{"version":3,"file":"static/js/main.1b0c792e.js","sources":["config/assets/NavigationAssets/admin.svg","config/assets/NavigationAssets/botWb.svg","config/assets/NavigationAssets/company.svg","config/assets/NavigationAssets/dashboard.svg","config/assets/NavigationAssets/inbox.svg","config/assets/NavigationAssets/knowledge.svg","config/assets/NavigationAssets/openings.svg","screen/UserPortal/Campaigns/Assets/condition.svg","screen/UserPortal/Campaigns/Assets/sandClock.svg","screen/UserPortal/Campaigns/Assets/thunder.svg","screen/UserPortal/WorkbenchV2/images/handlerIcon.svg","App.js","action/AccountVariables.js","action/AdminActions.js","action/AgentAction.js","action/CampaignAction.js","action/ContactAction.js","action/ContentAction.js","action/ConvAction.js","action/FileAction.js","action/LogonAction.js","action/MessageAction.js","action/NotificationActions.js","action/OpeningsAction.js","action/SocketAction.js","action/Subscription.js","action/TagAction.js","action/TemplateAction.js","action/UserActions.js","action/WorkbenchAction.js","component/Avatar/index.jsx","../node_modules/antd/es/badge/utils.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","component/Badge/index.jsx","component/Button/index.jsx","component/Card/index.jsx","../node_modules/rc-image/es/PreviewGroup.js","../node_modules/rc-image/es/Operations.js","../node_modules/rc-image/es/previewConfig.js","../node_modules/rc-image/es/hooks/useImageTransform.js","../node_modules/rc-image/es/getFixScaleEleTransPosition.js","../node_modules/rc-image/es/Preview.js","../node_modules/rc-image/es/Image.js","../node_modules/rc-image/es/index.js","../node_modules/@ant-design/icons-svg/es/asn/RotateLeftOutlined.js","../node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/RotateRightOutlined.js","../node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ZoomInOutlined.js","../node_modules/@ant-design/icons/es/icons/ZoomInOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ZoomOutOutlined.js","../node_modules/@ant-design/icons/es/icons/ZoomOutOutlined.js","../node_modules/antd/es/image/PreviewGroup.js","../node_modules/antd/es/image/index.js","../node_modules/@ant-design/icons-svg/es/asn/RedoOutlined.js","../node_modules/@ant-design/icons/es/icons/RedoOutlined.js","component/Chat/index.jsx","component/Checkbox/index.jsx","component/Col/index.jsx","../node_modules/rc-collapse/es/PanelContent.js","../node_modules/rc-collapse/es/Panel.js","../node_modules/rc-collapse/es/Collapse.js","../node_modules/rc-collapse/es/index.js","../node_modules/antd/es/collapse/Collapse.js","../node_modules/antd/es/collapse/CollapsePanel.js","../node_modules/antd/es/collapse/index.js","component/Collapse/index.jsx","../node_modules/rc-picker/es/generate/moment.js","../node_modules/@ant-design/icons-svg/es/asn/CalendarOutlined.js","../node_modules/@ant-design/icons/es/icons/CalendarOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ClockCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/SwapRightOutlined.js","../node_modules/@ant-design/icons/es/icons/SwapRightOutlined.js","../node_modules/rc-picker/es/PanelContext.js","../node_modules/rc-picker/es/panels/Header.js","../node_modules/rc-picker/es/panels/DecadePanel/DecadeHeader.js","../node_modules/rc-picker/es/utils/timeUtil.js","../node_modules/rc-picker/es/panels/PanelBody.js","../node_modules/rc-picker/es/panels/DecadePanel/DecadeBody.js","../node_modules/rc-picker/es/utils/uiUtil.js","../node_modules/rc-picker/es/panels/DecadePanel/index.js","../node_modules/rc-picker/es/utils/dateUtil.js","../node_modules/rc-picker/es/panels/TimePanel/TimeHeader.js","../node_modules/rc-picker/es/utils/miscUtil.js","../node_modules/rc-picker/es/panels/TimePanel/TimeUnitColumn.js","../node_modules/rc-picker/es/panels/TimePanel/TimeBody.js","../node_modules/rc-picker/es/hooks/useTimeSelection.js","../node_modules/rc-picker/es/panels/TimePanel/index.js","../node_modules/rc-picker/es/RangeContext.js","../node_modules/rc-picker/es/hooks/useCellClassName.js","../node_modules/rc-picker/es/panels/DatePanel/DateBody.js","../node_modules/rc-picker/es/panels/DatePanel/DateHeader.js","../node_modules/rc-picker/es/panels/DatePanel/index.js","../node_modules/rc-picker/es/panels/DatetimePanel/index.js","../node_modules/rc-picker/es/panels/WeekPanel/index.js","../node_modules/rc-picker/es/panels/MonthPanel/MonthHeader.js","../node_modules/rc-picker/es/panels/MonthPanel/MonthBody.js","../node_modules/rc-picker/es/panels/MonthPanel/index.js","../node_modules/rc-picker/es/panels/QuarterPanel/QuarterHeader.js","../node_modules/rc-picker/es/panels/QuarterPanel/QuarterBody.js","../node_modules/rc-picker/es/panels/QuarterPanel/index.js","../node_modules/rc-picker/es/panels/YearPanel/YearHeader.js","../node_modules/rc-picker/es/panels/YearPanel/YearBody.js","../node_modules/rc-picker/es/panels/YearPanel/index.js","../node_modules/rc-picker/es/utils/getExtraFooter.js","../node_modules/rc-picker/es/utils/getRanges.js","../node_modules/rc-picker/es/PickerPanel.js","../node_modules/rc-picker/es/PickerTrigger.js","../node_modules/rc-picker/es/hooks/usePickerInput.js","../node_modules/rc-picker/es/hooks/useTextValueMapping.js","../node_modules/rc-picker/es/hooks/useValueTexts.js","../node_modules/rc-picker/es/hooks/useHoverValue.js","../node_modules/rc-picker/es/Picker.js","../node_modules/rc-picker/es/hooks/useRangeViewDates.js","../node_modules/rc-picker/es/RangePicker.js","../node_modules/rc-picker/es/hooks/useRangeDisabled.js","../node_modules/rc-picker/es/index.js","../node_modules/antd/es/date-picker/util.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/date-picker/PickerButton.js","../node_modules/antd/es/date-picker/PickerTag.js","../node_modules/antd/es/date-picker/index.js","../node_modules/antd/es/time-picker/index.js","component/DatePicker/index.jsx","component/Divider/index.jsx","../node_modules/react-dnd/dist/esm/internals/registration.js","../node_modules/react-dnd/dist/esm/internals/DropTargetMonitorImpl.js","../node_modules/@react-dnd/shallowequal/src/index.ts","../node_modules/react-dnd/dist/esm/internals/wrapConnectorHooks.js","../node_modules/react-dnd/dist/esm/internals/isRef.js","../node_modules/react-dnd/dist/esm/internals/TargetConnector.js","../node_modules/react-dnd/dist/esm/decorators/utils.js","../node_modules/react-dnd/dist/esm/decorators/disposables.js","../node_modules/react-dnd/dist/esm/decorators/decorateHandler.js","../node_modules/react-dnd/dist/esm/decorators/createTargetFactory.js","component/Dropable/index.jsx","../node_modules/react-dnd/dist/esm/decorators/DropTarget.js","component/Dropdown/index.jsx","component/Empty/index.jsx","component/FacebookConnect/index.js","component/Form/index.jsx","component/InfoBox/index.jsx","../node_modules/@ant-design/icons-svg/es/asn/UpOutlined.js","../node_modules/@ant-design/icons/es/icons/UpOutlined.js","../node_modules/rc-input-number/es/utils/supportUtil.js","../node_modules/rc-input-number/es/utils/numberUtil.js","../node_modules/rc-input-number/es/utils/MiniDecimal.js","../node_modules/rc-input-number/es/StepHandler.js","../node_modules/rc-input-number/es/InputNumber.js","../node_modules/rc-input-number/es/hooks/useCursor.js","../node_modules/rc-input-number/es/hooks/useFrame.js","../node_modules/rc-input-number/es/index.js","../node_modules/antd/es/input-number/index.js","component/Input/index.jsx","../node_modules/antd/es/layout/index.js","component/Layout/index.jsx","component/Lottie/rootFile.js","component/Lottie/index.jsx","component/MarkdownEditor/SendButton.jsx","component/MarkdownEditor/index.jsx","component/Menu/index.jsx","component/Modal/index.jsx","component/OAuthPopup/index.js","component/Popover/index.js","component/Progress/index.jsx","component/Radio/index.jsx","component/Row/index.jsx","../node_modules/rc-tree-select/es/LegacyContext.js","../node_modules/rc-tree-select/es/TreeSelectContext.js","../node_modules/rc-tree-select/es/utils/valueUtil.js","../node_modules/rc-tree-select/es/OptionList.js","../node_modules/rc-tree-select/es/TreeNode.js","../node_modules/rc-tree-select/es/utils/strategyUtil.js","../node_modules/rc-tree-select/es/utils/legacyUtil.js","../node_modules/rc-tree-select/es/hooks/useTreeData.js","../node_modules/rc-tree-select/es/hooks/useRefFunc.js","../node_modules/rc-tree-select/es/TreeSelect.js","../node_modules/rc-tree-select/es/hooks/useDataEntities.js","../node_modules/rc-tree-select/es/hooks/useFilterTreeData.js","../node_modules/rc-tree-select/es/hooks/useCheckedKeys.js","../node_modules/rc-tree-select/es/hooks/useCache.js","../node_modules/rc-tree-select/es/index.js","../node_modules/antd/es/tree-select/index.js","component/Select/index.jsx","component/Skeleton/index.jsx","component/Spin/index.jsx","component/StageChangeConfirm/additionalContent.jsx","component/StageChangeConfirm/index.js","../node_modules/rc-steps/es/Step.js","../node_modules/rc-steps/es/Steps.js","../node_modules/rc-steps/es/index.js","../node_modules/antd/es/steps/index.js","../node_modules/antd/es/steps/useLegacyItems.js","component/Steps/index.jsx","../node_modules/rc-switch/es/index.js","../node_modules/antd/es/switch/index.js","component/Switch/index.jsx","../node_modules/rc-table/es/sugar/ColumnGroup.js","../node_modules/rc-table/es/sugar/Column.js","../node_modules/rc-table/es/utils/valueUtil.js","../node_modules/rc-table/es/context/StickyContext.js","../node_modules/rc-table/es/context/HoverContext.js","../node_modules/rc-table/es/ContextSelector/index.js","../node_modules/rc-table/es/context/BodyContext.js","../node_modules/rc-table/es/context/PerfContext.js","../node_modules/rc-table/es/Cell/index.js","../node_modules/rc-table/es/context/TableContext.js","../node_modules/rc-table/es/utils/fixUtil.js","../node_modules/rc-table/es/Header/HeaderRow.js","../node_modules/rc-table/es/Header/Header.js","../node_modules/rc-table/es/context/ExpandedRowContext.js","../node_modules/rc-table/es/Body/ExpandedRow.js","../node_modules/rc-table/es/context/ResizeContext.js","../node_modules/rc-table/es/Body/BodyRow.js","../node_modules/rc-table/es/hooks/useFlattenRecords.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/constant.js","../node_modules/rc-table/es/hooks/useColumns.js","../node_modules/rc-table/es/hooks/useFrame.js","../node_modules/rc-table/es/hooks/useStickyOffsets.js","../node_modules/rc-table/es/ColGroup.js","../node_modules/rc-table/es/Panel/index.js","../node_modules/rc-table/es/Footer/SummaryContext.js","../node_modules/rc-table/es/Footer/Row.js","../node_modules/rc-table/es/Footer/Summary.js","../node_modules/rc-table/es/Footer/Cell.js","../node_modules/rc-table/es/Footer/index.js","../node_modules/rc-table/es/utils/expandUtil.js","../node_modules/rc-table/es/stickyScrollBar.js","../node_modules/rc-table/es/hooks/useSticky.js","../node_modules/rc-table/es/FixedHolder/index.js","../node_modules/rc-table/es/Table.js","../node_modules/rc-table/es/index.js","../node_modules/antd/es/_util/getScroll.js","../node_modules/antd/es/_util/scrollTo.js","../node_modules/antd/es/_util/easings.js","../node_modules/antd/es/table/Column.js","../node_modules/antd/es/table/ColumnGroup.js","../node_modules/antd/es/table/ExpandIcon.js","../node_modules/antd/es/table/util.js","../node_modules/@ant-design/icons-svg/es/asn/FilterFilled.js","../node_modules/@ant-design/icons/es/icons/FilterFilled.js","../node_modules/@ant-design/icons-svg/es/asn/HolderOutlined.js","../node_modules/@ant-design/icons/es/icons/HolderOutlined.js","../node_modules/antd/es/tree/utils/dropIndicator.js","../node_modules/antd/es/tree/Tree.js","../node_modules/@ant-design/icons-svg/es/asn/FolderOpenOutlined.js","../node_modules/@ant-design/icons/es/icons/FolderOpenOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/FolderOutlined.js","../node_modules/@ant-design/icons/es/icons/FolderOutlined.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/_util/hooks/useSyncState.js","../node_modules/antd/es/table/hooks/useFilter/index.js","../node_modules/antd/es/table/hooks/usePagination.js","../node_modules/antd/es/table/hooks/useSelection.js","../node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js","../node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/CaretUpOutlined.js","../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/Table.js","../node_modules/antd/es/table/hooks/useLazyKVMap.js","../node_modules/antd/es/table/index.js","component/Table/index.jsx","component/Tabs/index.jsx","component/Tag/index.jsx","component/TagsSearch/index.js","component/Tooltip/index.js","../node_modules/antd/es/_util/transButton.js","../node_modules/@ant-design/icons-svg/es/asn/EnterOutlined.js","../node_modules/@ant-design/icons/es/icons/EnterOutlined.js","../node_modules/antd/es/typography/Editable.js","../node_modules/antd/es/typography/hooks/useMergedConfig.js","../node_modules/antd/es/typography/hooks/useUpdatedEffect.js","../node_modules/antd/es/typography/Typography.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","component/Typography/index.jsx","../node_modules/rc-upload/es/request.js","../node_modules/rc-upload/es/uid.js","../node_modules/rc-upload/es/attr-accept.js","../node_modules/rc-upload/es/traverseFileTree.js","../node_modules/rc-upload/es/AjaxUploader.js","../node_modules/rc-upload/es/Upload.js","../node_modules/rc-upload/es/index.js","../node_modules/@ant-design/icons-svg/es/asn/FileTwoTone.js","../node_modules/@ant-design/icons/es/icons/FileTwoTone.js","../node_modules/@ant-design/icons-svg/es/asn/PictureTwoTone.js","../node_modules/@ant-design/icons/es/icons/PictureTwoTone.js","../node_modules/antd/es/upload/utils.js","../node_modules/@ant-design/icons-svg/es/asn/DownloadOutlined.js","../node_modules/@ant-design/icons/es/icons/DownloadOutlined.js","../node_modules/antd/es/upload/UploadList/ListItem.js","../node_modules/antd/es/upload/UploadList/index.js","../node_modules/antd/es/upload/Upload.js","../node_modules/antd/es/upload/Dragger.js","../node_modules/antd/es/upload/index.js","component/Upload/index.jsx","config/PrivateRoutesConfig.js","config/Roles.js","config/config.js","constant/app.constant.js","constant/index.js","../node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js","helper/fingerprintHelper.js","helper/networkClient.js","../node_modules/@formatjs/intl/lib/src/message.js","../node_modules/@formatjs/intl/lib/src/number.js","../node_modules/@formatjs/intl/lib/src/relativeTime.js","../node_modules/@formatjs/intl/lib/src/dateTime.js","../node_modules/@formatjs/intl/lib/src/plural.js","../node_modules/@formatjs/intl/lib/src/list.js","../node_modules/@formatjs/intl/lib/src/displayName.js","../node_modules/@formatjs/intl/lib/src/create-intl.js","../node_modules/react-intl/lib/src/components/provider.js","i18n/locales.js","i18n/language/index.js","i18n/language/en-US.js","i18n/language/bn-IN.js","i18n/provider.js","i18n/translateText.js","index.js","reportWebVitals.js","screen/SignOn/LogIn/Login.validation.js","screen/SignOn/LogIn/Container.jsx","screen/SignOn/LogIn/unvarified.jsx","screen/SignOn/LogIn/index.jsx","screen/ResetPassword/index.js","screen/SignOn/LogIn/forgetPass.jsx","screen/SignOn/LogIn/outhRedirect.jsx","route/PublicRoutes.js","route/Auth.js","route/MapAllowedRoutes.js","route/PrivateRoutes.js","route/index.js","screen/Common/DatePickerComp.js","../node_modules/mixpanel-browser/dist/mixpanel.module.js","screen/Common/Sidebar.jsx","../node_modules/engine.io-parser/build/esm/commons.js","../node_modules/engine.io-parser/build/esm/encodePacket.browser.js","../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js","../node_modules/engine.io-parser/build/esm/decodePacket.browser.js","../node_modules/engine.io-parser/build/esm/index.js","../node_modules/@socket.io/component-emitter/lib/esm/index.js","../node_modules/engine.io-client/build/esm/globalThis.browser.js","../node_modules/engine.io-client/build/esm/util.js","../node_modules/engine.io-client/build/esm/transport.js","../node_modules/engine.io-client/build/esm/contrib/parseqs.js","../node_modules/engine.io-client/build/esm/contrib/yeast.js","../node_modules/engine.io-client/build/esm/contrib/has-cors.js","../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js","../node_modules/engine.io-client/build/esm/transports/polling.js","../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js","../node_modules/engine.io-client/build/esm/transports/websocket.js","../node_modules/engine.io-client/build/esm/transports/index.js","../node_modules/engine.io-client/build/esm/transports/webtransport.js","../node_modules/engine.io-client/build/esm/contrib/parseuri.js","../node_modules/engine.io-client/build/esm/socket.js","../node_modules/engine.io-client/build/esm/index.js","../node_modules/socket.io-parser/build/esm/is-binary.js","../node_modules/socket.io-parser/build/esm/binary.js","../node_modules/socket.io-parser/build/esm/index.js","../node_modules/socket.io-client/build/esm/on.js","../node_modules/socket.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/contrib/backo2.js","../node_modules/socket.io-client/build/esm/manager.js","../node_modules/socket.io-client/build/esm/index.js","../node_modules/socket.io-client/build/esm/url.js","../node_modules/@ant-design/icons-svg/es/asn/SmileOutlined.js","../node_modules/@ant-design/icons/es/icons/SmileOutlined.js","screen/Common/SocketWrapper.jsx","screen/Common/Workspace.jsx","action/TenantAction.js","screen/Common/Wrapper.jsx","screen/DummyScreen.jsx","screen/Error/NotFound404/index.jsx","screen/SignOn/Logout.js","screen/UserPortal/Admin/CandidateForm/CreateCustomFields.jsx","screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppBusinessAccRedirect.js","screen/UserPortal/Admin/Users/index.js","screen/UserPortal/Admin/Connected/Sms/index.js","screen/UserPortal/Admin/Connected/Email/index.js","screen/UserPortal/Admin/Connected/Facebook/index.js","screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppOnboard/MetaConnect.jsx","screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppOnboard/MetaWABA_numbers.jsx","screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppOnboard/StoreSteps.js","screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppOnboard/index.jsx","screen/UserPortal/Admin/Connected/Whatsapp/index.js","screen/UserPortal/Admin/Connected/Tabs.jsx","screen/UserPortal/Admin/Connected/index.jsx","screen/UserPortal/Admin/Integrations/Calendar/index.jsx","screen/UserPortal/Admin/Integrations/Tabs.jsx","screen/UserPortal/Admin/Integrations/index.js","screen/UserPortal/Admin/LanguageSettings/index.js","screen/UserPortal/Admin/NotificationSettings/index.jsx","screen/UserPortal/Admin/SideBar.js","screen/UserPortal/Admin/Users/AddUser.validation.js","screen/UserPortal/Admin/Users/AddNew.js","screen/UserPortal/Admin/Users/ViewData.js","screen/UserPortal/Admin/Users/UserData.js","screen/UserPortal/Admin/Connected/Sms/AddNewNumber.js","screen/UserPortal/Admin/Connected/ShareWith/ShareWithModal.js","screen/UserPortal/Admin/Connected/ShareWith/index.js","screen/UserPortal/Admin/Connected/Sms/ViewNumber.js","screen/UserPortal/Admin/Connected/Sms/SideBarData.js","component/OauthComponent/index.js","screen/UserPortal/Admin/Connected/Email/EmaliAccountLIst.js","screen/UserPortal/Admin/Connected/Email/AddEmail.js","screen/UserPortal/Admin/Connected/Email/Signature.jsx","screen/UserPortal/Admin/Connected/Email/ViewEmail.js","screen/UserPortal/Admin/Connected/Email/SideBarData.js","screen/UserPortal/Admin/Connected/Facebook/ViewMeta.js","screen/UserPortal/Admin/Connected/Facebook/SideBarData.js","screen/UserPortal/Admin/Connected/Whatsapp/AddWhatsapp.jsx","screen/UserPortal/Admin/Connected/Whatsapp/ViewWhatsapp.jsx","screen/UserPortal/Admin/Connected/Whatsapp/ConnectWhatsapp.jsx","screen/UserPortal/Admin/Connected/Whatsapp/SideBarData.js","screen/UserPortal/Admin/Connected/Google/SideBarData.js","screen/UserPortal/Admin/Connected/ConnectedData.js","screen/UserPortal/Admin/Integrations/Calendar/AddCalendar.jsx","screen/UserPortal/Admin/Integrations/Calendar/ViewCalander.jsx","screen/UserPortal/Admin/Integrations/Calendar/SidebarData.js","screen/UserPortal/Admin/Integrations/IntegrationData.js","screen/UserPortal/Admin/LanguageSettings/AddNew.js","screen/UserPortal/Admin/LanguageSettings/LanguageData.js","screen/UserPortal/Admin/SideBarData.jsx","screen/UserPortal/Admin/CandidateForm/index.jsx","screen/UserPortal/Admin/OrganizationSettings/index.jsx","screen/UserPortal/Admin/AccountVariableDefinitions/index.js","screen/UserPortal/Admin/StageConfiguration/index.jsx","screen/UserPortal/Admin/QuestionnaireConfiguration/index.js","screen/UserPortal/Admin/TrackerConfiguration/TrackerMain.js","screen/UserPortal/Admin/TrackerConfiguration/candidateTracker.js","screen/UserPortal/Admin/TrackerConfiguration/trackerTabs.js","screen/UserPortal/Admin/TrackerConfiguration/index.js","screen/UserPortal/Admin/index.jsx","screen/UserPortal/Admin/whatsappStore/createStore/connectFacebook.jsx","component/OauthShopify/index.js","screen/UserPortal/Admin/whatsappStore/createStore/connectShopify.jsx","../node_modules/@ant-design/icons-svg/es/asn/ReadOutlined.js","../node_modules/@ant-design/icons/es/icons/ReadOutlined.js","screen/UserPortal/Admin/whatsappStore/createStore/bussinessInfo.jsx","screen/UserPortal/Admin/whatsappStore/createStore/selectCollections.jsx","screen/UserPortal/Admin/whatsappStore/createStore/selectProducts.jsx","screen/UserPortal/Admin/whatsappStore/createStore/StoreSteps.jsx","screen/UserPortal/Admin/whatsappStore/createStore/index.js","screen/UserPortal/Admin/whatsappStore/listStore/StoreComponent.jsx","screen/UserPortal/Admin/whatsappStore/listStore/index.js","screen/UserPortal/Admin/whatsappStore/listStore/SiderData.jsx","screen/UserPortal/Admin/whatsappStore/index.js","screen/UserPortal/Campaigns/CampEdge/TagComponent.js","../node_modules/@ant-design/icons-svg/es/asn/MessageFilled.js","../node_modules/@ant-design/icons/es/icons/MessageFilled.js","screen/UserPortal/Campaigns/CampEdge/CustomAction.js","screen/UserPortal/Campaigns/CampEdge/CustomCondtions/CustomForm.js","screen/UserPortal/Campaigns/CampEdge/CustomCondtions/CustomCondition.js","screen/UserPortal/Campaigns/CampEdge/CustomCondtions/utils.js","screen/UserPortal/Campaigns/CampEdge/CustomDelay.js","screen/UserPortal/Campaigns/CampNodes/ActionNode.js","screen/UserPortal/Campaigns/CampNodes/ConditionNode.js","screen/UserPortal/Campaigns/CampNodes/DelayNode.js","screen/UserPortal/Campaigns/CampNodes/EndNode.js","screen/UserPortal/Campaigns/Assets/deleteicon.svg","screen/UserPortal/Campaigns/CampNodes/NodeContainer.js","screen/UserPortal/Campaigns/Assets/cal.svg","screen/UserPortal/Campaigns/CampNodes/StartNode.js","screen/UserPortal/Campaigns/CampaignCreate.jsx","screen/UserPortal/Campaigns/CampaignCreateEvent.jsx","screen/UserPortal/Campaigns/CampaignPlans.jsx","../node_modules/@reactflow/background/dist/esm/index.mjs","screen/UserPortal/Campaigns/CampEdge/CustomSelect.js","../node_modules/@gilbarbara/deep-equal/src/helpers.ts","../node_modules/@gilbarbara/deep-equal/src/index.ts","../node_modules/react-joyride/node_modules/is-lite/src/helpers.ts","../node_modules/react-joyride/node_modules/is-lite/src/index.ts","../node_modules/tree-changes/node_modules/is-lite/src/helpers.ts","../node_modules/tree-changes/node_modules/is-lite/src/index.ts","../node_modules/tree-changes/src/helpers.ts","../node_modules/tree-changes/src/index.ts","../node_modules/popper.js/src/utils/isBrowser.js","../node_modules/popper.js/src/utils/debounce.js","../node_modules/popper.js/src/utils/isFunction.js","../node_modules/popper.js/src/utils/getStyleComputedProperty.js","../node_modules/popper.js/src/utils/getParentNode.js","../node_modules/popper.js/src/utils/getScrollParent.js","../node_modules/popper.js/src/utils/getReferenceNode.js","../node_modules/popper.js/src/utils/isIE.js","../node_modules/popper.js/src/utils/getOffsetParent.js","../node_modules/popper.js/src/utils/getRoot.js","../node_modules/popper.js/src/utils/findCommonOffsetParent.js","../node_modules/popper.js/src/utils/isOffsetContainer.js","../node_modules/popper.js/src/utils/getScroll.js","../node_modules/popper.js/src/utils/getBordersSize.js","../node_modules/popper.js/src/utils/getWindowSizes.js","../node_modules/popper.js/src/utils/getClientRect.js","../node_modules/popper.js/src/utils/getBoundingClientRect.js","../node_modules/popper.js/src/utils/getOffsetRectRelativeToArbitraryNode.js","../node_modules/popper.js/src/utils/includeScroll.js","../node_modules/popper.js/src/utils/isFixed.js","../node_modules/popper.js/src/utils/getFixedPositionOffsetParent.js","../node_modules/popper.js/src/utils/getBoundaries.js","../node_modules/popper.js/src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","../node_modules/popper.js/src/utils/computeAutoPlacement.js","../node_modules/popper.js/src/utils/getReferenceOffsets.js","../node_modules/popper.js/src/utils/getOuterSizes.js","../node_modules/popper.js/src/utils/getOppositePlacement.js","../node_modules/popper.js/src/utils/getPopperOffsets.js","../node_modules/popper.js/src/utils/find.js","../node_modules/popper.js/src/utils/runModifiers.js","../node_modules/popper.js/src/utils/findIndex.js","../node_modules/popper.js/src/methods/update.js","../node_modules/popper.js/src/utils/isModifierEnabled.js","../node_modules/popper.js/src/utils/getSupportedPropertyName.js","../node_modules/popper.js/src/methods/destroy.js","../node_modules/popper.js/src/utils/getWindow.js","../node_modules/popper.js/src/utils/setupEventListeners.js","../node_modules/popper.js/src/methods/enableEventListeners.js","../node_modules/popper.js/src/methods/disableEventListeners.js","../node_modules/popper.js/src/utils/removeEventListeners.js","../node_modules/popper.js/src/utils/isNumeric.js","../node_modules/popper.js/src/utils/setStyles.js","../node_modules/popper.js/src/modifiers/computeStyle.js","../node_modules/popper.js/src/utils/isModifierRequired.js","../node_modules/popper.js/src/methods/placements.js","../node_modules/popper.js/src/utils/clockwise.js","../node_modules/popper.js/src/modifiers/flip.js","../node_modules/popper.js/src/modifiers/offset.js","../node_modules/popper.js/src/modifiers/index.js","../node_modules/popper.js/src/modifiers/shift.js","../node_modules/popper.js/src/modifiers/preventOverflow.js","../node_modules/popper.js/src/modifiers/keepTogether.js","../node_modules/popper.js/src/modifiers/arrow.js","../node_modules/popper.js/src/utils/getOppositeVariation.js","../node_modules/popper.js/src/modifiers/inner.js","../node_modules/popper.js/src/modifiers/hide.js","../node_modules/popper.js/src/utils/getRoundedOffsets.js","../node_modules/popper.js/src/modifiers/applyStyle.js","../node_modules/popper.js/src/utils/setAttributes.js","../node_modules/popper.js/src/methods/defaults.js","../node_modules/popper.js/src/index.js","../node_modules/is-lite/src/index.ts","../node_modules/react-floater/node_modules/@gilbarbara/deep-equal/src/helpers.ts","../node_modules/react-floater/node_modules/@gilbarbara/deep-equal/src/index.ts","../node_modules/react-floater/node_modules/tree-changes/src/helpers.ts","../node_modules/react-floater/es/index.js","../node_modules/react-floater/node_modules/tree-changes/src/index.ts","../node_modules/react-joyride/src/literals/index.ts","../node_modules/react-joyride/src/modules/dom.ts","../node_modules/react-joyride/src/modules/helpers.ts","../node_modules/react-joyride/src/defaults.ts","../node_modules/react-joyride/src/styles.ts","../node_modules/react-joyride/src/modules/step.ts","../node_modules/react-joyride/src/modules/store.ts","../node_modules/react-joyride/src/components/Spotlight.tsx","../node_modules/react-joyride/src/components/Overlay.tsx","../node_modules/react-joyride/src/components/Portal.tsx","../node_modules/react-joyride/src/modules/scope.ts","../node_modules/react-joyride/src/components/Beacon.tsx","../node_modules/react-joyride/src/components/Tooltip/CloseButton.tsx","../node_modules/react-joyride/src/components/Tooltip/Container.tsx","../node_modules/react-joyride/src/components/Tooltip/index.tsx","../node_modules/react-joyride/src/components/Step.tsx","../node_modules/react-joyride/src/components/index.tsx","screen/UserPortal/Campaigns/CampEdge/CustomEdge.js","screen/UserPortal/Campaigns/CampaignView.jsx","screen/UserPortal/Campaigns/Helper/ViewTemplate.jsx","screen/UserPortal/Campaigns/Helper/getLayoutedElements.js","screen/UserPortal/Campaigns/CampaignUpdate.jsx","screen/UserPortal/Campaigns/SideBarData.js","../node_modules/@ant-design/icons-svg/es/asn/NotificationOutlined.js","../node_modules/@ant-design/icons/es/icons/NotificationOutlined.js","screen/UserPortal/Campaigns/SideBar.js","screen/UserPortal/Campaigns/CampaignList.jsx","screen/UserPortal/Campaigns/CampaignCreateSelector.jsx","screen/UserPortal/Campaigns/CampaignPlansStatus.jsx","screen/UserPortal/Campaigns/index.js","screen/UserPortal/Communication/Common/AttachmentContainer/index.jsx","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatAccountLocked/index.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/AppstoreAddOutlined.js","../node_modules/@ant-design/icons/es/icons/AppstoreAddOutlined.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatTabs/index.js","component/PreviewLive/index.jsx","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/Compose.js","../node_modules/antd/es/timeline/TimelineItem.js","../node_modules/antd/es/timeline/Timeline.js","../node_modules/antd/es/timeline/index.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/ReplyThread.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaMeta/index.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaSms/index.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaWeb/index.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaWhatsapp/index.js","screen/UserPortal/Communication/Common/ChatOnlyInbox/Modals/index.jsx","screen/UserPortal/Communication/Common/ChatOnlyInbox/index.jsx","screen/UserPortal/Communication/Common/ContentContainer/index.jsx","screen/UserPortal/Communication/Common/LeftSideBar/Filter.jsx","screen/UserPortal/Communication/Common/LeftSideBar/FilterTags.js","screen/UserPortal/Communication/Common/LeftSideBar/ConvList.jsx","screen/UserPortal/Communication/Common/LeftSideBar/InboxSidebar.js","screen/UserPortal/Communication/Common/RenderMessage/index.js","screen/UserPortal/Communication/Common/ToolBar/Info/index.jsx","screen/UserPortal/Communication/Common/ToolBar/Thread.js","screen/UserPortal/Communication/Common/ToolBar/index.jsx","screen/UserPortal/Communication/Common/TopBar/index.jsx","screen/UserPortal/Communication/Inbox/index.jsx","screen/UserPortal/Company/AddCompany.jsx","screen/UserPortal/Company/CompanyCard.jsx","screen/UserPortal/Company/index.js","screen/UserPortal/Dashboard/Config.js","action/DashboardActions.js","action/PaymentAction.js","screen/UserPortal/Dashboard/index.jsx","screen/UserPortal/Knowledge/Common/LeftSideBar/index.jsx","screen/UserPortal/Knowledge/EmailTemplate/EmailTemplateCreate.jsx","screen/UserPortal/Knowledge/EmailTemplate/EmailTemplateEdit.jsx","screen/UserPortal/Knowledge/EmailTemplate/PreviewTemplate.jsx","screen/UserPortal/Knowledge/EmailTemplate/index.jsx","screen/UserPortal/Knowledge/SmsTemplate/open.svg","screen/UserPortal/Knowledge/SmsTemplate/PreviewTemplate.jsx","screen/UserPortal/Knowledge/SmsTemplate/SmsTemplateCreate.jsx","screen/UserPortal/Knowledge/SmsTemplate/index.js","screen/UserPortal/Knowledge/Template/CreateTemplate/open.svg","screen/UserPortal/Knowledge/Template/CreateTemplate/Preview.jsx","../node_modules/@ant-design/icons-svg/es/asn/BellOutlined.js","../node_modules/@ant-design/icons/es/icons/BellOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/LockOutlined.js","../node_modules/@ant-design/icons/es/icons/LockOutlined.js","screen/UserPortal/Knowledge/Template/CreateTemplate/NewTemplate.jsx","screen/UserPortal/Knowledge/Template/CreateTemplate/SampleModal.jsx","screen/UserPortal/Knowledge/Template/CreateTemplate/EditTemplate.jsx","screen/UserPortal/Knowledge/Template/CreateTemplate/LanguageSettings.js","screen/UserPortal/Knowledge/Template/CreateTemplate/index.jsx","screen/UserPortal/Knowledge/Template/Helper/TagColor.jsx","screen/UserPortal/Knowledge/Template/ListTemplate/ImportTemplates.jsx","../node_modules/@ant-design/icons-svg/es/asn/SyncOutlined.js","../node_modules/@ant-design/icons/es/icons/SyncOutlined.js","screen/UserPortal/Knowledge/Template/ListTemplate/TemplateFilter.jsx","screen/UserPortal/Knowledge/Template/ListTemplate/index.jsx","screen/UserPortal/Openings/AddCandidate/index.jsx","screen/UserPortal/Openings/AddPosition/QualifierQuestions.jsx","screen/UserPortal/Openings/AddPosition/ShareJob.jsx","screen/UserPortal/Openings/AddPosition/Position.jsx","component/AiPrompt/index.jsx","component/TextExtract/index.jsx","screen/UserPortal/Openings/AddPosition/JobDescription.jsx","screen/UserPortal/Openings/AddPosition/BotSelection.jsx","screen/UserPortal/Openings/AddPosition/index.jsx","screen/UserPortal/Openings/AddWorkflow/index.js","screen/UserPortal/Openings/DuplicateCandidateAlert/index.js","screen/UserPortal/Openings/ImportContact/StepTwo.jsx","screen/UserPortal/Openings/ImportContact/ImportCandidate.jsx","screen/UserPortal/Openings/OpeningsCandidateDetails.js","screen/UserPortal/Openings/OpeningsDetails.js","screen/UserPortal/Openings/SettingsSideBar.js","screen/UserPortal/Openings/SettingsGeneal.js","screen/UserPortal/Openings/OpeningVariables.jsx","screen/UserPortal/Openings/RecruiterSignature.jsx","screen/UserPortal/Openings/Settings.js","component/StageChangeConfirm/bulkUpdate.js","screen/UserPortal/Openings/SubmissionsReport/SubmissionTemplate.jsx","screen/UserPortal/Openings/SubmissionsReport/ProcessCV.jsx","screen/UserPortal/Openings/SubmissionsReport/index.js","screen/UserPortal/Openings/CandidateListing/utils.js","screen/UserPortal/Openings/CandidateListing/Candidates.js","../node_modules/@ant-design/icons-svg/es/asn/HistoryOutlined.js","../node_modules/@ant-design/icons/es/icons/HistoryOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ArrowLeftOutlined.js","../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/RadiusSettingOutlined.js","../node_modules/@ant-design/icons/es/icons/RadiusSettingOutlined.js","screen/UserPortal/Openings/AddPosition/CloneWorkflow.jsx","screen/UserPortal/Openings/Sequences.js","screen/UserPortal/Openings/OpeningsNote.jsx","screen/UserPortal/Openings/OpeningsDetailsTabs.js","screen/UserPortal/Openings/SettingsSequences.js","screen/UserPortal/Openings/SideBarView/CandidateAttachmentTab.jsx","../node_modules/@babel/runtime/helpers/esm/callSuper.js","../node_modules/uncontrollable/lib/esm/utils.js","../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../node_modules/clsx/dist/clsx.m.js","../node_modules/date-arithmetic/index.js","../node_modules/dom-helpers/esm/ownerDocument.js","../node_modules/dom-helpers/esm/getComputedStyle.js","../node_modules/dom-helpers/esm/ownerWindow.js","../node_modules/dom-helpers/esm/hyphenate.js","../node_modules/dom-helpers/esm/hyphenateStyle.js","../node_modules/dom-helpers/esm/isTransform.js","../node_modules/dom-helpers/esm/css.js","../node_modules/dom-helpers/esm/contains.js","../node_modules/dom-helpers/esm/isWindow.js","../node_modules/dom-helpers/esm/isDocument.js","../node_modules/dom-helpers/esm/getScrollAccessor.js","../node_modules/dom-helpers/esm/scrollLeft.js","../node_modules/dom-helpers/esm/scrollTop.js","../node_modules/dom-helpers/esm/offset.js","../node_modules/dom-helpers/esm/offsetParent.js","../node_modules/dom-helpers/esm/position.js","../node_modules/dom-helpers/esm/canUseDOM.js","../node_modules/dom-helpers/esm/animationFrame.js","../node_modules/@restart/hooks/esm/useCallbackRef.js","../node_modules/@restart/hooks/esm/useMergedRefs.js","../node_modules/@restart/hooks/esm/useSafeState.js","../node_modules/@restart/hooks/esm/useMounted.js","../node_modules/react-overlays/esm/popper.js","../node_modules/react-overlays/esm/usePopper.js","../node_modules/dom-helpers/esm/addEventListener.js","../node_modules/dom-helpers/esm/removeEventListener.js","../node_modules/dom-helpers/esm/listen.js","../node_modules/@restart/hooks/esm/useCommittedRef.js","../node_modules/@restart/hooks/esm/useEventCallback.js","../node_modules/react-overlays/esm/ownerDocument.js","../node_modules/react-overlays/esm/safeFindDOMNode.js","../node_modules/react-overlays/esm/useRootClose.js","../node_modules/react-overlays/esm/useWaitForDOMRef.js","../node_modules/react-overlays/esm/mergeOptionsWithPopperConfig.js","../node_modules/react-overlays/esm/Overlay.js","../node_modules/dom-helpers/esm/height.js","../node_modules/dom-helpers/esm/querySelectorAll.js","../node_modules/dom-helpers/esm/matches.js","../node_modules/dom-helpers/esm/closest.js","../node_modules/memoize-one/dist/memoize-one.esm.js","../node_modules/dom-helpers/esm/scrollbarSize.js","../node_modules/dom-helpers/esm/width.js","../node_modules/dom-helpers/esm/removeClass.js","../node_modules/react-big-calendar/dist/react-big-calendar.esm.js","../node_modules/dom-helpers/esm/addClass.js","../node_modules/dom-helpers/esm/hasClass.js","../node_modules/uncontrollable/lib/esm/uncontrollable.js","../node_modules/@ant-design/icons-svg/es/asn/ExportOutlined.js","../node_modules/@ant-design/icons/es/icons/ExportOutlined.js","screen/UserPortal/Openings/SideBarView/CandidateInterviewScheduling.jsx","screen/UserPortal/Openings/SideBarView/CandidateStats/Assessment.js","screen/UserPortal/Openings/SideBarView/CandidateStats/Engagement.js","screen/UserPortal/Openings/SideBarView/CandidateStats/SequenceHistory.js","screen/UserPortal/Openings/SideBarView/CandidateViewActivityLogTab.jsx","screen/UserPortal/Openings/SideBarView/CandidateViewMessageTab.js","screen/UserPortal/Openings/SideBarView/CreateContact.jsx","screen/UserPortal/Openings/SideBarView/CandidateViewAssessTab.jsx","../node_modules/antd/es/list/Item.js","../node_modules/antd/es/list/index.js","../node_modules/antd/es/comment/index.js","component/Comments/index.js","screen/UserPortal/Openings/SideBarView/CandidateViewProfileTab.js","screen/UserPortal/Openings/SideBarView/CandidateViewResumeTab.jsx","screen/UserPortal/Openings/SideBarView/CandidatesView.js","screen/UserPortal/Openings/SideBardata.js","screen/UserPortal/Openings/StageChangeRequiredConfig.js","screen/UserPortal/Openings/SubmissionsReport/utils.js","../node_modules/@ant-design/icons-svg/es/asn/RetweetOutlined.js","../node_modules/@ant-design/icons/es/icons/RetweetOutlined.js","screen/UserPortal/Openings/OpeningDuplicate.jsx","screen/UserPortal/Openings/OpeningsListCard.jsx","screen/UserPortal/Openings/index.js","screen/UserPortal/WorkbenchV2/BotConfiguration/SideBar.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/botConfig/AddNewBot.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/botConfig/BotList.jsx","../node_modules/@ant-design/icons-svg/es/asn/EyeFilled.js","../node_modules/@ant-design/icons/es/icons/EyeFilled.js","../node_modules/@ant-design/icons-svg/es/asn/SaveFilled.js","../node_modules/@ant-design/icons/es/icons/SaveFilled.js","../node_modules/@ant-design/icons-svg/es/asn/CloseSquareFilled.js","../node_modules/@ant-design/icons/es/icons/CloseSquareFilled.js","screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/WebhookChart.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/WebhookList.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/WebhookView.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/index.jsx","screen/UserPortal/WorkbenchV2/BotConfiguration/index.jsx","../node_modules/react-json-editor-ajrm/es/themes.js","../node_modules/react-json-editor-ajrm/es/err.js","../node_modules/react-json-editor-ajrm/es/locale/index.js","../node_modules/react-json-editor-ajrm/es/locale/en.js","../node_modules/react-json-editor-ajrm/es/index.js","screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/WebhookCreate.jsx","screen/UserPortal/WorkbenchV2/images/home.svg","screen/UserPortal/WorkbenchV2/images/homeActive.svg","screen/UserPortal/WorkbenchV2/images/question.svg","screen/UserPortal/WorkbenchV2/images/contact.svg","screen/UserPortal/WorkbenchV2/images/hand.svg","screen/UserPortal/WorkbenchV2/images/build.svg","screen/UserPortal/WorkbenchV2/images/design.svg","screen/UserPortal/WorkbenchV2/images/configureWP.svg","screen/UserPortal/WorkbenchV2/images/light.svg","screen/UserPortal/WorkbenchV2/images/graph.svg","screen/UserPortal/WorkbenchV2/images/AI.svg","screen/UserPortal/WorkbenchV2/images/settings.svg","screen/UserPortal/WorkbenchV2/images/clock.svg","screen/UserPortal/WorkbenchV2/images/more.svg","screen/UserPortal/WorkbenchV2/images/check.svg","screen/UserPortal/WorkbenchV2/images/closeDrw.svg","screen/UserPortal/WorkbenchV2/images/handOver.svg","screen/UserPortal/WorkbenchV2/images/mail.svg","screen/UserPortal/WorkbenchV2/images/sendAction.svg","screen/UserPortal/WorkbenchV2/images/task.svg","screen/UserPortal/WorkbenchV2/images/text.svg","screen/UserPortal/WorkbenchV2/images/zendex.svg","screen/UserPortal/WorkbenchV2/images/textW.svg","screen/UserPortal/WorkbenchV2/images/imageW.svg","screen/UserPortal/WorkbenchV2/images/questionW.svg","screen/UserPortal/WorkbenchV2/images/buttonW.svg","screen/UserPortal/WorkbenchV2/images/stIcon.svg","screen/UserPortal/WorkbenchV2/images/uploadImage.svg","screen/UserPortal/WorkbenchV2/images/editBtn.svg","screen/UserPortal/WorkbenchV2/images/delbtn.svg","screen/UserPortal/WorkbenchV2/images/wbDelete.svg","screen/UserPortal/WorkbenchV2/images/PlusIcon.svg","screen/UserPortal/WorkbenchV2/images/file.svg","screen/UserPortal/WorkbenchV2/images/QRDefault.svg","screen/UserPortal/WorkbenchV2/images/ACdefault.svg","screen/UserPortal/WorkbenchV2/images/conditionDef.svg","screen/UserPortal/WorkbenchV2/images/jumpIcon.svg","screen/UserPortal/WorkbenchV2/images/Btedit.svg","screen/UserPortal/WorkbenchV2/images/addH.svg","screen/UserPortal/WorkbenchV2/images/hookClearKey.svg","screen/UserPortal/WorkbenchV2/ImageMapper.js","screen/UserPortal/WorkbenchV2/components/WBNavbar.js","screen/UserPortal/WorkbenchV2/components/WBTopbar.js","screen/UserPortal/WorkbenchV2/components/node/WBNodeTopbar.js","screen/UserPortal/WorkbenchV2/WBconstants.js","screen/UserPortal/WorkbenchV2/components/node/WBQuestionNode.js","screen/UserPortal/WorkbenchV2/images/handlerIconFail.svg","screen/UserPortal/WorkbenchV2/components/node/WBActionNode.js","screen/UserPortal/WorkbenchV2/components/node/WBConditionNode.js","screen/UserPortal/WorkbenchV2/components/WBCanvas.js","action/BotAiAction.js","screen/UserPortal/WorkbenchV2/components/util/NodeLogic.js","screen/UserPortal/WorkbenchV2/Configure/images/facebook.svg","screen/UserPortal/WorkbenchV2/Configure/images/gmail.svg","screen/UserPortal/WorkbenchV2/Configure/images/google.svg","screen/UserPortal/WorkbenchV2/Configure/images/shopify.svg","screen/UserPortal/WorkbenchV2/Configure/images/WEB.svg","screen/UserPortal/WorkbenchV2/Configure/images/sms.svg","screen/UserPortal/WorkbenchV2/Configure/images/website.svg","screen/UserPortal/WorkbenchV2/Configure/images/zendesk.svg","screen/UserPortal/WorkbenchV2/Configure/images/wts.svg","screen/UserPortal/WorkbenchV2/Configure/HeaderComponent.jsx","screen/UserPortal/WorkbenchV2/Configure/images/smsSelector.svg","screen/UserPortal/WorkbenchV2/Configure/SmsComp.jsx","screen/UserPortal/WorkbenchV2/Configure/EmailComp.jsx","screen/UserPortal/WorkbenchV2/Configure/StatusComponent.jsx","screen/UserPortal/WorkbenchV2/Configure/FacebookComp.jsx","screen/UserPortal/WorkbenchV2/Configure/GoogleComp.jsx","screen/UserPortal/WorkbenchV2/Configure/ShopifyComp.jsx","screen/UserPortal/WorkbenchV2/Configure/ZendeskComp.jsx","screen/UserPortal/WorkbenchV2/Configure/WhatsAppComp.jsx","screen/UserPortal/WorkbenchV2/Configure/Web.jsx","screen/UserPortal/WorkbenchV2/Configure/index.js","screen/UserPortal/WorkbenchV2/components/WBWidget/Common/WidgetFooter.js","screen/UserPortal/WorkbenchV2/components/WBWidget/Common/WidgetVariable.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Heading.jsx","../node_modules/react-input-emoji/node_modules/style-inject/dist/style-inject.es.js","../node_modules/react-input-emoji/src/utils/emoji-utils.js","../node_modules/react-input-emoji/src/utils/input-event-utils.js","../node_modules/react-input-emoji/src/hooks/use-sanitize.js","../node_modules/react-input-emoji/src/text-input.js","../node_modules/react-input-emoji/src/components/emoji-picker-button.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/data.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/polyfills/stringFromCodePoint.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/index.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/store.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/emoji-index/emoji-index.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/frequently.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/react-input-emoji/node_modules/@babel/runtime/helpers/esm/inherits.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/svgs/index.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/shared-props.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/anchors.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/utils/shared-default-props.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/emoji/nimble-emoji.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/not-found.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/category.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/skins.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/skins-emoji.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/skins-dot.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/preview.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/search.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/picker/nimble-picker.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/picker/picker.js","../node_modules/react-input-emoji/node_modules/emoji-mart/dist-es/components/emoji/emoji.js","../node_modules/react-input-emoji/src/components/emoji-picker.js","../node_modules/react-input-emoji/src/components/emoji-picker-container.js","../node_modules/react-input-emoji/src/components/emoji-picker-wrapper.js","../node_modules/react-input-emoji/src/utils/mention-utils.js","../node_modules/react-input-emoji/src/hooks/use-mention.js","../node_modules/react-input-emoji/src/components/mention-user-list.js","../node_modules/react-input-emoji/src/components/mention-wrapper.js","../node_modules/react-input-emoji/src/utils/observer.js","../node_modules/react-input-emoji/src/index.js","../node_modules/react-input-emoji/src/hooks/use-event-listeners.js","../node_modules/react-input-emoji/src/hooks/user-pollute.js","../node_modules/react-input-emoji/src/hooks/use-emit.js","../node_modules/react-input-emoji/src/hooks/use-expose.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Buttons/index.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Button.jsx","screen/UserPortal/WorkbenchV2/components/fileUpload.jsx","../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/v4.js","../node_modules/@giphy/js-util/dist/index.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/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../node_modules/stylis/src/Utility.js","../node_modules/stylis/src/Tokenizer.js","../node_modules/stylis/src/Enum.js","../node_modules/stylis/src/Serializer.js","../node_modules/stylis/src/Parser.js","../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../node_modules/stylis/src/Middleware.js","../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js","../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../node_modules/@giphy/colors/dist/index.js","../node_modules/@giphy/js-fetch-api/dist/index.js","../node_modules/throttle-debounce/throttle.js","../node_modules/throttle-debounce/debounce.js","../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../node_modules/@giphy/js-analytics/dist/index.js","../node_modules/@giphy/react-components/dist/esm/index.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Image.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Text.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/Text-Event.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/AddSection.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ContentConfigRating.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ContentConfigShopifyCategory.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ContentConfigShopifyItem.jsx","screen/UserPortal/WorkbenchV2/images/addLang.svg","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/LanguageSection.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/intentSelect.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/QWidget-content.js","action/IntegrationAccountAction.js","action/ItemAction.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ActionConfigPayment.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ActionConfigSection.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ActionConfigUpdateContact.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/commonComponent/ActionWebhook.jsx","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/QWidget-action.js","screen/UserPortal/WorkbenchV2/components/WBWidget/Common/WidgetEditor.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/AiWidget.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/List-questionResponse.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/List-actions.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/QWidget-conditions.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/QWidget-waTemplate.js","screen/UserPortal/WorkbenchV2/components/WBWidget/Mapper/WidgetMapper.js","screen/UserPortal/WorkbenchV2/components/WBWidget/WidgetList/QualifierQ.js","screen/UserPortal/WorkbenchV2/components/WBWidget/index.js","screen/UserPortal/WorkbenchV2/components/WBCanvasNode.js","screen/UserPortal/WorkbenchV2/components/WBNodePopUp.js","screen/UserPortal/WorkbenchV2/ButtonEdge.js","screen/UserPortal/WorkbenchV2/index.js","screen/UserPortal/oathComp.js","../node_modules/@ant-design/icons-svg/es/asn/CameraOutlined.js","../node_modules/@ant-design/icons/es/icons/CameraOutlined.js","screen/UserProfile/ChnagePassword.jsx","screen/UserProfile/index.js","../node_modules/@redux-devtools/extension/lib/esm/index.js","../node_modules/redux-thunk/es/index.js","../node_modules/redux-persist/es/constants.js","../node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js","../node_modules/redux-persist/es/createPersistoid.js","../node_modules/redux-persist/es/getStoredState.js","../node_modules/redux-persist/es/purgeStoredState.js","../node_modules/redux-persist/es/persistReducer.js","../node_modules/redux-persist/es/persistStore.js","reducer/dittoAdminReducer.js","reducer/ContentReducer.js","reducer/FaqReducer.js","reducer/TagReducer.js","reducer/ConvReducer.js","reducer/MessageReducer.js","reducer/CallReducer.js","reducer/TaskBoardReducer.js","reducer/AgentReducer.js","reducer/ContactReducer.js","reducer/FileReducer.js","reducer/WorkbenchReducer.js","reducer/TenantReducer.js","reducer/BotAiReducer.js","reducer/AdminReducer.js","reducer/AppReducer.js","reducer/DashboardReducer.js","reducer/PaymentReducer.js","reducer/ItemReducer.js","reducer/IntegrationAccountReducer.js","reducer/TemplateReducer.js","reducer/CampaignReducer.js","reducer/UserProfileReducer.js","reducer/SignUpReducer.js","reducer/SubscriptionReducer.js","reducer/OpeningReducer.js","reducer/AccountVariablesDefinition.js","reducer/NotificationReducer.js","reducer/index.js","store/index.js","utils/history.js","../node_modules/fflate/esm/browser.js","../node_modules/jspdf/src/libs/globalObject.js","../node_modules/jspdf/src/libs/console.js","../node_modules/jspdf/src/libs/FileSaver.js","../node_modules/jspdf/src/libs/AtobBtoa.js","../node_modules/jspdf/src/libs/rgbcolor.js","../node_modules/jspdf/src/libs/md5.js","../node_modules/jspdf/src/libs/rc4.js","../node_modules/jspdf/src/libs/pdfsecurity.js","../node_modules/jspdf/src/libs/pdfname.js","../node_modules/jspdf/src/jspdf.js","../node_modules/jspdf/src/modules/acroform.js","../node_modules/jspdf/src/libs/fontFace.js","../node_modules/jspdf/src/modules/addimage.js","../node_modules/jspdf/src/modules/annotations.js","../node_modules/jspdf/src/modules/arabic.js","../node_modules/jspdf/src/modules/autoprint.js","../node_modules/jspdf/src/modules/canvas.js","../node_modules/jspdf/src/modules/cell.js","../node_modules/jspdf/src/modules/javascript.js","../node_modules/jspdf/src/modules/fileloading.js","../node_modules/jspdf/src/modules/context2d.js","../node_modules/jspdf/src/modules/filters.js","../node_modules/jspdf/src/modules/html.js","../node_modules/jspdf/src/modules/outline.js","../node_modules/jspdf/src/modules/jpeg_support.js","../node_modules/jspdf/src/libs/png.js","../node_modules/jspdf/src/modules/split_text_to_size.js","../node_modules/jspdf/src/libs/omggif.js","../node_modules/jspdf/src/libs/JPEGEncoder.js","../node_modules/jspdf/src/libs/BMPDecoder.js","../node_modules/jspdf/src/libs/WebPDecoder.js","../node_modules/jspdf/src/modules/png_support.js","../node_modules/jspdf/src/modules/gif_support.js","../node_modules/jspdf/src/modules/bmp_support.js","../node_modules/jspdf/src/modules/webp_support.js","../node_modules/jspdf/src/modules/rgba_support.js","../node_modules/jspdf/src/modules/setlanguage.js","../node_modules/jspdf/src/modules/standard_fonts_metrics.js","../node_modules/jspdf/src/modules/ttfsupport.js","../node_modules/jspdf/src/modules/svg.js","../node_modules/jspdf/src/modules/total_pages.js","../node_modules/jspdf/src/modules/viewerpreferences.js","../node_modules/jspdf/src/modules/xmp_metadata.js","../node_modules/jspdf/src/modules/utf8.js","../node_modules/jspdf/src/modules/vfs.js","../node_modules/jspdf/src/libs/bidiEngine.js","../node_modules/jspdf/src/libs/ttffont.js","utils/index.js","utils/languageList.jsx","../node_modules/360dialog-connect-button/src/open-popup.js","../node_modules/360dialog-connect-button/src/ConnectButton.tsx","../node_modules/360dialog-connect-button/dist/index.js","../node_modules/@ant-design/colors/dist/index.esm.js","../node_modules/@ant-design/icons-svg/lib/asn/CheckCircleFilled.js","../node_modules/@ant-design/icons-svg/lib/asn/CheckCircleOutlined.js","../node_modules/@ant-design/icons-svg/lib/asn/CloseCircleFilled.js","../node_modules/@ant-design/icons-svg/lib/asn/CloseCircleOutlined.js","../node_modules/@ant-design/icons-svg/lib/asn/CloseOutlined.js","../node_modules/@ant-design/icons-svg/lib/asn/ExclamationCircleFilled.js","../node_modules/@ant-design/icons-svg/lib/asn/ExclamationCircleOutlined.js","../node_modules/@ant-design/icons-svg/lib/asn/InfoCircleFilled.js","../node_modules/@ant-design/icons-svg/lib/asn/InfoCircleOutlined.js","../node_modules/@ant-design/icons-svg/lib/asn/LoadingOutlined.js","../node_modules/@ant-design/icons/CheckCircleFilled.js","../node_modules/@ant-design/icons/CheckCircleOutlined.js","../node_modules/@ant-design/icons/CloseCircleFilled.js","../node_modules/@ant-design/icons/CloseCircleOutlined.js","../node_modules/@ant-design/icons/CloseOutlined.js","../node_modules/@ant-design/icons/ExclamationCircleFilled.js","../node_modules/@ant-design/icons/ExclamationCircleOutlined.js","../node_modules/@ant-design/icons/InfoCircleFilled.js","../node_modules/@ant-design/icons/InfoCircleOutlined.js","../node_modules/@ant-design/icons/LoadingOutlined.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/es/components/Context.js","../node_modules/@ant-design/icons-svg/es/asn/ArrowRightOutlined.js","../node_modules/@ant-design/icons/es/icons/ArrowRightOutlined.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/CloudDownloadOutlined.js","../node_modules/@ant-design/icons/es/icons/CloudDownloadOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/CloudUploadOutlined.js","../node_modules/@ant-design/icons/es/icons/CloudUploadOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/CopyOutlined.js","../node_modules/@ant-design/icons/es/icons/CopyOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/DeleteFilled.js","../node_modules/@ant-design/icons/es/icons/DeleteFilled.js","../node_modules/@ant-design/icons-svg/es/asn/DeleteOutlined.js","../node_modules/@ant-design/icons/es/icons/DeleteOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/DoubleRightOutlined.js","../node_modules/@ant-design/icons/es/icons/DoubleRightOutlined.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/EditFilled.js","../node_modules/@ant-design/icons/es/icons/EditFilled.js","../node_modules/@ant-design/icons-svg/es/asn/EditOutlined.js","../node_modules/@ant-design/icons/es/icons/EditOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/EllipsisOutlined.js","../node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleFilled.js","../node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js","../node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ExpandOutlined.js","../node_modules/@ant-design/icons/es/icons/ExpandOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js","../node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/EyeOutlined.js","../node_modules/@ant-design/icons/es/icons/EyeOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/FileImageOutlined.js","../node_modules/@ant-design/icons/es/icons/FileImageOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/FileOutlined.js","../node_modules/@ant-design/icons/es/icons/FileOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/FilterOutlined.js","../node_modules/@ant-design/icons/es/icons/FilterOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/GlobalOutlined.js","../node_modules/@ant-design/icons/es/icons/GlobalOutlined.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/LinkedinOutlined.js","../node_modules/@ant-design/icons/es/icons/LinkedinOutlined.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/MailOutlined.js","../node_modules/@ant-design/icons/es/icons/MailOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/MenuFoldOutlined.js","../node_modules/@ant-design/icons/es/icons/MenuFoldOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/MenuUnfoldOutlined.js","../node_modules/@ant-design/icons/es/icons/MenuUnfoldOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/MessageOutlined.js","../node_modules/@ant-design/icons/es/icons/MessageOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PaperClipOutlined.js","../node_modules/@ant-design/icons/es/icons/PaperClipOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PlayCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/PlayCircleOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PlaySquareOutlined.js","../node_modules/@ant-design/icons/es/icons/PlaySquareOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PlusCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js","../node_modules/@ant-design/icons/es/icons/PlusOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/ProfileOutlined.js","../node_modules/@ant-design/icons/es/icons/ProfileOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/RightCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/RightCircleOutlined.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/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/SlidersOutlined.js","../node_modules/@ant-design/icons/es/icons/SlidersOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/SwapOutlined.js","../node_modules/@ant-design/icons/es/icons/SwapOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/UploadOutlined.js","../node_modules/@ant-design/icons/es/icons/UploadOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/WarningOutlined.js","../node_modules/@ant-design/icons/es/icons/WarningOutlined.js","../node_modules/@ant-design/icons/lib/components/AntdIcon.js","../node_modules/@ant-design/icons/lib/components/Context.js","../node_modules/@ant-design/icons/lib/components/IconBase.js","../node_modules/@ant-design/icons/lib/components/twoTonePrimaryColor.js","../node_modules/@ant-design/icons/lib/icons/CheckCircleFilled.js","../node_modules/@ant-design/icons/lib/icons/CheckCircleOutlined.js","../node_modules/@ant-design/icons/lib/icons/CloseCircleFilled.js","../node_modules/@ant-design/icons/lib/icons/CloseCircleOutlined.js","../node_modules/@ant-design/icons/lib/icons/CloseOutlined.js","../node_modules/@ant-design/icons/lib/icons/ExclamationCircleFilled.js","../node_modules/@ant-design/icons/lib/icons/ExclamationCircleOutlined.js","../node_modules/@ant-design/icons/lib/icons/InfoCircleFilled.js","../node_modules/@ant-design/icons/lib/icons/InfoCircleOutlined.js","../node_modules/@ant-design/icons/lib/icons/LoadingOutlined.js","../node_modules/@ant-design/icons/lib/utils.js","../CKEditor/webpack/universalModuleDefinition","../CKEditor/node_modules/prop-types/factoryWithThrowingShims.js","../CKEditor/node_modules/prop-types/index.js","../CKEditor/node_modules/prop-types/lib/ReactPropTypesSecret.js","../CKEditor/external umd {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","../CKEditor/webpack/bootstrap","../CKEditor/webpack/runtime/compat get default export","../CKEditor/webpack/runtime/define property getters","../CKEditor/webpack/runtime/hasOwnProperty shorthand","../CKEditor/webpack/runtime/make namespace object","../CKEditor/node_modules/lodash-es/isObject.js","../CKEditor/node_modules/lodash-es/_freeGlobal.js","../CKEditor/node_modules/lodash-es/_root.js","../CKEditor/node_modules/lodash-es/now.js","../CKEditor/node_modules/lodash-es/_trimmedEndIndex.js","../CKEditor/node_modules/lodash-es/_baseTrim.js","../CKEditor/node_modules/lodash-es/_Symbol.js","../CKEditor/node_modules/lodash-es/_getRawTag.js","../CKEditor/node_modules/lodash-es/_objectToString.js","../CKEditor/node_modules/lodash-es/_baseGetTag.js","../CKEditor/node_modules/lodash-es/isObjectLike.js","../CKEditor/node_modules/lodash-es/toNumber.js","../CKEditor/node_modules/lodash-es/isSymbol.js","../CKEditor/node_modules/lodash-es/debounce.js","../CKEditor/node_modules/lodash-es/throttle.js","../CKEditor/node_modules/lodash-es/eq.js","../CKEditor/node_modules/lodash-es/_assocIndexOf.js","../CKEditor/node_modules/lodash-es/_listCacheDelete.js","../CKEditor/node_modules/lodash-es/_ListCache.js","../CKEditor/node_modules/lodash-es/_listCacheClear.js","../CKEditor/node_modules/lodash-es/_listCacheGet.js","../CKEditor/node_modules/lodash-es/_listCacheHas.js","../CKEditor/node_modules/lodash-es/_listCacheSet.js","../CKEditor/node_modules/lodash-es/isFunction.js","../CKEditor/node_modules/lodash-es/_coreJsData.js","../CKEditor/node_modules/lodash-es/_isMasked.js","../CKEditor/node_modules/lodash-es/_toSource.js","../CKEditor/node_modules/lodash-es/_baseIsNative.js","../CKEditor/node_modules/lodash-es/_getNative.js","../CKEditor/node_modules/lodash-es/_getValue.js","../CKEditor/node_modules/lodash-es/_Map.js","../CKEditor/node_modules/lodash-es/_nativeCreate.js","../CKEditor/node_modules/lodash-es/_hashGet.js","../CKEditor/node_modules/lodash-es/_hashHas.js","../CKEditor/node_modules/lodash-es/_Hash.js","../CKEditor/node_modules/lodash-es/_hashClear.js","../CKEditor/node_modules/lodash-es/_hashDelete.js","../CKEditor/node_modules/lodash-es/_hashSet.js","../CKEditor/node_modules/lodash-es/_getMapData.js","../CKEditor/node_modules/lodash-es/_isKeyable.js","../CKEditor/node_modules/lodash-es/_MapCache.js","../CKEditor/node_modules/lodash-es/_mapCacheClear.js","../CKEditor/node_modules/lodash-es/_mapCacheDelete.js","../CKEditor/node_modules/lodash-es/_mapCacheGet.js","../CKEditor/node_modules/lodash-es/_mapCacheHas.js","../CKEditor/node_modules/lodash-es/_mapCacheSet.js","../CKEditor/node_modules/lodash-es/_Stack.js","../CKEditor/node_modules/lodash-es/_stackClear.js","../CKEditor/node_modules/lodash-es/_stackDelete.js","../CKEditor/node_modules/lodash-es/_stackGet.js","../CKEditor/node_modules/lodash-es/_stackHas.js","../CKEditor/node_modules/lodash-es/_stackSet.js","../CKEditor/node_modules/lodash-es/_defineProperty.js","../CKEditor/node_modules/lodash-es/_baseAssignValue.js","../CKEditor/node_modules/lodash-es/_assignValue.js","../CKEditor/node_modules/lodash-es/_copyObject.js","../CKEditor/node_modules/lodash-es/_baseIsArguments.js","../CKEditor/node_modules/lodash-es/isArguments.js","../CKEditor/node_modules/lodash-es/isArray.js","../CKEditor/node_modules/lodash-es/isBuffer.js","../CKEditor/node_modules/lodash-es/stubFalse.js","../CKEditor/node_modules/lodash-es/_isIndex.js","../CKEditor/node_modules/lodash-es/isLength.js","../CKEditor/node_modules/lodash-es/_baseIsTypedArray.js","../CKEditor/node_modules/lodash-es/_baseUnary.js","../CKEditor/node_modules/lodash-es/_nodeUtil.js","../CKEditor/node_modules/lodash-es/isTypedArray.js","../CKEditor/node_modules/lodash-es/_arrayLikeKeys.js","../CKEditor/node_modules/lodash-es/_baseTimes.js","../CKEditor/node_modules/lodash-es/_isPrototype.js","../CKEditor/node_modules/lodash-es/_overArg.js","../CKEditor/node_modules/lodash-es/_nativeKeys.js","../CKEditor/node_modules/lodash-es/_baseKeys.js","../CKEditor/node_modules/lodash-es/isArrayLike.js","../CKEditor/node_modules/lodash-es/keys.js","../CKEditor/node_modules/lodash-es/_baseKeysIn.js","../CKEditor/node_modules/lodash-es/_nativeKeysIn.js","../CKEditor/node_modules/lodash-es/keysIn.js","../CKEditor/node_modules/lodash-es/_cloneBuffer.js","../CKEditor/node_modules/lodash-es/stubArray.js","../CKEditor/node_modules/lodash-es/_getSymbols.js","../CKEditor/node_modules/lodash-es/_arrayFilter.js","../CKEditor/node_modules/lodash-es/_arrayPush.js","../CKEditor/node_modules/lodash-es/_getPrototype.js","../CKEditor/node_modules/lodash-es/_getSymbolsIn.js","../CKEditor/node_modules/lodash-es/_baseGetAllKeys.js","../CKEditor/node_modules/lodash-es/_getAllKeys.js","../CKEditor/node_modules/lodash-es/_getAllKeysIn.js","../CKEditor/node_modules/lodash-es/_DataView.js","../CKEditor/node_modules/lodash-es/_Promise.js","../CKEditor/node_modules/lodash-es/_Set.js","../CKEditor/node_modules/lodash-es/_WeakMap.js","../CKEditor/node_modules/lodash-es/_getTag.js","../CKEditor/node_modules/lodash-es/_initCloneArray.js","../CKEditor/node_modules/lodash-es/_Uint8Array.js","../CKEditor/node_modules/lodash-es/_cloneArrayBuffer.js","../CKEditor/node_modules/lodash-es/_cloneRegExp.js","../CKEditor/node_modules/lodash-es/_cloneSymbol.js","../CKEditor/node_modules/lodash-es/_initCloneByTag.js","../CKEditor/node_modules/lodash-es/_cloneDataView.js","../CKEditor/node_modules/lodash-es/_cloneTypedArray.js","../CKEditor/node_modules/lodash-es/_baseCreate.js","../CKEditor/node_modules/lodash-es/isMap.js","../CKEditor/node_modules/lodash-es/_baseIsMap.js","../CKEditor/node_modules/lodash-es/isSet.js","../CKEditor/node_modules/lodash-es/_baseIsSet.js","../CKEditor/node_modules/lodash-es/_baseClone.js","../CKEditor/node_modules/lodash-es/_copyArray.js","../CKEditor/node_modules/lodash-es/_initCloneObject.js","../CKEditor/node_modules/lodash-es/_copySymbolsIn.js","../CKEditor/node_modules/lodash-es/_baseAssignIn.js","../CKEditor/node_modules/lodash-es/_copySymbols.js","../CKEditor/node_modules/lodash-es/_baseAssign.js","../CKEditor/node_modules/lodash-es/_arrayEach.js","../CKEditor/node_modules/lodash-es/isPlainObject.js","../CKEditor/node_modules/lodash-es/isElement.js","../CKEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/getsubnodes.js","../CKEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/areconnectedthroughproperties.js","../CKEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js","../CKEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/editorwatchdog.js","../CKEditor/node_modules/lodash-es/cloneDeepWith.js","../CKEditor/node_modules/@ckeditor/ckeditor5-utils/src/uid.js","../CKEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/contextwatchdog.js","../CKEditor/src/ckeditorcontext.jsx","../CKEditor/src/ckeditor.jsx","../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/@ctrl/tinycolor/dist/module/readability.js","../node_modules/@ctrl/tinycolor/dist/module/to-ms-filter.js","../node_modules/@ctrl/tinycolor/dist/module/from-ratio.js","../node_modules/@ctrl/tinycolor/dist/module/random.js","../node_modules/@ctrl/tinycolor/dist/module/public_api.js","../node_modules/@ctrl/tinycolor/dist/module/util.js","../node_modules/@formatjs/ecma402-abstract/lib/utils.js","../node_modules/@formatjs/fast-memoize/lib/index.js","../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../node_modules/@formatjs/intl/lib/src/error.js","../node_modules/@formatjs/intl/lib/src/utils.js","../node_modules/@intercom/messenger-js-sdk/dist/constants.js","../node_modules/@intercom/messenger-js-sdk/dist/index.js","../node_modules/@intercom/messenger-js-sdk/dist/instance-manager.js","../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../node_modules/@popperjs/core/lib/utils/debounce.js","../node_modules/@popperjs/core/lib/createPopper.js","../node_modules/@popperjs/core/lib/utils/mergeByName.js","../node_modules/@popperjs/core/lib/dom-utils/contains.js","../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../node_modules/@popperjs/core/lib/enums.js","../node_modules/@popperjs/core/lib/modifiers/arrow.js","../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../node_modules/@popperjs/core/lib/modifiers/flip.js","../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../node_modules/@popperjs/core/lib/modifiers/hide.js","../node_modules/@popperjs/core/lib/modifiers/offset.js","../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../node_modules/@popperjs/core/lib/utils/getVariation.js","../node_modules/@popperjs/core/lib/utils/math.js","../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../node_modules/@popperjs/core/lib/utils/userAgent.js","../node_modules/@popperjs/core/lib/utils/within.js","../node_modules/@rc-component/portal/es/Context.js","../node_modules/@rc-component/portal/es/useDom.js","../node_modules/@rc-component/portal/es/useScrollLocker.js","../node_modules/@rc-component/portal/es/util.js","../node_modules/@rc-component/portal/es/mock.js","../node_modules/@rc-component/portal/es/Portal.js","../node_modules/@rc-component/portal/es/index.js","../node_modules/@react-dnd/invariant/src/index.ts","../node_modules/@sentry/src/metrics/metric-summary.ts","../node_modules/@sentry/src/tracing/spanstatus.ts","../node_modules/@sentry/src/tracing/span.ts","../node_modules/@sentry/src/utils/hasTracingEnabled.ts","../node_modules/@sentry/src/tracing/trace.ts","../node_modules/@sentry/src/tracing/transaction.ts","../node_modules/@sentry/src/tracing/idletransaction.ts","../node_modules/@sentry/src/tracing/utils.ts","../node_modules/@sentry/src/tracing/errors.ts","../node_modules/@sentry/src/tracing/sampling.ts","../node_modules/@sentry/src/tracing/hubextensions.ts","../node_modules/@sentry/src/span.ts","../node_modules/@sentry-internal/src/browser/metrics/utils.ts","../node_modules/@sentry-internal/src/browser/metrics/index.ts","../node_modules/@sentry/src/tracing/measurement.ts","../node_modules/@sentry-internal/src/common/fetch.ts","../node_modules/@sentry-internal/src/browser/request.ts","../node_modules/@sentry-internal/src/browser/browserTracingIntegration.ts","../node_modules/@sentry-internal/src/browser/backgroundtab.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/bindReporter.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getActivationStart.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/initMetric.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/generateUniqueID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/observe.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getCLS.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getFID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getINP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getLCP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/onTTFB.ts","../node_modules/@sentry-internal/src/browser/instrument.ts","../node_modules/@sentry-internal/src/browser/types.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getNavigationEntry.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getVisibilityWatcher.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/onHidden.ts","../node_modules/@sentry-internal/src/common/debug-build.ts","../node_modules/@sentry/src/api.ts","../node_modules/@sentry/src/metrics/envelope.ts","../node_modules/@sentry/src/metrics/utils.ts","../node_modules/@sentry/src/baseclient.ts","../node_modules/@sentry/src/envelope.ts","../node_modules/@sentry/src/constants.ts","../node_modules/@sentry/src/debug-build.ts","../node_modules/@sentry/src/eventProcessors.ts","../node_modules/@sentry/src/exports.ts","../node_modules/@sentry/src/hub.ts","../node_modules/@sentry/src/integration.ts","../node_modules/@sentry/src/scope.ts","../node_modules/@sentry/src/semanticAttributes.ts","../node_modules/@sentry/src/session.ts","../node_modules/@sentry/src/tracing/dynamicSamplingContext.ts","../node_modules/@sentry/src/utils/applyScopeDataToEvent.ts","../node_modules/@sentry/src/utils/getRootSpan.ts","../node_modules/@sentry/src/utils/prepareEvent.ts","../node_modules/@sentry/src/utils/spanUtils.ts","../node_modules/@sentry/src/version.ts","../node_modules/@sentry/src/integrations/inboundfilters.ts","../node_modules/@sentry/src/integrations/functiontostring.ts","../node_modules/@sentry/src/sdk.ts","../node_modules/@sentry/src/utils/sdkMetadata.ts","../node_modules/src/debug-build.ts","../node_modules/src/eventbuilder.ts","../node_modules/src/helpers.ts","../node_modules/src/client.ts","../node_modules/src/userfeedback.ts","../node_modules/@sentry/src/clientreport.ts","../node_modules/@sentry/src/instrument/console.ts","../node_modules/@sentry/src/severity.ts","../node_modules/src/integrations/breadcrumbs.ts","../node_modules/src/integrations/dedupe.ts","../node_modules/src/integrations/globalhandlers.ts","../node_modules/src/integrations/httpcontext.ts","../node_modules/@sentry/src/aggregate-errors.ts","../node_modules/src/integrations/linkederrors.ts","../node_modules/src/integrations/trycatch.ts","../node_modules/src/stack-parsers.ts","../node_modules/@sentry/src/promisebuffer.ts","../node_modules/@sentry/src/transports/base.ts","../node_modules/src/transports/utils.ts","../node_modules/src/transports/fetch.ts","../node_modules/src/transports/xhr.ts","../node_modules/src/sdk.ts","../node_modules/@sentry/src/buildPolyfills/_optionalChain.ts","../node_modules/@sentry/src/utils/isSentryRequestUrl.ts","../node_modules/@sentry/src/isBrowser.ts","../node_modules/src/constants.ts","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/utils.js","../node_modules/@sentry/src/buildPolyfills/_nullishCoalesce.ts","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/types/dist/rrweb-types.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/error-handler.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observer.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/cross-origin-iframe-mirror.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/processed-node-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/index.js","../node_modules/src/types/rrweb.ts","../node_modules/src/util/timestamp.ts","../node_modules/src/coreHandlers/util/addBreadcrumbEvent.ts","../node_modules/src/coreHandlers/util/domUtils.ts","../node_modules/src/coreHandlers/util/onWindowOpen.ts","../node_modules/src/coreHandlers/handleClick.ts","../node_modules/src/util/createBreadcrumb.ts","../../node_modules/@sentry-internal/rrweb-snapshot/es/rrweb-snapshot.js","../node_modules/src/coreHandlers/util/getAttributesToRecord.ts","../node_modules/src/coreHandlers/handleDom.ts","../node_modules/src/coreHandlers/handleKeyboardEvent.ts","../node_modules/src/util/createPerformanceEntries.ts","../node_modules/src/coreHandlers/performanceObserver.ts","../replay-worker/build/npm/esm/worker.ts","../node_modules/src/util/log.ts","../node_modules/src/eventBuffer/error.ts","../node_modules/src/eventBuffer/EventBufferArray.ts","../node_modules/src/eventBuffer/WorkerHandler.ts","../node_modules/src/eventBuffer/EventBufferCompressionWorker.ts","../node_modules/src/eventBuffer/EventBufferProxy.ts","../node_modules/src/eventBuffer/index.ts","../replay-worker/build/npm/esm/index.js","../node_modules/src/util/hasSessionStorage.ts","../node_modules/src/session/clearSession.ts","../node_modules/src/util/isSampled.ts","../node_modules/src/session/Session.ts","../node_modules/src/session/saveSession.ts","../node_modules/src/session/createSession.ts","../node_modules/src/util/isExpired.ts","../node_modules/src/util/isSessionExpired.ts","../node_modules/src/session/shouldRefreshSession.ts","../node_modules/src/session/loadOrCreateSession.ts","../node_modules/src/session/fetchSession.ts","../node_modules/src/util/addEvent.ts","../node_modules/src/util/eventUtils.ts","../node_modules/src/coreHandlers/handleAfterSendEvent.ts","../node_modules/src/coreHandlers/handleBeforeSendEvent.ts","../node_modules/src/coreHandlers/handleGlobalEvent.ts","../node_modules/src/coreHandlers/util/addFeedbackBreadcrumb.ts","../node_modules/src/util/isRrwebError.ts","../node_modules/src/coreHandlers/util/shouldSampleForBufferEvent.ts","../node_modules/src/util/createPerformanceSpans.ts","../node_modules/src/coreHandlers/handleHistory.ts","../node_modules/src/coreHandlers/util/addNetworkBreadcrumb.ts","../node_modules/src/util/shouldFilterRequest.ts","../node_modules/src/coreHandlers/handleXhr.ts","../node_modules/src/coreHandlers/util/networkUtils.ts","../node_modules/src/coreHandlers/util/fetchUtils.ts","../node_modules/src/coreHandlers/util/xhrUtils.ts","../node_modules/src/coreHandlers/handleNetworkBreadcrumbs.ts","../node_modules/src/coreHandlers/handleFetch.ts","../node_modules/src/coreHandlers/handleScope.ts","../node_modules/src/util/addGlobalListeners.ts","../node_modules/src/util/addMemoryEntry.ts","../node_modules/src/util/handleRecordingEmit.ts","../node_modules/src/util/createReplayEnvelope.ts","../node_modules/src/util/sendReplayRequest.ts","../node_modules/src/util/prepareRecordingData.ts","../node_modules/src/util/prepareReplayEvent.ts","../node_modules/src/util/sendReplay.ts","../node_modules/src/util/throttle.ts","../node_modules/src/replay.ts","../node_modules/src/util/debounce.ts","../node_modules/src/util/getPrivacyOptions.ts","../node_modules/src/integration.ts","../node_modules/src/util/maskAttribute.ts","../node_modules/@sentry/src/baggage.ts","../node_modules/@sentry/src/browser.ts","../node_modules/@sentry/src/dsn.ts","../node_modules/@sentry/src/env.ts","../node_modules/@sentry/src/error.ts","../node_modules/@sentry/src/instrument/_handlers.ts","../node_modules/@sentry/src/instrument/dom.ts","../node_modules/@sentry/src/instrument/fetch.ts","../node_modules/@sentry/src/instrument/globalError.ts","../node_modules/@sentry/src/instrument/globalUnhandledRejection.ts","../node_modules/@sentry/src/vendor/supportsHistory.ts","../node_modules/@sentry/src/instrument/history.ts","../node_modules/@sentry/src/instrument/xhr.ts","../node_modules/@sentry/src/is.ts","../node_modules/@sentry/src/logger.ts","../node_modules/@sentry/src/misc.ts","../node_modules/@sentry/src/node.ts","../node_modules/@sentry/src/normalize.ts","../node_modules/@sentry/src/memo.ts","../node_modules/@sentry/src/object.ts","../node_modules/@sentry/src/ratelimit.ts","../node_modules/@sentry/src/stacktrace.ts","../node_modules/@sentry/src/string.ts","../node_modules/@sentry/src/supports.ts","../node_modules/@sentry/src/syncpromise.ts","../node_modules/@sentry/src/time.ts","../node_modules/@sentry/src/tracing.ts","../node_modules/@sentry/src/url.ts","../node_modules/@sentry/src/worldwide.ts","../node_modules/antd/es/_util/colors.js","../node_modules/antd/es/_util/hooks/useFlexGapSupport.js","../node_modules/antd/es/_util/hooks/useForceUpdate.js","../node_modules/antd/es/_util/motion.js","../node_modules/antd/es/_util/placements.js","../node_modules/antd/es/_util/reactNode.js","../node_modules/antd/es/_util/responsiveObserve.js","../node_modules/antd/es/_util/statusUtils.js","../node_modules/antd/es/_util/styleChecker.js","../node_modules/antd/es/_util/type.js","../node_modules/antd/es/_util/raf.js","../node_modules/antd/es/_util/wave.js","../node_modules/antd/es/avatar/SizeContext.js","../node_modules/antd/es/avatar/avatar.js","../node_modules/antd/es/avatar/group.js","../node_modules/antd/es/avatar/index.js","../node_modules/antd/es/button/button-group.js","../node_modules/antd/es/button/LoadingIcon.js","../node_modules/antd/es/button/button.js","../node_modules/antd/es/button/index.js","../node_modules/antd/es/card/Grid.js","../node_modules/antd/es/card/Card.js","../node_modules/antd/es/card/Meta.js","../node_modules/antd/es/card/index.js","../node_modules/antd/es/checkbox/Group.js","../node_modules/antd/es/checkbox/Checkbox.js","../node_modules/antd/es/checkbox/index.js","../node_modules/antd/es/col/index.js","../node_modules/antd/es/config-provider/DisabledContext.js","../node_modules/antd/es/config-provider/SizeContext.js","../node_modules/antd/es/config-provider/context.js","../node_modules/antd/es/config-provider/defaultRenderEmpty.js","../node_modules/antd/es/locale-provider/index.js","../node_modules/antd/es/config-provider/cssVariables.js","../node_modules/antd/es/config-provider/index.js","../node_modules/rc-picker/es/locale/en_US.js","../node_modules/antd/es/date-picker/locale/en_US.js","../node_modules/antd/es/divider/index.js","../node_modules/rc-drawer/es/context.js","../node_modules/rc-drawer/es/DrawerPanel.js","../node_modules/rc-drawer/es/util.js","../node_modules/rc-drawer/es/DrawerPopup.js","../node_modules/rc-drawer/es/Drawer.js","../node_modules/rc-drawer/es/index.js","../node_modules/antd/es/drawer/index.js","../node_modules/antd/es/dropdown/dropdown-button.js","../node_modules/antd/es/dropdown/dropdown.js","../node_modules/antd/es/dropdown/index.js","../node_modules/antd/es/empty/empty.js","../node_modules/antd/es/empty/simple.js","../node_modules/antd/es/empty/index.js","../node_modules/antd/es/form/context.js","../node_modules/antd/es/form/hooks/useDebounce.js","../node_modules/antd/es/form/ErrorList.js","../node_modules/compute-scroll-into-view/src/index.ts","../node_modules/scroll-into-view-if-needed/es/index.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/useFormItemStatus.js","../node_modules/@ant-design/icons-svg/es/asn/QuestionCircleOutlined.js","../node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js","../node_modules/antd/es/form/FormItemLabel.js","../node_modules/antd/es/form/FormItemInput.js","../node_modules/antd/es/form/FormItem/ItemHolder.js","../node_modules/antd/es/form/FormItem/index.js","../node_modules/antd/es/form/hooks/useFrameState.js","../node_modules/antd/es/form/hooks/useItemRef.js","../node_modules/antd/es/form/FormList.js","../node_modules/antd/es/form/index.js","../node_modules/antd/es/form/hooks/useFormInstance.js","../node_modules/antd/es/form/validateMessagesContext.js","../node_modules/antd/es/grid/RowContext.js","../node_modules/antd/es/grid/col.js","../node_modules/antd/es/grid/hooks/useBreakpoint.js","../node_modules/antd/es/grid/row.js","../node_modules/rc-input/es/utils/commonUtils.js","../node_modules/rc-input/es/BaseInput.js","../node_modules/rc-input/es/Input.js","../node_modules/rc-input/es/index.js","../node_modules/antd/es/input/Input.js","../node_modules/antd/es/input/utils.js","../node_modules/rc-textarea/es/calculateNodeHeight.js","../node_modules/rc-textarea/es/ResizableTextArea.js","../node_modules/rc-textarea/es/index.js","../node_modules/antd/es/input/ClearableLabeledInput.js","../node_modules/antd/es/input/TextArea.js","../node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js","../node_modules/antd/es/input/Group.js","../node_modules/antd/es/input/Password.js","../node_modules/antd/es/input/Search.js","../node_modules/antd/es/input/index.js","../node_modules/@ant-design/icons-svg/es/asn/BarsOutlined.js","../node_modules/@ant-design/icons/es/icons/BarsOutlined.js","../node_modules/antd/es/_util/isNumeric.js","../node_modules/antd/es/layout/Sider.js","../node_modules/antd/es/layout/layout.js","../node_modules/antd/es/locale-provider/default.js","../node_modules/antd/es/locale-provider/LocaleReceiver.js","../node_modules/antd/es/locale-provider/context.js","../node_modules/antd/es/calendar/locale/en_US.js","../node_modules/antd/es/locale/default.js","../node_modules/antd/es/locale/en_US.js","../node_modules/antd/es/menu/OverrideContext.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/SubMenu.js","../node_modules/antd/es/menu/hooks/useItems.js","../node_modules/antd/es/menu/index.js","../node_modules/@ant-design/icons-svg/es/asn/InfoCircleFilled.js","../node_modules/@ant-design/icons/es/icons/InfoCircleFilled.js","../node_modules/antd/es/message/index.js","../node_modules/antd/es/message/hooks/useMessage.js","../node_modules/antd/es/_util/ActionButton.js","../node_modules/antd/es/modal/Modal.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/_util/hooks/usePatchElement.js","../node_modules/antd/es/modal/index.js","../node_modules/antd/es/modal/locale.js","../node_modules/antd/es/notification/index.js","../node_modules/antd/es/notification/hooks/useNotification.js","../node_modules/@ant-design/icons-svg/es/asn/DoubleLeftOutlined.js","../node_modules/@ant-design/icons/es/icons/DoubleLeftOutlined.js","../node_modules/rc-pagination/es/Pager.js","../node_modules/rc-pagination/es/KeyCode.js","../node_modules/rc-pagination/es/Options.js","../node_modules/rc-pagination/es/Pagination.js","../node_modules/rc-pagination/es/locale/zh_CN.js","../node_modules/antd/es/pagination/Select.js","../node_modules/antd/es/pagination/Pagination.js","../node_modules/antd/es/pagination/index.js","../node_modules/antd/es/_util/getRenderPropValue.js","../node_modules/antd/es/popover/index.js","../node_modules/rc-progress/es/common.js","../node_modules/rc-progress/es/hooks/useId.js","../node_modules/rc-progress/es/Circle.js","../node_modules/antd/es/progress/utils.js","../node_modules/antd/es/progress/Circle.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/es/progress/index.js","../node_modules/antd/es/radio/context.js","../node_modules/antd/es/radio/radio.js","../node_modules/antd/es/radio/group.js","../node_modules/antd/es/_util/getDataOrAriaProps.js","../node_modules/antd/es/radio/radioButton.js","../node_modules/antd/es/radio/index.js","../node_modules/@ant-design/icons-svg/es/asn/StarFilled.js","../node_modules/@ant-design/icons/es/icons/StarFilled.js","../node_modules/rc-rate/es/Star.js","../node_modules/rc-rate/es/Rate.js","../node_modules/rc-rate/es/util.js","../node_modules/rc-rate/es/index.js","../node_modules/antd/es/rate/index.js","../node_modules/antd/es/row/index.js","../node_modules/antd/es/select/index.js","../node_modules/antd/es/select/utils/iconUtil.js","../node_modules/antd/es/skeleton/Element.js","../node_modules/antd/es/skeleton/Avatar.js","../node_modules/antd/es/skeleton/Button.js","../node_modules/@ant-design/icons-svg/es/asn/DotChartOutlined.js","../node_modules/@ant-design/icons/es/icons/DotChartOutlined.js","../node_modules/antd/es/skeleton/Node.js","../node_modules/antd/es/skeleton/Image.js","../node_modules/antd/es/skeleton/Input.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/skeleton/index.js","../node_modules/antd/es/space/Compact.js","../node_modules/antd/es/space/Item.js","../node_modules/antd/es/space/index.js","../node_modules/antd/es/spin/index.js","../node_modules/rc-tabs/es/TabContext.js","../node_modules/rc-tabs/es/TabPanelList/TabPane.js","../node_modules/rc-tabs/es/TabPanelList/index.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/TabNavList/Wrapper.js","../node_modules/rc-tabs/es/Tabs.js","../node_modules/rc-tabs/es/hooks/useAnimateConfig.js","../node_modules/rc-tabs/es/index.js","../node_modules/antd/es/tabs/hooks/useAnimateConfig.js","../node_modules/antd/es/tabs/hooks/useLegacyItems.js","../node_modules/antd/es/tabs/TabPane.js","../node_modules/antd/es/tabs/index.js","../node_modules/antd/es/tag/CheckableTag.js","../node_modules/antd/es/tag/index.js","../node_modules/antd/es/time-picker/locale/en_US.js","../node_modules/rc-tooltip/es/Popup.js","../node_modules/rc-tooltip/es/Tooltip.js","../node_modules/rc-tooltip/es/index.js","../node_modules/antd/es/tooltip/index.js","../node_modules/@ant-design/icons-svg/es/asn/CaretDownFilled.js","../node_modules/@ant-design/icons/es/icons/CaretDownFilled.js","../node_modules/@ant-design/icons-svg/es/asn/MinusSquareOutlined.js","../node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js","../node_modules/@ant-design/icons-svg/es/asn/PlusSquareOutlined.js","../node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js","../node_modules/antd/es/tree/utils/iconUtil.js","../node_modules/antd/lib/_util/warning.js","../node_modules/antd/lib/calendar/locale/en_US.js","../node_modules/antd/lib/config-provider/DisabledContext.js","../node_modules/antd/lib/config-provider/SizeContext.js","../node_modules/antd/lib/config-provider/context.js","../node_modules/antd/lib/config-provider/cssVariables.js","../node_modules/antd/lib/config-provider/index.js","../node_modules/antd/lib/date-picker/locale/en_US.js","../node_modules/antd/lib/form/validateMessagesContext.js","../node_modules/antd/lib/locale-provider/LocaleReceiver.js","../node_modules/antd/lib/locale-provider/context.js","../node_modules/antd/lib/locale-provider/default.js","../node_modules/antd/lib/locale-provider/index.js","../node_modules/antd/lib/locale/default.js","../node_modules/antd/lib/message/hooks/useMessage.js","../node_modules/antd/lib/message/index.js","../node_modules/antd/lib/modal/locale.js","../node_modules/antd/lib/notification/hooks/useNotification.js","../node_modules/antd/lib/notification/index.js","../node_modules/antd/lib/time-picker/locale/en_US.js","../node_modules/antd/lib/timeline/TimelineItem.js","../node_modules/axios/index.js","../node_modules/axios/lib/adapters/xhr.js","../node_modules/axios/lib/axios.js","../node_modules/axios/lib/cancel/Cancel.js","../node_modules/axios/lib/cancel/CancelToken.js","../node_modules/axios/lib/cancel/isCancel.js","../node_modules/axios/lib/core/Axios.js","../node_modules/axios/lib/core/InterceptorManager.js","../node_modules/axios/lib/core/buildFullPath.js","../node_modules/axios/lib/core/createError.js","../node_modules/axios/lib/core/dispatchRequest.js","../node_modules/axios/lib/core/enhanceError.js","../node_modules/axios/lib/core/mergeConfig.js","../node_modules/axios/lib/core/settle.js","../node_modules/axios/lib/core/transformData.js","../node_modules/axios/lib/defaults.js","../node_modules/axios/lib/helpers/bind.js","../node_modules/axios/lib/helpers/buildURL.js","../node_modules/axios/lib/helpers/combineURLs.js","../node_modules/axios/lib/helpers/cookies.js","../node_modules/axios/lib/helpers/isAbsoluteURL.js","../node_modules/axios/lib/helpers/isAxiosError.js","../node_modules/axios/lib/helpers/isURLSameOrigin.js","../node_modules/axios/lib/helpers/normalizeHeaderName.js","../node_modules/axios/lib/helpers/parseHeaders.js","../node_modules/axios/lib/helpers/spread.js","../node_modules/axios/lib/helpers/validator.js","../node_modules/axios/lib/utils.js","../node_modules/babel-runtime/core-js/object/assign.js","../node_modules/babel-runtime/core-js/object/create.js","../node_modules/babel-runtime/core-js/object/define-property.js","../node_modules/babel-runtime/core-js/object/get-prototype-of.js","../node_modules/babel-runtime/core-js/object/set-prototype-of.js","../node_modules/babel-runtime/core-js/symbol.js","../node_modules/babel-runtime/core-js/symbol/iterator.js","../node_modules/babel-runtime/helpers/classCallCheck.js","../node_modules/babel-runtime/helpers/createClass.js","../node_modules/babel-runtime/helpers/extends.js","../node_modules/babel-runtime/helpers/inherits.js","../node_modules/babel-runtime/helpers/possibleConstructorReturn.js","../node_modules/babel-runtime/helpers/typeof.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/object/assign.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/object/create.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/object/define-property.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/object/get-prototype-of.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/object/set-prototype-of.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/index.js","../node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/iterator.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_a-function.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_add-to-unscopables.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_array-includes.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_dom-create.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-keys.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_html.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_ie8-dom-define.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-create.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-step.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-assign.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dps.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopd.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn-ext.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gpo.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys-internal.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_object-sap.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_set-proto.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_string-at.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-absolute-index.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.iterator.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.assign.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.create.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.define-property.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.get-prototype-of.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.set-prototype-of.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.async-iterator.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.observable.js","../node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js","../node_modules/base64-js/index.js","../node_modules/buffer/index.js","../ClassicEditor/webpack/universalModuleDefinition","../ClassicEditor/node_modules/color-convert/conversions.js","../ClassicEditor/node_modules/color-convert/index.js","../ClassicEditor/node_modules/color-convert/route.js","../ClassicEditor/node_modules/color-name/index.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/image.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/link.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/theme/list.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mention.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/form.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/formrow.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/table.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableform.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/charactergrid.css","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/characterinfo.css","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/emoji-characters.css","../ClassicEditor/node_modules/css-loader/dist/runtime/api.js","../ClassicEditor/node_modules/css-loader/dist/runtime/cssWithMappingToString.js","../ClassicEditor/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","../ClassicEditor/webpack/bootstrap","../ClassicEditor/webpack/runtime/compat get default export","../ClassicEditor/webpack/runtime/define property getters","../ClassicEditor/webpack/runtime/global","../ClassicEditor/webpack/runtime/hasOwnProperty shorthand","../ClassicEditor/webpack/runtime/nonce","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/csstransitiondisablermixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/addkeyboardhandlingforgrid.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/env.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/diff.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/spy.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/uid.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/priorities.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/inserttopriorityarray.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/version.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js","../ClassicEditor/node_modules/lodash-es/isObject.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/count.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js","../ClassicEditor/node_modules/lodash-es/_freeGlobal.js","../ClassicEditor/node_modules/lodash-es/_root.js","../ClassicEditor/node_modules/lodash-es/_Symbol.js","../ClassicEditor/node_modules/lodash-es/_getRawTag.js","../ClassicEditor/node_modules/lodash-es/_objectToString.js","../ClassicEditor/node_modules/lodash-es/_baseGetTag.js","../ClassicEditor/node_modules/lodash-es/isArray.js","../ClassicEditor/node_modules/lodash-es/isObjectLike.js","../ClassicEditor/node_modules/lodash-es/isString.js","../ClassicEditor/node_modules/lodash-es/_overArg.js","../ClassicEditor/node_modules/lodash-es/_getPrototype.js","../ClassicEditor/node_modules/lodash-es/isPlainObject.js","../ClassicEditor/node_modules/lodash-es/eq.js","../ClassicEditor/node_modules/lodash-es/_assocIndexOf.js","../ClassicEditor/node_modules/lodash-es/_listCacheDelete.js","../ClassicEditor/node_modules/lodash-es/_ListCache.js","../ClassicEditor/node_modules/lodash-es/_listCacheClear.js","../ClassicEditor/node_modules/lodash-es/_listCacheGet.js","../ClassicEditor/node_modules/lodash-es/_listCacheHas.js","../ClassicEditor/node_modules/lodash-es/_listCacheSet.js","../ClassicEditor/node_modules/lodash-es/isFunction.js","../ClassicEditor/node_modules/lodash-es/_coreJsData.js","../ClassicEditor/node_modules/lodash-es/_isMasked.js","../ClassicEditor/node_modules/lodash-es/_toSource.js","../ClassicEditor/node_modules/lodash-es/_baseIsNative.js","../ClassicEditor/node_modules/lodash-es/_getNative.js","../ClassicEditor/node_modules/lodash-es/_getValue.js","../ClassicEditor/node_modules/lodash-es/_Map.js","../ClassicEditor/node_modules/lodash-es/_nativeCreate.js","../ClassicEditor/node_modules/lodash-es/_hashGet.js","../ClassicEditor/node_modules/lodash-es/_hashHas.js","../ClassicEditor/node_modules/lodash-es/_Hash.js","../ClassicEditor/node_modules/lodash-es/_hashClear.js","../ClassicEditor/node_modules/lodash-es/_hashDelete.js","../ClassicEditor/node_modules/lodash-es/_hashSet.js","../ClassicEditor/node_modules/lodash-es/_getMapData.js","../ClassicEditor/node_modules/lodash-es/_isKeyable.js","../ClassicEditor/node_modules/lodash-es/_MapCache.js","../ClassicEditor/node_modules/lodash-es/_mapCacheClear.js","../ClassicEditor/node_modules/lodash-es/_mapCacheDelete.js","../ClassicEditor/node_modules/lodash-es/_mapCacheGet.js","../ClassicEditor/node_modules/lodash-es/_mapCacheHas.js","../ClassicEditor/node_modules/lodash-es/_mapCacheSet.js","../ClassicEditor/node_modules/lodash-es/_Stack.js","../ClassicEditor/node_modules/lodash-es/_stackClear.js","../ClassicEditor/node_modules/lodash-es/_stackDelete.js","../ClassicEditor/node_modules/lodash-es/_stackGet.js","../ClassicEditor/node_modules/lodash-es/_stackHas.js","../ClassicEditor/node_modules/lodash-es/_stackSet.js","../ClassicEditor/node_modules/lodash-es/_defineProperty.js","../ClassicEditor/node_modules/lodash-es/_baseAssignValue.js","../ClassicEditor/node_modules/lodash-es/_assignValue.js","../ClassicEditor/node_modules/lodash-es/_copyObject.js","../ClassicEditor/node_modules/lodash-es/_baseIsArguments.js","../ClassicEditor/node_modules/lodash-es/isArguments.js","../ClassicEditor/node_modules/lodash-es/isBuffer.js","../ClassicEditor/node_modules/lodash-es/stubFalse.js","../ClassicEditor/node_modules/lodash-es/_isIndex.js","../ClassicEditor/node_modules/lodash-es/isLength.js","../ClassicEditor/node_modules/lodash-es/_baseIsTypedArray.js","../ClassicEditor/node_modules/lodash-es/_baseUnary.js","../ClassicEditor/node_modules/lodash-es/_nodeUtil.js","../ClassicEditor/node_modules/lodash-es/isTypedArray.js","../ClassicEditor/node_modules/lodash-es/_arrayLikeKeys.js","../ClassicEditor/node_modules/lodash-es/_baseTimes.js","../ClassicEditor/node_modules/lodash-es/_isPrototype.js","../ClassicEditor/node_modules/lodash-es/_nativeKeys.js","../ClassicEditor/node_modules/lodash-es/_baseKeys.js","../ClassicEditor/node_modules/lodash-es/isArrayLike.js","../ClassicEditor/node_modules/lodash-es/keys.js","../ClassicEditor/node_modules/lodash-es/_baseKeysIn.js","../ClassicEditor/node_modules/lodash-es/_nativeKeysIn.js","../ClassicEditor/node_modules/lodash-es/keysIn.js","../ClassicEditor/node_modules/lodash-es/_cloneBuffer.js","../ClassicEditor/node_modules/lodash-es/_copyArray.js","../ClassicEditor/node_modules/lodash-es/stubArray.js","../ClassicEditor/node_modules/lodash-es/_getSymbols.js","../ClassicEditor/node_modules/lodash-es/_arrayFilter.js","../ClassicEditor/node_modules/lodash-es/_arrayPush.js","../ClassicEditor/node_modules/lodash-es/_getSymbolsIn.js","../ClassicEditor/node_modules/lodash-es/_baseGetAllKeys.js","../ClassicEditor/node_modules/lodash-es/_getAllKeys.js","../ClassicEditor/node_modules/lodash-es/_getAllKeysIn.js","../ClassicEditor/node_modules/lodash-es/_DataView.js","../ClassicEditor/node_modules/lodash-es/_Promise.js","../ClassicEditor/node_modules/lodash-es/_Set.js","../ClassicEditor/node_modules/lodash-es/_WeakMap.js","../ClassicEditor/node_modules/lodash-es/_getTag.js","../ClassicEditor/node_modules/lodash-es/_initCloneArray.js","../ClassicEditor/node_modules/lodash-es/_Uint8Array.js","../ClassicEditor/node_modules/lodash-es/_cloneArrayBuffer.js","../ClassicEditor/node_modules/lodash-es/_cloneRegExp.js","../ClassicEditor/node_modules/lodash-es/_cloneSymbol.js","../ClassicEditor/node_modules/lodash-es/_cloneTypedArray.js","../ClassicEditor/node_modules/lodash-es/_initCloneByTag.js","../ClassicEditor/node_modules/lodash-es/_cloneDataView.js","../ClassicEditor/node_modules/lodash-es/_baseCreate.js","../ClassicEditor/node_modules/lodash-es/_initCloneObject.js","../ClassicEditor/node_modules/lodash-es/isMap.js","../ClassicEditor/node_modules/lodash-es/_baseIsMap.js","../ClassicEditor/node_modules/lodash-es/isSet.js","../ClassicEditor/node_modules/lodash-es/_baseIsSet.js","../ClassicEditor/node_modules/lodash-es/_baseClone.js","../ClassicEditor/node_modules/lodash-es/_copySymbolsIn.js","../ClassicEditor/node_modules/lodash-es/_baseAssignIn.js","../ClassicEditor/node_modules/lodash-es/_copySymbols.js","../ClassicEditor/node_modules/lodash-es/_baseAssign.js","../ClassicEditor/node_modules/lodash-es/_arrayEach.js","../ClassicEditor/node_modules/lodash-es/cloneDeepWith.js","../ClassicEditor/node_modules/lodash-es/isElement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/config.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/iscomment.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isvisible.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/toarray.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/language.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/locale.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/collection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/first.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/tomap.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/delay.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/unicode.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css?9ffd","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/view.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/template.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css?d134","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css?e9d2","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css?aaf0","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css?2704","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js","../ClassicEditor/node_modules/color-parse/index.mjs","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/utils.js","../ClassicEditor/node_modules/lodash-es/now.js","../ClassicEditor/node_modules/lodash-es/_trimmedEndIndex.js","../ClassicEditor/node_modules/lodash-es/_baseTrim.js","../ClassicEditor/node_modules/lodash-es/isSymbol.js","../ClassicEditor/node_modules/lodash-es/toNumber.js","../ClassicEditor/node_modules/lodash-es/debounce.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css?8d4e","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css?2832","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css?edfa","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/input/inputview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css?1880","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/plugin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/command.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/context.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css?b8f9","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/typecheckable.js","../ClassicEditor/node_modules/lodash-es/clone.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/node.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/text.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js","../ClassicEditor/node_modules/lodash-es/_isKey.js","../ClassicEditor/node_modules/lodash-es/memoize.js","../ClassicEditor/node_modules/lodash-es/_stringToPath.js","../ClassicEditor/node_modules/lodash-es/_memoizeCapped.js","../ClassicEditor/node_modules/lodash-es/_baseToString.js","../ClassicEditor/node_modules/lodash-es/_arrayMap.js","../ClassicEditor/node_modules/lodash-es/toString.js","../ClassicEditor/node_modules/lodash-es/_castPath.js","../ClassicEditor/node_modules/lodash-es/_toKey.js","../ClassicEditor/node_modules/lodash-es/_baseGet.js","../ClassicEditor/node_modules/lodash-es/_baseSlice.js","../ClassicEditor/node_modules/lodash-es/_baseUnset.js","../ClassicEditor/node_modules/lodash-es/_parent.js","../ClassicEditor/node_modules/lodash-es/last.js","../ClassicEditor/node_modules/lodash-es/get.js","../ClassicEditor/node_modules/lodash-es/_assignMergeValue.js","../ClassicEditor/node_modules/lodash-es/_baseFor.js","../ClassicEditor/node_modules/lodash-es/_createBaseFor.js","../ClassicEditor/node_modules/lodash-es/_safeGet.js","../ClassicEditor/node_modules/lodash-es/_baseMergeDeep.js","../ClassicEditor/node_modules/lodash-es/isArrayLikeObject.js","../ClassicEditor/node_modules/lodash-es/toPlainObject.js","../ClassicEditor/node_modules/lodash-es/_baseMerge.js","../ClassicEditor/node_modules/lodash-es/identity.js","../ClassicEditor/node_modules/lodash-es/_overRest.js","../ClassicEditor/node_modules/lodash-es/constant.js","../ClassicEditor/node_modules/lodash-es/_baseSetToString.js","../ClassicEditor/node_modules/lodash-es/_shortOut.js","../ClassicEditor/node_modules/lodash-es/_setToString.js","../ClassicEditor/node_modules/lodash-es/_baseRest.js","../ClassicEditor/node_modules/lodash-es/_apply.js","../ClassicEditor/node_modules/lodash-es/_createAssigner.js","../ClassicEditor/node_modules/lodash-es/_isIterateeCall.js","../ClassicEditor/node_modules/lodash-es/merge.js","../ClassicEditor/node_modules/lodash-es/set.js","../ClassicEditor/node_modules/lodash-es/_baseSet.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js","../ClassicEditor/node_modules/lodash-es/unset.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/element.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/position.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/range.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/document.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css?d589","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isvalidattributename.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js","../ClassicEditor/node_modules/lodash-es/assignIn.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js","../ClassicEditor/node_modules/lodash-es/_SetCache.js","../ClassicEditor/node_modules/lodash-es/_setCacheAdd.js","../ClassicEditor/node_modules/lodash-es/_setCacheHas.js","../ClassicEditor/node_modules/lodash-es/_arraySome.js","../ClassicEditor/node_modules/lodash-es/_cacheHas.js","../ClassicEditor/node_modules/lodash-es/_equalArrays.js","../ClassicEditor/node_modules/lodash-es/_mapToArray.js","../ClassicEditor/node_modules/lodash-es/_setToArray.js","../ClassicEditor/node_modules/lodash-es/_equalByTag.js","../ClassicEditor/node_modules/lodash-es/_equalObjects.js","../ClassicEditor/node_modules/lodash-es/_baseIsEqualDeep.js","../ClassicEditor/node_modules/lodash-es/_baseIsEqual.js","../ClassicEditor/node_modules/lodash-es/isEqualWith.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/datatransfer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/tabobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/view.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/typecheckable.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/node.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/splicearray.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/text.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/element.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/position.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/range.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js","../ClassicEditor/node_modules/lodash-es/cloneDeep.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js","../ClassicEditor/node_modules/lodash-es/isEqual.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/history.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/document.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/findoptimalinsertionrange.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/model.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertobject.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/index.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/bold.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/cog.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/importexport.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/paragraph.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/plus.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/text.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css?0211","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css?cbd7","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css?0497","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css?347c","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css?1a4d","../ClassicEditor/node_modules/vanilla-colorful/lib/utils/math.js","../ClassicEditor/node_modules/vanilla-colorful/lib/utils/convert.js","../ClassicEditor/node_modules/vanilla-colorful/lib/utils/compare.js","../ClassicEditor/node_modules/vanilla-colorful/lib/utils/dom.js","../ClassicEditor/node_modules/vanilla-colorful/lib/components/slider.js","../ClassicEditor/node_modules/vanilla-colorful/lib/components/hue.js","../ClassicEditor/node_modules/vanilla-colorful/lib/components/saturation.js","../ClassicEditor/node_modules/vanilla-colorful/lib/styles/color-picker.js","../ClassicEditor/node_modules/vanilla-colorful/lib/components/color-picker.js","../ClassicEditor/node_modules/vanilla-colorful/lib/styles/hue.js","../ClassicEditor/node_modules/vanilla-colorful/lib/styles/saturation.js","../ClassicEditor/node_modules/vanilla-colorful/lib/entrypoints/hex.js","../ClassicEditor/node_modules/vanilla-colorful/hex-color-picker.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css?53be","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/colorpickerview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css?7831","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css?a08c","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/tooltipmanager.js","../ClassicEditor/node_modules/lodash-es/throttle.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/poweredby.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/verifylicense.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/project-logo.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/findclosestscrollableancestor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/editorui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css?2a16","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css?0cda","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/model.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css?1baf","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css?17b0","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css?009d","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css?45fd","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css?97f1","../ClassicEditor/node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/getsubnodes.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/areconnectedthroughproperties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/editorwatchdog.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/contextwatchdog.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/inserttextcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/inserttextobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/input.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/delete.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/typing.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/enter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css?abb1","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widget.css?47b7","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widget.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css?24e6","../ClassicEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css?0a95","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/lineview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/undoui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-undo/src/undo.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentioncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentionediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css?c111","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionsview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/domwrapperview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionlistitemview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentionui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mention.css?d8de","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-alignment/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js","../ClassicEditor/node_modules/lodash-es/_hasUnicode.js","../ClassicEditor/node_modules/lodash-es/_unicodeToArray.js","../ClassicEditor/node_modules/lodash-es/_stringToArray.js","../ClassicEditor/node_modules/lodash-es/_asciiToArray.js","../ClassicEditor/node_modules/lodash-es/upperFirst.js","../ClassicEditor/node_modules/lodash-es/_createCaseFirst.js","../ClassicEditor/node_modules/lodash-es/_castSlice.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/link.css?4da5","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/linkediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css?7101","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkform.css?837e","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css?b997","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/linkui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/autolink.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/indentcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listutils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/converters.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/theme/list.css?ef70","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/theme/heading.css?2b0a","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageutils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css?66f4","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/converters.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/replaceimagesourcecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/image.css?5c96","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageblock.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageinline.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionutils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css?5152","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css?a152","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-upload/src/filereader.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css?72d0","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css?b791","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css?3f3f","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css?66ed","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googlesheetsnormalizer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removegooglesheetstag.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removexmlns.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeinvalidtablewidth.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/tableproperties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/common.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableutils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-handler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css?183a","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-headings-refresh-handler.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css?8f02","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css?52d0","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableselection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/converters.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/table.css?7a76","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/mediaregistry.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media-placeholder.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css?816e","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/automediaembed.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css?e368","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/ui/mediaformview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css?b12c","../ClassicEditor/node_modules/marked/lib/marked.esm.js","../ClassicEditor/node_modules/turndown/lib/turndown.es.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-markdown-gfm/src/markdown2html/markdown2html.js","../ClassicEditor/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-markdown-gfm/src/html2markdown/html2markdown.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-markdown-gfm/src/gfmdataprocessor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css?361f","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-palette.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontsize/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css?31d2","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/icons/font-size.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontsize.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilycommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontfamily/utils.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/icons/font-family.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontfamily.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebackgroundcolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/table-properties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebordercolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderstylecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderwidthcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablewidthcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableheightcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablealignmentcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css?a66f","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/colorinputview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-properties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/formrow.css?e9c9","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/formrowview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/form.css?9b02","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableform.css?4fab","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css?db5b","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-properties.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/contextualballoon.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css?861e","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-cell-properties.svg","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/commands/tablecellwidthcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/tablecellwidthediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpaddingcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellheightcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderstylecommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbordercolorcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderwidthcommand.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/ui/emojicharactersnavigationview.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/charactergrid.css?2312","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/ui/charactergridview.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/characterinfo.css?80e1","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/ui/characterinfoview.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/emoji-characters.css?93ac","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji.js","../ClassicEditor/src/ckeditor.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-font/src/font.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-mention/src/mention.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/theme/icons/emoji-icon.svg","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-people.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-nature.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-places.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-food.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-activity.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-objects.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-symbols.js","../ClassicEditor/node_modules/@phudak/ckeditor5-emoji/src/emoji-flags.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-link/src/link.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-list/src/list.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-heading/src/heading.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/image.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/table.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembed.js","../ClassicEditor/node_modules/@ckeditor/ckeditor5-markdown-gfm/src/markdown.js","../node_modules/copy-to-clipboard/index.js","../node_modules/dagre/index.js","../node_modules/dagre/lib/acyclic.js","../node_modules/dagre/lib/add-border-segments.js","../node_modules/dagre/lib/coordinate-system.js","../node_modules/dagre/lib/data/list.js","../node_modules/dagre/lib/debug.js","../node_modules/dagre/lib/graphlib.js","../node_modules/dagre/lib/greedy-fas.js","../node_modules/dagre/lib/layout.js","../node_modules/dagre/lib/lodash.js","../node_modules/dagre/lib/nesting-graph.js","../node_modules/dagre/lib/normalize.js","../node_modules/dagre/lib/order/add-subgraph-constraints.js","../node_modules/dagre/lib/order/barycenter.js","../node_modules/dagre/lib/order/build-layer-graph.js","../node_modules/dagre/lib/order/cross-count.js","../node_modules/dagre/lib/order/index.js","../node_modules/dagre/lib/order/init-order.js","../node_modules/dagre/lib/order/resolve-conflicts.js","../node_modules/dagre/lib/order/sort-subgraph.js","../node_modules/dagre/lib/order/sort.js","../node_modules/dagre/lib/parent-dummy-chains.js","../node_modules/dagre/lib/position/bk.js","../node_modules/dagre/lib/position/index.js","../node_modules/dagre/lib/rank/feasible-tree.js","../node_modules/dagre/lib/rank/index.js","../node_modules/dagre/lib/rank/network-simplex.js","../node_modules/dagre/lib/rank/util.js","../node_modules/dagre/lib/util.js","../node_modules/dagre/lib/version.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../node_modules/date-fns/esm/locale/en-US/index.js","../node_modules/date-fns/esm/_lib/defaultLocale/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../node_modules/date-fns/esm/_lib/defaultOptions/index.js","../node_modules/date-fns/esm/_lib/format/longFormatters/index.js","../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","../node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","../node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","../node_modules/date-fns/esm/_lib/getUTCWeek/index.js","../node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","../node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","../node_modules/date-fns/esm/_lib/protectedTokens/index.js","../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","../node_modules/date-fns/esm/_lib/toInteger/index.js","../node_modules/date-fns/esm/addDays/index.js","../node_modules/date-fns/esm/addHours/index.js","../node_modules/date-fns/esm/addMilliseconds/index.js","../node_modules/date-fns/esm/addMinutes/index.js","../node_modules/date-fns/esm/addMonths/index.js","../node_modules/date-fns/esm/addQuarters/index.js","../node_modules/date-fns/esm/addWeeks/index.js","../node_modules/date-fns/esm/addYears/index.js","../node_modules/date-fns/esm/constants/index.js","../node_modules/date-fns/esm/differenceInCalendarDays/index.js","../node_modules/date-fns/esm/differenceInCalendarMonths/index.js","../node_modules/date-fns/esm/differenceInCalendarYears/index.js","../node_modules/date-fns/esm/endOfDay/index.js","../node_modules/date-fns/esm/endOfMonth/index.js","../node_modules/date-fns/esm/endOfWeek/index.js","../node_modules/date-fns/esm/endOfYear/index.js","../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","../node_modules/date-fns/esm/_lib/format/formatters/index.js","../node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","../node_modules/date-fns/esm/format/index.js","../node_modules/date-fns/esm/getDate/index.js","../node_modules/date-fns/esm/getDay/index.js","../node_modules/date-fns/esm/getHours/index.js","../node_modules/date-fns/esm/startOfISOWeek/index.js","../node_modules/date-fns/esm/startOfISOWeekYear/index.js","../node_modules/date-fns/esm/getISOWeekYear/index.js","../node_modules/date-fns/esm/getISOWeek/index.js","../node_modules/date-fns/esm/getMinutes/index.js","../node_modules/date-fns/esm/getMonth/index.js","../node_modules/date-fns/esm/getQuarter/index.js","../node_modules/date-fns/esm/getSeconds/index.js","../node_modules/date-fns/esm/getTime/index.js","../node_modules/date-fns/esm/getYear/index.js","../node_modules/date-fns/esm/isAfter/index.js","../node_modules/date-fns/esm/isBefore/index.js","../node_modules/date-fns/esm/isDate/index.js","../node_modules/date-fns/esm/isEqual/index.js","../node_modules/date-fns/esm/isSameDay/index.js","../node_modules/date-fns/esm/isSameMonth/index.js","../node_modules/date-fns/esm/isSameQuarter/index.js","../node_modules/date-fns/esm/isSameYear/index.js","../node_modules/date-fns/esm/isValid/index.js","../node_modules/date-fns/esm/isWithinInterval/index.js","../node_modules/date-fns/esm/max/index.js","../node_modules/date-fns/esm/min/index.js","../node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js","../node_modules/date-fns/esm/_lib/assign/index.js","../node_modules/date-fns/esm/parse/_lib/Setter.js","../node_modules/date-fns/esm/parse/_lib/Parser.js","../node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js","../node_modules/date-fns/esm/parse/_lib/constants.js","../node_modules/date-fns/esm/parse/_lib/utils.js","../node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js","../node_modules/date-fns/esm/_lib/setUTCWeek/index.js","../node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js","../node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","../node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js","../node_modules/date-fns/esm/_lib/setUTCDay/index.js","../node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js","../node_modules/date-fns/esm/_lib/setUTCISODay/index.js","../node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js","../node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js","../node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js","../node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js","../node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js","../node_modules/date-fns/esm/parse/_lib/parsers/index.js","../node_modules/date-fns/esm/parse/index.js","../node_modules/date-fns/esm/parseISO/index.js","../node_modules/date-fns/esm/set/index.js","../node_modules/date-fns/esm/setHours/index.js","../node_modules/date-fns/esm/setMinutes/index.js","../node_modules/date-fns/esm/setMonth/index.js","../node_modules/date-fns/esm/getDaysInMonth/index.js","../node_modules/date-fns/esm/setQuarter/index.js","../node_modules/date-fns/esm/setSeconds/index.js","../node_modules/date-fns/esm/setYear/index.js","../node_modules/date-fns/esm/startOfDay/index.js","../node_modules/date-fns/esm/startOfMonth/index.js","../node_modules/date-fns/esm/startOfQuarter/index.js","../node_modules/date-fns/esm/startOfWeek/index.js","../node_modules/date-fns/esm/startOfYear/index.js","../node_modules/date-fns/esm/subDays/index.js","../node_modules/date-fns/esm/subMilliseconds/index.js","../node_modules/date-fns/esm/subMonths/index.js","../node_modules/date-fns/esm/subQuarters/index.js","../node_modules/date-fns/esm/subWeeks/index.js","../node_modules/date-fns/esm/subYears/index.js","../node_modules/date-fns/esm/toDate/index.js","../node_modules/dayjs/plugin/isBetween.js","../node_modules/dayjs/plugin/isSameOrAfter.js","../node_modules/dayjs/plugin/isSameOrBefore.js","../node_modules/dayjs/plugin/localeData.js","../node_modules/dayjs/plugin/localizedFormat.js","../node_modules/dayjs/plugin/minMax.js","../node_modules/dayjs/plugin/utc.js","../node_modules/deepmerge/dist/cjs.js","../node_modules/dom-serializer/index.js","../node_modules/domelementtype/lib/index.js","../node_modules/domutils/index.js","../node_modules/domutils/lib/helpers.js","../node_modules/domutils/lib/legacy.js","../node_modules/domutils/lib/manipulation.js","../node_modules/domutils/lib/querying.js","../node_modules/domutils/lib/stringify.js","../node_modules/domutils/lib/traversal.js","../node_modules/domutils/node_modules/domelementtype/index.js","../node_modules/entities/lib/decode.js","../node_modules/entities/lib/decode_codepoint.js","../node_modules/entities/lib/encode.js","../node_modules/entities/lib/index.js","../node_modules/escape-string-regexp/index.js","../node_modules/events/events.js","../node_modules/extend/index.js","../node_modules/formik/node_modules/deepmerge/dist/es.js","../node_modules/lodash-es/_freeGlobal.js","../node_modules/lodash-es/_root.js","../node_modules/lodash-es/_Symbol.js","../node_modules/lodash-es/_getRawTag.js","../node_modules/lodash-es/_objectToString.js","../node_modules/lodash-es/_baseGetTag.js","../node_modules/lodash-es/_overArg.js","../node_modules/lodash-es/_getPrototype.js","../node_modules/lodash-es/isObjectLike.js","../node_modules/lodash-es/isPlainObject.js","../node_modules/lodash-es/_listCacheClear.js","../node_modules/lodash-es/eq.js","../node_modules/lodash-es/_assocIndexOf.js","../node_modules/lodash-es/_listCacheDelete.js","../node_modules/lodash-es/_listCacheGet.js","../node_modules/lodash-es/_listCacheHas.js","../node_modules/lodash-es/_listCacheSet.js","../node_modules/lodash-es/_ListCache.js","../node_modules/lodash-es/_stackClear.js","../node_modules/lodash-es/_stackDelete.js","../node_modules/lodash-es/_stackGet.js","../node_modules/lodash-es/_stackHas.js","../node_modules/lodash-es/isObject.js","../node_modules/lodash-es/isFunction.js","../node_modules/lodash-es/_coreJsData.js","../node_modules/lodash-es/_isMasked.js","../node_modules/lodash-es/_toSource.js","../node_modules/lodash-es/_baseIsNative.js","../node_modules/lodash-es/_getValue.js","../node_modules/lodash-es/_getNative.js","../node_modules/lodash-es/_Map.js","../node_modules/lodash-es/_nativeCreate.js","../node_modules/lodash-es/_hashClear.js","../node_modules/lodash-es/_hashDelete.js","../node_modules/lodash-es/_hashGet.js","../node_modules/lodash-es/_hashHas.js","../node_modules/lodash-es/_hashSet.js","../node_modules/lodash-es/_Hash.js","../node_modules/lodash-es/_mapCacheClear.js","../node_modules/lodash-es/_isKeyable.js","../node_modules/lodash-es/_getMapData.js","../node_modules/lodash-es/_mapCacheDelete.js","../node_modules/lodash-es/_mapCacheGet.js","../node_modules/lodash-es/_mapCacheHas.js","../node_modules/lodash-es/_mapCacheSet.js","../node_modules/lodash-es/_MapCache.js","../node_modules/lodash-es/_stackSet.js","../node_modules/lodash-es/_Stack.js","../node_modules/lodash-es/_arrayEach.js","../node_modules/lodash-es/_defineProperty.js","../node_modules/lodash-es/_baseAssignValue.js","../node_modules/lodash-es/_assignValue.js","../node_modules/lodash-es/_copyObject.js","../node_modules/lodash-es/_baseTimes.js","../node_modules/lodash-es/_baseIsArguments.js","../node_modules/lodash-es/isArguments.js","../node_modules/lodash-es/isArray.js","../node_modules/lodash-es/stubFalse.js","../node_modules/lodash-es/isBuffer.js","../node_modules/lodash-es/_isIndex.js","../node_modules/lodash-es/isLength.js","../node_modules/lodash-es/_baseIsTypedArray.js","../node_modules/lodash-es/_baseUnary.js","../node_modules/lodash-es/_nodeUtil.js","../node_modules/lodash-es/isTypedArray.js","../node_modules/lodash-es/_arrayLikeKeys.js","../node_modules/lodash-es/_isPrototype.js","../node_modules/lodash-es/_nativeKeys.js","../node_modules/lodash-es/_baseKeys.js","../node_modules/lodash-es/isArrayLike.js","../node_modules/lodash-es/keys.js","../node_modules/lodash-es/_baseAssign.js","../node_modules/lodash-es/_nativeKeysIn.js","../node_modules/lodash-es/_baseKeysIn.js","../node_modules/lodash-es/keysIn.js","../node_modules/lodash-es/_baseAssignIn.js","../node_modules/lodash-es/_cloneBuffer.js","../node_modules/lodash-es/_copyArray.js","../node_modules/lodash-es/_arrayFilter.js","../node_modules/lodash-es/stubArray.js","../node_modules/lodash-es/_getSymbols.js","../node_modules/lodash-es/_copySymbols.js","../node_modules/lodash-es/_arrayPush.js","../node_modules/lodash-es/_getSymbolsIn.js","../node_modules/lodash-es/_copySymbolsIn.js","../node_modules/lodash-es/_baseGetAllKeys.js","../node_modules/lodash-es/_getAllKeys.js","../node_modules/lodash-es/_getAllKeysIn.js","../node_modules/lodash-es/_DataView.js","../node_modules/lodash-es/_Promise.js","../node_modules/lodash-es/_Set.js","../node_modules/lodash-es/_WeakMap.js","../node_modules/lodash-es/_getTag.js","../node_modules/lodash-es/_initCloneArray.js","../node_modules/lodash-es/_Uint8Array.js","../node_modules/lodash-es/_cloneArrayBuffer.js","../node_modules/lodash-es/_cloneDataView.js","../node_modules/lodash-es/_cloneRegExp.js","../node_modules/lodash-es/_cloneSymbol.js","../node_modules/lodash-es/_cloneTypedArray.js","../node_modules/lodash-es/_initCloneByTag.js","../node_modules/lodash-es/_baseCreate.js","../node_modules/lodash-es/_initCloneObject.js","../node_modules/lodash-es/_baseIsMap.js","../node_modules/lodash-es/isMap.js","../node_modules/lodash-es/_baseIsSet.js","../node_modules/lodash-es/isSet.js","../node_modules/lodash-es/_baseClone.js","../node_modules/lodash-es/cloneDeep.js","../node_modules/lodash-es/clone.js","../node_modules/lodash-es/_arrayMap.js","../node_modules/lodash-es/isSymbol.js","../node_modules/lodash-es/memoize.js","../node_modules/lodash-es/_stringToPath.js","../node_modules/lodash-es/_memoizeCapped.js","../node_modules/lodash-es/_toKey.js","../node_modules/lodash-es/_baseToString.js","../node_modules/lodash-es/toString.js","../node_modules/lodash-es/toPath.js","../node_modules/formik/src/FormikContext.tsx","../node_modules/formik/src/utils.ts","../node_modules/formik/src/Formik.tsx","../node_modules/formik/src/Form.tsx","../node_modules/formik/src/FieldArray.tsx","../node_modules/graphlib/index.js","../node_modules/graphlib/lib/alg/components.js","../node_modules/graphlib/lib/alg/dfs.js","../node_modules/graphlib/lib/alg/dijkstra-all.js","../node_modules/graphlib/lib/alg/dijkstra.js","../node_modules/graphlib/lib/alg/find-cycles.js","../node_modules/graphlib/lib/alg/floyd-warshall.js","../node_modules/graphlib/lib/alg/index.js","../node_modules/graphlib/lib/alg/is-acyclic.js","../node_modules/graphlib/lib/alg/postorder.js","../node_modules/graphlib/lib/alg/preorder.js","../node_modules/graphlib/lib/alg/prim.js","../node_modules/graphlib/lib/alg/tarjan.js","../node_modules/graphlib/lib/alg/topsort.js","../node_modules/graphlib/lib/data/priority-queue.js","../node_modules/graphlib/lib/graph.js","../node_modules/graphlib/lib/index.js","../node_modules/graphlib/lib/json.js","../node_modules/graphlib/lib/lodash.js","../node_modules/graphlib/lib/version.js","../node_modules/resolve-pathname/esm/resolve-pathname.js","../node_modules/value-equal/esm/value-equal.js","../node_modules/history/esm/history.js","../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../node_modules/htmlparser2/lib/CollectingHandler.js","../node_modules/htmlparser2/lib/FeedHandler.js","../node_modules/htmlparser2/lib/Parser.js","../node_modules/htmlparser2/lib/ProxyHandler.js","../node_modules/htmlparser2/lib/Stream.js","../node_modules/htmlparser2/lib/Tokenizer.js","../node_modules/htmlparser2/lib/WritableStream.js","../node_modules/htmlparser2/lib/index.js","../node_modules/htmlparser2/node_modules/domelementtype/index.js","../node_modules/htmlparser2/node_modules/domhandler/index.js","../node_modules/htmlparser2/node_modules/domhandler/lib/element.js","../node_modules/htmlparser2/node_modules/domhandler/lib/node.js","../node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js","../node_modules/ieee754/index.js","../node_modules/inherits/inherits_browser.js","../node_modules/inline-style-parser/index.js","../node_modules/intersection-observer/intersection-observer.js","../node_modules/intl-messageformat/lib/src/core.js","../node_modules/intl-messageformat/lib/src/error.js","../node_modules/intl-messageformat/lib/src/formatters.js","../node_modules/invariant/browser.js","../node_modules/is-buffer/index.js","../node_modules/is-plain-object/dist/is-plain-object.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_arrayEach.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/_arrayIncludes.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_arrayReduce.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_asciiSize.js","../node_modules/lodash/_asciiToArray.js","../node_modules/lodash/_asciiWords.js","../node_modules/lodash/_assignMergeValue.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_baseAssign.js","../node_modules/lodash/_baseAssignIn.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/_baseClone.js","../node_modules/lodash/_baseCreate.js","../node_modules/lodash/_baseEach.js","../node_modules/lodash/_baseExtremum.js","../node_modules/lodash/_baseFilter.js","../node_modules/lodash/_baseFindIndex.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/_baseGt.js","../node_modules/lodash/_baseHas.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_baseIndexOf.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsMap.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_baseIsNaN.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_baseIsSet.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/_baseLt.js","../node_modules/lodash/_baseMap.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/_baseMerge.js","../node_modules/lodash/_baseMergeDeep.js","../node_modules/lodash/_baseOrderBy.js","../node_modules/lodash/_basePick.js","../node_modules/lodash/_basePickBy.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/_basePropertyOf.js","../node_modules/lodash/_baseRange.js","../node_modules/lodash/_baseReduce.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_baseSet.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_baseSlice.js","../node_modules/lodash/_baseSortBy.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/_baseUnset.js","../node_modules/lodash/_baseValues.js","../node_modules/lodash/_baseZipObject.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_castFunction.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_castSlice.js","../node_modules/lodash/_cloneArrayBuffer.js","../node_modules/lodash/_cloneBuffer.js","../node_modules/lodash/_cloneDataView.js","../node_modules/lodash/_cloneRegExp.js","../node_modules/lodash/_cloneSymbol.js","../node_modules/lodash/_cloneTypedArray.js","../node_modules/lodash/_compareAscending.js","../node_modules/lodash/_compareMultiple.js","../node_modules/lodash/_copyArray.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/_copySymbols.js","../node_modules/lodash/_copySymbolsIn.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_createAssigner.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_createCaseFirst.js","../node_modules/lodash/_createCompounder.js","../node_modules/lodash/_createFind.js","../node_modules/lodash/_createRange.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_customOmitClone.js","../node_modules/lodash/_deburrLetter.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_flatRest.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_getAllKeysIn.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_getSymbolsIn.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/_hasUnicode.js","../node_modules/lodash/_hasUnicodeWord.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_initCloneArray.js","../node_modules/lodash/_initCloneByTag.js","../node_modules/lodash/_initCloneObject.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/_parent.js","../node_modules/lodash/_root.js","../node_modules/lodash/_safeGet.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_strictIndexOf.js","../node_modules/lodash/_stringSize.js","../node_modules/lodash/_stringToArray.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_unicodeSize.js","../node_modules/lodash/_unicodeToArray.js","../node_modules/lodash/_unicodeWords.js","../node_modules/lodash/camelCase.js","../node_modules/lodash/capitalize.js","../node_modules/lodash/chunk.js","../node_modules/lodash/clone.js","../node_modules/lodash/cloneDeep.js","../node_modules/lodash/constant.js","../node_modules/lodash/debounce.js","../node_modules/lodash/deburr.js","../node_modules/lodash/defaults.js","../node_modules/lodash/each.js","../node_modules/lodash/eq.js","../node_modules/lodash/filter.js","../node_modules/lodash/find.js","../node_modules/lodash/findIndex.js","../node_modules/lodash/flatten.js","../node_modules/lodash/forEach.js","../node_modules/lodash/forIn.js","../node_modules/lodash/get.js","../node_modules/lodash/has.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/identity.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/isEmpty.js","../node_modules/lodash/isEqual.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isMap.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isPlainObject.js","../node_modules/lodash/isSet.js","../node_modules/lodash/isString.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/isUndefined.js","../node_modules/lodash/keys.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/last.js","../node_modules/lodash/lodash.js","../node_modules/lodash/map.js","../node_modules/lodash/mapKeys.js","../node_modules/lodash/mapValues.js","../node_modules/lodash/max.js","../node_modules/lodash/memoize.js","../node_modules/lodash/merge.js","../node_modules/lodash/min.js","../node_modules/lodash/minBy.js","../node_modules/lodash/noop.js","../node_modules/lodash/now.js","../node_modules/lodash/omit.js","../node_modules/lodash/pick.js","../node_modules/lodash/property.js","../node_modules/lodash/range.js","../node_modules/lodash/reduce.js","../node_modules/lodash/size.js","../node_modules/lodash/snakeCase.js","../node_modules/lodash/sortBy.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/toFinite.js","../node_modules/lodash/toInteger.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/toPlainObject.js","../node_modules/lodash/toString.js","../node_modules/lodash/transform.js","../node_modules/lodash/union.js","../node_modules/lodash/uniqueId.js","../node_modules/lodash/upperFirst.js","../node_modules/lodash/values.js","../node_modules/lodash/words.js","../node_modules/lodash/zipObject.js","../node_modules/lottie-web/build/player/lottie.js","../node_modules/moment-timezone/index.js","../node_modules/moment-timezone/moment-timezone.js","../node_modules/moment/moment.js","../node_modules/object-assign/index.js","../node_modules/parse-srcset/src/parse-srcset.js","../node_modules/path-to-regexp/index.js","../node_modules/path-to-regexp/node_modules/isarray/index.js","../node_modules/picocolors/picocolors.browser.js","../node_modules/postcss/lib/at-rule.js","../node_modules/postcss/lib/comment.js","../node_modules/postcss/lib/container.js","../node_modules/postcss/lib/css-syntax-error.js","../node_modules/postcss/lib/declaration.js","../node_modules/postcss/lib/document.js","../node_modules/postcss/lib/fromJSON.js","../node_modules/postcss/lib/input.js","../node_modules/postcss/lib/lazy-result.js","../node_modules/postcss/lib/list.js","../node_modules/postcss/lib/map-generator.js","../node_modules/postcss/lib/no-work-result.js","../node_modules/postcss/lib/node.js","../node_modules/postcss/lib/parse.js","../node_modules/postcss/lib/parser.js","../node_modules/postcss/lib/postcss.js","../node_modules/postcss/lib/previous-map.js","../node_modules/postcss/lib/processor.js","../node_modules/postcss/lib/result.js","../node_modules/postcss/lib/root.js","../node_modules/postcss/lib/rule.js","../node_modules/postcss/lib/stringifier.js","../node_modules/postcss/lib/stringify.js","../node_modules/postcss/lib/symbols.js","../node_modules/postcss/lib/tokenize.js","../node_modules/postcss/lib/warn-once.js","../node_modules/postcss/lib/warning.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/property-expr/index.js","../node_modules/rc-checkbox/es/index.js","../node_modules/rc-util/es/hooks/useId.js","../node_modules/rc-dialog/es/Dialog/Mask.js","../node_modules/rc-dialog/es/util.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/index.js","../node_modules/rc-dialog/es/DialogWrap.js","../node_modules/rc-dialog/es/index.js","../node_modules/rc-dropdown/es/placements.js","../node_modules/rc-dropdown/es/hooks/useAccessibility.js","../node_modules/rc-dropdown/es/Dropdown.js","../node_modules/rc-dropdown/es/index.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/src/util.ts","../node_modules/src/rule/required.ts","../node_modules/src/rule/url.ts","../node_modules/src/rule/type.ts","../node_modules/src/rule/enum.ts","../node_modules/src/rule/index.ts","../node_modules/src/rule/whitespace.ts","../node_modules/src/rule/range.ts","../node_modules/src/rule/pattern.ts","../node_modules/src/validator/type.ts","../node_modules/src/validator/index.ts","../node_modules/src/validator/string.ts","../node_modules/src/validator/method.ts","../node_modules/src/validator/number.ts","../node_modules/src/validator/boolean.ts","../node_modules/src/validator/regexp.ts","../node_modules/src/validator/integer.ts","../node_modules/src/validator/float.ts","../node_modules/src/validator/array.ts","../node_modules/src/validator/object.ts","../node_modules/src/validator/enum.ts","../node_modules/src/validator/pattern.ts","../node_modules/src/validator/date.ts","../node_modules/src/validator/required.ts","../node_modules/src/validator/any.ts","../node_modules/src/messages.ts","../node_modules/src/index.ts","../node_modules/rc-field-form/es/utils/messages.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/NameMap.js","../node_modules/rc-field-form/es/useForm.js","../node_modules/rc-field-form/es/utils/asyncUtil.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/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-menu/es/hooks/useAccessibility.js","../node_modules/rc-menu/es/hooks/useKeyRecords.js","../node_modules/rc-menu/es/utils/timeUtil.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/nodeUtil.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/Menu.js","../node_modules/rc-menu/es/MenuItemGroup.js","../node_modules/rc-menu/es/Divider.js","../node_modules/rc-menu/es/index.js","../node_modules/rc-motion/es/context.js","../node_modules/rc-motion/es/DomWrapper.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-motion/es/hooks/useStepQueue.js","../node_modules/rc-motion/es/hooks/useNextFrame.js","../node_modules/rc-motion/es/hooks/useStatus.js","../node_modules/rc-util/es/hooks/useSyncState.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-motion/es/index.js","../node_modules/rc-notification/es/Notice.js","../node_modules/rc-notification/es/Notification.js","../node_modules/rc-notification/es/index.js","../node_modules/rc-notification/es/useNotification.js","../node_modules/rc-notification/lib/Notice.js","../node_modules/rc-notification/lib/useNotification.js","../node_modules/rc-overflow/es/Item.js","../node_modules/rc-overflow/es/hooks/useEffectState.js","../node_modules/rc-overflow/es/hooks/channelUpdate.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-overflow/es/index.js","../node_modules/rc-pagination/es/locale/en_US.js","../node_modules/rc-pagination/lib/locale/en_US.js","../node_modules/rc-picker/lib/locale/en_US.js","../node_modules/rc-resize-observer/es/Collection.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/SingleObserver/index.js","../node_modules/rc-resize-observer/es/index.js","../node_modules/rc-select/es/hooks/useId.js","../node_modules/rc-select/es/hooks/useBaseProps.js","../node_modules/rc-select/es/hooks/useLock.js","../node_modules/rc-select/es/TransBtn.js","../node_modules/rc-select/es/Selector/Input.js","../node_modules/rc-select/es/utils/commonUtil.js","../node_modules/rc-select/es/Selector/MultipleSelector.js","../node_modules/rc-select/es/hooks/useLayoutEffect.js","../node_modules/rc-select/es/Selector/SingleSelector.js","../node_modules/rc-select/es/Selector/index.js","../node_modules/rc-select/es/utils/keyUtil.js","../node_modules/rc-select/es/SelectTrigger.js","../node_modules/rc-select/es/utils/valueUtil.js","../node_modules/rc-select/es/BaseSelect.js","../node_modules/rc-select/es/hooks/useDelayReset.js","../node_modules/rc-select/es/hooks/useSelectTriggerControl.js","../node_modules/rc-select/es/hooks/useFilterOptions.js","../node_modules/rc-select/es/utils/legacyUtil.js","../node_modules/rc-select/es/hooks/useRefFunc.js","../node_modules/rc-select/es/OptGroup.js","../node_modules/rc-select/es/Option.js","../node_modules/rc-select/es/SelectContext.js","../node_modules/rc-select/es/OptionList.js","../node_modules/rc-select/es/utils/platformUtil.js","../node_modules/rc-select/es/Select.js","../node_modules/rc-select/es/hooks/useOptions.js","../node_modules/rc-select/es/hooks/useCache.js","../node_modules/rc-select/es/index.js","../node_modules/rc-tooltip/es/placements.js","../node_modules/rc-tree/es/Indent.js","../node_modules/rc-tree/es/TreeNode.js","../node_modules/rc-tree/es/contextTypes.js","../node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js","../node_modules/rc-tree/es/MotionTreeNode.js","../node_modules/rc-tree/es/useUnmount.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/rc-tree/es/DropIndicator.js","../node_modules/rc-tree/es/index.js","../node_modules/rc-tree/es/util.js","../node_modules/rc-tree/es/utils/conductUtil.js","../node_modules/rc-tree/es/utils/keyUtil.js","../node_modules/rc-tree/es/utils/treeUtil.js","../node_modules/rc-util/es/Portal.js","../node_modules/rc-trigger/es/utils/alignUtil.js","../node_modules/rc-trigger/es/utils/legacyUtil.js","../node_modules/rc-trigger/es/Popup/Mask.js","../node_modules/src/propertyUtils.js","../node_modules/src/utils.js","../node_modules/src/getOffsetParent.js","../node_modules/src/isAncestorFixed.js","../node_modules/src/getVisibleRectForElement.js","../node_modules/src/getRegion.js","../node_modules/src/getAlignOffset.js","../node_modules/src/getElFuturePos.js","../node_modules/src/align/align.js","../node_modules/src/adjustForViewport.js","../node_modules/src/align/alignElement.js","../node_modules/rc-align/es/util.js","../node_modules/rc-align/es/Align.js","../node_modules/rc-align/es/hooks/useBuffer.js","../node_modules/src/align/alignPoint.js","../node_modules/rc-align/es/index.js","../node_modules/rc-trigger/es/Popup/useVisibleStatus.js","../node_modules/rc-trigger/es/Popup/PopupInner.js","../node_modules/rc-trigger/es/Popup/useStretchStyle.js","../node_modules/rc-trigger/es/Popup/MobilePopupInner.js","../node_modules/rc-trigger/es/Popup/index.js","../node_modules/rc-trigger/es/context.js","../node_modules/rc-trigger/es/index.js","../node_modules/rc-util/es/Children/toArray.js","../node_modules/rc-util/es/Dom/addEventListener.js","../node_modules/rc-util/es/Dom/canUseDom.js","../node_modules/rc-util/es/Dom/contains.js","../node_modules/rc-util/es/Dom/css.js","../node_modules/rc-util/es/Dom/dynamicCSS.js","../node_modules/rc-util/es/Dom/findDOMNode.js","../node_modules/rc-util/es/Dom/focus.js","../node_modules/rc-util/es/Dom/isVisible.js","../node_modules/rc-util/es/Dom/styleChecker.js","../node_modules/rc-util/es/KeyCode.js","../node_modules/rc-util/es/React/render.js","../node_modules/rc-util/es/getScrollBarSize.js","../node_modules/rc-util/es/hooks/useEvent.js","../node_modules/rc-util/es/hooks/useLayoutEffect.js","../node_modules/rc-util/es/hooks/useMemo.js","../node_modules/rc-util/es/hooks/useMergedState.js","../node_modules/rc-util/es/hooks/useState.js","../node_modules/rc-util/es/isEqual.js","../node_modules/rc-util/es/isMobile.js","../node_modules/rc-util/es/omit.js","../node_modules/rc-util/es/pickAttrs.js","../node_modules/rc-util/es/raf.js","../node_modules/rc-util/es/ref.js","../node_modules/rc-util/es/utils/get.js","../node_modules/rc-util/es/utils/set.js","../node_modules/rc-util/es/warning.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/rc-util/lib/hooks/useMemo.js","../node_modules/rc-util/lib/utils/get.js","../node_modules/rc-util/lib/utils/set.js","../node_modules/rc-util/lib/warning.js","../node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/rc-util/node_modules/react-is/index.js","../node_modules/rc-virtual-list/es/Filler.js","../node_modules/rc-virtual-list/es/Item.js","../node_modules/rc-virtual-list/es/hooks/useDiffItem.js","../node_modules/rc-virtual-list/es/utils/algorithmUtil.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/utils/CacheMap.js","../node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js","../node_modules/rc-virtual-list/es/hooks/useScrollTo.js","../node_modules/rc-virtual-list/es/ScrollBar.js","../node_modules/rc-virtual-list/es/utils/scrollbarUtil.js","../node_modules/rc-virtual-list/es/List.js","../node_modules/rc-virtual-list/es/hooks/useHeights.js","../node_modules/rc-virtual-list/es/hooks/useGetSize.js","../node_modules/rc-virtual-list/es/hooks/useChildren.js","../node_modules/rc-virtual-list/es/index.js","../node_modules/react-chartjs-2/src/utils.ts","../node_modules/react-chartjs-2/src/chart.tsx","../node_modules/react-chartjs-2/src/typedCharts.tsx","../node_modules/react-csv/index.js","../node_modules/react-csv/lib/components/Download.js","../node_modules/react-csv/lib/components/Link.js","../node_modules/react-csv/lib/core.js","../node_modules/react-csv/lib/index.js","../node_modules/react-csv/lib/metaProps.js","../node_modules/react-datepicker/dist/react-datepicker.min.js","../node_modules/react-dnd-html5-backend/dist/esm/utils/js_utils.js","../node_modules/react-dnd-html5-backend/dist/esm/EnterLeaveCounter.js","../node_modules/react-dnd-html5-backend/dist/esm/BrowserDetector.js","../node_modules/react-dnd-html5-backend/dist/esm/MonotonicInterpolant.js","../node_modules/react-dnd-html5-backend/dist/esm/OffsetUtils.js","../node_modules/react-dnd-html5-backend/dist/esm/NativeTypes.js","../node_modules/react-dnd-html5-backend/dist/esm/NativeDragSources/nativeTypesConfig.js","../node_modules/react-dnd-html5-backend/dist/esm/NativeDragSources/getDataFromDataTransfer.js","../node_modules/react-dnd-html5-backend/dist/esm/NativeDragSources/NativeDragSource.js","../node_modules/react-dnd-html5-backend/dist/esm/NativeDragSources/index.js","../node_modules/react-dnd-html5-backend/dist/esm/OptionsReader.js","../node_modules/react-dnd-html5-backend/dist/esm/HTML5BackendImpl.js","../node_modules/react-dnd-html5-backend/dist/esm/index.js","../node_modules/react-dnd/dist/esm/core/DndContext.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/types.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/local/setClientOffset.js","../node_modules/dnd-core/dist/esm/utils/js_utils.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/beginDrag.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/publishDragSource.js","../node_modules/dnd-core/dist/esm/utils/matchesType.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/hover.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/drop.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/endDrag.js","../node_modules/dnd-core/dist/esm/classes/DragDropManagerImpl.js","../node_modules/dnd-core/dist/esm/actions/dragDrop/index.js","../node_modules/dnd-core/dist/esm/utils/equality.js","../node_modules/dnd-core/dist/esm/reducers/dragOffset.js","../node_modules/dnd-core/dist/esm/actions/registry.js","../node_modules/dnd-core/dist/esm/reducers/dragOperation.js","../node_modules/dnd-core/dist/esm/reducers/refCount.js","../node_modules/dnd-core/dist/esm/utils/dirtiness.js","../node_modules/dnd-core/dist/esm/reducers/dirtyHandlerIds.js","../node_modules/dnd-core/dist/esm/reducers/stateId.js","../node_modules/dnd-core/dist/esm/reducers/index.js","../node_modules/dnd-core/dist/esm/utils/coords.js","../node_modules/dnd-core/dist/esm/classes/DragDropMonitorImpl.js","../node_modules/dnd-core/dist/esm/interfaces.js","../node_modules/dnd-core/dist/esm/utils/getNextUniqueId.js","../node_modules/dnd-core/dist/esm/contracts.js","../node_modules/@react-dnd/asap/src/makeRequestCall.ts","../node_modules/@react-dnd/asap/src/RawTask.ts","../node_modules/@react-dnd/asap/src/asap.ts","../node_modules/@react-dnd/asap/src/AsapQueue.ts","../node_modules/@react-dnd/asap/src/TaskFactory.ts","../node_modules/dnd-core/dist/esm/classes/HandlerRegistryImpl.js","../node_modules/dnd-core/dist/esm/createDragDropManager.js","../node_modules/react-dnd/dist/esm/core/DndProvider.js","../node_modules/react-dom/cjs/react-dom-server.browser.production.min.js","../node_modules/react-dom/cjs/react-dom.production.min.js","../node_modules/react-dom/index.js","../node_modules/react-dom/server.browser.js","../node_modules/react-fast-compare/index.js","../node_modules/react-hotjar/index.js","../node_modules/react-hotjar/src/react-hotjar.js","../node_modules/react-html-parser/lib/HtmlParser.js","../node_modules/react-html-parser/lib/convertNodeToElement.js","../node_modules/react-html-parser/lib/dom/attributes/BooleanAttributes.js","../node_modules/react-html-parser/lib/dom/attributes/ReactAttributes.js","../node_modules/react-html-parser/lib/dom/elements/VoidElements.js","../node_modules/react-html-parser/lib/elementTypes/StyleElementType.js","../node_modules/react-html-parser/lib/elementTypes/TagElementType.js","../node_modules/react-html-parser/lib/elementTypes/TextElementType.js","../node_modules/react-html-parser/lib/elementTypes/UnsupportedElementType.js","../node_modules/react-html-parser/lib/elementTypes/index.js","../node_modules/react-html-parser/lib/index.js","../node_modules/react-html-parser/lib/processNodes.js","../node_modules/react-html-parser/lib/utils/generatePropsFromAttributes.js","../node_modules/react-html-parser/lib/utils/htmlAttributesToReact.js","../node_modules/react-html-parser/lib/utils/inlineStyleToObject.js","../node_modules/react-html-parser/lib/utils/isEmptyTextNode.js","../node_modules/react-html-parser/lib/utils/isValidTagOrAttributeName.js","../node_modules/react-infinite-scroller/dist/InfiniteScroll.js","../node_modules/react-infinite-scroller/index.js","../node_modules/react-innertext/index.js","../node_modules/react-intl/lib/src/components/injectIntl.js","../node_modules/react-intl/lib/src/components/message.js","../node_modules/react-intl/lib/src/components/useIntl.js","../node_modules/react-intl/lib/src/utils.js","../node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-is/index.js","../node_modules/react-json-editor-ajrm/es/mitsuketa/index.js","../node_modules/react-json-editor-ajrm/locale/en.js","../node_modules/react-lottie/dist/index.js","../node_modules/react-markdown/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-markdown/node_modules/react-is/index.js","../node_modules/react-onclickoutside/dist/react-onclickoutside.es.js","../node_modules/react-popper/lib/esm/Manager.js","../node_modules/react-popper/lib/esm/utils.js","../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../node_modules/@popperjs/core/lib/popper.js","../node_modules/react-popper/lib/esm/usePopper.js","../node_modules/react-popper/lib/esm/Popper.js","../node_modules/react-popper/lib/esm/Reference.js","../node_modules/react-popper/node_modules/react-fast-compare/index.js","../node_modules/react-redux/es/components/Context.js","../node_modules/react-redux/es/utils/batch.js","../node_modules/react-redux/es/utils/Subscription.js","../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","../node_modules/react-redux/es/components/Provider.js","../node_modules/react-redux/es/hooks/useReduxContext.js","../node_modules/react-redux/es/hooks/useStore.js","../node_modules/react-redux/es/hooks/useDispatch.js","../node_modules/react-redux/es/hooks/useSelector.js","../node_modules/react-redux/es/index.js","../node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-redux/node_modules/react-is/index.js","../node_modules/react-router-dom/modules/BrowserRouter.js","../node_modules/react-router-dom/modules/HashRouter.js","../node_modules/react-router-dom/modules/utils/locationUtils.js","../node_modules/react-router-dom/modules/Link.js","../node_modules/react-router-dom/modules/NavLink.js","../node_modules/react-router/modules/miniCreateReactContext.js","../node_modules/react-router/modules/createContext.js","../node_modules/react-router/modules/createNamedContext.js","../node_modules/react-router/modules/HistoryContext.js","../node_modules/react-router/modules/RouterContext.js","../node_modules/react-router/modules/Router.js","../node_modules/react-router/modules/MemoryRouter.js","../node_modules/react-router/modules/Lifecycle.js","../node_modules/react-router/modules/Prompt.js","../node_modules/react-router/modules/generatePath.js","../node_modules/react-router/modules/Redirect.js","../node_modules/react-router/modules/matchPath.js","../node_modules/react-router/modules/Route.js","../node_modules/react-router/modules/StaticRouter.js","../node_modules/react-router/modules/Switch.js","../node_modules/react-router/modules/withRouter.js","../node_modules/react-router/modules/hooks.js","../node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js","../node_modules/react-use/lib/misc/util.js","../node_modules/react-use/lib/useAsyncFn.js","../node_modules/react-use/lib/useDebounce.js","../node_modules/react-use/lib/useEffectOnce.js","../node_modules/react-use/lib/useIsomorphicLayoutEffect.js","../node_modules/react-use/lib/useLatest.js","../node_modules/react-use/lib/useMountedState.js","../node_modules/react-use/lib/useRaf.js","../node_modules/react-use/lib/useThrottle.js","../node_modules/react-use/lib/useTimeoutFn.js","../node_modules/react-use/lib/useUnmount.js","../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react.production.min.js","../node_modules/react/index.js","../node_modules/react/jsx-runtime.js","../node_modules/redux-logger/dist/redux-logger.js","../node_modules/redux-persist/es/integration/react.js","../node_modules/redux-persist/lib/stateReconciler/hardSet.js","../node_modules/redux-persist/lib/storage/createWebStorage.js","../node_modules/redux-persist/lib/storage/getStorage.js","../node_modules/redux-persist/lib/storage/index.js","../node_modules/redux/es/redux.js","../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../node_modules/safe-buffer/index.js","../node_modules/sanitize-html/index.js","../node_modules/sanitize-html/node_modules/dom-serializer/lib/foreignNames.js","../node_modules/sanitize-html/node_modules/dom-serializer/lib/index.js","../node_modules/sanitize-html/node_modules/domhandler/lib/index.js","../node_modules/sanitize-html/node_modules/domhandler/lib/node.js","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/feeds.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/helpers.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/index.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/legacy.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/manipulation.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/querying.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/stringify.ts","../https:/raw.githubusercontent.com/fb55/domutils/96c989e159c98218958f375ea04210f2d1b43c0c/src/traversal.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode_codepoint.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/encode.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/escape.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-html.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-xml.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/encode-html.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/index.ts","../https:/raw.githubusercontent.com/fb55/htmlparser2/c123610e003a1eaebc61febed01cabb6e41eb658/src/Parser.ts","../https:/raw.githubusercontent.com/fb55/htmlparser2/c123610e003a1eaebc61febed01cabb6e41eb658/src/Tokenizer.ts","../https:/raw.githubusercontent.com/fb55/htmlparser2/c123610e003a1eaebc61febed01cabb6e41eb658/src/index.ts","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/scheduler/index.js","../node_modules/scroll/index.js","../node_modules/scrollparent/scrollparent.js","../node_modules/shallowequal/index.js","../node_modules/string_decoder/lib/string_decoder.js","../node_modules/striptags/src/striptags.js","../node_modules/style-to-object/index.js","../node_modules/tiny-invariant/dist/tiny-invariant.cjs.js","../node_modules/tiny-warning/dist/tiny-warning.esm.js","../node_modules/toggle-selection/index.js","../node_modules/toposort/index.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.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/index.js","../node_modules/use-sync-external-store/shim/with-selector.js","../node_modules/warning/warning.js","../node_modules/nanoclone/src/index.js","../node_modules/yup/es/util/printValue.js","../node_modules/yup/es/locale.js","../node_modules/yup/es/util/isSchema.js","../node_modules/yup/es/Condition.js","../node_modules/yup/es/util/toArray.js","../node_modules/yup/es/ValidationError.js","../node_modules/yup/es/util/runTests.js","../node_modules/yup/es/Reference.js","../node_modules/yup/es/util/createValidation.js","../node_modules/yup/es/util/reach.js","../node_modules/yup/es/util/ReferenceSet.js","../node_modules/yup/es/schema.js","../node_modules/yup/es/mixed.js","../node_modules/yup/es/util/isAbsent.js","../node_modules/yup/es/string.js","../node_modules/yup/es/util/isodate.js","../node_modules/yup/es/date.js","../node_modules/yup/es/util/sortByKeyOrder.js","../node_modules/yup/es/object.js","../node_modules/yup/es/util/sortFields.js","../external module \"https:/esm.sh/rehype-raw@7\"","../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../node_modules/@babel/runtime/helpers/createSuper.js","../node_modules/@babel/runtime/helpers/defineProperty.js","../node_modules/@babel/runtime/helpers/extends.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../node_modules/@babel/runtime/helpers/interopRequireWildcard.js","../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","../node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../node_modules/@babel/runtime/helpers/objectSpread2.js","../node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/slicedToArray.js","../node_modules/@babel/runtime/helpers/toArray.js","../node_modules/@babel/runtime/helpers/toConsumableArray.js","../node_modules/@babel/runtime/helpers/toPrimitive.js","../node_modules/@babel/runtime/helpers/toPropertyKey.js","../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../node_modules/classnames/index.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/@babel/runtime/helpers/esm/createSuper.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/inherits.js","../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/toArray.js","../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@reactflow/controls/dist/esm/index.mjs","../node_modules/zustand/esm/vanilla.mjs","../node_modules/zustand/esm/traditional.mjs","../node_modules/d3-dispatch/src/dispatch.js","../node_modules/d3-selection/src/selector.js","../node_modules/d3-selection/src/selectorAll.js","../node_modules/d3-selection/src/selection/selectAll.js","../node_modules/d3-selection/src/array.js","../node_modules/d3-selection/src/matcher.js","../node_modules/d3-selection/src/selection/selectChild.js","../node_modules/d3-selection/src/selection/selectChildren.js","../node_modules/d3-selection/src/selection/sparse.js","../node_modules/d3-selection/src/selection/enter.js","../node_modules/d3-selection/src/selection/data.js","../node_modules/d3-selection/src/selection/sort.js","../node_modules/d3-selection/src/namespaces.js","../node_modules/d3-selection/src/namespace.js","../node_modules/d3-selection/src/selection/attr.js","../node_modules/d3-selection/src/window.js","../node_modules/d3-selection/src/selection/style.js","../node_modules/d3-selection/src/selection/property.js","../node_modules/d3-selection/src/selection/classed.js","../node_modules/d3-selection/src/selection/text.js","../node_modules/d3-selection/src/selection/html.js","../node_modules/d3-selection/src/selection/raise.js","../node_modules/d3-selection/src/selection/lower.js","../node_modules/d3-selection/src/creator.js","../node_modules/d3-selection/src/selection/insert.js","../node_modules/d3-selection/src/selection/remove.js","../node_modules/d3-selection/src/selection/clone.js","../node_modules/d3-selection/src/selection/on.js","../node_modules/d3-selection/src/selection/dispatch.js","../node_modules/d3-selection/src/selection/index.js","../node_modules/d3-selection/src/selection/select.js","../node_modules/d3-selection/src/selection/filter.js","../node_modules/d3-selection/src/constant.js","../node_modules/d3-selection/src/selection/exit.js","../node_modules/d3-selection/src/selection/join.js","../node_modules/d3-selection/src/selection/merge.js","../node_modules/d3-selection/src/selection/order.js","../node_modules/d3-selection/src/selection/call.js","../node_modules/d3-selection/src/selection/nodes.js","../node_modules/d3-selection/src/selection/node.js","../node_modules/d3-selection/src/selection/size.js","../node_modules/d3-selection/src/selection/empty.js","../node_modules/d3-selection/src/selection/each.js","../node_modules/d3-selection/src/selection/append.js","../node_modules/d3-selection/src/selection/datum.js","../node_modules/d3-selection/src/selection/iterator.js","../node_modules/d3-selection/src/select.js","../node_modules/d3-drag/src/noevent.js","../node_modules/d3-drag/src/nodrag.js","../node_modules/d3-interpolate/src/zoom.js","../node_modules/d3-selection/src/pointer.js","../node_modules/d3-selection/src/sourceEvent.js","../node_modules/d3-timer/src/timer.js","../node_modules/d3-timer/src/timeout.js","../node_modules/d3-transition/src/transition/schedule.js","../node_modules/d3-transition/src/interrupt.js","../node_modules/d3-interpolate/src/number.js","../node_modules/d3-interpolate/src/transform/decompose.js","../node_modules/d3-interpolate/src/transform/parse.js","../node_modules/d3-interpolate/src/transform/index.js","../node_modules/d3-transition/src/transition/tween.js","../node_modules/d3-color/src/define.js","../node_modules/d3-color/src/color.js","../node_modules/d3-interpolate/src/basis.js","../node_modules/d3-interpolate/src/constant.js","../node_modules/d3-interpolate/src/color.js","../node_modules/d3-interpolate/src/rgb.js","../node_modules/d3-interpolate/src/basisClosed.js","../node_modules/d3-interpolate/src/string.js","../node_modules/d3-transition/src/transition/interpolate.js","../node_modules/d3-transition/src/transition/attr.js","../node_modules/d3-transition/src/transition/attrTween.js","../node_modules/d3-transition/src/transition/delay.js","../node_modules/d3-transition/src/transition/duration.js","../node_modules/d3-transition/src/transition/selection.js","../node_modules/d3-transition/src/transition/style.js","../node_modules/d3-transition/src/transition/index.js","../node_modules/d3-transition/src/transition/select.js","../node_modules/d3-transition/src/transition/selectAll.js","../node_modules/d3-transition/src/transition/filter.js","../node_modules/d3-transition/src/transition/merge.js","../node_modules/d3-transition/src/transition/transition.js","../node_modules/d3-transition/src/transition/on.js","../node_modules/d3-transition/src/transition/styleTween.js","../node_modules/d3-transition/src/transition/text.js","../node_modules/d3-transition/src/transition/textTween.js","../node_modules/d3-transition/src/transition/remove.js","../node_modules/d3-transition/src/transition/ease.js","../node_modules/d3-transition/src/transition/easeVarying.js","../node_modules/d3-transition/src/transition/end.js","../node_modules/d3-transition/src/selection/transition.js","../node_modules/d3-ease/src/cubic.js","../node_modules/d3-transition/src/selection/index.js","../node_modules/d3-transition/src/selection/interrupt.js","../node_modules/d3-zoom/src/constant.js","../node_modules/d3-zoom/src/event.js","../node_modules/d3-zoom/src/transform.js","../node_modules/d3-zoom/src/noevent.js","../node_modules/d3-zoom/src/zoom.js","../node_modules/d3-drag/src/constant.js","../node_modules/d3-drag/src/event.js","../node_modules/d3-drag/src/drag.js","../node_modules/@reactflow/core/dist/esm/index.mjs","../node_modules/array-move/index.js","../node_modules/chart.js/auto/auto.mjs","../node_modules/chart.js/dist/chunks/helpers.segment.mjs","../node_modules/chart.js/dist/chart.mjs","../node_modules/classcat/index.js","../node_modules/decode-named-character-reference/index.dom.js","../node_modules/libphonenumber-js/source/AsYouTypeState.js","../node_modules/libphonenumber-js/source/AsYouTypeFormatter.util.js","../node_modules/libphonenumber-js/source/AsYouTypeFormatter.complete.js","../node_modules/libphonenumber-js/source/AsYouTypeFormatter.PatternParser.js","../node_modules/libphonenumber-js/source/AsYouTypeFormatter.PatternMatcher.js","../node_modules/libphonenumber-js/source/AsYouTypeFormatter.js","../node_modules/libphonenumber-js/source/AsYouTypeParser.js","../node_modules/libphonenumber-js/source/AsYouType.js","../node_modules/libphonenumber-js/source/helpers/getPossibleCountriesForNumber.js","../node_modules/libphonenumber-js/source/helpers/getIddPrefix.js","../node_modules/libphonenumber-js/source/format.js","../node_modules/libphonenumber-js/source/helpers/RFC3966.js","../node_modules/libphonenumber-js/source/PhoneNumber.js","../node_modules/libphonenumber-js/source/isValid.js","../node_modules/libphonenumber-js/source/constants.js","../node_modules/libphonenumber-js/source/helpers/applyInternationalSeparatorStyle.js","../node_modules/libphonenumber-js/source/helpers/checkNumberLength.js","../node_modules/libphonenumber-js/source/helpers/mergeArrays.js","../node_modules/libphonenumber-js/source/helpers/extractCountryCallingCode.js","../node_modules/libphonenumber-js/source/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","../node_modules/libphonenumber-js/source/helpers/extractNationalNumber.js","../node_modules/libphonenumber-js/source/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js","../node_modules/libphonenumber-js/source/helpers/formatNationalNumberUsingFormat.js","../node_modules/libphonenumber-js/source/helpers/getCountryByCallingCode.js","../node_modules/libphonenumber-js/source/helpers/getCountryByNationalNumber.js","../node_modules/libphonenumber-js/source/helpers/getNumberType.js","../node_modules/libphonenumber-js/source/helpers/isObject.js","../node_modules/libphonenumber-js/source/helpers/matchesEntirely.js","../node_modules/libphonenumber-js/source/helpers/parseDigits.js","../node_modules/libphonenumber-js/source/helpers/stripIddPrefix.js","../node_modules/libphonenumber-js/source/isPossible.js","../node_modules/libphonenumber-js/source/tools/semver-compare.js","../node_modules/libphonenumber-js/source/metadata.js","../node_modules/libphonenumber-js/source/parseIncompletePhoneNumber.js","../node_modules/libphonenumber-js/metadata.min.json.js","../node_modules/micromark-core-commonmark/lib/blank-line.js","../node_modules/micromark-factory-space/index.js","../node_modules/micromark-util-character/lib/unicode-punctuation-regex.js","../node_modules/micromark-util-character/index.js","../node_modules/micromark-util-chunked/index.js","../node_modules/micromark-util-classify-character/index.js","../node_modules/micromark-util-combine-extensions/index.js","../node_modules/micromark-util-decode-numeric-character-reference/index.js","../node_modules/micromark-util-decode-string/index.js","../node_modules/micromark-util-normalize-identifier/index.js","../node_modules/micromark-util-resolve-all/index.js","../node_modules/unist-util-stringify-position/lib/index.js","../node_modules/react-markdown/node_modules/vfile-message/lib/index.js","../node_modules/react-markdown/node_modules/vfile/lib/minpath.browser.js","../node_modules/react-markdown/node_modules/vfile/lib/minproc.browser.js","../node_modules/react-markdown/node_modules/vfile/lib/minurl.shared.js","../node_modules/react-markdown/node_modules/vfile/lib/minurl.browser.js","../node_modules/react-markdown/node_modules/vfile/lib/index.js","../node_modules/bail/index.js","../node_modules/is-plain-obj/index.js","../node_modules/trough/lib/index.js","../node_modules/unified/node_modules/vfile-message/lib/index.js","../node_modules/unified/node_modules/vfile/lib/minpath.browser.js","../node_modules/unified/node_modules/vfile/lib/minproc.browser.js","../node_modules/unified/node_modules/vfile/lib/minurl.shared.js","../node_modules/unified/node_modules/vfile/lib/minurl.browser.js","../node_modules/unified/node_modules/vfile/lib/index.js","../node_modules/unified/lib/index.js","../node_modules/mdast-util-to-string/lib/index.js","../node_modules/micromark/lib/initialize/content.js","../node_modules/micromark/lib/initialize/document.js","../node_modules/micromark-util-subtokenize/index.js","../node_modules/micromark-core-commonmark/lib/content.js","../node_modules/micromark/lib/initialize/flow.js","../node_modules/micromark/lib/initialize/text.js","../node_modules/micromark/lib/create-tokenizer.js","../node_modules/micromark-core-commonmark/lib/thematic-break.js","../node_modules/micromark-core-commonmark/lib/list.js","../node_modules/micromark-core-commonmark/lib/block-quote.js","../node_modules/micromark-factory-destination/index.js","../node_modules/micromark-factory-label/index.js","../node_modules/micromark-factory-title/index.js","../node_modules/micromark-factory-whitespace/index.js","../node_modules/micromark-core-commonmark/lib/definition.js","../node_modules/micromark-core-commonmark/lib/code-indented.js","../node_modules/micromark-core-commonmark/lib/heading-atx.js","../node_modules/micromark-core-commonmark/lib/setext-underline.js","../node_modules/micromark-util-html-tag-name/index.js","../node_modules/micromark-core-commonmark/lib/html-flow.js","../node_modules/micromark-core-commonmark/lib/code-fenced.js","../node_modules/micromark-core-commonmark/lib/character-reference.js","../node_modules/micromark-core-commonmark/lib/character-escape.js","../node_modules/micromark-core-commonmark/lib/line-ending.js","../node_modules/micromark-core-commonmark/lib/label-end.js","../node_modules/micromark-core-commonmark/lib/label-start-image.js","../node_modules/micromark-core-commonmark/lib/attention.js","../node_modules/micromark-core-commonmark/lib/autolink.js","../node_modules/micromark-core-commonmark/lib/html-text.js","../node_modules/micromark-core-commonmark/lib/label-start-link.js","../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../node_modules/micromark-core-commonmark/lib/code-text.js","../node_modules/micromark/lib/constructs.js","../node_modules/micromark/lib/preprocess.js","../node_modules/mdast-util-from-markdown/lib/index.js","../node_modules/micromark/lib/postprocess.js","../node_modules/micromark/lib/parse.js","../node_modules/remark-parse/lib/index.js","../node_modules/micromark-util-sanitize-uri/index.js","../node_modules/unist-util-visit/lib/index.js","../node_modules/mdast-util-to-hast/node_modules/unist-util-position/lib/index.js","../node_modules/mdast-util-definitions/lib/index.js","../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../node_modules/mdast-util-to-hast/lib/revert.js","../node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../node_modules/trim-lines/index.js","../node_modules/mdast-util-to-hast/lib/handlers/index.js","../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../node_modules/mdast-util-to-hast/lib/handlers/break.js","../node_modules/mdast-util-to-hast/lib/handlers/code.js","../node_modules/mdast-util-to-hast/lib/handlers/delete.js","../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../node_modules/mdast-util-to-hast/lib/handlers/footnote.js","../node_modules/mdast-util-to-hast/lib/handlers/heading.js","../node_modules/mdast-util-to-hast/lib/handlers/html.js","../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../node_modules/mdast-util-to-hast/lib/handlers/image.js","../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../node_modules/mdast-util-to-hast/lib/handlers/link.js","../node_modules/mdast-util-to-hast/lib/handlers/list.js","../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../node_modules/mdast-util-to-hast/lib/handlers/root.js","../node_modules/mdast-util-to-hast/lib/handlers/strong.js","../node_modules/mdast-util-to-hast/lib/handlers/table.js","../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js","../node_modules/mdast-util-to-hast/lib/handlers/table-row.js","../node_modules/mdast-util-to-hast/lib/handlers/text.js","../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../node_modules/mdast-util-to-hast/lib/state.js","../node_modules/unist-util-generated/lib/index.js","../node_modules/mdast-util-to-hast/lib/index.js","../node_modules/mdast-util-to-hast/lib/footer.js","../node_modules/remark-rehype/lib/index.js","../node_modules/property-information/lib/util/schema.js","../node_modules/property-information/lib/util/merge.js","../node_modules/property-information/lib/normalize.js","../node_modules/property-information/lib/util/info.js","../node_modules/property-information/lib/util/types.js","../node_modules/property-information/lib/util/defined-info.js","../node_modules/property-information/lib/util/create.js","../node_modules/property-information/lib/xlink.js","../node_modules/property-information/lib/xml.js","../node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/property-information/lib/xmlns.js","../node_modules/property-information/lib/aria.js","../node_modules/property-information/lib/html.js","../node_modules/property-information/lib/svg.js","../node_modules/property-information/index.js","../node_modules/react-markdown/lib/rehype-filter.js","../node_modules/hast-util-whitespace/index.js","../node_modules/property-information/lib/find.js","../node_modules/property-information/lib/hast-to-react.js","../node_modules/style-to-object/index.mjs","../node_modules/react-markdown/lib/uri-transformer.js","../node_modules/react-markdown/lib/ast-to-react.js","../node_modules/comma-separated-tokens/index.js","../node_modules/space-separated-tokens/index.js","../node_modules/react-markdown/lib/react-markdown.js","../node_modules/react-phone-number-input/source/usePhoneDigits.js","../node_modules/react-phone-number-input/source/PhoneInput.js","../node_modules/react-phone-number-input/source/PhoneInputBrowser.js","../node_modules/react-phone-number-input/input/index.js","../node_modules/libphonenumber-js/source/normalizeArguments.js","../node_modules/libphonenumber-js/source/ParseError.js","../node_modules/libphonenumber-js/source/helpers/extension/createExtensionPattern.js","../node_modules/libphonenumber-js/source/helpers/isViablePhoneNumber.js","../node_modules/libphonenumber-js/source/helpers/extension/extractExtension.js","../node_modules/libphonenumber-js/source/helpers/extractPhoneContext.js","../node_modules/libphonenumber-js/source/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js","../node_modules/libphonenumber-js/source/parse.js","../node_modules/libphonenumber-js/source/parsePhoneNumber_.js","../node_modules/libphonenumber-js/source/parsePhoneNumberWithError_.js","../node_modules/libphonenumber-js/source/parsePhoneNumber.js","../node_modules/react-phone-number-input/locale/en.json.js","../node_modules/country-flag-icons/source/unicode.js","../node_modules/react-phone-number-input/source/CountrySelect.js","../node_modules/react-phone-number-input/source/Flag.js","../node_modules/react-phone-number-input/source/InternationalIcon.js","../node_modules/react-phone-number-input/source/helpers/countries.js","../node_modules/libphonenumber-js/source/getCountries.js","../node_modules/react-phone-number-input/source/CountryIcon.js","../node_modules/react-phone-number-input/source/useExternalRef.js","../node_modules/react-phone-number-input/source/helpers/phoneInputHelpers.js","../node_modules/react-phone-number-input/source/helpers/getPhoneInputWithCountryStateUpdateFromNewProps.js","../node_modules/react-phone-number-input/source/PhoneInputWithCountry.js","../node_modules/react-phone-number-input/source/PhoneInputWithCountryDefault.js","../node_modules/react-phone-number-input/min/index.js","../node_modules/react-phone-number-input/source/InputBasic.js","../node_modules/libphonenumber-js/source/formatIncompletePhoneNumber.js","../node_modules/input-format/source/helpers.js","../node_modules/input-format/source/templateFormatter.js","../node_modules/input-format/source/closeBraces.js","../node_modules/input-format/source/dom.js","../node_modules/input-format/source/inputControl.js","../node_modules/input-format/source/parse.js","../node_modules/input-format/source/edit.js","../node_modules/input-format/source/format.js","../node_modules/input-format/source/react/Input.js","../node_modules/react-phone-number-input/source/helpers/parsePhoneNumberCharacter.js","../node_modules/react-phone-number-input/source/InputSmart.js","../node_modules/react-phone-number-input/source/PropTypes.js","../node_modules/react-phone-number-input/source/helpers/getInternationalPhoneNumberPrefix.js","../node_modules/react-phone-number-input/source/helpers/inputValuePrefix.js","../node_modules/react-phone-number-input/source/useInputKeyDownHandler.js","../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../node_modules/micromark-extension-gfm-table/lib/edit-map.js","../node_modules/micromark-extension-gfm-table/lib/infer.js","../node_modules/micromark-extension-gfm-table/lib/syntax.js","../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../node_modules/ccount/index.js","../node_modules/mdast-util-find-and-replace/lib/index.js","../node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js","../node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../node_modules/mdast-util-to-markdown/lib/util/association.js","../node_modules/mdast-util-to-markdown/lib/util/container-flow.js","../node_modules/mdast-util-to-markdown/lib/util/indent-lines.js","../node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js","../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../node_modules/mdast-util-to-markdown/lib/util/safe.js","../node_modules/mdast-util-to-markdown/lib/util/track.js","../node_modules/mdast-util-gfm-footnote/lib/index.js","../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js","../node_modules/mdast-util-gfm-strikethrough/lib/index.js","../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../node_modules/markdown-table/index.js","../node_modules/mdast-util-gfm-table/lib/index.js","../node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../node_modules/mdast-util-gfm-task-list-item/lib/index.js","../node_modules/remark-gfm/index.js","../node_modules/micromark-extension-gfm/index.js","../node_modules/mdast-util-gfm/lib/index.js","../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/unist-util-is/lib/index.js","../node_modules/unist-util-visit-parents/lib/index.js","../node_modules/zustand/esm/shallow.mjs","../webpack/bootstrap","../webpack/runtime/amd options","../webpack/runtime/async module","../webpack/runtime/compat get default export","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/harmony module decorator","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/load script","../webpack/runtime/make namespace object","../webpack/runtime/node module decorator","../webpack/runtime/publicPath","../webpack/runtime/jsonp chunk loading","../webpack/startup"],"sourceRoot":"","sourcesContent":["var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgAdmin(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_4895_25410)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.03527 10.6487C10.4009 10.6487 11.508 9.54157 11.508 8.1759C11.508 6.81022 10.4009 5.70312 9.03527 5.70312C7.6696 5.70312 6.5625 6.81022 6.5625 8.1759C6.5625 9.54157 7.6696 10.6487 9.03527 10.6487Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.1931 13.5475C4.79333 14.1722 4.58203 14.8944 4.58203 15.6359V17.9993H13.4929V15.6359C13.4929 14.8943 13.2816 14.1722 12.8818 13.5475C12.1662 12.4293 10.9463 11.7617 9.61872 11.7617H8.45624C7.12862 11.7617 5.90876 12.4293 5.1931 13.5475Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.0201 9.63021V6.40939L15.0731 5.94585C14.9853 5.68886 14.8808 5.43703 14.7606 5.19266L15.8098 3.48769L13.5324 1.21021L11.8274 2.25945C11.583 2.13929 11.3312 2.03482 11.0742 1.94699L10.6107 0H7.38989L6.92631 1.94699C6.66932 2.03482 6.4175 2.13929 6.17317 2.25945L4.46819 1.21021L2.19067 3.48769L3.23988 5.19266C3.11972 5.43703 3.01525 5.68886 2.92743 5.94585L0.980469 6.40935V9.63018L2.92746 10.0938C3.01529 10.3507 3.11976 10.6026 3.23991 10.8469L2.18576 12.5599L3.76491 14.0725C3.89333 13.6876 4.06938 13.3179 4.2909 12.9718C4.90415 12.0136 5.80778 11.3152 6.84811 10.9595C6.02396 10.3104 5.49387 9.30383 5.49387 8.17574C5.49387 6.22265 7.08286 4.63366 9.03595 4.63366C10.989 4.63366 12.578 6.22265 12.578 8.17574C12.578 9.30383 12.0479 10.3104 11.2238 10.9595C12.2641 11.3152 13.1677 12.0136 13.781 12.9718C14.0124 13.3334 14.1938 13.7207 14.3235 14.1243C14.3234 14.1242 14.3234 14.1241 14.3234 14.1241L15.8021 12.5393L14.7607 10.847C14.8809 10.6026 14.9853 10.3508 15.0732 10.0938L17.0201 9.63021Z\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_4895_25410\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgAdmin);\nexport default __webpack_public_path__ + \"static/media/admin.62968f72be261c2ad6248708b7f2d95a.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgBotWb(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.532 9.76489C15.1859 18.5503 2.81092 18.5463 3.46658 9.76489C3.46655 9.71563 3.47623 9.66686 3.49507 9.62135C3.5139 9.57583 3.54152 9.53448 3.57635 9.49965C3.61118 9.46483 3.65253 9.43721 3.69804 9.41837C3.74355 9.39954 3.79233 9.38986 3.84158 9.38989H14.157C14.2063 9.38986 14.255 9.39954 14.3005 9.41838C14.3461 9.43721 14.3874 9.46483 14.4222 9.49966C14.4571 9.53449 14.4847 9.57584 14.5035 9.62135C14.5224 9.66686 14.532 9.71563 14.532 9.76489ZM13.0328 2.82153V7.17724C13.0325 7.49211 12.9073 7.794 12.6848 8.01671C12.4622 8.23942 12.1604 8.36477 11.8455 8.36524H6.15307C5.8382 8.36477 5.53639 8.23942 5.31382 8.01671C5.09125 7.794 4.9661 7.49211 4.96582 7.17724V2.82153C4.96611 2.50324 5.09268 2.19808 5.31774 1.97302C5.5428 1.74796 5.84797 1.62139 6.16625 1.62109H11.8323C12.1505 1.62139 12.4557 1.74796 12.6808 1.97302C12.9058 2.19808 13.0325 2.50324 13.0328 2.82153ZM8.53201 4.9331C8.52784 4.65029 8.41258 4.38048 8.21111 4.18196C8.00965 3.98344 7.73816 3.87216 7.45532 3.87217C7.17249 3.87218 6.90101 3.98347 6.69955 4.18199C6.49809 4.38052 6.38284 4.65034 6.37869 4.93315C6.38285 5.21595 6.49812 5.48577 6.69958 5.68429C6.90105 5.8828 7.17253 5.99408 7.45537 5.99408C7.73821 5.99407 8.00969 5.88278 8.21114 5.68425C8.4126 5.48573 8.52786 5.21591 8.53201 4.9331ZM11.6199 4.9331C11.6157 4.65029 11.5005 4.38048 11.299 4.18196C11.0975 3.98344 10.8261 3.87216 10.5432 3.87217C10.2604 3.87218 9.9889 3.98347 9.78744 4.18199C9.58599 4.38052 9.47073 4.65034 9.46658 4.93315C9.47106 5.21574 9.58647 5.48523 9.78789 5.68349C9.98932 5.88174 10.2606 5.99285 10.5432 5.99285C10.8259 5.99284 11.0972 5.88172 11.2986 5.68346C11.5 5.48519 11.6154 5.21569 11.6199 4.9331ZM10.5432 4.60644C10.4582 4.60882 10.3774 4.64427 10.3181 4.70528C10.2588 4.76628 10.2256 4.84801 10.2256 4.9331C10.2256 5.01819 10.2588 5.09992 10.3181 5.16093C10.3774 5.22193 10.4582 5.25739 10.5432 5.25976C10.6283 5.25738 10.7091 5.22192 10.7684 5.16091C10.8277 5.09991 10.8609 5.01817 10.8609 4.93308C10.8609 4.84799 10.8277 4.76626 10.7684 4.70526C10.709 4.64426 10.6283 4.60881 10.5432 4.60644ZM7.45535 4.60644C7.37025 4.60875 7.2894 4.64417 7.23003 4.70518C7.17065 4.76619 7.13742 4.84797 7.13742 4.9331C7.13742 5.01824 7.17065 5.10001 7.23003 5.16102C7.2894 5.22203 7.37025 5.25746 7.45535 5.25976C7.54045 5.25745 7.62129 5.22202 7.68067 5.16101C7.74004 5.09999 7.77326 5.01822 7.77326 4.93308C7.77325 4.84795 7.74003 4.76618 7.68064 4.70517C7.62126 4.64416 7.54045 4.60874 7.45535 4.60644Z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgBotWb);\nexport default __webpack_public_path__ + \"static/media/botWb.48e335d29dae3c3c5b103a406c8cfb8e.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgCompany(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_4895_25380)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.7725 1.40181L1.53 0.149314C1.1475 0.089314 0.7575 0.194314 0.465 0.441814C0.1725 0.696814 0 1.06431 0 1.44681V17.2493C0 17.6618 0.3375 17.9993 0.75 17.9993H3.1875V14.0618C3.1875 13.3343 3.7725 12.7493 4.5 12.7493H6.375C7.1025 12.7493 7.6875 13.3343 7.6875 14.0618V17.9993H10.875V2.69931C10.875 2.05431 10.41 1.50681 9.7725 1.40181ZM4.125 11.0618H3C2.6895 11.0618 2.4375 10.8098 2.4375 10.4993C2.4375 10.1888 2.6895 9.93682 3 9.93682H4.125C4.4355 9.93682 4.6875 10.1888 4.6875 10.4993C4.6875 10.8098 4.4355 11.0618 4.125 11.0618ZM4.125 8.81182H3C2.6895 8.81182 2.4375 8.55982 2.4375 8.24932C2.4375 7.93882 2.6895 7.68681 3 7.68681H4.125C4.4355 7.68681 4.6875 7.93882 4.6875 8.24932C4.6875 8.55982 4.4355 8.81182 4.125 8.81182ZM4.125 6.56181H3C2.6895 6.56181 2.4375 6.30981 2.4375 5.99931C2.4375 5.68881 2.6895 5.43681 3 5.43681H4.125C4.4355 5.43681 4.6875 5.68881 4.6875 5.99931C4.6875 6.30981 4.4355 6.56181 4.125 6.56181ZM4.125 4.31181H3C2.6895 4.31181 2.4375 4.05981 2.4375 3.74931C2.4375 3.43881 2.6895 3.18681 3 3.18681H4.125C4.4355 3.18681 4.6875 3.43881 4.6875 3.74931C4.6875 4.05981 4.4355 4.31181 4.125 4.31181ZM7.875 11.0618H6.75C6.4395 11.0618 6.1875 10.8098 6.1875 10.4993C6.1875 10.1888 6.4395 9.93682 6.75 9.93682H7.875C8.1855 9.93682 8.4375 10.1888 8.4375 10.4993C8.4375 10.8098 8.1855 11.0618 7.875 11.0618ZM7.875 8.81182H6.75C6.4395 8.81182 6.1875 8.55982 6.1875 8.24932C6.1875 7.93882 6.4395 7.68681 6.75 7.68681H7.875C8.1855 7.68681 8.4375 7.93882 8.4375 8.24932C8.4375 8.55982 8.1855 8.81182 7.875 8.81182ZM7.875 6.56181H6.75C6.4395 6.56181 6.1875 6.30981 6.1875 5.99931C6.1875 5.68881 6.4395 5.43681 6.75 5.43681H7.875C8.1855 5.43681 8.4375 5.68881 8.4375 5.99931C8.4375 6.30981 8.1855 6.56181 7.875 6.56181ZM7.875 4.31181H6.75C6.4395 4.31181 6.1875 4.05981 6.1875 3.74931C6.1875 3.43881 6.4395 3.18681 6.75 3.18681H7.875C8.1855 3.18681 8.4375 3.43881 8.4375 3.74931C8.4375 4.05981 8.1855 4.31181 7.875 4.31181Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.965 8.12997L11.625 7.01172V17.9985H16.6875C17.4113 17.9985 18 17.4097 18 16.686V9.41247C18 8.79297 17.5778 8.26572 16.965 8.12997ZM15.1875 15.7485H14.0625C13.752 15.7485 13.5 15.4965 13.5 15.186C13.5 14.8755 13.752 14.6235 14.0625 14.6235H15.1875C15.498 14.6235 15.75 14.8755 15.75 15.186C15.75 15.4965 15.498 15.7485 15.1875 15.7485ZM15.1875 13.4985H14.0625C13.752 13.4985 13.5 13.2465 13.5 12.936C13.5 12.6255 13.752 12.3735 14.0625 12.3735H15.1875C15.498 12.3735 15.75 12.6255 15.75 12.936C15.75 13.2465 15.498 13.4985 15.1875 13.4985ZM15.1875 11.2485H14.0625C13.752 11.2485 13.5 10.9965 13.5 10.686C13.5 10.3755 13.752 10.1235 14.0625 10.1235H15.1875C15.498 10.1235 15.75 10.3755 15.75 10.686C15.75 10.9965 15.498 11.2485 15.1875 11.2485Z\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_4895_25380\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgCompany);\nexport default __webpack_public_path__ + \"static/media/company.e33155dcaa582d4a667ad9d0b2def3be.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgDashboard(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.43 1.5H4.005C2.3625 1.5 1.5 2.3625 1.5 3.9975V5.4225C1.5 7.0575 2.3625 7.92 3.9975 7.92H5.4225C7.0575 7.92 7.92 7.0575 7.92 5.4225V3.9975C7.9275 2.3625 7.065 1.5 5.43 1.5Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.0045 1.5H12.5795C10.9445 1.5 10.082 2.3625 10.082 3.9975V5.4225C10.082 7.0575 10.9445 7.92 12.5795 7.92H14.0045C15.6395 7.92 16.502 7.0575 16.502 5.4225V3.9975C16.502 2.3625 15.6395 1.5 14.0045 1.5Z\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.0045 10.0742H12.5795C10.9445 10.0742 10.082 10.9367 10.082 12.5717V13.9967C10.082 15.6317 10.9445 16.4942 12.5795 16.4942H14.0045C15.6395 16.4942 16.502 15.6317 16.502 13.9967V12.5717C16.502 10.9367 15.6395 10.0742 14.0045 10.0742Z\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.43 10.0742H4.005C2.3625 10.0742 1.5 10.9367 1.5 12.5717V13.9967C1.5 15.6392 2.3625 16.5017 3.9975 16.5017H5.4225C7.0575 16.5017 7.92 15.6392 7.92 14.0042V12.5792C7.9275 10.9367 7.065 10.0742 5.43 10.0742Z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgDashboard);\nexport default __webpack_public_path__ + \"static/media/dashboard.85ff482cb71b35cf8653656f8a16ccfc.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgInbox(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.75 1.5L5.25 1.5C3.18 1.5 1.5 3.1725 1.5 5.235L1.5 9.72L1.5 10.47C1.5 12.5325 3.18 14.205 5.25 14.205H6.375C6.5775 14.205 6.8475 14.34 6.975 14.505L8.1 15.9975C8.595 16.6575 9.405 16.6575 9.9 15.9975L11.025 14.505C11.1675 14.3175 11.3925 14.205 11.625 14.205H12.75C14.82 14.205 16.5 12.5325 16.5 10.47V5.235C16.5 3.1725 14.82 1.5 12.75 1.5ZM9.75 10.3125L5.25 10.3125C4.9425 10.3125 4.6875 10.0575 4.6875 9.75C4.6875 9.4425 4.9425 9.1875 5.25 9.1875H9.75C10.0575 9.1875 10.3125 9.4425 10.3125 9.75C10.3125 10.0575 10.0575 10.3125 9.75 10.3125ZM12.75 6.5625L5.25 6.5625C4.9425 6.5625 4.6875 6.3075 4.6875 6C4.6875 5.6925 4.9425 5.4375 5.25 5.4375L12.75 5.4375C13.0575 5.4375 13.3125 5.6925 13.3125 6C13.3125 6.3075 13.0575 6.5625 12.75 6.5625Z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgInbox);\nexport default __webpack_public_path__ + \"static/media/inbox.a09fb0ec776ab1d53d583ea4ea63d3af.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgKnowledge(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_4895_25385)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.02734 15.9755H7.1025V16.0662C7.1025 17.1321 7.96965 17.9992 9.0355 17.9992C10.1013 17.9992 10.9685 17.1321 10.9685 16.0662V15.9755H12.0436V13.625H6.02734V15.9755Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.50828 10.7358L7.07472 9.81373V8.22609H8.12955V9.23799L9.0357 9.82079L9.94184 9.23799V8.22609H10.9967V9.81373L9.56311 10.7358V12.5702H12.1201C12.2139 12.2531 12.3915 11.9627 12.6386 11.7349C13.7279 10.7307 14.3527 9.30554 14.3527 7.82476C14.3527 4.89298 11.9675 2.50781 9.0357 2.50781L8.99748 2.50795C7.59887 2.5178 6.2799 3.07088 5.28353 4.06528C4.28713 5.05971 3.73148 6.37759 3.71896 7.77617C3.7056 9.26922 4.32577 10.708 5.42045 11.7235C5.67196 11.9568 5.85297 12.251 5.94892 12.5702H8.50831L8.50828 10.7358Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.47266 0H9.52749V1.42523H8.47266V0Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.62891 1.30859L5.5424 0.781175L6.25684 2.01859L5.34335 2.54601L4.62891 1.30859Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.95703 4.36719L2.48445 3.4537L3.72186 4.16814L3.19444 5.08163L1.95703 4.36719Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.17188 7.29688H2.60076V8.35171H1.17188V7.29688Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.4023 7.29688H16.8312V8.35171H15.4023V7.29688Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.2812 4.16797L15.5187 3.45351L16.0461 4.367L14.8087 5.08146L14.2812 4.16797Z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.7461 2.01953L12.4605 0.782118L13.374 1.30954L12.6596 2.54695L11.7461 2.01953Z\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_4895_25385\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgKnowledge);\nexport default __webpack_public_path__ + \"static/media/knowledge.835a489317f00310ac77290e9ad1f1db.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgOpenings(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"#898989\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.8153 5.23562C15.1778 4.53062 14.1128 4.17812 12.5678 4.17812H12.3878V4.14812C12.3878 2.88813 12.3878 1.32813 9.56783 1.32813H8.42783C5.60783 1.32813 5.60783 2.89563 5.60783 4.14812V4.18562H5.42783C3.87533 4.18562 2.81783 4.53812 2.18033 5.24312C1.43783 6.06812 1.46033 7.17812 1.53533 7.93562L1.54283 7.98812L1.59595 8.54589C1.60979 8.69125 1.68817 8.82265 1.8105 8.90237C1.99239 9.02092 2.2614 9.19317 2.42783 9.28562C2.53283 9.35312 2.64533 9.41313 2.75783 9.47312C4.04033 10.1781 5.45033 10.6506 6.88283 10.8831C6.95033 11.5881 7.25783 12.4131 8.90033 12.4131C10.5428 12.4131 10.8653 11.5956 10.9178 10.8681C12.4478 10.6206 13.9253 10.0881 15.2603 9.30812C15.3053 9.28562 15.3353 9.26312 15.3728 9.24062C15.6566 9.08022 15.9506 8.88428 16.2213 8.6904C16.3312 8.61164 16.4013 8.4892 16.4163 8.35477L16.4228 8.29563L16.4603 7.94312C16.4678 7.89812 16.4678 7.86062 16.4753 7.80812C16.5353 7.05062 16.5203 6.01562 15.8153 5.23562ZM9.81533 10.3731C9.81533 11.1681 9.81533 11.2881 8.89283 11.2881C7.97033 11.2881 7.97033 11.1456 7.97033 10.3806V9.43562H9.81533V10.3731ZM6.68033 4.17812V4.14812C6.68033 2.87312 6.68033 2.40062 8.42783 2.40062H9.56783C11.3153 2.40062 11.3153 2.88063 11.3153 4.14812V4.18562L6.68033 4.18562V4.17812Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.4759 10.3855C15.8197 10.2235 16.2146 10.4961 16.1802 10.8746L15.9289 13.643C15.7714 15.143 15.1564 16.673 11.8564 16.673H6.14141C2.84141 16.673 2.22641 15.143 2.06891 13.6505L1.83086 11.032C1.79685 10.6579 2.18269 10.3857 2.52549 10.5392C3.38836 10.9258 4.78431 11.5233 5.69744 11.7723C5.85647 11.8156 5.98598 11.9305 6.05931 12.0781C6.52553 13.0167 7.50243 13.5155 8.90141 13.5155C10.2866 13.5155 11.2753 12.9974 11.7433 12.0558C11.8168 11.908 11.9461 11.7934 12.1052 11.7497C13.077 11.483 14.5695 10.8125 15.4759 10.3855Z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgOpenings);\nexport default __webpack_public_path__ + \"static/media/openings.8955e9a6ae1bda319b9bb2741c184e35.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgCondition(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 34,\n height: 34,\n viewBox: \"0 0 34 34\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_3817_37134)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 20.3568V9.76219C0 5.91747 3.12793 2.78954 6.97266 2.78954H25.5664V0.0527344L33.9477 8.43407L25.5664 16.8154V14.0786H8.44096C5.77628 14.0786 3.30298 15.4023 1.82491 17.6194L0 20.3568Z\",\n fill: \"#7D8AFF\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.43407 33.9486L0.0527344 25.5672L8.43407 17.1859V19.9227H25.5595C28.2242 19.9227 30.6975 18.599 32.1756 16.3819L34.0005 13.6445V24.2391C34.0005 28.0838 30.8725 31.2118 27.0278 31.2118H8.43407V33.9486Z\",\n fill: \"#FFDC40\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.1751 16.3819C30.697 18.599 28.2237 19.9227 25.559 19.9227H17V31.2118H27.0273C30.8721 31.2118 34 28.0838 34 24.2391V13.6445L32.1751 16.3819Z\",\n fill: \"#FFAB15\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M33.9477 8.43407L25.5664 0.0527344V2.78954H17V14.0786H25.5664V16.8154L33.9477 8.43407Z\",\n fill: \"#6E76E5\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_3817_37134\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 34,\n height: 34,\n fill: \"white\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgCondition);\nexport default __webpack_public_path__ + \"static/media/condition.caa3dea8314818113d04d85a43021e5e.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgSandClock(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 34,\n height: 34,\n viewBox: \"0 0 34 34\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7903 0H9.20703C8.03343 0 7.08203 0.951402 7.08203 2.125C7.08203 3.2986 8.03343 4.25 9.20703 4.25H24.7904C25.964 4.25 26.9154 3.2986 26.9154 2.125C26.9154 0.951402 25.9639 0 24.7903 0Z\",\n fill: \"#455A64\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7916 31.1673H9.20836C8.81716 31.1673 8.5 30.8501 8.5 30.4589V24.5302C8.49993 22.6916 9.29362 20.9425 10.6774 19.7319L13.1891 17.5333C13.4833 17.2754 13.5127 16.8279 13.2549 16.5337C13.2344 16.5104 13.2125 16.4884 13.1891 16.468L10.6774 14.2693C9.29362 13.0588 8.49993 11.3097 8.5 9.47109V3.54234C8.5 3.15114 8.81716 2.83398 9.20836 2.83398H24.7917C25.1829 2.83398 25.5001 3.15114 25.5001 3.54234V9.47109C25.5001 11.3097 24.7064 13.0588 23.3227 14.2693L20.8109 16.468C20.5167 16.7258 20.4873 17.1734 20.7452 17.4675C20.7656 17.4908 20.7876 17.5128 20.8109 17.5333L23.3227 19.7319C24.7064 20.9425 25.5001 22.6916 25.5001 24.5302V30.4589C25.5 30.8502 25.1828 31.1673 24.7916 31.1673Z\",\n fill: \"#455A64\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.91797 29.75H24.0846V24.5296C24.0829 23.0987 23.4631 21.7384 22.3846 20.7981L19.8729 18.5995C18.9895 17.8268 18.8999 16.4843 19.6726 15.601C19.7348 15.5298 19.8017 15.4629 19.8729 15.4007L22.3846 13.202C23.4631 12.2618 24.0829 10.9014 24.0846 9.47053V4.25H9.91797V9.4704C9.9197 10.9013 10.5395 12.2616 11.618 13.2019L14.1297 15.4005C15.0127 16.1737 15.1016 17.5162 14.3285 18.3992C14.2667 18.4698 14.2003 18.5362 14.1297 18.598L11.618 20.7981C10.5395 21.7384 9.9197 23.0987 9.91797 24.5296V29.75Z\",\n fill: \"#ECEFF1\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.1974 11.7717C21.0879 11.5068 20.8296 11.3341 20.5429 11.334H13.4596C13.0684 11.3333 12.7507 11.6499 12.75 12.0411C12.7497 12.2297 12.8246 12.4106 12.9581 12.5438L16.4998 16.0855C16.7763 16.362 17.2247 16.362 17.5014 16.0855L21.043 12.5438C21.246 12.3414 21.3069 12.0366 21.1974 11.7717Z\",\n fill: \"#FFC107\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.7903 29.75H9.20703C8.03343 29.75 7.08203 30.7014 7.08203 31.875C7.08203 33.0486 8.03343 34 9.20703 34H24.7904C25.964 34 26.9154 33.0486 26.9154 31.875C26.9154 30.7014 25.9639 29.75 24.7903 29.75Z\",\n fill: \"#455A64\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.4773 22.1422C17.1975 21.8889 16.7682 21.8995 16.5012 22.1663L9.91797 28.7482V29.7497H24.0846V28.1489L17.4773 22.1422Z\",\n fill: \"#FFC107\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgSandClock);\nexport default __webpack_public_path__ + \"static/media/sandClock.66eb640cf7d08be06a3a5b847d94982b.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgThunder(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 34,\n height: 34,\n viewBox: \"0 0 34 34\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_3321_35193)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.2368 11.475C30.1955 11.3803 30.1275 11.2997 30.041 11.2431C29.9546 11.1865 29.8535 11.1563 29.7502 11.1562H16.894L22.2537 0.775094C22.2956 0.69409 22.3159 0.603679 22.3127 0.51256C22.3095 0.421441 22.2829 0.332681 22.2354 0.254821C22.188 0.176961 22.1213 0.112621 22.0418 0.0679924C21.9623 0.0233638 21.8726 -5.13217e-05 21.7815 8.44612e-08H13.6241C13.5279 -3.85221e-05 13.4336 0.0260331 13.351 0.0754336C13.2685 0.124834 13.201 0.19571 13.1556 0.2805L3.78165 17.8118C3.73831 17.8927 3.71669 17.9835 3.7189 18.0753C3.72112 18.1671 3.74709 18.2568 3.79429 18.3356C3.84149 18.4143 3.9083 18.4795 3.98821 18.5248C4.06811 18.57 4.15838 18.5938 4.25021 18.5938H15.1408L9.07184 33.2653C9.02409 33.3804 9.01835 33.5087 9.05561 33.6276C9.09288 33.7466 9.17079 33.8486 9.27571 33.9159C9.38062 33.9832 9.50587 34.0115 9.62952 33.9958C9.75317 33.9801 9.86737 33.9214 9.95212 33.83L30.1396 12.0487C30.2099 11.9729 30.2565 11.8783 30.2738 11.7764C30.291 11.6745 30.2782 11.5697 30.2368 11.475Z\",\n fill: \"#FFD747\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_3321_35193\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 34,\n height: 34,\n fill: \"white\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgThunder);\nexport default __webpack_public_path__ + \"static/media/thunder.832068cc329dacbc255a60d24dc93ee1.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHandlerIcon(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n rx: 12,\n fill: \"#4CB580\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.75 16.5L14.25 12L9.75 7.5\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHandlerIcon);\nexport default __webpack_public_path__ + \"static/media/handlerIcon.c607daed89a566a75325599ad0cc038c.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useEffect } from \"react\";\nimport { Provider } from \"react-redux\";\nimport { PersistGate } from \"redux-persist/integration/react\";\nimport { DndProvider } from \"react-dnd\";\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\nimport { store, persistor } from \"store\";\nimport Routes from \"route\";\nimport { I18NProvider, LOCALES } from \"./i18n\";\nimport FingerprintHelper from \"helper/fingerprintHelper\";\nimport \"bootstrap/dist/css/bootstrap.min.css\";\nimport \"antd/dist/antd.css\";\nimport \"./App.css\";\nimport \"animate.css\";\nimport { decodeFromBase64, deleteAllCookies, setCookie } from \"utils\";\n\nfunction App() {\n useEffect(() => {\n const link = document.createElement(\"link\");\n link.type = \"image/x-icon\";\n link.rel = \"shortcut icon\";\n link.href = \"/favicon.ico\";\n document.title = \"Hirebound\";\n document.getElementsByTagName(\"head\")[0]?.appendChild(link);\n }, []);\n (() => {\n const urlParams = new URLSearchParams(window.location.search);\n const encodedData = urlParams?.get(\"redirectExternal\");\n if (encodedData) {\n deleteAllCookies();\n localStorage?.clear();\n const decodedData = decodeFromBase64(encodedData);\n let { ob_a, ob_r, tenant, hostname } = decodedData;\n setCookie(\"ob_a\", ob_a, 7 * 24 * 60 * 60 * 1000);\n setCookie(\"token_type\", \"bearer\", 7 * 24 * 60 * 60 * 1000);\n setCookie(\"ob_r\", ob_r, 7 * 24 * 60 * 60 * 1000);\n setCookie(\"tenant\", tenant, 7 * 24 * 60 * 60 * 1000);\n setCookie(\"hostname\", hostname, 7 * 24 * 60 * 60 * 1000);\n localStorage.setItem(\"roles\", JSON.stringify([\"admin\"]));\n window.location.href = `https://${hostname}/admin/`;\n }\n })();\n return (\n \n \n \n \n \n \n \n \n \n \n );\n}\n\nexport default App;\n","import { notification } from \"antd\";\nimport { del, get, post, put } from \"helper/networkClient\";\n\nexport const getAccountVariablesDefinition = () => async (dispatch) => {\n dispatch({\n type: \"GET_ACCOUNT_VARIABLES_DEFINITION_ACTION_TRIGGER\",\n });\n try {\n const response = await get(`/account-variables`);\n if (response.status === 200) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_DEFINITION_ACTION_RESPONSE\",\n data: response.data,\n });\n }\n } catch (error) {\n notification.error({ message: \"Failed to get account details\" });\n dispatch({\n type: \"ACCOUNT_VARIABLES_DEFINITION_ACTION_ERROR\",\n data: error,\n });\n }\n};\n\nexport const updateAccountVariablesDefinition =\n (avId, accountData) => async (dispatch) => {\n try {\n const response = await put(`/account-variables/${avId}`, accountData);\n if (response.status === 200) {\n notification.success({\n message: \"Account details updated successfully\",\n });\n dispatch(getAccountVariablesDefinition());\n }\n } catch (error) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_DEFINITION_ACTION_ERROR\",\n data: error,\n });\n notification.error({ message: \"Failed to update account details\" });\n }\n };\n\nexport const deleteAccountVariablesDefinition = (avId) => async (dispatch) => {\n try {\n const response = await del(`/account-variables/${avId}`, {\n isDeleted: true,\n });\n if (response.status === 200) {\n notification.success({\n message: \"Account details deleted successfully\",\n });\n dispatch(getAccountVariablesDefinition());\n }\n } catch (error) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_DEFINITION_ACTION_ERROR\",\n data: error,\n });\n notification.error({ message: \"Failed to delete account\" });\n }\n};\n\nexport const createAccountVariablesDefinition = (Data) => async (dispatch) => {\n try {\n const response = await post(\"/account-variables\", Data);\n if (response.status === 200) {\n notification.success({\n message: \"Account details created successfully\",\n });\n dispatch(getAccountVariablesDefinition());\n }\n } catch (error) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_DEFINITION_ACTION_ERROR\",\n data: error,\n });\n notification.error({ message: \"Failed to create account\" });\n }\n};\n\nexport const getAccountVariablesForOpening =\n (openingsId) => async (dispatch) => {\n dispatch({\n type: \"GET_ACCOUNT_VARIABLES_OPENING_TRIGGER\",\n });\n try {\n const response = await get(`/account-variables/opening/${openingsId}`);\n if (response.status === 200) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_OPENING_RESPONSE\",\n data: response.data,\n });\n }\n } catch (error) {\n notification.error({ message: \"Failed to get account details\" });\n dispatch({\n type: \"ACCOUNT_VARIABLES_OPENING_ERROR\",\n data: error,\n });\n }\n };\nexport const updateAccountVariablesForOpening =\n ({ openingsId, accountData }) =>\n async (dispatch) => {\n try {\n const response = await put(\n `/account-variables/opening/${openingsId}`,\n accountData\n );\n if (response.status === 200) {\n notification.success({\n message: \"Account details updated successfully\",\n });\n dispatch(getAccountVariablesForOpening(openingsId));\n }\n } catch (error) {\n dispatch({\n type: \"ACCOUNT_VARIABLES_OPENING_ERROR\",\n data: error,\n });\n notification.error({ message: \"Failed to update account details\" });\n }\n };\n","import {\n CHECK_EMAIL_AVL,\n DEF_EMAIL_CONFIG,\n ALL_CONFIG,\n CHECK_PHONE_AVL,\n SMS_SEARCH,\n USER_TENANT_LIST,\n DEF_SMS_CONFIG,\n SMS_NO_DATA,\n CONTENT_LOADING,\n WHATSAPP_RESPONSE,\n WHATSAPP_ERROR,\n GET_LANGUAGES,\n GET_LANGUAGES_FORM,\n STORE_SHOPIFY,\n STORE_FACEBOOK,\n STORE_COLLECTIONS,\n STORE_DATA,\n PRODUCT_COLLECTIONS,\n LOADING_TRIGGER,\n BUSINESS_INFO,\n META_CONNECTION_INFO,\n STORE_DATA_LIST,\n WHATSAPP_WEBHOOK,\n CONNECTED_BOT,\n GET_INTEGRATION_PAYMENT_TRIGGER,\n GET_INTEGRATION_PAYMENT_RESPONSE,\n GET_INTEGRATION_PAYMENT_ERROR,\n GET_INTEGRATION_SHOPIFY_TRIGGER,\n GET_INTEGRATION_SHOPIFY_RESPONSE,\n GET_INTEGRATION_SHOPIFY_ERROR,\n NOTIFICATION_PREFERENCE_TRIGGER,\n NOTIFICATION_PREFERENCE_RESPONSE,\n META_APIS_BUSINESS_INFO,\n META_APIS_WEB_ID,\n META_APIS_NUMBER,\n} from \"constant\";\nimport { get, post, put, postsign, patch, del } from \"helper/networkClient\";\nimport { deleteCookie, setCookie } from \"utils\";\nimport history from \"utils/history\";\nimport { notification } from \"antd\";\n\nconst CheckEmail = (data) => ({\n type: CHECK_EMAIL_AVL,\n data: data,\n});\nconst DefEmail = (data) => ({\n type: DEF_EMAIL_CONFIG,\n data: data,\n});\nconst DefSms = (data) => ({\n type: DEF_SMS_CONFIG,\n data: data,\n});\nconst allConfig = (data) => ({\n type: ALL_CONFIG,\n data: data,\n});\nconst CheckPhone = (data) => ({\n type: CHECK_PHONE_AVL,\n data: data,\n});\nconst userTenant = (data) => ({\n type: USER_TENANT_LIST,\n data: data,\n});\n\nexport const CheckEmailAvl = (email) => async (dispatch) => {\n await get(`/channel-account/check?email=${email}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(CheckEmail(resp.data.data));\n }\n });\n};\n\nexport const EmailCreateAction = (data) => async (dispatch) => {\n await post(`/channel-account`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n }\n });\n};\n\nexport const defEmailConfig = () => async (dispatch) => {\n await get(`/channel-account/email`).then((resp) => {\n if (resp.status === 200) {\n dispatch(DefEmail(resp.data));\n }\n });\n};\n\nexport const GetAllConfig = () => async (dispatch) => {\n await get(`/channel-account/`).then((resp) => {\n if (resp.status === 200) {\n dispatch(allConfig(resp.data.data));\n if (resp.data.data.length > 0) {\n deleteCookie(\"ch-alert\");\n }\n let disabled = resp.data.data.filter(\n (item) => item.disableReason === \"authError\"\n );\n if (disabled.length > 0) {\n setCookie(\"email-auth-failed\", \"true\", \"1d\");\n } else {\n deleteCookie(\"email-auth-failed\");\n }\n dispatch({ type: CONTENT_LOADING, data: false });\n }\n });\n};\nexport const updateConfig = (data, id) => async (dispatch) => {\n await put(`/channel-account/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n }\n });\n};\nexport const patchConfig = (data, id) => async (dispatch) => {\n try {\n await patch(`/channel-account/bot-conf/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {\n dispatch(GetAllConfig());\n dispatch(getIntegrationShopify({ provider: \"shopify\" }));\n }\n};\n\nexport const CheckPhoneAvl = (code) => async (dispatch) => {\n try {\n await get(`/twilio/phones?code=${code}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(CheckPhone(resp.data.data));\n dispatch({ type: SMS_SEARCH, data: false });\n resp?.data?.data?.length === 0\n ? dispatch({ type: SMS_NO_DATA, data: true })\n : dispatch({ type: SMS_NO_DATA, data: false });\n }\n });\n } catch (error) {\n dispatch({ type: SMS_SEARCH, data: false });\n }\n};\n\nexport const SmsCreateAction = (data) => async (dispatch) => {\n await post(`/twilio/purchase-number`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n }\n });\n};\nexport const defSmsConfig = () => async (dispatch) => {\n await get(`/channel-account/sms`).then((resp) => {\n if (resp.status === 200) {\n dispatch(DefSms(resp.data));\n }\n });\n};\nexport const WhatsAppCreateAction = (data) => async (dispatch) => {\n try {\n await post(`/channel-account/meta`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n dispatch({ type: WHATSAPP_RESPONSE, data: resp.data });\n }\n });\n } catch (error) {\n dispatch({ type: WHATSAPP_ERROR, data: false });\n }\n};\n\n//adminAction\n\nexport const CreateNewUser = (data) => async (dispatch) => {\n await post(`/user`, data).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(GetUserTanent());\n }\n });\n};\n\nexport const GetUserTanent = () => async (dispatch) => {\n try {\n await get(`/agents`).then((resp) => {\n if (resp.status === 200) {\n dispatch(userTenant(resp?.data));\n dispatch({ type: CONTENT_LOADING, data: false });\n dispatch({\n type: \"GET_AGENTS_ACTION_RESPONSE\",\n data: resp?.data,\n });\n }\n });\n } catch (error) {\n dispatch({ type: CONTENT_LOADING, data: false });\n }\n};\n\nexport const SendInvite = (data) => async (dispatch) => {\n await post(`/user/invite`, data).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n console.log(\"SendInvite\");\n }\n });\n};\nexport const SignupUser = (data) => async (dispatch) => {\n try {\n await postsign(`/public/user/signup`, data).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n history.push(\"\");\n }\n });\n } catch (error) {\n history.push(\"\");\n }\n};\n\nexport const GetLanguages = () => async (dispatch) => {\n try {\n await get(`/uitranslations/screen?id=faq`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: GET_LANGUAGES, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const updateLanguageSettings = (data) => async (dispatch) => {\n try {\n await put(`/uitranslations`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: ` language updated. `,\n });\n dispatch(GetLanguages());\n }\n });\n } catch (error) {}\n};\n\nexport const addLanguageSettings = (data) => async (dispatch) => {\n try {\n await post(`/uitranslations`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: ` language added. `,\n });\n dispatch(GetLanguages());\n }\n });\n } catch (error) {}\n};\nexport const getStore =\n (param = false) =>\n async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/store/all?enabled=${param}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: STORE_DATA, data: resp.data.data });\n }\n });\n } catch (error) {}\n };\nexport const getStoreList =\n (param = false) =>\n async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/store/list?enabled=${param}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: STORE_DATA_LIST, data: resp.data.data });\n }\n });\n } catch (error) {}\n };\n\nexport const getStoreIntegartionSopify = () => async (dispatch) => {\n try {\n await get(`/integration-account?provider=shopify`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: STORE_SHOPIFY, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\nexport const getStoreIntegartionFacebook = () => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/integration-account?provider=facebook`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: STORE_FACEBOOK, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const getStoreCollection = (storeId) => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/store/${storeId}/collections`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: STORE_COLLECTIONS, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const createStoreCollection = (storeId, data) => async (dispatch) => {\n try {\n await post(`/store/${storeId}/collections`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getStoreCollection(storeId));\n }\n });\n } catch (error) {}\n};\nexport const getCollectionProduct =\n (storeId, colectionId) => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/store/${storeId}/collections/${colectionId}/products`).then(\n (resp) => {\n if (resp.status === 200) {\n dispatch({ type: PRODUCT_COLLECTIONS, data: resp.data.data });\n }\n }\n );\n } catch (error) {}\n };\n\nexport const CreateCollectionProduct =\n (storeId, colectionId, data) => async (dispatch) => {\n try {\n await post(\n `/store/${storeId}/collections/${colectionId}/products`,\n data\n ).then((resp) => {\n notification.success({\n message: `Product saved. `,\n });\n dispatch(getStoreCollection(storeId));\n });\n } catch (error) {}\n };\nexport const getBusinessInfo = (id) => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/metaapis/businessinfo/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: BUSINESS_INFO, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const metaConnection = (data) => async (dispatch) => {\n try {\n await post(`/store/setup/meta`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: META_CONNECTION_INFO, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\nexport const SyncStore = (data) => async (dispatch) => {\n try {\n await post(`/store/meta/sync`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Product synced. `,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const createCatalouge = (data) => async (dispatch) => {\n try {\n await post(`/metaapis/catalog`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Catalouge created `,\n });\n dispatch(getBusinessInfo(data.iaId));\n }\n });\n } catch (error) {}\n};\n\nexport const getWhatAppWebhook = () => async (dispatch) => {\n try {\n await get(`/channel-account/whatsapp/webhook`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: WHATSAPP_WEBHOOK, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const getConnectedBot = (id) => async (dispatch) => {\n try {\n await get(`/channel-account/bot/ca/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: CONNECTED_BOT, data: resp.data.data });\n } else {\n dispatch({ type: CONNECTED_BOT, data: null });\n }\n });\n } catch (error) {\n dispatch({ type: CONNECTED_BOT, data: null });\n }\n};\n\nexport const getIntegrationPayment = (data) => async (dispatch) => {\n dispatch({ type: GET_INTEGRATION_PAYMENT_TRIGGER, data });\n await get(\"/integration-account/\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_INTEGRATION_PAYMENT_RESPONSE,\n data: resp.data.data,\n });\n } else {\n dispatch({\n type: GET_INTEGRATION_PAYMENT_ERROR,\n });\n }\n });\n};\nexport const getIntegrationShopify = (data) => async (dispatch) => {\n dispatch({ type: GET_INTEGRATION_SHOPIFY_TRIGGER, data });\n await get(\"/integration-account/\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_INTEGRATION_SHOPIFY_RESPONSE,\n data: resp.data.data,\n });\n } else {\n dispatch({\n type: GET_INTEGRATION_SHOPIFY_ERROR,\n });\n }\n });\n};\n\nexport const updateStoreSettings = (storeId, data) => async (dispatch) => {\n try {\n await patch(`/store/${storeId}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getStoreList());\n notification.success({\n message: `Store settings updated. `,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const getNotificationPreference = () => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/notification/preferences`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: NOTIFICATION_PREFERENCE_RESPONSE,\n data: resp.data.data,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const updateNotificationPreference = (data) => async (dispatch) => {\n try {\n await put(`/notification/preferences`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getNotificationPreference());\n notification.success({\n message: `Notification preference updated. `,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const getMetaBussinessInfo = (id) => async (dispatch) => {\n try {\n await get(`/metaapis/businesses?ia=${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: META_APIS_BUSINESS_INFO, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const getMetaBussinessInfoByStoreId = (bid, ia) => async (dispatch) => {\n try {\n await get(`/metaapis/businesses/waba?bid=${bid}&ia=${ia}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: META_APIS_WEB_ID, data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const getMetaNumber = (wid, id) => async (dispatch) => {\n try {\n get(`/metaapis/businesses/waba/numbers?waba=${wid}&ia=${id}`).then(\n (resp) => {\n if (resp.status === 200) {\n dispatch({ type: META_APIS_NUMBER, data: resp.data.data });\n }\n }\n );\n } catch (error) {}\n};\n\nexport const registerWhatsAppAccount = (data) => async (dispatch) => {\n try {\n await post(`/channel-account/whatsapp`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `WhatsApp account created. `,\n });\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {}\n};\n\nexport const createIntegrationAccount = (data) => async (dispatch) => {\n try {\n await post(`/integration-account`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Integration account created. `,\n });\n dispatch(getIntegrationPayment());\n }\n });\n } catch (error) {\n notification.error({\n message: `Something went wrong. `,\n });\n }\n};\n\nexport const deleteChannelAccount = (id) => async (dispatch) => {\n try {\n await del(`/channel-account/${id}`).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Channel account deleted. `,\n });\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {}\n};\nexport const getChannelAccountStatus = (data) => async (dispatch) => {\n dispatch({ type: \"CHANNEL_ACCOUNT_STATUS_LOADING\" });\n try {\n await post(`/channel-account/status`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"CHANNEL_ACCOUNT_STATUS\", data: resp?.data });\n }\n });\n } catch (error) {\n dispatch({ type: \"CHANNEL_ACCOUNT_STATUS_LOADING_FALSE\" });\n }\n};\nexport const getWBAphone = (id) => async (dispatch) => {\n dispatch({ type: LOADING_TRIGGER, data: true });\n try {\n await get(`/channel-account/meta/phone?id=${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"META_APIS_NUMBER\", data: resp?.data });\n }\n });\n } catch (error) {}\n};\nexport const updateChannelAccountAccess = (data) => async (dispatch) => {\n try {\n await patch(`/channel-account/access`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Channel account access updated. `,\n });\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {\n notification.error({\n message: `Something went wrong. `,\n });\n }\n};\nexport const WebAccountCreateAction = (data) => async (dispatch) => {\n try {\n await post(`/channel-account/web`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {\n notification.error({\n message: `Something went wrong. `,\n });\n }\n};\n\nexport const getSmtpProviders = () => async (dispatch) => {\n dispatch({ type: \"SMTP_PROVIDERS_TRIGGER\", data: true });\n try {\n await get(`/tenant-imap-provider/all`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"SMTP_PROVIDERS_RESPONSE\", data: resp.data.data });\n }\n });\n } catch (error) {\n dispatch({ type: \"SMTP_PROVIDERS_ERROR\", data: false });\n }\n};\n\nexport const registerSMTPAccount = (data) => async (dispatch) => {\n try {\n await post(`/channel-account/smtp`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Account created. `,\n });\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {\n notification.error({\n message: `Something went wrong. `,\n });\n }\n};\n\nexport const addSignatureToChannelAccount =\n (caid, signature) => async (dispatch) => {\n try {\n await post(\"/channel-account/email/signature\", { caid, signature }).then(\n (resp) => {\n dispatch(GetAllConfig());\n notification.success({\n message: `Signature Updated. `,\n });\n }\n );\n } catch (error) {\n dispatch(error);\n }\n };\n\nexport const removeSignatureFromChannelAccount = (caid) => async (dispatch) => {\n try {\n await del(\"/channel-account/email/signature\", { caid }).then((resp) => {\n dispatch(GetAllConfig());\n });\n } catch (error) {\n dispatch(error);\n }\n};\n\nexport const updateSignatureToChannelAccount =\n (caid, data) => async (dispatch) => {\n try {\n await put(\"/channel-account/email/signature\", { caid, ...data }).then(\n (resp) => {\n dispatch(GetAllConfig());\n }\n );\n } catch (error) {\n dispatch(error);\n }\n };\n\nexport const getCalenderIntegrationAccounts = () => async (dispatch) => {\n dispatch({ type: \"CALENDER_LOADING_TRIGGER\", data: true });\n try {\n await get(`/integration-account?type=calendar`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"CALENDER_ACCOUNTS\", data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const deleteCalendarAccount = (id) => async (dispatch) => {\n try {\n await del(`/integration-account/${id}`).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Account Removed. `,\n });\n dispatch(getCalenderIntegrationAccounts());\n }\n });\n } catch (error) {}\n};\n\nexport const updateSmtpPassword = (data) => async (dispatch) => {\n try {\n await put(`/channel-account/email/smtp-password`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Password Updated. `,\n });\n dispatch(GetAllConfig());\n }\n });\n } catch (error) {}\n};\n\nexport const patchMakeDefault = (data) => async (dispatch) => {\n try {\n await patch(`/channel-account/make-primary`, data).then((resp) => {\n if (resp.status === 200 && resp.data.status === true) {\n notification.success({\n message: `Primary Account Updated. `,\n });\n dispatch(GetAllConfig());\n } else {\n notification.error({\n message: resp?.data?.data?.message,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const SaveQuestionnaire = (data) => async (dispatch) => {\n try {\n await post(`/questionnaire-config`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Questionnaire saved. `,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const getQuestionsConfig = () => async (dispatch) => {\n try {\n await get(`/questionnaire-config`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"QUESTIONS_CONFIG\", data: resp.data.data });\n } else {\n dispatch({ type: \"QUESTIONS_CONFIG\", data: [] });\n }\n });\n } catch (error) {\n dispatch({ type: \"QUESTIONS_CONFIG\", data: [] });\n }\n};\n\nexport const SaveTenantTracker = (data) => async (dispatch) => {\n try {\n await post(`/tenant-tracker-config`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `tracker saved for global default. `,\n });\n }\n dispatch(getTenantTracker());\n });\n } catch (error) {}\n};\n\nexport const getTenantTracker = () => async (dispatch) => {\n try {\n await get(`/tenant-tracker-config`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"TRACKER_CONFIG\", data: resp.data.data });\n } else {\n dispatch({ type: \"TRACKER_CONFIG\", data: {} });\n }\n });\n } catch (error) {\n dispatch({ type: \"TRACKER_CONFIG\", data: {} });\n }\n};\nexport const updateTenantTracker = (id, data) => async (dispatch) => {\n try {\n await put(`/tenant-tracker-config/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `tracker updated for global default. `,\n });\n }\n dispatch(getTenantTracker());\n });\n } catch (error) {}\n};\n\nexport const deleteTenantTracker = (id) => async (dispatch) => {\n try {\n await del(`/tenant-tracker-config/${id}`).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `tracker deleted for global default. `,\n });\n }\n dispatch(getTenantTracker());\n });\n } catch (error) {}\n};\n","import {\n GET_AGENTS_ACTION_ERROR,\n GET_AGENTS_ACTION_RESPONSE,\n GET_AGENTS_ACTION_TRIGGER,\n} from \"constant\";\n\nimport { get } from \"helper/networkClient\";\nimport { store } from \"../store\";\n\nconst getAgentsActionResponse = (data) => ({\n type: GET_AGENTS_ACTION_RESPONSE,\n data: data,\n});\n\nconst getAgentsActionError = (data) => ({\n type: GET_AGENTS_ACTION_ERROR,\n data: data,\n});\n\nexport const getAgentsActionTrigger = () => async (dispatch) => {\n let Store = store.getState();\n let agents = Store?.AgentReducer?.agents;\n let tenants = Store?.TenantReducer?.tenants;\n if (agents?.data?.length === 0 || tenants?.length === 0) {\n dispatch({ type: GET_AGENTS_ACTION_TRIGGER, data: {} });\n await get(\"/agents\").then((resp) => {\n if (resp.status === 200) {\n dispatch(getAgentsActionResponse(resp.data));\n dispatch({ type: \"USER_TENANT_LIST\", data: resp.data.data });\n dispatch({ type: \"CONTENT_LOADING\", data: false });\n } else {\n dispatch(getAgentsActionError(resp));\n }\n });\n }\n};\n\nexport const getTeamAgentsActionTrigger = () => async (dispatch) => {\n let Store = store.getState();\n let teams = Store?.AgentReducer?.teams;\n let tenants = Store?.TenantReducer?.tenants;\n if (\n !teams?.data?.length ||\n teams?.data?.length === 0 ||\n tenants?.length === 0\n ) {\n await get(\"/team/all\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"TEAM_LIST\",\n data: resp?.data,\n });\n }\n });\n }\n};\n","import {\n GET_CAMPAIGNS_TRIGGER,\n GET_CAMPAIGNS_RESPONSE,\n CREATE_CAMPAIGNS_TRIGGER,\n CREATE_CAMPAIGNS_RESPONSE,\n CREATE_CAMPAIGN_STEP_TRIGGER,\n CREATE_CAMPAIGN_STEP_RESPONSE,\n GET_CAMPAIGN_BY_ID_RESPONSE,\n GET_CAMPAIGNS_ERROR,\n WAIT_FOR_CAMPAIGN_RESPONSE,\n GET_CAMPAIGNS_PLANS_RESPONSE,\n GET_CAMPAIGNS_PLAN_STATUS_TRIGGER,\n GET_CAMPAIGNS_PLAN_STATUS_RESPONSE,\n GET_CAMPAIGNS_PLAN_STATUS_ERROR,\n GET_CAMPAIGNS_STEPS_CONDITIONS_TRIGGER,\n GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE,\n GET_CAMPAIGNS_STEPS_CONDITIONS_ERROR,\n} from \"constant\";\nimport { notification } from \"antd\";\n\nimport { del, get, patch, post, put } from \"helper/networkClient\";\n\nconst getCampaignsResponse = (data) => ({\n type: GET_CAMPAIGNS_RESPONSE,\n data: data,\n});\nconst getCampaignsByIDResp = (data) => ({\n type: GET_CAMPAIGN_BY_ID_RESPONSE,\n data: data,\n});\nexport const getCampaigns = (params) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_TRIGGER });\n await get(\"/workflow\", params)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignsResponse(resp.data));\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const getCampaignsMaster = (params) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_TRIGGER });\n await get(`/workflow?master=true`, params)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignsResponse(resp.data));\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const createCampaigns = (data) => async (dispatch) => {\n dispatch({ type: CREATE_CAMPAIGNS_TRIGGER });\n await post(\"/workflow\", data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: CREATE_CAMPAIGNS_RESPONSE, data: resp.data });\n notification.success({\n message: `Campaign created`,\n });\n if (!data.openingId) {\n dispatch(getCampaigns());\n }\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const createCampaignStep = (data) => async (dispatch) => {\n dispatch({ type: CREATE_CAMPAIGN_STEP_TRIGGER });\n await post(\"/workflow/step\", data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: CREATE_CAMPAIGN_STEP_RESPONSE, data: resp.data });\n dispatch(getCampaignByID(data.wfId));\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: false });\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: false });\n });\n};\nexport const createCampaignStepCloned = (data) => async (dispatch) => {\n dispatch({ type: CREATE_CAMPAIGN_STEP_TRIGGER });\n await post(\"/workflow/step/cloned\", data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: CREATE_CAMPAIGN_STEP_RESPONSE, data: resp.data });\n dispatch(getCampaignByID(data.wfId));\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: false });\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: false });\n });\n};\n\nexport const getCampaignByID = (id) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_TRIGGER });\n await get(`/workflow/${id}`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignsByIDResp(resp.data));\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\n\nexport const publishCampaigns = (data) => async (dispatch) => {\n await patch(\"/workflow\", data)\n .then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Campaign Published`,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const updateCampaigns = (id, data) => async (dispatch) => {\n dispatch({ type: CREATE_CAMPAIGNS_TRIGGER });\n await put(`/workflow/${id}`, data)\n .then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Campaign Updated`,\n });\n if (!data.openingId) {\n dispatch(getCampaigns());\n }\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const delCampaignStep = (id) => async (dispatch) => {\n await del(`/workflow/step/${id}`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignByID(resp?.data?.data?.wfId));\n notification.success({\n message: `Campaign deleted`,\n });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const delCampaignStepCloned = (id) => async (dispatch) => {\n await del(`/workflow/step/${id}/cloned`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignByID(resp?.data?.data?.wfId));\n notification.success({\n message: `Campaign deleted`,\n });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const delCampaign = (id) => async (dispatch) => {\n await del(`/workflow/${id}`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaigns());\n notification.success({\n message: `Campaign deleted`,\n });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const updateCampaignStep = (id, data) => async (dispatch) => {\n await put(`/workflow/step/${id}`, data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignByID(resp?.data?.data?.wfId));\n notification.success({\n message: `Campaign Step Updated`,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\nexport const updateCampaignStepCloned = (id, data) => async (dispatch) => {\n await put(`/workflow/step/${id}/cloned`, data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaignByID(resp?.data?.data?.wfId));\n notification.success({\n message: `Campaign Step Updated`,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\n\nexport const getCampaignsPlans = (id) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_TRIGGER });\n await get(`/workflow/${id}/plans`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: GET_CAMPAIGNS_PLANS_RESPONSE, data: resp.data });\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\n\nexport const executeCampaignOnDemand = (data) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_TRIGGER });\n await post(`/workflow/ondemand`, data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getCampaigns());\n notification.success({\n message: `on-demand campaign executed`,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_ERROR });\n });\n};\n\nexport const getCampaignsPlanStatus = (id) => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_PLAN_STATUS_TRIGGER });\n await get(`/workflow/plan/${id}/status`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_CAMPAIGNS_PLAN_STATUS_RESPONSE,\n data: resp?.data?.data ?? resp?.data,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_PLAN_STATUS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_PLAN_STATUS_ERROR });\n });\n};\n\nexport const getCampaignsStepsConditions = () => async (dispatch) => {\n dispatch({ type: GET_CAMPAIGNS_STEPS_CONDITIONS_TRIGGER });\n await get(`/workflow/steps/conditions`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_CAMPAIGNS_STEPS_CONDITIONS_ERROR });\n }\n })\n .catch((err) => {\n dispatch({ type: GET_CAMPAIGNS_STEPS_CONDITIONS_ERROR });\n });\n};\n\nexport const exportWfPlanDetails = (planId) => async (dispatch) => {\n try {\n dispatch({ type: \"EXPORT_WF_PLAN_TRIGGER\" });\n const response = await get(`/workflow/export?planId=${planId}`, {\n responseType: \"blob\",\n });\n if (response.status === 200) {\n const blob = response.data;\n const url = window.URL.createObjectURL(\n new Blob([blob], { type: \"application/octet-stream\" })\n );\n const link = document.createElement(\"a\");\n link.href = url;\n link.setAttribute(\"download\", \"PlanDetails.csv\");\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n notification.success({\n message: `Contacts exported successfully`,\n });\n } else {\n dispatch({ type: \"EXPORT_WF_PLAN_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n } catch (error) {\n dispatch({ type: \"EXPORT_WF_PLAN_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getClonedCampaigns = (id) => async (dispatch) => {\n dispatch({ type: \"CLONED_CAMPAIGNS_TRIGGER\" });\n await get(`/workflow/${id}/cloned`)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"CLONED_CAMPAIGNS_RESPONSE\", data: resp.data });\n } else {\n dispatch({ type: \"CLONED_CAMPAIGNS_ERROR\" });\n }\n })\n .catch((err) => {\n dispatch({ type: \"CLONED_CAMPAIGNS_ERROR\" });\n });\n};\n\nexport const updateCloneCampaignWithMaster = (data) => async (dispatch) => {\n dispatch({ type: \"CLONED_CAMPAIGNS_TRIGGER\" });\n await post(`/workflow/sequences/push`, data)\n .then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Clones Updated`,\n });\n } else {\n notification.error({\n message: `Error please try again later`,\n });\n }\n })\n .catch((err) => {\n notification.error({\n message: `Error please try again later`,\n });\n });\n};\n","import { notification } from \"antd\";\nimport {\n GET_ALL_CONTACT_ACTION_ERROR,\n GET_ALL_CONTACT_ACTION_RESPONSE,\n GET_ALL_CONTACT_ACTION_TRIGGER,\n GET_CONTACT_ACTION_ERROR,\n GET_CONTACT_ACTION_RESPONSE,\n GET_CONTACT_ACTION_TRIGGER,\n GET_CONTACT_FORM,\n GET_CONTACT_FORM_RESPONSE,\n UPDATE_CONTACT_ACTION_ERROR,\n UPDATE_CONTACT_ACTION_RESPONSE,\n UPDATE_CONTACT_ACTION_TRIGGER,\n GET_CONTACT_GRP_RESPONSE,\n GET_ACTIVE_GRP_RESPONSE,\n GET_LOCATION_ACTION_TRIGGER,\n GET_LOCATION_ACTION_RESPONSE,\n GET_LOCATION_ACTION_ERROR,\n CREATE_CONTACT_FORM_FIELD_RESPONSE,\n CREATE_CONTACT_FORM_FIELD_ERROR,\n SEARCH_CONTACT_RESPONSE,\n} from \"constant\";\n\nimport { del, get, patch, post, put } from \"helper/networkClient\";\nimport history from \"utils/history\";\n\nexport const getAllContactActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: GET_ALL_CONTACT_ACTION_TRIGGER });\n await get(\"/contact\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_ALL_CONTACT_ACTION_RESPONSE\",\n data: resp.data,\n });\n dispatch({ type: \"STOP_LOADING_CANDIDATE\" });\n } else {\n dispatch({\n type: \"GET_ALL_CONTACT_ACTION_ERROR\",\n data: resp.data,\n });\n dispatch({ type: \"STOP_LOADING_CANDIDATE\" });\n }\n });\n};\n\nconst getContactActionResponse = (data) => ({\n type: GET_CONTACT_ACTION_RESPONSE,\n data: data,\n});\n\nconst getContactActionError = (data) => ({\n type: GET_CONTACT_ACTION_ERROR,\n data: data,\n});\n\nexport const getContactActionTrigger = (userId) => async (dispatch) => {\n dispatch({ type: GET_CONTACT_ACTION_TRIGGER, data: { userId } });\n await get(\"/contact/\" + userId).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContactActionResponse(resp.data));\n } else {\n dispatch(getContactActionError(resp));\n }\n });\n};\n\nconst updateContactActionResponse = (data) => ({\n type: UPDATE_CONTACT_ACTION_RESPONSE,\n data: data,\n});\n\nconst updateContactActionError = (data) => ({\n type: UPDATE_CONTACT_ACTION_ERROR,\n data: data,\n});\n\nexport const updateContactActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: UPDATE_CONTACT_ACTION_TRIGGER, data });\n try {\n await patch(\"/contact\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(updateContactActionResponse(resp.data));\n } else {\n dispatch(updateContactActionError(resp));\n }\n });\n } catch (error) {\n dispatch(updateContactActionError());\n }\n};\nexport const updateContactAc = (data, id) => async (dispatch) => {\n dispatch({ type: UPDATE_CONTACT_ACTION_TRIGGER, data });\n try {\n await put(`/contact/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllContactActionTrigger());\n history.push(\"/admin/Contacts\");\n } else {\n dispatch(getAllContactActionTrigger());\n }\n });\n } catch (error) {\n dispatch(updateContactActionError());\n }\n};\nconst GetContactFormResp = (data) => ({\n type: GET_CONTACT_FORM_RESPONSE,\n data: data,\n});\n\nexport const getContactForm = () => async (dispatch) => {\n dispatch({ type: GET_CONTACT_FORM });\n await get(\"/contact-management\").then((resp) => {\n if (resp.status === 200) {\n dispatch(GetContactFormResp(resp.data.data));\n } else {\n dispatch(getContactActionError(resp));\n }\n });\n};\nexport const CreateCont = (data) => async (dispatch) => {\n await post(\"/contact\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllContactActionTrigger());\n history.push(\"/admin/Contacts\");\n } else {\n dispatch(getAllContactActionTrigger());\n }\n });\n};\nconst getContGrpnResponse = (data) => ({\n type: GET_CONTACT_GRP_RESPONSE,\n data: data,\n});\nexport const getContGrpTrigger = (userId) => async (dispatch) => {\n dispatch({ type: GET_CONTACT_ACTION_TRIGGER, data: { userId } });\n await get(\"/contact/group\").then((resp) => {\n if (resp.status === 200) {\n dispatch(getContGrpnResponse(resp.data));\n } else {\n dispatch(getContactActionError(resp));\n }\n });\n};\nexport const CreateContGrp = (data) => async (dispatch) => {\n await post(\"/contact/group\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContGrpTrigger());\n history.push(`/admin/Contacts/group`);\n } else {\n dispatch(getContGrpTrigger());\n }\n });\n};\nconst activeGroup = (data) => ({\n type: GET_ACTIVE_GRP_RESPONSE,\n data: data,\n});\nexport const getContGrpIDr = (userId) => async (dispatch) => {\n dispatch({ type: GET_CONTACT_ACTION_TRIGGER, data: { userId } });\n await get(`/contact/group/${userId}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(activeGroup(resp.data));\n } else {\n dispatch(getContactActionError(resp));\n }\n });\n};\nexport const updateGrp = (id, obj) => async (dispatch) => {\n dispatch({ type: GET_CONTACT_ACTION_TRIGGER });\n await put(`/contact/group/${id}`, obj).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContGrpTrigger());\n history.push(`/admin/Contacts/group`);\n } else {\n dispatch(getContactActionError(resp));\n }\n });\n};\n\nexport const getLocation = (param) => async (dispatch) => {\n dispatch({ type: GET_LOCATION_ACTION_TRIGGER });\n try {\n await get(\"/user/location/search\", param).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: GET_LOCATION_ACTION_RESPONSE, data: resp.data });\n } else {\n dispatch({ type: GET_LOCATION_ACTION_ERROR, data: resp });\n }\n });\n } catch (error) {\n dispatch({ type: GET_LOCATION_ACTION_ERROR, data: error });\n }\n};\n\nexport const createContactFormField = (data) => async (dispatch) => {\n try {\n await post(\"/contact-management/field\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: CREATE_CONTACT_FORM_FIELD_RESPONSE, data: resp.data });\n notification.success({\n message: `Field created successfully`,\n });\n dispatch(getContactForm());\n } else {\n dispatch({\n type: CREATE_CONTACT_FORM_FIELD_ERROR,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: CREATE_CONTACT_FORM_FIELD_ERROR,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const deleteContactFormField = (parm, data) => async (dispatch) => {\n try {\n await del(`/contact-management/field`, data, parm).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContactForm());\n notification.success({\n message: `Field deleted successfully`,\n });\n dispatch(getContactForm());\n } else {\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const updateContactFormField = (data, params) => async (dispatch) => {\n try {\n await put(\"/contact-management/field\", data, { ...params }).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContactForm());\n notification.success({\n message: `Field updated successfully`,\n });\n } else {\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const searchContactAction = (data) => async (dispatch) => {\n try {\n await get(\"/contact/search\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: SEARCH_CONTACT_RESPONSE, data: resp.data });\n }\n });\n } catch (error) {}\n};\n\nexport const ContactImportAction = (data) => async (dispatch) => {\n try {\n await post(\"/contact/import\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllContactActionTrigger());\n notification.success({\n message: `Contacts imported successfully`,\n });\n } else {\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getContactStages = () => async (dispatch) => {\n try {\n dispatch({ type: \"GET_CONTACT_STAGES_TRIGGER\" });\n await get(\"/contact/stage\").then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"GET_CONTACT_STAGES_RESPONSE\", data: resp.data });\n }\n });\n } catch (error) {\n dispatch({ type: \"GET_CONTACT_STAGES_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const changeContactStage = (data) => async (dispatch) => {\n try {\n dispatch({ type: \"CHANGE_CONTACT_STAGE_TRIGGER\" });\n await patch(\"/contact/stage\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"CHANGE_CONTACT_STAGE_RESPONSE\", data: resp.data });\n notification.success({\n message: `Stage changed successfully`,\n });\n } else {\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n dispatch({ type: \"CHANGE_CONTACT_STAGE_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const exportContactByTag = (TagVal) => async (dispatch) => {\n try {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_TRIGGER\" });\n const response = await get(`/contact/export?tag=${TagVal}`, {\n responseType: \"blob\",\n });\n if (response.status === 200) {\n const blob = response.data;\n const url = window.URL.createObjectURL(\n new Blob([blob], { type: \"application/octet-stream\" })\n );\n const link = document.createElement(\"a\");\n link.href = url;\n link.setAttribute(\"download\", \"contacts.csv\");\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n notification.success({\n message: `Contacts exported successfully`,\n });\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_RESPONSE\" });\n } else {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n } catch (error) {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const exportContactByPosition =\n (id, positionName) => async (dispatch) => {\n try {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_TRIGGER\" });\n const response = await get(`/contact/export/position?id=${id}`, {\n responseType: \"blob\",\n });\n if (response.status === 200) {\n const blob = response.data;\n const url = window.URL.createObjectURL(\n new Blob([blob], { type: \"application/octet-stream\" })\n );\n const link = document.createElement(\"a\");\n link.href = url;\n link.setAttribute(\"download\", `${positionName}.csv`);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n notification.success({\n message: `candidates exported successfully`,\n });\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_RESPONSE\" });\n } else {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n } catch (error) {\n dispatch({ type: \"EXPORT_CONTACT_BY_TAG_ERROR\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n };\n","import {\n GET_CONTENT_ACTION_TRIGGER,\n GET_CONTENT_ACTION_RESPONSE,\n GET_CONTENT_ACTION_ERROR,\n DELETE_CONTENT_ACTION_TRIGGER,\n DELETE_CONTENT_ACTION_RESPONSE,\n DELETE_CONTENT_ACTION_ERROR,\n CREATE_CONTENT_ACTION_TRIGGER,\n CREATE_CONTENT_ACTION_RESPONSE,\n CREATE_CONTENT_ACTION_ERROR,\n UPDATE_CONTENT_ACTION_TRIGGER,\n UPDATE_CONTENT_ACTION_RESPONSE,\n UPDATE_CONTENT_ACTION_ERROR,\n SEARCH_CONTENT_ACTION_TRIGGER,\n SEARCH_CONTENT_ACTION_RESPONSE,\n SEARCH_CONTENT_ACTION_ERROR,\n GET_SINGLE_CONTENT_ACTION_TRIGGER,\n GET_SINGLE_CONTENT_ACTION_RESPONSE,\n GET_SINGLE_CONTENT_ACTION_ERROR,\n UPDATE_CONTENT_TAG_ACTION_TRIGGER,\n UPDATE_CONTENT_TAG_ACTION_RESPONSE,\n UPDATE_CONTENT_TAG_ACTION_ERROR,\n} from \"constant\";\n\nimport { get, post, del, put } from \"helper/networkClient\";\n\nconst getContentActionResponse = (data) => ({\n type: GET_CONTENT_ACTION_RESPONSE,\n data: data,\n});\n\nconst getContentActionError = (data) => ({\n type: GET_CONTENT_ACTION_ERROR,\n data: data,\n});\n\nexport const getContentActionTrigger = (start, end) => async (dispatch) => {\n dispatch({ type: GET_CONTENT_ACTION_TRIGGER, data: { start, end } });\n await get(\"/content\", {\n start: start,\n end: end,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContentActionResponse(resp.data));\n } else {\n dispatch(getContentActionError(resp));\n }\n });\n};\n\nconst getSingleContentActionResponse = (data) => ({\n type: GET_SINGLE_CONTENT_ACTION_RESPONSE,\n data: data,\n});\n\nconst getSingleContentActionError = (data) => ({\n type: GET_SINGLE_CONTENT_ACTION_ERROR,\n data: data,\n});\n\nexport const getSingleContentActionTrigger = (id) => async (dispatch) => {\n dispatch({ type: GET_SINGLE_CONTENT_ACTION_TRIGGER });\n await get(`/content/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getSingleContentActionResponse(resp.data));\n } else {\n dispatch(getSingleContentActionError(resp));\n }\n });\n};\n\nexport const searchContentActionTrigger = (query) => async (dispatch) => {\n dispatch({ type: SEARCH_CONTENT_ACTION_TRIGGER, data: query });\n await get(\"/content/search\", {\n text: query,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(searchContentActionResponse(resp.data));\n } else {\n dispatch(searchContentActionError(resp));\n }\n });\n};\n\nconst searchContentActionResponse = (data) => ({\n type: SEARCH_CONTENT_ACTION_RESPONSE,\n data: data,\n});\n\nconst searchContentActionError = (data) => ({\n type: SEARCH_CONTENT_ACTION_ERROR,\n data: data,\n});\n\nexport const createContentActionTrigger = (data) => async (dispatch) => {\n try {\n dispatch({ type: CREATE_CONTENT_ACTION_TRIGGER, data });\n await post(\"/content\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(createContentActionResponse(resp.data));\n dispatch(getContentActionTrigger(0, 9));\n } else {\n dispatch(createContentActionError(resp));\n }\n });\n } catch (error) {\n dispatch({ type: SEARCH_CONTENT_ACTION_ERROR, data });\n }\n};\n\nconst createContentActionResponse = (data) => ({\n type: CREATE_CONTENT_ACTION_RESPONSE,\n data: data,\n});\n\nconst createContentActionError = (data) => ({\n type: CREATE_CONTENT_ACTION_ERROR,\n data: data,\n});\n\nexport const deleteContentActionTrigger = (id) => async (dispatch) => {\n dispatch({ type: DELETE_CONTENT_ACTION_TRIGGER, id });\n await del(\"/content\", {}, { id: id }).then((res) => {\n if (res.status === 200) {\n dispatch(getContentActionTrigger(0, 9));\n dispatch(deleteContentActionResponse(res));\n } else {\n dispatch(deleteContentActionError(res));\n }\n });\n};\n\nconst deleteContentActionResponse = (data) => ({\n type: DELETE_CONTENT_ACTION_RESPONSE,\n data,\n});\n\nconst deleteContentActionError = (data) => ({\n type: DELETE_CONTENT_ACTION_ERROR,\n data,\n});\n\nexport const updateContentActionTrigger = (data, id) => async (dispatch) => {\n dispatch({ type: UPDATE_CONTENT_ACTION_TRIGGER, data });\n await put(\"/content\", data, { id: id }).then((res) => {\n if (res.status === 200) {\n dispatch(getContentActionTrigger(0, 9));\n dispatch(updateContentActionResponse(res.data));\n } else {\n dispatch(updateContentActionError(res));\n }\n });\n};\n\nconst updateContentActionResponse = (data) => ({\n type: UPDATE_CONTENT_ACTION_RESPONSE,\n data: data,\n});\n\nconst updateContentActionError = (data) => ({\n type: UPDATE_CONTENT_ACTION_ERROR,\n data: data,\n});\n\nexport const updateContentTagActionTrigger = (data, id) => async (dispatch) => {\n dispatch({ type: UPDATE_CONTENT_TAG_ACTION_TRIGGER, data });\n await put(\"/content\", data, { id: id }).then((res) => {\n if (res.status === 200) {\n dispatch(getContentActionTrigger(0, 9));\n dispatch(updateContentTagActionResponse(res));\n } else {\n dispatch(updateContentTagActionError(res));\n }\n });\n};\n\nconst updateContentTagActionResponse = (data) => ({\n type: UPDATE_CONTENT_TAG_ACTION_RESPONSE,\n data: data,\n});\n\nconst updateContentTagActionError = (data) => ({\n type: UPDATE_CONTENT_TAG_ACTION_ERROR,\n data: data,\n});\n\nexport const getContentTemplate = () => async (dispatch) => {\n await get(\"/content\", {\n start: 0,\n end: 1000,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(getContentActionResponse(resp.data));\n } else {\n dispatch(getContentActionError(resp));\n }\n });\n};\n","import {\n GET_CONV_ACTION_TRIGGER,\n GET_CONV_ACTION_RESPONSE,\n GET_CONV_ACTION_ERROR,\n UPDATE_CONV_ACTION_TRIGGER,\n UPDATE_CONV_ACTION_RESPONSE,\n UPDATE_CONV_ACTION_ERROR,\n GET_SINGLE_CONV_ACTION_TRIGGER,\n GET_SINGLE_CONV_ACTION_RESPONSE,\n GET_SINGLE_CONV_ACTION_ERROR,\n GET_CONV_SEARCH_RESPONSE,\n} from \"constant\";\nimport { notification } from \"antd\";\nimport { SET_CHAT_BOT_SWITCH } from \"constant/app.constant\";\n\nimport { get, put } from \"helper/networkClient\";\n\nconst getConvActionResponse = (data) => ({\n type: GET_CONV_ACTION_RESPONSE,\n data: data,\n});\nconst getConvSearchResponse = (data) => ({\n type: GET_CONV_SEARCH_RESPONSE,\n data: data,\n});\n\nconst getConvActionError = (data) => ({\n type: GET_CONV_ACTION_ERROR,\n data: data,\n});\nconst updateConvActionResponse = (data) => ({\n type: UPDATE_CONV_ACTION_RESPONSE,\n data: data,\n});\n\nconst updateConvActionError = (data) => ({\n type: UPDATE_CONV_ACTION_ERROR,\n data: data,\n});\nconst getSingleConvActionResponse = (data) => ({\n type: GET_SINGLE_CONV_ACTION_RESPONSE,\n data: data,\n});\n\nconst getSingleConvActionError = (data) => ({\n type: GET_SINGLE_CONV_ACTION_ERROR,\n data: data,\n});\n\nexport const getConvActionTrigger = (params) => async (dispatch) => {\n console.log(\"convTriiger\", params);\n dispatch({ type: \"GET_CONV_ACTION_TRIGGER_LOADING\", data: params });\n await get(\"/conversation\", params).then((resp) => {\n if (resp.status === 200) {\n dispatch(getConvActionResponse(resp.data));\n } else {\n dispatch(getConvActionError(resp));\n }\n });\n};\nexport const getConvSearchTrigger = (params) => async (dispatch) => {\n dispatch({ type: GET_CONV_ACTION_TRIGGER, data: params });\n await get(\"/conversation\", params).then((resp) => {\n if (resp.status === 200) {\n dispatch(getConvSearchResponse(resp.data));\n } else {\n dispatch(getConvActionError(resp));\n }\n });\n};\n\nexport const updateConvActionTrigger = (id, data) => async (dispatch) => {\n dispatch({ type: UPDATE_CONV_ACTION_TRIGGER, data });\n await put(`/conversation/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(updateConvActionResponse(resp.data));\n } else {\n dispatch(updateConvActionError(resp));\n }\n });\n};\nexport const updateChatBot = (id, data) => async (dispatch) => {\n await put(\"/conversation/\" + id, data).then((resp) => {\n dispatch({ type: SET_CHAT_BOT_SWITCH, data: resp.data.data });\n notification.success({\n message: `${\n resp?.data?.data?.botConv\n ? `ChatBot Activated!`\n : `ChatBot Deactivated!`\n }`,\n });\n });\n};\n\nexport const getSingleConvActionTrigger = (convId) => async (dispatch) => {\n dispatch({ type: GET_SINGLE_CONV_ACTION_TRIGGER, data: { convId } });\n await get(`/conversation/${convId}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getSingleConvActionResponse(resp.data));\n } else {\n dispatch(getSingleConvActionError(resp));\n }\n });\n};\n","import {\n GET_FILE_ACTION_ERROR,\n GET_FILE_ACTION_RESPONSE,\n GET_FILE_ACTION_TRIGGER,\n SEARCH_FILE_ACTION_ERROR,\n SEARCH_FILE_ACTION_RESPONSE,\n SEARCH_FILE_ACTION_TRIGGER,\n UPLOAD_FILE_ACTION_ERROR,\n UPLOAD_FILE_ACTION_RESPONSE,\n UPLOAD_FILE_ACTION_TRIGGER,\n UPLOAD_MESSAGE_FILE_ACTION_ERROR,\n UPLOAD_MESSAGE_FILE_ACTION_RESPONSE,\n UPLOAD_MESSAGE_FILE_ACTION_TRIGGER,\n} from \"constant\";\n\nimport { get, postFormData } from \"helper/networkClient\";\n\nconst getFileActionResponse = (data) => ({\n type: GET_FILE_ACTION_RESPONSE,\n data: data,\n});\n\nconst getFileActionError = (data) => ({\n type: GET_FILE_ACTION_ERROR,\n data: data,\n});\n\nexport const getFileActionTrigger = (start, end) => async (dispatch) => {\n dispatch({ type: GET_FILE_ACTION_TRIGGER, data: { start, end } });\n await get(\"/file\", {\n start: start,\n end: end,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(getFileActionResponse(resp.data));\n } else {\n dispatch(getFileActionError(resp));\n }\n });\n};\n\nconst searchFileActionResponse = (data) => ({\n type: SEARCH_FILE_ACTION_RESPONSE,\n data: data,\n});\n\nconst searchFileActionError = (data) => ({\n type: SEARCH_FILE_ACTION_ERROR,\n data: data,\n});\n\nexport const searchFileActionTrigger = (query) => async (dispatch) => {\n dispatch({ type: SEARCH_FILE_ACTION_TRIGGER, data: query });\n await get(\"/file/search\", {\n text: query,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(searchFileActionResponse(resp.data));\n } else {\n dispatch(searchFileActionError(resp));\n }\n });\n};\n\nconst uploadFileActionResponse = (data) => ({\n type: UPLOAD_FILE_ACTION_RESPONSE,\n data: data,\n});\n\nconst uploadFileActionError = (data) => ({\n type: UPLOAD_FILE_ACTION_ERROR,\n data: data,\n});\n\nexport const uploadFileActionTrigger = (file) => async (dispatch) => {\n dispatch({ type: UPLOAD_FILE_ACTION_TRIGGER, data: {} });\n const formData = new FormData();\n formData.append(\"file\", file);\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n dispatch(uploadFileActionResponse(resp.data));\n } else {\n dispatch(uploadFileActionError(resp));\n }\n });\n};\n\nconst uploadMessageFileActionResponse = (data) => ({\n type: UPLOAD_MESSAGE_FILE_ACTION_RESPONSE,\n data: data,\n});\n\nconst uploadMessageFileActionError = (data) => ({\n type: UPLOAD_MESSAGE_FILE_ACTION_ERROR,\n data: data,\n});\n\nexport const uploadMessageFileActionTrigger = (file) => async (dispatch) => {\n dispatch({ type: UPLOAD_MESSAGE_FILE_ACTION_TRIGGER, data: {} });\n const formData = new FormData();\n formData.append(\"file\", file);\n await postFormData(\"/file/message\", formData).then((resp) => {\n if (resp.status === 200) {\n dispatch(uploadMessageFileActionResponse(resp.data));\n } else {\n dispatch(uploadMessageFileActionError(resp));\n }\n });\n};\n","import {\n LOGIN_ACTION_TRIGGER,\n LOGIN_ACTION_RESPONSE,\n LOGIN_ACTION_ERROR,\n GET_USER_ACTION_TRIGGER,\n GET_USER_ACTION_RESPONSE,\n GET_USER_ACTION_ERROR,\n GET_SYSTEM_ACTION_ERROR,\n GET_SYSTEM_ACTION_TRIGGER,\n GET_SYSTEM_ACTION_RESPONSE,\n SET_MFA,\n SUPPORTED_LANGUAGES,\n POSTAL_CODE,\n UNVERIFIED_USER,\n} from \"constant\";\nimport {\n postLogin,\n getpublic,\n usrpref,\n postpublic,\n get,\n} from \"helper/networkClient\";\nimport {\n setCookie,\n getCookie,\n cxmessage,\n deleteCookie,\n encodeToBase64,\n} from \"utils\";\nimport { notification } from \"antd\";\nimport history from \"utils/history\";\nimport { store } from \"../store\";\n\nexport const loginActionTrigger = (data) => async (dispatch) => {\n deleteCookie(\"ob_a\");\n deleteCookie(\"ob_r\");\n deleteCookie(\"tenant\");\n dispatch({\n type: LOGIN_ACTION_TRIGGER,\n data: data,\n });\n\n await postLogin(\"/login\", data)\n .then((res) => {\n if (res.status === 200) {\n dispatch(loginActionResponse(res.data));\n } else {\n dispatch(loginActionError(res));\n }\n })\n .catch((error) => {\n if ([\"E11-218\", \"E11-217\", \"E11-302\"].includes(error.appErrorCode)) {\n dispatch(loginActionError(error));\n dispatch({ type: UNVERIFIED_USER, data: true });\n } else {\n dispatch(\n loginActionError(error),\n notification.error({ message: \"Please check your credentials\" })\n );\n }\n });\n};\n\nconst loginActionResponse = (data) => {\n setCookie(\"ob_a\", data.access_token, data.expires_in * 1000);\n setCookie(\"ob_r\", data.refresh_token, 7 * 24 * 60 * 60 * 1000);\n setCookie(\"token_type\", data.token_type, 7 * 24 * 60 * 60 * 1000);\n return { type: LOGIN_ACTION_RESPONSE, data };\n};\n\nconst loginActionError = (data) => {\n return { type: LOGIN_ACTION_ERROR, data };\n};\n\nexport const getUserActionTrigger = () => async (dispatch) => {\n let Store = store.getState();\n let user = Store?.dittoAdminReducer?.user;\n if (!user?.userTenants) {\n dispatch({\n type: GET_USER_ACTION_TRIGGER,\n });\n\n await usrpref(\"/auth/pref\")\n .then((res) => {\n if (res.status === 200) {\n const hostname = window.location.hostname;\n if (\n res?.data?.data?.userTenants?.[0]?.redirectionEnabled &&\n res?.data?.data?.userTenants?.[0]?.redirectionUrl?.length > 0 &&\n hostname !== res?.data?.data?.userTenants?.[0]?.redirectionUrl &&\n hostname !== \"localhost\" &&\n hostname !== \"app2.hirebound.io\"\n ) {\n setCookie(\n \"tenant\",\n res?.data?.data?.userTenants[0]?.tenantId?._id,\n 7 * 24 * 60 * 60 * 1000\n );\n\n const tenant = res?.data?.data?.userTenants[0]?.tenantId?._id;\n const ob_a = getCookie(\"ob_a\");\n const ob_r = getCookie(\"ob_r\");\n const dataObj = {\n tenant,\n ob_a,\n ob_r,\n hostname: res?.data?.data?.userTenants?.[0]?.redirectionUrl,\n };\n const encodedData = encodeToBase64(dataObj);\n window.location.href = `https://${res?.data?.data?.userTenants?.[0]?.redirectionUrl}/?redirectExternal=${encodedData}`;\n } else {\n dispatch(getUserActionResponse(res.data?.data));\n const tenantId = getCookie(\"tenant\");\n if (!tenantId) {\n setCookie(\n \"tenant\",\n res?.data?.data?.userTenants[0]?.tenantId?._id,\n 7 * 24 * 60 * 60 * 1000\n );\n } else {\n setCookie(\"tenant\", tenantId, 7 * 24 * 60 * 60 * 1000);\n }\n }\n\n // dispatch(getSystemActionTrigger());\n } else {\n dispatch(getUserActionError(res));\n }\n })\n .catch((error) => dispatch(getUserActionError(error)));\n }\n};\n// export const getSystemActionTrigger = () => async (dispatch) => {\n// dispatch({\n// type: GET_SYSTEM_ACTION_TRIGGER,\n// });\n// const tenantId = getCookie(\"tenant\");\n// await usrpref(`/tenant/${tenantId}/preferences`, null, \"workbench\")\n// .then((res) => {\n// if (res.status === 200) {\n// dispatch(getSystemActionResponse(res.data));\n// } else {\n// dispatch(getSystemActionError(res));\n// }\n// })\n// .catch((error) => dispatch(getSystemActionError(error)));\n// };\n\nconst getUserActionResponse = (data) => {\n return { type: GET_USER_ACTION_RESPONSE, data };\n};\n\nconst getUserActionError = (data) => {\n return { type: GET_USER_ACTION_ERROR, data };\n};\nconst getSystemActionResponse = (data) => {\n return { type: GET_SYSTEM_ACTION_RESPONSE, data };\n};\n\nconst getSystemActionError = (data) => {\n return { type: GET_SYSTEM_ACTION_ERROR, data };\n};\n\nexport const mfaActionTrigger = (data) => async (dispatch) => {\n try {\n await postLogin(\"/2faverify\", data).then((res) => {\n if (res.status === 200) {\n if (res.data?.access_token) {\n setCookie(\"ob_a\", res.data.access_token, data.expires_in * 1000);\n setCookie(\"token_type\", \"bearer\", 7 * 24 * 60 * 60 * 1000);\n setCookie(\"token_type\", res.data.token_type, 7 * 24 * 60 * 60 * 1000);\n setTimeout(() => {\n dispatch({ type: SET_MFA, data: false });\n }, 500);\n }\n dispatch(getUserActionTrigger());\n } else {\n dispatch({ type: SET_MFA, data: true });\n }\n });\n } catch (error) {\n cxmessage.error(\"incorrect verification code. please try again\");\n }\n};\nexport const reMfaActionTrigger = (data) => async (dispatch) => {\n try {\n await postLogin(\"/resendotp\", data).then((res) => {\n if (res.status === 200) {\n cxmessage.success(\"Pelase check your mail for OTP\");\n } else {\n dispatch({ type: SET_MFA, data: true });\n }\n });\n } catch (error) {\n cxmessage.error(\"please try again\");\n }\n};\n\nexport const forgetPasswordActionTrigger = (data) => async (dispatch) => {\n try {\n await postLogin(\"/user/forgotpwd\", data).then((res) => {\n if (res.status === 200) {\n notification.success({ message: \"Please check your mail for link\" });\n }\n });\n } catch (error) {\n notification.error({ message: \"Please try again\" });\n }\n};\n\nexport const resetPasswordActionTrigger = (data) => async (dispatch) => {\n try {\n await postLogin(\"/user/password/validatepwd\", data).then((res) => {\n if (res.status === 200) {\n notification.success({ message: \"Password updated successfully\" });\n history.push(\"/login\");\n }\n });\n } catch (error) {\n notification.error({ message: \"Something went wrong , Please try again\" });\n }\n};\n\nexport const postaldetails = (country, pin) => async (dispatch) => {\n try {\n await getpublic(`/utils/postaldetails?country=${country}&pin=${pin}`).then(\n (res) => {\n if (res.status === 200) {\n dispatch({ type: POSTAL_CODE, data: res.data });\n }\n }\n );\n } catch (error) {\n notification.error({ message: \"Something went wrong , Please try again\" });\n }\n};\n\nexport const supportedlanguages = () => async (dispatch) => {\n try {\n await getpublic(`/utils/supportedlanguages`).then((res) => {\n if (res.status === 200) {\n dispatch({ type: SUPPORTED_LANGUAGES, data: res.data });\n }\n });\n } catch (error) {\n notification.error({ message: \"Something went wrong , Please try again\" });\n }\n};\n\nexport const Register = (data) => async (dispatch) => {\n try {\n await postpublic(\"/tenant\", data, null, \"workbench\").then((res) => {\n if (res.status === 200 || res.status === 201) {\n notification.success({ message: \"User registered successfully\" });\n history.push(\"/login\");\n }\n });\n } catch (error) {\n notification.error({\n message: error?.response?.data?.message ?? \"User registered successfully\",\n });\n dispatch({ type: \"WAITING\", data: false });\n history.push(\"/sign-up\");\n }\n};\nexport const mwfAllowedCheck = () => async (dispatch) => {\n dispatch({\n type: \"MWF_CHECKING\",\n data: true,\n });\n let Store = store.getState();\n let { mfwAllowed } = Store?.dittoAdminReducer;\n if (mfwAllowed === null) {\n dispatch({\n type: \"MWF_ALLOWED\",\n data: false,\n });\n try {\n await get(\"/rollout/mwf-allowed\").then((res) => {\n if (res.status === 200) {\n dispatch({ type: \"MWF_ALLOWED\", data: res.data.data.mfwAllowed });\n }\n });\n } catch (error) {\n notification.error({\n message: \"Something went wrong , Please try again\",\n });\n }\n }\n dispatch({\n type: \"MWF_CHECKING\",\n data: false,\n });\n};\n\nexport const getTenantSettings = () => async (dispatch) => {\n try {\n await get(`/tenant/setting`).then((res) => {\n if (res.status === 200) {\n dispatch({ type: \"TENANT_SETTINGS_DATA\", data: res.data });\n }\n });\n } catch (error) {\n notification.error({ message: \"Something went wrong , Please try again\" });\n }\n};\n","import {\n HISTORICAL_MESSAGE_ACTION_TRIGGER,\n HISTORICAL_MESSAGE_ACTION_RESPONSE,\n HISTORICAL_MESSAGE_ACTION_ERROR,\n SET_TEAM_MESSAGE,\n SET_CHANNEL_MESSAGE,\n GET_THREAD_EMAIL_MESSAGES_TRIGGER,\n GET_THREAD_EMAIL_MESSAGES_RESPONSE,\n GET_THREAD_EMAIL_MESSAGES_ERROR,\n} from \"constant\";\n\nimport { get, post } from \"helper/networkClient\";\n\nconst historicalMessageActionResponse = (data) => ({\n type: HISTORICAL_MESSAGE_ACTION_RESPONSE,\n data: data,\n});\nconst historicalMessageTeamResponse = (data) => ({\n type: SET_TEAM_MESSAGE,\n data: data,\n});\nconst historicalMessageChannelResponse = (data) => ({\n type: SET_CHANNEL_MESSAGE,\n data: data,\n});\n\nconst historicalMessageActionError = (data) => ({\n type: HISTORICAL_MESSAGE_ACTION_ERROR,\n data: data,\n});\n\nexport const historicalMessageActionTrigger = (params) => async (dispatch) => {\n dispatch({ type: HISTORICAL_MESSAGE_ACTION_TRIGGER, data: {} });\n await get(\"/message\", params).then((resp) => {\n if (resp.status === 200) {\n dispatch(historicalMessageActionResponse(resp.data));\n } else {\n dispatch(historicalMessageActionError(resp));\n }\n });\n};\n\nexport const historicalMessageTeamTrigger =\n (start, end, convId) => async (dispatch) => {\n // dispatch({\n // type: HISTORICAL_MESSAGE_ACTION_TRIGGER,\n // data: { start, end },\n // });\n // await get(\"/message\", {\n // convId,\n // }).then((resp) => {\n // if (resp.status === 200) {\n // dispatch(historicalMessageTeamResponse(resp.data));\n // } else {\n // dispatch(historicalMessageActionError(resp));\n // }\n // });\n };\n\nexport const historicalMessageChannelTrigger =\n (start, end, convId) => async (dispatch) => {\n // dispatch({\n // type: HISTORICAL_MESSAGE_ACTION_TRIGGER,\n // data: { start, end },\n // });\n // await get(\"/message\", {\n // start,\n // end,\n // convId,\n // }).then((resp) => {\n // if (resp.status === 200) {\n // dispatch(historicalMessageChannelResponse(resp.data));\n // } else {\n // dispatch(historicalMessageActionError(resp));\n // }\n // });\n };\n\nexport const getThreadMessages = (id) => async (dispatch) => {\n dispatch({\n type: GET_THREAD_EMAIL_MESSAGES_TRIGGER,\n data: {},\n });\n await get(\"/message/threads\", {\n id,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_THREAD_EMAIL_MESSAGES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_THREAD_EMAIL_MESSAGES_ERROR,\n data: resp,\n });\n }\n });\n};\n","import { get, patch, post } from \"helper/networkClient\";\n\nexport const getSidebarNotifications = () => async (dispatch) => {\n try {\n const response = await get(\n \"/notification/dashboard-notification-count\",\n null,\n \"notification\"\n );\n if (response?.status === 200) {\n dispatch({\n type: \"SIDEBAR_NOTIF\",\n data: response?.data?.data,\n });\n }\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getStageMetricsNotifications = () => async (dispatch) => {\n try {\n const response = await get(\n \"/notification/stagemetrics-notification-count\",\n null,\n \"notification\"\n );\n if (response?.status === 200) {\n dispatch({\n type: \"STAGE_METRIC_NOTIF\",\n data: response?.data?.data,\n });\n }\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getConvUnreadNotifications = () => async (dispatch) => {\n try {\n const response = await get(\n \"/notification/conv-unread-count\",\n null,\n \"notification\"\n );\n if (response?.status === 200) {\n dispatch({\n type: \"CONV_UNREAD_NOTIF\",\n data: response?.data?.data,\n });\n }\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const markReadNotification = (data) => async (dispatch) => {\n try {\n const response = await post(\n \"/notification/mark-read\",\n data,\n null,\n \"notification\"\n );\n if (response?.status === 200 && data?.type === \"stage\") {\n dispatch({\n type: \"MARK_READ_NOTIF\",\n data: data,\n });\n } else if (response?.status === 200 && data?.type === \"message\") {\n dispatch({\n type: \"MARK_READ_NOTIF_MESSAGE\",\n data: data,\n });\n }\n } catch (error) {\n console.error(error);\n }\n};\nexport const markReadConversation = (data) => async (dispatch) => {\n try {\n const response = await patch(\"/conversation/mark-read\", data);\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getContactMessagesCount = () => async (dispatch) => {\n try {\n const response = await get(\n \"/notification/contact-message-count\",\n null,\n \"notification\"\n );\n if (response?.status === 200) {\n dispatch({\n type: \"CONTACT_MESSAGE_COUNT_FOR_OPENING_CARD\",\n data: response?.data?.data,\n });\n }\n } catch (error) {\n console.error(error);\n }\n};\n","import { notification } from \"antd\";\nimport {\n GET_OPEN_POSITIONS_TRIGGER,\n GET_OPEN_POSITIONS_RESPONSE,\n GET_OPEN_POSITIONS_ERROR,\n GET_ALL_CANDIDATES_BY_POSITION_TRIGGER,\n GET_ALL_CANDIDATES_BY_POSITION_RESPONSE,\n GET_ALL_CANDIDATES_BY_POSITION_ERROR,\n GET_ALL_COMPANIES_TRIGGER,\n GET_ALL_COMPANIES_RESPONSE,\n GET_ALL_COMPANIES_ERROR,\n GET_CANDIDATE_STAGE_TRIGGER,\n GET_CANDIDATE_STAGE_RESPONSE,\n GET_CANDIDATE_STAGE_ERROR,\n} from \"constant\";\n\nimport { del, get, patch, post, put } from \"helper/networkClient\";\nimport history from \"utils/history\";\n\nexport const getOpenPositionsTrigger =\n (archive = false, after) =>\n async (dispatch) => {\n dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n await get(\n `/openings/paginated?archive=${archive} ${after ? `&after=${after}` : \"\"}`\n ).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_OPEN_POSITIONS_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_OPEN_POSITIONS_ERROR,\n data: resp.data,\n });\n }\n });\n };\nexport const getOpeningByIdTrigger = (id) => async (dispatch) => {\n if (id) {\n dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n await get(`/openings/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_OPEN_POSITIONS_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_OPEN_POSITIONS_ERROR,\n data: resp.data,\n });\n }\n });\n }\n};\n\nexport const getAllCandidatesByPositionTrigger =\n (params, disable = false) =>\n async (dispatch) => {\n !disable &&\n dispatch({ type: GET_ALL_CANDIDATES_BY_POSITION_TRIGGER, data: {} });\n await get(`/candidate`, {\n ...params,\n // limit: 2500,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_ALL_CANDIDATES_BY_POSITION_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_ALL_CANDIDATES_BY_POSITION_ERROR,\n data: resp.data,\n });\n }\n });\n };\n\nexport const createOpenPositionTrigger =\n (data, duplicateId) => async (dispatch) => {\n await post(\n `${duplicateId ? `/openings?openingId=${duplicateId}` : `/openings`}`,\n data\n ).then((resp) => {\n try {\n if (resp.status === 200) {\n dispatch({\n type: \"POSITION_DATA_RESPONSE\",\n data: resp.data,\n });\n dispatch(getOpenPositionsTrigger());\n }\n } catch (error) {\n dispatch({\n type: \"POSITION_DATA_ERROR\",\n data: null,\n });\n }\n });\n };\n\nexport const updateOpenPositionTrigger =\n (id, data, type = \"all\") =>\n async (dispatch) => {\n dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n try {\n await put(`/openings/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"POSITION_DATA_RESPONSE\",\n\n data: resp.data,\n });\n\n if (type === \"all\") {\n dispatch(getOpenPositionsTrigger(false, false));\n } else {\n dispatch(getOpeningByIdTrigger(id));\n }\n } else {\n dispatch({\n type: \"POSITION_DATA_RESPONSE\",\n\n data: null,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"POSITION_DATA_ERROR\",\n\n data: null,\n });\n }\n };\n\nexport const updatePrincipalAction =\n (opId, data, trigger = null) =>\n async (dispatch) => {\n // dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n try {\n await put(`/openings/add-principal/${opId}`, data).then((resp) => {\n if (resp.status === 200) {\n if (trigger === \"trigger\") {\n dispatch(getOpeningByIdTrigger(opId));\n }\n notification.success({\n message: \"Recruiter settings updated successfully\",\n });\n }\n });\n } catch (error) {\n dispatch(getOpeningByIdTrigger(opId));\n }\n };\n\nexport const removePrincipalAction = (opId, data) => async (dispatch) => {\n dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n try {\n await put(`/openings/remove-principal/${opId}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getOpeningByIdTrigger(opId));\n notification.success({\n message: \"Recruiter added successfully\",\n });\n }\n });\n } catch (error) {\n dispatch(getOpeningByIdTrigger(opId));\n }\n};\n\nexport const getCandidateStageTrigger = () => async (dispatch) => {\n dispatch({ type: GET_CANDIDATE_STAGE_TRIGGER, data: {} });\n await get(`/candidate/stage`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_CANDIDATE_STAGE_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_CANDIDATE_STAGE_ERROR,\n data: resp.data,\n });\n }\n });\n};\n\nexport const addCandidateAction =\n (data, openingId, stageId) => async (dispatch) => {\n await post(\"/candidate\", data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(\n getAllCandidatesByPositionTrigger({\n id: openingId,\n stage: stageId,\n })\n );\n // dispatch(GetMatrixByOpeningIds({ id: [openingId] }));\n notification.success({\n message: \"Candidate added successfully\",\n });\n }\n })\n .catch((err) => {\n notification.error({\n message: \"Candidate details update failed\",\n });\n });\n };\n\nexport const updateCandidateDetails =\n (id, data, disable) => async (dispatch) => {\n !disable && dispatch({ type: \"UPDATE_CANDIDATE_DETAILS\", data: {} });\n disable && dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: true });\n await put(`/candidate/${id}`, data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"UPDATE_CANDIDATE_DETAILS_WIDGET\",\n data: { data, id },\n });\n dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: false });\n }\n })\n .catch((err) => {\n dispatch({ type: \"ERROR_UPDATE_CANDIDATE_DETAILS\" });\n dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: false });\n notification.error({\n message: \"Candidate details update failed\",\n });\n });\n };\nexport const updateCandidateDetailsViaInbox =\n (id, data, ActiveOPID, disable) => async (dispatch) => {\n disable && dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: true });\n !disable && dispatch({ type: \"UPDATE_CANDIDATE_DETAILS\", data: {} });\n await put(`/candidate/${id}`, data)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(getContactProfileByOpeningId(id, ActiveOPID));\n dispatch(getOpeningByCandidateId(id));\n // dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: false });\n }\n })\n .catch((err) => {\n dispatch({ type: \"ERROR_UPDATE_CANDIDATE_DETAILS\" });\n dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: false });\n notification.error({\n message: \"Candidate details update failed\",\n });\n });\n };\n\n// workflow/ondemand\n\nexport const addCandidatetoFlow = (data) => async (dispatch) => {\n await post(\"/workflow/target\", data)\n .then((resp) => {\n dispatch({ type: \"CANDIDATE_ADDED_TO_FLOW\" });\n })\n .catch((err) => {\n notification.error({\n message: \"Candidate details update failed\",\n });\n });\n};\nexport const addCandidatetoFlowCheck = (data) => async (dispatch) => {\n await post(\"/workflow/check\", data)\n .then((resp) => {\n dispatch({ type: \"ADD_CANDIDATE_TO_FLOW_CHECK\", data: resp.data });\n })\n .catch((err) => {\n dispatch({ type: \"ERROR_ADD_CANDIDATE_TO_FLOW_CHECK\" });\n notification.error({\n message: \"Something went wrong please try again\",\n });\n });\n};\n\nexport const CandidateImportAction = (data) => async (dispatch) => {\n dispatch({ type: \"CANDIDATE_IMPORTING\" });\n try {\n await post(\"/candidate/import\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"CANDIDATE_IMPORTING_RESPONSE\" });\n notification.success({\n message: `Candidate imported successfully`,\n });\n } else {\n dispatch({ type: \"CANDIDATE_IMPORTING_RESPONSE\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n });\n } catch (error) {\n dispatch({ type: \"CANDIDATE_IMPORTING_RESPONSE\" });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const PatchStageId =\n (candidateID, data, formdata, openingsId, ActiveStage) =>\n async (dispatch) => {\n try {\n await patch(`/candidate/${candidateID}/stage`, {\n ...data,\n ...formdata,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(getOpeningByIdTrigger(openingsId));\n }\n notification.success({\n message: `Stage Updated`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n };\nexport const PatchStageIdInBulk =\n (data, openingsId, ActiveStage) => async (dispatch) => {\n try {\n await patch(`/candidate/stage/bulk`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getOpeningByIdTrigger(openingsId));\n }\n notification.success({\n message: `Stage Updated`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n };\nexport const PatchStageIdFromInbox =\n (candidateID, data, formdata) => async (dispatch) => {\n let payload = {\n contactIds: [candidateID],\n openingId: data.openingId,\n stageId: data.stageId,\n ...formdata,\n };\n try {\n await patch(`/candidate/stage/bulk`, payload).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"UPDATE_CANDIDATE_STAGE_RESPONSE_ACTIVE\",\n data: {\n candidateID,\n ...data,\n },\n });\n }\n notification.success({\n message: `Stage Updated`,\n });\n });\n } catch (error) {\n notification.error({\n message: `The following candidates have not completed the required fields.\n Please review the mandatory fields in the profile widget.`,\n });\n }\n };\n\n// export const GetMatrixByOpeningIds = (data) => async (dispatch) => {\n// try {\n// await post(`/openings/stagemetrics`, data).then((resp) => {\n// if (resp.status === 200) {\n// setTimeout(() => {\n// dispatch({\n// type: \"RESPONSE_MATRIX_BY_OPENING_IDS\",\n// data: resp.data,\n// });\n// }, 1500);\n// dispatch({\n// type: \"RESPONSE_MATRIX_BY_OPENING_IDS\",\n// data: resp.data,\n// });\n// }\n// });\n// } catch (error) {\n// notification.error({\n// message: `Error please try again later`,\n// });\n// }\n// };\n// company actions\nexport const getAllCompaniesTrigger = () => async (dispatch) => {\n dispatch({ type: GET_ALL_COMPANIES_TRIGGER, data: {} });\n await get(\"/company\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_ALL_COMPANIES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_ALL_COMPANIES_ERROR,\n data: resp.data,\n });\n }\n });\n};\nexport const getCompanyByName = (val) => async (dispatch) => {\n dispatch({ type: GET_ALL_COMPANIES_TRIGGER, data: {} });\n await get(`/company/search?name=${val}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_ALL_COMPANIES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({\n type: GET_ALL_COMPANIES_ERROR,\n data: resp.data,\n });\n }\n });\n};\n\nexport const deleteCompanyTrigger = (id) => async (dispatch) => {\n try {\n await del(`/company/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllCompaniesTrigger());\n notification.success({\n message: `Company deleted successfully`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const createCompanyTrigger = (data, from) => async (dispatch) => {\n try {\n await post(\"/company\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllCompaniesTrigger());\n notification.success({\n message: `Company added successfully`,\n });\n if (from !== \"opening\") {\n history.push(\"/admin/company/\");\n }\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const createCompanyTriggerLink = (data) => async (dispatch) => {\n dispatch({ type: \"CREATE_COMPANY_LINKEDIN_TRIGGER\", data: {} });\n try {\n await post(\"/company/linkedin\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllCompaniesTrigger());\n }\n notification.success({\n message: resp.data.data,\n });\n history.push(\"/admin/company/\");\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const updateCompanyTrigger = (id, data) => async (dispatch) => {\n await put(`/company/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getAllCompaniesTrigger());\n notification.success({\n message: `Company updated successfully`,\n });\n }\n });\n};\nexport const getLinkPreview = (data, index) => async (dispatch) => {\n dispatch({ type: \"GET_LINK_PREVIEW\", data: index });\n try {\n await get(`/company/link/preview?url=${data}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_LINK_PREVIEW\",\n data: { index, data: resp?.data?.data },\n });\n } else {\n dispatch({\n type: \"RESPONSE_LINK_PREVIEW\",\n data: { index, data },\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"RESPONSE_LINK_PREVIEW\",\n data: { index, data: null },\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\n// export const getCandidateActivity = (cid, params) => async (dispatch) => {\n// dispatch({ type: \"GET_CANDIDATE_ACTIVITY\", data: {} });\n// try {\n// await get(`/activity/c/${cid}`, params).then((resp) => {\n// if (resp.status === 200) {\n// dispatch({\n// type: \"RESPONSE_CANDIDATE_ACTIVITY\",\n// data: resp?.data?.data,\n// });\n// }\n// });\n// } catch (error) {\n// dispatch({\n// type: \"RESPONSE_CANDIDATE_ACTIVITY\",\n// data: null,\n// });\n// notification.error({\n// message: `Error please try again later`,\n// });\n// }\n// };\n\nexport const getCandidateActivity = (cid, after) => async (dispatch) => {\n dispatch({ type: \"GET_CANDIDATE_ACTIVITY\", data: {} });\n try {\n await post(\n `/activity/log${after ? `?after=${after}` : \"\"}`,\n { contactId: cid },\n null,\n \"notification\"\n ).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_CANDIDATE_ACTIVITY\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"RESPONSE_CANDIDATE_ACTIVITY\",\n data: null,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getCandidateActivityCustom = () => async (dispatch) => {\n dispatch({ type: \"GET_CANDIDATE_CUSTOM_ACTIVITY\", data: {} });\n try {\n await get(`/activity/custom`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_CANDIDATE_CUSTOM_ACTIVITY\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"RESPONSE_CANDIDATE_CUSTOM_ACTIVITY\",\n data: null,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const addCandidateActivityCustom = (data) => async (dispatch) => {\n try {\n await post(`/activity/custom`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateActivityCustom());\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const RecordActivityAction = (data) => async (dispatch) => {\n try {\n await post(`/activity/custom/record`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateActivity(data?.contactId));\n notification.success({\n message: `Activity recorded successfully`,\n });\n dispatch(getCandidateEngagement(data?.contactId));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const removeCandidatesFromOpening = (ids, data) => async (dispatch) => {\n let payload = {\n ...ids,\n };\n if (data.id) {\n payload = {\n ...payload,\n openingId: data.id,\n };\n }\n try {\n await del(`/candidate`, payload).then((resp) => {\n if (resp.status === 200) {\n // dispatch(getAllCandidatesByPositionTrigger(data));\n dispatch(getOpeningByIdTrigger(data.id));\n // dispatch(GetMatrixByOpeningIds({ id: [data.id] }));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const SearchCandidatesByOpenings = (params) => async (dispatch) => {\n dispatch({ type: GET_ALL_CANDIDATES_BY_POSITION_TRIGGER, data: {} });\n try {\n await get(`/candidate/search`, { ...params }).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_ALL_CANDIDATES_BY_POSITION_RESPONSE,\n data: resp.data,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const cloneWorkflow = (data) => async (dispatch) => {\n try {\n await post(`/workflow/clone`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_CLONE_WORKFLOW\",\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const getWorkflowCAbyOpening = (data) => async (dispatch) => {\n try {\n await post(`/workflow/channelaccounts`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_GET_WORKFLOW_CA_BY_OPENING\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const patchWorkflowCAbyOpening = (data) => async (dispatch) => {\n try {\n await patch(`/workflow/channelaccounts`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Channel account updated successfully`,\n });\n dispatch(getWorkflowCAbyOpening({ openingId: data?.openingId }));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const getCandidateEngagement = (id) => async (dispatch) => {\n dispatch({ type: \"GET_CANDIDATE_ENGAGEMENT_TRIGGER\", data: {} });\n try {\n await get(`/candidate/engagement?id=${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_GET_CANDIDATE_ENGAGEMENT\",\n data: resp?.data?.data,\n });\n } else {\n dispatch({\n type: \"RESPONSE_GET_CANDIDATE_ENGAGEMENT\",\n data: null,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"RESPONSE_GET_CANDIDATE_ENGAGEMENT\",\n data: null,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const OpeningSearch = (obj) => async (dispatch) => {\n dispatch({ type: GET_OPEN_POSITIONS_TRIGGER, data: {} });\n await get(`/openings/search`, obj).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_OPEN_POSITIONS_RESPONSE,\n data: resp.data,\n });\n // let ids = resp?.data?.data?.map((item) => item?._id);\n // dispatch(GetMatrixByOpeningIds({ id: ids }));\n let bulk = resp?.data?.data?.map((item) => {\n return {\n openingId: item?._id,\n wfIds: item?.res?.workflowIds,\n };\n });\n if (bulk.length > 0) {\n dispatch(getChannelAccountsfromWorkflow(bulk));\n }\n } else {\n dispatch({\n type: GET_OPEN_POSITIONS_ERROR,\n data: resp.data,\n });\n }\n });\n};\n\nexport const markFavorite =\n (id, data, from, openingsId, ActiveStage) => async (dispatch) => {\n try {\n await put(`/candidate/${id}/favorite`, data).then((resp) => {\n if (resp.status === 200) {\n if (from === \"inbox\") {\n dispatch({\n type: \"UPDATE_CANDIDATE_DETAILS_RESPONSE_ACTIVE\",\n data: resp.data,\n });\n } else {\n dispatch(\n getAllCandidatesByPositionTrigger({\n id: openingsId,\n stage: ActiveStage,\n })\n );\n }\n }\n notification.success({\n message: `Candidate marked as ${\n data.favorite ? \"favorite\" : \"unfavorite\"\n }`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n };\n\nexport const markArchive = (id, archive) => async (dispatch) => {\n try {\n await put(`/openings/${id}/archive`, { archive: archive }).then((resp) => {\n // if (resp.status === 200) {\n // dispatch(getOpenPositionsTrigger(!archive));\n // }\n notification.success({\n message: `Position marked as ${archive ? \"archive\" : \"unarchive\"}`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getSequenceHistory = (id, openingId) => async (dispatch) => {\n dispatch({ type: \"GET_SEQUENCE_HISTORY_TRIGGER\", data: {} });\n try {\n await get(\n `/workflow/contact/sequence?id=${id}&openingId=${openingId}`\n ).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_SEQUENCE_HISTORY_RESPONSE\",\n data: resp?.data?.data,\n });\n } else {\n dispatch({\n type: \"GET_SEQUENCE_HISTORY_RESPONSE\",\n data: null,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"GET_SEQUENCE_HISTORY_RESPONSE\",\n data: null,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const cancelSequence = (data, openingsId) => async (dispatch) => {\n try {\n await patch(`/workflow/contact/sequence/cancel`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getSequenceHistory(data.target, openingsId));\n }\n notification.success({\n message: `Sequence cancelled`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const checkNextStageSequence = (data) => async (dispatch) => {\n dispatch({ type: \"CHECK_NEXT_STAGE_SEQUENCE_TRIGGER\", data: {} });\n try {\n await post(`/workflow/stage/sequence`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"CHECK_NEXT_STAGE_SEQUENCE_RESPONSE\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {}\n};\nexport const getCandidateAttachments = (id) => async (dispatch) => {\n dispatch({ type: \"GET_CANDIDATE_ATTACHMENTS_TRIGGER\", data: {} });\n try {\n await get(`/candidate/attachments/all?id=${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_CANDIDATE_ATTACHMENTS_RESPONSE\",\n data: resp?.data?.data,\n });\n } else {\n dispatch({\n type: \"GET_CANDIDATE_ATTACHMENTS_RESPONSE\",\n data: [],\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"GET_CANDIDATE_ATTACHMENTS_RESPONSE\",\n data: [],\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const getAllContactActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: \"GET_ALL_CONTACT_ACTION_TRIGGER\" });\n await get(\"/contact\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_ALL_CONTACT_ACTION_RESPONSE\",\n data: resp.data,\n });\n dispatch({ type: \"STOP_LOADING_CANDIDATE\" });\n } else {\n dispatch({\n type: \"GET_ALL_CONTACT_ACTION_ERROR\",\n data: resp.data,\n });\n dispatch({ type: \"STOP_LOADING_CANDIDATE\" });\n }\n });\n};\n\nexport const createCommentAction = (data) => async (dispatch) => {\n dispatch({ type: \"ADD_COMMENT_TRIGGER\" });\n try {\n await post(\"/comments\", data).then((resp) => {\n if (resp.status === 200) {\n // TODO candidateId need to be changed to contactId later\n let params = {\n contactId: data?.candidateId,\n openingId: data?.openingId,\n };\n dispatch(getCommentsAction(params, true));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n dispatch({\n type: \"ADD_COMMENT_ERROR\",\n });\n }\n};\n\nexport const getCommentsAction = (params, nloading) => async (dispatch) => {\n !nloading && dispatch({ type: \"GET_COMMENTS_TRIGGER\" });\n try {\n await get(\"/comments\", { ...params }).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_COMMENTS_RESPONSE\",\n data: resp.data,\n });\n } else {\n dispatch({\n type: \"GET_COMMENTS_ERROR\",\n data: resp.data,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"GET_COMMENTS_ERROR\",\n data: null,\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const updateStageSeqAction = (obj) => async (dispatch) => {\n dispatch({ type: GET_CANDIDATE_STAGE_TRIGGER, data: {} });\n try {\n await put(`/candidate/stage/sequence`, obj).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateStageTrigger());\n notification.success({\n message: `Stage Sequence Updated`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const createStageSeqAction = (data) => async (dispatch) => {\n dispatch({ type: GET_CANDIDATE_STAGE_TRIGGER, data: {} });\n try {\n await post(`/candidate/stage/sequence`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateStageTrigger());\n notification.success({\n message: `Stage Created`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const deleteStageSeqAction = (id) => async (dispatch) => {\n dispatch({ type: GET_CANDIDATE_STAGE_TRIGGER, data: {} });\n try {\n await del(`/candidate/stage/sequence/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateStageTrigger());\n notification.success({\n message: `Stage Deleted`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const UpdateIsDefaultStageSeqAction = (id) => async (dispatch) => {\n dispatch({ type: GET_CANDIDATE_STAGE_TRIGGER, data: {} });\n try {\n await put(`/candidate/stage/sequence/default/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateStageTrigger());\n notification.success({\n message: `Default Updated`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const BookInterviewSlot = (data) => async (dispatch) => {\n dispatch({ type: \"INTERVIEW_SLOT_LOADING\", data: true });\n try {\n await post(`/interview/create`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Interview booked successfully`,\n });\n dispatch(getInterViewSlotForCandidate(data?.contactId));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const UpdateInterviewSlot = (id, data) => async (dispatch) => {\n dispatch({ type: \"INTERVIEW_SLOT_LOADING\", data: true });\n try {\n await put(`/interview/slot/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Interview updated successfully`,\n });\n dispatch(getInterViewSlotForCandidate(data?.contactId));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const getInterViewSlotForCandidate = (id) => async (dispatch) => {\n dispatch({ type: \"INTERVIEW_SLOT_LOADING\", data: true });\n try {\n await get(`/interview/slots/candidate/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"INTERVIEW_SLOT_RESPONSE\", data: resp.data.data });\n }\n });\n } catch (error) {}\n};\n\nexport const deleteInterviewSlot = (id, contactId) => async (dispatch) => {\n dispatch({ type: \"INTERVIEW_SLOT_LOADING\", data: true });\n try {\n await del(`/interview/slot/${id}`).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Interview deleted successfully`,\n });\n dispatch(getInterViewSlotForCandidate(contactId));\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const pinJobOpening = (id, isPinned) => async (dispatch) => {\n try {\n await post(`/openings/${id}/isPinned`, { isPinned: isPinned }).then(\n (resp) => {\n if (resp.status === 200) {\n dispatch(getOpenPositionsTrigger());\n }\n notification.success({\n message: `Position ${isPinned ? \"Pinned\" : \"un-pinned\"}`,\n });\n }\n );\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const updateSubmissionSequence = (id, data) => async (dispatch) => {\n try {\n await patch(`/openings/${id}/submission-sequence`, {\n data,\n }).then((resp) => {\n console.log(\"updated submission sequence\");\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\nexport const updateExportSequence = (id, data) => async (dispatch) => {\n try {\n await patch(`/openings/${id}/export-sequence`, {\n data,\n }).then((resp) => {\n console.log(\"updated export sequence\");\n notification.success({\n message: `Sequence format saved`,\n });\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const UpdateIsFirstFollowup =\n (id, isFirstFollowup) => async (dispatch) => {\n try {\n await put(`/candidate/stage/sequence/is-first-follow-up/${id}`, {\n isFirstFollowup,\n }).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `First followup updated`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n };\n\nexport const getChannelAccountsfromWorkflow = (data) => async (dispatch) => {\n // dispatch({\n // type: \"TRIGGER_GET_CHANNEL_ACCOUNTS_BULK\",\n // data: true,\n // });\n // try {\n // await post(`/openings/channel-accounts/bulk`, { data }).then((resp) => {\n // if (resp.status === 200) {\n // dispatch({\n // type: \"RESPONSE_GET_CHANNEL_ACCOUNTS_BULK\",\n // data: resp?.data?.data,\n // });\n // }\n // });\n // } catch (error) {\n // notification.error({\n // message: `Error please try again later`,\n // });\n // }\n};\n\nexport const getWfType = (openingId) => async (dispatch) => {\n dispatch({ type: \"GET_WF_TYPE_TRIGGER\", data: [] });\n try {\n await get(`/workflow/get-wf-type/${openingId}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"RESPONSE_GET_WF_TYPE\",\n data: resp?.data?.data?.wfTypes,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n dispatch({\n type: \"RESPONSE_GET_WF_TYPE\",\n data: [],\n });\n }\n};\n\nexport const shareCandidatesWith = (data) => async (dispatch) => {\n try {\n await post(`/candidate/share`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Candidates shared successfully`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getOpeningByCandidateId = (id) => async (dispatch) => {\n dispatch({ type: \"GET_OPENINGS_FOR_CANDIDATE\", data: {} });\n try {\n await get(`/candidate/${id}/associations`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_OPENINGS_FOR_CANDIDATE_RESPONSE\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {\n dispatch({\n type: \"GET_OPENINGS_FOR_CANDIDATE_RESPONSE_ERROR\",\n data: [],\n });\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const getContactProfileByOpeningId = (cid, opid) => async (dispatch) => {\n try {\n await get(`/candidate/${opid}/profile/${cid}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: \"ERROR_UPDATE_CANDIDATE_DETAILS\" });\n dispatch({ type: \"CANDIDATE_RECORD_UPDATING\", data: false });\n dispatch({\n type: \"SET_ACTIVE_CONTACT_OPENING\",\n data: resp?.data?.data,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n\nexport const transferOwnerShip = (data) => async (dispatch) => {\n try {\n await post(`/candidate/transfer-ownership`, data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Candidate transferred successfully`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error please try again later`,\n });\n }\n};\n","import {\n SEND_MESSAGE_ACTION_TRIGGER,\n LOGOUT_ACTION_TRIGGER,\n SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER,\n} from \"constant\";\n\nexport const messageSocket = (data, user) => async (dispatch) => {\n dispatch({ type: SEND_MESSAGE_ACTION_TRIGGER, data });\n};\nexport const messageSocketAccountLocked = (data, user) => async (dispatch) => {\n dispatch({ type: SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER, data });\n};\n\nexport const disconnectSocket = () => async (dispatch) => {\n dispatch({ type: LOGOUT_ACTION_TRIGGER });\n};\n","import { notification } from \"antd\";\nimport {\n GET_SUBSCRIPTIONS_TRIGGER,\n GET_SUBSCRIPTIONS_RESPONSE,\n GET_SUBSCRIPTIONS_ERROR,\n} from \"constant\";\nimport { get, put } from \"helper/networkClient\";\n\nexport const getSubscriptionsTrigger = () => async (dispatch) => {\n dispatch({ type: GET_SUBSCRIPTIONS_TRIGGER });\n try {\n await get(\"/tenant/plan/id\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_SUBSCRIPTIONS_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_SUBSCRIPTIONS_ERROR });\n }\n });\n } catch (error) {\n dispatch({ type: GET_SUBSCRIPTIONS_ERROR });\n }\n};\n\nexport const updateSubscriptionTrigger = (id) => async (dispatch) => {\n dispatch({ type: GET_SUBSCRIPTIONS_TRIGGER });\n try {\n const response = await get(`/tenant/changeplan?id=${id}`);\n if (response?.data?.data?.url) {\n window.location.href = response?.data?.data?.url;\n } else {\n dispatch(getSubscriptionsTrigger());\n }\n } catch (error) {\n dispatch({ type: GET_SUBSCRIPTIONS_ERROR });\n }\n};\n\nexport const updatePlanDetailsTrigger = (data) => async (dispatch) => {\n dispatch({ type: \"UPDATE_PAGE_DETAILS_TRIGGER\" });\n try {\n const response = await put(`/tenant/pagedetails`, data);\n if (response.status === 200) {\n dispatch({ type: \"UPDATE_PAGE_DETAILS_SUCCESS\" });\n notification.success({\n message: \"Page details updated successfully\",\n });\n }\n } catch (error) {\n dispatch({ type: \"UPDATE_PAGE_DETAILS_ERROR\" });\n }\n};\nexport const getPlanDetailsTrigger = () => async (dispatch) => {\n dispatch({ type: \"GET_PAGE_DETAILS_TRIGGER\" });\n try {\n const response = await get(`/tenant/pagedetails`);\n if (response.status === 200) {\n dispatch({\n type: \"GET_PAGE_DETAILS_SUCCESS\",\n data: response.data.data,\n });\n }\n } catch (error) {\n dispatch({ type: \"GET_PAGE_DETAILS_ERROR\" });\n }\n};\n\nexport const updateAgencySettingsTrigger = (data) => async (dispatch) => {\n try {\n const response = await put(`/tenant/agency-setting`, data);\n if (response.status === 200) {\n notification.success({\n message: \"updated successfully\",\n });\n dispatch(getAgencySettings());\n }\n } catch (error) {\n dispatch({ type: \"UPDATE_ORG_PAGE_SETTINGS_ERROR\" });\n }\n};\n\nexport const getAgencySettings = (nloader) => async (dispatch) => {\n !nloader && dispatch({ type: \"GET_ORG_PAGE_SETTINGS_TRIGGER\" });\n try {\n const response = await get(`/tenant/agency-setting`);\n if (response.status === 200) {\n dispatch({\n type: \"GET_ORG_PAGE_SETTINGS_RESPONSE\",\n data: response.data.data,\n });\n }\n } catch (error) {\n dispatch({ type: \"GET_ORG_PAGE_SETTINGS_ERROR\" });\n }\n};\n","import { notification } from \"antd\";\nimport {\n CREATE_TAG_ACTION_TRIGGER,\n CREATE_TAG_ACTION_RESPONSE,\n CREATE_TAG_ACTION_ERROR,\n SEARCH_TAG_ACTION_TRIGGER,\n SEARCH_TAG_ACTION_RESPONSE,\n SEARCH_TAG_ACTION_ERROR,\n TAG_LIST_TRIGGER,\n TAG_LIST_RESPONSE,\n TAG_LIST_ERROR,\n} from \"constant\";\n\nimport { del, get, post } from \"helper/networkClient\";\n\nexport const createTagActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: CREATE_TAG_ACTION_TRIGGER, data });\n await post(\"/tag\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(createTagActionResponse(resp.data));\n } else {\n dispatch(createTagActionError(resp));\n }\n });\n};\n\nconst createTagActionResponse = (data) => ({\n type: CREATE_TAG_ACTION_RESPONSE,\n data: data,\n});\n\nconst createTagActionError = (data) => ({\n type: CREATE_TAG_ACTION_ERROR,\n data: data,\n});\n\nexport const searchTagActionTrigger = (query, type) => async (dispatch) => {\n dispatch({ type: SEARCH_TAG_ACTION_TRIGGER, data: query });\n await get(\"/tag/search\", {\n text: query,\n ...type,\n }).then((resp) => {\n if (resp.status === 200) {\n dispatch(searchTagActionResponse(resp.data));\n } else {\n dispatch(searchTagActionError(resp));\n }\n });\n};\n\nconst searchTagActionResponse = (data) => ({\n type: SEARCH_TAG_ACTION_RESPONSE,\n data: data,\n});\n\nconst searchTagActionError = (data) => ({\n type: SEARCH_TAG_ACTION_ERROR,\n data: data,\n});\n\nexport const getTag = (data) => async (dispatch) => {\n await get(\"/tag\", data).then((resp) => {\n dispatch({ type: TAG_LIST_TRIGGER });\n if (resp.status === 200) {\n dispatch({ type: TAG_LIST_RESPONSE, data: resp.data });\n } else {\n dispatch({ type: TAG_LIST_ERROR });\n }\n });\n};\n\nexport const deleteTag = (id) => async (dispatch) => {\n await del(`/tag/${id}`).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: \"Tag deleted successfully\",\n });\n }\n });\n};\n","import {\n GET_TEMPLATES_ACTION_TRIGGER,\n GET_TEMPLATES_ACTION_RESPONSE,\n GET_TEMPLATES_ACTION_ERROR,\n CREATE_TEMPLATES_ACTION_TRIGGER,\n CREATE_TEMPLATES_ACTION_RESPONSE,\n CREATE_TEMPLATES_ACTION_ERROR,\n EMAIL_TEMPLATES_ACTION_RESPONSE,\n EMAIL_TEMPLATES_ACTION_ERROR,\n GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE,\n GET_EMAIL_TEMPLATES_VARIABLES_ERROR,\n TEMPLATE_DETAILS_BY_ID_RESPONSE,\n TEMPLATE_DETAILS_BY_ID_ERROR,\n GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE,\n GET_EMAIL_PLATEFORM_TEMPLATES_ERROR,\n GET_WHATSAPP_TEMPLATES_TRIGGER,\n GET_WHATSAPP_TEMPLATES_RESPONSE,\n GET_WHATSAPP_TEMPLATES_ERROR,\n PUT_WHATSAPP_TEMPLATE_RESPONSE,\n PUT_WHATSAPP_TEMPLATE_ERROR,\n PUT_WHATSAPP_TEMPLATE_TRIGGER,\n GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER,\n GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE,\n GET_WHATSAPP_TEMPLATE_BY_ID_ERROR,\n IMPORT_TEMPLATE_RESPONSE,\n GET_TEMPLATE_VARIABLES_RESPONSE,\n GET_TEMPLATE_VARIABLES_ERROR,\n GET_ACCOUNT_VARIABLES_RESPONSE,\n GET_ACCOUNT_VARIABLES_ERROR,\n} from \"constant\";\n\nimport { notification } from \"antd\";\n\nimport { del, get, post, put } from \"helper/networkClient\";\nimport history from \"utils/history\";\n\nexport const createTemplateActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: CREATE_TEMPLATES_ACTION_TRIGGER, data });\n try {\n await post(\"/template\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(createTemplateActionResponse(resp.data));\n notification.success({\n message: `Template created successfully`,\n });\n } else {\n dispatch(createTemplateActionError(resp));\n }\n });\n } catch (error) {\n dispatch(createTemplateActionError(error));\n }\n};\n\nconst createTemplateActionResponse = (data) => ({\n type: CREATE_TEMPLATES_ACTION_RESPONSE,\n data: data,\n});\n\nconst createTemplateActionError = (data) => ({\n type: CREATE_TEMPLATES_ACTION_ERROR,\n});\n\nexport const getTemplatesActionTrigger = (params) => async (dispatch) => {\n dispatch({ type: GET_TEMPLATES_ACTION_TRIGGER, data: params });\n await get(\"/template\", params).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionResponse(resp.data));\n } else {\n dispatch(getTemplatesActionError(resp));\n }\n });\n};\n\nexport const searchTemplatesActionTrigger = (params) => async (dispatch) => {\n dispatch({ type: GET_TEMPLATES_ACTION_TRIGGER, data: params });\n await get(\"/template/search\", params).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionResponse(resp.data));\n } else {\n dispatch(getTemplatesActionError(resp));\n }\n });\n};\n\nconst getTemplatesActionResponse = (data) => ({\n type: GET_TEMPLATES_ACTION_RESPONSE,\n data: data,\n});\n\nconst getTemplatesActionError = (data) => ({\n type: GET_TEMPLATES_ACTION_ERROR,\n data: data,\n});\n\nexport const getEmailTemplatesTrigger = () => async (dispatch) => {\n dispatch({ type: GET_TEMPLATES_ACTION_TRIGGER });\n await get(\"/emailtemplate/templates/all\").then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: EMAIL_TEMPLATES_ACTION_RESPONSE, data: resp.data });\n } else {\n dispatch({ type: EMAIL_TEMPLATES_ACTION_ERROR });\n }\n });\n};\n\nexport const getEmailTemplateVariables = () => async (dispatch) => {\n await get(\"/emailtemplate/variables/all\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_EMAIL_TEMPLATES_VARIABLES_ERROR });\n }\n });\n};\n\nexport const deleteEmailTemplate = (id) => async (dispatch) => {\n await del(`/emailtemplate/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getEmailTemplatesTrigger());\n notification.success({\n message: `Template deleted successfully`,\n });\n }\n });\n};\n\nexport const getTemplateDetailsById = (id) => async (dispatch) => {\n dispatch({ type: GET_TEMPLATES_ACTION_TRIGGER });\n try {\n await get(`/emailtemplate/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: TEMPLATE_DETAILS_BY_ID_RESPONSE, data: resp.data });\n }\n });\n } catch (error) {\n dispatch({ type: TEMPLATE_DETAILS_BY_ID_ERROR });\n }\n};\n\nexport const createEmailTemplate = (data) => async (dispatch) => {\n await post(\"/emailtemplate\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getEmailTemplatesTrigger());\n notification.success({\n message: `Template created successfully`,\n });\n history.push(\"/admin/knowledge-base/email-template\");\n }\n });\n};\n\n// export const getPlatformEmailTemplates = () => async (dispatch) => {\n// dispatch({ type: GET_TEMPLATES_ACTION_TRIGGER });\n// await get(\"/emailtemplate/platform/template/all\").then((resp) => {\n// if (resp.status === 200) {\n// dispatch({\n// type: GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE,\n// data: resp.data,\n// });\n// } else {\n// dispatch({ type: GET_EMAIL_PLATEFORM_TEMPLATES_ERROR });\n// }\n// });\n// };\n// export const getPlatformEmailTemplateById = (id) => async (dispatch) => {\n// await get(`/emailtemplate/platform/template/${id}`).then((resp) => {\n// if (resp.status === 200) {\n// dispatch({\n// type: TEMPLATE_DETAILS_BY_ID_RESPONSE,\n// data: resp.data,\n// });\n// } else {\n// dispatch({ type: TEMPLATE_DETAILS_BY_ID_ERROR });\n// }\n// });\n// };\nexport const UpdateEmailTemplate = (id, data) => async (dispatch) => {\n await put(`/emailtemplate/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getEmailTemplatesTrigger());\n notification.success({\n message: `Template updated successfully`,\n });\n history.push(\"/admin/knowledge-base/email-template\");\n }\n });\n};\nexport const publishEmailTemplate = (id, data) => async (dispatch) => {\n await put(`/emailtemplate/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getEmailTemplatesTrigger());\n notification.success({\n message: `Template published successfully`,\n });\n }\n });\n};\n\nexport const getImportedTemplates = (id) => async (dispatch) => {\n dispatch({ type: GET_WHATSAPP_TEMPLATES_TRIGGER });\n await get(\"/template/whatsapp\", id).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: GET_WHATSAPP_TEMPLATES_RESPONSE, data: resp.data.data });\n } else {\n dispatch({ type: GET_WHATSAPP_TEMPLATES_ERROR });\n }\n });\n};\nexport const importApprovedTemplatesByData = (id, data) => async (dispatch) => {\n try {\n await post(`/template/import?id=${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionTrigger());\n dispatch({ type: IMPORT_TEMPLATE_RESPONSE, data: resp.data });\n notification.success({\n message: `Template imported successfully`,\n });\n } else {\n notification.success({\n message: `Something went wrong`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Template imported Failed, Please try again`,\n });\n }\n};\nexport const syncTemplatesFromMeta = (id) => async (dispatch) => {\n await put(`/template/import/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionTrigger());\n notification.success({\n message: `Template imported successfully`,\n });\n }\n });\n};\nexport const deleteWhatsAppTemplate = (id) => async (dispatch) => {\n await del(`/template/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionTrigger());\n notification.success({\n message: `Template deleted successfully`,\n });\n }\n });\n};\nexport const updateWhatsAppTemplate = (data) => async (dispatch) => {\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_TRIGGER });\n try {\n await put(`/template`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionTrigger());\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_RESPONSE });\n notification.success({\n message: `Template updated successfully`,\n });\n } else {\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_ERROR });\n }\n });\n } catch (error) {\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_ERROR });\n }\n};\n\nexport const updateWaIntentAction = (data) => async (dispatch) => {\n try {\n await put(`/template/intent`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getTemplatesActionTrigger());\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_RESPONSE });\n notification.success({\n message: `Template intent updated successfully`,\n });\n } else {\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_ERROR });\n }\n });\n } catch (error) {\n dispatch({ type: PUT_WHATSAPP_TEMPLATE_ERROR });\n }\n};\nexport const getWhatsAppTemplateByID = (param) => async (dispatch) => {\n dispatch({ type: GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER });\n try {\n await get(`/template`, param).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_WHATSAPP_TEMPLATE_BY_ID_ERROR });\n }\n });\n } catch (error) {\n dispatch({ type: GET_WHATSAPP_TEMPLATE_BY_ID_ERROR });\n }\n};\n\nexport const getTemplateVariables = () => async (dispatch) => {\n dispatch({ type: \"GET_VARIABLES_TRIGGER\" });\n await get(\"/variables\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_TEMPLATE_VARIABLES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_TEMPLATE_VARIABLES_ERROR });\n }\n });\n};\n\nexport const getAccountVariables = () => async (dispatch) => {\n await get(\"/variables\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: GET_ACCOUNT_VARIABLES_RESPONSE,\n data: resp.data,\n });\n } else {\n dispatch({ type: GET_ACCOUNT_VARIABLES_ERROR });\n }\n });\n};\n\n// --------------------------- SMS Template ------------------------------------------------\nexport const getSmsTemplates = () => async (dispatch) => {\n dispatch({ type: \"GET_SMS_TEMPLATES_TRIGGER\" });\n await get(\"/sms-template/all\").then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_SMS_TEMPLATES_RESPONSE\",\n data: resp.data,\n });\n } else {\n dispatch({\n type: \"GET_SMS_TEMPLATES_ERROR\",\n data: resp,\n });\n }\n });\n};\nexport const getSmsTemplateById = (id) => async (dispatch) => {\n dispatch({ type: \"GET_SMS_TEMPLATES_TRIGGER\" });\n await get(`/sms-template/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch({\n type: \"GET_SMS_TEMPLATES_RESPONSE\",\n data: resp.data,\n });\n } else {\n dispatch({\n type: \"GET_SMS_TEMPLATES_ERROR\",\n data: resp,\n });\n }\n });\n};\nexport const createSmsTemplate = (data) => async (dispatch) => {\n dispatch({ type: \"GET_SMS_TEMPLATES_TRIGGER\" });\n await post(\"/sms-template\", data).then((resp) => {\n if (resp.status === 200) {\n notification.success({\n message: `Template created successfully`,\n });\n dispatch(getSmsTemplates());\n history.push(\"/admin/knowledge-base/sms-template\");\n } else {\n dispatch(getSmsTemplates());\n }\n });\n};\nexport const updateSmsTemplate = (id, data) => async (dispatch) => {\n dispatch({ type: \"GET_SMS_TEMPLATES_TRIGGER\" });\n await put(`/sms-template/${id}`, data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getSmsTemplates());\n notification.success({\n message: `Template updated successfully`,\n });\n } else {\n dispatch(getSmsTemplates());\n }\n });\n};\nexport const deleteSmsTemplate = (id) => async (dispatch) => {\n dispatch({ type: \"GET_SMS_TEMPLATES_TRIGGER\" });\n await del(`/sms-template/${id}`).then((resp) => {\n if (resp.status === 200) {\n dispatch(getSmsTemplates());\n notification.success({\n message: `Template deleted successfully`,\n });\n } else {\n dispatch(getSmsTemplates());\n }\n });\n};\n","import {\n GET_USER_DETAILS,\n GET_USER_DETAILS_ERROR,\n GET_USER_DETAILS_SUCCESS,\n} from \"constant\";\nimport { notification } from \"antd\";\nimport { del, get, put, patch } from \"helper/networkClient\";\nimport { GetUserTanent } from \"action/AdminActions\";\n\nexport const getUserDetails = () => {\n return (dispatch) => {\n dispatch({ type: GET_USER_DETAILS });\n get(\"/user\", null, \"workbench\")\n .then((response) => {\n dispatch({ type: GET_USER_DETAILS_SUCCESS, data: response.data });\n })\n .catch((error) => {\n dispatch({ type: GET_USER_DETAILS_ERROR, data: error });\n });\n };\n};\n\nexport const updateUserDetails = (data) => {\n return (dispatch) => {\n dispatch({ type: GET_USER_DETAILS });\n put(\"/user\", data)\n .then((response) => {\n notification.success({\n message: \"Profile update Successfully\",\n });\n })\n .catch((error) => {\n notification.error({\n message: \"Error\",\n });\n });\n };\n};\n\nexport const changePassword = (data) => {\n return (dispatch) => {\n dispatch({ type: GET_USER_DETAILS });\n patch(\"/user/pwd\", data, null, \"workbench\")\n .then((response) => {\n notification.success({\n message: \"Password Changed Successfully\",\n });\n })\n .catch((error) => {\n notification.error({\n message: \"Error\",\n });\n });\n };\n};\nexport const deleteUser = (id) => {\n return (dispatch) => {\n dispatch({ type: GET_USER_DETAILS });\n del(`/user/${id}`)\n .then((response) => {\n dispatch(GetUserTanent());\n notification.success({\n message: \"User Deleted Successfully\",\n });\n })\n .catch((error) => {\n notification.error({\n message: \"Error\",\n });\n });\n };\n};\n","import { notification } from \"antd\";\nimport {\n GET_ALL_CONVERSATION,\n CREATE_CONVERSATION,\n CREATE_CONV_NODE,\n LINK_CONV_NODE,\n GET_ALL_CONVERSATION_BY_IDS,\n GET_ALL_BOTS,\n SET_LOGOURL,\n SET_LAUNCHERURL,\n SET_WIDGET_COLOR,\n SET_WIDGET_ENABLED,\n WB_DESIGN_JSON,\n DEPLOY_URL,\n DATA_LOAD,\n ADD_NODE,\n BOT_SKELETON,\n LANGUAGE_SET,\n SET_WIDGET_DRAWER,\n UPDATE_SELECTED_NODE,\n CONDITIONS_VAR_SET,\n JUMP_LOCATIONS_SET,\n WB_BASE_URL,\n WB_ALL_API,\n WB_WEBHOOK_BY_ID,\n WB_SOPIFI_CAT,\n WB_SOPIFI_ITEM,\n WB_SOPIFI_VAR,\n CONFIG_CHANNELS,\n} from \"constant\";\nimport { get, post, put, del, patch } from \"helper/networkClient\";\nimport history from \"utils/history\";\n\nconst getAllConversationsByIds = (data) => ({\n type: GET_ALL_CONVERSATION_BY_IDS,\n data: data,\n});\n\nconst GetAllBots = (data) => ({\n type: GET_ALL_BOTS,\n data: data,\n});\nexport const uploadlogo = (data) => ({\n type: SET_LOGOURL,\n data: data,\n});\nexport const uploadlauncher = (data) => ({\n type: SET_LAUNCHERURL,\n data: data,\n});\n\nexport const getAllConvertionAPI = (botId) => async (dispatch) => {\n try {\n await get(`/conv/${botId}/nodes`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getAllConversationsByIds(resp.data));\n dispatch({ type: DATA_LOAD, data: false });\n dispatch({ type: ADD_NODE, data: false });\n }\n });\n } catch (error) {}\n};\n\nexport const createNodeAPI = (payload, ActiveBot) => async (dispatch) => {\n dispatch({ type: ADD_NODE, data: true });\n try {\n await post(`/conv/${ActiveBot}/node`, payload, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n notification.success({\n message: ` Node created!`,\n });\n let botId = localStorage.getItem(\"botId\");\n dispatch(getAllConvertionAPI(botId));\n dispatch({ type: ADD_NODE, data: false });\n }\n }\n );\n } catch (error) {\n dispatch({ type: ADD_NODE, data: false });\n }\n};\n\nexport const linkNodeAPI = (payload) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await put(`/conv/${botId}/nodelink`, payload, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n //TODO Replace localstorage with prop / url param\n let botId = localStorage.getItem(\"botId\");\n dispatch(getAllConvertionAPI(botId));\n }\n }\n );\n } catch (error) {}\n};\n\nexport const deleteNodeLinkAPI = (data) => async (dispatch) => {\n try {\n let botId = localStorage.getItem(\"botId\");\n await del(`/conv/${botId}/nodelink`, data, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getAllConvertionAPI(botId));\n }\n }\n );\n } catch (error) {}\n};\n\nexport const deleteNodeAPI = (id) => async (dispatch) => {\n try {\n let botId = localStorage.getItem(\"botId\");\n await del(`/conv/${botId}/node/${id}`, null, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n notification.success({\n message: ` Node deleted!`,\n });\n dispatch(getAllConvertionAPI(botId));\n }\n }\n );\n } catch (error) {}\n};\n\nexport const getAllbots = () => async (dispatch) => {\n try {\n await get(`/ditto/all`, null, \"workbench\").then((resp) => {\n (resp.status === 200 || resp.status === 201) &&\n dispatch(GetAllBots(resp.data));\n dispatch({ type: ADD_NODE, data: false });\n dispatch({ type: BOT_SKELETON, data: false });\n });\n } catch (error) {\n dispatch({ type: BOT_SKELETON, data: false });\n }\n};\n\nexport const redirectWorkbench = () => async (dispatch) => {\n try {\n await get(`/ditto/all`, null, \"workbench\").then((resp) => {\n (resp.status === 200 || resp.status === 201) &&\n dispatch(GetAllBots(resp.data));\n dispatch({ type: ADD_NODE, data: false });\n dispatch({ type: BOT_SKELETON, data: false });\n history.push(\n `/admin/bot-workbench/botList/${\n resp.data[resp?.data?.length - 1].id\n }/Configure`\n );\n });\n } catch (error) {\n dispatch({ type: BOT_SKELETON, data: false });\n }\n};\n\nexport const createBotAction = (payload) => async (dispatch) => {\n try {\n await post(`/ditto`, payload, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(redirectWorkbench());\n }\n });\n } catch (error) {}\n};\n\nexport const deleteBotAction = (id) => async (dispatch) => {\n try {\n await del(`/ditto/${id}`, null, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getAllbots());\n }\n });\n } catch (error) {}\n};\n\nexport const deleteConvNode = (id) => async (dispatch) => {\n dispatch({ type: ADD_NODE, data: true });\n let botId = localStorage.getItem(\"botId\");\n try {\n await del(`/conv/${botId}/node/${id}`, null, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getAllConvertionAPI(botId));\n }\n }\n );\n } catch (error) {\n dispatch({ type: ADD_NODE, data: false });\n }\n};\n\nexport const updateConvNode = (val) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await put(`/conv/${botId}/node`, val, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: SET_WIDGET_DRAWER, data: false });\n notification.success({\n message: `Updated`,\n });\n dispatch(getAllConvertionAPI(botId));\n }\n });\n } catch (error) {}\n};\n\nexport const updateConvNodePos = (val) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await patch(`/conv/${botId}/node`, val, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n }\n });\n } catch (error) {}\n};\n\nexport const updateNodeSettings = (val) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await patch(`/conv/${botId}/node`, val, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getAllConvertionAPI(botId));\n dispatch(JumpLocationsList());\n }\n });\n } catch (error) {}\n};\n\nexport const GetBotDesign = (id) => async (dispatch) => {\n try {\n await get(`/ditto/${id}/design`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: WB_DESIGN_JSON, data: resp.data });\n }\n });\n } catch (error) {}\n};\n\nexport const SaveBotDesign = (payload) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await post(`/ditto/${botId}/design`, payload, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(GetBotDesign(botId));\n notification.success({\n message: `Saved`,\n });\n }\n }\n );\n } catch (error) {}\n};\n\nexport const GetdeployUrl = (id) => async (dispatch) => {\n try {\n await get(`/ditto/${id}/deploy`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: DEPLOY_URL, data: resp.data });\n }\n });\n } catch (error) {}\n};\nexport const PreviewWidget = (id) => async (dispatch) => {\n try {\n await get(`/ditto/${id}/deploy`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n window.open(`https://yoda.zipnip.io/${resp.data.botId}`, \"_blank\");\n }\n });\n } catch (error) {}\n};\n\nexport const publishAction = () => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await post(`/conv/${botId}/publish`, null, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n notification.success({\n message: `Published`,\n });\n }\n }\n );\n } catch (error) {\n notification.error({\n message: `Failed`,\n });\n }\n};\n\nexport const GetLanguageSettings =\n (id, node = null) =>\n async (dispatch) => {\n try {\n await get(`/ditto/${id}/languages`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: LANGUAGE_SET, data: resp.data });\n if (node) {\n dispatch(getLanguageData(node));\n }\n }\n });\n } catch (error) {}\n };\n\nexport const addLanguageSet =\n (data, node = null) =>\n async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await post(`/conv/${botId}/language`, data, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(GetLanguageSettings(botId, node));\n }\n }\n );\n } catch (error) {}\n };\n\nexport const deleteLanguageSet = (data) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await del(`/conv/${botId}/language`, data, null, \"workbench\").then(\n (resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(GetLanguageSettings(botId));\n }\n }\n );\n } catch (error) {\n dispatch({ type: ADD_NODE, data: false });\n }\n};\n\nexport const getLanguageData = (id) => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await get(`/conv/${botId}/node/${id}`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: UPDATE_SELECTED_NODE,\n data: resp.data.convNodeContent,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const conditionalVar = () => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await get(`/conv/${botId}/contextvars`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: CONDITIONS_VAR_SET,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const JumpLocationsList = () => async (dispatch) => {\n let botId = localStorage.getItem(\"botId\");\n try {\n await get(`/conv/${botId}/jlos`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: JUMP_LOCATIONS_SET,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const WBCreateBaseURl = (data) => async (dispatch) => {\n try {\n await post(`/api/baseurl`, data, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBBaseUrl());\n }\n });\n } catch (error) {}\n};\nexport const WBdeleteBaseURl = (id) => async (dispatch) => {\n try {\n await del(`/api/baseurl/${id}`, null, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBBaseUrl());\n }\n });\n } catch (error) {}\n};\nexport const WBupdateBaseURl = (payload) => async (dispatch) => {\n try {\n await put(`/api/baseurl`, payload, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBBaseUrl());\n }\n });\n } catch (error) {\n notification.error({\n message: `Error`,\n });\n }\n};\nexport const WBBaseUrl = () => async (dispatch) => {\n try {\n await get(`/api/baseurl/all`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_BASE_URL,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\nexport const WBCreateWebHook = (data) => async (dispatch) => {\n try {\n await post(`/api`, data, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBgetWebHook());\n notification.success({\n message: `Webhook created`,\n });\n }\n });\n } catch (error) {\n notification.error({\n message: `Error`,\n });\n }\n};\nexport const WBgetWebHook = () => async (dispatch) => {\n try {\n await get(`/api/all`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_ALL_API,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\nexport const WBgetWebHookbyID = (id) => async (dispatch) => {\n try {\n await get(`/api/${id}`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_WEBHOOK_BY_ID,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\nexport const WBdeleteWebHook = (id) => async (dispatch) => {\n try {\n await del(`/api/${id}`, null, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBgetWebHook());\n notification.success({\n message: `Webhook deleted`,\n });\n }\n });\n } catch (error) {}\n};\nexport const WBupdateWebHook = (id, payload) => async (dispatch) => {\n try {\n await put(`/api/${id}`, payload, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(WBgetWebHook());\n notification.success({\n message: `Webhook updated`,\n });\n }\n });\n } catch (error) {}\n};\n// shopify\nexport const WBgetSopifiCat = () => async (dispatch) => {\n try {\n await get(`/shopify/collections`, null, null).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_SOPIFI_CAT,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const WBgetSopifiItem = (id) => async (dispatch) => {\n try {\n await get(`/shopify/products/${id}`, null, null).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_SOPIFI_ITEM,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\nexport const WBgetSopifiVar = (id) => async (dispatch) => {\n try {\n await get(`/shopify/variant/${id}`, null, null).then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({\n type: WB_SOPIFI_VAR,\n data: resp.data,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const getBotDetailsById = (id) => async (dispatch) => {\n try {\n await get(`/ditto/${id}`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: CONFIG_CHANNELS, data: resp.data });\n }\n });\n } catch (error) {}\n};\n\nexport const patchDittoConfig = (data) => async (dispatch) => {\n try {\n await patch(`/ditto`, data, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch(getBotDetailsById(data.id));\n notification.success({\n message: `Config updated`,\n });\n }\n });\n } catch (error) {}\n};\n\nexport const getAccountintents = () => async (dispatch) => {\n try {\n await get(`/ie/intents`, null, \"workbench\").then((resp) => {\n if (resp.status === 200 || resp.status === 201) {\n dispatch({ type: \"ACCOUNT_INTENTS\", data: resp.data });\n }\n });\n } catch (error) {}\n};\n","import React from \"react\";\nimport { Avatar } from \"antd\";\n\nexport const CXAvatar = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXAvatarGroup = ({ children, ...props }) => {\n return {children};\n};\n","import { PresetColorTypes } from '../_util/colors';\n// eslint-disable-next-line import/prefer-default-export\nexport function isPresetColor(color) {\n return PresetColorTypes.includes(color);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { isPresetColor } from './utils';\nvar Ribbon = function Ribbon(_ref) {\n var className = _ref.className,\n customizePrefixCls = _ref.prefixCls,\n style = _ref.style,\n color = _ref.color,\n children = _ref.children,\n text = _ref.text,\n _ref$placement = _ref.placement,\n placement = _ref$placement === void 0 ? 'end' : _ref$placement;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n var colorInPreset = isPresetColor(color);\n var ribbonCls = classNames(prefixCls, \"\".concat(prefixCls, \"-placement-\").concat(placement), _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-color-\").concat(color), colorInPreset), className);\n var colorStyle = {};\n var cornerColorStyle = {};\n if (color && !colorInPreset) {\n colorStyle.background = color;\n cornerColorStyle.color = color;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-wrapper\")\n }, children, /*#__PURE__*/React.createElement(\"div\", {\n className: ribbonCls,\n style: _extends(_extends({}, colorStyle), style)\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-text\")\n }, text), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-corner\"),\n style: cornerColorStyle\n })));\n};\nexport default Ribbon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nfunction UnitNumber(_ref) {\n var prefixCls = _ref.prefixCls,\n value = _ref.value,\n current = _ref.current,\n _ref$offset = _ref.offset,\n offset = _ref$offset === void 0 ? 0 : _ref$offset;\n var style;\n if (offset) {\n style = {\n position: 'absolute',\n top: \"\".concat(offset, \"00%\"),\n left: 0\n };\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n style: style,\n className: classNames(\"\".concat(prefixCls, \"-only-unit\"), {\n current: current\n })\n }, value);\n}\nfunction getOffset(start, end, unit) {\n var index = start;\n var offset = 0;\n while ((index + 10) % 10 !== end) {\n index += unit;\n offset += unit;\n }\n return offset;\n}\nexport default function SingleNumber(props) {\n var prefixCls = props.prefixCls,\n originCount = props.count,\n originValue = props.value;\n var value = Number(originValue);\n var count = Math.abs(originCount);\n var _React$useState = React.useState(value),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n prevValue = _React$useState2[0],\n setPrevValue = _React$useState2[1];\n var _React$useState3 = React.useState(count),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n prevCount = _React$useState4[0],\n setPrevCount = _React$useState4[1];\n // ============================= Events =============================\n var onTransitionEnd = function onTransitionEnd() {\n setPrevValue(value);\n setPrevCount(count);\n };\n // Fallback if transition event not support\n React.useEffect(function () {\n var timeout = setTimeout(function () {\n onTransitionEnd();\n }, 1000);\n return function () {\n clearTimeout(timeout);\n };\n }, [value]);\n // ============================= Render =============================\n // Render unit list\n var unitNodes;\n var offsetStyle;\n if (prevValue === value || Number.isNaN(value) || Number.isNaN(prevValue)) {\n // Nothing to change\n unitNodes = [/*#__PURE__*/React.createElement(UnitNumber, _extends({}, props, {\n key: value,\n current: true\n }))];\n offsetStyle = {\n transition: 'none'\n };\n } else {\n unitNodes = [];\n // Fill basic number units\n var end = value + 10;\n var unitNumberList = [];\n for (var index = value; index <= end; index += 1) {\n unitNumberList.push(index);\n }\n // Fill with number unit nodes\n var prevIndex = unitNumberList.findIndex(function (n) {\n return n % 10 === prevValue;\n });\n unitNodes = unitNumberList.map(function (n, index) {\n var singleUnit = n % 10;\n return /*#__PURE__*/React.createElement(UnitNumber, _extends({}, props, {\n key: n,\n value: singleUnit,\n offset: index - prevIndex,\n current: index === prevIndex\n }));\n });\n // Calculate container offset value\n var unit = prevCount < count ? 1 : -1;\n offsetStyle = {\n transform: \"translateY(\".concat(-getOffset(prevValue, value, unit), \"00%)\")\n };\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-only\"),\n style: offsetStyle,\n onTransitionEnd: onTransitionEnd\n }, unitNodes);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nimport SingleNumber from './SingleNumber';\nvar ScrollNumber = function ScrollNumber(_a) {\n var customizePrefixCls = _a.prefixCls,\n count = _a.count,\n className = _a.className,\n motionClassName = _a.motionClassName,\n style = _a.style,\n title = _a.title,\n show = _a.show,\n _a$component = _a.component,\n component = _a$component === void 0 ? 'sup' : _a$component,\n children = _a.children,\n restProps = __rest(_a, [\"prefixCls\", \"count\", \"className\", \"motionClassName\", \"style\", \"title\", \"show\", \"component\", \"children\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('scroll-number', customizePrefixCls);\n // ============================ Render ============================\n var newProps = _extends(_extends({}, restProps), {\n 'data-show': show,\n style: style,\n className: classNames(prefixCls, className, motionClassName),\n title: title\n });\n // Only integer need motion\n var numberNodes = count;\n if (count && Number(count) % 1 === 0) {\n var numberList = String(count).split('');\n numberNodes = numberList.map(function (num, i) {\n return /*#__PURE__*/React.createElement(SingleNumber, {\n prefixCls: prefixCls,\n count: Number(count),\n value: num,\n // eslint-disable-next-line react/no-array-index-key\n key: numberList.length - i\n });\n });\n }\n // allow specify the border\n // mock border-color by box-shadow for compatible with old usage:\n // \n if (style && style.borderColor) {\n newProps.style = _extends(_extends({}, style), {\n boxShadow: \"0 0 0 1px \".concat(style.borderColor, \" inset\")\n });\n }\n if (children) {\n return cloneElement(children, function (oriProps) {\n return {\n className: classNames(\"\".concat(prefixCls, \"-custom-component\"), oriProps === null || oriProps === void 0 ? void 0 : oriProps.className, motionClassName)\n };\n });\n }\n return /*#__PURE__*/React.createElement(component, newProps, numberNodes);\n};\nexport default ScrollNumber;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport * as React from 'react';\nimport { useMemo, useRef } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nimport Ribbon from './Ribbon';\nimport ScrollNumber from './ScrollNumber';\nimport { isPresetColor } from './utils';\nvar Badge = function Badge(_a) {\n var customizePrefixCls = _a.prefixCls,\n customizeScrollNumberPrefixCls = _a.scrollNumberPrefixCls,\n children = _a.children,\n status = _a.status,\n text = _a.text,\n color = _a.color,\n _a$count = _a.count,\n count = _a$count === void 0 ? null : _a$count,\n _a$overflowCount = _a.overflowCount,\n overflowCount = _a$overflowCount === void 0 ? 99 : _a$overflowCount,\n _a$dot = _a.dot,\n dot = _a$dot === void 0 ? false : _a$dot,\n _a$size = _a.size,\n size = _a$size === void 0 ? 'default' : _a$size,\n title = _a.title,\n offset = _a.offset,\n style = _a.style,\n className = _a.className,\n _a$showZero = _a.showZero,\n showZero = _a$showZero === void 0 ? false : _a$showZero,\n restProps = __rest(_a, [\"prefixCls\", \"scrollNumberPrefixCls\", \"children\", \"status\", \"text\", \"color\", \"count\", \"overflowCount\", \"dot\", \"size\", \"title\", \"offset\", \"style\", \"className\", \"showZero\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('badge', customizePrefixCls);\n // ================================ Misc ================================\n var numberedDisplayCount = count > overflowCount ? \"\".concat(overflowCount, \"+\") : count;\n var isZero = numberedDisplayCount === '0' || numberedDisplayCount === 0;\n var ignoreCount = count === null || isZero && !showZero;\n var hasStatus = (status !== null && status !== undefined || color !== null && color !== undefined) && ignoreCount;\n var showAsDot = dot && !isZero;\n var mergedCount = showAsDot ? '' : numberedDisplayCount;\n var isHidden = useMemo(function () {\n var isEmpty = mergedCount === null || mergedCount === undefined || mergedCount === '';\n return (isEmpty || isZero && !showZero) && !showAsDot;\n }, [mergedCount, isZero, showZero, showAsDot]);\n // Count should be cache in case hidden change it\n var countRef = useRef(count);\n if (!isHidden) {\n countRef.current = count;\n }\n var livingCount = countRef.current;\n // We need cache count since remove motion should not change count display\n var displayCountRef = useRef(mergedCount);\n if (!isHidden) {\n displayCountRef.current = mergedCount;\n }\n var displayCount = displayCountRef.current;\n // We will cache the dot status to avoid shaking on leaved motion\n var isDotRef = useRef(showAsDot);\n if (!isHidden) {\n isDotRef.current = showAsDot;\n }\n // =============================== Styles ===============================\n var mergedStyle = useMemo(function () {\n if (!offset) {\n return _extends({}, style);\n }\n var offsetStyle = {\n marginTop: offset[1]\n };\n if (direction === 'rtl') {\n offsetStyle.left = parseInt(offset[0], 10);\n } else {\n offsetStyle.right = -parseInt(offset[0], 10);\n }\n return _extends(_extends({}, offsetStyle), style);\n }, [direction, offset, style]);\n // =============================== Render ===============================\n // >>> Title\n var titleNode = title !== null && title !== void 0 ? title : typeof livingCount === 'string' || typeof livingCount === 'number' ? livingCount : undefined;\n // >>> Status Text\n var statusTextNode = isHidden || !text ? null : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-status-text\")\n }, text);\n // >>> Display Component\n var displayNode = !livingCount || _typeof(livingCount) !== 'object' ? undefined : cloneElement(livingCount, function (oriProps) {\n return {\n style: _extends(_extends({}, mergedStyle), oriProps.style)\n };\n });\n // Shared styles\n var statusCls = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-status-dot\"), hasStatus), \"\".concat(prefixCls, \"-status-\").concat(status), !!status), \"\".concat(prefixCls, \"-status-\").concat(color), isPresetColor(color)));\n var statusStyle = {};\n if (color && !isPresetColor(color)) {\n statusStyle.background = color;\n }\n var badgeClassName = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-status\"), hasStatus), \"\".concat(prefixCls, \"-not-a-wrapper\"), !children), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n // \n if (!children && hasStatus) {\n var statusTextColor = mergedStyle.color;\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, restProps, {\n className: badgeClassName,\n style: mergedStyle\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: statusCls,\n style: statusStyle\n }), text && ( /*#__PURE__*/React.createElement(\"span\", {\n style: {\n color: statusTextColor\n },\n className: \"\".concat(prefixCls, \"-status-text\")\n }, text)));\n }\n // }>\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, restProps, {\n className: badgeClassName\n }), children, /*#__PURE__*/React.createElement(CSSMotion, {\n visible: !isHidden,\n motionName: \"\".concat(prefixCls, \"-zoom\"),\n motionAppear: false,\n motionDeadline: 1000\n }, function (_ref) {\n var motionClassName = _ref.className;\n var scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls);\n var isDot = isDotRef.current;\n var scrollNumberCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-dot\"), isDot), \"\".concat(prefixCls, \"-count\"), !isDot), \"\".concat(prefixCls, \"-count-sm\"), size === 'small'), \"\".concat(prefixCls, \"-multiple-words\"), !isDot && displayCount && displayCount.toString().length > 1), \"\".concat(prefixCls, \"-status-\").concat(status), !!status), \"\".concat(prefixCls, \"-status-\").concat(color), isPresetColor(color)));\n var scrollNumberStyle = _extends({}, mergedStyle);\n if (color && !isPresetColor(color)) {\n scrollNumberStyle = scrollNumberStyle || {};\n scrollNumberStyle.background = color;\n }\n return /*#__PURE__*/React.createElement(ScrollNumber, {\n prefixCls: scrollNumberPrefixCls,\n show: !isHidden,\n motionClassName: motionClassName,\n className: scrollNumberCls,\n count: displayCount,\n title: titleNode,\n style: scrollNumberStyle,\n key: \"scrollNumber\"\n }, displayNode);\n }), statusTextNode);\n};\nBadge.Ribbon = Ribbon;\nexport default Badge;","import React from \"react\";\nimport { Badge } from \"antd\";\n\nexport const CXBadge = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Button } from \"antd\";\n\nexport const CXButton = ({ children, ...props }) => {\n return ;\n};\n","import React from \"react\";\nimport { Card } from \"antd\";\n\nexport const CXCard = ({ children, ...props }) => {\n return {children};\n};\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"visible\", \"onVisibleChange\", \"getContainer\", \"current\", \"countRender\"];\nimport * as React from 'react';\nimport { useState } from 'react';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport Preview from \"./Preview\";\n\n/* istanbul ignore next */\nexport var context = /*#__PURE__*/React.createContext({\n previewUrls: new Map(),\n setPreviewUrls: function setPreviewUrls() {\n return null;\n },\n current: null,\n setCurrent: function setCurrent() {\n return null;\n },\n setShowPreview: function setShowPreview() {\n return null;\n },\n setMousePosition: function setMousePosition() {\n return null;\n },\n registerImage: function registerImage() {\n return function () {\n return null;\n };\n },\n rootClassName: ''\n});\nvar Provider = context.Provider;\n\nvar Group = function Group(_ref) {\n var _ref$previewPrefixCls = _ref.previewPrefixCls,\n previewPrefixCls = _ref$previewPrefixCls === void 0 ? 'rc-image-preview' : _ref$previewPrefixCls,\n children = _ref.children,\n _ref$icons = _ref.icons,\n icons = _ref$icons === void 0 ? {} : _ref$icons,\n preview = _ref.preview;\n\n var _ref2 = _typeof(preview) === 'object' ? preview : {},\n _ref2$visible = _ref2.visible,\n previewVisible = _ref2$visible === void 0 ? undefined : _ref2$visible,\n _ref2$onVisibleChange = _ref2.onVisibleChange,\n onPreviewVisibleChange = _ref2$onVisibleChange === void 0 ? undefined : _ref2$onVisibleChange,\n _ref2$getContainer = _ref2.getContainer,\n getContainer = _ref2$getContainer === void 0 ? undefined : _ref2$getContainer,\n _ref2$current = _ref2.current,\n currentIndex = _ref2$current === void 0 ? 0 : _ref2$current,\n _ref2$countRender = _ref2.countRender,\n countRender = _ref2$countRender === void 0 ? undefined : _ref2$countRender,\n dialogProps = _objectWithoutProperties(_ref2, _excluded);\n\n var _useState = useState(new Map()),\n _useState2 = _slicedToArray(_useState, 2),\n previewUrls = _useState2[0],\n setPreviewUrls = _useState2[1];\n\n var _useState3 = useState(),\n _useState4 = _slicedToArray(_useState3, 2),\n current = _useState4[0],\n setCurrent = _useState4[1];\n\n var _useMergedState = useMergedState(!!previewVisible, {\n value: previewVisible,\n onChange: onPreviewVisibleChange\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n isShowPreview = _useMergedState2[0],\n setShowPreview = _useMergedState2[1];\n\n var _useState5 = useState(null),\n _useState6 = _slicedToArray(_useState5, 2),\n mousePosition = _useState6[0],\n setMousePosition = _useState6[1];\n\n var isControlled = previewVisible !== undefined;\n var previewUrlsKeys = Array.from(previewUrls.keys());\n var currentControlledKey = previewUrlsKeys[currentIndex];\n var canPreviewUrls = new Map(Array.from(previewUrls).filter(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n canPreview = _ref4[1].canPreview;\n\n return !!canPreview;\n }).map(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n id = _ref6[0],\n url = _ref6[1].url;\n\n return [id, url];\n }));\n\n var registerImage = function registerImage(id, url) {\n var canPreview = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var unRegister = function unRegister() {\n setPreviewUrls(function (oldPreviewUrls) {\n var clonePreviewUrls = new Map(oldPreviewUrls);\n var deleteResult = clonePreviewUrls.delete(id);\n return deleteResult ? clonePreviewUrls : oldPreviewUrls;\n });\n };\n\n setPreviewUrls(function (oldPreviewUrls) {\n return new Map(oldPreviewUrls).set(id, {\n url: url,\n canPreview: canPreview\n });\n });\n return unRegister;\n };\n\n var onPreviewClose = function onPreviewClose(e) {\n e.stopPropagation();\n setShowPreview(false);\n setMousePosition(null);\n };\n\n React.useEffect(function () {\n setCurrent(currentControlledKey);\n }, [currentControlledKey]);\n React.useEffect(function () {\n if (!isShowPreview && isControlled) {\n setCurrent(currentControlledKey);\n }\n }, [currentControlledKey, isControlled, isShowPreview]);\n return /*#__PURE__*/React.createElement(Provider, {\n value: {\n isPreviewGroup: true,\n previewUrls: canPreviewUrls,\n setPreviewUrls: setPreviewUrls,\n current: current,\n setCurrent: setCurrent,\n setShowPreview: setShowPreview,\n setMousePosition: setMousePosition,\n registerImage: registerImage\n }\n }, children, /*#__PURE__*/React.createElement(Preview, _extends({\n \"aria-hidden\": !isShowPreview,\n visible: isShowPreview,\n prefixCls: previewPrefixCls,\n onClose: onPreviewClose,\n mousePosition: mousePosition,\n src: canPreviewUrls.get(current),\n icons: icons,\n getContainer: getContainer,\n countRender: countRender\n }, dialogProps)));\n};\n\nexport default Group;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classnames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport Portal from '@rc-component/portal';\nimport { MIN_SCALE, MAX_SCALE } from \"./previewConfig\";\n\nvar Operations = function Operations(props) {\n var _countRender;\n\n var visible = props.visible,\n maskTransitionName = props.maskTransitionName,\n getContainer = props.getContainer,\n prefixCls = props.prefixCls,\n rootClassName = props.rootClassName,\n icons = props.icons,\n countRender = props.countRender,\n showSwitch = props.showSwitch,\n showProgress = props.showProgress,\n current = props.current,\n count = props.count,\n scale = props.scale,\n onSwitchLeft = props.onSwitchLeft,\n onSwitchRight = props.onSwitchRight,\n onClose = props.onClose,\n onZoomIn = props.onZoomIn,\n onZoomOut = props.onZoomOut,\n onRotateRight = props.onRotateRight,\n onRotateLeft = props.onRotateLeft;\n var rotateLeft = icons.rotateLeft,\n rotateRight = icons.rotateRight,\n zoomIn = icons.zoomIn,\n zoomOut = icons.zoomOut,\n close = icons.close,\n left = icons.left,\n right = icons.right;\n var toolClassName = \"\".concat(prefixCls, \"-operations-operation\");\n var iconClassName = \"\".concat(prefixCls, \"-operations-icon\");\n var tools = [{\n icon: close,\n onClick: onClose,\n type: 'close'\n }, {\n icon: zoomIn,\n onClick: onZoomIn,\n type: 'zoomIn',\n disabled: scale === MAX_SCALE\n }, {\n icon: zoomOut,\n onClick: onZoomOut,\n type: 'zoomOut',\n disabled: scale === MIN_SCALE\n }, {\n icon: rotateRight,\n onClick: onRotateRight,\n type: 'rotateRight'\n }, {\n icon: rotateLeft,\n onClick: onRotateLeft,\n type: 'rotateLeft'\n }];\n var operations = /*#__PURE__*/React.createElement(React.Fragment, null, showSwitch && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: classnames(\"\".concat(prefixCls, \"-switch-left\"), _defineProperty({}, \"\".concat(prefixCls, \"-switch-left-disabled\"), current === 0)),\n onClick: onSwitchLeft\n }, left), /*#__PURE__*/React.createElement(\"div\", {\n className: classnames(\"\".concat(prefixCls, \"-switch-right\"), _defineProperty({}, \"\".concat(prefixCls, \"-switch-right-disabled\"), current === count - 1)),\n onClick: onSwitchRight\n }, right)), /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-operations\")\n }, showProgress && /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-operations-progress\")\n }, (_countRender = countRender === null || countRender === void 0 ? void 0 : countRender(current + 1, count)) !== null && _countRender !== void 0 ? _countRender : \"\".concat(current + 1, \" / \").concat(count)), tools.map(function (_ref) {\n var _classnames3;\n\n var icon = _ref.icon,\n onClick = _ref.onClick,\n type = _ref.type,\n disabled = _ref.disabled;\n return /*#__PURE__*/React.createElement(\"li\", {\n className: classnames(toolClassName, (_classnames3 = {}, _defineProperty(_classnames3, \"\".concat(prefixCls, \"-operations-operation-\").concat(type), true), _defineProperty(_classnames3, \"\".concat(prefixCls, \"-operations-operation-disabled\"), !!disabled), _classnames3)),\n onClick: onClick,\n key: type\n }, /*#__PURE__*/React.isValidElement(icon) ? /*#__PURE__*/React.cloneElement(icon, {\n className: iconClassName\n }) : icon);\n })));\n return /*#__PURE__*/React.createElement(CSSMotion, {\n visible: visible,\n motionName: maskTransitionName\n }, function (_ref2) {\n var className = _ref2.className,\n style = _ref2.style;\n return /*#__PURE__*/React.createElement(Portal, {\n open: true,\n getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : document.body\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classnames(\"\".concat(prefixCls, \"-operations-wrapper\"), className, rootClassName),\n style: style\n }, operations));\n });\n};\n\nexport default Operations;","/** Minimum scale */\nexport var MIN_SCALE = 1;\n/** Maximum Scale */\n\nexport var MAX_SCALE = 50;\n/** Scale the ratio base */\n\nexport var BASE_SCALE_RATIO = 1;\n/** The maximum zoom ratio when the mouse zooms in, adjustable */\n\nexport var WHEEL_MAX_SCALE_RATIO = 0.2;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useState, useRef } from 'react';\nimport raf from \"rc-util/es/raf\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nimport { MIN_SCALE, MAX_SCALE } from \"../previewConfig\";\nvar initialTransform = {\n x: 0,\n y: 0,\n rotate: 0,\n scale: 1\n};\nexport default function useImageTransform(imgRef) {\n var frame = useRef(null);\n var queue = useRef([]);\n\n var _useState = useState(initialTransform),\n _useState2 = _slicedToArray(_useState, 2),\n transform = _useState2[0],\n setTransform = _useState2[1];\n\n var resetTransform = function resetTransform() {\n setTransform(initialTransform);\n };\n /** Direct update transform */\n\n\n var updateTransform = function updateTransform(newTransform) {\n if (frame.current === null) {\n queue.current = [];\n frame.current = raf(function () {\n setTransform(function (preState) {\n var memoState = preState;\n queue.current.forEach(function (queueState) {\n memoState = _objectSpread(_objectSpread({}, memoState), queueState);\n });\n frame.current = null;\n return memoState;\n });\n });\n }\n\n queue.current.push(_objectSpread(_objectSpread({}, transform), newTransform));\n };\n /** Scale according to the position of clientX and clientY */\n\n\n var dispatchZoonChange = function dispatchZoonChange(ratio, clientX, clientY) {\n var _imgRef$current = imgRef.current,\n width = _imgRef$current.width,\n height = _imgRef$current.height,\n offsetWidth = _imgRef$current.offsetWidth,\n offsetHeight = _imgRef$current.offsetHeight,\n offsetLeft = _imgRef$current.offsetLeft,\n offsetTop = _imgRef$current.offsetTop;\n var newRatio = ratio;\n var newScale = transform.scale * ratio;\n\n if (newScale > MAX_SCALE) {\n newRatio = MAX_SCALE / transform.scale;\n newScale = MAX_SCALE;\n } else if (newScale < MIN_SCALE) {\n newRatio = MIN_SCALE / transform.scale;\n newScale = MIN_SCALE;\n }\n /** Default center point scaling */\n\n\n var mergedClientX = clientX !== null && clientX !== void 0 ? clientX : innerWidth / 2;\n var mergedClientY = clientY !== null && clientY !== void 0 ? clientY : innerHeight / 2;\n var diffRatio = newRatio - 1;\n /** Deviation calculated from image size */\n\n var diffImgX = diffRatio * width * 0.5;\n var diffImgY = diffRatio * height * 0.5;\n /** The difference between the click position and the edge of the document */\n\n var diffOffsetLeft = diffRatio * (mergedClientX - transform.x - offsetLeft);\n var diffOffsetTop = diffRatio * (mergedClientY - transform.y - offsetTop);\n /** Final positioning */\n\n var newX = transform.x - (diffOffsetLeft - diffImgX);\n var newY = transform.y - (diffOffsetTop - diffImgY);\n /**\n * When zooming the image\n * When the image size is smaller than the width and height of the window, the position is initialized\n */\n\n if (ratio < 1 && newScale === 1) {\n var mergedWidth = offsetWidth * newScale;\n var mergedHeight = offsetHeight * newScale;\n\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n\n if (mergedWidth <= clientWidth && mergedHeight <= clientHeight) {\n newX = 0;\n newY = 0;\n }\n }\n\n updateTransform({\n x: newX,\n y: newY,\n scale: newScale\n });\n };\n\n return {\n transform: transform,\n resetTransform: resetTransform,\n updateTransform: updateTransform,\n dispatchZoonChange: dispatchZoonChange\n };\n}\n;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\n\nfunction fixPoint(key, start, width, clientWidth) {\n var startAddWidth = start + width;\n var offsetStart = (width - clientWidth) / 2;\n\n if (width > clientWidth) {\n if (start > 0) {\n return _defineProperty({}, key, offsetStart);\n }\n\n if (start < 0 && startAddWidth < clientWidth) {\n return _defineProperty({}, key, -offsetStart);\n }\n } else if (start < 0 || startAddWidth > clientWidth) {\n return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n }\n\n return {};\n}\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\n\n\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n\n var fixPos = null;\n\n if (width <= clientWidth && height <= clientHeight) {\n fixPos = {\n x: 0,\n y: 0\n };\n } else if (width > clientWidth || height > clientHeight) {\n fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n }\n\n return fixPos;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"src\", \"alt\", \"onClose\", \"afterClose\", \"visible\", \"icons\", \"rootClassName\", \"getContainer\", \"countRender\", \"scaleStep\", \"transitionName\", \"maskTransitionName\"];\nimport React, { useState, useEffect, useCallback, useRef, useContext } from 'react';\nimport Dialog from 'rc-dialog';\nimport classnames from 'classnames';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { warning } from \"rc-util/es/warning\";\nimport { context } from \"./PreviewGroup\";\nimport Operations from \"./Operations\";\nimport useImageTransform from \"./hooks/useImageTransform\";\nimport getFixScaleEleTransPosition from \"./getFixScaleEleTransPosition\";\nimport { BASE_SCALE_RATIO, WHEEL_MAX_SCALE_RATIO } from \"./previewConfig\";\n\nvar Preview = function Preview(props) {\n var prefixCls = props.prefixCls,\n src = props.src,\n alt = props.alt,\n onClose = props.onClose,\n afterClose = props.afterClose,\n visible = props.visible,\n _props$icons = props.icons,\n icons = _props$icons === void 0 ? {} : _props$icons,\n rootClassName = props.rootClassName,\n getContainer = props.getContainer,\n countRender = props.countRender,\n _props$scaleStep = props.scaleStep,\n scaleStep = _props$scaleStep === void 0 ? 0.5 : _props$scaleStep,\n _props$transitionName = props.transitionName,\n transitionName = _props$transitionName === void 0 ? 'zoom' : _props$transitionName,\n _props$maskTransition = props.maskTransitionName,\n maskTransitionName = _props$maskTransition === void 0 ? 'fade' : _props$maskTransition,\n restProps = _objectWithoutProperties(props, _excluded);\n\n var imgRef = useRef();\n var downPositionRef = useRef({\n deltaX: 0,\n deltaY: 0,\n transformX: 0,\n transformY: 0\n });\n\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n isMoving = _useState2[0],\n setMoving = _useState2[1];\n\n var _useContext = useContext(context),\n previewUrls = _useContext.previewUrls,\n current = _useContext.current,\n isPreviewGroup = _useContext.isPreviewGroup,\n setCurrent = _useContext.setCurrent;\n\n var previewGroupCount = previewUrls.size;\n var previewUrlsKeys = Array.from(previewUrls.keys());\n var currentPreviewIndex = previewUrlsKeys.indexOf(current);\n var combinationSrc = isPreviewGroup ? previewUrls.get(current) : src;\n var showLeftOrRightSwitches = isPreviewGroup && previewGroupCount > 1;\n var showOperationsProgress = isPreviewGroup && previewGroupCount >= 1;\n\n var _useImageTransform = useImageTransform(imgRef),\n transform = _useImageTransform.transform,\n resetTransform = _useImageTransform.resetTransform,\n updateTransform = _useImageTransform.updateTransform,\n dispatchZoonChange = _useImageTransform.dispatchZoonChange;\n\n var rotate = transform.rotate,\n scale = transform.scale;\n var wrapClassName = classnames(_defineProperty({}, \"\".concat(prefixCls, \"-moving\"), isMoving));\n\n var onAfterClose = function onAfterClose() {\n resetTransform();\n };\n\n var onZoomIn = function onZoomIn() {\n dispatchZoonChange(BASE_SCALE_RATIO + scaleStep);\n };\n\n var onZoomOut = function onZoomOut() {\n dispatchZoonChange(BASE_SCALE_RATIO - scaleStep);\n };\n\n var onRotateRight = function onRotateRight() {\n updateTransform({\n rotate: rotate + 90\n });\n };\n\n var onRotateLeft = function onRotateLeft() {\n updateTransform({\n rotate: rotate - 90\n });\n };\n\n var onSwitchLeft = function onSwitchLeft(event) {\n event.preventDefault();\n event.stopPropagation();\n\n if (currentPreviewIndex > 0) {\n setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n }\n };\n\n var onSwitchRight = function onSwitchRight(event) {\n event.preventDefault();\n event.stopPropagation();\n\n if (currentPreviewIndex < previewGroupCount - 1) {\n setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n }\n };\n\n var onMouseUp = function onMouseUp() {\n if (visible && isMoving) {\n setMoving(false);\n /** No need to restore the position when the picture is not moved, So as not to interfere with the click */\n\n var _downPositionRef$curr = downPositionRef.current,\n transformX = _downPositionRef$curr.transformX,\n transformY = _downPositionRef$curr.transformY;\n var hasChangedPosition = transform.x !== transformX && transform.y !== transformY;\n\n if (!hasChangedPosition) {\n return;\n }\n\n var width = imgRef.current.offsetWidth * scale;\n var height = imgRef.current.offsetHeight * scale; // eslint-disable-next-line @typescript-eslint/no-shadow\n\n var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),\n left = _imgRef$current$getBo.left,\n top = _imgRef$current$getBo.top;\n\n var isRotate = rotate % 180 !== 0;\n var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);\n\n if (fixState) {\n updateTransform(_objectSpread({}, fixState));\n }\n }\n };\n\n var onMouseDown = function onMouseDown(event) {\n // Only allow main button\n if (event.button !== 0) return;\n event.preventDefault();\n event.stopPropagation();\n downPositionRef.current = {\n deltaX: event.pageX - transform.x,\n deltaY: event.pageY - transform.y,\n transformX: transform.x,\n transformY: transform.y\n };\n setMoving(true);\n };\n\n var onMouseMove = function onMouseMove(event) {\n if (visible && isMoving) {\n updateTransform({\n x: event.pageX - downPositionRef.current.deltaX,\n y: event.pageY - downPositionRef.current.deltaY\n });\n }\n };\n\n var onWheel = function onWheel(event) {\n if (!visible || event.deltaY == 0) return; // Scale ratio depends on the deltaY size\n\n var scaleRatio = Math.abs(event.deltaY / 100); // Limit the maximum scale ratio\n\n var mergedScaleRatio = Math.min(scaleRatio, WHEEL_MAX_SCALE_RATIO); // Scale the ratio each time\n\n var ratio = BASE_SCALE_RATIO + mergedScaleRatio * scaleStep;\n\n if (event.deltaY > 0) {\n ratio = BASE_SCALE_RATIO / ratio;\n }\n\n dispatchZoonChange(ratio, event.clientX, event.clientY);\n };\n\n var onKeyDown = useCallback(function (event) {\n if (!visible || !showLeftOrRightSwitches) return;\n\n if (event.keyCode === KeyCode.LEFT) {\n if (currentPreviewIndex > 0) {\n setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n }\n } else if (event.keyCode === KeyCode.RIGHT) {\n if (currentPreviewIndex < previewGroupCount - 1) {\n setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n }\n }\n }, [currentPreviewIndex, previewGroupCount, previewUrlsKeys, setCurrent, showLeftOrRightSwitches, visible]);\n\n var onDoubleClick = function onDoubleClick(event) {\n if (visible) {\n if (scale !== 1) {\n updateTransform({\n x: 0,\n y: 0,\n scale: 1\n });\n } else {\n dispatchZoonChange(BASE_SCALE_RATIO + scaleStep, event.clientX, event.clientY);\n }\n }\n };\n\n useEffect(function () {\n var onTopMouseUpListener;\n var onTopMouseMoveListener;\n var onMouseUpListener = addEventListener(window, 'mouseup', onMouseUp, false);\n var onMouseMoveListener = addEventListener(window, 'mousemove', onMouseMove, false);\n var onKeyDownListener = addEventListener(window, 'keydown', onKeyDown, false);\n\n try {\n // Resolve if in iframe lost event\n\n /* istanbul ignore next */\n if (window.top !== window.self) {\n onTopMouseUpListener = addEventListener(window.top, 'mouseup', onMouseUp, false);\n onTopMouseMoveListener = addEventListener(window.top, 'mousemove', onMouseMove, false);\n }\n } catch (error) {\n /* istanbul ignore next */\n warning(false, \"[rc-image] \".concat(error));\n }\n\n return function () {\n var _onTopMouseUpListener, _onTopMouseMoveListen;\n\n onMouseUpListener.remove();\n onMouseMoveListener.remove();\n onKeyDownListener.remove();\n /* istanbul ignore next */\n\n (_onTopMouseUpListener = onTopMouseUpListener) === null || _onTopMouseUpListener === void 0 ? void 0 : _onTopMouseUpListener.remove();\n /* istanbul ignore next */\n\n (_onTopMouseMoveListen = onTopMouseMoveListener) === null || _onTopMouseMoveListen === void 0 ? void 0 : _onTopMouseMoveListen.remove();\n };\n }, [visible, isMoving, onKeyDown]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, _extends({\n transitionName: transitionName,\n maskTransitionName: maskTransitionName,\n closable: false,\n keyboard: true,\n prefixCls: prefixCls,\n onClose: onClose,\n afterClose: onAfterClose,\n visible: visible,\n wrapClassName: wrapClassName,\n rootClassName: rootClassName,\n getContainer: getContainer\n }, restProps), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-img-wrapper\")\n }, /*#__PURE__*/React.createElement(\"img\", {\n width: props.width,\n height: props.height,\n onWheel: onWheel,\n onMouseDown: onMouseDown,\n onDoubleClick: onDoubleClick,\n ref: imgRef,\n className: \"\".concat(prefixCls, \"-img\"),\n src: combinationSrc,\n alt: alt,\n style: {\n transform: \"translate3d(\".concat(transform.x, \"px, \").concat(transform.y, \"px, 0) scale3d(\").concat(scale, \", \").concat(scale, \", 1) rotate(\").concat(rotate, \"deg)\")\n }\n }))), /*#__PURE__*/React.createElement(Operations, {\n visible: visible,\n maskTransitionName: maskTransitionName,\n getContainer: getContainer,\n prefixCls: prefixCls,\n rootClassName: rootClassName,\n icons: icons,\n countRender: countRender,\n showSwitch: showLeftOrRightSwitches,\n showProgress: showOperationsProgress,\n current: currentPreviewIndex,\n count: previewGroupCount,\n scale: scale,\n onSwitchLeft: onSwitchLeft,\n onSwitchRight: onSwitchRight,\n onZoomIn: onZoomIn,\n onZoomOut: onZoomOut,\n onRotateRight: onRotateRight,\n onRotateLeft: onRotateLeft,\n onClose: onClose\n }));\n};\n\nexport default Preview;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"src\", \"alt\", \"onPreviewClose\", \"prefixCls\", \"previewPrefixCls\", \"placeholder\", \"fallback\", \"width\", \"height\", \"style\", \"preview\", \"className\", \"onClick\", \"onError\", \"wrapperClassName\", \"wrapperStyle\", \"rootClassName\", \"crossOrigin\", \"decoding\", \"loading\", \"referrerPolicy\", \"sizes\", \"srcSet\", \"useMap\", \"draggable\"],\n _excluded2 = [\"src\", \"visible\", \"onVisibleChange\", \"getContainer\", \"mask\", \"maskClassName\", \"icons\", \"scaleStep\"];\nimport * as React from 'react';\nimport { useState } from 'react';\nimport cn from 'classnames';\nimport { getOffset } from \"rc-util/es/Dom/css\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport Preview from \"./Preview\";\nimport PreviewGroup, { context } from \"./PreviewGroup\";\nvar uuid = 0;\n\nvar ImageInternal = function ImageInternal(_ref) {\n var _imgCommonProps$style;\n\n var imgSrc = _ref.src,\n alt = _ref.alt,\n onInitialPreviewClose = _ref.onPreviewClose,\n _ref$prefixCls = _ref.prefixCls,\n prefixCls = _ref$prefixCls === void 0 ? 'rc-image' : _ref$prefixCls,\n _ref$previewPrefixCls = _ref.previewPrefixCls,\n previewPrefixCls = _ref$previewPrefixCls === void 0 ? \"\".concat(prefixCls, \"-preview\") : _ref$previewPrefixCls,\n placeholder = _ref.placeholder,\n fallback = _ref.fallback,\n width = _ref.width,\n height = _ref.height,\n style = _ref.style,\n _ref$preview = _ref.preview,\n preview = _ref$preview === void 0 ? true : _ref$preview,\n className = _ref.className,\n onClick = _ref.onClick,\n onImageError = _ref.onError,\n wrapperClassName = _ref.wrapperClassName,\n wrapperStyle = _ref.wrapperStyle,\n rootClassName = _ref.rootClassName,\n crossOrigin = _ref.crossOrigin,\n decoding = _ref.decoding,\n loading = _ref.loading,\n referrerPolicy = _ref.referrerPolicy,\n sizes = _ref.sizes,\n srcSet = _ref.srcSet,\n useMap = _ref.useMap,\n draggable = _ref.draggable,\n otherProps = _objectWithoutProperties(_ref, _excluded);\n\n var isCustomPlaceholder = placeholder && placeholder !== true;\n\n var _ref2 = _typeof(preview) === 'object' ? preview : {},\n previewSrc = _ref2.src,\n _ref2$visible = _ref2.visible,\n previewVisible = _ref2$visible === void 0 ? undefined : _ref2$visible,\n _ref2$onVisibleChange = _ref2.onVisibleChange,\n onPreviewVisibleChange = _ref2$onVisibleChange === void 0 ? onInitialPreviewClose : _ref2$onVisibleChange,\n _ref2$getContainer = _ref2.getContainer,\n getPreviewContainer = _ref2$getContainer === void 0 ? undefined : _ref2$getContainer,\n previewMask = _ref2.mask,\n maskClassName = _ref2.maskClassName,\n icons = _ref2.icons,\n scaleStep = _ref2.scaleStep,\n dialogProps = _objectWithoutProperties(_ref2, _excluded2);\n\n var src = previewSrc !== null && previewSrc !== void 0 ? previewSrc : imgSrc;\n var isControlled = previewVisible !== undefined;\n\n var _useMergedState = useMergedState(!!previewVisible, {\n value: previewVisible,\n onChange: onPreviewVisibleChange\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n isShowPreview = _useMergedState2[0],\n setShowPreview = _useMergedState2[1];\n\n var _useState = useState(isCustomPlaceholder ? 'loading' : 'normal'),\n _useState2 = _slicedToArray(_useState, 2),\n status = _useState2[0],\n setStatus = _useState2[1];\n\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n mousePosition = _useState4[0],\n setMousePosition = _useState4[1];\n\n var isError = status === 'error';\n\n var _React$useContext = React.useContext(context),\n isPreviewGroup = _React$useContext.isPreviewGroup,\n setCurrent = _React$useContext.setCurrent,\n setGroupShowPreview = _React$useContext.setShowPreview,\n setGroupMousePosition = _React$useContext.setMousePosition,\n registerImage = _React$useContext.registerImage;\n\n var _React$useState = React.useState(function () {\n uuid += 1;\n return uuid;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n currentId = _React$useState2[0];\n\n var canPreview = !!preview;\n var isLoaded = React.useRef(false);\n\n var onLoad = function onLoad() {\n setStatus('normal');\n };\n\n var onError = function onError(e) {\n if (onImageError) {\n onImageError(e);\n }\n\n setStatus('error');\n };\n\n var onPreview = function onPreview(e) {\n if (!isControlled) {\n var _getOffset = getOffset(e.target),\n left = _getOffset.left,\n top = _getOffset.top;\n\n if (isPreviewGroup) {\n setCurrent(currentId);\n setGroupMousePosition({\n x: left,\n y: top\n });\n } else {\n setMousePosition({\n x: left,\n y: top\n });\n }\n }\n\n if (isPreviewGroup) {\n setGroupShowPreview(true);\n } else {\n setShowPreview(true);\n }\n\n if (onClick) onClick(e);\n };\n\n var onPreviewClose = function onPreviewClose(e) {\n e.stopPropagation();\n setShowPreview(false);\n\n if (!isControlled) {\n setMousePosition(null);\n }\n };\n\n var getImgRef = function getImgRef(img) {\n isLoaded.current = false;\n if (status !== 'loading') return;\n\n if (img !== null && img !== void 0 && img.complete && (img.naturalWidth || img.naturalHeight)) {\n isLoaded.current = true;\n onLoad();\n }\n }; // Keep order start\n // Resolve https://github.com/ant-design/ant-design/issues/28881\n // Only need unRegister when component unMount\n\n\n React.useEffect(function () {\n var unRegister = registerImage(currentId, src);\n return unRegister;\n }, []);\n React.useEffect(function () {\n registerImage(currentId, src, canPreview);\n }, [src, canPreview]); // Keep order end\n\n React.useEffect(function () {\n if (isError) {\n setStatus('normal');\n }\n\n if (isCustomPlaceholder && !isLoaded.current) {\n setStatus('loading');\n }\n }, [imgSrc]);\n var wrapperClass = cn(prefixCls, wrapperClassName, rootClassName, _defineProperty({}, \"\".concat(prefixCls, \"-error\"), isError));\n var mergedSrc = isError && fallback ? fallback : src;\n var imgCommonProps = {\n crossOrigin: crossOrigin,\n decoding: decoding,\n draggable: draggable,\n loading: loading,\n referrerPolicy: referrerPolicy,\n sizes: sizes,\n srcSet: srcSet,\n useMap: useMap,\n alt: alt,\n className: cn(\"\".concat(prefixCls, \"-img\"), _defineProperty({}, \"\".concat(prefixCls, \"-img-placeholder\"), placeholder === true), className),\n style: _objectSpread({\n height: height\n }, style)\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", _extends({}, otherProps, {\n className: wrapperClass,\n onClick: canPreview ? onPreview : onClick,\n style: _objectSpread({\n width: width,\n height: height\n }, wrapperStyle)\n }), /*#__PURE__*/React.createElement(\"img\", _extends({}, imgCommonProps, {\n ref: getImgRef\n }, isError && fallback ? {\n src: fallback\n } : {\n onLoad: onLoad,\n onError: onError,\n src: imgSrc\n }, {\n width: width,\n height: height\n })), status === 'loading' && /*#__PURE__*/React.createElement(\"div\", {\n \"aria-hidden\": \"true\",\n className: \"\".concat(prefixCls, \"-placeholder\")\n }, placeholder), previewMask && canPreview && /*#__PURE__*/React.createElement(\"div\", {\n className: cn(\"\".concat(prefixCls, \"-mask\"), maskClassName),\n style: {\n display: ((_imgCommonProps$style = imgCommonProps.style) === null || _imgCommonProps$style === void 0 ? void 0 : _imgCommonProps$style.display) === 'none' ? 'none' : undefined\n }\n }, previewMask)), !isPreviewGroup && canPreview && /*#__PURE__*/React.createElement(Preview, _extends({\n \"aria-hidden\": !isShowPreview,\n visible: isShowPreview,\n prefixCls: previewPrefixCls,\n onClose: onPreviewClose,\n mousePosition: mousePosition,\n src: mergedSrc,\n alt: alt,\n getContainer: getPreviewContainer,\n icons: icons,\n scaleStep: scaleStep,\n rootClassName: rootClassName\n }, dialogProps)));\n};\n\nImageInternal.PreviewGroup = PreviewGroup;\nImageInternal.displayName = 'Image';\nexport default ImageInternal;","import Image from \"./Image\";\nexport * from \"./Image\";\nexport default Image;","// This icon file is generated automatically.\nvar RotateLeftOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"defs\", \"attrs\": {}, \"children\": [{ \"tag\": \"style\", \"attrs\": {} }] }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z\" } }] }, \"name\": \"rotate-left\", \"theme\": \"outlined\" };\nexport default RotateLeftOutlined;\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 RotateLeftOutlinedSvg from \"@ant-design/icons-svg/es/asn/RotateLeftOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RotateLeftOutlined = function RotateLeftOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RotateLeftOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RotateLeftOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RotateLeftOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar RotateRightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"defs\", \"attrs\": {}, \"children\": [{ \"tag\": \"style\", \"attrs\": {} }] }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z\" } }] }, \"name\": \"rotate-right\", \"theme\": \"outlined\" };\nexport default RotateRightOutlined;\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 RotateRightOutlinedSvg from \"@ant-design/icons-svg/es/asn/RotateRightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RotateRightOutlined = function RotateRightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RotateRightOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RotateRightOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RotateRightOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ZoomInOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\" } }] }, \"name\": \"zoom-in\", \"theme\": \"outlined\" };\nexport default ZoomInOutlined;\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 ZoomInOutlinedSvg from \"@ant-design/icons-svg/es/asn/ZoomInOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ZoomInOutlined = function ZoomInOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ZoomInOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ZoomInOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ZoomInOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ZoomOutOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z\" } }] }, \"name\": \"zoom-out\", \"theme\": \"outlined\" };\nexport default ZoomOutOutlined;\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 ZoomOutOutlinedSvg from \"@ant-design/icons-svg/es/asn/ZoomOutOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ZoomOutOutlined = function ZoomOutOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ZoomOutOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ZoomOutOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ZoomOutOutlined';\n}\nexport default RefIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport LeftOutlined from \"@ant-design/icons/es/icons/LeftOutlined\";\nimport RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport RotateLeftOutlined from \"@ant-design/icons/es/icons/RotateLeftOutlined\";\nimport RotateRightOutlined from \"@ant-design/icons/es/icons/RotateRightOutlined\";\nimport ZoomInOutlined from \"@ant-design/icons/es/icons/ZoomInOutlined\";\nimport ZoomOutOutlined from \"@ant-design/icons/es/icons/ZoomOutOutlined\";\nimport RcImage from 'rc-image';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { getTransitionName } from '../_util/motion';\nexport var icons = {\n rotateLeft: /*#__PURE__*/React.createElement(RotateLeftOutlined, null),\n rotateRight: /*#__PURE__*/React.createElement(RotateRightOutlined, null),\n zoomIn: /*#__PURE__*/React.createElement(ZoomInOutlined, null),\n zoomOut: /*#__PURE__*/React.createElement(ZoomOutOutlined, null),\n close: /*#__PURE__*/React.createElement(CloseOutlined, null),\n left: /*#__PURE__*/React.createElement(LeftOutlined, null),\n right: /*#__PURE__*/React.createElement(RightOutlined, null)\n};\nvar InternalPreviewGroup = function InternalPreviewGroup(_a) {\n var customizePrefixCls = _a.previewPrefixCls,\n preview = _a.preview,\n props = __rest(_a, [\"previewPrefixCls\", \"preview\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('image-preview', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var mergedPreview = React.useMemo(function () {\n if (preview === false) {\n return preview;\n }\n var _preview = _typeof(preview) === 'object' ? preview : {};\n return _extends(_extends({}, _preview), {\n transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),\n maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName)\n });\n }, [preview]);\n return /*#__PURE__*/React.createElement(RcImage.PreviewGroup, _extends({\n preview: mergedPreview,\n previewPrefixCls: prefixCls,\n icons: icons\n }, props));\n};\nexport default InternalPreviewGroup;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport RcImage from 'rc-image';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport defaultLocale from '../locale/en_US';\nimport { getTransitionName } from '../_util/motion';\nimport PreviewGroup, { icons } from './PreviewGroup';\nvar Image = function Image(_a) {\n var customizePrefixCls = _a.prefixCls,\n preview = _a.preview,\n otherProps = __rest(_a, [\"prefixCls\", \"preview\"]);\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls,\n _useContext$locale = _useContext.locale,\n contextLocale = _useContext$locale === void 0 ? defaultLocale : _useContext$locale,\n getContextPopupContainer = _useContext.getPopupContainer;\n var prefixCls = getPrefixCls('image', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var imageLocale = contextLocale.Image || defaultLocale.Image;\n var mergedPreview = React.useMemo(function () {\n if (preview === false) {\n return preview;\n }\n var _preview = _typeof(preview) === 'object' ? preview : {};\n var getContainer = _preview.getContainer,\n restPreviewProps = __rest(_preview, [\"getContainer\"]);\n return _extends(_extends({\n mask: ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-mask-info\")\n }, /*#__PURE__*/React.createElement(EyeOutlined, null), imageLocale === null || imageLocale === void 0 ? void 0 : imageLocale.preview)),\n icons: icons\n }, restPreviewProps), {\n getContainer: getContainer || getContextPopupContainer,\n transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),\n maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName)\n });\n }, [preview, imageLocale]);\n return /*#__PURE__*/React.createElement(RcImage, _extends({\n prefixCls: prefixCls,\n preview: mergedPreview\n }, otherProps));\n};\nImage.PreviewGroup = PreviewGroup;\nexport default Image;","// This icon file is generated automatically.\nvar RedoOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z\" } }] }, \"name\": \"redo\", \"theme\": \"outlined\" };\nexport default RedoOutlined;\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 RedoOutlinedSvg from \"@ant-design/icons-svg/es/asn/RedoOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RedoOutlined = function RedoOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RedoOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RedoOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RedoOutlined';\n}\nexport default RefIcon;","import React, { Fragment } from \"react\";\nimport moment from \"moment\";\nimport { Avatar, Skeleton, Dropdown, Menu } from \"antd\";\nimport { ColorSet, truncateSt } from \"utils\";\nimport { CXTooltip } from \"component/Tooltip\";\nimport \"./style.css\";\nimport { CXLottie } from \"component/Lottie\";\nimport { checkTime } from \"utils\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXTag } from \"component/Tag\";\nimport { CXButton } from \"component/Button\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { Image } from \"antd\";\nimport {\n ArrowsAltOutlined,\n CompressOutlined,\n DownOutlined,\n EyeOutlined,\n PaperClipOutlined,\n RedoOutlined,\n} from \"@ant-design/icons\";\nimport { CXPopover } from \"component/Popover\";\nconst dropStyle = {\n color: \"#000000\",\n opacity: 0.2,\n fontSize: \"16px\",\n marginLeft: \"2px\",\n cursor: \"pointer\",\n};\n\nconst FileIcons = (mimeType, url) => {\n if (\n [\"application/pdf\", \"application/csv\", \"application/xlsx\"].includes(\n mimeType\n )\n ) {\n let obj = {\n \"application/pdf\": (\n \n \n \n ),\n \"application/csv\": (\n \n \n \n ),\n \"application/xlsx\": (\n \n {\" \"}\n \n \n ),\n };\n return obj[mimeType];\n } else if (\n [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/webp\",\n \"image/gif\",\n ].includes(mimeType)\n ) {\n return (\n \n \n \n );\n } else if (\n [\n \"video/mp4\",\n \"video/ogg\",\n \"video/3gp\",\n \"video/3gpp\",\n \"video/3gpp2\",\n \"video/mpeg\",\n \"video/quicktime\",\n \"video/x-msvideo\",\n \"video/x-ms-wmv\",\n ].includes(mimeType)\n ) {\n return (\n \n \n \n );\n } else {\n return (\n \n \n \n );\n }\n};\n\nconst mediaRender = (attachment) => {\n switch (attachment.mimeType) {\n case \"image/jpeg\":\n case \"image/webp\":\n case \"image/gif\":\n case \"image/png\":\n case \"image/jpg\":\n return (\n
\n \n
\n );\n break;\n case \"video/mp4\":\n case \"video/ogg\":\n case \"video/3gp\":\n case \"video/3gpp\":\n case \"video/3gpp2\":\n case \"video/mpeg\":\n case \"video/quicktime\":\n case \"video/x-msvideo\":\n case \"video/x-ms-wmv\":\n return (\n \n );\n break;\n case \"audio/mpeg\":\n case \"audio/ogg\":\n case \"audio/wav\":\n case \"audio/x-wav\":\n case \"audio/x-pn-wav\":\n case \"audio/amr\":\n return (\n \n );\n break;\n default:\n return (\n \n );\n }\n};\n\nconst Delivered = (condition) => {\n // \"sent\", \"delivered\", \"read\", \"failed\"\n switch (condition.status) {\n case \"sent\":\n return ;\n case \"delivered\":\n return ;\n case \"read\":\n return ;\n case \"failed\":\n return (\n \n \n \n Message Failed. Retry\n \n \n );\n default:\n return sending..;\n }\n};\n\nconst EmailChatContainer = ({ data, setEmailComponent }) => {\n return (\n
\n
\n
\n {data.mode === \"receive\"\n ? data?.from?.name ?? \"NA\"\n : data?.to[0]?.name ?? \"NA\"}\n
\n
{data?.subject ?? \"NA\"}
\n
{ReactHtmlParser(data?.text) ?? \"NA\"}
\n
\n
\n );\n};\n\nexport const CXChatTextSend = ({\n children,\n avatar,\n time,\n attachments = [],\n user = {},\n dropdownMenu,\n md,\n data,\n setReply,\n ChatContainerWidth,\n ActiveComponent,\n tenantAgents,\n msgFrom,\n msgTo,\n setEmailComponent,\n qType,\n content,\n ...props\n}) => {\n const dispatch = useDispatch();\n return (\n
\n {!avatar?.profileUrl ? (\n \n \n {msgFrom?.name ? msgFrom?.name[0].toUpperCase() : null}\n \n \n ) : (\n \n )}\n
\n \n
\n
\n
\n {md === \"email\" ? (\n \n Email\n {attachments?.length > 0 && }\n \n ) : msgFrom?.name ? (\n truncateSt(msgFrom?.name, 22)\n ) : (\n \"N/A\"\n )}\n
\n
\n \n {/* {moment(time).format(\"hh:mm A\")} */}\n {checkTime(time)}\n \n {md !== \"email\" && dropdownMenu ? (\n \n setReply(data)}\n style={dropStyle}\n />\n \n ) : null}\n
\n
\n
\n {\" \"}\n \n {data?.channelAccount ?? \"\"}\n \n
\n \n {md !== \"email\" && (\n
\n {children}\n {attachments.map((attachment) =>\n attachment.mType === \"iframe\" ? (\n \n ) : (\n mediaRender(attachment)\n )\n )}\n
\n )}\n {md === \"email\" && (\n \n )}\n {(qType === \"button\" || content?.buttons?.length > 0) && (\n
\n {content?.buttons?.map((res) => {\n return (\n {res.text}\n );\n })}\n
\n )}\n
\n
\n
\n \n
\n {md === \"email\" && (\n
\n
\n {\n setEmailComponent(\"composeViewOnly\");\n dispatch({\n type: \"SET_MAIL_PREVIEW_DATA\",\n data: data,\n });\n }}\n >\n View\n \n {\n setEmailComponent(\"replyView\");\n dispatch({\n type: \"SET_MAIL_PREVIEW_DATA_THREAD\",\n data: data,\n });\n }}\n >\n Reply\n \n
\n
\n )}\n
\n\n {attachments?.length > 0 && (\n
\n
\n {attachments.map((res) => {\n return (\n
\n \n {FileIcons(res?.mimeType, res?.url)}\n \n
\n );\n })}\n
\n
\n )}\n \n \n \n );\n};\n\nexport const CXChatTextSendSkeleton = () => {\n return (\n
\n \n
\n
\n \n
\n
\n
\n );\n};\n\nexport const CXChatTextReceive = ({\n children,\n avatar,\n time,\n attachments = [],\n user = {},\n dropdownMenu,\n md,\n data,\n setReply,\n ChatContainerWidth,\n ActiveComponent,\n type,\n meta,\n qType,\n content,\n setEmailComponent,\n ...props\n}) => {\n const { CampaignsList } = useSelector((state) => state.CampaignReducer);\n const dispatch = useDispatch();\n return (\n \n
\n
\n \n
\n
\n
\n {user?.fname ? (\n truncateSt(user?.fname, 22)\n ) : meta?.wfId ? (\n \n Campaign : {meta.wfName ?? \"NA\"}\n \n ) : md === \"email\" ? (\n \n Email\n {attachments?.length > 0 && }{\" \"}\n \n ) : (\n \"Recruiter\"\n )}\n
\n
\n \n {checkTime(time)}\n \n {md !== \"email\" && dropdownMenu ? (\n \n setReply(data)}\n style={dropStyle}\n />\n \n ) : null}\n
\n
\n
\n {\" \"}\n \n {data?.channelAccount ?? \"\"}\n \n
\n\n \n {md !== \"email\" && (\n
\n {children}\n {attachments.map((attachment) =>\n attachment.mType === \"iframe\" ? (\n \n ) : (\n mediaRender(attachment)\n )\n )}\n
\n )}\n {md === \"email\" && (\n \n )}\n\n {qType === \"button\" && (\n
\n {content?.buttons?.map((res) => {\n return (\n {res.text}\n );\n })}\n
\n )}\n {qType === \"shopifyCategory\" && (\n
\n {content?.items?.map((res) => {\n return (\n \n {res?.catName}\n \n );\n })}\n
\n )}\n {qType === \"shopifyItem\" && (\n
\n {content?.items?.map((res) => {\n res?.storeItems?.map((item) => {\n return (\n \n {item?.name}\n \n );\n });\n })}\n
\n )}\n
\n
\n
\n \n {!avatar?.profileUrl ? (\n \n {user.fname ? (\n \n {user.fname ? user.fname[0].toUpperCase() : null}\n \n ) : (\n \n )}\n \n ) : (\n \n )}\n \n
\n \n
\n {attachments?.length > 0 && (\n
\n
\n {attachments.map((res) => {\n return (\n
\n \n {FileIcons(res?.mimeType, res?.url)}\n \n
\n );\n })}\n
\n
\n )}\n
\n\n
\n {md === \"email\" && (\n
\n
\n {\n setEmailComponent(\"composeViewOnly\");\n dispatch({\n type: \"SET_MAIL_PREVIEW_DATA\",\n data: data,\n });\n }}\n >\n View\n \n {\n setEmailComponent(\"replyView\");\n dispatch({\n type: \"SET_MAIL_PREVIEW_DATA_THREAD\",\n data: data,\n });\n }}\n >\n Reply\n \n
\n
\n )}\n
{type !== \"all\" && Delivered(data)}
\n
\n
\n \n
\n );\n};\n\nexport const CXChatTextReceiveSkeleton = () => {\n return (\n
\n
\n
\n \n
\n
\n \n
\n );\n};\n\nexport const CXChatProcessing = () => {\n return (\n
\n
\n
\n \n
\n
\n \n
\n );\n};\nexport const CXChatTyping = ({ activeConv }) => {\n return (\n
\n \n {activeConv?.data?.name\n ? activeConv?.data?.name[0].toUpperCase()\n : null}\n \n
\n
\n \n
\n
\n
\n );\n};\n\nexport const CXChatInfo = ({ text }) => {\n return (\n
\n {text}\n
\n );\n};\n","import React from \"react\";\nimport { Checkbox } from \"antd\";\n\nexport const CXCheckbox = ({ children, ...props }) => {\n return {children};\n};\nexport const CXCheckboxGroup = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Col } from \"antd\";\n\nexport const CXCol = ({ children, ...props }) => {\n return {children};\n};\n","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n\n/* eslint-disable no-underscore-dangle */\n\n/* eslint-disable react/prop-types */\nimport * as React from 'react';\nimport classnames from 'classnames';\nvar PanelContent = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _classnames;\n\n var prefixCls = props.prefixCls,\n forceRender = props.forceRender,\n className = props.className,\n style = props.style,\n children = props.children,\n isActive = props.isActive,\n role = props.role;\n\n var _React$useState = React.useState(isActive || forceRender),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n rendered = _React$useState2[0],\n setRendered = _React$useState2[1];\n\n React.useEffect(function () {\n if (forceRender || isActive) {\n setRendered(true);\n }\n }, [forceRender, isActive]);\n\n if (!rendered) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: ref,\n className: classnames(\"\".concat(prefixCls, \"-content\"), (_classnames = {}, _defineProperty(_classnames, \"\".concat(prefixCls, \"-content-active\"), isActive), _defineProperty(_classnames, \"\".concat(prefixCls, \"-content-inactive\"), !isActive), _classnames), className),\n style: style,\n role: role\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-box\")\n }, children));\n});\nPanelContent.displayName = 'PanelContent';\nexport default PanelContent;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nvar _excluded = [\"className\", \"id\", \"style\", \"prefixCls\", \"headerClass\", \"children\", \"isActive\", \"destroyInactivePanel\", \"accordion\", \"forceRender\", \"openMotion\", \"extra\", \"collapsible\"];\n\n/* eslint-disable react/prop-types */\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport * as React from 'react';\nimport shallowEqual from 'shallowequal';\nimport PanelContent from './PanelContent';\n\nvar CollapsePanel = /*#__PURE__*/function (_React$Component) {\n _inherits(CollapsePanel, _React$Component);\n\n var _super = _createSuper(CollapsePanel);\n\n function CollapsePanel() {\n var _this;\n\n _classCallCheck(this, CollapsePanel);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _this.onItemClick = function () {\n var _this$props = _this.props,\n onItemClick = _this$props.onItemClick,\n panelKey = _this$props.panelKey;\n\n if (typeof onItemClick === 'function') {\n onItemClick(panelKey);\n }\n };\n\n _this.handleKeyPress = function (e) {\n if (e.key === 'Enter' || e.keyCode === 13 || e.which === 13) {\n _this.onItemClick();\n }\n };\n\n _this.renderIcon = function () {\n var _this$props2 = _this.props,\n showArrow = _this$props2.showArrow,\n expandIcon = _this$props2.expandIcon,\n prefixCls = _this$props2.prefixCls,\n collapsible = _this$props2.collapsible;\n\n if (!showArrow) {\n return null;\n }\n\n var iconNode = typeof expandIcon === 'function' ? expandIcon(_this.props) : /*#__PURE__*/React.createElement(\"i\", {\n className: \"arrow\"\n });\n return iconNode && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-expand-icon\"),\n onClick: collapsible === 'header' || collapsible === 'icon' ? _this.onItemClick : null\n }, iconNode);\n };\n\n _this.renderTitle = function () {\n var _this$props3 = _this.props,\n header = _this$props3.header,\n prefixCls = _this$props3.prefixCls,\n collapsible = _this$props3.collapsible;\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-header-text\"),\n onClick: collapsible === 'header' ? _this.onItemClick : null\n }, header);\n };\n\n return _this;\n }\n\n _createClass(CollapsePanel, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return !shallowEqual(this.props, nextProps);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames, _classNames2;\n\n var _this$props4 = this.props,\n className = _this$props4.className,\n id = _this$props4.id,\n style = _this$props4.style,\n prefixCls = _this$props4.prefixCls,\n headerClass = _this$props4.headerClass,\n children = _this$props4.children,\n isActive = _this$props4.isActive,\n destroyInactivePanel = _this$props4.destroyInactivePanel,\n accordion = _this$props4.accordion,\n forceRender = _this$props4.forceRender,\n openMotion = _this$props4.openMotion,\n extra = _this$props4.extra,\n collapsible = _this$props4.collapsible,\n rest = _objectWithoutProperties(_this$props4, _excluded);\n\n var disabled = collapsible === 'disabled';\n var collapsibleHeader = collapsible === 'header';\n var collapsibleIcon = collapsible === 'icon';\n var itemCls = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-item\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-item-active\"), isActive), _defineProperty(_classNames, \"\".concat(prefixCls, \"-item-disabled\"), disabled), _classNames), className);\n var headerCls = classNames(\"\".concat(prefixCls, \"-header\"), (_classNames2 = {}, _defineProperty(_classNames2, headerClass, headerClass), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-header-collapsible-only\"), collapsibleHeader), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-icon-collapsible-only\"), collapsibleIcon), _classNames2));\n /** header 节点属性 */\n\n var headerProps = {\n className: headerCls,\n 'aria-expanded': isActive,\n 'aria-disabled': disabled,\n onKeyPress: this.handleKeyPress\n };\n\n if (!collapsibleHeader && !collapsibleIcon) {\n headerProps.onClick = this.onItemClick;\n headerProps.role = accordion ? 'tab' : 'button';\n headerProps.tabIndex = disabled ? -1 : 0;\n }\n\n var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean'; // https://github.com/ant-design/ant-design/pull/37419#issuecomment-1238812797\n\n delete rest.header;\n delete rest.panelKey;\n delete rest.onItemClick;\n delete rest.showArrow;\n delete rest.expandIcon;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, rest, {\n className: itemCls,\n style: style,\n id: id\n }), /*#__PURE__*/React.createElement(\"div\", headerProps, this.renderIcon(), this.renderTitle(), ifExtraExist && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), /*#__PURE__*/React.createElement(CSSMotion, _extends({\n visible: isActive,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n }, openMotion, {\n forceRender: forceRender,\n removeOnLeave: destroyInactivePanel\n }), function (_ref, ref) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(PanelContent, {\n ref: ref,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n isActive: isActive,\n forceRender: forceRender,\n role: accordion ? 'tabpanel' : null\n }, children);\n }));\n }\n }]);\n\n return CollapsePanel;\n}(React.Component);\n\nCollapsePanel.defaultProps = {\n showArrow: true,\n isActive: false,\n onItemClick: function onItemClick() {},\n headerClass: '',\n forceRender: false\n};\nexport default CollapsePanel;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/* eslint-disable react/prop-types */\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport shallowEqual from 'shallowequal';\nimport CollapsePanel from './Panel';\n\nfunction getActiveKeysArray(activeKey) {\n var currentActiveKey = activeKey;\n\n if (!Array.isArray(currentActiveKey)) {\n var activeKeyType = _typeof(currentActiveKey);\n\n currentActiveKey = activeKeyType === 'number' || activeKeyType === 'string' ? [currentActiveKey] : [];\n }\n\n return currentActiveKey.map(function (key) {\n return String(key);\n });\n}\n\nvar Collapse = /*#__PURE__*/function (_React$Component) {\n _inherits(Collapse, _React$Component);\n\n var _super = _createSuper(Collapse);\n\n function Collapse(_props) {\n var _this;\n\n _classCallCheck(this, Collapse);\n\n _this = _super.call(this, _props);\n\n _this.onClickItem = function (key) {\n var activeKey = _this.state.activeKey;\n\n if (_this.props.accordion) {\n activeKey = activeKey[0] === key ? [] : [key];\n } else {\n activeKey = _toConsumableArray(activeKey);\n var index = activeKey.indexOf(key);\n var isActive = index > -1;\n\n if (isActive) {\n // remove active state\n activeKey.splice(index, 1);\n } else {\n activeKey.push(key);\n }\n }\n\n _this.setActiveKey(activeKey);\n };\n\n _this.getNewChild = function (child, index) {\n if (!child) return null;\n var activeKey = _this.state.activeKey;\n var _this$props = _this.props,\n prefixCls = _this$props.prefixCls,\n openMotion = _this$props.openMotion,\n accordion = _this$props.accordion,\n rootDestroyInactivePanel = _this$props.destroyInactivePanel,\n expandIcon = _this$props.expandIcon,\n collapsible = _this$props.collapsible; // If there is no key provide, use the panel order as default key\n\n var key = child.key || String(index);\n var _child$props = child.props,\n header = _child$props.header,\n headerClass = _child$props.headerClass,\n destroyInactivePanel = _child$props.destroyInactivePanel,\n childCollapsible = _child$props.collapsible;\n var isActive = false;\n\n if (accordion) {\n isActive = activeKey[0] === key;\n } else {\n isActive = activeKey.indexOf(key) > -1;\n }\n\n var mergeCollapsible = childCollapsible !== null && childCollapsible !== void 0 ? childCollapsible : collapsible;\n var props = {\n key: key,\n panelKey: key,\n header: header,\n headerClass: headerClass,\n isActive: isActive,\n prefixCls: prefixCls,\n destroyInactivePanel: destroyInactivePanel !== null && destroyInactivePanel !== void 0 ? destroyInactivePanel : rootDestroyInactivePanel,\n openMotion: openMotion,\n accordion: accordion,\n children: child.props.children,\n onItemClick: mergeCollapsible === 'disabled' ? null : _this.onClickItem,\n expandIcon: expandIcon,\n collapsible: mergeCollapsible\n }; // https://github.com/ant-design/ant-design/issues/20479\n\n if (typeof child.type === 'string') {\n return child;\n }\n\n Object.keys(props).forEach(function (propName) {\n if (typeof props[propName] === 'undefined') {\n delete props[propName];\n }\n });\n return /*#__PURE__*/React.cloneElement(child, props);\n };\n\n _this.getItems = function () {\n var children = _this.props.children;\n return toArray(children).map(_this.getNewChild);\n };\n\n _this.setActiveKey = function (activeKey) {\n if (!('activeKey' in _this.props)) {\n _this.setState({\n activeKey: activeKey\n });\n }\n\n _this.props.onChange(_this.props.accordion ? activeKey[0] : activeKey);\n };\n\n var _activeKey = _props.activeKey,\n defaultActiveKey = _props.defaultActiveKey;\n var currentActiveKey = defaultActiveKey;\n\n if ('activeKey' in _props) {\n currentActiveKey = _activeKey;\n }\n\n _this.state = {\n activeKey: getActiveKeysArray(currentActiveKey)\n };\n return _this;\n }\n\n _createClass(Collapse, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames;\n\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n className = _this$props2.className,\n style = _this$props2.style,\n accordion = _this$props2.accordion;\n var collapseClassName = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, className, !!className), _classNames));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: collapseClassName,\n style: style,\n role: accordion ? 'tablist' : null\n }, this.getItems());\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n var newState = {};\n\n if ('activeKey' in nextProps) {\n newState.activeKey = getActiveKeysArray(nextProps.activeKey);\n }\n\n return newState;\n }\n }]);\n\n return Collapse;\n}(React.Component);\n\nCollapse.defaultProps = {\n prefixCls: 'rc-collapse',\n onChange: function onChange() {},\n accordion: false,\n destroyInactivePanel: false\n};\nCollapse.Panel = CollapsePanel;\nexport default Collapse;","import Collapse from './Collapse';\nexport default Collapse;\nvar Panel = Collapse.Panel;\nexport { Panel };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport RcCollapse from 'rc-collapse';\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport { ConfigContext } from '../config-provider';\nimport collapseMotion from '../_util/motion';\nimport { cloneElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nimport CollapsePanel from './CollapsePanel';\nvar Collapse = function Collapse(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n ghost = props.ghost,\n _props$expandIconPosi = props.expandIconPosition,\n expandIconPosition = _props$expandIconPosi === void 0 ? 'start' : _props$expandIconPosi;\n var prefixCls = getPrefixCls('collapse', customizePrefixCls);\n // Warning if use legacy type `expandIconPosition`\n process.env.NODE_ENV !== \"production\" ? warning(expandIconPosition !== 'left' && expandIconPosition !== 'right', 'Collapse', '`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.') : void 0;\n // Align with logic position\n var mergedExpandIconPosition = React.useMemo(function () {\n if (expandIconPosition === 'left') {\n return 'start';\n }\n return expandIconPosition === 'right' ? 'end' : expandIconPosition;\n }, [expandIconPosition]);\n var renderExpandIcon = function renderExpandIcon() {\n var panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var expandIcon = props.expandIcon;\n var icon = expandIcon ? expandIcon(panelProps) : ( /*#__PURE__*/React.createElement(RightOutlined, {\n rotate: panelProps.isActive ? 90 : undefined\n }));\n return cloneElement(icon, function () {\n return {\n className: classNames(icon.props.className, \"\".concat(prefixCls, \"-arrow\"))\n };\n });\n };\n var collapseClassName = classNames(\"\".concat(prefixCls, \"-icon-position-\").concat(mergedExpandIconPosition), _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-borderless\"), !bordered), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-ghost\"), !!ghost), className);\n var openMotion = _extends(_extends({}, collapseMotion), {\n motionAppear: false,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n });\n var getItems = function getItems() {\n var children = props.children;\n return toArray(children).map(function (child, index) {\n var _a;\n if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {\n var key = child.key || String(index);\n var _child$props = child.props,\n disabled = _child$props.disabled,\n collapsible = _child$props.collapsible;\n var childProps = _extends(_extends({}, omit(child.props, ['disabled'])), {\n key: key,\n collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined\n });\n return cloneElement(child, childProps);\n }\n return child;\n });\n };\n return /*#__PURE__*/React.createElement(RcCollapse, _extends({\n openMotion: openMotion\n }, props, {\n expandIcon: renderExpandIcon,\n prefixCls: prefixCls,\n className: collapseClassName\n }), getItems());\n};\nCollapse.Panel = CollapsePanel;\nexport default Collapse;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport RcCollapse from 'rc-collapse';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport warning from '../_util/warning';\nvar CollapsePanel = function CollapsePanel(props) {\n process.env.NODE_ENV !== \"production\" ? warning(!('disabled' in props), 'Collapse.Panel', '`disabled` is deprecated. Please use `collapsible=\"disabled\"` instead.') : void 0;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n _props$showArrow = props.showArrow,\n showArrow = _props$showArrow === void 0 ? true : _props$showArrow;\n var prefixCls = getPrefixCls('collapse', customizePrefixCls);\n var collapsePanelClassName = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-no-arrow\"), !showArrow), className);\n return /*#__PURE__*/React.createElement(RcCollapse.Panel, _extends({}, props, {\n prefixCls: prefixCls,\n className: collapsePanelClassName\n }));\n};\nexport default CollapsePanel;","import Collapse from './Collapse';\nexport default Collapse;","import React from \"react\";\nimport { Collapse } from \"antd\";\n\nexport const CXCollapse = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXCollapsePanel = ({ children, ...props }) => {\n return {children};\n};\n","import moment from 'moment';\nimport { noteOnce } from \"rc-util/es/warning\";\nvar generateConfig = {\n // get\n getNow: function getNow() {\n return moment();\n },\n getFixedDate: function getFixedDate(string) {\n return moment(string, 'YYYY-MM-DD');\n },\n getEndDate: function getEndDate(date) {\n var clone = date.clone();\n return clone.endOf('month');\n },\n getWeekDay: function getWeekDay(date) {\n var clone = date.clone().locale('en_US');\n return clone.weekday() + clone.localeData().firstDayOfWeek();\n },\n getYear: function getYear(date) {\n return date.year();\n },\n getMonth: function getMonth(date) {\n return date.month();\n },\n getDate: function getDate(date) {\n return date.date();\n },\n getHour: function getHour(date) {\n return date.hour();\n },\n getMinute: function getMinute(date) {\n return date.minute();\n },\n getSecond: function getSecond(date) {\n return date.second();\n },\n // set\n addYear: function addYear(date, diff) {\n var clone = date.clone();\n return clone.add(diff, 'year');\n },\n addMonth: function addMonth(date, diff) {\n var clone = date.clone();\n return clone.add(diff, 'month');\n },\n addDate: function addDate(date, diff) {\n var clone = date.clone();\n return clone.add(diff, 'day');\n },\n setYear: function setYear(date, year) {\n var clone = date.clone();\n return clone.year(year);\n },\n setMonth: function setMonth(date, month) {\n var clone = date.clone();\n return clone.month(month);\n },\n setDate: function setDate(date, num) {\n var clone = date.clone();\n return clone.date(num);\n },\n setHour: function setHour(date, hour) {\n var clone = date.clone();\n return clone.hour(hour);\n },\n setMinute: function setMinute(date, minute) {\n var clone = date.clone();\n return clone.minute(minute);\n },\n setSecond: function setSecond(date, second) {\n var clone = date.clone();\n return clone.second(second);\n },\n // Compare\n isAfter: function isAfter(date1, date2) {\n return date1.isAfter(date2);\n },\n isValidate: function isValidate(date) {\n return date.isValid();\n },\n locale: {\n getWeekFirstDay: function getWeekFirstDay(locale) {\n var date = moment().locale(locale);\n return date.localeData().firstDayOfWeek();\n },\n getWeekFirstDate: function getWeekFirstDate(locale, date) {\n var clone = date.clone();\n var result = clone.locale(locale);\n return result.weekday(0);\n },\n getWeek: function getWeek(locale, date) {\n var clone = date.clone();\n var result = clone.locale(locale);\n return result.week();\n },\n getShortWeekDays: function getShortWeekDays(locale) {\n var date = moment().locale(locale);\n return date.localeData().weekdaysMin();\n },\n getShortMonths: function getShortMonths(locale) {\n var date = moment().locale(locale);\n return date.localeData().monthsShort();\n },\n format: function format(locale, date, _format) {\n var clone = date.clone();\n var result = clone.locale(locale);\n return result.format(_format);\n },\n parse: function parse(locale, text, formats) {\n var fallbackFormatList = [];\n for (var i = 0; i < formats.length; i += 1) {\n var format = formats[i];\n var formatText = text;\n if (format.includes('wo') || format.includes('Wo')) {\n format = format.replace(/wo/g, 'w').replace(/Wo/g, 'W');\n var matchFormat = format.match(/[-YyMmDdHhSsWwGg]+/g);\n var matchText = formatText.match(/[-\\d]+/g);\n if (matchFormat && matchText) {\n format = matchFormat.join('');\n formatText = matchText.join('');\n } else {\n fallbackFormatList.push(format.replace(/o/g, ''));\n }\n }\n var date = moment(formatText, format, locale, true);\n if (date.isValid()) {\n return date;\n }\n }\n // Fallback to fuzzy matching, this should always not reach match or need fire a issue\n for (var _i = 0; _i < fallbackFormatList.length; _i += 1) {\n var _date = moment(text, fallbackFormatList[_i], locale, false);\n /* istanbul ignore next */\n if (_date.isValid()) {\n noteOnce(false, 'Not match any format strictly and fallback to fuzzy match. Please help to fire a issue about this.');\n return _date;\n }\n }\n return null;\n }\n }\n};\nexport default generateConfig;","// This icon file is generated automatically.\nvar CalendarOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z\" } }] }, \"name\": \"calendar\", \"theme\": \"outlined\" };\nexport default CalendarOutlined;\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 CalendarOutlinedSvg from \"@ant-design/icons-svg/es/asn/CalendarOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CalendarOutlined = function CalendarOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CalendarOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CalendarOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CalendarOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ClockCircleOutlined = { \"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\": \"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z\" } }] }, \"name\": \"clock-circle\", \"theme\": \"outlined\" };\nexport default ClockCircleOutlined;\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 ClockCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/ClockCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ClockCircleOutlined = function ClockCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ClockCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ClockCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ClockCircleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar SwapRightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z\" } }] }, \"name\": \"swap-right\", \"theme\": \"outlined\" };\nexport default SwapRightOutlined;\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 SwapRightOutlinedSvg from \"@ant-design/icons-svg/es/asn/SwapRightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SwapRightOutlined = function SwapRightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SwapRightOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SwapRightOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SwapRightOutlined';\n}\nexport default RefIcon;","import * as React from 'react';\nvar PanelContext = /*#__PURE__*/React.createContext({});\nexport default PanelContext;","import * as React from 'react';\nimport PanelContext from '../PanelContext';\nvar HIDDEN_STYLE = {\n visibility: 'hidden'\n};\nfunction Header(_ref) {\n var prefixCls = _ref.prefixCls,\n _ref$prevIcon = _ref.prevIcon,\n prevIcon = _ref$prevIcon === void 0 ? \"\\u2039\" : _ref$prevIcon,\n _ref$nextIcon = _ref.nextIcon,\n nextIcon = _ref$nextIcon === void 0 ? \"\\u203A\" : _ref$nextIcon,\n _ref$superPrevIcon = _ref.superPrevIcon,\n superPrevIcon = _ref$superPrevIcon === void 0 ? \"\\xAB\" : _ref$superPrevIcon,\n _ref$superNextIcon = _ref.superNextIcon,\n superNextIcon = _ref$superNextIcon === void 0 ? \"\\xBB\" : _ref$superNextIcon,\n onSuperPrev = _ref.onSuperPrev,\n onSuperNext = _ref.onSuperNext,\n onPrev = _ref.onPrev,\n onNext = _ref.onNext,\n children = _ref.children;\n var _React$useContext = React.useContext(PanelContext),\n hideNextBtn = _React$useContext.hideNextBtn,\n hidePrevBtn = _React$useContext.hidePrevBtn;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: prefixCls\n }, onSuperPrev && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onSuperPrev,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-super-prev-btn\"),\n style: hidePrevBtn ? HIDDEN_STYLE : {}\n }, superPrevIcon), onPrev && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onPrev,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-prev-btn\"),\n style: hidePrevBtn ? HIDDEN_STYLE : {}\n }, prevIcon), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-view\")\n }, children), onNext && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onNext,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-next-btn\"),\n style: hideNextBtn ? HIDDEN_STYLE : {}\n }, nextIcon), onSuperNext && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onSuperNext,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-super-next-btn\"),\n style: hideNextBtn ? HIDDEN_STYLE : {}\n }, superNextIcon));\n}\nexport default Header;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Header from '../Header';\nimport { DECADE_DISTANCE_COUNT } from '.';\nimport PanelContext from '../../PanelContext';\nfunction DecadeHeader(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n viewDate = props.viewDate,\n onPrevDecades = props.onPrevDecades,\n onNextDecades = props.onNextDecades;\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n var yearNumber = generateConfig.getYear(viewDate);\n var startYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT;\n var endYear = startYear + DECADE_DISTANCE_COUNT - 1;\n return /*#__PURE__*/React.createElement(Header, _extends({}, props, {\n prefixCls: headerPrefixCls,\n onSuperPrev: onPrevDecades,\n onSuperNext: onNextDecades\n }), startYear, \"-\", endYear);\n}\nexport default DecadeHeader;","export function setTime(generateConfig, date, hour, minute, second) {\n var nextTime = generateConfig.setHour(date, hour);\n nextTime = generateConfig.setMinute(nextTime, minute);\n nextTime = generateConfig.setSecond(nextTime, second);\n return nextTime;\n}\nexport function setDateTime(generateConfig, date, defaultDate) {\n if (!defaultDate) {\n return date;\n }\n var newDate = date;\n newDate = generateConfig.setHour(newDate, generateConfig.getHour(defaultDate));\n newDate = generateConfig.setMinute(newDate, generateConfig.getMinute(defaultDate));\n newDate = generateConfig.setSecond(newDate, generateConfig.getSecond(defaultDate));\n return newDate;\n}\nexport function getLowerBoundTime(hour, minute, second, hourStep, minuteStep, secondStep) {\n var lowerBoundHour = Math.floor(hour / hourStep) * hourStep;\n if (lowerBoundHour < hour) {\n return [lowerBoundHour, 60 - minuteStep, 60 - secondStep];\n }\n var lowerBoundMinute = Math.floor(minute / minuteStep) * minuteStep;\n if (lowerBoundMinute < minute) {\n return [lowerBoundHour, lowerBoundMinute, 60 - secondStep];\n }\n var lowerBoundSecond = Math.floor(second / secondStep) * secondStep;\n return [lowerBoundHour, lowerBoundMinute, lowerBoundSecond];\n}\nexport function getLastDay(generateConfig, date) {\n var year = generateConfig.getYear(date);\n var month = generateConfig.getMonth(date) + 1;\n var endDate = generateConfig.getEndDate(generateConfig.getFixedDate(\"\".concat(year, \"-\").concat(month, \"-01\")));\n var lastDay = generateConfig.getDate(endDate);\n var monthShow = month < 10 ? \"0\".concat(month) : \"\".concat(month);\n return \"\".concat(year, \"-\").concat(monthShow, \"-\").concat(lastDay);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport PanelContext from '../PanelContext';\nimport { getLastDay } from '../utils/timeUtil';\nimport { getCellDateDisabled } from '../utils/dateUtil';\nexport default function PanelBody(_ref) {\n var prefixCls = _ref.prefixCls,\n disabledDate = _ref.disabledDate,\n onSelect = _ref.onSelect,\n picker = _ref.picker,\n rowNum = _ref.rowNum,\n colNum = _ref.colNum,\n prefixColumn = _ref.prefixColumn,\n rowClassName = _ref.rowClassName,\n baseDate = _ref.baseDate,\n getCellClassName = _ref.getCellClassName,\n getCellText = _ref.getCellText,\n getCellNode = _ref.getCellNode,\n getCellDate = _ref.getCellDate,\n generateConfig = _ref.generateConfig,\n titleCell = _ref.titleCell,\n headerCells = _ref.headerCells;\n var _React$useContext = React.useContext(PanelContext),\n onDateMouseEnter = _React$useContext.onDateMouseEnter,\n onDateMouseLeave = _React$useContext.onDateMouseLeave,\n mode = _React$useContext.mode;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n // =============================== Body ===============================\n var rows = [];\n for (var i = 0; i < rowNum; i += 1) {\n var row = [];\n var rowStartDate = void 0;\n var _loop = function _loop() {\n var _objectSpread2;\n var offset = i * colNum + j;\n var currentDate = getCellDate(baseDate, offset);\n var disabled = getCellDateDisabled({\n cellDate: currentDate,\n mode: mode,\n disabledDate: disabledDate,\n generateConfig: generateConfig\n });\n if (j === 0) {\n rowStartDate = currentDate;\n if (prefixColumn) {\n row.push(prefixColumn(rowStartDate));\n }\n }\n var title = titleCell && titleCell(currentDate);\n row.push( /*#__PURE__*/React.createElement(\"td\", {\n key: j,\n title: title,\n className: classNames(cellPrefixCls, _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, \"\".concat(cellPrefixCls, \"-disabled\"), disabled), _defineProperty(_objectSpread2, \"\".concat(cellPrefixCls, \"-start\"), getCellText(currentDate) === 1 || picker === 'year' && Number(title) % 10 === 0), _defineProperty(_objectSpread2, \"\".concat(cellPrefixCls, \"-end\"), title === getLastDay(generateConfig, currentDate) || picker === 'year' && Number(title) % 10 === 9), _objectSpread2), getCellClassName(currentDate))),\n onClick: function onClick() {\n if (!disabled) {\n onSelect(currentDate);\n }\n },\n onMouseEnter: function onMouseEnter() {\n if (!disabled && onDateMouseEnter) {\n onDateMouseEnter(currentDate);\n }\n },\n onMouseLeave: function onMouseLeave() {\n if (!disabled && onDateMouseLeave) {\n onDateMouseLeave(currentDate);\n }\n }\n }, getCellNode ? getCellNode(currentDate) : /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(cellPrefixCls, \"-inner\")\n }, getCellText(currentDate))));\n };\n for (var j = 0; j < colNum; j += 1) {\n _loop();\n }\n rows.push( /*#__PURE__*/React.createElement(\"tr\", {\n key: i,\n className: rowClassName && rowClassName(rowStartDate)\n }, row));\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\")\n }, /*#__PURE__*/React.createElement(\"table\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, headerCells && /*#__PURE__*/React.createElement(\"thead\", null, /*#__PURE__*/React.createElement(\"tr\", null, headerCells)), /*#__PURE__*/React.createElement(\"tbody\", null, rows)));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport { DECADE_DISTANCE_COUNT, DECADE_UNIT_DIFF } from '.';\nimport PanelBody from '../PanelBody';\nexport var DECADE_COL_COUNT = 3;\nvar DECADE_ROW_COUNT = 4;\nfunction DecadeBody(props) {\n var DECADE_UNIT_DIFF_DES = DECADE_UNIT_DIFF - 1;\n var prefixCls = props.prefixCls,\n viewDate = props.viewDate,\n generateConfig = props.generateConfig;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var yearNumber = generateConfig.getYear(viewDate);\n var decadeYearNumber = Math.floor(yearNumber / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF;\n var startDecadeYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT;\n var endDecadeYear = startDecadeYear + DECADE_DISTANCE_COUNT - 1;\n var baseDecadeYear = generateConfig.setYear(viewDate, startDecadeYear - Math.ceil((DECADE_COL_COUNT * DECADE_ROW_COUNT * DECADE_UNIT_DIFF - DECADE_DISTANCE_COUNT) / 2));\n var getCellClassName = function getCellClassName(date) {\n var _ref;\n var startDecadeNumber = generateConfig.getYear(date);\n var endDecadeNumber = startDecadeNumber + DECADE_UNIT_DIFF_DES;\n return _ref = {}, _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-in-view\"), startDecadeYear <= startDecadeNumber && endDecadeNumber <= endDecadeYear), _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-selected\"), startDecadeNumber === decadeYearNumber), _ref;\n };\n return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n rowNum: DECADE_ROW_COUNT,\n colNum: DECADE_COL_COUNT,\n baseDate: baseDecadeYear,\n getCellText: function getCellText(date) {\n var startDecadeNumber = generateConfig.getYear(date);\n return \"\".concat(startDecadeNumber, \"-\").concat(startDecadeNumber + DECADE_UNIT_DIFF_DES);\n },\n getCellClassName: getCellClassName,\n getCellDate: function getCellDate(date, offset) {\n return generateConfig.addYear(date, offset * DECADE_UNIT_DIFF);\n }\n }));\n}\nexport default DecadeBody;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport raf from \"rc-util/es/raf\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nvar scrollIds = new Map();\n/** Trigger when element is visible in view */\nexport function waitElementReady(element, callback) {\n var id;\n function tryOrNextFrame() {\n if (isVisible(element)) {\n callback();\n } else {\n id = raf(function () {\n tryOrNextFrame();\n });\n }\n }\n tryOrNextFrame();\n return function () {\n raf.cancel(id);\n };\n}\n/* eslint-disable no-param-reassign */\nexport function scrollTo(element, to, duration) {\n if (scrollIds.get(element)) {\n cancelAnimationFrame(scrollIds.get(element));\n }\n // jump to target if duration zero\n if (duration <= 0) {\n scrollIds.set(element, requestAnimationFrame(function () {\n element.scrollTop = to;\n }));\n return;\n }\n var difference = to - element.scrollTop;\n var perTick = difference / duration * 10;\n scrollIds.set(element, requestAnimationFrame(function () {\n element.scrollTop += perTick;\n if (element.scrollTop !== to) {\n scrollTo(element, to, duration - 10);\n }\n }));\n}\nexport function createKeyDownHandler(event, _ref) {\n var onLeftRight = _ref.onLeftRight,\n onCtrlLeftRight = _ref.onCtrlLeftRight,\n onUpDown = _ref.onUpDown,\n onPageUpDown = _ref.onPageUpDown,\n onEnter = _ref.onEnter;\n var which = event.which,\n ctrlKey = event.ctrlKey,\n metaKey = event.metaKey;\n switch (which) {\n case KeyCode.LEFT:\n if (ctrlKey || metaKey) {\n if (onCtrlLeftRight) {\n onCtrlLeftRight(-1);\n return true;\n }\n } else if (onLeftRight) {\n onLeftRight(-1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.RIGHT:\n if (ctrlKey || metaKey) {\n if (onCtrlLeftRight) {\n onCtrlLeftRight(1);\n return true;\n }\n } else if (onLeftRight) {\n onLeftRight(1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.UP:\n if (onUpDown) {\n onUpDown(-1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.DOWN:\n if (onUpDown) {\n onUpDown(1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.PAGE_UP:\n if (onPageUpDown) {\n onPageUpDown(-1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.PAGE_DOWN:\n if (onPageUpDown) {\n onPageUpDown(1);\n return true;\n }\n /* istanbul ignore next */\n break;\n case KeyCode.ENTER:\n if (onEnter) {\n onEnter();\n return true;\n }\n /* istanbul ignore next */\n break;\n }\n return false;\n}\n// ===================== Format =====================\nexport function getDefaultFormat(format, picker, showTime, use12Hours) {\n var mergedFormat = format;\n if (!mergedFormat) {\n switch (picker) {\n case 'time':\n mergedFormat = use12Hours ? 'hh:mm:ss a' : 'HH:mm:ss';\n break;\n case 'week':\n mergedFormat = 'gggg-wo';\n break;\n case 'month':\n mergedFormat = 'YYYY-MM';\n break;\n case 'quarter':\n mergedFormat = 'YYYY-[Q]Q';\n break;\n case 'year':\n mergedFormat = 'YYYY';\n break;\n default:\n mergedFormat = showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';\n }\n }\n return mergedFormat;\n}\nexport function getInputSize(picker, format, generateConfig) {\n var defaultSize = picker === 'time' ? 8 : 10;\n var length = typeof format === 'function' ? format(generateConfig.getNow()).length : format.length;\n return Math.max(defaultSize, length) + 2;\n}\nvar globalClickFunc = null;\nvar clickCallbacks = new Set();\nexport function addGlobalMouseDownEvent(callback) {\n if (!globalClickFunc && typeof window !== 'undefined' && window.addEventListener) {\n globalClickFunc = function globalClickFunc(e) {\n // Clone a new list to avoid repeat trigger events\n _toConsumableArray(clickCallbacks).forEach(function (queueFunc) {\n queueFunc(e);\n });\n };\n window.addEventListener('mousedown', globalClickFunc);\n }\n clickCallbacks.add(callback);\n return function () {\n clickCallbacks.delete(callback);\n if (clickCallbacks.size === 0) {\n window.removeEventListener('mousedown', globalClickFunc);\n globalClickFunc = null;\n }\n };\n}\nexport function getTargetFromEvent(e) {\n var target = e.target;\n // get target if in shadow dom\n if (e.composed && target.shadowRoot) {\n var _e$composedPath;\n return ((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath.call(e)[0]) || target;\n }\n return target;\n}\n// ====================== Mode ======================\nvar getYearNextMode = function getYearNextMode(next) {\n if (next === 'month' || next === 'date') {\n return 'year';\n }\n return next;\n};\nvar getMonthNextMode = function getMonthNextMode(next) {\n if (next === 'date') {\n return 'month';\n }\n return next;\n};\nvar getQuarterNextMode = function getQuarterNextMode(next) {\n if (next === 'month' || next === 'date') {\n return 'quarter';\n }\n return next;\n};\nvar getWeekNextMode = function getWeekNextMode(next) {\n if (next === 'date') {\n return 'week';\n }\n return next;\n};\nexport var PickerModeMap = {\n year: getYearNextMode,\n month: getMonthNextMode,\n quarter: getQuarterNextMode,\n week: getWeekNextMode,\n time: null,\n date: null\n};\nexport function elementsContains(elements, target) {\n return elements.some(function (ele) {\n return ele && ele.contains(target);\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport DecadeHeader from './DecadeHeader';\nimport DecadeBody, { DECADE_COL_COUNT } from './DecadeBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nexport var DECADE_UNIT_DIFF = 10;\nexport var DECADE_DISTANCE_COUNT = DECADE_UNIT_DIFF * 10;\nfunction DecadePanel(props) {\n var prefixCls = props.prefixCls,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n viewDate = props.viewDate,\n operationRef = props.operationRef,\n onSelect = props.onSelect,\n onPanelChange = props.onPanelChange;\n var panelPrefixCls = \"\".concat(prefixCls, \"-decade-panel\");\n // ======================= Keyboard =======================\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n onSelect(generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT), 'key');\n },\n onUpDown: function onUpDown(diff) {\n onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF * DECADE_COL_COUNT), 'key');\n },\n onEnter: function onEnter() {\n onPanelChange('year', viewDate);\n }\n });\n }\n };\n // ==================== View Operation ====================\n var onDecadesChange = function onDecadesChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n var onInternalSelect = function onInternalSelect(date) {\n onSelect(date, 'mouse');\n onPanelChange('year', date);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(DecadeHeader, _extends({}, props, {\n prefixCls: prefixCls,\n onPrevDecades: function onPrevDecades() {\n onDecadesChange(-1);\n },\n onNextDecades: function onNextDecades() {\n onDecadesChange(1);\n }\n })), /*#__PURE__*/React.createElement(DecadeBody, _extends({}, props, {\n prefixCls: prefixCls,\n onSelect: onInternalSelect\n })));\n}\nexport default DecadePanel;","import { DECADE_UNIT_DIFF } from '../panels/DecadePanel/index';\nexport var WEEK_DAY_COUNT = 7;\nexport function isNullEqual(value1, value2) {\n if (!value1 && !value2) {\n return true;\n }\n if (!value1 || !value2) {\n return false;\n }\n return undefined;\n}\nexport function isSameDecade(generateConfig, decade1, decade2) {\n var equal = isNullEqual(decade1, decade2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n var num1 = Math.floor(generateConfig.getYear(decade1) / 10);\n var num2 = Math.floor(generateConfig.getYear(decade2) / 10);\n return num1 === num2;\n}\nexport function isSameYear(generateConfig, year1, year2) {\n var equal = isNullEqual(year1, year2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return generateConfig.getYear(year1) === generateConfig.getYear(year2);\n}\nexport function getQuarter(generateConfig, date) {\n var quota = Math.floor(generateConfig.getMonth(date) / 3);\n return quota + 1;\n}\nexport function isSameQuarter(generateConfig, quarter1, quarter2) {\n var equal = isNullEqual(quarter1, quarter2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return isSameYear(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);\n}\nexport function isSameMonth(generateConfig, month1, month2) {\n var equal = isNullEqual(month1, month2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return isSameYear(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);\n}\nexport function isSameDate(generateConfig, date1, date2) {\n var equal = isNullEqual(date1, date2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return generateConfig.getYear(date1) === generateConfig.getYear(date2) && generateConfig.getMonth(date1) === generateConfig.getMonth(date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);\n}\nexport function isSameTime(generateConfig, time1, time2) {\n var equal = isNullEqual(time1, time2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);\n}\nexport function isSameWeek(generateConfig, locale, date1, date2) {\n var equal = isNullEqual(date1, date2);\n if (typeof equal === 'boolean') {\n return equal;\n }\n return isSameYear(generateConfig, date1, date2) && generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);\n}\nexport function isEqual(generateConfig, value1, value2) {\n return isSameDate(generateConfig, value1, value2) && isSameTime(generateConfig, value1, value2);\n}\n/** Between in date but not equal of date */\nexport function isInRange(generateConfig, startDate, endDate, current) {\n if (!startDate || !endDate || !current) {\n return false;\n }\n return !isSameDate(generateConfig, startDate, current) && !isSameDate(generateConfig, endDate, current) && generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);\n}\nexport function getWeekStartDate(locale, generateConfig, value) {\n var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);\n var monthStartDate = generateConfig.setDate(value, 1);\n var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);\n var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);\n if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) {\n alignStartDate = generateConfig.addDate(alignStartDate, -7);\n }\n return alignStartDate;\n}\nexport function getClosingViewDate(viewDate, picker, generateConfig) {\n var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n switch (picker) {\n case 'year':\n return generateConfig.addYear(viewDate, offset * 10);\n case 'quarter':\n case 'month':\n return generateConfig.addYear(viewDate, offset);\n default:\n return generateConfig.addMonth(viewDate, offset);\n }\n}\nexport function formatValue(value, _ref) {\n var generateConfig = _ref.generateConfig,\n locale = _ref.locale,\n format = _ref.format;\n return typeof format === 'function' ? format(value) : generateConfig.locale.format(locale.locale, value, format);\n}\nexport function parseValue(value, _ref2) {\n var generateConfig = _ref2.generateConfig,\n locale = _ref2.locale,\n formatList = _ref2.formatList;\n if (!value || typeof formatList[0] === 'function') {\n return null;\n }\n return generateConfig.locale.parse(locale.locale, value, formatList);\n}\n// eslint-disable-next-line consistent-return\nexport function getCellDateDisabled(_ref3) {\n var cellDate = _ref3.cellDate,\n mode = _ref3.mode,\n disabledDate = _ref3.disabledDate,\n generateConfig = _ref3.generateConfig;\n if (!disabledDate) return false;\n // Whether cellDate is disabled in range\n var getDisabledFromRange = function getDisabledFromRange(currentMode, start, end) {\n var current = start;\n while (current <= end) {\n var date = void 0;\n switch (currentMode) {\n case 'date':\n {\n date = generateConfig.setDate(cellDate, current);\n if (!disabledDate(date)) {\n return false;\n }\n break;\n }\n case 'month':\n {\n date = generateConfig.setMonth(cellDate, current);\n if (!getCellDateDisabled({\n cellDate: date,\n mode: 'month',\n generateConfig: generateConfig,\n disabledDate: disabledDate\n })) {\n return false;\n }\n break;\n }\n case 'year':\n {\n date = generateConfig.setYear(cellDate, current);\n if (!getCellDateDisabled({\n cellDate: date,\n mode: 'year',\n generateConfig: generateConfig,\n disabledDate: disabledDate\n })) {\n return false;\n }\n break;\n }\n }\n current += 1;\n }\n return true;\n };\n switch (mode) {\n case 'date':\n case 'week':\n {\n return disabledDate(cellDate);\n }\n case 'month':\n {\n var startDate = 1;\n var endDate = generateConfig.getDate(generateConfig.getEndDate(cellDate));\n return getDisabledFromRange('date', startDate, endDate);\n }\n case 'quarter':\n {\n var startMonth = Math.floor(generateConfig.getMonth(cellDate) / 3) * 3;\n var endMonth = startMonth + 2;\n return getDisabledFromRange('month', startMonth, endMonth);\n }\n case 'year':\n {\n return getDisabledFromRange('month', 0, 11);\n }\n case 'decade':\n {\n var year = generateConfig.getYear(cellDate);\n var startYear = Math.floor(year / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF;\n var endYear = startYear + DECADE_UNIT_DIFF - 1;\n return getDisabledFromRange('year', startYear, endYear);\n }\n }\n}","import * as React from 'react';\nimport Header from '../Header';\nimport PanelContext from '../../PanelContext';\nimport { formatValue } from '../../utils/dateUtil';\nfunction TimeHeader(props) {\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n locale = props.locale,\n value = props.value,\n format = props.format;\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n return /*#__PURE__*/React.createElement(Header, {\n prefixCls: headerPrefixCls\n }, value ? formatValue(value, {\n locale: locale,\n format: format,\n generateConfig: generateConfig\n }) : \"\\xA0\");\n}\nexport default TimeHeader;","export function leftPad(str, length) {\n var fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';\n var current = String(str);\n while (current.length < length) {\n current = \"\".concat(fill).concat(str);\n }\n return current;\n}\nexport var tuple = function tuple() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return args;\n};\nexport function toArray(val) {\n if (val === null || val === undefined) {\n return [];\n }\n return Array.isArray(val) ? val : [val];\n}\nexport default function getDataOrAriaProps(props) {\n var retProps = {};\n Object.keys(props).forEach(function (key) {\n if ((key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role' || key === 'name') && key.substr(0, 7) !== 'data-__') {\n retProps[key] = props[key];\n }\n });\n return retProps;\n}\nexport function getValue(values, index) {\n return values ? values[index] : null;\n}\nexport function updateValues(values, value, index) {\n var newValues = [getValue(values, 0), getValue(values, 1)];\n newValues[index] = typeof value === 'function' ? value(newValues[index]) : value;\n if (!newValues[0] && !newValues[1]) {\n return null;\n }\n return newValues;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport { useRef, useLayoutEffect } from 'react';\nimport classNames from 'classnames';\nimport { scrollTo, waitElementReady } from '../../utils/uiUtil';\nimport PanelContext from '../../PanelContext';\nfunction TimeUnitColumn(props) {\n var prefixCls = props.prefixCls,\n units = props.units,\n onSelect = props.onSelect,\n value = props.value,\n active = props.active,\n hideDisabledOptions = props.hideDisabledOptions;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var _React$useContext = React.useContext(PanelContext),\n open = _React$useContext.open;\n var ulRef = useRef(null);\n var liRefs = useRef(new Map());\n var scrollRef = useRef();\n // `useLayoutEffect` here to avoid blink by duration is 0\n useLayoutEffect(function () {\n var li = liRefs.current.get(value);\n if (li && open !== false) {\n scrollTo(ulRef.current, li.offsetTop, 120);\n }\n }, [value]);\n useLayoutEffect(function () {\n if (open) {\n var li = liRefs.current.get(value);\n if (li) {\n scrollRef.current = waitElementReady(li, function () {\n scrollTo(ulRef.current, li.offsetTop, 0);\n });\n }\n }\n return function () {\n var _scrollRef$current;\n (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.call(scrollRef);\n };\n }, [open]);\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: classNames(\"\".concat(prefixCls, \"-column\"), _defineProperty({}, \"\".concat(prefixCls, \"-column-active\"), active)),\n ref: ulRef,\n style: {\n position: 'relative'\n }\n }, units.map(function (unit) {\n var _classNames2;\n if (hideDisabledOptions && unit.disabled) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"li\", {\n key: unit.value,\n ref: function ref(element) {\n liRefs.current.set(unit.value, element);\n },\n className: classNames(cellPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(cellPrefixCls, \"-disabled\"), unit.disabled), _defineProperty(_classNames2, \"\".concat(cellPrefixCls, \"-selected\"), value === unit.value), _classNames2)),\n onClick: function onClick() {\n if (unit.disabled) {\n return;\n }\n onSelect(unit.value);\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(cellPrefixCls, \"-inner\")\n }, unit.label));\n }));\n}\nexport default TimeUnitColumn;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport useMemo from \"rc-util/es/hooks/useMemo\";\nimport * as React from 'react';\nimport useTimeSelection from '../../hooks/useTimeSelection';\nimport { leftPad } from '../../utils/miscUtil';\nimport TimeUnitColumn from './TimeUnitColumn';\nfunction shouldUnitsUpdate(prevUnits, nextUnits) {\n if (prevUnits.length !== nextUnits.length) return true;\n // if any unit's disabled status is different, the units should be re-evaluted\n for (var i = 0; i < prevUnits.length; i += 1) {\n if (prevUnits[i].disabled !== nextUnits[i].disabled) return true;\n }\n return false;\n}\nfunction generateUnits(start, end, step, disabledUnits) {\n var units = [];\n var integerStep = step >= 1 ? step | 0 : 1;\n for (var i = start; i <= end; i += integerStep) {\n units.push({\n label: leftPad(i, 2),\n value: i,\n disabled: (disabledUnits || []).includes(i)\n });\n }\n return units;\n}\nfunction TimeBody(props) {\n var generateConfig = props.generateConfig,\n prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n activeColumnIndex = props.activeColumnIndex,\n value = props.value,\n showHour = props.showHour,\n showMinute = props.showMinute,\n showSecond = props.showSecond,\n use12Hours = props.use12Hours,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep,\n disabledHours = props.disabledHours,\n disabledMinutes = props.disabledMinutes,\n disabledSeconds = props.disabledSeconds,\n disabledTime = props.disabledTime,\n hideDisabledOptions = props.hideDisabledOptions,\n onSelect = props.onSelect;\n // Misc\n var columns = [];\n var contentPrefixCls = \"\".concat(prefixCls, \"-content\");\n var columnPrefixCls = \"\".concat(prefixCls, \"-time-panel\");\n var isPM;\n var originHour = value ? generateConfig.getHour(value) : -1;\n var hour = originHour;\n var minute = value ? generateConfig.getMinute(value) : -1;\n var second = value ? generateConfig.getSecond(value) : -1;\n // Disabled Time\n var now = generateConfig.getNow();\n var _React$useMemo = React.useMemo(function () {\n if (disabledTime) {\n var disabledConfig = disabledTime(now);\n return [disabledConfig.disabledHours, disabledConfig.disabledMinutes, disabledConfig.disabledSeconds];\n }\n return [disabledHours, disabledMinutes, disabledSeconds];\n }, [disabledHours, disabledMinutes, disabledSeconds, disabledTime, now]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 3),\n mergedDisabledHours = _React$useMemo2[0],\n mergedDisabledMinutes = _React$useMemo2[1],\n mergedDisabledSeconds = _React$useMemo2[2];\n // ========================= Unit =========================\n var rawHours = generateUnits(0, 23, hourStep, mergedDisabledHours && mergedDisabledHours());\n var memorizedRawHours = useMemo(function () {\n return rawHours;\n }, rawHours, shouldUnitsUpdate);\n // Should additional logic to handle 12 hours\n if (use12Hours) {\n isPM = hour >= 12; // -1 means should display AM\n hour %= 12;\n }\n var _React$useMemo3 = React.useMemo(function () {\n if (!use12Hours) {\n return [false, false];\n }\n var AMPMDisabled = [true, true];\n memorizedRawHours.forEach(function (_ref) {\n var disabled = _ref.disabled,\n hourValue = _ref.value;\n if (disabled) return;\n if (hourValue >= 12) {\n AMPMDisabled[1] = false;\n } else {\n AMPMDisabled[0] = false;\n }\n });\n return AMPMDisabled;\n }, [use12Hours, memorizedRawHours]),\n _React$useMemo4 = _slicedToArray(_React$useMemo3, 2),\n AMDisabled = _React$useMemo4[0],\n PMDisabled = _React$useMemo4[1];\n var hours = React.useMemo(function () {\n if (!use12Hours) return memorizedRawHours;\n return memorizedRawHours.filter(isPM ? function (hourMeta) {\n return hourMeta.value >= 12;\n } : function (hourMeta) {\n return hourMeta.value < 12;\n }).map(function (hourMeta) {\n var hourValue = hourMeta.value % 12;\n var hourLabel = hourValue === 0 ? '12' : leftPad(hourValue, 2);\n return _objectSpread(_objectSpread({}, hourMeta), {}, {\n label: hourLabel,\n value: hourValue\n });\n });\n }, [use12Hours, isPM, memorizedRawHours]);\n var minutes = generateUnits(0, 59, minuteStep, mergedDisabledMinutes && mergedDisabledMinutes(originHour));\n var seconds = generateUnits(0, 59, secondStep, mergedDisabledSeconds && mergedDisabledSeconds(originHour, minute));\n // Set Time\n var setTime = useTimeSelection({\n value: value,\n generateConfig: generateConfig,\n disabledMinutes: mergedDisabledMinutes,\n disabledSeconds: mergedDisabledSeconds,\n minutes: minutes,\n seconds: seconds,\n use12Hours: use12Hours\n });\n // ====================== Operations ======================\n operationRef.current = {\n onUpDown: function onUpDown(diff) {\n var column = columns[activeColumnIndex];\n if (column) {\n var valueIndex = column.units.findIndex(function (unit) {\n return unit.value === column.value;\n });\n var unitLen = column.units.length;\n for (var i = 1; i < unitLen; i += 1) {\n var nextUnit = column.units[(valueIndex + diff * i + unitLen) % unitLen];\n if (nextUnit.disabled !== true) {\n column.onSelect(nextUnit.value);\n break;\n }\n }\n }\n }\n };\n // ======================== Render ========================\n function addColumnNode(condition, node, columnValue, units, onColumnSelect) {\n if (condition !== false) {\n columns.push({\n node: /*#__PURE__*/React.cloneElement(node, {\n prefixCls: columnPrefixCls,\n value: columnValue,\n active: activeColumnIndex === columns.length,\n onSelect: onColumnSelect,\n units: units,\n hideDisabledOptions: hideDisabledOptions\n }),\n onSelect: onColumnSelect,\n value: columnValue,\n units: units\n });\n }\n }\n // Hour\n addColumnNode(showHour, /*#__PURE__*/React.createElement(TimeUnitColumn, {\n key: \"hour\"\n }), hour, hours, function (num) {\n onSelect(setTime(isPM, num, minute, second), 'mouse');\n });\n // Minute\n addColumnNode(showMinute, /*#__PURE__*/React.createElement(TimeUnitColumn, {\n key: \"minute\"\n }), minute, minutes, function (num) {\n onSelect(setTime(isPM, hour, num, second), 'mouse');\n });\n // Second\n addColumnNode(showSecond, /*#__PURE__*/React.createElement(TimeUnitColumn, {\n key: \"second\"\n }), second, seconds, function (num) {\n onSelect(setTime(isPM, hour, minute, num), 'mouse');\n });\n // 12 Hours\n var PMIndex = -1;\n if (typeof isPM === 'boolean') {\n PMIndex = isPM ? 1 : 0;\n }\n addColumnNode(use12Hours === true, /*#__PURE__*/React.createElement(TimeUnitColumn, {\n key: \"12hours\"\n }), PMIndex, [{\n label: 'AM',\n value: 0,\n disabled: AMDisabled\n }, {\n label: 'PM',\n value: 1,\n disabled: PMDisabled\n }], function (num) {\n onSelect(setTime(!!num, hour, minute, second), 'mouse');\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n className: contentPrefixCls\n }, columns.map(function (_ref2) {\n var node = _ref2.node;\n return node;\n }));\n}\nexport default TimeBody;","import { setTime as utilSetTime } from '../utils/timeUtil';\nexport default function useTimeSelection(_ref) {\n var value = _ref.value,\n generateConfig = _ref.generateConfig,\n disabledMinutes = _ref.disabledMinutes,\n disabledSeconds = _ref.disabledSeconds,\n minutes = _ref.minutes,\n seconds = _ref.seconds,\n use12Hours = _ref.use12Hours;\n var setTime = function setTime(isNewPM, newHour, newMinute, newSecond) {\n var newDate = value || generateConfig.getNow();\n var mergedHour = Math.max(0, newHour);\n var mergedMinute = Math.max(0, newMinute);\n var mergedSecond = Math.max(0, newSecond);\n var newDisabledMinutes = disabledMinutes && disabledMinutes(mergedHour);\n if (newDisabledMinutes === null || newDisabledMinutes === void 0 ? void 0 : newDisabledMinutes.includes(mergedMinute)) {\n // find the first available minute in minutes\n var availableMinute = minutes.find(function (i) {\n return !newDisabledMinutes.includes(i.value);\n });\n if (availableMinute) {\n mergedMinute = availableMinute.value;\n } else {\n return null;\n }\n }\n var newDisabledSeconds = disabledSeconds && disabledSeconds(mergedHour, mergedMinute);\n if (newDisabledSeconds === null || newDisabledSeconds === void 0 ? void 0 : newDisabledSeconds.includes(mergedSecond)) {\n // find the first available second in seconds\n var availableSecond = seconds.find(function (i) {\n return !newDisabledSeconds.includes(i.value);\n });\n if (availableSecond) {\n mergedSecond = availableSecond.value;\n } else {\n return null;\n }\n }\n newDate = utilSetTime(generateConfig, newDate, !use12Hours || !isNewPM ? mergedHour : mergedHour + 12, mergedMinute, mergedSecond);\n return newDate;\n };\n return setTime;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport TimeHeader from './TimeHeader';\nimport TimeBody from './TimeBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nvar countBoolean = function countBoolean(boolList) {\n return boolList.filter(function (bool) {\n return bool !== false;\n }).length;\n};\nfunction TimePanel(props) {\n var generateConfig = props.generateConfig,\n _props$format = props.format,\n format = _props$format === void 0 ? 'HH:mm:ss' : _props$format,\n prefixCls = props.prefixCls,\n active = props.active,\n operationRef = props.operationRef,\n showHour = props.showHour,\n showMinute = props.showMinute,\n showSecond = props.showSecond,\n _props$use12Hours = props.use12Hours,\n use12Hours = _props$use12Hours === void 0 ? false : _props$use12Hours,\n onSelect = props.onSelect,\n value = props.value;\n var panelPrefixCls = \"\".concat(prefixCls, \"-time-panel\");\n var bodyOperationRef = React.useRef();\n // ======================= Keyboard =======================\n var _React$useState = React.useState(-1),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n activeColumnIndex = _React$useState2[0],\n setActiveColumnIndex = _React$useState2[1];\n var columnsCount = countBoolean([showHour, showMinute, showSecond, use12Hours]);\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n setActiveColumnIndex((activeColumnIndex + diff + columnsCount) % columnsCount);\n },\n onUpDown: function onUpDown(diff) {\n if (activeColumnIndex === -1) {\n setActiveColumnIndex(0);\n } else if (bodyOperationRef.current) {\n bodyOperationRef.current.onUpDown(diff);\n }\n },\n onEnter: function onEnter() {\n onSelect(value || generateConfig.getNow(), 'key');\n setActiveColumnIndex(-1);\n }\n });\n },\n onBlur: function onBlur() {\n setActiveColumnIndex(-1);\n }\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(panelPrefixCls, _defineProperty({}, \"\".concat(panelPrefixCls, \"-active\"), active))\n }, /*#__PURE__*/React.createElement(TimeHeader, _extends({}, props, {\n format: format,\n prefixCls: prefixCls\n })), /*#__PURE__*/React.createElement(TimeBody, _extends({}, props, {\n prefixCls: prefixCls,\n activeColumnIndex: activeColumnIndex,\n operationRef: bodyOperationRef\n })));\n}\nexport default TimePanel;","import * as React from 'react';\nvar RangeContext = /*#__PURE__*/React.createContext({});\nexport default RangeContext;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { isInRange } from '../utils/dateUtil';\nimport { getValue } from '../utils/miscUtil';\nexport default function useCellClassName(_ref) {\n var cellPrefixCls = _ref.cellPrefixCls,\n generateConfig = _ref.generateConfig,\n rangedValue = _ref.rangedValue,\n hoverRangedValue = _ref.hoverRangedValue,\n isInView = _ref.isInView,\n isSameCell = _ref.isSameCell,\n offsetCell = _ref.offsetCell,\n today = _ref.today,\n value = _ref.value;\n function getClassName(currentDate) {\n var _ref2;\n var prevDate = offsetCell(currentDate, -1);\n var nextDate = offsetCell(currentDate, 1);\n var rangeStart = getValue(rangedValue, 0);\n var rangeEnd = getValue(rangedValue, 1);\n var hoverStart = getValue(hoverRangedValue, 0);\n var hoverEnd = getValue(hoverRangedValue, 1);\n var isRangeHovered = isInRange(generateConfig, hoverStart, hoverEnd, currentDate);\n function isRangeStart(date) {\n return isSameCell(rangeStart, date);\n }\n function isRangeEnd(date) {\n return isSameCell(rangeEnd, date);\n }\n var isHoverStart = isSameCell(hoverStart, currentDate);\n var isHoverEnd = isSameCell(hoverEnd, currentDate);\n var isHoverEdgeStart = (isRangeHovered || isHoverEnd) && (!isInView(prevDate) || isRangeEnd(prevDate));\n var isHoverEdgeEnd = (isRangeHovered || isHoverStart) && (!isInView(nextDate) || isRangeStart(nextDate));\n return _ref2 = {}, _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-in-view\"), isInView(currentDate)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-in-range\"), isInRange(generateConfig, rangeStart, rangeEnd, currentDate)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-start\"), isRangeStart(currentDate)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-end\"), isRangeEnd(currentDate)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-start-single\"), isRangeStart(currentDate) && !rangeEnd), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-end-single\"), isRangeEnd(currentDate) && !rangeStart), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-start-near-hover\"), isRangeStart(currentDate) && (isSameCell(prevDate, hoverStart) || isInRange(generateConfig, hoverStart, hoverEnd, prevDate))), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-end-near-hover\"), isRangeEnd(currentDate) && (isSameCell(nextDate, hoverEnd) || isInRange(generateConfig, hoverStart, hoverEnd, nextDate))), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover\"), isRangeHovered), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-start\"), isHoverStart), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-end\"), isHoverEnd), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-edge-start\"), isHoverEdgeStart), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-edge-end\"), isHoverEdgeEnd), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-edge-start-near-range\"), isHoverEdgeStart && isSameCell(prevDate, rangeEnd)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-range-hover-edge-end-near-range\"), isHoverEdgeEnd && isSameCell(nextDate, rangeStart)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-today\"), isSameCell(today, currentDate)), _defineProperty(_ref2, \"\".concat(cellPrefixCls, \"-selected\"), isSameCell(value, currentDate)), _ref2;\n }\n return getClassName;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { WEEK_DAY_COUNT, getWeekStartDate, isSameDate, isSameMonth, formatValue } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport PanelBody from '../PanelBody';\nfunction DateBody(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n prefixColumn = props.prefixColumn,\n locale = props.locale,\n rowCount = props.rowCount,\n viewDate = props.viewDate,\n value = props.value,\n dateRender = props.dateRender;\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n var baseDate = getWeekStartDate(locale.locale, generateConfig, viewDate);\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale.locale);\n var today = generateConfig.getNow();\n // ============================== Header ==============================\n var headerCells = [];\n var weekDaysLocale = locale.shortWeekDays || (generateConfig.locale.getShortWeekDays ? generateConfig.locale.getShortWeekDays(locale.locale) : []);\n if (prefixColumn) {\n headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n key: \"empty\",\n \"aria-label\": \"empty cell\"\n }));\n }\n for (var i = 0; i < WEEK_DAY_COUNT; i += 1) {\n headerCells.push( /*#__PURE__*/React.createElement(\"th\", {\n key: i\n }, weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]));\n }\n // =============================== Body ===============================\n var getCellClassName = useCellClassName({\n cellPrefixCls: cellPrefixCls,\n today: today,\n value: value,\n generateConfig: generateConfig,\n rangedValue: prefixColumn ? null : rangedValue,\n hoverRangedValue: prefixColumn ? null : hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameDate(generateConfig, current, target);\n },\n isInView: function isInView(date) {\n return isSameMonth(generateConfig, date, viewDate);\n },\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addDate(date, offset);\n }\n });\n var getCellNode = dateRender ? function (date) {\n return dateRender(date, today);\n } : undefined;\n return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n rowNum: rowCount,\n colNum: WEEK_DAY_COUNT,\n baseDate: baseDate,\n getCellNode: getCellNode,\n getCellText: generateConfig.getDate,\n getCellClassName: getCellClassName,\n getCellDate: generateConfig.addDate,\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY-MM-DD',\n generateConfig: generateConfig\n });\n },\n headerCells: headerCells\n }));\n}\nexport default DateBody;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Header from '../Header';\nimport PanelContext from '../../PanelContext';\nimport { formatValue } from '../../utils/dateUtil';\nfunction DateHeader(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n locale = props.locale,\n viewDate = props.viewDate,\n onNextMonth = props.onNextMonth,\n onPrevMonth = props.onPrevMonth,\n onNextYear = props.onNextYear,\n onPrevYear = props.onPrevYear,\n onYearClick = props.onYearClick,\n onMonthClick = props.onMonthClick;\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);\n var month = generateConfig.getMonth(viewDate);\n // =================== Month & Year ===================\n var yearNode = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: \"year\",\n onClick: onYearClick,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-year-btn\")\n }, formatValue(viewDate, {\n locale: locale,\n format: locale.yearFormat,\n generateConfig: generateConfig\n }));\n var monthNode = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: \"month\",\n onClick: onMonthClick,\n tabIndex: -1,\n className: \"\".concat(prefixCls, \"-month-btn\")\n }, locale.monthFormat ? formatValue(viewDate, {\n locale: locale,\n format: locale.monthFormat,\n generateConfig: generateConfig\n }) : monthsLocale[month]);\n var monthYearNodes = locale.monthBeforeYear ? [monthNode, yearNode] : [yearNode, monthNode];\n return /*#__PURE__*/React.createElement(Header, _extends({}, props, {\n prefixCls: headerPrefixCls,\n onSuperPrev: onPrevYear,\n onPrev: onPrevMonth,\n onNext: onNextMonth,\n onSuperNext: onNextYear\n }), monthYearNodes);\n}\nexport default DateHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport DateBody from './DateBody';\nimport DateHeader from './DateHeader';\nimport { WEEK_DAY_COUNT } from '../../utils/dateUtil';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nvar DATE_ROW_COUNT = 6;\nfunction DatePanel(props) {\n var prefixCls = props.prefixCls,\n _props$panelName = props.panelName,\n panelName = _props$panelName === void 0 ? 'date' : _props$panelName,\n keyboardConfig = props.keyboardConfig,\n active = props.active,\n operationRef = props.operationRef,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n onViewDateChange = props.onViewDateChange,\n onPanelChange = props.onPanelChange,\n _onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-\").concat(panelName, \"-panel\");\n // ======================= Keyboard =======================\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, _objectSpread({\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addDate(value || viewDate, diff), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addDate(value || viewDate, diff * WEEK_DAY_COUNT), 'key');\n },\n onPageUpDown: function onPageUpDown(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n }\n }, keyboardConfig));\n }\n };\n // ==================== View Operation ====================\n var onYearChange = function onYearChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n var onMonthChange = function onMonthChange(diff) {\n var newDate = generateConfig.addMonth(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(panelPrefixCls, _defineProperty({}, \"\".concat(panelPrefixCls, \"-active\"), active))\n }, /*#__PURE__*/React.createElement(DateHeader, _extends({}, props, {\n prefixCls: prefixCls,\n value: value,\n viewDate: viewDate\n // View Operation\n ,\n onPrevYear: function onPrevYear() {\n onYearChange(-1);\n },\n onNextYear: function onNextYear() {\n onYearChange(1);\n },\n onPrevMonth: function onPrevMonth() {\n onMonthChange(-1);\n },\n onNextMonth: function onNextMonth() {\n onMonthChange(1);\n },\n onMonthClick: function onMonthClick() {\n onPanelChange('month', viewDate);\n },\n onYearClick: function onYearClick() {\n onPanelChange('year', viewDate);\n }\n })), /*#__PURE__*/React.createElement(DateBody, _extends({}, props, {\n onSelect: function onSelect(date) {\n return _onSelect(date, 'mouse');\n },\n prefixCls: prefixCls,\n value: value,\n viewDate: viewDate,\n rowCount: DATE_ROW_COUNT\n })));\n}\nexport default DatePanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport DatePanel from '../DatePanel';\nimport TimePanel from '../TimePanel';\nimport { tuple } from '../../utils/miscUtil';\nimport { setDateTime as setTime } from '../../utils/timeUtil';\nvar ACTIVE_PANEL = tuple('date', 'time');\nfunction DatetimePanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n disabledTime = props.disabledTime,\n showTime = props.showTime,\n onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-datetime-panel\");\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n activePanel = _React$useState2[0],\n setActivePanel = _React$useState2[1];\n var dateOperationRef = React.useRef({});\n var timeOperationRef = React.useRef({});\n var timeProps = _typeof(showTime) === 'object' ? _objectSpread({}, showTime) : {};\n // ======================= Keyboard =======================\n function getNextActive(offset) {\n var activeIndex = ACTIVE_PANEL.indexOf(activePanel) + offset;\n var nextActivePanel = ACTIVE_PANEL[activeIndex] || null;\n return nextActivePanel;\n }\n var onBlur = function onBlur(e) {\n if (timeOperationRef.current.onBlur) {\n timeOperationRef.current.onBlur(e);\n }\n setActivePanel(null);\n };\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n // Switch active panel\n if (event.which === KeyCode.TAB) {\n var nextActivePanel = getNextActive(event.shiftKey ? -1 : 1);\n setActivePanel(nextActivePanel);\n if (nextActivePanel) {\n event.preventDefault();\n }\n return true;\n }\n // Operate on current active panel\n if (activePanel) {\n var ref = activePanel === 'date' ? dateOperationRef : timeOperationRef;\n if (ref.current && ref.current.onKeyDown) {\n ref.current.onKeyDown(event);\n }\n return true;\n }\n // Switch first active panel if operate without panel\n if ([KeyCode.LEFT, KeyCode.RIGHT, KeyCode.UP, KeyCode.DOWN].includes(event.which)) {\n setActivePanel('date');\n return true;\n }\n return false;\n },\n onBlur: onBlur,\n onClose: onBlur\n };\n // ======================== Events ========================\n var onInternalSelect = function onInternalSelect(date, source) {\n var selectedDate = date;\n if (source === 'date' && !value && timeProps.defaultValue) {\n // Date with time defaultValue\n selectedDate = generateConfig.setHour(selectedDate, generateConfig.getHour(timeProps.defaultValue));\n selectedDate = generateConfig.setMinute(selectedDate, generateConfig.getMinute(timeProps.defaultValue));\n selectedDate = generateConfig.setSecond(selectedDate, generateConfig.getSecond(timeProps.defaultValue));\n } else if (source === 'time' && !value && defaultValue) {\n selectedDate = generateConfig.setYear(selectedDate, generateConfig.getYear(defaultValue));\n selectedDate = generateConfig.setMonth(selectedDate, generateConfig.getMonth(defaultValue));\n selectedDate = generateConfig.setDate(selectedDate, generateConfig.getDate(defaultValue));\n }\n if (onSelect) {\n onSelect(selectedDate, 'mouse');\n }\n };\n // ======================== Render ========================\n var disabledTimes = disabledTime ? disabledTime(value || null) : {};\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(panelPrefixCls, _defineProperty({}, \"\".concat(panelPrefixCls, \"-active\"), activePanel))\n }, /*#__PURE__*/React.createElement(DatePanel, _extends({}, props, {\n operationRef: dateOperationRef,\n active: activePanel === 'date',\n onSelect: function onSelect(date) {\n onInternalSelect(setTime(generateConfig, date, !value && _typeof(showTime) === 'object' ? showTime.defaultValue : null), 'date');\n }\n })), /*#__PURE__*/React.createElement(TimePanel, _extends({}, props, {\n format: undefined\n }, timeProps, disabledTimes, {\n disabledTime: null,\n defaultValue: undefined,\n operationRef: timeOperationRef,\n active: activePanel === 'time',\n onSelect: function onSelect(date) {\n onInternalSelect(date, 'time');\n }\n })));\n}\nexport default DatetimePanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport DatePanel from '../DatePanel';\nimport { isSameWeek } from '../../utils/dateUtil';\nfunction WeekPanel(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n locale = props.locale,\n value = props.value;\n // Render additional column\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var prefixColumn = function prefixColumn(date) {\n return /*#__PURE__*/React.createElement(\"td\", {\n key: \"week\",\n className: classNames(cellPrefixCls, \"\".concat(cellPrefixCls, \"-week\"))\n }, generateConfig.locale.getWeek(locale.locale, date));\n };\n // Add row className\n var rowPrefixCls = \"\".concat(prefixCls, \"-week-panel-row\");\n var rowClassName = function rowClassName(date) {\n return classNames(rowPrefixCls, _defineProperty({}, \"\".concat(rowPrefixCls, \"-selected\"), isSameWeek(generateConfig, locale.locale, value, date)));\n };\n return /*#__PURE__*/React.createElement(DatePanel, _extends({}, props, {\n panelName: \"week\",\n prefixColumn: prefixColumn,\n rowClassName: rowClassName,\n keyboardConfig: {\n onLeftRight: null\n }\n }));\n}\nexport default WeekPanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Header from '../Header';\nimport PanelContext from '../../PanelContext';\nimport { formatValue } from '../../utils/dateUtil';\nfunction MonthHeader(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n locale = props.locale,\n viewDate = props.viewDate,\n onNextYear = props.onNextYear,\n onPrevYear = props.onPrevYear,\n onYearClick = props.onYearClick;\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n return /*#__PURE__*/React.createElement(Header, _extends({}, props, {\n prefixCls: headerPrefixCls,\n onSuperPrev: onPrevYear,\n onSuperNext: onNextYear\n }), /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onYearClick,\n className: \"\".concat(prefixCls, \"-year-btn\")\n }, formatValue(viewDate, {\n locale: locale,\n format: locale.yearFormat,\n generateConfig: generateConfig\n })));\n}\nexport default MonthHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { formatValue, isSameMonth } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport PanelBody from '../PanelBody';\nexport var MONTH_COL_COUNT = 3;\nvar MONTH_ROW_COUNT = 4;\nfunction MonthBody(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n value = props.value,\n viewDate = props.viewDate,\n generateConfig = props.generateConfig,\n monthCellRender = props.monthCellRender;\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var getCellClassName = useCellClassName({\n cellPrefixCls: cellPrefixCls,\n value: value,\n generateConfig: generateConfig,\n rangedValue: rangedValue,\n hoverRangedValue: hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameMonth(generateConfig, current, target);\n },\n isInView: function isInView() {\n return true;\n },\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addMonth(date, offset);\n }\n });\n var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);\n var baseMonth = generateConfig.setMonth(viewDate, 0);\n var getCellNode = monthCellRender ? function (date) {\n return monthCellRender(date, locale);\n } : undefined;\n return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n rowNum: MONTH_ROW_COUNT,\n colNum: MONTH_COL_COUNT,\n baseDate: baseMonth,\n getCellNode: getCellNode,\n getCellText: function getCellText(date) {\n return locale.monthFormat ? formatValue(date, {\n locale: locale,\n format: locale.monthFormat,\n generateConfig: generateConfig\n }) : monthsLocale[generateConfig.getMonth(date)];\n },\n getCellClassName: getCellClassName,\n getCellDate: generateConfig.addMonth,\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY-MM',\n generateConfig: generateConfig\n });\n }\n }));\n}\nexport default MonthBody;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport MonthHeader from './MonthHeader';\nimport MonthBody, { MONTH_COL_COUNT } from './MonthBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nfunction MonthPanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n onPanelChange = props.onPanelChange,\n _onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\");\n // ======================= Keyboard =======================\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff * MONTH_COL_COUNT), 'key');\n },\n onEnter: function onEnter() {\n onPanelChange('date', value || viewDate);\n }\n });\n }\n };\n // ==================== View Operation ====================\n var onYearChange = function onYearChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(MonthHeader, _extends({}, props, {\n prefixCls: prefixCls,\n onPrevYear: function onPrevYear() {\n onYearChange(-1);\n },\n onNextYear: function onNextYear() {\n onYearChange(1);\n },\n onYearClick: function onYearClick() {\n onPanelChange('year', viewDate);\n }\n })), /*#__PURE__*/React.createElement(MonthBody, _extends({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n onPanelChange('date', date);\n }\n })));\n}\nexport default MonthPanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Header from '../Header';\nimport PanelContext from '../../PanelContext';\nimport { formatValue } from '../../utils/dateUtil';\nfunction QuarterHeader(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n locale = props.locale,\n viewDate = props.viewDate,\n onNextYear = props.onNextYear,\n onPrevYear = props.onPrevYear,\n onYearClick = props.onYearClick;\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n return /*#__PURE__*/React.createElement(Header, _extends({}, props, {\n prefixCls: headerPrefixCls,\n onSuperPrev: onPrevYear,\n onSuperNext: onNextYear\n }), /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onYearClick,\n className: \"\".concat(prefixCls, \"-year-btn\")\n }, formatValue(viewDate, {\n locale: locale,\n format: locale.yearFormat,\n generateConfig: generateConfig\n })));\n}\nexport default QuarterHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { formatValue, isSameQuarter } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport PanelBody from '../PanelBody';\nexport var QUARTER_COL_COUNT = 4;\nvar QUARTER_ROW_COUNT = 1;\nfunction QuarterBody(props) {\n var prefixCls = props.prefixCls,\n locale = props.locale,\n value = props.value,\n viewDate = props.viewDate,\n generateConfig = props.generateConfig;\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var getCellClassName = useCellClassName({\n cellPrefixCls: cellPrefixCls,\n value: value,\n generateConfig: generateConfig,\n rangedValue: rangedValue,\n hoverRangedValue: hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameQuarter(generateConfig, current, target);\n },\n isInView: function isInView() {\n return true;\n },\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n }\n });\n var baseQuarter = generateConfig.setDate(generateConfig.setMonth(viewDate, 0), 1);\n return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n rowNum: QUARTER_ROW_COUNT,\n colNum: QUARTER_COL_COUNT,\n baseDate: baseQuarter,\n getCellText: function getCellText(date) {\n return formatValue(date, {\n locale: locale,\n format: locale.quarterFormat || '[Q]Q',\n generateConfig: generateConfig\n });\n },\n getCellClassName: getCellClassName,\n getCellDate: function getCellDate(date, offset) {\n return generateConfig.addMonth(date, offset * 3);\n },\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY-[Q]Q',\n generateConfig: generateConfig\n });\n }\n }));\n}\nexport default QuarterBody;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport QuarterHeader from './QuarterHeader';\nimport QuarterBody from './QuarterBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nfunction QuarterPanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n onPanelChange = props.onPanelChange,\n _onSelect = props.onSelect;\n var panelPrefixCls = \"\".concat(prefixCls, \"-quarter-panel\");\n // ======================= Keyboard =======================\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addMonth(value || viewDate, diff * 3), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n }\n });\n }\n };\n // ==================== View Operation ====================\n var onYearChange = function onYearChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(QuarterHeader, _extends({}, props, {\n prefixCls: prefixCls,\n onPrevYear: function onPrevYear() {\n onYearChange(-1);\n },\n onNextYear: function onNextYear() {\n onYearChange(1);\n },\n onYearClick: function onYearClick() {\n onPanelChange('year', viewDate);\n }\n })), /*#__PURE__*/React.createElement(QuarterBody, _extends({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n _onSelect(date, 'mouse');\n }\n })));\n}\nexport default QuarterPanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Header from '../Header';\nimport { YEAR_DECADE_COUNT } from '.';\nimport PanelContext from '../../PanelContext';\nfunction YearHeader(props) {\n var prefixCls = props.prefixCls,\n generateConfig = props.generateConfig,\n viewDate = props.viewDate,\n onPrevDecade = props.onPrevDecade,\n onNextDecade = props.onNextDecade,\n onDecadeClick = props.onDecadeClick;\n var _React$useContext = React.useContext(PanelContext),\n hideHeader = _React$useContext.hideHeader;\n if (hideHeader) {\n return null;\n }\n var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n var yearNumber = generateConfig.getYear(viewDate);\n var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT;\n var endYear = startYear + YEAR_DECADE_COUNT - 1;\n return /*#__PURE__*/React.createElement(Header, _extends({}, props, {\n prefixCls: headerPrefixCls,\n onSuperPrev: onPrevDecade,\n onSuperNext: onNextDecade\n }), /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onDecadeClick,\n className: \"\".concat(prefixCls, \"-decade-btn\")\n }, startYear, \"-\", endYear));\n}\nexport default YearHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { YEAR_DECADE_COUNT } from '.';\nimport useCellClassName from '../../hooks/useCellClassName';\nimport { formatValue, isSameYear } from '../../utils/dateUtil';\nimport RangeContext from '../../RangeContext';\nimport PanelBody from '../PanelBody';\nexport var YEAR_COL_COUNT = 3;\nvar YEAR_ROW_COUNT = 4;\nfunction YearBody(props) {\n var prefixCls = props.prefixCls,\n value = props.value,\n viewDate = props.viewDate,\n locale = props.locale,\n generateConfig = props.generateConfig;\n var _React$useContext = React.useContext(RangeContext),\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n var yearPrefixCls = \"\".concat(prefixCls, \"-cell\");\n // =============================== Year ===============================\n var yearNumber = generateConfig.getYear(viewDate);\n var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT;\n var endYear = startYear + YEAR_DECADE_COUNT - 1;\n var baseYear = generateConfig.setYear(viewDate, startYear - Math.ceil((YEAR_COL_COUNT * YEAR_ROW_COUNT - YEAR_DECADE_COUNT) / 2));\n var isInView = function isInView(date) {\n var currentYearNumber = generateConfig.getYear(date);\n return startYear <= currentYearNumber && currentYearNumber <= endYear;\n };\n var getCellClassName = useCellClassName({\n cellPrefixCls: yearPrefixCls,\n value: value,\n generateConfig: generateConfig,\n rangedValue: rangedValue,\n hoverRangedValue: hoverRangedValue,\n isSameCell: function isSameCell(current, target) {\n return isSameYear(generateConfig, current, target);\n },\n isInView: isInView,\n offsetCell: function offsetCell(date, offset) {\n return generateConfig.addYear(date, offset);\n }\n });\n return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n rowNum: YEAR_ROW_COUNT,\n colNum: YEAR_COL_COUNT,\n baseDate: baseYear,\n getCellText: generateConfig.getYear,\n getCellClassName: getCellClassName,\n getCellDate: generateConfig.addYear,\n titleCell: function titleCell(date) {\n return formatValue(date, {\n locale: locale,\n format: 'YYYY',\n generateConfig: generateConfig\n });\n }\n }));\n}\nexport default YearBody;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport YearHeader from './YearHeader';\nimport YearBody, { YEAR_COL_COUNT } from './YearBody';\nimport { createKeyDownHandler } from '../../utils/uiUtil';\nexport var YEAR_DECADE_COUNT = 10;\nfunction YearPanel(props) {\n var prefixCls = props.prefixCls,\n operationRef = props.operationRef,\n onViewDateChange = props.onViewDateChange,\n generateConfig = props.generateConfig,\n value = props.value,\n viewDate = props.viewDate,\n sourceMode = props.sourceMode,\n _onSelect = props.onSelect,\n onPanelChange = props.onPanelChange;\n var panelPrefixCls = \"\".concat(prefixCls, \"-year-panel\");\n // ======================= Keyboard =======================\n operationRef.current = {\n onKeyDown: function onKeyDown(event) {\n return createKeyDownHandler(event, {\n onLeftRight: function onLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n },\n onCtrlLeftRight: function onCtrlLeftRight(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff * YEAR_DECADE_COUNT), 'key');\n },\n onUpDown: function onUpDown(diff) {\n _onSelect(generateConfig.addYear(value || viewDate, diff * YEAR_COL_COUNT), 'key');\n },\n onEnter: function onEnter() {\n onPanelChange(sourceMode === 'date' ? 'date' : 'month', value || viewDate);\n }\n });\n }\n };\n // ==================== View Operation ====================\n var onDecadeChange = function onDecadeChange(diff) {\n var newDate = generateConfig.addYear(viewDate, diff * 10);\n onViewDateChange(newDate);\n onPanelChange(null, newDate);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: panelPrefixCls\n }, /*#__PURE__*/React.createElement(YearHeader, _extends({}, props, {\n prefixCls: prefixCls,\n onPrevDecade: function onPrevDecade() {\n onDecadeChange(-1);\n },\n onNextDecade: function onNextDecade() {\n onDecadeChange(1);\n },\n onDecadeClick: function onDecadeClick() {\n onPanelChange('decade', viewDate);\n }\n })), /*#__PURE__*/React.createElement(YearBody, _extends({}, props, {\n prefixCls: prefixCls,\n onSelect: function onSelect(date) {\n onPanelChange(sourceMode === 'date' ? 'date' : 'month', date);\n _onSelect(date, 'mouse');\n }\n })));\n}\nexport default YearPanel;","import * as React from 'react';\nexport default function getExtraFooter(prefixCls, mode, renderExtraFooter) {\n if (!renderExtraFooter) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\")\n }, renderExtraFooter(mode));\n}","import * as React from 'react';\nexport default function getRanges(_ref) {\n var prefixCls = _ref.prefixCls,\n _ref$rangeList = _ref.rangeList,\n rangeList = _ref$rangeList === void 0 ? [] : _ref$rangeList,\n _ref$components = _ref.components,\n components = _ref$components === void 0 ? {} : _ref$components,\n needConfirmButton = _ref.needConfirmButton,\n onNow = _ref.onNow,\n onOk = _ref.onOk,\n okDisabled = _ref.okDisabled,\n showNow = _ref.showNow,\n locale = _ref.locale;\n var presetNode;\n var okNode;\n if (rangeList.length) {\n var Item = components.rangeItem || 'span';\n presetNode = /*#__PURE__*/React.createElement(React.Fragment, null, rangeList.map(function (_ref2) {\n var label = _ref2.label,\n onClick = _ref2.onClick,\n onMouseEnter = _ref2.onMouseEnter,\n onMouseLeave = _ref2.onMouseLeave;\n return /*#__PURE__*/React.createElement(\"li\", {\n key: label,\n className: \"\".concat(prefixCls, \"-preset\")\n }, /*#__PURE__*/React.createElement(Item, {\n onClick: onClick,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, label));\n }));\n }\n if (needConfirmButton) {\n var Button = components.button || 'button';\n if (onNow && !presetNode && showNow !== false) {\n presetNode = /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-now\")\n }, /*#__PURE__*/React.createElement(\"a\", {\n className: \"\".concat(prefixCls, \"-now-btn\"),\n onClick: onNow\n }, locale.now));\n }\n okNode = needConfirmButton && /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-ok\")\n }, /*#__PURE__*/React.createElement(Button, {\n disabled: okDisabled,\n onClick: onOk\n }, locale.ok));\n }\n if (!presetNode && !okNode) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-ranges\")\n }, presetNode, okNode);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n/**\n * Logic:\n * When `mode` === `picker`,\n * click will trigger `onSelect` (if value changed trigger `onChange` also).\n * Panel change will not trigger `onSelect` but trigger `onPanelChange`\n */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport warning from \"rc-util/es/warning\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport TimePanel from './panels/TimePanel';\nimport DatetimePanel from './panels/DatetimePanel';\nimport DatePanel from './panels/DatePanel';\nimport WeekPanel from './panels/WeekPanel';\nimport MonthPanel from './panels/MonthPanel';\nimport QuarterPanel from './panels/QuarterPanel';\nimport YearPanel from './panels/YearPanel';\nimport DecadePanel from './panels/DecadePanel';\nimport { WEEK_DAY_COUNT, isEqual } from './utils/dateUtil';\nimport PanelContext from './PanelContext';\nimport { PickerModeMap } from './utils/uiUtil';\nimport { MONTH_COL_COUNT } from './panels/MonthPanel/MonthBody';\nimport RangeContext from './RangeContext';\nimport getExtraFooter from './utils/getExtraFooter';\nimport getRanges from './utils/getRanges';\nimport { getLowerBoundTime, setDateTime, setTime } from './utils/timeUtil';\n// Calendar picker type\nvar CALENDAR_PANEL_MODE = ['date', 'month'];\nfunction PickerPanel(props) {\n var _classNames;\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n if (process.env.NODE_ENV !== 'production') {\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n warning(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n warning(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n warning(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n warning(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n }\n // ============================ State =============================\n var panelContext = React.useContext(PanelContext);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n var _React$useContext = React.useContext(RangeContext),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n var panelRef = React.useRef({});\n // Handle init logic\n var initRef = React.useRef(true);\n // Value\n var _useMergedState = useMergedState(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n return val;\n }\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1];\n // View date control\n var _useMergedState3 = useMergedState(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n var now = generateConfig.getNow();\n if (!date) {\n return now;\n }\n // When value is null and set showTime\n if (!mergedValue && showTime) {\n var defaultDateObject = _typeof(showTime) === 'object' ? showTime.defaultValue : defaultValue;\n return setDateTime(generateConfig, Array.isArray(date) ? date[0] : date, defaultDateObject || now);\n }\n return Array.isArray(date) ? date[0] : date;\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n };\n // Panel control\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = PickerModeMap[picker];\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n return nextMode;\n };\n // Save panel is changed from which panel\n var _useMergedState5 = useMergedState(function () {\n if (picker === 'time') {\n return 'time';\n }\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n React.useEffect(function () {\n setInnerMode(picker);\n }, [picker]);\n var _React$useState = React.useState(function () {\n return mergedMode;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n if (onPanelChange && (mergedMode !== nextMode || isEqual(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n if (onSelect) {\n onSelect(date);\n }\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n if (onChange && !isEqual(generateConfig, date, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date))) {\n onChange(date);\n }\n }\n };\n var isSelectable = function isSelectable(key) {\n if (CALENDAR_PANEL_MODE.includes(mergedMode)) {\n var date;\n var operationFnc;\n var isDateMode = mergedMode === 'date';\n if (key === KeyCode.PAGE_UP || key === KeyCode.PAGE_DOWN) {\n operationFnc = isDateMode ? generateConfig.addMonth : generateConfig.addYear;\n } else {\n operationFnc = isDateMode ? generateConfig.addDate : generateConfig.addMonth;\n }\n switch (key) {\n case KeyCode.LEFT:\n case KeyCode.PAGE_UP:\n date = operationFnc(viewDate, -1);\n break;\n case KeyCode.RIGHT:\n case KeyCode.PAGE_DOWN:\n date = operationFnc(viewDate, 1);\n break;\n case KeyCode.UP:\n case KeyCode.DOWN:\n date = operationFnc(viewDate, Number(\"\".concat(key === KeyCode.UP ? '-' : '').concat(isDateMode ? WEEK_DAY_COUNT : MONTH_COL_COUNT)));\n break;\n }\n if (date) {\n return !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date));\n }\n }\n return true;\n };\n // ========================= Interactive ==========================\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n var selectable = true;\n var which = e.which;\n if ([KeyCode.LEFT, KeyCode.RIGHT, KeyCode.UP, KeyCode.DOWN, KeyCode.PAGE_UP, KeyCode.PAGE_DOWN, KeyCode.ENTER].includes(which)) {\n e.preventDefault();\n if (which !== KeyCode.ENTER && tabIndex === 0) {\n selectable = isSelectable(which);\n }\n }\n // Cannot use keyboard to select disabled date\n if (selectable) {\n return panelRef.current.onKeyDown(e);\n }\n }\n /* istanbul ignore next */\n /* eslint-disable no-lone-blocks */\n {\n warning(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n }\n // ============================ Effect ============================\n React.useEffect(function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n React.useEffect(function () {\n initRef.current = false;\n }, []);\n // ============================ Panels ============================\n var panelNode;\n var pickerProps = _objectSpread(_objectSpread({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: disabledDate\n });\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n switch (mergedMode) {\n case 'decade':\n panelNode = /*#__PURE__*/React.createElement(DecadePanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n case 'year':\n panelNode = /*#__PURE__*/React.createElement(YearPanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n case 'month':\n panelNode = /*#__PURE__*/React.createElement(MonthPanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n case 'quarter':\n panelNode = /*#__PURE__*/React.createElement(QuarterPanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n case 'week':\n panelNode = /*#__PURE__*/React.createElement(WeekPanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n case 'time':\n delete pickerProps.showTime;\n panelNode = /*#__PURE__*/React.createElement(TimePanel, _extends({}, pickerProps, _typeof(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n default:\n if (showTime) {\n panelNode = /*#__PURE__*/React.createElement(DatetimePanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = /*#__PURE__*/React.createElement(DatePanel, _extends({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n }\n // ============================ Footer ============================\n var extraFooter;\n var rangesNode;\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = getLowerBoundTime(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = setTime(generateConfig, now, lowerBoundTime[0],\n // hour\n lowerBoundTime[1],\n // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n if (!hideRanges) {\n extraFooter = getExtraFooter(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = getRanges({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n var todayNode;\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = /*#__PURE__*/React.createElement(\"a\", {\n className: classNames(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: _objectSpread(_objectSpread({}, panelContext), {}, {\n mode: mergedMode,\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, /*#__PURE__*/React.createElement(\"div\", {\n tabIndex: tabIndex,\n className: classNames(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), _defineProperty(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}\nexport default PickerPanel;\n/* eslint-enable */","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Trigger from 'rc-trigger';\nvar BUILT_IN_PLACEMENTS = {\n bottomLeft: {\n points: ['tl', 'bl'],\n offset: [0, 4],\n overflow: {\n adjustX: 1,\n adjustY: 1\n }\n },\n bottomRight: {\n points: ['tr', 'br'],\n offset: [0, 4],\n overflow: {\n adjustX: 1,\n adjustY: 1\n }\n },\n topLeft: {\n points: ['bl', 'tl'],\n offset: [0, -4],\n overflow: {\n adjustX: 0,\n adjustY: 1\n }\n },\n topRight: {\n points: ['br', 'tr'],\n offset: [0, -4],\n overflow: {\n adjustX: 0,\n adjustY: 1\n }\n }\n};\nfunction PickerTrigger(_ref) {\n var _classNames;\n var prefixCls = _ref.prefixCls,\n popupElement = _ref.popupElement,\n popupStyle = _ref.popupStyle,\n visible = _ref.visible,\n dropdownClassName = _ref.dropdownClassName,\n dropdownAlign = _ref.dropdownAlign,\n transitionName = _ref.transitionName,\n getPopupContainer = _ref.getPopupContainer,\n children = _ref.children,\n range = _ref.range,\n popupPlacement = _ref.popupPlacement,\n direction = _ref.direction;\n var dropdownPrefixCls = \"\".concat(prefixCls, \"-dropdown\");\n var getPopupPlacement = function getPopupPlacement() {\n if (popupPlacement !== undefined) {\n return popupPlacement;\n }\n return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n };\n return /*#__PURE__*/React.createElement(Trigger, {\n showAction: [],\n hideAction: [],\n popupPlacement: getPopupPlacement(),\n builtinPlacements: BUILT_IN_PLACEMENTS,\n prefixCls: dropdownPrefixCls,\n popupTransitionName: transitionName,\n popup: popupElement,\n popupAlign: dropdownAlign,\n popupVisible: visible,\n popupClassName: classNames(dropdownClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(dropdownPrefixCls, \"-range\"), range), _defineProperty(_classNames, \"\".concat(dropdownPrefixCls, \"-rtl\"), direction === 'rtl'), _classNames)),\n popupStyle: popupStyle,\n getPopupContainer: getPopupContainer\n }, children);\n}\nexport default PickerTrigger;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useState, useEffect, useRef } from 'react';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { addGlobalMouseDownEvent, getTargetFromEvent } from '../utils/uiUtil';\nexport default function usePickerInput(_ref) {\n var open = _ref.open,\n value = _ref.value,\n isClickOutside = _ref.isClickOutside,\n triggerOpen = _ref.triggerOpen,\n forwardKeyDown = _ref.forwardKeyDown,\n _onKeyDown = _ref.onKeyDown,\n blurToCancel = _ref.blurToCancel,\n onSubmit = _ref.onSubmit,\n onCancel = _ref.onCancel,\n _onFocus = _ref.onFocus,\n _onBlur = _ref.onBlur,\n currentFocusedKey = _ref.currentFocusedKey,\n _ref$key = _ref.key,\n key = _ref$key === void 0 ? 'start' : _ref$key;\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n typing = _useState2[0],\n setTyping = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n focused = _useState4[0],\n setFocused = _useState4[1];\n var delayBlurTimer = useRef();\n /**\n * We will prevent blur to handle open event when user click outside,\n * since this will repeat trigger `onOpenChange` event.\n */\n var preventBlurRef = useRef(false);\n var valueChangedRef = useRef(false);\n var preventDefaultRef = useRef(false);\n var inputProps = {\n onMouseDown: function onMouseDown() {\n setTyping(true);\n triggerOpen(true);\n },\n onKeyDown: function onKeyDown(e) {\n var preventDefault = function preventDefault() {\n preventDefaultRef.current = true;\n };\n _onKeyDown(e, preventDefault);\n if (preventDefaultRef.current) return;\n switch (e.which) {\n case KeyCode.ENTER:\n {\n if (!open) {\n triggerOpen(true);\n } else if (onSubmit() !== false) {\n setTyping(true);\n }\n e.preventDefault();\n return;\n }\n case KeyCode.TAB:\n {\n if (typing && open && !e.shiftKey) {\n setTyping(false);\n e.preventDefault();\n } else if (!typing && open) {\n if (!forwardKeyDown(e) && e.shiftKey) {\n setTyping(true);\n e.preventDefault();\n }\n }\n return;\n }\n case KeyCode.ESC:\n {\n setTyping(true);\n onCancel();\n return;\n }\n }\n if (!open && ![KeyCode.SHIFT].includes(e.which)) {\n triggerOpen(true);\n } else if (!typing) {\n // Let popup panel handle keyboard\n forwardKeyDown(e);\n }\n },\n onFocus: function onFocus(e) {\n setTyping(true);\n setFocused(true);\n if (currentFocusedKey) {\n currentFocusedKey.current = key;\n }\n clearTimeout(delayBlurTimer.current);\n if (_onFocus) {\n _onFocus(e);\n }\n },\n onBlur: function onBlur(e) {\n if (preventBlurRef.current || !isClickOutside(document.activeElement)) {\n preventBlurRef.current = false;\n return;\n }\n if (blurToCancel) {\n setTimeout(function () {\n var _document = document,\n activeElement = _document.activeElement;\n while (activeElement && activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n if (isClickOutside(activeElement)) {\n onCancel();\n }\n }, 0);\n } else if (open) {\n triggerOpen(false);\n if (valueChangedRef.current) {\n onSubmit();\n }\n }\n setFocused(false);\n if (currentFocusedKey) {\n currentFocusedKey.current = '';\n // Delay to prevent 'range' focus transitions from firing resulting in incorrect out-of-focus events\n delayBlurTimer.current = setTimeout(function () {\n // Prevent the 'blur' event from firing when there is currently a focused input\n if (currentFocusedKey.current) {\n return;\n }\n _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e);\n }, 100);\n } else {\n _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e);\n }\n }\n };\n // check if value changed\n useEffect(function () {\n valueChangedRef.current = false;\n }, [open]);\n useEffect(function () {\n valueChangedRef.current = true;\n }, [value]);\n // Global click handler\n useEffect(function () {\n return addGlobalMouseDownEvent(function (e) {\n var target = getTargetFromEvent(e);\n var clickedOutside = isClickOutside(target);\n if (open) {\n if (!clickedOutside) {\n preventBlurRef.current = true;\n // Always set back in case `onBlur` prevented by user\n requestAnimationFrame(function () {\n preventBlurRef.current = false;\n });\n } else if (!focused || clickedOutside) {\n triggerOpen(false);\n }\n } else if (focused && !clickedOutside) {\n preventBlurRef.current = true;\n }\n });\n });\n useEffect(function () {\n return function () {\n return clearTimeout(delayBlurTimer.current);\n };\n }, []);\n return [inputProps, {\n focused: focused,\n typing: typing\n }];\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function useTextValueMapping(_ref) {\n var valueTexts = _ref.valueTexts,\n onTextChange = _ref.onTextChange;\n var _React$useState = React.useState(''),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n text = _React$useState2[0],\n setInnerText = _React$useState2[1];\n var valueTextsRef = React.useRef([]);\n valueTextsRef.current = valueTexts;\n function triggerTextChange(value) {\n setInnerText(value);\n onTextChange(value);\n }\n function resetText() {\n setInnerText(valueTextsRef.current[0]);\n }\n React.useEffect(function () {\n if (valueTexts.every(function (valText) {\n return valText !== text;\n })) {\n resetText();\n }\n }, [valueTexts.join('||')]);\n return [text, triggerTextChange, resetText];\n}","import useMemo from \"rc-util/es/hooks/useMemo\";\nimport shallowEqual from \"rc-util/es/isEqual\";\nimport { formatValue, isEqual } from '../utils/dateUtil';\nexport default function useValueTexts(value, _ref) {\n var formatList = _ref.formatList,\n generateConfig = _ref.generateConfig,\n locale = _ref.locale;\n return useMemo(function () {\n if (!value) {\n return [[''], ''];\n }\n // We will convert data format back to first format\n var firstValueText = '';\n var fullValueTexts = [];\n for (var i = 0; i < formatList.length; i += 1) {\n var format = formatList[i];\n var formatStr = formatValue(value, {\n generateConfig: generateConfig,\n locale: locale,\n format: format\n });\n fullValueTexts.push(formatStr);\n if (i === 0) {\n firstValueText = formatStr;\n }\n }\n return [fullValueTexts, firstValueText];\n }, [value, formatList, locale], function (prev, next) {\n return (\n // Not Same Date\n !isEqual(generateConfig, prev[0], next[0]) ||\n // Not Same format\n !shallowEqual(prev[1], next[1], true) ||\n // Not Same locale\n !shallowEqual(prev[2], next[2], true)\n );\n });\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useState, useEffect, useRef } from 'react';\nimport useValueTexts from './useValueTexts';\nexport default function useHoverValue(valueText, _ref) {\n var formatList = _ref.formatList,\n generateConfig = _ref.generateConfig,\n locale = _ref.locale;\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n value = _useState2[0],\n internalSetValue = _useState2[1];\n var raf = useRef(null);\n function setValue(val) {\n var immediately = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n cancelAnimationFrame(raf.current);\n if (immediately) {\n internalSetValue(val);\n return;\n }\n raf.current = requestAnimationFrame(function () {\n internalSetValue(val);\n });\n }\n var _useValueTexts = useValueTexts(value, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = _slicedToArray(_useValueTexts, 2),\n firstText = _useValueTexts2[1];\n function onEnter(date) {\n setValue(date);\n }\n function onLeave() {\n var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n setValue(null, immediately);\n }\n useEffect(function () {\n onLeave(true);\n }, [valueText]);\n useEffect(function () {\n return function () {\n return cancelAnimationFrame(raf.current);\n };\n }, []);\n return [firstText, onEnter, onLeave];\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 _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\n/**\n * Removed:\n * - getCalendarContainer: use `getPopupContainer` instead\n * - onOk\n *\n * New Feature:\n * - picker\n * - allowEmpty\n * - selectable\n *\n * Tips: Should add faq about `datetime` mode with `defaultValue`\n */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport PickerPanel from './PickerPanel';\nimport PickerTrigger from './PickerTrigger';\nimport { formatValue, isEqual, parseValue } from './utils/dateUtil';\nimport getDataOrAriaProps, { toArray } from './utils/miscUtil';\nimport PanelContext from './PanelContext';\nimport { getDefaultFormat, getInputSize, elementsContains } from './utils/uiUtil';\nimport usePickerInput from './hooks/usePickerInput';\nimport useTextValueMapping from './hooks/useTextValueMapping';\nimport useValueTexts from './hooks/useValueTexts';\nimport useHoverValue from './hooks/useHoverValue';\nimport { legacyPropsWarning } from './utils/warnUtil';\nfunction InnerPicker(props) {\n var _classNames2;\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n _onKeyDown = props.onKeyDown,\n _onSelect = props.onSelect,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete,\n inputRender = props.inputRender;\n var inputRef = React.useRef(null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n // ============================ Warning ============================\n if (process.env.NODE_ENV !== 'production') {\n legacyPropsWarning(props);\n }\n // ============================= State =============================\n var formatList = toArray(getDefaultFormat(format, picker, showTime, use12Hours));\n // Panel ref\n var panelDivRef = React.useRef(null);\n var inputDivRef = React.useRef(null);\n var containerRef = React.useRef(null);\n // Real value\n var _useMergedState = useMergedState(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1];\n // Selected value\n var _React$useState = React.useState(mergedValue),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1];\n // Operation ref\n var operationRef = React.useRef(null);\n // Open\n var _useMergedState3 = useMergedState(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1];\n // ============================= Text ==============================\n var _useValueTexts = useValueTexts(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = _slicedToArray(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n var _useTextValueMapping = useTextValueMapping({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = parseValue(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = _slicedToArray(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2];\n // ============================ Trigger ============================\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n if (onChange && !isEqual(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? formatValue(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n triggerInnerOpen(newOpen);\n };\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n /* eslint-disable no-lone-blocks */\n {\n warning(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n var onInternalClick = function onInternalClick() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n onClick === null || onClick === void 0 ? void 0 : onClick.apply(void 0, args);\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n };\n // ============================= Input =============================\n var _usePickerInput = usePickerInput({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !elementsContains([panelDivRef.current, inputDivRef.current, containerRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (\n // When user typing disabledDate with keyboard and enter, this value will be empty\n !selectedValue ||\n // Normal disabled check\n disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = _slicedToArray(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing;\n // ============================= Sync ==============================\n // Close should sync back with text value\n React.useEffect(function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]);\n // Change picker should sync back with text value\n React.useEffect(function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]);\n // Sync innerValue with control mode\n React.useEffect(function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]);\n // ============================ Private ============================\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n }\n var _useHoverValue = useHoverValue(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = _slicedToArray(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2];\n // ============================= Panel =============================\n var panelProps = _objectSpread(_objectSpread({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n var panelNode = /*#__PURE__*/React.createElement(PickerPanel, _extends({}, panelProps, {\n generateConfig: generateConfig,\n className: classNames(_defineProperty({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onSelect: function onSelect(date) {\n _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date);\n setSelectedValue(date);\n },\n direction: direction,\n onPanelChange: function onPanelChange(viewDate, mode) {\n var onPanelChange = props.onPanelChange;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }));\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n var panel = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n var clearNode;\n if (allowClear && mergedValue && !disabled) {\n clearNode = /*#__PURE__*/React.createElement(\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\"),\n role: \"button\"\n }, clearIcon || /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n }\n var mergedInputProps = _objectSpread(_objectSpread(_objectSpread({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps), {}, {\n size: getInputSize(picker, formatList[0], generateConfig)\n }, getDataOrAriaProps(props)), {}, {\n autoComplete: autoComplete\n });\n var inputNode = inputRender ? inputRender(mergedInputProps) : /*#__PURE__*/React.createElement(\"input\", mergedInputProps);\n // ============================ Warning ============================\n if (process.env.NODE_ENV !== 'production') {\n warning(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n }\n // ============================ Return =============================\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, /*#__PURE__*/React.createElement(PickerTrigger, {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: containerRef,\n className: classNames(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onInternalClick\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-input\"), _defineProperty({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, inputNode, suffixNode, clearNode))));\n}\n// Wrap with class component to enable pass generic with instance method\nvar Picker = /*#__PURE__*/function (_React$Component) {\n _inherits(Picker, _React$Component);\n var _super = _createSuper(Picker);\n function Picker() {\n var _this;\n _classCallCheck(this, Picker);\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.pickerRef = /*#__PURE__*/React.createRef();\n _this.focus = function () {\n if (_this.pickerRef.current) {\n _this.pickerRef.current.focus();\n }\n };\n _this.blur = function () {\n if (_this.pickerRef.current) {\n _this.pickerRef.current.blur();\n }\n };\n return _this;\n }\n _createClass(Picker, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(InnerPicker, _extends({}, this.props, {\n pickerRef: this.pickerRef\n }));\n }\n }]);\n return Picker;\n}(React.Component);\nexport default Picker;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { getValue, updateValues } from '../utils/miscUtil';\nimport { getClosingViewDate, isSameYear, isSameMonth, isSameDecade } from '../utils/dateUtil';\nfunction getStartEndDistance(startDate, endDate, picker, generateConfig) {\n var startNext = getClosingViewDate(startDate, picker, generateConfig, 1);\n function getDistance(compareFunc) {\n if (compareFunc(startDate, endDate)) {\n return 'same';\n }\n if (compareFunc(startNext, endDate)) {\n return 'closing';\n }\n return 'far';\n }\n switch (picker) {\n case 'year':\n return getDistance(function (start, end) {\n return isSameDecade(generateConfig, start, end);\n });\n case 'quarter':\n case 'month':\n return getDistance(function (start, end) {\n return isSameYear(generateConfig, start, end);\n });\n default:\n return getDistance(function (start, end) {\n return isSameMonth(generateConfig, start, end);\n });\n }\n}\nfunction getRangeViewDate(values, index, picker, generateConfig) {\n var startDate = getValue(values, 0);\n var endDate = getValue(values, 1);\n if (index === 0) {\n return startDate;\n }\n if (startDate && endDate) {\n var distance = getStartEndDistance(startDate, endDate, picker, generateConfig);\n switch (distance) {\n case 'same':\n return startDate;\n case 'closing':\n return startDate;\n default:\n return getClosingViewDate(endDate, picker, generateConfig, -1);\n }\n }\n return startDate;\n}\nexport default function useRangeViewDates(_ref) {\n var values = _ref.values,\n picker = _ref.picker,\n defaultDates = _ref.defaultDates,\n generateConfig = _ref.generateConfig;\n var _React$useState = React.useState(function () {\n return [getValue(defaultDates, 0), getValue(defaultDates, 1)];\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n defaultViewDates = _React$useState2[0],\n setDefaultViewDates = _React$useState2[1];\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n viewDates = _React$useState4[0],\n setInternalViewDates = _React$useState4[1];\n var startDate = getValue(values, 0);\n var endDate = getValue(values, 1);\n function getViewDate(index) {\n // If set default view date, use it\n if (defaultViewDates[index]) {\n return defaultViewDates[index];\n }\n return getValue(viewDates, index) || getRangeViewDate(values, index, picker, generateConfig) || startDate || endDate || generateConfig.getNow();\n }\n function setViewDate(viewDate, index) {\n if (viewDate) {\n var newViewDates = updateValues(viewDates, viewDate, index);\n // Set view date will clean up default one\n setDefaultViewDates(\n // Should always be an array\n updateValues(defaultViewDates, null, index) || [null, null]);\n // Reset another one when not have value\n var anotherIndex = (index + 1) % 2;\n if (!getValue(values, anotherIndex)) {\n newViewDates = updateValues(newViewDates, viewDate, anotherIndex);\n }\n setInternalViewDates(newViewDates);\n } else if (startDate || endDate) {\n // Reset all when has values when `viewDate` is `null` which means from open trigger\n setInternalViewDates(null);\n }\n }\n return [getViewDate, setViewDate];\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 _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport PickerTrigger from './PickerTrigger';\nimport PickerPanel from './PickerPanel';\nimport usePickerInput from './hooks/usePickerInput';\nimport getDataOrAriaProps, { toArray, getValue, updateValues } from './utils/miscUtil';\nimport { getDefaultFormat, getInputSize, elementsContains } from './utils/uiUtil';\nimport PanelContext from './PanelContext';\nimport { isEqual, getClosingViewDate, isSameDate, isSameWeek, isSameQuarter, formatValue, parseValue } from './utils/dateUtil';\nimport useValueTexts from './hooks/useValueTexts';\nimport useTextValueMapping from './hooks/useTextValueMapping';\nimport RangeContext from './RangeContext';\nimport useRangeDisabled from './hooks/useRangeDisabled';\nimport getExtraFooter from './utils/getExtraFooter';\nimport getRanges from './utils/getRanges';\nimport useRangeViewDates from './hooks/useRangeViewDates';\nimport useHoverValue from './hooks/useHoverValue';\nimport { legacyPropsWarning } from './utils/warnUtil';\nfunction reorderValues(values, generateConfig) {\n if (values && values[0] && values[1] && generateConfig.isAfter(values[0], values[1])) {\n return [values[1], values[0]];\n }\n return values;\n}\nfunction canValueTrigger(value, index, disabled, allowEmpty) {\n if (value) {\n return true;\n }\n if (allowEmpty && allowEmpty[index]) {\n return true;\n }\n if (disabled[(index + 1) % 2]) {\n return true;\n }\n return false;\n}\nfunction InnerRangePicker(props) {\n var _classNames2, _classNames3, _classNames4;\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n style = props.style,\n className = props.className,\n popupStyle = props.popupStyle,\n dropdownClassName = props.dropdownClassName,\n transitionName = props.transitionName,\n dropdownAlign = props.dropdownAlign,\n getPopupContainer = props.getPopupContainer,\n generateConfig = props.generateConfig,\n locale = props.locale,\n placeholder = props.placeholder,\n autoFocus = props.autoFocus,\n disabled = props.disabled,\n format = props.format,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n showTime = props.showTime,\n use12Hours = props.use12Hours,\n _props$separator = props.separator,\n separator = _props$separator === void 0 ? '~' : _props$separator,\n value = props.value,\n defaultValue = props.defaultValue,\n defaultPickerValue = props.defaultPickerValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n disabledDate = props.disabledDate,\n _disabledTime = props.disabledTime,\n dateRender = props.dateRender,\n panelRender = props.panelRender,\n ranges = props.ranges,\n allowEmpty = props.allowEmpty,\n allowClear = props.allowClear,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n pickerRef = props.pickerRef,\n inputReadOnly = props.inputReadOnly,\n mode = props.mode,\n renderExtraFooter = props.renderExtraFooter,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onPanelChange = props.onPanelChange,\n onCalendarChange = props.onCalendarChange,\n _onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onClick = props.onClick,\n _onOk = props.onOk,\n _onKeyDown = props.onKeyDown,\n components = props.components,\n order = props.order,\n direction = props.direction,\n activePickerIndex = props.activePickerIndex,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n // We record opened status here in case repeat open with picker\n var openRecordsRef = useRef({});\n var containerRef = useRef(null);\n var panelDivRef = useRef(null);\n var startInputDivRef = useRef(null);\n var endInputDivRef = useRef(null);\n var separatorRef = useRef(null);\n var startInputRef = useRef(null);\n var endInputRef = useRef(null);\n var arrowRef = useRef(null);\n // ============================ Warning ============================\n if (process.env.NODE_ENV !== 'production') {\n legacyPropsWarning(props);\n }\n // ============================= Misc ==============================\n var formatList = toArray(getDefaultFormat(format, picker, showTime, use12Hours));\n // Active picker\n var _useMergedState = useMergedState(0, {\n value: activePickerIndex\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedActivePickerIndex = _useMergedState2[0],\n setMergedActivePickerIndex = _useMergedState2[1];\n // Operation ref\n var operationRef = useRef(null);\n var mergedDisabled = React.useMemo(function () {\n if (Array.isArray(disabled)) {\n return disabled;\n }\n return [disabled || false, disabled || false];\n }, [disabled]);\n // ============================= Value =============================\n var _useMergedState3 = useMergedState(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(values) {\n return picker === 'time' && !order ? values : reorderValues(values, generateConfig);\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n mergedValue = _useMergedState4[0],\n setInnerValue = _useMergedState4[1];\n // =========================== View Date ===========================\n // Config view panel\n var _useRangeViewDates = useRangeViewDates({\n values: mergedValue,\n picker: picker,\n defaultDates: defaultPickerValue,\n generateConfig: generateConfig\n }),\n _useRangeViewDates2 = _slicedToArray(_useRangeViewDates, 2),\n getViewDate = _useRangeViewDates2[0],\n setViewDate = _useRangeViewDates2[1];\n // ========================= Select Values =========================\n var _useMergedState5 = useMergedState(mergedValue, {\n postState: function postState(values) {\n var postValues = values;\n if (mergedDisabled[0] && mergedDisabled[1]) {\n return postValues;\n }\n // Fill disabled unit\n for (var i = 0; i < 2; i += 1) {\n if (mergedDisabled[i] && !postValues && !getValue(postValues, i) && !getValue(allowEmpty, i)) {\n postValues = updateValues(postValues, generateConfig.getNow(), i);\n }\n }\n return postValues;\n }\n }),\n _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n selectedValue = _useMergedState6[0],\n setSelectedValue = _useMergedState6[1];\n // ============================= Modes =============================\n var _useMergedState7 = useMergedState([picker, picker], {\n value: mode\n }),\n _useMergedState8 = _slicedToArray(_useMergedState7, 2),\n mergedModes = _useMergedState8[0],\n setInnerModes = _useMergedState8[1];\n useEffect(function () {\n setInnerModes([picker, picker]);\n }, [picker]);\n var triggerModesChange = function triggerModesChange(modes, values) {\n setInnerModes(modes);\n if (onPanelChange) {\n onPanelChange(values, modes);\n }\n };\n // ========================= Disable Date ==========================\n var _useRangeDisabled = useRangeDisabled({\n picker: picker,\n selectedValue: selectedValue,\n locale: locale,\n disabled: mergedDisabled,\n disabledDate: disabledDate,\n generateConfig: generateConfig\n }, openRecordsRef.current[1], openRecordsRef.current[0]),\n _useRangeDisabled2 = _slicedToArray(_useRangeDisabled, 2),\n disabledStartDate = _useRangeDisabled2[0],\n disabledEndDate = _useRangeDisabled2[1];\n // ============================= Open ==============================\n var _useMergedState9 = useMergedState(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return mergedDisabled[mergedActivePickerIndex] ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState10 = _slicedToArray(_useMergedState9, 2),\n mergedOpen = _useMergedState10[0],\n triggerInnerOpen = _useMergedState10[1];\n var startOpen = mergedOpen && mergedActivePickerIndex === 0;\n var endOpen = mergedOpen && mergedActivePickerIndex === 1;\n // ============================= Popup =============================\n // Popup min width\n var _useState = useState(0),\n _useState2 = _slicedToArray(_useState, 2),\n popupMinWidth = _useState2[0],\n setPopupMinWidth = _useState2[1];\n useEffect(function () {\n if (!mergedOpen && containerRef.current) {\n setPopupMinWidth(containerRef.current.offsetWidth);\n }\n }, [mergedOpen]);\n // ============================ Trigger ============================\n var triggerRef = React.useRef();\n function _triggerOpen(newOpen, index) {\n if (newOpen) {\n clearTimeout(triggerRef.current);\n openRecordsRef.current[index] = true;\n setMergedActivePickerIndex(index);\n triggerInnerOpen(newOpen);\n // Open to reset view date\n if (!mergedOpen) {\n setViewDate(null, index);\n }\n } else if (mergedActivePickerIndex === index) {\n triggerInnerOpen(newOpen);\n // Clean up async\n // This makes ref not quick refresh in case user open another input with blur trigger\n var openRecords = openRecordsRef.current;\n triggerRef.current = setTimeout(function () {\n if (openRecords === openRecordsRef.current) {\n openRecordsRef.current = {};\n }\n });\n }\n }\n function triggerOpenAndFocus(index) {\n _triggerOpen(true, index);\n // Use setTimeout to make sure panel DOM exists\n setTimeout(function () {\n var inputRef = [startInputRef, endInputRef][index];\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, 0);\n }\n function triggerChange(newValue, sourceIndex) {\n var values = newValue;\n var startValue = getValue(values, 0);\n var endValue = getValue(values, 1);\n // >>>>> Format start & end values\n if (startValue && endValue && generateConfig.isAfter(startValue, endValue)) {\n if (\n // WeekPicker only compare week\n picker === 'week' && !isSameWeek(generateConfig, locale.locale, startValue, endValue) ||\n // QuotaPicker only compare week\n picker === 'quarter' && !isSameQuarter(generateConfig, startValue, endValue) ||\n // Other non-TimePicker compare date\n picker !== 'week' && picker !== 'quarter' && picker !== 'time' && !isSameDate(generateConfig, startValue, endValue)) {\n // Clean up end date when start date is after end date\n if (sourceIndex === 0) {\n values = [startValue, null];\n endValue = null;\n } else {\n startValue = null;\n values = [null, endValue];\n }\n // Clean up cache since invalidate\n openRecordsRef.current = _defineProperty({}, sourceIndex, true);\n } else if (picker !== 'time' || order !== false) {\n // Reorder when in same date\n values = reorderValues(values, generateConfig);\n }\n }\n setSelectedValue(values);\n var startStr = values && values[0] ? formatValue(values[0], {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '';\n var endStr = values && values[1] ? formatValue(values[1], {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '';\n if (onCalendarChange) {\n var info = {\n range: sourceIndex === 0 ? 'start' : 'end'\n };\n onCalendarChange(values, [startStr, endStr], info);\n }\n // >>>>> Trigger `onChange` event\n var canStartValueTrigger = canValueTrigger(startValue, 0, mergedDisabled, allowEmpty);\n var canEndValueTrigger = canValueTrigger(endValue, 1, mergedDisabled, allowEmpty);\n var canTrigger = values === null || canStartValueTrigger && canEndValueTrigger;\n if (canTrigger) {\n // Trigger onChange only when value is validate\n setInnerValue(values);\n if (onChange && (!isEqual(generateConfig, getValue(mergedValue, 0), startValue) || !isEqual(generateConfig, getValue(mergedValue, 1), endValue))) {\n onChange(values, [startStr, endStr]);\n }\n }\n // >>>>> Open picker when\n // Always open another picker if possible\n var nextOpenIndex = null;\n if (sourceIndex === 0 && !mergedDisabled[1]) {\n nextOpenIndex = 1;\n } else if (sourceIndex === 1 && !mergedDisabled[0]) {\n nextOpenIndex = 0;\n }\n if (nextOpenIndex !== null && nextOpenIndex !== mergedActivePickerIndex && (!openRecordsRef.current[nextOpenIndex] || !getValue(values, nextOpenIndex)) && getValue(values, sourceIndex)) {\n // Delay to focus to avoid input blur trigger expired selectedValues\n triggerOpenAndFocus(nextOpenIndex);\n } else {\n _triggerOpen(false, sourceIndex);\n }\n }\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n /* eslint-disable no-lone-blocks */\n {\n warning(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n // ============================= Text ==============================\n var sharedTextHooksProps = {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n };\n var _useValueTexts = useValueTexts(getValue(selectedValue, 0), sharedTextHooksProps),\n _useValueTexts2 = _slicedToArray(_useValueTexts, 2),\n startValueTexts = _useValueTexts2[0],\n firstStartValueText = _useValueTexts2[1];\n var _useValueTexts3 = useValueTexts(getValue(selectedValue, 1), sharedTextHooksProps),\n _useValueTexts4 = _slicedToArray(_useValueTexts3, 2),\n endValueTexts = _useValueTexts4[0],\n firstEndValueText = _useValueTexts4[1];\n var _onTextChange = function onTextChange(newText, index) {\n var inputDate = parseValue(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n var disabledFunc = index === 0 ? disabledStartDate : disabledEndDate;\n if (inputDate && !disabledFunc(inputDate)) {\n setSelectedValue(updateValues(selectedValue, inputDate, index));\n setViewDate(inputDate, index);\n }\n };\n var _useTextValueMapping = useTextValueMapping({\n valueTexts: startValueTexts,\n onTextChange: function onTextChange(newText) {\n return _onTextChange(newText, 0);\n }\n }),\n _useTextValueMapping2 = _slicedToArray(_useTextValueMapping, 3),\n startText = _useTextValueMapping2[0],\n triggerStartTextChange = _useTextValueMapping2[1],\n resetStartText = _useTextValueMapping2[2];\n var _useTextValueMapping3 = useTextValueMapping({\n valueTexts: endValueTexts,\n onTextChange: function onTextChange(newText) {\n return _onTextChange(newText, 1);\n }\n }),\n _useTextValueMapping4 = _slicedToArray(_useTextValueMapping3, 3),\n endText = _useTextValueMapping4[0],\n triggerEndTextChange = _useTextValueMapping4[1],\n resetEndText = _useTextValueMapping4[2];\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n rangeHoverValue = _useState4[0],\n setRangeHoverValue = _useState4[1];\n // ========================== Hover Range ==========================\n var _useState5 = useState(null),\n _useState6 = _slicedToArray(_useState5, 2),\n hoverRangedValue = _useState6[0],\n setHoverRangedValue = _useState6[1];\n var _useHoverValue = useHoverValue(startText, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = _slicedToArray(_useHoverValue, 3),\n startHoverValue = _useHoverValue2[0],\n onStartEnter = _useHoverValue2[1],\n onStartLeave = _useHoverValue2[2];\n var _useHoverValue3 = useHoverValue(endText, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue4 = _slicedToArray(_useHoverValue3, 3),\n endHoverValue = _useHoverValue4[0],\n onEndEnter = _useHoverValue4[1],\n onEndLeave = _useHoverValue4[2];\n var onDateMouseEnter = function onDateMouseEnter(date) {\n setHoverRangedValue(updateValues(selectedValue, date, mergedActivePickerIndex));\n if (mergedActivePickerIndex === 0) {\n onStartEnter(date);\n } else {\n onEndEnter(date);\n }\n };\n var onDateMouseLeave = function onDateMouseLeave() {\n setHoverRangedValue(updateValues(selectedValue, null, mergedActivePickerIndex));\n if (mergedActivePickerIndex === 0) {\n onStartLeave();\n } else {\n onEndLeave();\n }\n };\n // ============================= Input =============================\n var getSharedInputHookProps = function getSharedInputHookProps(index, resetText) {\n return {\n blurToCancel: needConfirmButton,\n forwardKeyDown: forwardKeyDown,\n onBlur: onBlur,\n isClickOutside: function isClickOutside(target) {\n return !elementsContains([panelDivRef.current, startInputDivRef.current, endInputDivRef.current, containerRef.current], target);\n },\n onFocus: function onFocus(e) {\n setMergedActivePickerIndex(index);\n if (_onFocus) {\n _onFocus(e);\n }\n },\n triggerOpen: function triggerOpen(newOpen) {\n _triggerOpen(newOpen, index);\n },\n onSubmit: function onSubmit() {\n if (\n // When user typing disabledDate with keyboard and enter, this value will be empty\n !selectedValue ||\n // Normal disabled check\n disabledDate && disabledDate(selectedValue[index])) {\n return false;\n }\n triggerChange(selectedValue, index);\n resetText();\n },\n onCancel: function onCancel() {\n _triggerOpen(false, index);\n setSelectedValue(mergedValue);\n resetText();\n }\n };\n };\n var currentFocusedKey = useRef('');\n var _usePickerInput = usePickerInput(_objectSpread(_objectSpread({}, getSharedInputHookProps(0, resetStartText)), {}, {\n open: startOpen,\n value: startText,\n currentFocusedKey: currentFocusedKey,\n key: 'start',\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n }\n })),\n _usePickerInput2 = _slicedToArray(_usePickerInput, 2),\n startInputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n startFocused = _usePickerInput2$.focused,\n startTyping = _usePickerInput2$.typing;\n var _usePickerInput3 = usePickerInput(_objectSpread(_objectSpread({}, getSharedInputHookProps(1, resetEndText)), {}, {\n open: endOpen,\n value: endText,\n currentFocusedKey: currentFocusedKey,\n key: 'end',\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n }\n })),\n _usePickerInput4 = _slicedToArray(_usePickerInput3, 2),\n endInputProps = _usePickerInput4[0],\n _usePickerInput4$ = _usePickerInput4[1],\n endFocused = _usePickerInput4$.focused,\n endTyping = _usePickerInput4$.typing;\n // ========================== Click Picker ==========================\n var onPickerClick = function onPickerClick(e) {\n // When click inside the picker & outside the picker's input elements\n // the panel should still be opened\n if (onClick) {\n onClick(e);\n }\n if (!mergedOpen && !startInputRef.current.contains(e.target) && !endInputRef.current.contains(e.target)) {\n if (!mergedDisabled[0]) {\n triggerOpenAndFocus(0);\n } else if (!mergedDisabled[1]) {\n triggerOpenAndFocus(1);\n }\n }\n };\n var onPickerMouseDown = function onPickerMouseDown(e) {\n // shouldn't affect input elements if picker is active\n if (onMouseDown) {\n onMouseDown(e);\n }\n if (mergedOpen && (startFocused || endFocused) && !startInputRef.current.contains(e.target) && !endInputRef.current.contains(e.target)) {\n e.preventDefault();\n }\n };\n // ============================= Sync ==============================\n // Close should sync back with text value\n var startStr = mergedValue && mergedValue[0] ? formatValue(mergedValue[0], {\n locale: locale,\n format: 'YYYYMMDDHHmmss',\n generateConfig: generateConfig\n }) : '';\n var endStr = mergedValue && mergedValue[1] ? formatValue(mergedValue[1], {\n locale: locale,\n format: 'YYYYMMDDHHmmss',\n generateConfig: generateConfig\n }) : '';\n useEffect(function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n if (!startValueTexts.length || startValueTexts[0] === '') {\n triggerStartTextChange('');\n } else if (firstStartValueText !== startText) {\n resetStartText();\n }\n if (!endValueTexts.length || endValueTexts[0] === '') {\n triggerEndTextChange('');\n } else if (firstEndValueText !== endText) {\n resetEndText();\n }\n }\n }, [mergedOpen, startValueTexts, endValueTexts]);\n // Sync innerValue with control mode\n useEffect(function () {\n setSelectedValue(mergedValue);\n }, [startStr, endStr]);\n // ============================ Warning ============================\n if (process.env.NODE_ENV !== 'production') {\n if (value && Array.isArray(disabled) && (getValue(disabled, 0) && !getValue(value, 0) || getValue(disabled, 1) && !getValue(value, 1))) {\n warning(false, '`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead.');\n }\n }\n // ============================ Private ============================\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (startInputRef.current) {\n startInputRef.current.focus();\n }\n },\n blur: function blur() {\n if (startInputRef.current) {\n startInputRef.current.blur();\n }\n if (endInputRef.current) {\n endInputRef.current.blur();\n }\n }\n };\n }\n // ============================ Ranges =============================\n var rangeLabels = Object.keys(ranges || {});\n var rangeList = rangeLabels.map(function (label) {\n var range = ranges[label];\n var newValues = typeof range === 'function' ? range() : range;\n return {\n label: label,\n onClick: function onClick() {\n triggerChange(newValues, null);\n _triggerOpen(false, mergedActivePickerIndex);\n },\n onMouseEnter: function onMouseEnter() {\n setRangeHoverValue(newValues);\n },\n onMouseLeave: function onMouseLeave() {\n setRangeHoverValue(null);\n }\n };\n });\n // ============================= Panel =============================\n function renderPanel() {\n var panelPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var panelProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var panelHoverRangedValue = null;\n if (mergedOpen && hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1] && generateConfig.isAfter(hoverRangedValue[1], hoverRangedValue[0])) {\n panelHoverRangedValue = hoverRangedValue;\n }\n var panelShowTime = showTime;\n if (showTime && _typeof(showTime) === 'object' && showTime.defaultValue) {\n var timeDefaultValues = showTime.defaultValue;\n panelShowTime = _objectSpread(_objectSpread({}, showTime), {}, {\n defaultValue: getValue(timeDefaultValues, mergedActivePickerIndex) || undefined\n });\n }\n var panelDateRender = null;\n if (dateRender) {\n panelDateRender = function panelDateRender(date, today) {\n return dateRender(date, today, {\n range: mergedActivePickerIndex ? 'end' : 'start'\n });\n };\n }\n return /*#__PURE__*/React.createElement(RangeContext.Provider, {\n value: {\n inRange: true,\n panelPosition: panelPosition,\n rangedValue: rangeHoverValue || selectedValue,\n hoverRangedValue: panelHoverRangedValue\n }\n }, /*#__PURE__*/React.createElement(PickerPanel, _extends({}, props, panelProps, {\n dateRender: panelDateRender,\n showTime: panelShowTime,\n mode: mergedModes[mergedActivePickerIndex],\n generateConfig: generateConfig,\n style: undefined,\n direction: direction,\n disabledDate: mergedActivePickerIndex === 0 ? disabledStartDate : disabledEndDate,\n disabledTime: function disabledTime(date) {\n if (_disabledTime) {\n return _disabledTime(date, mergedActivePickerIndex === 0 ? 'start' : 'end');\n }\n return false;\n },\n className: classNames(_defineProperty({}, \"\".concat(prefixCls, \"-panel-focused\"), mergedActivePickerIndex === 0 ? !startTyping : !endTyping)),\n value: getValue(selectedValue, mergedActivePickerIndex),\n locale: locale,\n tabIndex: -1,\n onPanelChange: function onPanelChange(date, newMode) {\n // clear hover value when panel change\n if (mergedActivePickerIndex === 0) {\n onStartLeave(true);\n }\n if (mergedActivePickerIndex === 1) {\n onEndLeave(true);\n }\n triggerModesChange(updateValues(mergedModes, newMode, mergedActivePickerIndex), updateValues(selectedValue, date, mergedActivePickerIndex));\n var viewDate = date;\n if (panelPosition === 'right' && mergedModes[mergedActivePickerIndex] === newMode) {\n viewDate = getClosingViewDate(viewDate, newMode, generateConfig, -1);\n }\n setViewDate(viewDate, mergedActivePickerIndex);\n },\n onOk: null,\n onSelect: undefined,\n onChange: undefined,\n defaultValue: mergedActivePickerIndex === 0 ? getValue(selectedValue, 1) : getValue(selectedValue, 0)\n })));\n }\n var arrowLeft = 0;\n var panelLeft = 0;\n if (mergedActivePickerIndex && startInputDivRef.current && separatorRef.current && panelDivRef.current) {\n // Arrow offset\n arrowLeft = startInputDivRef.current.offsetWidth + separatorRef.current.offsetWidth;\n // If panelWidth - arrowWidth - arrowMarginLeft < arrowLeft, panel should move to right side.\n // If arrowOffsetLeft > arrowLeft, arrowMarginLeft = arrowOffsetLeft - arrowLeft\n var arrowMarginLeft = arrowRef.current.offsetLeft > arrowLeft ? arrowRef.current.offsetLeft - arrowLeft : arrowRef.current.offsetLeft;\n if (panelDivRef.current.offsetWidth && arrowRef.current.offsetWidth && arrowLeft > panelDivRef.current.offsetWidth - arrowRef.current.offsetWidth - (direction === 'rtl' ? 0 : arrowMarginLeft)) {\n panelLeft = arrowLeft;\n }\n }\n var arrowPositionStyle = direction === 'rtl' ? {\n right: arrowLeft\n } : {\n left: arrowLeft\n };\n function renderPanels() {\n var panels;\n var extraNode = getExtraFooter(prefixCls, mergedModes[mergedActivePickerIndex], renderExtraFooter);\n var rangesNode = getRanges({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !getValue(selectedValue, mergedActivePickerIndex) || disabledDate && disabledDate(selectedValue[mergedActivePickerIndex]),\n locale: locale,\n rangeList: rangeList,\n onOk: function onOk() {\n if (getValue(selectedValue, mergedActivePickerIndex)) {\n // triggerChangeOld(selectedValue);\n triggerChange(selectedValue, mergedActivePickerIndex);\n if (_onOk) {\n _onOk(selectedValue);\n }\n }\n }\n });\n if (picker !== 'time' && !showTime) {\n var viewDate = getViewDate(mergedActivePickerIndex);\n var nextViewDate = getClosingViewDate(viewDate, picker, generateConfig);\n var currentMode = mergedModes[mergedActivePickerIndex];\n var showDoublePanel = currentMode === picker;\n var leftPanel = renderPanel(showDoublePanel ? 'left' : false, {\n pickerValue: viewDate,\n onPickerValueChange: function onPickerValueChange(newViewDate) {\n setViewDate(newViewDate, mergedActivePickerIndex);\n }\n });\n var rightPanel = renderPanel('right', {\n pickerValue: nextViewDate,\n onPickerValueChange: function onPickerValueChange(newViewDate) {\n setViewDate(getClosingViewDate(newViewDate, picker, generateConfig, -1), mergedActivePickerIndex);\n }\n });\n if (direction === 'rtl') {\n panels = /*#__PURE__*/React.createElement(React.Fragment, null, rightPanel, showDoublePanel && leftPanel);\n } else {\n panels = /*#__PURE__*/React.createElement(React.Fragment, null, leftPanel, showDoublePanel && rightPanel);\n }\n } else {\n panels = renderPanel();\n }\n var mergedNodes = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panels\")\n }, panels), (extraNode || rangesNode) && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraNode, rangesNode));\n if (panelRender) {\n mergedNodes = panelRender(mergedNodes);\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n style: {\n marginLeft: panelLeft\n },\n ref: panelDivRef,\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, mergedNodes);\n }\n var rangePanel = /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-range-wrapper\"), \"\".concat(prefixCls, \"-\").concat(picker, \"-range-wrapper\")),\n style: {\n minWidth: popupMinWidth\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: arrowRef,\n className: \"\".concat(prefixCls, \"-range-arrow\"),\n style: arrowPositionStyle\n }), renderPanels());\n // ============================= Icons =============================\n var suffixNode;\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n var clearNode;\n if (allowClear && (getValue(mergedValue, 0) && !mergedDisabled[0] || getValue(mergedValue, 1) && !mergedDisabled[1])) {\n clearNode = /*#__PURE__*/React.createElement(\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n var values = mergedValue;\n if (!mergedDisabled[0]) {\n values = updateValues(values, null, 0);\n }\n if (!mergedDisabled[1]) {\n values = updateValues(values, null, 1);\n }\n triggerChange(values, null);\n _triggerOpen(false, mergedActivePickerIndex);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n }\n var inputSharedProps = {\n size: getInputSize(picker, formatList[0], generateConfig)\n };\n var activeBarLeft = 0;\n var activeBarWidth = 0;\n if (startInputDivRef.current && endInputDivRef.current && separatorRef.current) {\n if (mergedActivePickerIndex === 0) {\n activeBarWidth = startInputDivRef.current.offsetWidth;\n } else {\n activeBarLeft = arrowLeft;\n activeBarWidth = endInputDivRef.current.offsetWidth;\n }\n }\n var activeBarPositionStyle = direction === 'rtl' ? {\n right: activeBarLeft\n } : {\n left: activeBarLeft\n };\n // ============================ Return =============================\n var onContextSelect = function onContextSelect(date, type) {\n var values = updateValues(selectedValue, date, mergedActivePickerIndex);\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(values, mergedActivePickerIndex);\n // clear hover value style\n if (mergedActivePickerIndex === 0) {\n onStartLeave();\n } else {\n onEndLeave();\n }\n } else {\n setSelectedValue(values);\n }\n };\n return /*#__PURE__*/React.createElement(PanelContext.Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n onDateMouseEnter: onDateMouseEnter,\n onDateMouseLeave: onDateMouseLeave,\n hideRanges: true,\n onSelect: onContextSelect,\n open: mergedOpen\n }\n }, /*#__PURE__*/React.createElement(PickerTrigger, {\n visible: mergedOpen,\n popupElement: rangePanel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n range: true,\n direction: direction\n }, /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: containerRef,\n className: classNames(prefixCls, \"\".concat(prefixCls, \"-range\"), className, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-disabled\"), mergedDisabled[0] && mergedDisabled[1]), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-focused\"), mergedActivePickerIndex === 0 ? startFocused : endFocused), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onClick: onPickerClick,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onMouseDown: onPickerMouseDown,\n onMouseUp: onMouseUp\n }, getDataOrAriaProps(props)), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-input\"), (_classNames3 = {}, _defineProperty(_classNames3, \"\".concat(prefixCls, \"-input-active\"), mergedActivePickerIndex === 0), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-input-placeholder\"), !!startHoverValue), _classNames3)),\n ref: startInputDivRef\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n id: id,\n disabled: mergedDisabled[0],\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !startTyping,\n value: startHoverValue || startText,\n onChange: function onChange(e) {\n triggerStartTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: getValue(placeholder, 0) || '',\n ref: startInputRef\n }, startInputProps, inputSharedProps, {\n autoComplete: autoComplete\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-range-separator\"),\n ref: separatorRef\n }, separator), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-input\"), (_classNames4 = {}, _defineProperty(_classNames4, \"\".concat(prefixCls, \"-input-active\"), mergedActivePickerIndex === 1), _defineProperty(_classNames4, \"\".concat(prefixCls, \"-input-placeholder\"), !!endHoverValue), _classNames4)),\n ref: endInputDivRef\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n disabled: mergedDisabled[1],\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !endTyping,\n value: endHoverValue || endText,\n onChange: function onChange(e) {\n triggerEndTextChange(e.target.value);\n },\n placeholder: getValue(placeholder, 1) || '',\n ref: endInputRef\n }, endInputProps, inputSharedProps, {\n autoComplete: autoComplete\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-active-bar\"),\n style: _objectSpread(_objectSpread({}, activeBarPositionStyle), {}, {\n width: activeBarWidth,\n position: 'absolute'\n })\n }), suffixNode, clearNode)));\n}\n// Wrap with class component to enable pass generic with instance method\nvar RangePicker = /*#__PURE__*/function (_React$Component) {\n _inherits(RangePicker, _React$Component);\n var _super = _createSuper(RangePicker);\n function RangePicker() {\n var _this;\n _classCallCheck(this, RangePicker);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.pickerRef = /*#__PURE__*/React.createRef();\n _this.focus = function () {\n if (_this.pickerRef.current) {\n _this.pickerRef.current.focus();\n }\n };\n _this.blur = function () {\n if (_this.pickerRef.current) {\n _this.pickerRef.current.blur();\n }\n };\n return _this;\n }\n _createClass(RangePicker, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(InnerRangePicker, _extends({}, this.props, {\n pickerRef: this.pickerRef\n }));\n }\n }]);\n return RangePicker;\n}(React.Component);\nexport default RangePicker;","import * as React from 'react';\nimport { getValue } from '../utils/miscUtil';\nimport { isSameDate, getQuarter } from '../utils/dateUtil';\nexport default function useRangeDisabled(_ref, disabledStart, disabledEnd) {\n var picker = _ref.picker,\n locale = _ref.locale,\n selectedValue = _ref.selectedValue,\n disabledDate = _ref.disabledDate,\n disabled = _ref.disabled,\n generateConfig = _ref.generateConfig;\n var startDate = getValue(selectedValue, 0);\n var endDate = getValue(selectedValue, 1);\n function weekFirstDate(date) {\n return generateConfig.locale.getWeekFirstDate(locale.locale, date);\n }\n function monthNumber(date) {\n var year = generateConfig.getYear(date);\n var month = generateConfig.getMonth(date);\n return year * 100 + month;\n }\n function quarterNumber(date) {\n var year = generateConfig.getYear(date);\n var quarter = getQuarter(generateConfig, date);\n return year * 10 + quarter;\n }\n var disabledStartDate = React.useCallback(function (date) {\n if (disabledDate && disabledDate(date)) {\n return true;\n }\n // Disabled range\n if (disabled[1] && endDate) {\n return !isSameDate(generateConfig, date, endDate) && generateConfig.isAfter(date, endDate);\n }\n // Disabled part\n if (disabledStart && endDate) {\n switch (picker) {\n case 'quarter':\n return quarterNumber(date) > quarterNumber(endDate);\n case 'month':\n return monthNumber(date) > monthNumber(endDate);\n case 'week':\n return weekFirstDate(date) > weekFirstDate(endDate);\n default:\n return !isSameDate(generateConfig, date, endDate) && generateConfig.isAfter(date, endDate);\n }\n }\n return false;\n }, [disabledDate, disabled[1], endDate, disabledStart]);\n var disabledEndDate = React.useCallback(function (date) {\n if (disabledDate && disabledDate(date)) {\n return true;\n }\n // Disabled range\n if (disabled[0] && startDate) {\n return !isSameDate(generateConfig, date, endDate) && generateConfig.isAfter(startDate, date);\n }\n // Disabled part\n if (disabledEnd && startDate) {\n switch (picker) {\n case 'quarter':\n return quarterNumber(date) < quarterNumber(startDate);\n case 'month':\n return monthNumber(date) < monthNumber(startDate);\n case 'week':\n return weekFirstDate(date) < weekFirstDate(startDate);\n default:\n return !isSameDate(generateConfig, date, startDate) && generateConfig.isAfter(startDate, date);\n }\n }\n return false;\n }, [disabledDate, disabled[0], startDate, disabledEnd]);\n return [disabledStartDate, disabledEndDate];\n}","import Picker from './Picker';\nimport PickerPanel from './PickerPanel';\nimport RangePicker from './RangePicker';\nexport { PickerPanel, RangePicker };\nexport default Picker;","export function getPlaceholder(picker, locale, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.yearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.quarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.monthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.weekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.placeholder;\n }\n return locale.lang.placeholder;\n}\nexport function getRangePlaceholder(picker, locale, customizePlaceholder) {\n if (customizePlaceholder !== undefined) {\n return customizePlaceholder;\n }\n if (picker === 'year' && locale.lang.yearPlaceholder) {\n return locale.lang.rangeYearPlaceholder;\n }\n if (picker === 'quarter' && locale.lang.quarterPlaceholder) {\n return locale.lang.rangeQuarterPlaceholder;\n }\n if (picker === 'month' && locale.lang.monthPlaceholder) {\n return locale.lang.rangeMonthPlaceholder;\n }\n if (picker === 'week' && locale.lang.weekPlaceholder) {\n return locale.lang.rangeWeekPlaceholder;\n }\n if (picker === 'time' && locale.timePickerLocale.placeholder) {\n return locale.timePickerLocale.rangePlaceholder;\n }\n return locale.lang.rangePlaceholder;\n}\nexport function transPlacement2DropdownAlign(direction, placement) {\n var overflow = {\n adjustX: 1,\n adjustY: 1\n };\n switch (placement) {\n case 'bottomLeft':\n {\n return {\n points: ['tl', 'bl'],\n offset: [0, 4],\n overflow: overflow\n };\n }\n case 'bottomRight':\n {\n return {\n points: ['tr', 'br'],\n offset: [0, 4],\n overflow: overflow\n };\n }\n case 'topLeft':\n {\n return {\n points: ['bl', 'tl'],\n offset: [0, -4],\n overflow: overflow\n };\n }\n case 'topRight':\n {\n return {\n points: ['br', 'tr'],\n offset: [0, -4],\n overflow: overflow\n };\n }\n default:\n {\n return {\n points: direction === 'rtl' ? ['tr', 'br'] : ['tl', 'bl'],\n offset: [0, 4],\n overflow: overflow\n };\n }\n }\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CalendarOutlined from \"@ant-design/icons/es/icons/CalendarOutlined\";\nimport ClockCircleOutlined from \"@ant-design/icons/es/icons/ClockCircleOutlined\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport SwapRightOutlined from \"@ant-design/icons/es/icons/SwapRightOutlined\";\nimport classNames from 'classnames';\nimport { RangePicker as RCRangePicker } from 'rc-picker';\nimport * as React from 'react';\nimport { forwardRef, useContext, useImperativeHandle } from 'react';\nimport { Components, getTimeProps } from '.';\nimport { ConfigContext } from '../../config-provider';\nimport DisabledContext from '../../config-provider/DisabledContext';\nimport SizeContext from '../../config-provider/SizeContext';\nimport { FormItemInputContext } from '../../form/context';\nimport { useCompactItemContext } from '../../space/Compact';\nimport LocaleReceiver from '../../locale-provider/LocaleReceiver';\nimport { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';\nimport enUS from '../locale/en_US';\nimport { getRangePlaceholder, transPlacement2DropdownAlign } from '../util';\nimport warning from '../../_util/warning';\nexport default function generateRangePicker(generateConfig) {\n var RangePicker = /*#__PURE__*/forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n customGetPopupContainer = props.getPopupContainer,\n className = props.className,\n placement = props.placement,\n customizeSize = props.size,\n customDisabled = props.disabled,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n placeholder = props.placeholder,\n popupClassName = props.popupClassName,\n dropdownClassName = props.dropdownClassName,\n customStatus = props.status,\n restProps = __rest(props, [\"prefixCls\", \"getPopupContainer\", \"className\", \"placement\", \"size\", \"disabled\", \"bordered\", \"placeholder\", \"popupClassName\", \"dropdownClassName\", \"status\"]);\n var innerRef = React.useRef(null);\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls,\n direction = _useContext.direction,\n getPopupContainer = _useContext.getPopupContainer;\n var prefixCls = getPrefixCls('picker', customizePrefixCls);\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var format = props.format,\n showTime = props.showTime,\n picker = props.picker;\n var rootPrefixCls = getPrefixCls();\n var additionalOverrideProps = {};\n additionalOverrideProps = _extends(_extends(_extends({}, additionalOverrideProps), showTime ? getTimeProps(_extends({\n format: format,\n picker: picker\n }, showTime)) : {}), picker === 'time' ? getTimeProps(_extends(_extends({\n format: format\n }, props), {\n picker: picker\n })) : {});\n process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, 'RangePicker', '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.') : void 0;\n // ===================== Size =====================\n var size = React.useContext(SizeContext);\n var mergedSize = compactSize || customizeSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n // ===================== FormItemInput =====================\n var formItemContext = useContext(FormItemInputContext);\n var hasFeedback = formItemContext.hasFeedback,\n contextStatus = formItemContext.status,\n feedbackIcon = formItemContext.feedbackIcon;\n var suffixNode = /*#__PURE__*/React.createElement(React.Fragment, null, picker === 'time' ? /*#__PURE__*/React.createElement(ClockCircleOutlined, null) : /*#__PURE__*/React.createElement(CalendarOutlined, null), hasFeedback && feedbackIcon);\n useImperativeHandle(ref, function () {\n return {\n focus: function focus() {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n },\n blur: function blur() {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();\n }\n };\n });\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"DatePicker\",\n defaultLocale: enUS\n }, function (contextLocale) {\n var locale = _extends(_extends({}, contextLocale), props.locale);\n return /*#__PURE__*/React.createElement(RCRangePicker, _extends({\n separator: /*#__PURE__*/React.createElement(\"span\", {\n \"aria-label\": \"to\",\n className: \"\".concat(prefixCls, \"-separator\")\n }, /*#__PURE__*/React.createElement(SwapRightOutlined, null)),\n disabled: mergedDisabled,\n ref: innerRef,\n dropdownAlign: transPlacement2DropdownAlign(direction, placement),\n placeholder: getRangePlaceholder(picker, locale, placeholder),\n suffixIcon: suffixNode,\n clearIcon: /*#__PURE__*/React.createElement(CloseCircleFilled, null),\n prevIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prev-icon\")\n }),\n nextIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-next-icon\")\n }),\n superPrevIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-super-prev-icon\")\n }),\n superNextIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-super-next-icon\")\n }),\n allowClear: true,\n transitionName: \"\".concat(rootPrefixCls, \"-slide-up\")\n }, restProps, additionalOverrideProps, {\n className: classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(mergedSize), mergedSize), \"\".concat(prefixCls, \"-borderless\"), !bordered), getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), compactItemClassnames, className),\n locale: locale.lang,\n prefixCls: prefixCls,\n getPopupContainer: customGetPopupContainer || getPopupContainer,\n generateConfig: generateConfig,\n components: Components,\n direction: direction,\n dropdownClassName: popupClassName || dropdownClassName\n }));\n });\n });\n return RangePicker;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CalendarOutlined from \"@ant-design/icons/es/icons/CalendarOutlined\";\nimport ClockCircleOutlined from \"@ant-design/icons/es/icons/ClockCircleOutlined\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport classNames from 'classnames';\nimport RCPicker from 'rc-picker';\nimport * as React from 'react';\nimport { forwardRef, useContext, useImperativeHandle } from 'react';\nimport { useCompactItemContext } from '../../space/Compact';\nimport { Components, getTimeProps } from '.';\nimport { ConfigContext } from '../../config-provider';\nimport DisabledContext from '../../config-provider/DisabledContext';\nimport SizeContext from '../../config-provider/SizeContext';\nimport { FormItemInputContext } from '../../form/context';\nimport LocaleReceiver from '../../locale-provider/LocaleReceiver';\nimport { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';\nimport warning from '../../_util/warning';\nimport enUS from '../locale/en_US';\nimport { getPlaceholder, transPlacement2DropdownAlign } from '../util';\nexport default function generatePicker(generateConfig) {\n function getPicker(picker, displayName) {\n var Picker = /*#__PURE__*/forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n customizeGetPopupContainer = props.getPopupContainer,\n className = props.className,\n customizeSize = props.size,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n placement = props.placement,\n placeholder = props.placeholder,\n popupClassName = props.popupClassName,\n dropdownClassName = props.dropdownClassName,\n customDisabled = props.disabled,\n customStatus = props.status,\n restProps = __rest(props, [\"prefixCls\", \"getPopupContainer\", \"className\", \"size\", \"bordered\", \"placement\", \"placeholder\", \"popupClassName\", \"dropdownClassName\", \"disabled\", \"status\"]);\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls,\n direction = _useContext.direction,\n getPopupContainer = _useContext.getPopupContainer;\n var prefixCls = getPrefixCls('picker', customizePrefixCls);\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var innerRef = React.useRef(null);\n var format = props.format,\n showTime = props.showTime;\n useImperativeHandle(ref, function () {\n return {\n focus: function focus() {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n },\n blur: function blur() {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();\n }\n };\n });\n var additionalProps = {\n showToday: true\n };\n var additionalOverrideProps = {};\n if (picker) {\n additionalOverrideProps.picker = picker;\n }\n var mergedPicker = picker || props.picker;\n additionalOverrideProps = _extends(_extends(_extends({}, additionalOverrideProps), showTime ? getTimeProps(_extends({\n format: format,\n picker: mergedPicker\n }, showTime)) : {}), mergedPicker === 'time' ? getTimeProps(_extends(_extends({\n format: format\n }, props), {\n picker: mergedPicker\n })) : {});\n var rootPrefixCls = getPrefixCls();\n // =================== Warning =====================\n process.env.NODE_ENV !== \"production\" ? warning(picker !== 'quarter', displayName, \"DatePicker.\".concat(displayName, \" is legacy usage. Please use DatePicker[picker='\").concat(picker, \"'] directly.\")) : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, mergedPicker === 'time' ? 'TimePicker' : 'DatePicker', '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.') : void 0;\n // ===================== Size =====================\n var size = React.useContext(SizeContext);\n var mergedSize = compactSize || customizeSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n // ===================== FormItemInput =====================\n var formItemContext = useContext(FormItemInputContext);\n var hasFeedback = formItemContext.hasFeedback,\n contextStatus = formItemContext.status,\n feedbackIcon = formItemContext.feedbackIcon;\n var suffixNode = /*#__PURE__*/React.createElement(React.Fragment, null, mergedPicker === 'time' ? /*#__PURE__*/React.createElement(ClockCircleOutlined, null) : /*#__PURE__*/React.createElement(CalendarOutlined, null), hasFeedback && feedbackIcon);\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"DatePicker\",\n defaultLocale: enUS\n }, function (contextLocale) {\n var locale = _extends(_extends({}, contextLocale), props.locale);\n return /*#__PURE__*/React.createElement(RCPicker, _extends({\n ref: innerRef,\n placeholder: getPlaceholder(mergedPicker, locale, placeholder),\n suffixIcon: suffixNode,\n dropdownAlign: transPlacement2DropdownAlign(direction, placement),\n clearIcon: /*#__PURE__*/React.createElement(CloseCircleFilled, null),\n prevIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prev-icon\")\n }),\n nextIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-next-icon\")\n }),\n superPrevIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-super-prev-icon\")\n }),\n superNextIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-super-next-icon\")\n }),\n allowClear: true,\n transitionName: \"\".concat(rootPrefixCls, \"-slide-up\")\n }, additionalProps, restProps, additionalOverrideProps, {\n locale: locale.lang,\n className: classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(mergedSize), mergedSize), \"\".concat(prefixCls, \"-borderless\"), !bordered), getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), compactItemClassnames, className),\n prefixCls: prefixCls,\n getPopupContainer: customizeGetPopupContainer || getPopupContainer,\n generateConfig: generateConfig,\n components: Components,\n direction: direction,\n disabled: mergedDisabled,\n dropdownClassName: popupClassName || dropdownClassName\n }));\n });\n });\n if (displayName) {\n Picker.displayName = displayName;\n }\n return Picker;\n }\n var DatePicker = getPicker();\n var WeekPicker = getPicker('week', 'WeekPicker');\n var MonthPicker = getPicker('month', 'MonthPicker');\n var YearPicker = getPicker('year', 'YearPicker');\n var TimePicker = getPicker('time', 'TimePicker');\n var QuarterPicker = getPicker('quarter', 'QuarterPicker');\n return {\n DatePicker: DatePicker,\n WeekPicker: WeekPicker,\n MonthPicker: MonthPicker,\n YearPicker: YearPicker,\n TimePicker: TimePicker,\n QuarterPicker: QuarterPicker\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { tuple } from '../../_util/type';\nimport PickerButton from '../PickerButton';\nimport PickerTag from '../PickerTag';\nimport generateRangePicker from './generateRangePicker';\nimport generateSinglePicker from './generateSinglePicker';\nexport var Components = {\n button: PickerButton,\n rangeItem: PickerTag\n};\nfunction toArray(list) {\n if (!list) {\n return [];\n }\n return Array.isArray(list) ? list : [list];\n}\nexport function getTimeProps(props) {\n var format = props.format,\n picker = props.picker,\n showHour = props.showHour,\n showMinute = props.showMinute,\n showSecond = props.showSecond,\n use12Hours = props.use12Hours;\n var firstFormat = toArray(format)[0];\n var showTimeObj = _extends({}, props);\n if (firstFormat && typeof firstFormat === 'string') {\n if (!firstFormat.includes('s') && showSecond === undefined) {\n showTimeObj.showSecond = false;\n }\n if (!firstFormat.includes('m') && showMinute === undefined) {\n showTimeObj.showMinute = false;\n }\n if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {\n showTimeObj.showHour = false;\n }\n if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {\n showTimeObj.use12Hours = true;\n }\n }\n if (picker === 'time') {\n return showTimeObj;\n }\n if (typeof firstFormat === 'function') {\n // format of showTime should use default when format is custom format function\n delete showTimeObj.format;\n }\n return {\n showTime: showTimeObj\n };\n}\nvar DataPickerPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');\nfunction generatePicker(generateConfig) {\n // =========================== Picker ===========================\n var _generateSinglePicker = generateSinglePicker(generateConfig),\n DatePicker = _generateSinglePicker.DatePicker,\n WeekPicker = _generateSinglePicker.WeekPicker,\n MonthPicker = _generateSinglePicker.MonthPicker,\n YearPicker = _generateSinglePicker.YearPicker,\n TimePicker = _generateSinglePicker.TimePicker,\n QuarterPicker = _generateSinglePicker.QuarterPicker;\n // ======================== Range Picker ========================\n var RangePicker = generateRangePicker(generateConfig);\n var MergedDatePicker = DatePicker;\n MergedDatePicker.WeekPicker = WeekPicker;\n MergedDatePicker.MonthPicker = MonthPicker;\n MergedDatePicker.YearPicker = YearPicker;\n MergedDatePicker.RangePicker = RangePicker;\n MergedDatePicker.TimePicker = TimePicker;\n MergedDatePicker.QuarterPicker = QuarterPicker;\n return MergedDatePicker;\n}\nexport default generatePicker;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Button from '../button';\nexport default function PickerButton(props) {\n return /*#__PURE__*/React.createElement(Button, _extends({\n size: \"small\",\n type: \"primary\"\n }, props));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Tag from '../tag';\nexport default function PickerTag(props) {\n return /*#__PURE__*/React.createElement(Tag, _extends({\n color: \"blue\"\n }, props));\n}","import momentGenerateConfig from \"rc-picker/es/generate/moment\";\nimport generatePicker from './generatePicker';\nvar DatePicker = generatePicker(momentGenerateConfig);\nexport default DatePicker;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport DatePicker from '../date-picker';\nimport warning from '../_util/warning';\nvar InternalTimePicker = DatePicker.TimePicker,\n InternalRangePicker = DatePicker.RangePicker;\nvar RangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var dropdownClassName = props.dropdownClassName,\n popupClassName = props.popupClassName;\n return /*#__PURE__*/React.createElement(InternalRangePicker, _extends({}, props, {\n dropdownClassName: dropdownClassName,\n popupClassName: popupClassName,\n picker: \"time\",\n mode: undefined,\n ref: ref\n }));\n});\nvar TimePicker = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var addon = _a.addon,\n renderExtraFooter = _a.renderExtraFooter,\n popupClassName = _a.popupClassName,\n dropdownClassName = _a.dropdownClassName,\n restProps = __rest(_a, [\"addon\", \"renderExtraFooter\", \"popupClassName\", \"dropdownClassName\"]);\n var internalRenderExtraFooter = React.useMemo(function () {\n if (renderExtraFooter) {\n return renderExtraFooter;\n }\n if (addon) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'TimePicker', '`addon` is deprecated. Please use `renderExtraFooter` instead.') : void 0;\n return addon;\n }\n return undefined;\n }, [addon, renderExtraFooter]);\n return /*#__PURE__*/React.createElement(InternalTimePicker, _extends({\n dropdownClassName: dropdownClassName,\n popupClassName: popupClassName\n }, restProps, {\n mode: undefined,\n ref: ref,\n renderExtraFooter: internalRenderExtraFooter\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n TimePicker.displayName = 'TimePicker';\n}\nTimePicker.RangePicker = RangePicker;\nexport default TimePicker;","import React from \"react\";\nimport { DatePicker, TimePicker } from \"antd\";\nconst { RangePicker } = DatePicker;\nexport const CXDatePicker = ({ children, ...props }) => {\n return {children};\n};\nexport const CXRangePicker = ({ children, ...props }) => {\n return {children};\n};\nexport const CXHourPicker = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Divider } from \"antd\";\n\nexport const CXDivider = (props) => {\n return ;\n};\n","export function registerTarget(type, target, manager) {\n var registry = manager.getRegistry();\n var targetId = registry.addTarget(type, target);\n return [targetId, function () {\n return registry.removeTarget(targetId);\n }];\n}\nexport function registerSource(type, source, manager) {\n var registry = manager.getRegistry();\n var sourceId = registry.addSource(type, source);\n return [sourceId, function () {\n return registry.removeSource(sourceId);\n }];\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { invariant } from '@react-dnd/invariant';\nvar isCallingCanDrop = false;\nexport var DropTargetMonitorImpl = /*#__PURE__*/function () {\n function DropTargetMonitorImpl(manager) {\n _classCallCheck(this, DropTargetMonitorImpl);\n\n _defineProperty(this, \"internalMonitor\", void 0);\n\n _defineProperty(this, \"targetId\", null);\n\n this.internalMonitor = manager.getMonitor();\n }\n\n _createClass(DropTargetMonitorImpl, [{\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(targetId) {\n this.targetId = targetId;\n }\n }, {\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.targetId;\n }\n }, {\n key: \"subscribeToStateChange\",\n value: function subscribeToStateChange(listener, options) {\n return this.internalMonitor.subscribeToStateChange(listener, options);\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n // Cut out early if the target id has not been set. This should prevent errors\n // where the user has an older version of dnd-core like in\n // https://github.com/react-dnd/react-dnd/issues/1310\n if (!this.targetId) {\n return false;\n }\n\n invariant(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor');\n\n try {\n isCallingCanDrop = true;\n return this.internalMonitor.canDropOnTarget(this.targetId);\n } finally {\n isCallingCanDrop = false;\n }\n }\n }, {\n key: \"isOver\",\n value: function isOver(options) {\n if (!this.targetId) {\n return false;\n }\n\n return this.internalMonitor.isOverTarget(this.targetId, options);\n }\n }, {\n key: \"getItemType\",\n value: function getItemType() {\n return this.internalMonitor.getItemType();\n }\n }, {\n key: \"getItem\",\n value: function getItem() {\n return this.internalMonitor.getItem();\n }\n }, {\n key: \"getDropResult\",\n value: function getDropResult() {\n return this.internalMonitor.getDropResult();\n }\n }, {\n key: \"didDrop\",\n value: function didDrop() {\n return this.internalMonitor.didDrop();\n }\n }, {\n key: \"getInitialClientOffset\",\n value: function getInitialClientOffset() {\n return this.internalMonitor.getInitialClientOffset();\n }\n }, {\n key: \"getInitialSourceClientOffset\",\n value: function getInitialSourceClientOffset() {\n return this.internalMonitor.getInitialSourceClientOffset();\n }\n }, {\n key: \"getSourceClientOffset\",\n value: function getSourceClientOffset() {\n return this.internalMonitor.getSourceClientOffset();\n }\n }, {\n key: \"getClientOffset\",\n value: function getClientOffset() {\n return this.internalMonitor.getClientOffset();\n }\n }, {\n key: \"getDifferenceFromInitialOffset\",\n value: function getDifferenceFromInitialOffset() {\n return this.internalMonitor.getDifferenceFromInitialOffset();\n }\n }]);\n\n return DropTargetMonitorImpl;\n}();","export function shallowEqual(\n objA: T,\n objB: T,\n compare?: (a: T, b: T, key?: string) => boolean | void,\n compareContext?: any\n) {\n var compareResult = compare\n ? compare.call(compareContext, objA, objB)\n : void 0;\n if (compareResult !== void 0) {\n return !!compareResult;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = (objA as any)[key];\n var valueB = (objB as any)[key];\n\n compareResult = compare\n ? compare.call(compareContext, valueA, valueB, key)\n : void 0;\n\n if (\n compareResult === false ||\n (compareResult === void 0 && valueA !== valueB)\n ) {\n return false;\n }\n }\n\n return true;\n}\n","import { invariant } from '@react-dnd/invariant';\nimport { cloneElement, isValidElement } from 'react';\n\nfunction throwIfCompositeComponentElement(element) {\n // Custom components can no longer be wrapped directly in React DnD 2.0\n // so that we don't need to depend on findDOMNode() from react-dom.\n if (typeof element.type === 'string') {\n return;\n }\n\n var displayName = element.type.displayName || element.type.name || 'the component';\n throw new Error('Only native element nodes can now be passed to React DnD connectors.' + \"You can either wrap \".concat(displayName, \" into a
, or turn it into a \") + 'drag source or a drop target itself.');\n}\n\nfunction wrapHookToRecognizeElement(hook) {\n return function () {\n var elementOrNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n // When passed a node, call the hook straight away.\n if (!isValidElement(elementOrNode)) {\n var node = elementOrNode;\n hook(node, options); // return the node so it can be chained (e.g. when within callback refs\n //
connectDragSource(connectDropTarget(node))}/>\n\n return node;\n } // If passed a ReactElement, clone it and attach this function as a ref.\n // This helps us achieve a neat API where user doesn't even know that refs\n // are being used under the hood.\n\n\n var element = elementOrNode;\n throwIfCompositeComponentElement(element); // When no options are passed, use the hook directly\n\n var ref = options ? function (node) {\n return hook(node, options);\n } : hook;\n return cloneWithRef(element, ref);\n };\n}\n\nexport function wrapConnectorHooks(hooks) {\n var wrappedHooks = {};\n Object.keys(hooks).forEach(function (key) {\n var hook = hooks[key]; // ref objects should be passed straight through without wrapping\n\n if (key.endsWith('Ref')) {\n wrappedHooks[key] = hooks[key];\n } else {\n var wrappedHook = wrapHookToRecognizeElement(hook);\n\n wrappedHooks[key] = function () {\n return wrappedHook;\n };\n }\n });\n return wrappedHooks;\n}\n\nfunction setRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n}\n\nfunction cloneWithRef(element, newRef) {\n var previousRef = element.ref;\n invariant(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a or
. ' + 'Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs');\n\n if (!previousRef) {\n // When there is no ref on the element, use the new ref directly\n return cloneElement(element, {\n ref: newRef\n });\n } else {\n return cloneElement(element, {\n ref: function ref(node) {\n setRef(previousRef, node);\n setRef(newRef, node);\n }\n });\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nexport function isRef(obj) {\n return (// eslint-disable-next-line no-prototype-builtins\n obj !== null && _typeof(obj) === 'object' && Object.prototype.hasOwnProperty.call(obj, 'current')\n );\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { wrapConnectorHooks } from './wrapConnectorHooks';\nimport { isRef } from './isRef';\nexport var TargetConnector = /*#__PURE__*/function () {\n // The drop target may either be attached via ref or connect function\n function TargetConnector(backend) {\n var _this = this;\n\n _classCallCheck(this, TargetConnector);\n\n _defineProperty(this, \"hooks\", wrapConnectorHooks({\n dropTarget: function dropTarget(node, options) {\n _this.clearDropTarget();\n\n _this.dropTargetOptions = options;\n\n if (isRef(node)) {\n _this.dropTargetRef = node;\n } else {\n _this.dropTargetNode = node;\n }\n\n _this.reconnect();\n }\n }));\n\n _defineProperty(this, \"handlerId\", null);\n\n _defineProperty(this, \"dropTargetRef\", null);\n\n _defineProperty(this, \"dropTargetNode\", void 0);\n\n _defineProperty(this, \"dropTargetOptionsInternal\", null);\n\n _defineProperty(this, \"unsubscribeDropTarget\", void 0);\n\n _defineProperty(this, \"lastConnectedHandlerId\", null);\n\n _defineProperty(this, \"lastConnectedDropTarget\", null);\n\n _defineProperty(this, \"lastConnectedDropTargetOptions\", null);\n\n _defineProperty(this, \"backend\", void 0);\n\n this.backend = backend;\n }\n\n _createClass(TargetConnector, [{\n key: \"connectTarget\",\n get: function get() {\n return this.dropTarget;\n }\n }, {\n key: \"reconnect\",\n value: function reconnect() {\n // if nothing has changed then don't resubscribe\n var didChange = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();\n\n if (didChange) {\n this.disconnectDropTarget();\n }\n\n var dropTarget = this.dropTarget;\n\n if (!this.handlerId) {\n return;\n }\n\n if (!dropTarget) {\n this.lastConnectedDropTarget = dropTarget;\n return;\n }\n\n if (didChange) {\n this.lastConnectedHandlerId = this.handlerId;\n this.lastConnectedDropTarget = dropTarget;\n this.lastConnectedDropTargetOptions = this.dropTargetOptions;\n this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, dropTarget, this.dropTargetOptions);\n }\n }\n }, {\n key: \"receiveHandlerId\",\n value: function receiveHandlerId(newHandlerId) {\n if (newHandlerId === this.handlerId) {\n return;\n }\n\n this.handlerId = newHandlerId;\n this.reconnect();\n }\n }, {\n key: \"dropTargetOptions\",\n get: function get() {\n return this.dropTargetOptionsInternal;\n },\n set: function set(options) {\n this.dropTargetOptionsInternal = options;\n }\n }, {\n key: \"didHandlerIdChange\",\n value: function didHandlerIdChange() {\n return this.lastConnectedHandlerId !== this.handlerId;\n }\n }, {\n key: \"didDropTargetChange\",\n value: function didDropTargetChange() {\n return this.lastConnectedDropTarget !== this.dropTarget;\n }\n }, {\n key: \"didOptionsChange\",\n value: function didOptionsChange() {\n return !shallowEqual(this.lastConnectedDropTargetOptions, this.dropTargetOptions);\n }\n }, {\n key: \"disconnectDropTarget\",\n value: function disconnectDropTarget() {\n if (this.unsubscribeDropTarget) {\n this.unsubscribeDropTarget();\n this.unsubscribeDropTarget = undefined;\n }\n }\n }, {\n key: \"dropTarget\",\n get: function get() {\n return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;\n }\n }, {\n key: \"clearDropTarget\",\n value: function clearDropTarget() {\n this.dropTargetRef = null;\n this.dropTargetNode = null;\n }\n }]);\n\n return TargetConnector;\n}();","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nexport function getDecoratedComponent(instanceRef) {\n var currentRef = instanceRef.current;\n\n if (currentRef == null) {\n return null;\n } else if (currentRef.decoratedRef) {\n // go through the private field in decorateHandler to avoid the invariant hit\n return currentRef.decoratedRef.current;\n } else {\n return currentRef;\n }\n}\nexport function isClassComponent(Component) {\n return Component && Component.prototype && typeof Component.prototype.render === 'function';\n}\nexport function isRefForwardingComponent(C) {\n var _item$$$typeof;\n\n var item = C;\n return (item === null || item === void 0 ? void 0 : (_item$$$typeof = item.$$typeof) === null || _item$$$typeof === void 0 ? void 0 : _item$$$typeof.toString()) === 'Symbol(react.forward_ref)';\n}\nexport function isRefable(C) {\n return isClassComponent(C) || isRefForwardingComponent(C);\n}\nexport function checkDecoratorArguments(functionName, signature) {\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i++) {\n var arg = i + 2 < 2 || arguments.length <= i + 2 ? undefined : arguments[i + 2];\n\n if (arg && arg.prototype && arg.prototype.render) {\n // eslint-disable-next-line no-console\n console.error('You seem to be applying the arguments in the wrong order. ' + \"It should be \".concat(functionName, \"(\").concat(signature, \")(Component), not the other way around. \") + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#you-seem-to-be-applying-the-arguments-in-the-wrong-order');\n return;\n }\n }\n }\n}\nexport function isFunction(input) {\n return typeof input === 'function';\n}\nexport function noop() {// noop\n}\n\nfunction isObjectLike(input) {\n return _typeof(input) === 'object' && input !== null;\n}\n\nexport function isPlainObject(input) {\n if (!isObjectLike(input)) {\n return false;\n }\n\n if (Object.getPrototypeOf(input) === null) {\n return true;\n }\n\n var proto = input;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(input) === proto;\n}\nexport function isValidType(type, allowArray) {\n return typeof type === 'string' || _typeof(type) === 'symbol' || !!allowArray && Array.isArray(type) && type.every(function (t) {\n return isValidType(t, false);\n });\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { isFunction, noop } from './utils';\n/**\n * Provides a set of static methods for creating Disposables.\n * @param {Function} action Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n */\n\nexport var Disposable = /*#__PURE__*/function () {\n function Disposable(action) {\n _classCallCheck(this, Disposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"action\", void 0);\n\n this.action = isFunction(action) ? action : noop;\n }\n /** Performs the task of cleaning up resources. */\n\n\n _createClass(Disposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.action();\n this.isDisposed = true;\n }\n }\n }], [{\n key: \"isDisposable\",\n value:\n /**\n * Gets the disposable that does nothing when disposed.\n */\n\n /**\n * Validates whether the given object is a disposable\n * @param {Object} Object to test whether it has a dispose method\n * @returns {Boolean} true if a disposable object, else false.\n */\n function isDisposable(d) {\n return Boolean(d && isFunction(d.dispose));\n }\n }, {\n key: \"_fixup\",\n value: function _fixup(result) {\n return Disposable.isDisposable(result) ? result : Disposable.empty;\n }\n /**\n * Creates a disposable object that invokes the specified action when disposed.\n * @param {Function} dispose Action to run during the first call to dispose.\n * The action is guaranteed to be run at most once.\n * @return {Disposable} The disposable object that runs the given action upon disposal.\n */\n\n }, {\n key: \"create\",\n value: function create(action) {\n return new Disposable(action);\n }\n }]);\n\n return Disposable;\n}();\n/**\n * Represents a group of disposable resources that are disposed together.\n * @constructor\n */\n\n_defineProperty(Disposable, \"empty\", {\n dispose: noop\n});\n\nexport var CompositeDisposable = /*#__PURE__*/function () {\n function CompositeDisposable() {\n _classCallCheck(this, CompositeDisposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"disposables\", void 0);\n\n for (var _len = arguments.length, disposables = new Array(_len), _key = 0; _key < _len; _key++) {\n disposables[_key] = arguments[_key];\n }\n\n this.disposables = disposables;\n }\n /**\n * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.\n * @param {Any} item Disposable to add.\n */\n\n\n _createClass(CompositeDisposable, [{\n key: \"add\",\n value: function add(item) {\n if (this.isDisposed) {\n item.dispose();\n } else {\n this.disposables.push(item);\n }\n }\n /**\n * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.\n * @param {Any} item Disposable to remove.\n * @returns {Boolean} true if found; false otherwise.\n */\n\n }, {\n key: \"remove\",\n value: function remove(item) {\n var shouldDispose = false;\n\n if (!this.isDisposed) {\n var idx = this.disposables.indexOf(item);\n\n if (idx !== -1) {\n shouldDispose = true;\n this.disposables.splice(idx, 1);\n item.dispose();\n }\n }\n\n return shouldDispose;\n }\n /**\n * Disposes all disposables in the group and removes them from the group but\n * does not dispose the CompositeDisposable.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n if (!this.isDisposed) {\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i = 0; _i < len; _i++) {\n currentDisposables[_i].dispose();\n }\n }\n }\n /**\n * Disposes all disposables in the group and removes them from the group.\n */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var len = this.disposables.length;\n var currentDisposables = new Array(len);\n\n for (var i = 0; i < len; i++) {\n currentDisposables[i] = this.disposables[i];\n }\n\n this.disposables = [];\n\n for (var _i2 = 0; _i2 < len; _i2++) {\n currentDisposables[_i2].dispose();\n }\n }\n }\n }]);\n\n return CompositeDisposable;\n}();\n/**\n * Represents a disposable resource whose underlying disposable resource can\n * be replaced by another disposable resource, causing automatic disposal of\n * the previous underlying disposable resource.\n */\n\nexport var SerialDisposable = /*#__PURE__*/function () {\n function SerialDisposable() {\n _classCallCheck(this, SerialDisposable);\n\n _defineProperty(this, \"isDisposed\", false);\n\n _defineProperty(this, \"current\", void 0);\n }\n\n _createClass(SerialDisposable, [{\n key: \"getDisposable\",\n value:\n /**\n * Gets the underlying disposable.\n * @returns {Any} the underlying disposable.\n */\n function getDisposable() {\n return this.current;\n }\n }, {\n key: \"setDisposable\",\n value: function setDisposable(value) {\n var shouldDispose = this.isDisposed;\n\n if (!shouldDispose) {\n var old = this.current;\n this.current = value;\n\n if (old) {\n old.dispose();\n }\n }\n\n if (shouldDispose && value) {\n value.dispose();\n }\n }\n /** Performs the task of cleaning up resources. */\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n if (!this.isDisposed) {\n this.isDisposed = true;\n var old = this.current;\n this.current = undefined;\n\n if (old) {\n old.dispose();\n }\n }\n }\n }]);\n\n return SerialDisposable;\n}();","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { 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\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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createRef, Component } from 'react';\nimport { shallowEqual } from '@react-dnd/shallowequal';\nimport { invariant } from '@react-dnd/invariant';\nimport { DndContext } from '../core';\nimport { isPlainObject } from './utils';\nimport { Disposable, CompositeDisposable, SerialDisposable } from './disposables';\nimport { isRefable } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\nexport function decorateHandler(_ref) {\n var DecoratedComponent = _ref.DecoratedComponent,\n createHandler = _ref.createHandler,\n createMonitor = _ref.createMonitor,\n createConnector = _ref.createConnector,\n registerHandler = _ref.registerHandler,\n containerDisplayName = _ref.containerDisplayName,\n getType = _ref.getType,\n collect = _ref.collect,\n options = _ref.options;\n var _options$arePropsEqua = options.arePropsEqual,\n arePropsEqual = _options$arePropsEqua === void 0 ? shallowEqual : _options$arePropsEqua;\n var Decorated = DecoratedComponent;\n var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';\n\n var DragDropContainer = /*#__PURE__*/function (_Component) {\n _inherits(DragDropContainer, _Component);\n\n var _super = _createSuper(DragDropContainer);\n\n function DragDropContainer(props) {\n var _this;\n\n _classCallCheck(this, DragDropContainer);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"decoratedRef\", createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"handlerId\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"manager\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handlerMonitor\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handlerConnector\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handler\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"disposable\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"currentType\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"handleChange\", function () {\n var nextState = _this.getCurrentState();\n\n if (!shallowEqual(nextState, _this.state)) {\n _this.setState(nextState);\n }\n });\n\n _this.disposable = new SerialDisposable();\n\n _this.receiveProps(props);\n\n _this.dispose();\n\n return _this;\n }\n\n _createClass(DragDropContainer, [{\n key: \"getHandlerId\",\n value: function getHandlerId() {\n return this.handlerId;\n }\n }, {\n key: \"getDecoratedComponentInstance\",\n value: function getDecoratedComponentInstance() {\n invariant(this.decoratedRef.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');\n return this.decoratedRef.current;\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !arePropsEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.disposable = new SerialDisposable();\n this.currentType = undefined;\n this.receiveProps(this.props);\n this.handleChange();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!arePropsEqual(this.props, prevProps)) {\n this.receiveProps(this.props);\n this.handleChange();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.dispose();\n }\n }, {\n key: \"receiveProps\",\n value: function receiveProps(props) {\n if (!this.handler) {\n return;\n }\n\n this.handler.receiveProps(props);\n this.receiveType(getType(props));\n }\n }, {\n key: \"receiveType\",\n value: function receiveType(type) {\n if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {\n return;\n }\n\n if (type === this.currentType) {\n return;\n }\n\n this.currentType = type;\n\n var _registerHandler = registerHandler(type, this.handler, this.manager),\n _registerHandler2 = _slicedToArray(_registerHandler, 2),\n handlerId = _registerHandler2[0],\n unregister = _registerHandler2[1];\n\n this.handlerId = handlerId;\n this.handlerMonitor.receiveHandlerId(handlerId);\n this.handlerConnector.receiveHandlerId(handlerId);\n var globalMonitor = this.manager.getMonitor();\n var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, {\n handlerIds: [handlerId]\n });\n this.disposable.setDisposable(new CompositeDisposable(new Disposable(unsubscribe), new Disposable(unregister)));\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.disposable.dispose();\n\n if (this.handlerConnector) {\n this.handlerConnector.receiveHandlerId(null);\n }\n }\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n if (!this.handlerConnector) {\n return {};\n }\n\n var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor, this.props);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(isPlainObject(nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);\n }\n\n return nextState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return _jsx(DndContext.Consumer, {\n children: function children(_ref2) {\n var dragDropManager = _ref2.dragDropManager;\n\n _this2.receiveDragDropManager(dragDropManager);\n\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(function () {\n var _this2$handlerConnect;\n\n return (_this2$handlerConnect = _this2.handlerConnector) === null || _this2$handlerConnect === void 0 ? void 0 : _this2$handlerConnect.reconnect();\n });\n }\n\n return _jsx(Decorated, Object.assign({}, _this2.props, _this2.getCurrentState(), {\n // NOTE: if Decorated is a Function Component, decoratedRef will not be populated unless it's a refforwarding component.\n ref: isRefable(Decorated) ? _this2.decoratedRef : null\n }), void 0);\n }\n }, void 0);\n }\n }, {\n key: \"receiveDragDropManager\",\n value: function receiveDragDropManager(dragDropManager) {\n if (this.manager !== undefined) {\n return;\n }\n\n invariant(dragDropManager !== undefined, 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to render a DndProvider component in your top-level component. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);\n\n if (dragDropManager === undefined) {\n return;\n }\n\n this.manager = dragDropManager;\n this.handlerMonitor = createMonitor(dragDropManager);\n this.handlerConnector = createConnector(dragDropManager.getBackend());\n this.handler = createHandler(this.handlerMonitor, this.decoratedRef);\n }\n }]);\n\n return DragDropContainer;\n }(Component);\n\n _defineProperty(DragDropContainer, \"DecoratedComponent\", DecoratedComponent);\n\n _defineProperty(DragDropContainer, \"displayName\", \"\".concat(containerDisplayName, \"(\").concat(displayName, \")\"));\n\n return hoistStatics(DragDropContainer, DecoratedComponent);\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { invariant } from '@react-dnd/invariant';\nimport { isPlainObject, getDecoratedComponent } from './utils';\nvar ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];\n\nvar TargetImpl = /*#__PURE__*/function () {\n function TargetImpl(spec, monitor, ref) {\n _classCallCheck(this, TargetImpl);\n\n _defineProperty(this, \"props\", null);\n\n _defineProperty(this, \"spec\", void 0);\n\n _defineProperty(this, \"monitor\", void 0);\n\n _defineProperty(this, \"ref\", void 0);\n\n this.spec = spec;\n this.monitor = monitor;\n this.ref = ref;\n }\n\n _createClass(TargetImpl, [{\n key: \"receiveProps\",\n value: function receiveProps(props) {\n this.props = props;\n }\n }, {\n key: \"receiveMonitor\",\n value: function receiveMonitor(monitor) {\n this.monitor = monitor;\n }\n }, {\n key: \"canDrop\",\n value: function canDrop() {\n if (!this.spec.canDrop) {\n return true;\n }\n\n return this.spec.canDrop(this.props, this.monitor);\n }\n }, {\n key: \"hover\",\n value: function hover() {\n if (!this.spec.hover || !this.props) {\n return;\n }\n\n this.spec.hover(this.props, this.monitor, getDecoratedComponent(this.ref));\n }\n }, {\n key: \"drop\",\n value: function drop() {\n if (!this.spec.drop) {\n return undefined;\n }\n\n var dropResult = this.spec.drop(this.props, this.monitor, this.ref.current);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(typeof dropResult === 'undefined' || isPlainObject(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', dropResult);\n }\n\n return dropResult;\n }\n }]);\n\n return TargetImpl;\n}();\n\nexport function createTargetFactory(spec) {\n Object.keys(spec).forEach(function (key) {\n invariant(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected \"%s\" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', ALLOWED_SPEC_METHODS.join(', '), key);\n invariant(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', key, key, spec[key]);\n });\n return function createTarget(monitor, ref) {\n return new TargetImpl(spec, monitor, ref);\n };\n}","import { DropTarget } from \"react-dnd\";\n\nimport \"./style.css\";\n\nconst CXDropable = ({ canDrop, isOver, connectDropTarget, children }) => {\n const isActive = canDrop && isOver;\n let backgroundColor = \"#222\";\n if (isActive) {\n backgroundColor = \"darkgreen\";\n } else if (canDrop) {\n backgroundColor = \"darkkhaki\";\n }\n return (\n \n {children}\n
\n );\n};\nexport default DropTarget(\n \"BOX\",\n {\n drop: () => ({ id: \"CXDropable\" }),\n },\n (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop(),\n })\n)(CXDropable);\n","import { invariant } from '@react-dnd/invariant';\nimport { TargetConnector, DropTargetMonitorImpl, registerTarget } from '../internals';\nimport { isPlainObject, isValidType } from './utils';\nimport { checkDecoratorArguments } from './utils';\nimport { decorateHandler } from './decorateHandler';\nimport { createTargetFactory } from './createTargetFactory';\n/**\n * @param type The accepted target type\n * @param spec The DropTarget specification\n * @param collect The props collector function\n * @param options Options\n */\n\nexport function DropTarget(type, spec, collect) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n checkDecoratorArguments('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);\n var getType = type;\n\n if (typeof type !== 'function') {\n invariant(isValidType(type, true), 'Expected \"type\" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', type);\n\n getType = function getType() {\n return type;\n };\n }\n\n invariant(isPlainObject(spec), 'Expected \"spec\" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', spec);\n var createTarget = createTargetFactory(spec);\n invariant(typeof collect === 'function', 'Expected \"collect\" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n invariant(isPlainObject(options), 'Expected \"options\" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);\n return function decorateTarget(DecoratedComponent) {\n return decorateHandler({\n containerDisplayName: 'DropTarget',\n createHandler: createTarget,\n registerHandler: registerTarget,\n createMonitor: function createMonitor(manager) {\n return new DropTargetMonitorImpl(manager);\n },\n createConnector: function createConnector(backend) {\n return new TargetConnector(backend);\n },\n DecoratedComponent: DecoratedComponent,\n getType: getType,\n collect: collect,\n options: options\n });\n };\n}","import React from \"react\";\nimport { Dropdown } from \"antd\";\n\nexport const CXDropdown = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Empty } from \"antd\";\n\nexport const CXEmpty = (props) => {\n return ;\n};\n","import { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport OAuthPopup from \"component/OAuthPopup\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport React, { useState } from \"react\";\nimport { truncateSt } from \"utils\";\n\nconst Index = ({ storeFacebook, Loading, addSettings, metaId }) => {\n const [SelectType, setSelectType] = useState(false);\n return (\n
\n
\n
\n {SelectType && (\n \n \n
\n \n Existing whatsApp number\n \n
\n
\n \n
\n \n Register new number\n \n
\n
\n
\n )}\n {!SelectType && (\n setSelectType(true)}\n >\n
\n {\" \"}\n Connect your facebook account\n
\n
\n \n Login with Facebook\n \n
\n
\n )}\n
\n
\n
\n {storeFacebook &&\n storeFacebook?.data?.map((item) => (\n addSettings(item._id, item.wabaId)}\n >\n
\n \n
\n
\n {truncateSt(item?.dtls?.name, 26)}\n
\n \n ))}\n {Loading && storeFacebook?.length === 0 && (\n \n \n \n )}\n
\n
\n );\n};\n\nexport default Index;\n","import React from \"react\";\nimport { Form } from \"antd\";\n\nexport const CXForm = (props) => {\n return
;\n};\n\nexport const CXFormItem = (props) => {\n return ;\n};\nexport const CXFormList = (props) => {\n return ;\n};\n","import ReactMarkdown from \"react-markdown\";\n\nexport const InfoBox = ({ text, HaveClick = false }) => {\n return (\n
\n
\n \"img\"\n
\n {!HaveClick && (\n
\n {text}\n
\n )}\n {HaveClick &&
{text}
}\n
\n );\n};\n","// This icon file is generated automatically.\nvar UpOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z\" } }] }, \"name\": \"up\", \"theme\": \"outlined\" };\nexport default UpOutlined;\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 UpOutlinedSvg from \"@ant-design/icons-svg/es/asn/UpOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar UpOutlined = function UpOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: UpOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(UpOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'UpOutlined';\n}\nexport default RefIcon;","export function supportBigInt() {\n return typeof BigInt === 'function';\n}","import { supportBigInt } from './supportUtil';\n/**\n * Format string number to readable number\n */\nexport function trimNumber(numStr) {\n var str = numStr.trim();\n var negative = str.startsWith('-');\n if (negative) {\n str = str.slice(1);\n }\n str = str\n // Remove decimal 0. `1.000` => `1.`, `1.100` => `1.1`\n .replace(/(\\.\\d*[^0])0*$/, '$1')\n // Remove useless decimal. `1.` => `1`\n .replace(/\\.0*$/, '')\n // Remove integer 0. `0001` => `1`, 000.1' => `.1`\n .replace(/^0+/, '');\n if (str.startsWith('.')) {\n str = \"0\".concat(str);\n }\n var trimStr = str || '0';\n var splitNumber = trimStr.split('.');\n var integerStr = splitNumber[0] || '0';\n var decimalStr = splitNumber[1] || '0';\n if (integerStr === '0' && decimalStr === '0') {\n negative = false;\n }\n var negativeStr = negative ? '-' : '';\n return {\n negative: negative,\n negativeStr: negativeStr,\n trimStr: trimStr,\n integerStr: integerStr,\n decimalStr: decimalStr,\n fullStr: \"\".concat(negativeStr).concat(trimStr)\n };\n}\nexport function isE(number) {\n var str = String(number);\n return !Number.isNaN(Number(str)) && str.includes('e');\n}\n/**\n * [Legacy] Convert 1e-9 to 0.000000001.\n * This may lose some precision if user really want 1e-9.\n */\nexport function getNumberPrecision(number) {\n var numStr = String(number);\n if (isE(number)) {\n var precision = Number(numStr.slice(numStr.indexOf('e-') + 2));\n var decimalMatch = numStr.match(/\\.(\\d+)/);\n if (decimalMatch === null || decimalMatch === void 0 ? void 0 : decimalMatch[1]) {\n precision += decimalMatch[1].length;\n }\n return precision;\n }\n return numStr.includes('.') && validateNumber(numStr) ? numStr.length - numStr.indexOf('.') - 1 : 0;\n}\n/**\n * Convert number (includes scientific notation) to -xxx.yyy format\n */\nexport function num2str(number) {\n var numStr = String(number);\n if (isE(number)) {\n if (number > Number.MAX_SAFE_INTEGER) {\n return String(supportBigInt() ? BigInt(number).toString() : Number.MAX_SAFE_INTEGER);\n }\n if (number < Number.MIN_SAFE_INTEGER) {\n return String(supportBigInt() ? BigInt(number).toString() : Number.MIN_SAFE_INTEGER);\n }\n numStr = number.toFixed(getNumberPrecision(numStr));\n }\n return trimNumber(numStr).fullStr;\n}\nexport function validateNumber(num) {\n if (typeof num === 'number') {\n return !Number.isNaN(num);\n }\n // Empty\n if (!num) {\n return false;\n }\n return (\n // Normal type: 11.28\n /^\\s*-?\\d+(\\.\\d+)?\\s*$/.test(num) ||\n // Pre-number: 1.\n /^\\s*-?\\d+\\.\\s*$/.test(num) ||\n // Post-number: .1\n /^\\s*-?\\.\\d+\\s*$/.test(num)\n );\n}\nexport function getDecupleSteps(step) {\n var stepStr = typeof step === 'number' ? num2str(step) : trimNumber(step).fullStr;\n var hasPoint = stepStr.includes('.');\n if (!hasPoint) {\n return step + '0';\n }\n return trimNumber(stepStr.replace(/(\\d)\\.(\\d)/g, '$1$2.')).fullStr;\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\n/* eslint-disable max-classes-per-file */\nimport { getNumberPrecision, isE, num2str, trimNumber, validateNumber } from './numberUtil';\nimport { supportBigInt } from './supportUtil';\n/**\n * We can remove this when IE not support anymore\n */\nexport var NumberDecimal = /*#__PURE__*/function () {\n function NumberDecimal(value) {\n _classCallCheck(this, NumberDecimal);\n this.origin = '';\n this.number = void 0;\n this.empty = void 0;\n if (!value && value !== 0 || !String(value).trim()) {\n this.empty = true;\n return;\n }\n this.origin = String(value);\n this.number = Number(value);\n }\n _createClass(NumberDecimal, [{\n key: \"negate\",\n value: function negate() {\n return new NumberDecimal(-this.toNumber());\n }\n }, {\n key: \"add\",\n value: function add(value) {\n if (this.isInvalidate()) {\n return new NumberDecimal(value);\n }\n var target = Number(value);\n if (Number.isNaN(target)) {\n return this;\n }\n var number = this.number + target;\n // [Legacy] Back to safe integer\n if (number > Number.MAX_SAFE_INTEGER) {\n return new NumberDecimal(Number.MAX_SAFE_INTEGER);\n }\n if (number < Number.MIN_SAFE_INTEGER) {\n return new NumberDecimal(Number.MIN_SAFE_INTEGER);\n }\n var maxPrecision = Math.max(getNumberPrecision(this.number), getNumberPrecision(target));\n return new NumberDecimal(number.toFixed(maxPrecision));\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n return this.empty;\n }\n }, {\n key: \"isNaN\",\n value: function isNaN() {\n return Number.isNaN(this.number);\n }\n }, {\n key: \"isInvalidate\",\n value: function isInvalidate() {\n return this.isEmpty() || this.isNaN();\n }\n }, {\n key: \"equals\",\n value: function equals(target) {\n return this.toNumber() === (target === null || target === void 0 ? void 0 : target.toNumber());\n }\n }, {\n key: \"lessEquals\",\n value: function lessEquals(target) {\n return this.add(target.negate().toString()).toNumber() <= 0;\n }\n }, {\n key: \"toNumber\",\n value: function toNumber() {\n return this.number;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var safe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n if (!safe) {\n return this.origin;\n }\n if (this.isInvalidate()) {\n return '';\n }\n return num2str(this.number);\n }\n }]);\n return NumberDecimal;\n}();\nexport var BigIntDecimal = /*#__PURE__*/function () {\n /** BigInt will convert `0009` to `9`. We need record the len of decimal */\n\n function BigIntDecimal(value) {\n _classCallCheck(this, BigIntDecimal);\n this.origin = '';\n this.negative = void 0;\n this.integer = void 0;\n this.decimal = void 0;\n this.decimalLen = void 0;\n this.empty = void 0;\n this.nan = void 0;\n if (!value && value !== 0 || !String(value).trim()) {\n this.empty = true;\n return;\n }\n this.origin = String(value);\n // Act like Number convert\n if (value === '-') {\n this.nan = true;\n return;\n }\n var mergedValue = value;\n // We need convert back to Number since it require `toFixed` to handle this\n if (isE(mergedValue)) {\n mergedValue = Number(mergedValue);\n }\n mergedValue = typeof mergedValue === 'string' ? mergedValue : num2str(mergedValue);\n if (validateNumber(mergedValue)) {\n var trimRet = trimNumber(mergedValue);\n this.negative = trimRet.negative;\n var numbers = trimRet.trimStr.split('.');\n this.integer = BigInt(numbers[0]);\n var decimalStr = numbers[1] || '0';\n this.decimal = BigInt(decimalStr);\n this.decimalLen = decimalStr.length;\n } else {\n this.nan = true;\n }\n }\n _createClass(BigIntDecimal, [{\n key: \"getMark\",\n value: function getMark() {\n return this.negative ? '-' : '';\n }\n }, {\n key: \"getIntegerStr\",\n value: function getIntegerStr() {\n return this.integer.toString();\n }\n }, {\n key: \"getDecimalStr\",\n value: function getDecimalStr() {\n return this.decimal.toString().padStart(this.decimalLen, '0');\n }\n /**\n * Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000\n * This is used for add function only.\n */\n }, {\n key: \"alignDecimal\",\n value: function alignDecimal(decimalLength) {\n var str = \"\".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(decimalLength, '0'));\n return BigInt(str);\n }\n }, {\n key: \"negate\",\n value: function negate() {\n var clone = new BigIntDecimal(this.toString());\n clone.negative = !clone.negative;\n return clone;\n }\n }, {\n key: \"add\",\n value: function add(value) {\n if (this.isInvalidate()) {\n return new BigIntDecimal(value);\n }\n var offset = new BigIntDecimal(value);\n if (offset.isInvalidate()) {\n return this;\n }\n var maxDecimalLength = Math.max(this.getDecimalStr().length, offset.getDecimalStr().length);\n var myAlignedDecimal = this.alignDecimal(maxDecimalLength);\n var offsetAlignedDecimal = offset.alignDecimal(maxDecimalLength);\n var valueStr = (myAlignedDecimal + offsetAlignedDecimal).toString();\n // We need fill string length back to `maxDecimalLength` to avoid parser failed\n var _trimNumber = trimNumber(valueStr),\n negativeStr = _trimNumber.negativeStr,\n trimStr = _trimNumber.trimStr;\n var hydrateValueStr = \"\".concat(negativeStr).concat(trimStr.padStart(maxDecimalLength + 1, '0'));\n return new BigIntDecimal(\"\".concat(hydrateValueStr.slice(0, -maxDecimalLength), \".\").concat(hydrateValueStr.slice(-maxDecimalLength)));\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n return this.empty;\n }\n }, {\n key: \"isNaN\",\n value: function isNaN() {\n return this.nan;\n }\n }, {\n key: \"isInvalidate\",\n value: function isInvalidate() {\n return this.isEmpty() || this.isNaN();\n }\n }, {\n key: \"equals\",\n value: function equals(target) {\n return this.toString() === (target === null || target === void 0 ? void 0 : target.toString());\n }\n }, {\n key: \"lessEquals\",\n value: function lessEquals(target) {\n return this.add(target.negate().toString()).toNumber() <= 0;\n }\n }, {\n key: \"toNumber\",\n value: function toNumber() {\n if (this.isNaN()) {\n return NaN;\n }\n return Number(this.toString());\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var safe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n if (!safe) {\n return this.origin;\n }\n if (this.isInvalidate()) {\n return '';\n }\n return trimNumber(\"\".concat(this.getMark()).concat(this.getIntegerStr(), \".\").concat(this.getDecimalStr())).fullStr;\n }\n }]);\n return BigIntDecimal;\n}();\nexport default function getMiniDecimal(value) {\n // We use BigInt here.\n // Will fallback to Number if not support.\n if (supportBigInt()) {\n return new BigIntDecimal(value);\n }\n return new NumberDecimal(value);\n}\n/**\n * Align the logic of toFixed to around like 1.5 => 2.\n * If set `cutOnly`, will just remove the over decimal part.\n */\nexport function toFixed(numStr, separatorStr, precision) {\n var cutOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n if (numStr === '') {\n return '';\n }\n var _trimNumber2 = trimNumber(numStr),\n negativeStr = _trimNumber2.negativeStr,\n integerStr = _trimNumber2.integerStr,\n decimalStr = _trimNumber2.decimalStr;\n var precisionDecimalStr = \"\".concat(separatorStr).concat(decimalStr);\n var numberWithoutDecimal = \"\".concat(negativeStr).concat(integerStr);\n if (precision >= 0) {\n // We will get last + 1 number to check if need advanced number\n var advancedNum = Number(decimalStr[precision]);\n if (advancedNum >= 5 && !cutOnly) {\n var advancedDecimal = getMiniDecimal(numStr).add(\"\".concat(negativeStr, \"0.\").concat('0'.repeat(precision)).concat(10 - advancedNum));\n return toFixed(advancedDecimal.toString(), separatorStr, precision, cutOnly);\n }\n if (precision === 0) {\n return numberWithoutDecimal;\n }\n return \"\".concat(numberWithoutDecimal).concat(separatorStr).concat(decimalStr.padEnd(precision, '0').slice(0, precision));\n }\n if (precisionDecimalStr === '.0') {\n return numberWithoutDecimal;\n }\n return \"\".concat(numberWithoutDecimal).concat(precisionDecimalStr);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/* eslint-disable react/no-unknown-property */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport isMobile from \"rc-util/es/isMobile\";\n/**\n * When click and hold on a button - the speed of auto changing the value.\n */\nvar STEP_INTERVAL = 200;\n/**\n * When click and hold on a button - the delay before auto changing the value.\n */\nvar STEP_DELAY = 600;\nexport default function StepHandler(_ref) {\n var prefixCls = _ref.prefixCls,\n upNode = _ref.upNode,\n downNode = _ref.downNode,\n upDisabled = _ref.upDisabled,\n downDisabled = _ref.downDisabled,\n onStep = _ref.onStep;\n // ======================== Step ========================\n var stepTimeoutRef = React.useRef();\n var onStepRef = React.useRef();\n onStepRef.current = onStep;\n // We will interval update step when hold mouse down\n var onStepMouseDown = function onStepMouseDown(e, up) {\n e.preventDefault();\n onStepRef.current(up);\n // Loop step for interval\n function loopStep() {\n onStepRef.current(up);\n stepTimeoutRef.current = setTimeout(loopStep, STEP_INTERVAL);\n }\n // First time press will wait some time to trigger loop step update\n stepTimeoutRef.current = setTimeout(loopStep, STEP_DELAY);\n };\n var onStopStep = function onStopStep() {\n clearTimeout(stepTimeoutRef.current);\n };\n React.useEffect(function () {\n return onStopStep;\n }, []);\n // ======================= Render =======================\n if (isMobile()) {\n return null;\n }\n var handlerClassName = \"\".concat(prefixCls, \"-handler\");\n var upClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-up\"), _defineProperty({}, \"\".concat(handlerClassName, \"-up-disabled\"), upDisabled));\n var downClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-down\"), _defineProperty({}, \"\".concat(handlerClassName, \"-down-disabled\"), downDisabled));\n var sharedHandlerProps = {\n unselectable: 'on',\n role: 'button',\n onMouseUp: onStopStep,\n onMouseLeave: onStopStep\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(handlerClassName, \"-wrap\")\n }, /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n onMouseDown: function onMouseDown(e) {\n onStepMouseDown(e, true);\n },\n \"aria-label\": \"Increase Value\",\n \"aria-disabled\": upDisabled,\n className: upClassName\n }), upNode || /*#__PURE__*/React.createElement(\"span\", {\n unselectable: \"on\",\n className: \"\".concat(prefixCls, \"-handler-up-inner\")\n })), /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n onMouseDown: function onMouseDown(e) {\n onStepMouseDown(e, false);\n },\n \"aria-label\": \"Decrease Value\",\n \"aria-disabled\": downDisabled,\n className: downClassName\n }), downNode || /*#__PURE__*/React.createElement(\"span\", {\n unselectable: \"on\",\n className: \"\".concat(prefixCls, \"-handler-down-inner\")\n })));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"min\", \"max\", \"step\", \"defaultValue\", \"value\", \"disabled\", \"readOnly\", \"upHandler\", \"downHandler\", \"keyboard\", \"controls\", \"stringMode\", \"parser\", \"formatter\", \"precision\", \"decimalSeparator\", \"onChange\", \"onInput\", \"onPressEnter\", \"onStep\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport getMiniDecimal, { toFixed } from './utils/MiniDecimal';\nimport StepHandler from './StepHandler';\nimport { getNumberPrecision, num2str, getDecupleSteps, validateNumber } from './utils/numberUtil';\nimport useCursor from './hooks/useCursor';\nimport useFrame from './hooks/useFrame';\n/**\n * We support `stringMode` which need handle correct type when user call in onChange\n * format max or min value\n * 1. if isInvalid return null\n * 2. if precision is undefined, return decimal\n * 3. format with precision\n * I. if max > 0, round down with precision. Example: max= 3.5, precision=0 afterFormat: 3\n * II. if max < 0, round up with precision. Example: max= -3.5, precision=0 afterFormat: -4\n * III. if min > 0, round up with precision. Example: min= 3.5, precision=0 afterFormat: 4\n * IV. if min < 0, round down with precision. Example: max= -3.5, precision=0 afterFormat: -3\n */\nvar getDecimalValue = function getDecimalValue(stringMode, decimalValue) {\n if (stringMode || decimalValue.isEmpty()) {\n return decimalValue.toString();\n }\n return decimalValue.toNumber();\n};\nvar getDecimalIfValidate = function getDecimalIfValidate(value) {\n var decimal = getMiniDecimal(value);\n return decimal.isInvalidate() ? null : decimal;\n};\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _classNames;\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,\n className = props.className,\n style = props.style,\n min = props.min,\n max = props.max,\n _props$step = props.step,\n step = _props$step === void 0 ? 1 : _props$step,\n defaultValue = props.defaultValue,\n value = props.value,\n disabled = props.disabled,\n readOnly = props.readOnly,\n upHandler = props.upHandler,\n downHandler = props.downHandler,\n keyboard = props.keyboard,\n _props$controls = props.controls,\n controls = _props$controls === void 0 ? true : _props$controls,\n stringMode = props.stringMode,\n parser = props.parser,\n formatter = props.formatter,\n precision = props.precision,\n decimalSeparator = props.decimalSeparator,\n onChange = props.onChange,\n onInput = props.onInput,\n onPressEnter = props.onPressEnter,\n onStep = props.onStep,\n inputProps = _objectWithoutProperties(props, _excluded);\n var inputClassName = \"\".concat(prefixCls, \"-input\");\n var inputRef = React.useRef(null);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focus = _React$useState2[0],\n setFocus = _React$useState2[1];\n var userTypingRef = React.useRef(false);\n var compositionRef = React.useRef(false);\n var shiftKeyRef = React.useRef(false);\n // ============================ Value =============================\n // Real value control\n var _React$useState3 = React.useState(function () {\n return getMiniDecimal(value !== null && value !== void 0 ? value : defaultValue);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n decimalValue = _React$useState4[0],\n setDecimalValue = _React$useState4[1];\n function setUncontrolledDecimalValue(newDecimal) {\n if (value === undefined) {\n setDecimalValue(newDecimal);\n }\n }\n // ====================== Parser & Formatter ======================\n /**\n * `precision` is used for formatter & onChange.\n * It will auto generate by `value` & `step`.\n * But it will not block user typing.\n *\n * Note: Auto generate `precision` is used for legacy logic.\n * We should remove this since we already support high precision with BigInt.\n *\n * @param number Provide which number should calculate precision\n * @param userTyping Change by user typing\n */\n var getPrecision = React.useCallback(function (numStr, userTyping) {\n if (userTyping) {\n return undefined;\n }\n if (precision >= 0) {\n return precision;\n }\n return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));\n }, [precision, step]);\n // >>> Parser\n var mergedParser = React.useCallback(function (num) {\n var numStr = String(num);\n if (parser) {\n return parser(numStr);\n }\n var parsedStr = numStr;\n if (decimalSeparator) {\n parsedStr = parsedStr.replace(decimalSeparator, '.');\n }\n // [Legacy] We still support auto convert `$ 123,456` to `123456`\n return parsedStr.replace(/[^\\w.-]+/g, '');\n }, [parser, decimalSeparator]);\n // >>> Formatter\n var inputValueRef = React.useRef('');\n var mergedFormatter = React.useCallback(function (number, userTyping) {\n if (formatter) {\n return formatter(number, {\n userTyping: userTyping,\n input: String(inputValueRef.current)\n });\n }\n var str = typeof number === 'number' ? num2str(number) : number;\n // User typing will not auto format with precision directly\n if (!userTyping) {\n var mergedPrecision = getPrecision(str, userTyping);\n if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {\n // Separator\n var separatorStr = decimalSeparator || '.';\n str = toFixed(str, separatorStr, mergedPrecision);\n }\n }\n return str;\n }, [formatter, getPrecision, decimalSeparator]);\n // ========================== InputValue ==========================\n /**\n * Input text value control\n *\n * User can not update input content directly. It update with follow rules by priority:\n * 1. controlled `value` changed\n * * [SPECIAL] Typing like `1.` should not immediately convert to `1`\n * 2. User typing with format (not precision)\n * 3. Blur or Enter trigger revalidate\n */\n var _React$useState5 = React.useState(function () {\n var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;\n if (decimalValue.isInvalidate() && ['string', 'number'].includes(_typeof(initValue))) {\n return Number.isNaN(initValue) ? '' : initValue;\n }\n return mergedFormatter(decimalValue.toString(), false);\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n inputValue = _React$useState6[0],\n setInternalInputValue = _React$useState6[1];\n inputValueRef.current = inputValue;\n // Should always be string\n function setInputValue(newValue, userTyping) {\n setInternalInputValue(mergedFormatter(\n // Invalidate number is sometime passed by external control, we should let it go\n // Otherwise is controlled by internal interactive logic which check by userTyping\n // You can ref 'show limited value when input is not focused' test for more info.\n newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n }\n // >>> Max & Min limit\n var maxDecimal = React.useMemo(function () {\n return getDecimalIfValidate(max);\n }, [max, precision]);\n var minDecimal = React.useMemo(function () {\n return getDecimalIfValidate(min);\n }, [min, precision]);\n var upDisabled = React.useMemo(function () {\n if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return maxDecimal.lessEquals(decimalValue);\n }, [maxDecimal, decimalValue]);\n var downDisabled = React.useMemo(function () {\n if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return decimalValue.lessEquals(minDecimal);\n }, [minDecimal, decimalValue]);\n // Cursor controller\n var _useCursor = useCursor(inputRef.current, focus),\n _useCursor2 = _slicedToArray(_useCursor, 2),\n recordCursor = _useCursor2[0],\n restoreCursor = _useCursor2[1];\n // ============================= Data =============================\n /**\n * Find target value closet within range.\n * e.g. [11, 28]:\n * 3 => 11\n * 23 => 23\n * 99 => 28\n */\n var getRangeValue = function getRangeValue(target) {\n // target > max\n if (maxDecimal && !target.lessEquals(maxDecimal)) {\n return maxDecimal;\n }\n // target < min\n if (minDecimal && !minDecimal.lessEquals(target)) {\n return minDecimal;\n }\n return null;\n };\n /**\n * Check value is in [min, max] range\n */\n var isInRange = function isInRange(target) {\n return !getRangeValue(target);\n };\n /**\n * Trigger `onChange` if value validated and not equals of origin.\n * Return the value that re-align in range.\n */\n var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {\n var updateValue = newValue;\n var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();\n // Skip align value when trigger value is empty.\n // We just trigger onChange(null)\n // This should not block user typing\n if (!updateValue.isEmpty() && !userTyping) {\n // Revert value in range if needed\n updateValue = getRangeValue(updateValue) || updateValue;\n isRangeValidate = true;\n }\n if (!readOnly && !disabled && isRangeValidate) {\n var numStr = updateValue.toString();\n var mergedPrecision = getPrecision(numStr, userTyping);\n if (mergedPrecision >= 0) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision));\n // When to fixed. The value may out of min & max range.\n // 4 in [0, 3.8] => 3.8 => 4 (toFixed)\n if (!isInRange(updateValue)) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision, true));\n }\n }\n // Trigger event\n if (!updateValue.equals(decimalValue)) {\n setUncontrolledDecimalValue(updateValue);\n onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));\n // Reformat input if value is not controlled\n if (value === undefined) {\n setInputValue(updateValue, userTyping);\n }\n }\n return updateValue;\n }\n return decimalValue;\n };\n // ========================== User Input ==========================\n var onNextPromise = useFrame();\n // >>> Collect input value\n var collectInputValue = function collectInputValue(inputStr) {\n recordCursor();\n // Update inputValue incase input can not parse as number\n setInternalInputValue(inputStr);\n // Parse number\n if (!compositionRef.current) {\n var finalValue = mergedParser(inputStr);\n var finalDecimal = getMiniDecimal(finalValue);\n if (!finalDecimal.isNaN()) {\n triggerValueUpdate(finalDecimal, true);\n }\n }\n // Trigger onInput later to let user customize value if they want do handle something after onChange\n onInput === null || onInput === void 0 ? void 0 : onInput(inputStr);\n // optimize for chinese input experience\n // https://github.com/ant-design/ant-design/issues/8196\n onNextPromise(function () {\n var nextInputStr = inputStr;\n if (!parser) {\n nextInputStr = inputStr.replace(/。/g, '.');\n }\n if (nextInputStr !== inputStr) {\n collectInputValue(nextInputStr);\n }\n });\n };\n // >>> Composition\n var onCompositionStart = function onCompositionStart() {\n compositionRef.current = true;\n };\n var onCompositionEnd = function onCompositionEnd() {\n compositionRef.current = false;\n collectInputValue(inputRef.current.value);\n };\n // >>> Input\n var onInternalInput = function onInternalInput(e) {\n collectInputValue(e.target.value);\n };\n // ============================= Step =============================\n var onInternalStep = function onInternalStep(up) {\n var _inputRef$current;\n // Ignore step since out of range\n if (up && upDisabled || !up && downDisabled) {\n return;\n }\n // Clear typing status since it may caused by up & down key.\n // We should sync with input value.\n userTypingRef.current = false;\n var stepDecimal = getMiniDecimal(shiftKeyRef.current ? getDecupleSteps(step) : step);\n if (!up) {\n stepDecimal = stepDecimal.negate();\n }\n var target = (decimalValue || getMiniDecimal(0)).add(stepDecimal.toString());\n var updatedValue = triggerValueUpdate(target, false);\n onStep === null || onStep === void 0 ? void 0 : onStep(getDecimalValue(stringMode, updatedValue), {\n offset: shiftKeyRef.current ? getDecupleSteps(step) : step,\n type: up ? 'up' : 'down'\n });\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();\n };\n // ============================ Flush =============================\n /**\n * Flush current input content to trigger value change & re-formatter input if needed\n */\n var flushInputValue = function flushInputValue(userTyping) {\n var parsedValue = getMiniDecimal(mergedParser(inputValue));\n var formatValue = parsedValue;\n if (!parsedValue.isNaN()) {\n // Only validate value or empty value can be re-fill to inputValue\n // Reassign the formatValue within ranged of trigger control\n formatValue = triggerValueUpdate(parsedValue, userTyping);\n } else {\n formatValue = decimalValue;\n }\n if (value !== undefined) {\n // Reset back with controlled value first\n setInputValue(decimalValue, false);\n } else if (!formatValue.isNaN()) {\n // Reset input back since no validate value\n setInputValue(formatValue, false);\n }\n };\n // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)\n var onBeforeInput = function onBeforeInput() {\n userTypingRef.current = true;\n };\n var onKeyDown = function onKeyDown(event) {\n var which = event.which,\n shiftKey = event.shiftKey;\n userTypingRef.current = true;\n if (shiftKey) {\n shiftKeyRef.current = true;\n } else {\n shiftKeyRef.current = false;\n }\n if (which === KeyCode.ENTER) {\n if (!compositionRef.current) {\n userTypingRef.current = false;\n }\n flushInputValue(false);\n onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event);\n }\n if (keyboard === false) {\n return;\n }\n // Do step\n if (!compositionRef.current && [KeyCode.UP, KeyCode.DOWN].includes(which)) {\n onInternalStep(KeyCode.UP === which);\n event.preventDefault();\n }\n };\n var onKeyUp = function onKeyUp() {\n userTypingRef.current = false;\n shiftKeyRef.current = false;\n };\n // >>> Focus & Blur\n var onBlur = function onBlur() {\n flushInputValue(false);\n setFocus(false);\n userTypingRef.current = false;\n };\n // ========================== Controlled ==========================\n // Input by precision\n useLayoutUpdateEffect(function () {\n if (!decimalValue.isInvalidate()) {\n setInputValue(decimalValue, false);\n }\n }, [precision]);\n // Input by value\n useLayoutUpdateEffect(function () {\n var newValue = getMiniDecimal(value);\n setDecimalValue(newValue);\n var currentParsedValue = getMiniDecimal(mergedParser(inputValue));\n // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.\n // But let it go if user set `formatter`\n if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {\n // Update value as effect\n setInputValue(newValue, userTypingRef.current);\n }\n }, [value]);\n // ============================ Cursor ============================\n useLayoutUpdateEffect(function () {\n if (formatter) {\n restoreCursor();\n }\n }, [inputValue]);\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-focused\"), focus), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames, \"\".concat(prefixCls, \"-not-a-number\"), decimalValue.isNaN()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-out-of-range\"), !decimalValue.isInvalidate() && !isInRange(decimalValue)), _classNames)),\n style: style,\n onFocus: function onFocus() {\n setFocus(true);\n },\n onBlur: onBlur,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onCompositionStart: onCompositionStart,\n onCompositionEnd: onCompositionEnd,\n onBeforeInput: onBeforeInput\n }, controls && /*#__PURE__*/React.createElement(StepHandler, {\n prefixCls: prefixCls,\n upNode: upHandler,\n downNode: downHandler,\n upDisabled: upDisabled,\n downDisabled: downDisabled,\n onStep: onInternalStep\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(inputClassName, \"-wrap\")\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n autoComplete: \"off\",\n role: \"spinbutton\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": decimalValue.isInvalidate() ? null : decimalValue.toString(),\n step: step\n }, inputProps, {\n ref: composeRef(inputRef, ref),\n className: inputClassName,\n value: inputValue,\n onChange: onInternalInput,\n disabled: disabled,\n readOnly: readOnly\n }))));\n});\nInputNumber.displayName = 'InputNumber';\nexport default InputNumber;","import { useRef } from 'react';\nimport warning from \"rc-util/es/warning\";\n/**\n * Keep input cursor in the correct position if possible.\n * Is this necessary since we have `formatter` which may mass the content?\n */\nexport default function useCursor(input, focused) {\n var selectionRef = useRef(null);\n function recordCursor() {\n // Record position\n try {\n var start = input.selectionStart,\n end = input.selectionEnd,\n value = input.value;\n var beforeTxt = value.substring(0, start);\n var afterTxt = value.substring(end);\n selectionRef.current = {\n start: start,\n end: end,\n value: value,\n beforeTxt: beforeTxt,\n afterTxt: afterTxt\n };\n } catch (e) {\n // Fix error in Chrome:\n // Failed to read the 'selectionStart' property from 'HTMLInputElement'\n // http://stackoverflow.com/q/21177489/3040605\n }\n }\n /**\n * Restore logic:\n * 1. back string same\n * 2. start string same\n */\n function restoreCursor() {\n if (input && selectionRef.current && focused) {\n try {\n var value = input.value;\n var _selectionRef$current = selectionRef.current,\n beforeTxt = _selectionRef$current.beforeTxt,\n afterTxt = _selectionRef$current.afterTxt,\n start = _selectionRef$current.start;\n var startPos = value.length;\n if (value.endsWith(afterTxt)) {\n startPos = value.length - selectionRef.current.afterTxt.length;\n } else if (value.startsWith(beforeTxt)) {\n startPos = beforeTxt.length;\n } else {\n var beforeLastChar = beforeTxt[start - 1];\n var newIndex = value.indexOf(beforeLastChar, start - 1);\n if (newIndex !== -1) {\n startPos = newIndex + 1;\n }\n }\n input.setSelectionRange(startPos, startPos);\n } catch (e) {\n warning(false, \"Something warning of cursor restore. Please fire issue about this: \".concat(e.message));\n }\n }\n }\n return [recordCursor, restoreCursor];\n}","import { useRef, useEffect } from 'react';\nimport raf from \"rc-util/es/raf\";\n/**\n * Always trigger latest once when call multiple time\n */\nexport default (function () {\n var idRef = useRef(0);\n var cleanUp = function cleanUp() {\n raf.cancel(idRef.current);\n };\n useEffect(function () {\n return cleanUp;\n }, []);\n return function (callback) {\n cleanUp();\n idRef.current = raf(function () {\n callback();\n });\n };\n});","import InputNumber from './InputNumber';\nexport default InputNumber;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport DownOutlined from \"@ant-design/icons/es/icons/DownOutlined\";\nimport UpOutlined from \"@ant-design/icons/es/icons/UpOutlined\";\nimport classNames from 'classnames';\nimport RcInputNumber from 'rc-input-number';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { FormItemInputContext, NoFormStyle } from '../form/context';\nimport { NoCompactStyle, useCompactItemContext } from '../space/Compact';\nimport { cloneElement } from '../_util/reactNode';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var size = React.useContext(SizeContext);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focused = _React$useState2[0],\n setFocus = _React$useState2[1];\n var inputRef = React.useRef(null);\n React.useImperativeHandle(ref, function () {\n return inputRef.current;\n });\n var className = props.className,\n customizeSize = props.size,\n customDisabled = props.disabled,\n customizePrefixCls = props.prefixCls,\n addonBefore = props.addonBefore,\n addonAfter = props.addonAfter,\n prefix = props.prefix,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n readOnly = props.readOnly,\n customStatus = props.status,\n controls = props.controls,\n others = __rest(props, [\"className\", \"size\", \"disabled\", \"prefixCls\", \"addonBefore\", \"addonAfter\", \"prefix\", \"bordered\", \"readOnly\", \"status\", \"controls\"]);\n var prefixCls = getPrefixCls('input-number', customizePrefixCls);\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var upIcon = /*#__PURE__*/React.createElement(UpOutlined, {\n className: \"\".concat(prefixCls, \"-handler-up-inner\")\n });\n var downIcon = /*#__PURE__*/React.createElement(DownOutlined, {\n className: \"\".concat(prefixCls, \"-handler-down-inner\")\n });\n var controlsTemp = typeof controls === 'boolean' ? controls : undefined;\n if (_typeof(controls) === 'object') {\n upIcon = typeof controls.upIcon === 'undefined' ? upIcon : ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-handler-up-inner\")\n }, controls.upIcon));\n downIcon = typeof controls.downIcon === 'undefined' ? downIcon : ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-handler-down-inner\")\n }, controls.downIcon));\n }\n var _useContext = useContext(FormItemInputContext),\n hasFeedback = _useContext.hasFeedback,\n contextStatus = _useContext.status,\n isFormItemInput = _useContext.isFormItemInput,\n feedbackIcon = _useContext.feedbackIcon;\n var mergedStatus = getMergedStatus(contextStatus, customStatus);\n var mergeSize = compactSize || customizeSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var inputNumberClass = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), mergeSize === 'large'), \"\".concat(prefixCls, \"-sm\"), mergeSize === 'small'), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-borderless\"), !bordered), \"\".concat(prefixCls, \"-in-form-item\"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus), compactItemClassnames, className);\n var element = /*#__PURE__*/React.createElement(RcInputNumber, _extends({\n ref: inputRef,\n disabled: mergedDisabled,\n className: inputNumberClass,\n upHandler: upIcon,\n downHandler: downIcon,\n prefixCls: prefixCls,\n readOnly: readOnly,\n controls: controlsTemp\n }, others));\n if (prefix != null || hasFeedback) {\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), getStatusClassNames(\"\".concat(prefixCls, \"-affix-wrapper\"), mergedStatus, hasFeedback), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-affix-wrapper-focused\"), focused), \"\".concat(prefixCls, \"-affix-wrapper-disabled\"), props.disabled), \"\".concat(prefixCls, \"-affix-wrapper-sm\"), size === 'small'), \"\".concat(prefixCls, \"-affix-wrapper-lg\"), size === 'large'), \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-affix-wrapper-readonly\"), readOnly), \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), \"\".concat(className), !(addonBefore || addonAfter) && className));\n element = /*#__PURE__*/React.createElement(\"div\", {\n className: affixWrapperCls,\n style: props.style,\n onMouseUp: function onMouseUp() {\n return inputRef.current.focus();\n }\n }, prefix && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prefix\")\n }, prefix), cloneElement(element, {\n style: null,\n value: props.value,\n onFocus: function onFocus(event) {\n var _a;\n setFocus(true);\n (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);\n },\n onBlur: function onBlur(event) {\n var _a;\n setFocus(false);\n (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);\n }\n }), hasFeedback && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, feedbackIcon));\n }\n if (addonBefore != null || addonAfter != null) {\n var wrapperClassName = \"\".concat(prefixCls, \"-group\");\n var addonClassName = \"\".concat(wrapperClassName, \"-addon\");\n var addonBeforeNode = addonBefore ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: addonClassName\n }, addonBefore)) : null;\n var addonAfterNode = addonAfter ? /*#__PURE__*/React.createElement(\"div\", {\n className: addonClassName\n }, addonAfter) : null;\n var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperClassName, _defineProperty({}, \"\".concat(wrapperClassName, \"-rtl\"), direction === 'rtl'));\n var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-group-wrapper-sm\"), size === 'small'), \"\".concat(prefixCls, \"-group-wrapper-lg\"), size === 'large'), \"\".concat(prefixCls, \"-group-wrapper-rtl\"), direction === 'rtl'), getStatusClassNames(\"\".concat(prefixCls, \"-group-wrapper\"), mergedStatus, hasFeedback), className);\n element = /*#__PURE__*/React.createElement(\"div\", {\n className: mergedGroupClassName,\n style: props.style\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: mergedWrapperClassName\n }, addonBeforeNode && ( /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n status: true,\n override: true\n }, addonBeforeNode))), cloneElement(element, {\n style: null,\n disabled: mergedDisabled\n }), addonAfterNode && ( /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n status: true,\n override: true\n }, addonAfterNode)))));\n }\n return element;\n});\nexport default InputNumber;","import React from \"react\";\nimport { Input, InputNumber } from \"antd\";\n\nexport const CXInput = (props) => {\n return ;\n};\n\nexport const CXPassword = (props) => {\n return ;\n};\nexport const CXSearch = (props) => {\n return ;\n};\n\nexport const CXTextArea = (props) => {\n return ;\n};\n\nexport const CXGroup = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXInputNumber = (props) => {\n return ;\n};\n","import InternalLayout, { Content, Footer, Header } from './layout';\nimport Sider, { SiderContext } from './Sider';\nvar Layout = InternalLayout;\nLayout.Header = Header;\nLayout.Footer = Footer;\nLayout.Content = Content;\nLayout.Sider = Sider;\nLayout._InternalSiderContext = SiderContext;\nexport default Layout;","import React from \"react\";\nimport { Layout } from \"antd\";\n\nimport \"./style.css\";\n\nconst { Header, Footer, Sider, Content } = Layout;\n\nexport const CXLayout = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXHeader = ({ children, ...props }) => {\n return
{children}
;\n};\n\nexport const CXFooter = ({ children, ...props }) => {\n return
{children}
;\n};\n\nexport const CXSider = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXContent = ({ children, ...props }) => {\n return {children};\n};\n","import * as dashboard from \"./Data/dashboard.json\"; // https://edit.lottiefiles.com/?src=https%3A%2F%2Fassets5.lottiefiles.com%2Fpackages%2Flf20_aqdwkozj.json\nimport * as success from \"./Data/success.json\"; // https://edit.lottiefiles.com/?src=https%3A%2F%2Fassets1.lottiefiles.com%2Fpackages%2Flf20_y2hxPc.json\nimport * as notfound from \"./Data/notFound404.json\"; // https://edit.lottiefiles.com/?src=https%3A%2F%2Fassets6.lottiefiles.com%2Ftemp%2Flf20_USCruP.json\nimport * as loading from \"./Data/Loading.json\"; // https://lottiefiles.com/108642-loading\nimport * as typing from \"./Data/typing.json\";\nimport * as processing from \"./Data/processing.json\";\nimport * as upload from \"./Data/upload.json\";\nimport * as uploadDone from \"./Data/uploadDone.json\";\nimport * as downloadFile from \"./Data/downloadFile.json\";\nimport * as noFileFound from \"./Data/noFileFound.json\";\nimport * as error from \"./Data/error.json\";\nimport * as waiting from \"./Data/waiting.json\";\nimport * as WaitCreating from \"./Data/WaitCreating.json\";\nimport * as LoadingSwitch from \"./Data/LoadingSwitch.json\";\n\nexport default {\n dashboard,\n success,\n notfound,\n loading,\n typing,\n processing,\n upload,\n uploadDone,\n downloadFile,\n noFileFound,\n error,\n waiting,\n WaitCreating,\n LoadingSwitch,\n};\n","import React from \"react\";\nimport Lottie from \"react-lottie\";\nimport icons from \"./rootFile\";\nimport \"./style.css\";\n\nexport const CXLottie = ({ children, ...props }) => {\n let iconType = props.type;\n let animData = icons[iconType].default;\n return (\n \n );\n};\n","import React from \"react\";\n\nconst SendButton = () => {\n const SendMsg = () => {\n const event = new KeyboardEvent(\"keydown\", {\n bubbles: true,\n cancelable: true,\n keyCode: 13,\n });\n document.querySelector(\".ck-editor__editable\").dispatchEvent(event);\n };\n return (\n
SendMsg()}>\n \n
\n );\n};\n\nexport default SendButton;\n","import React from \"react\";\nimport Editor from \"ckeditor5-custom-build/build/ckeditor\";\nimport { CKEditor } from \"@ckeditor/ckeditor5-react\";\nimport \"./style.css\";\nimport { postFormData } from \"helper/networkClient\";\n\nclass MyUploadAdapter {\n constructor(loader) {\n this.loader = loader;\n }\n upload() {\n return this.loader.file.then(\n (file) =>\n new Promise((resolve, reject) => {\n const formData = new FormData();\n formData.append(\"file\", file);\n postFormData(`/file`, formData)\n .then((data) => {\n const imageUrl = data?.data?.data?.url;\n resolve({ default: imageUrl });\n })\n .catch((error) => reject(error));\n })\n );\n }\n abort() {\n // Implement if needed\n }\n}\n\nexport const CXMarkdownEditor = ({ onBlur, className, ...props }) => {\n const editorConfiguration = {\n removePlugins: [\"Table\", \"MediaEmbed\"],\n };\n return (\n
\n {\n editor.plugins.get(\"FileRepository\").createUploadAdapter = (\n loader\n ) => {\n return new MyUploadAdapter(loader);\n };\n }}\n onBlur={(event, editor) => {\n onBlur(event, editor);\n }}\n {...props}\n />\n
\n );\n};\nexport const CXHTMLEditor = ({ onBlur, className, ...props }) => {\n const editorConfiguration = {\n removePlugins: [\"Table\", \"MediaEmbed\", \"Markdown\"],\n };\n return (\n
\n {\n editor.plugins.get(\"FileRepository\").createUploadAdapter = (\n loader\n ) => {\n return new MyUploadAdapter(loader);\n };\n }}\n onBlur={(event, editor) => {\n onBlur(event, editor);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXMarkdownWebChatEditor = ({\n onSubmit,\n onFileUpload,\n onModelChange,\n ...props\n}) => {\n const editorConfiguration = {\n fontFamily: {\n options: [\n \"default\",\n \"Roboto,sans-serif\",\n \"Oswald,sans-serif\",\n \"Montserrat,sans-serif\",\n \"'Open Sans Condensed',sans-serif\",\n ],\n },\n fontSize: {\n options: [9, 11, 13, \"default\", 17, 19, 21],\n },\n fontColor: {\n colors: [\n \"#15E67F\",\n \"#E3DE8C\",\n \"#D8A076\",\n \"#D83762\",\n \"#76B6D8\",\n \"REMOVE\",\n \"#1C7A90\",\n \"#249CB8\",\n \"#4ABED9\",\n \"#FBD75B\",\n \"#FBE571\",\n \"#FFFFFF\",\n ],\n },\n fontBackgroundColor: {\n colors: [\n \"#15E67F\",\n \"#E3DE8C\",\n \"#D8A076\",\n \"#D83762\",\n \"#76B6D8\",\n \"REMOVE\",\n \"#1C7A90\",\n \"#249CB8\",\n \"#4ABED9\",\n \"#FBD75B\",\n \"#FBE571\",\n \"#FFFFFF\",\n ],\n },\n toolbar: [\n \"bold\",\n \"italic\",\n // \"underline\",\n \"strikeThrough\",\n \"|\",\n \"link\",\n \"|\",\n // \"subscript\",\n // \"superscript\",\n // \"fontFamily\",\n // \"fontSize\",\n // \"fontColor\",\n // \"fontBackgroundColor\",\n // \"clearFormatting\",\n \"bulletedList\",\n \"numberedList\",\n \"|\",\n // \"alignment\",\n \"blockQuote\",\n \"|\",\n \"code\",\n \"codeBlock\",\n //\"emoji\",\n \"send\",\n ],\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n const data = editor.getData();\n if (dt.keyCode == 13) {\n onSubmit(data);\n editor.setData(\"\");\n dt.preventDefault();\n evt.stop();\n }\n });\n editor.ui.view.editable.element.style.height = \"110px\";\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXMarkdownWhatsappChatEditor = ({\n onSubmit,\n onFileUpload,\n onModelChange,\n mentionData,\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: [\"bold\", \"italic\", \"strikeThrough\", \"|\", \"emoji\"],\n mention: {\n feeds: [\n {\n marker: \"@\",\n feed: mentionData,\n minimumCharacters: 0,\n dropdownLimit: 100,\n },\n ],\n },\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n const data = editor.getData();\n if (dt.keyCode == 13) {\n onSubmit(data);\n editor.setData(\"\");\n dt.preventDefault();\n evt.stop();\n }\n });\n editor.ui.view.editable.element.style.height = \"110px\";\n\n editor.conversion.for(\"downcast\").attributeToElement({\n model: \"mention\",\n view: (modelAttributeValue, { writer }) => {\n // Do not convert empty attributes (lack of value means no mention).\n if (!modelAttributeValue) {\n return;\n }\n let href;\n // User mentions are downcasted as mailto: links. Tags become normal URLs.\n if (modelAttributeValue.id[0] === \"@\") {\n href = `UID:${modelAttributeValue.uid}`;\n }\n return writer.createAttributeElement(\n \"a\",\n {\n href,\n },\n {\n // Make mention attribute to be wrapped by other attribute elements.\n priority: 20,\n // Prevent merging mentions together.\n id: modelAttributeValue.uid,\n }\n );\n },\n converterPriority: \"high\",\n });\n\n // editor.plugins.get( 'Mention' )\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n console.log(data, \"myData\");\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXMarkdownFacebookChatEditor = ({\n onSubmit,\n onFileUpload,\n onModelChange,\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: [\n \"bold\",\n \"italic\",\n // \"underline\",\n \"strikeThrough\",\n \"|\",\n \"emoji\",\n // \"send\",\n ],\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n const data = editor.getData();\n if (dt.keyCode == 13) {\n onSubmit(data);\n editor.setData(\"\");\n dt.preventDefault();\n evt.stop();\n }\n });\n editor.ui.view.editable.element.style.height = \"110px\";\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXMarkdownWorkbenchEditor = ({\n onBlur,\n onModelChange,\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: [\n \"bold\",\n \"italic\",\n // \"underline\",\n \"strikeThrough\",\n \"|\",\n \"emoji\",\n // \"send\",\n ],\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n onBlur={(event, editor) => {\n let data = editor.getData();\n onBlur(data);\n }}\n {...props}\n />\n
\n );\n};\nexport const CXMarkdownTemplateEditor = ({\n onBlur,\n onModelChange,\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: [\n \"bold\",\n \"italic\",\n // \"underline\",\n \"strikeThrough\",\n \"|\",\n \"emoji\",\n // \"send\",\n ],\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n onBlur={(event, editor) => {\n let data = editor.getData();\n onBlur(data);\n }}\n {...props}\n />\n
\n );\n};\nexport const CXMarkdownTemplateEditorMention = ({\n onBlur,\n onModelChange,\n variableData,\n ...props\n}) => {\n const editorConfiguration = {\n removePlugins: [\"Markdown\"],\n toolbar: [\n \"bold\",\n \"italic\",\n // \"underline\",\n \"strikeThrough\",\n \"|\",\n \"emoji\",\n // \"send\",\n ],\n mention: {\n feeds: [\n {\n marker: \"{\",\n feed: variableData,\n minimumCharacters: 0,\n dropdownLimit: 100,\n },\n ],\n },\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n onBlur={(event, editor) => {\n let data = editor.getData();\n onBlur(data);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXHTMLEditorEmail = ({\n onBlur,\n onSubmit,\n onFileUpload,\n onModelChange,\n mentionData,\n variableData,\n toolbar = true,\n className = \"ck-email\",\n ...props\n}) => {\n const editorConfiguration = {\n removePlugins: [\"Markdown\"],\n toolbar: toolbar\n ? {\n items: [\n \"bold\",\n \"italic\",\n \"link\",\n \"bulletedList\",\n \"numberedList\",\n \"|\",\n \"outdent\",\n \"indent\",\n \"|\",\n \"imageUpload\",\n \"blockQuote\",\n \"insertTable\",\n \"undo\",\n \"redo\",\n \"alignment\",\n \"|\",\n \"emoji\",\n ],\n }\n : null,\n language: \"en\",\n image: {\n toolbar: [\n \"imageTextAlternative\",\n \"imageStyle:inline\",\n \"imageStyle:block\",\n \"imageStyle:side\",\n ],\n },\n table: {\n contentToolbar: [\n \"tableColumn\",\n \"tableRow\",\n \"mergeTableCells\",\n \"tableProperties\",\n \"tableCellProperties\",\n ],\n },\n mention: {\n feeds: [\n {\n marker: \"@\",\n feed: mentionData,\n minimumCharacters: 0,\n dropdownLimit: 100,\n },\n {\n marker: \"{\",\n feed: variableData,\n minimumCharacters: 0,\n dropdownLimit: 100,\n },\n ],\n },\n };\n return (\n
\n {\n editor.plugins.get(\"FileRepository\").createUploadAdapter = (\n loader\n ) => {\n return new MyUploadAdapter(loader);\n };\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n // editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n // const data = editor.getData();\n // if (dt.keyCode == 13) {\n // onSubmit(data);\n // editor.setData(\"\");\n // dt.preventDefault();\n // evt.stop();\n // }\n // });\n editor.ui.view.editable.element.style.height = \"110px\";\n\n editor.conversion.for(\"downcast\").attributeToElement({\n model: \"mention\",\n view: (modelAttributeValue, { writer }) => {\n // Do not convert empty attributes (lack of value means no mention).\n if (!modelAttributeValue) {\n return;\n }\n let href;\n // User mentions are downcasted as mailto: links. Tags become normal URLs.\n if (modelAttributeValue.id[0] === \"@\") {\n href = `UID:${modelAttributeValue?.uid}`;\n return writer.createAttributeElement(\n \"a\",\n {\n href,\n },\n {\n // Make mention attribute to be wrapped by other attribute elements.\n priority: 20,\n // Prevent merging mentions together.\n id: modelAttributeValue?.uid,\n }\n );\n }\n },\n converterPriority: \"high\",\n });\n\n // editor.plugins.get( 'Mention' )\n }}\n onChange={(event, editor) => {\n const data = editor?.getData();\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\nexport const CXMarkdownDescriptionEditor = ({\n // onSubmit,\n onFileUpload,\n onModelChange,\n mentionData,\n className = \"\",\n toolbar = true,\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: toolbar\n ? {\n items: [\n \"bold\",\n \"italic\",\n \"link\",\n \"bulletedList\",\n \"numberedList\",\n \"|\",\n \"outdent\",\n \"indent\",\n \"|\",\n \"imageUpload\",\n \"blockQuote\",\n \"insertTable\",\n \"undo\",\n \"redo\",\n \"alignment\",\n \"|\",\n \"emoji\",\n ],\n }\n : null,\n language: \"en\",\n image: {\n toolbar: [\n \"imageTextAlternative\",\n \"imageStyle:inline\",\n \"imageStyle:block\",\n \"imageStyle:side\",\n ],\n },\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n // editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n // const data = editor.getData();\n // if (dt.keyCode == 13) {\n // onSubmit(data);\n // editor.setData(\"\");\n // dt.preventDefault();\n // evt.stop();\n // }\n // });\n // editor.ui.view.editable.element.style.height = \"110px\";\n\n // editor.conversion.for(\"downcast\").attributeToElement({\n // model: \"mention\",\n // view: (modelAttributeValue, { writer }) => {\n // // Do not convert empty attributes (lack of value means no mention).\n // if (!modelAttributeValue) {\n // return;\n // }\n // let href;\n // // User mentions are downcasted as mailto: links. Tags become normal URLs.\n // if (modelAttributeValue.id[0] === \"@\") {\n // href = `UID:${modelAttributeValue.uid}`;\n // }\n // return writer.createAttributeElement(\n // \"a\",\n // {\n // href,\n // },\n // {\n // // Make mention attribute to be wrapped by other attribute elements.\n // priority: 20,\n // // Prevent merging mentions together.\n // id: modelAttributeValue.uid,\n // }\n // );\n // },\n // converterPriority: \"high\",\n // });\n\n // editor.plugins.get( 'Mention' )\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\nexport const CXMarkdownDescriptionEditorHTML = ({\n // onSubmit,\n onFileUpload,\n onModelChange,\n mentionData,\n className = \"\",\n toolbar = true,\n ...props\n}) => {\n const editorConfiguration = {\n removePlugins: [\"Markdown\"],\n fontSize: {\n options: [9, 11, 13, \"default\", 16, 18, 20, 22, 24, 26],\n },\n toolbar: toolbar\n ? {\n items: [\n \"fontSize\",\n \"|\",\n \"bold\",\n \"italic\",\n \"link\",\n \"bulletedList\",\n \"numberedList\",\n \"|\",\n \"outdent\",\n \"indent\",\n \"|\",\n \"imageUpload\",\n \"blockQuote\",\n \"insertTable\",\n \"undo\",\n \"redo\",\n \"alignment\",\n \"|\",\n \"emoji\",\n \"|\",\n // \"heading\",\n ],\n }\n : null,\n\n language: \"en\",\n image: {\n toolbar: [\n \"imageTextAlternative\",\n \"imageStyle:inline\",\n \"imageStyle:block\",\n \"imageStyle:side\",\n ],\n },\n };\n console.log(\"testCase====>\", Editor?.ui?.componentFactory?.names());\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\n\nexport const CXMarkdownCommentEditor = ({\n onSubmit,\n onFileUpload,\n onModelChange,\n mentionData,\n className = \"\",\n ...props\n}) => {\n const editorConfiguration = {\n toolbar: [\"emoji\"],\n mention: {\n feeds: [\n {\n marker: \"@\",\n feed: mentionData,\n minimumCharacters: 0,\n dropdownLimit: 100,\n },\n ],\n },\n };\n return (\n
\n {\n editor.editing.view.document.on(\n \"drop\",\n (evt, data) => {\n onFileUpload(data?.dataTransfer?.files);\n // Stop executing next callbacks.\n evt.stop();\n\n // Prevent the default event action.\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\n \"dragover\",\n (evt, data) => {\n evt.stop();\n data.preventDefault();\n },\n { priority: \"high\" }\n );\n\n editor.editing.view.document.on(\"keydown\", (evt, dt) => {\n const data = editor.getData();\n if (dt.keyCode == 13) {\n onSubmit(data);\n editor.setData(\"\");\n dt.preventDefault();\n evt.stop();\n }\n });\n editor.ui.view.editable.element.style.height = \"110px\";\n\n editor.conversion.for(\"downcast\").attributeToElement({\n model: \"mention\",\n view: (modelAttributeValue, { writer }) => {\n // Do not convert empty attributes (lack of value means no mention).\n if (!modelAttributeValue) {\n return;\n }\n let href;\n // User mentions are downcasted as mailto: links. Tags become normal URLs.\n if (modelAttributeValue.id[0] === \"@\") {\n href = `UID:${modelAttributeValue.uid}`;\n }\n return writer.createAttributeElement(\n \"a\",\n {\n href,\n },\n {\n // Make mention attribute to be wrapped by other attribute elements.\n priority: 20,\n // Prevent merging mentions together.\n id: modelAttributeValue.uid,\n }\n );\n },\n converterPriority: \"high\",\n });\n\n // editor.plugins.get( 'Mention' )\n }}\n onChange={(event, editor) => {\n const data = editor.getData();\n console.log(data, \"myData\");\n onModelChange(data);\n }}\n {...props}\n />\n
\n );\n};\n","import React from \"react\";\nimport { Menu } from \"antd\";\n\nimport \"./style.css\";\n\nconst { SubMenu, Item, ItemGroup, Divider } = Menu;\n\nexport const CXMenu = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXSubMenu = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXMenuItem = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXMenuItemGroup = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXMenuDivider = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Modal } from \"antd\";\n\nexport const CXModal = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXModalConfirm = Modal.confirm;\n\nexport const { confirm } = Modal;\n","import {\n connectOath,\n GetAllConfig,\n getIntegrationPayment,\n getStoreIntegartionFacebook,\n} from \"action/AdminActions\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { oauthUrl } from \"config/config\";\nimport { getCookie } from \"utils\";\nconst OAuthPopup = ({ children, url, mode, waba }) => {\n const dispatch = useDispatch();\n const tenantId = getCookie(\"tenant\");\n const accessToken = getCookie(\"ob_a\");\n const [externalPopup, setExternalPopup] = useState(null);\n const connectClick = async () => {\n const width = 500;\n const height = 400;\n const left = window.screenX + (window.outerWidth - width) / 2;\n const top = window.screenY + (window.outerHeight - height) / 2.5;\n // Ensure the variables are properly encoded\n const encodedOauthUrl = encodeURIComponent(oauthUrl);\n const encodedUrl = encodeURIComponent(url);\n const encodedTenantId = encodeURIComponent(tenantId);\n const encodedMode = encodeURIComponent(mode);\n const encodedAccessToken = encodeURIComponent(accessToken);\n const encodedWaba = encodeURIComponent(waba);\n let completeUrl =\n encodedOauthUrl +\n encodedUrl +\n \"?tid=\" +\n encodedTenantId +\n \"&mode=\" +\n encodedMode +\n \"&authorization=Bearer%20\" +\n encodedAccessToken +\n \"&waba=\" +\n encodedWaba;\n\n const title = `Connect Account`;\n const decodedUrl = decodeURIComponent(completeUrl);\n const popup = window.open(\n decodedUrl,\n title,\n `width=${width},height=${height},left=${left},top=${top}`\n );\n\n if (popup === null) {\n console.log(\"window.open failed\");\n } else {\n setExternalPopup(popup);\n }\n };\n useEffect(() => {\n if (!externalPopup) {\n return;\n }\n const timer = setInterval(() => {\n if (!externalPopup) {\n timer && clearInterval(timer);\n return;\n }\n if (externalPopup.closed) {\n dispatch(GetAllConfig());\n dispatch(getStoreIntegartionFacebook());\n dispatch(getIntegrationPayment());\n setExternalPopup(null);\n timer && clearInterval(timer);\n }\n }, 500);\n }, [externalPopup]);\n return (\n
connectClick()} className=\"w-100\">\n {children}\n
\n );\n};\n\nexport default OAuthPopup;\n","import React from \"react\";\nimport { Popover, Popconfirm } from \"antd\";\n\nexport const CXPopover = ({ children, ...props }) => {\n return {children};\n};\nexport const CXPopconfirm = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Progress } from \"antd\";\n\nexport const CXProgress = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Radio, Space } from \"antd\";\n\nexport const CXRadio = ({ children, ...props }) => {\n return {children};\n};\nexport const CXRadioGroup = ({ children, ...props }) => {\n return {children};\n};\nexport const CXSpace = ({ children, ...props }) => {\n return {children};\n};\nexport const CXRadioButton = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Row } from \"antd\";\n\nexport const CXRow = ({ children, ...props }) => {\n return {children};\n};\n","import * as React from 'react';\nvar LegacySelectContext = /*#__PURE__*/React.createContext(null);\nexport default LegacySelectContext;","import * as React from 'react';\nvar TreeSelectContext = /*#__PURE__*/React.createContext(null);\nexport default TreeSelectContext;","export function toArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n\n return value !== undefined ? [value] : [];\n}\nexport function fillFieldNames(fieldNames) {\n var _ref = fieldNames || {},\n label = _ref.label,\n value = _ref.value,\n children = _ref.children;\n\n var mergedValue = value || 'value';\n return {\n _title: label ? [label] : ['title', 'label'],\n value: mergedValue,\n key: mergedValue,\n children: children || 'children'\n };\n}\nexport function isCheckDisabled(node) {\n return !node || node.disabled || node.disableCheckbox || node.checkable === false;\n}\n/** Loop fetch all the keys exist in the tree */\n\nexport function getAllKeys(treeData, fieldNames) {\n var keys = [];\n\n function dig(list) {\n list.forEach(function (item) {\n var children = item[fieldNames.children];\n\n if (children) {\n keys.push(item[fieldNames.value]);\n dig(children);\n }\n });\n }\n\n dig(treeData);\n return keys;\n}\nexport function isNil(val) {\n return val === null || val === undefined;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport useMemo from \"rc-util/es/hooks/useMemo\";\nimport { useBaseProps } from 'rc-select';\nimport Tree from 'rc-tree';\nimport LegacyContext from \"./LegacyContext\";\nimport TreeSelectContext from \"./TreeSelectContext\";\nimport { getAllKeys, isCheckDisabled } from \"./utils/valueUtil\";\nvar HIDDEN_STYLE = {\n width: 0,\n height: 0,\n display: 'flex',\n overflow: 'hidden',\n opacity: 0,\n border: 0,\n padding: 0,\n margin: 0\n};\n\nvar OptionList = function OptionList(_, ref) {\n var _useBaseProps = useBaseProps(),\n prefixCls = _useBaseProps.prefixCls,\n multiple = _useBaseProps.multiple,\n searchValue = _useBaseProps.searchValue,\n toggleOpen = _useBaseProps.toggleOpen,\n open = _useBaseProps.open,\n notFoundContent = _useBaseProps.notFoundContent;\n\n var _React$useContext = React.useContext(TreeSelectContext),\n virtual = _React$useContext.virtual,\n listHeight = _React$useContext.listHeight,\n listItemHeight = _React$useContext.listItemHeight,\n treeData = _React$useContext.treeData,\n fieldNames = _React$useContext.fieldNames,\n onSelect = _React$useContext.onSelect,\n dropdownMatchSelectWidth = _React$useContext.dropdownMatchSelectWidth,\n treeExpandAction = _React$useContext.treeExpandAction;\n\n var _React$useContext2 = React.useContext(LegacyContext),\n checkable = _React$useContext2.checkable,\n checkedKeys = _React$useContext2.checkedKeys,\n halfCheckedKeys = _React$useContext2.halfCheckedKeys,\n treeExpandedKeys = _React$useContext2.treeExpandedKeys,\n treeDefaultExpandAll = _React$useContext2.treeDefaultExpandAll,\n treeDefaultExpandedKeys = _React$useContext2.treeDefaultExpandedKeys,\n onTreeExpand = _React$useContext2.onTreeExpand,\n treeIcon = _React$useContext2.treeIcon,\n showTreeIcon = _React$useContext2.showTreeIcon,\n switcherIcon = _React$useContext2.switcherIcon,\n treeLine = _React$useContext2.treeLine,\n treeNodeFilterProp = _React$useContext2.treeNodeFilterProp,\n loadData = _React$useContext2.loadData,\n treeLoadedKeys = _React$useContext2.treeLoadedKeys,\n treeMotion = _React$useContext2.treeMotion,\n onTreeLoad = _React$useContext2.onTreeLoad,\n keyEntities = _React$useContext2.keyEntities;\n\n var treeRef = React.useRef();\n var memoTreeData = useMemo(function () {\n return treeData;\n }, [open, treeData], function (prev, next) {\n return next[0] && prev[1] !== next[1];\n }); // ========================== Values ==========================\n\n var mergedCheckedKeys = React.useMemo(function () {\n if (!checkable) {\n return null;\n }\n\n return {\n checked: checkedKeys,\n halfChecked: halfCheckedKeys\n };\n }, [checkable, checkedKeys, halfCheckedKeys]); // ========================== Scroll ==========================\n\n React.useEffect(function () {\n // Single mode should scroll to current key\n if (open && !multiple && checkedKeys.length) {\n var _treeRef$current;\n\n (_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 ? void 0 : _treeRef$current.scrollTo({\n key: checkedKeys[0]\n });\n }\n }, [open]); // ========================== Search ==========================\n\n var lowerSearchValue = String(searchValue).toLowerCase();\n\n var filterTreeNode = function filterTreeNode(treeNode) {\n if (!lowerSearchValue) {\n return false;\n }\n\n return String(treeNode[treeNodeFilterProp]).toLowerCase().includes(lowerSearchValue);\n }; // =========================== Keys ===========================\n\n\n var _React$useState = React.useState(treeDefaultExpandedKeys),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n expandedKeys = _React$useState2[0],\n setExpandedKeys = _React$useState2[1];\n\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n searchExpandedKeys = _React$useState4[0],\n setSearchExpandedKeys = _React$useState4[1];\n\n var mergedExpandedKeys = React.useMemo(function () {\n if (treeExpandedKeys) {\n return _toConsumableArray(treeExpandedKeys);\n }\n\n return searchValue ? searchExpandedKeys : expandedKeys;\n }, [expandedKeys, searchExpandedKeys, treeExpandedKeys, searchValue]);\n React.useEffect(function () {\n if (searchValue) {\n setSearchExpandedKeys(getAllKeys(treeData, fieldNames));\n }\n }, [searchValue]);\n\n var onInternalExpand = function onInternalExpand(keys) {\n setExpandedKeys(keys);\n setSearchExpandedKeys(keys);\n\n if (onTreeExpand) {\n onTreeExpand(keys);\n }\n }; // ========================== Events ==========================\n\n\n var onListMouseDown = function onListMouseDown(event) {\n event.preventDefault();\n };\n\n var onInternalSelect = function onInternalSelect(__, info) {\n var node = info.node;\n\n if (checkable && isCheckDisabled(node)) {\n return;\n }\n\n onSelect(node.key, {\n selected: !checkedKeys.includes(node.key)\n });\n\n if (!multiple) {\n toggleOpen(false);\n }\n }; // ========================= Keyboard =========================\n\n\n var _React$useState5 = React.useState(null),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n activeKey = _React$useState6[0],\n setActiveKey = _React$useState6[1];\n\n var activeEntity = keyEntities[activeKey];\n React.useImperativeHandle(ref, function () {\n var _treeRef$current2;\n\n return {\n scrollTo: (_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.scrollTo,\n onKeyDown: function onKeyDown(event) {\n var _treeRef$current3;\n\n var which = event.which;\n\n switch (which) {\n // >>> Arrow keys\n case KeyCode.UP:\n case KeyCode.DOWN:\n case KeyCode.LEFT:\n case KeyCode.RIGHT:\n (_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 ? void 0 : _treeRef$current3.onKeyDown(event);\n break;\n // >>> Select item\n\n case KeyCode.ENTER:\n {\n if (activeEntity) {\n var _ref = (activeEntity === null || activeEntity === void 0 ? void 0 : activeEntity.node) || {},\n selectable = _ref.selectable,\n value = _ref.value;\n\n if (selectable !== false) {\n onInternalSelect(null, {\n node: {\n key: activeKey\n },\n selected: !checkedKeys.includes(value)\n });\n }\n }\n\n break;\n }\n // >>> Close\n\n case KeyCode.ESC:\n {\n toggleOpen(false);\n }\n }\n },\n onKeyUp: function onKeyUp() {}\n };\n }); // ========================== Render ==========================\n\n if (memoTreeData.length === 0) {\n return /*#__PURE__*/React.createElement(\"div\", {\n role: \"listbox\",\n className: \"\".concat(prefixCls, \"-empty\"),\n onMouseDown: onListMouseDown\n }, notFoundContent);\n }\n\n var treeProps = {\n fieldNames: fieldNames\n };\n\n if (treeLoadedKeys) {\n treeProps.loadedKeys = treeLoadedKeys;\n }\n\n if (mergedExpandedKeys) {\n treeProps.expandedKeys = mergedExpandedKeys;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n onMouseDown: onListMouseDown\n }, activeEntity && open && /*#__PURE__*/React.createElement(\"span\", {\n style: HIDDEN_STYLE,\n \"aria-live\": \"assertive\"\n }, activeEntity.node.value), /*#__PURE__*/React.createElement(Tree, _extends({\n ref: treeRef,\n focusable: false,\n prefixCls: \"\".concat(prefixCls, \"-tree\"),\n treeData: memoTreeData,\n height: listHeight,\n itemHeight: listItemHeight,\n virtual: virtual !== false && dropdownMatchSelectWidth !== false,\n multiple: multiple,\n icon: treeIcon,\n showIcon: showTreeIcon,\n switcherIcon: switcherIcon,\n showLine: treeLine,\n loadData: searchValue ? null : loadData,\n motion: treeMotion,\n activeKey: activeKey // We handle keys by out instead tree self\n ,\n checkable: checkable,\n checkStrictly: true,\n checkedKeys: mergedCheckedKeys,\n selectedKeys: !checkable ? checkedKeys : [],\n defaultExpandAll: treeDefaultExpandAll\n }, treeProps, {\n // Proxy event out\n onActiveChange: setActiveKey,\n onSelect: onInternalSelect,\n onCheck: onInternalSelect,\n onExpand: onInternalExpand,\n onLoad: onTreeLoad,\n filterTreeNode: filterTreeNode,\n expandAction: treeExpandAction\n })));\n};\n\nvar RefOptionList = /*#__PURE__*/React.forwardRef(OptionList);\nRefOptionList.displayName = 'OptionList';\nexport default RefOptionList;","/* istanbul ignore file */\n\n/** This is a placeholder, not real render in dom */\nvar TreeNode = function TreeNode() {\n return null;\n};\n\nexport default TreeNode;","import { isCheckDisabled } from \"./valueUtil\";\nexport var SHOW_ALL = 'SHOW_ALL';\nexport var SHOW_PARENT = 'SHOW_PARENT';\nexport var SHOW_CHILD = 'SHOW_CHILD';\nexport function formatStrategyValues(values, strategy, keyEntities, fieldNames) {\n var valueSet = new Set(values);\n\n if (strategy === SHOW_CHILD) {\n return values.filter(function (key) {\n var entity = keyEntities[key];\n\n if (entity && entity.children && entity.children.some(function (_ref) {\n var node = _ref.node;\n return valueSet.has(node[fieldNames.value]);\n }) && entity.children.every(function (_ref2) {\n var node = _ref2.node;\n return isCheckDisabled(node) || valueSet.has(node[fieldNames.value]);\n })) {\n return false;\n }\n\n return true;\n });\n }\n\n if (strategy === SHOW_PARENT) {\n return values.filter(function (key) {\n var entity = keyEntities[key];\n var parent = entity ? entity.parent : null;\n\n if (parent && !isCheckDisabled(parent.node) && valueSet.has(parent.key)) {\n return false;\n }\n\n return true;\n });\n }\n\n return values;\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\", \"value\"];\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport warning from \"rc-util/es/warning\";\nimport TreeNode from \"../TreeNode\";\nexport function convertChildrenToData(nodes) {\n return toArray(nodes).map(function (node) {\n if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {\n return null;\n }\n\n var _ref = node,\n key = _ref.key,\n _ref$props = _ref.props,\n children = _ref$props.children,\n value = _ref$props.value,\n restProps = _objectWithoutProperties(_ref$props, _excluded);\n\n var data = _objectSpread({\n key: key,\n value: value\n }, restProps);\n\n var childData = convertChildrenToData(children);\n\n if (childData.length) {\n data.children = childData;\n }\n\n return data;\n }).filter(function (data) {\n return data;\n });\n}\nexport function fillLegacyProps(dataNode) {\n if (!dataNode) {\n return dataNode;\n }\n\n var cloneNode = _objectSpread({}, dataNode);\n\n if (!('props' in cloneNode)) {\n Object.defineProperty(cloneNode, 'props', {\n get: function get() {\n warning(false, 'New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access.');\n return cloneNode;\n }\n });\n }\n\n return cloneNode;\n}\nexport function fillAdditionalInfo(extra, triggerValue, checkedValues, treeData, showPosition, fieldNames) {\n var triggerNode = null;\n var nodeList = null;\n\n function generateMap() {\n function dig(list) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';\n var parentIncluded = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n return list.map(function (option, index) {\n var pos = \"\".concat(level, \"-\").concat(index);\n var value = option[fieldNames.value];\n var included = checkedValues.includes(value);\n var children = dig(option[fieldNames.children] || [], pos, included);\n var node = /*#__PURE__*/React.createElement(TreeNode, option, children.map(function (child) {\n return child.node;\n })); // Link with trigger node\n\n if (triggerValue === value) {\n triggerNode = node;\n }\n\n if (included) {\n var checkedNode = {\n pos: pos,\n node: node,\n children: children\n };\n\n if (!parentIncluded) {\n nodeList.push(checkedNode);\n }\n\n return checkedNode;\n }\n\n return null;\n }).filter(function (node) {\n return node;\n });\n }\n\n if (!nodeList) {\n nodeList = [];\n dig(treeData); // Sort to keep the checked node length\n\n nodeList.sort(function (_ref2, _ref3) {\n var val1 = _ref2.node.props.value;\n var val2 = _ref3.node.props.value;\n var index1 = checkedValues.indexOf(val1);\n var index2 = checkedValues.indexOf(val2);\n return index1 - index2;\n });\n }\n }\n\n Object.defineProperty(extra, 'triggerNode', {\n get: function get() {\n warning(false, '`triggerNode` is deprecated. Please consider decoupling data with node.');\n generateMap();\n return triggerNode;\n }\n });\n Object.defineProperty(extra, 'allCheckedNodes', {\n get: function get() {\n warning(false, '`allCheckedNodes` is deprecated. Please consider decoupling data with node.');\n generateMap();\n\n if (showPosition) {\n return nodeList;\n }\n\n return nodeList.map(function (_ref4) {\n var node = _ref4.node;\n return node;\n });\n }\n });\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport { convertChildrenToData } from \"../utils/legacyUtil\";\n\nfunction parseSimpleTreeData(treeData, _ref) {\n var id = _ref.id,\n pId = _ref.pId,\n rootPId = _ref.rootPId;\n var keyNodes = {};\n var rootNodeList = []; // Fill in the map\n\n var nodeList = treeData.map(function (node) {\n var clone = _objectSpread({}, node);\n\n var key = clone[id];\n keyNodes[key] = clone;\n clone.key = clone.key || key;\n return clone;\n }); // Connect tree\n\n nodeList.forEach(function (node) {\n var parentKey = node[pId];\n var parent = keyNodes[parentKey]; // Fill parent\n\n if (parent) {\n parent.children = parent.children || [];\n parent.children.push(node);\n } // Fill root tree node\n\n\n if (parentKey === rootPId || !parent && rootPId === null) {\n rootNodeList.push(node);\n }\n });\n return rootNodeList;\n}\n/**\n * Convert `treeData` or `children` into formatted `treeData`.\n * Will not re-calculate if `treeData` or `children` not change.\n */\n\n\nexport default function useTreeData(treeData, children, simpleMode) {\n return React.useMemo(function () {\n if (treeData) {\n return simpleMode ? parseSimpleTreeData(treeData, _objectSpread({\n id: 'id',\n pId: 'pId',\n rootPId: null\n }, simpleMode !== true ? simpleMode : {})) : treeData;\n }\n\n return convertChildrenToData(children);\n }, [children, simpleMode, treeData]);\n}","import * as React from 'react';\n/**\n * Same as `React.useCallback` but always return a memoized function\n * but redirect to real function.\n */\n\nexport default function useRefFunc(callback) {\n var funcRef = React.useRef();\n funcRef.current = callback;\n var cacheFn = React.useCallback(function () {\n return funcRef.current.apply(funcRef, arguments);\n }, []);\n return cacheFn;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"id\", \"prefixCls\", \"value\", \"defaultValue\", \"onChange\", \"onSelect\", \"onDeselect\", \"searchValue\", \"inputValue\", \"onSearch\", \"autoClearSearchValue\", \"filterTreeNode\", \"treeNodeFilterProp\", \"showCheckedStrategy\", \"treeNodeLabelProp\", \"multiple\", \"treeCheckable\", \"treeCheckStrictly\", \"labelInValue\", \"fieldNames\", \"treeDataSimpleMode\", \"treeData\", \"children\", \"loadData\", \"treeLoadedKeys\", \"onTreeLoad\", \"treeDefaultExpandAll\", \"treeExpandedKeys\", \"treeDefaultExpandedKeys\", \"onTreeExpand\", \"treeExpandAction\", \"virtual\", \"listHeight\", \"listItemHeight\", \"onDropdownVisibleChange\", \"dropdownMatchSelectWidth\", \"treeLine\", \"treeIcon\", \"showTreeIcon\", \"switcherIcon\", \"treeMotion\"];\nimport * as React from 'react';\nimport { BaseSelect } from 'rc-select';\nimport { conductCheck } from \"rc-tree/es/utils/conductUtil\";\nimport useId from \"rc-select/es/hooks/useId\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport OptionList from \"./OptionList\";\nimport TreeNode from \"./TreeNode\";\nimport { formatStrategyValues, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from \"./utils/strategyUtil\";\nimport TreeSelectContext from \"./TreeSelectContext\";\nimport LegacyContext from \"./LegacyContext\";\nimport useTreeData from \"./hooks/useTreeData\";\nimport { toArray, fillFieldNames, isNil } from \"./utils/valueUtil\";\nimport useCache from \"./hooks/useCache\";\nimport useRefFunc from \"./hooks/useRefFunc\";\nimport useDataEntities from \"./hooks/useDataEntities\";\nimport { fillAdditionalInfo, fillLegacyProps } from \"./utils/legacyUtil\";\nimport useCheckedKeys from \"./hooks/useCheckedKeys\";\nimport useFilterTreeData from \"./hooks/useFilterTreeData\";\nimport warningProps from \"./utils/warningPropsUtil\";\nimport warning from \"rc-util/es/warning\";\n\nfunction isRawValue(value) {\n return !value || _typeof(value) !== 'object';\n}\n\nvar TreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var id = props.id,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-tree-select' : _props$prefixCls,\n value = props.value,\n defaultValue = props.defaultValue,\n onChange = props.onChange,\n onSelect = props.onSelect,\n onDeselect = props.onDeselect,\n searchValue = props.searchValue,\n inputValue = props.inputValue,\n onSearch = props.onSearch,\n _props$autoClearSearc = props.autoClearSearchValue,\n autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n filterTreeNode = props.filterTreeNode,\n _props$treeNodeFilter = props.treeNodeFilterProp,\n treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'value' : _props$treeNodeFilter,\n _props$showCheckedStr = props.showCheckedStrategy,\n showCheckedStrategy = _props$showCheckedStr === void 0 ? SHOW_CHILD : _props$showCheckedStr,\n treeNodeLabelProp = props.treeNodeLabelProp,\n multiple = props.multiple,\n treeCheckable = props.treeCheckable,\n treeCheckStrictly = props.treeCheckStrictly,\n labelInValue = props.labelInValue,\n fieldNames = props.fieldNames,\n treeDataSimpleMode = props.treeDataSimpleMode,\n treeData = props.treeData,\n children = props.children,\n loadData = props.loadData,\n treeLoadedKeys = props.treeLoadedKeys,\n onTreeLoad = props.onTreeLoad,\n treeDefaultExpandAll = props.treeDefaultExpandAll,\n treeExpandedKeys = props.treeExpandedKeys,\n treeDefaultExpandedKeys = props.treeDefaultExpandedKeys,\n onTreeExpand = props.onTreeExpand,\n treeExpandAction = props.treeExpandAction,\n virtual = props.virtual,\n _props$listHeight = props.listHeight,\n listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n _props$listItemHeight = props.listItemHeight,\n listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n onDropdownVisibleChange = props.onDropdownVisibleChange,\n _props$dropdownMatchS = props.dropdownMatchSelectWidth,\n dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,\n treeLine = props.treeLine,\n treeIcon = props.treeIcon,\n showTreeIcon = props.showTreeIcon,\n switcherIcon = props.switcherIcon,\n treeMotion = props.treeMotion,\n restProps = _objectWithoutProperties(props, _excluded);\n\n var mergedId = useId(id);\n var treeConduction = treeCheckable && !treeCheckStrictly;\n var mergedCheckable = treeCheckable || treeCheckStrictly;\n var mergedLabelInValue = treeCheckStrictly || labelInValue;\n var mergedMultiple = mergedCheckable || multiple;\n\n var _useMergedState = useMergedState(defaultValue, {\n value: value\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n internalValue = _useMergedState2[0],\n setInternalValue = _useMergedState2[1]; // ========================== Warning ===========================\n\n\n if (process.env.NODE_ENV !== 'production') {\n warningProps(props);\n } // ========================= FieldNames =========================\n\n\n var mergedFieldNames = React.useMemo(function () {\n return fillFieldNames(fieldNames);\n },\n /* eslint-disable react-hooks/exhaustive-deps */\n [JSON.stringify(fieldNames)]\n /* eslint-enable react-hooks/exhaustive-deps */\n ); // =========================== Search ===========================\n\n var _useMergedState3 = useMergedState('', {\n value: searchValue !== undefined ? searchValue : inputValue,\n postState: function postState(search) {\n return search || '';\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n mergedSearchValue = _useMergedState4[0],\n setSearchValue = _useMergedState4[1];\n\n var onInternalSearch = function onInternalSearch(searchText) {\n setSearchValue(searchText);\n onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);\n }; // ============================ Data ============================\n // `useTreeData` only do convert of `children` or `simpleMode`.\n // Else will return origin `treeData` for perf consideration.\n // Do not do anything to loop the data.\n\n\n var mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);\n\n var _useDataEntities = useDataEntities(mergedTreeData, mergedFieldNames),\n keyEntities = _useDataEntities.keyEntities,\n valueEntities = _useDataEntities.valueEntities;\n /** Get `missingRawValues` which not exist in the tree yet */\n\n\n var splitRawValues = React.useCallback(function (newRawValues) {\n var missingRawValues = [];\n var existRawValues = []; // Keep missing value in the cache\n\n newRawValues.forEach(function (val) {\n if (valueEntities.has(val)) {\n existRawValues.push(val);\n } else {\n missingRawValues.push(val);\n }\n });\n return {\n missingRawValues: missingRawValues,\n existRawValues: existRawValues\n };\n }, [valueEntities]); // Filtered Tree\n\n var filteredTreeData = useFilterTreeData(mergedTreeData, mergedSearchValue, {\n fieldNames: mergedFieldNames,\n treeNodeFilterProp: treeNodeFilterProp,\n filterTreeNode: filterTreeNode\n }); // =========================== Label ============================\n\n var getLabel = React.useCallback(function (item) {\n if (item) {\n if (treeNodeLabelProp) {\n return item[treeNodeLabelProp];\n } // Loop from fieldNames\n\n\n var titleList = mergedFieldNames._title;\n\n for (var i = 0; i < titleList.length; i += 1) {\n var title = item[titleList[i]];\n\n if (title !== undefined) {\n return title;\n }\n }\n }\n }, [mergedFieldNames, treeNodeLabelProp]); // ========================= Wrap Value =========================\n\n var toLabeledValues = React.useCallback(function (draftValues) {\n var values = toArray(draftValues);\n return values.map(function (val) {\n if (isRawValue(val)) {\n return {\n value: val\n };\n }\n\n return val;\n });\n }, []);\n var convert2LabelValues = React.useCallback(function (draftValues) {\n var values = toLabeledValues(draftValues);\n return values.map(function (item) {\n var rawLabel = item.label;\n var rawValue = item.value,\n rawHalfChecked = item.halfChecked;\n var rawDisabled;\n var entity = valueEntities.get(rawValue); // Fill missing label & status\n\n if (entity) {\n var _rawLabel;\n\n rawLabel = (_rawLabel = rawLabel) !== null && _rawLabel !== void 0 ? _rawLabel : getLabel(entity.node);\n rawDisabled = entity.node.disabled;\n } else if (rawLabel === undefined) {\n // We try to find in current `labelInValue` value\n var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {\n return labeledItem.value === rawValue;\n });\n rawLabel = labelInValueItem.label;\n }\n\n return {\n label: rawLabel,\n value: rawValue,\n halfChecked: rawHalfChecked,\n disabled: rawDisabled\n };\n });\n }, [valueEntities, getLabel, toLabeledValues, internalValue]); // =========================== Values ===========================\n\n var rawMixedLabeledValues = React.useMemo(function () {\n return toLabeledValues(internalValue);\n }, [toLabeledValues, internalValue]); // Split value into full check and half check\n\n var _React$useMemo = React.useMemo(function () {\n var fullCheckValues = [];\n var halfCheckValues = [];\n rawMixedLabeledValues.forEach(function (item) {\n if (item.halfChecked) {\n halfCheckValues.push(item);\n } else {\n fullCheckValues.push(item);\n }\n });\n return [fullCheckValues, halfCheckValues];\n }, [rawMixedLabeledValues]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n rawLabeledValues = _React$useMemo2[0],\n rawHalfLabeledValues = _React$useMemo2[1]; // const [mergedValues] = useCache(rawLabeledValues);\n\n\n var rawValues = React.useMemo(function () {\n return rawLabeledValues.map(function (item) {\n return item.value;\n });\n }, [rawLabeledValues]); // Convert value to key. Will fill missed keys for conduct check.\n\n var _useCheckedKeys = useCheckedKeys(rawLabeledValues, rawHalfLabeledValues, treeConduction, keyEntities),\n _useCheckedKeys2 = _slicedToArray(_useCheckedKeys, 2),\n rawCheckedValues = _useCheckedKeys2[0],\n rawHalfCheckedValues = _useCheckedKeys2[1]; // Convert rawCheckedKeys to check strategy related values\n\n\n var displayValues = React.useMemo(function () {\n // Collect keys which need to show\n var displayKeys = formatStrategyValues(rawCheckedValues, showCheckedStrategy, keyEntities, mergedFieldNames); // Convert to value and filled with label\n\n var values = displayKeys.map(function (key) {\n var _keyEntities$key$node, _keyEntities$key, _keyEntities$key$node2;\n\n return (_keyEntities$key$node = (_keyEntities$key = keyEntities[key]) === null || _keyEntities$key === void 0 ? void 0 : (_keyEntities$key$node2 = _keyEntities$key.node) === null || _keyEntities$key$node2 === void 0 ? void 0 : _keyEntities$key$node2[mergedFieldNames.value]) !== null && _keyEntities$key$node !== void 0 ? _keyEntities$key$node : key;\n }); // Back fill with origin label\n\n var labeledValues = values.map(function (val) {\n var targetItem = rawLabeledValues.find(function (item) {\n return item.value === val;\n });\n return {\n value: val,\n label: targetItem === null || targetItem === void 0 ? void 0 : targetItem.label\n };\n });\n var rawDisplayValues = convert2LabelValues(labeledValues);\n var firstVal = rawDisplayValues[0];\n\n if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) {\n return [];\n }\n\n return rawDisplayValues.map(function (item) {\n var _item$label;\n\n return _objectSpread(_objectSpread({}, item), {}, {\n label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value\n });\n });\n }, [mergedFieldNames, mergedMultiple, rawCheckedValues, rawLabeledValues, convert2LabelValues, showCheckedStrategy, keyEntities]);\n\n var _useCache = useCache(displayValues),\n _useCache2 = _slicedToArray(_useCache, 1),\n cachedDisplayValues = _useCache2[0]; // =========================== Change ===========================\n\n\n var triggerChange = useRefFunc(function (newRawValues, extra, source) {\n var labeledValues = convert2LabelValues(newRawValues);\n setInternalValue(labeledValues); // Clean up if needed\n\n if (autoClearSearchValue) {\n setSearchValue('');\n } // Generate rest parameters is costly, so only do it when necessary\n\n\n if (onChange) {\n var eventValues = newRawValues;\n\n if (treeConduction) {\n var formattedKeyList = formatStrategyValues(newRawValues, showCheckedStrategy, keyEntities, mergedFieldNames);\n eventValues = formattedKeyList.map(function (key) {\n var entity = valueEntities.get(key);\n return entity ? entity.node[mergedFieldNames.value] : key;\n });\n }\n\n var _ref = extra || {\n triggerValue: undefined,\n selected: undefined\n },\n triggerValue = _ref.triggerValue,\n selected = _ref.selected;\n\n var returnRawValues = eventValues; // We need fill half check back\n\n if (treeCheckStrictly) {\n var halfValues = rawHalfLabeledValues.filter(function (item) {\n return !eventValues.includes(item.value);\n });\n returnRawValues = [].concat(_toConsumableArray(returnRawValues), _toConsumableArray(halfValues));\n }\n\n var returnLabeledValues = convert2LabelValues(returnRawValues);\n var additionalInfo = {\n // [Legacy] Always return as array contains label & value\n preValue: rawLabeledValues,\n triggerValue: triggerValue\n }; // [Legacy] Fill legacy data if user query.\n // This is expansive that we only fill when user query\n // https://github.com/react-component/tree-select/blob/fe33eb7c27830c9ac70cd1fdb1ebbe7bc679c16a/src/Select.jsx\n\n var showPosition = true;\n\n if (treeCheckStrictly || source === 'selection' && !selected) {\n showPosition = false;\n }\n\n fillAdditionalInfo(additionalInfo, triggerValue, newRawValues, mergedTreeData, showPosition, mergedFieldNames);\n\n if (mergedCheckable) {\n additionalInfo.checked = selected;\n } else {\n additionalInfo.selected = selected;\n }\n\n var returnValues = mergedLabelInValue ? returnLabeledValues : returnLabeledValues.map(function (item) {\n return item.value;\n });\n onChange(mergedMultiple ? returnValues : returnValues[0], mergedLabelInValue ? null : returnLabeledValues.map(function (item) {\n return item.label;\n }), additionalInfo);\n }\n }); // ========================== Options ===========================\n\n /** Trigger by option list */\n\n var onOptionSelect = React.useCallback(function (selectedKey, _ref2) {\n var _node$mergedFieldName;\n\n var selected = _ref2.selected,\n source = _ref2.source;\n var entity = keyEntities[selectedKey];\n var node = entity === null || entity === void 0 ? void 0 : entity.node;\n var selectedValue = (_node$mergedFieldName = node === null || node === void 0 ? void 0 : node[mergedFieldNames.value]) !== null && _node$mergedFieldName !== void 0 ? _node$mergedFieldName : selectedKey; // Never be falsy but keep it safe\n\n if (!mergedMultiple) {\n // Single mode always set value\n triggerChange([selectedValue], {\n selected: true,\n triggerValue: selectedValue\n }, 'option');\n } else {\n var newRawValues = selected ? [].concat(_toConsumableArray(rawValues), [selectedValue]) : rawCheckedValues.filter(function (v) {\n return v !== selectedValue;\n }); // Add keys if tree conduction\n\n if (treeConduction) {\n // Should keep missing values\n var _splitRawValues = splitRawValues(newRawValues),\n missingRawValues = _splitRawValues.missingRawValues,\n existRawValues = _splitRawValues.existRawValues;\n\n var keyList = existRawValues.map(function (val) {\n return valueEntities.get(val).key;\n }); // Conduction by selected or not\n\n var checkedKeys;\n\n if (selected) {\n var _conductCheck = conductCheck(keyList, true, keyEntities);\n\n checkedKeys = _conductCheck.checkedKeys;\n } else {\n var _conductCheck2 = conductCheck(keyList, {\n checked: false,\n halfCheckedKeys: rawHalfCheckedValues\n }, keyEntities);\n\n checkedKeys = _conductCheck2.checkedKeys;\n } // Fill back of keys\n\n\n newRawValues = [].concat(_toConsumableArray(missingRawValues), _toConsumableArray(checkedKeys.map(function (key) {\n return keyEntities[key].node[mergedFieldNames.value];\n })));\n }\n\n triggerChange(newRawValues, {\n selected: selected,\n triggerValue: selectedValue\n }, source || 'option');\n } // Trigger select event\n\n\n if (selected || !mergedMultiple) {\n onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedValue, fillLegacyProps(node));\n } else {\n onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectedValue, fillLegacyProps(node));\n }\n }, [splitRawValues, valueEntities, keyEntities, mergedFieldNames, mergedMultiple, rawValues, triggerChange, treeConduction, onSelect, onDeselect, rawCheckedValues, rawHalfCheckedValues]); // ========================== Dropdown ==========================\n\n var onInternalDropdownVisibleChange = React.useCallback(function (open) {\n if (onDropdownVisibleChange) {\n var legacyParam = {};\n Object.defineProperty(legacyParam, 'documentClickClose', {\n get: function get() {\n warning(false, 'Second param of `onDropdownVisibleChange` has been removed.');\n return false;\n }\n });\n onDropdownVisibleChange(open, legacyParam);\n }\n }, [onDropdownVisibleChange]); // ====================== Display Change ========================\n\n var onDisplayValuesChange = useRefFunc(function (newValues, info) {\n var newRawValues = newValues.map(function (item) {\n return item.value;\n });\n\n if (info.type === 'clear') {\n triggerChange(newRawValues, {}, 'selection');\n return;\n } // TreeSelect only have multiple mode which means display change only has remove\n\n\n if (info.values.length) {\n onOptionSelect(info.values[0].value, {\n selected: false,\n source: 'selection'\n });\n }\n }); // ========================== Context ===========================\n\n var treeSelectContext = React.useMemo(function () {\n return {\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n listHeight: listHeight,\n listItemHeight: listItemHeight,\n treeData: filteredTreeData,\n fieldNames: mergedFieldNames,\n onSelect: onOptionSelect,\n treeExpandAction: treeExpandAction\n };\n }, [virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, filteredTreeData, mergedFieldNames, onOptionSelect, treeExpandAction]); // ======================= Legacy Context =======================\n\n var legacyContext = React.useMemo(function () {\n return {\n checkable: mergedCheckable,\n loadData: loadData,\n treeLoadedKeys: treeLoadedKeys,\n onTreeLoad: onTreeLoad,\n checkedKeys: rawCheckedValues,\n halfCheckedKeys: rawHalfCheckedValues,\n treeDefaultExpandAll: treeDefaultExpandAll,\n treeExpandedKeys: treeExpandedKeys,\n treeDefaultExpandedKeys: treeDefaultExpandedKeys,\n onTreeExpand: onTreeExpand,\n treeIcon: treeIcon,\n treeMotion: treeMotion,\n showTreeIcon: showTreeIcon,\n switcherIcon: switcherIcon,\n treeLine: treeLine,\n treeNodeFilterProp: treeNodeFilterProp,\n keyEntities: keyEntities\n };\n }, [mergedCheckable, loadData, treeLoadedKeys, onTreeLoad, rawCheckedValues, rawHalfCheckedValues, treeDefaultExpandAll, treeExpandedKeys, treeDefaultExpandedKeys, onTreeExpand, treeIcon, treeMotion, showTreeIcon, switcherIcon, treeLine, treeNodeFilterProp, keyEntities]); // =========================== Render ===========================\n\n return /*#__PURE__*/React.createElement(TreeSelectContext.Provider, {\n value: treeSelectContext\n }, /*#__PURE__*/React.createElement(LegacyContext.Provider, {\n value: legacyContext\n }, /*#__PURE__*/React.createElement(BaseSelect, _extends({\n ref: ref\n }, restProps, {\n // >>> MISC\n id: mergedId,\n prefixCls: prefixCls,\n mode: mergedMultiple ? 'multiple' : undefined // >>> Display Value\n ,\n displayValues: cachedDisplayValues,\n onDisplayValuesChange: onDisplayValuesChange // >>> Search\n ,\n searchValue: mergedSearchValue,\n onSearch: onInternalSearch // >>> Options\n ,\n OptionList: OptionList,\n emptyOptions: !mergedTreeData.length,\n onDropdownVisibleChange: onInternalDropdownVisibleChange,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth\n }))));\n}); // Assign name for Debug\n\nif (process.env.NODE_ENV !== 'production') {\n TreeSelect.displayName = 'TreeSelect';\n}\n\nvar GenericTreeSelect = TreeSelect;\nGenericTreeSelect.TreeNode = TreeNode;\nGenericTreeSelect.SHOW_ALL = SHOW_ALL;\nGenericTreeSelect.SHOW_PARENT = SHOW_PARENT;\nGenericTreeSelect.SHOW_CHILD = SHOW_CHILD;\nexport default GenericTreeSelect;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport { convertDataToEntities } from \"rc-tree/es/utils/treeUtil\";\nimport warning from \"rc-util/es/warning\";\nimport { isNil } from \"../utils/valueUtil\";\nexport default (function (treeData, fieldNames) {\n return React.useMemo(function () {\n var collection = convertDataToEntities(treeData, {\n fieldNames: fieldNames,\n initWrapper: function initWrapper(wrapper) {\n return _objectSpread(_objectSpread({}, wrapper), {}, {\n valueEntities: new Map()\n });\n },\n processEntity: function processEntity(entity, wrapper) {\n var val = entity.node[fieldNames.value]; // Check if exist same value\n\n if (process.env.NODE_ENV !== 'production') {\n var key = entity.node.key;\n warning(!isNil(val), 'TreeNode `value` is invalidate: undefined');\n warning(!wrapper.valueEntities.has(val), \"Same `value` exist in the tree: \".concat(val));\n warning(!key || String(key) === String(val), \"`key` or `value` with TreeNode must be the same or you can remove one of them. key: \".concat(key, \", value: \").concat(val, \".\"));\n }\n\n wrapper.valueEntities.set(val, entity);\n }\n });\n return collection;\n }, [treeData, fieldNames]);\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport { fillLegacyProps } from \"../utils/legacyUtil\";\nexport default (function (treeData, searchValue, _ref) {\n var treeNodeFilterProp = _ref.treeNodeFilterProp,\n filterTreeNode = _ref.filterTreeNode,\n fieldNames = _ref.fieldNames;\n var fieldChildren = fieldNames.children;\n return React.useMemo(function () {\n if (!searchValue || filterTreeNode === false) {\n return treeData;\n }\n\n var filterOptionFunc;\n\n if (typeof filterTreeNode === 'function') {\n filterOptionFunc = filterTreeNode;\n } else {\n var upperStr = searchValue.toUpperCase();\n\n filterOptionFunc = function filterOptionFunc(_, dataNode) {\n var value = dataNode[treeNodeFilterProp];\n return String(value).toUpperCase().includes(upperStr);\n };\n }\n\n function dig(list) {\n var keepAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return list.map(function (dataNode) {\n var children = dataNode[fieldChildren];\n var match = keepAll || filterOptionFunc(searchValue, fillLegacyProps(dataNode));\n var childList = dig(children || [], match);\n\n if (match || childList.length) {\n return _objectSpread(_objectSpread({}, dataNode), {}, _defineProperty({\n isLeaf: undefined\n }, fieldChildren, childList));\n }\n\n return null;\n }).filter(function (node) {\n return node;\n });\n }\n\n return dig(treeData);\n }, [treeData, searchValue, fieldChildren, treeNodeFilterProp, filterTreeNode]);\n});","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\nimport { conductCheck } from \"rc-tree/es/utils/conductUtil\";\nexport default (function (rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities) {\n return React.useMemo(function () {\n var checkedKeys = rawLabeledValues.map(function (_ref) {\n var value = _ref.value;\n return value;\n });\n var halfCheckedKeys = rawHalfCheckedValues.map(function (_ref2) {\n var value = _ref2.value;\n return value;\n });\n var missingValues = checkedKeys.filter(function (key) {\n return !keyEntities[key];\n });\n\n if (treeConduction) {\n var _conductCheck = conductCheck(checkedKeys, true, keyEntities);\n\n checkedKeys = _conductCheck.checkedKeys;\n halfCheckedKeys = _conductCheck.halfCheckedKeys;\n }\n\n return [// Checked keys should fill with missing keys which should de-duplicated\n Array.from(new Set([].concat(_toConsumableArray(missingValues), _toConsumableArray(checkedKeys)))), // Half checked keys\n halfCheckedKeys];\n }, [rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities]);\n});","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\n\n/**\n * This function will try to call requestIdleCallback if available to save performance.\n * No need `getLabel` here since already fetch on `rawLabeledValue`.\n */\nexport default (function (values) {\n var cacheRef = React.useRef({\n valueLabels: new Map()\n });\n return React.useMemo(function () {\n var valueLabels = cacheRef.current.valueLabels;\n var valueLabelsCache = new Map();\n var filledValues = values.map(function (item) {\n var _item$label;\n\n var value = item.value;\n var mergedLabel = (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : valueLabels.get(value); // Save in cache\n\n valueLabelsCache.set(value, mergedLabel);\n return _objectSpread(_objectSpread({}, item), {}, {\n label: mergedLabel\n });\n });\n cacheRef.current.valueLabels = valueLabelsCache;\n return [filledValues];\n }, [values]);\n});","import TreeSelect from \"./TreeSelect\";\nimport TreeNode from \"./TreeNode\";\nimport { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from \"./utils/strategyUtil\";\nexport { TreeNode, SHOW_ALL, SHOW_CHILD, SHOW_PARENT };\nexport default TreeSelect;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcTreeSelect, { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeNode } from 'rc-tree-select';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport defaultRenderEmpty from '../config-provider/defaultRenderEmpty';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { FormItemInputContext } from '../form/context';\nimport getIcons from '../select/utils/iconUtil';\nimport renderSwitcherIcon from '../tree/utils/iconUtil';\nimport { getTransitionDirection, getTransitionName } from '../_util/motion';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport { useCompactItemContext } from '../space/Compact';\nimport warning from '../_util/warning';\nvar InternalTreeSelect = function InternalTreeSelect(_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n customizeSize = _a.size,\n customDisabled = _a.disabled,\n _a$bordered = _a.bordered,\n bordered = _a$bordered === void 0 ? true : _a$bordered,\n className = _a.className,\n treeCheckable = _a.treeCheckable,\n multiple = _a.multiple,\n _a$listHeight = _a.listHeight,\n listHeight = _a$listHeight === void 0 ? 256 : _a$listHeight,\n _a$listItemHeight = _a.listItemHeight,\n listItemHeight = _a$listItemHeight === void 0 ? 26 : _a$listItemHeight,\n placement = _a.placement,\n notFoundContent = _a.notFoundContent,\n _switcherIcon = _a.switcherIcon,\n treeLine = _a.treeLine,\n getPopupContainer = _a.getPopupContainer,\n dropdownClassName = _a.dropdownClassName,\n popupClassName = _a.popupClassName,\n _a$treeIcon = _a.treeIcon,\n treeIcon = _a$treeIcon === void 0 ? false : _a$treeIcon,\n transitionName = _a.transitionName,\n _a$choiceTransitionNa = _a.choiceTransitionName,\n choiceTransitionName = _a$choiceTransitionNa === void 0 ? '' : _a$choiceTransitionNa,\n customStatus = _a.status,\n showArrow = _a.showArrow,\n treeExpandAction = _a.treeExpandAction,\n props = __rest(_a, [\"prefixCls\", \"size\", \"disabled\", \"bordered\", \"className\", \"treeCheckable\", \"multiple\", \"listHeight\", \"listItemHeight\", \"placement\", \"notFoundContent\", \"switcherIcon\", \"treeLine\", \"getPopupContainer\", \"dropdownClassName\", \"popupClassName\", \"treeIcon\", \"transitionName\", \"choiceTransitionName\", \"status\", \"showArrow\", \"treeExpandAction\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction,\n virtual = _React$useContext.virtual,\n dropdownMatchSelectWidth = _React$useContext.dropdownMatchSelectWidth;\n var size = React.useContext(SizeContext);\n process.env.NODE_ENV !== \"production\" ? warning(multiple !== false || !treeCheckable, 'TreeSelect', '`multiple` will always be `true` when `treeCheckable` is true') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, 'TreeSelect', '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.') : void 0;\n var prefixCls = getPrefixCls('select', customizePrefixCls);\n var treePrefixCls = getPrefixCls('select-tree', customizePrefixCls);\n var treeSelectPrefixCls = getPrefixCls('tree-select', customizePrefixCls);\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var mergedDropdownClassName = classNames(popupClassName || dropdownClassName, \"\".concat(treeSelectPrefixCls, \"-dropdown\"), _defineProperty({}, \"\".concat(treeSelectPrefixCls, \"-dropdown-rtl\"), direction === 'rtl'));\n var isMultiple = !!(treeCheckable || multiple);\n var mergedShowArrow = showArrow !== undefined ? showArrow : props.loading || !isMultiple;\n // ===================== Form =====================\n var _useContext = useContext(FormItemInputContext),\n contextStatus = _useContext.status,\n hasFeedback = _useContext.hasFeedback,\n isFormItemInput = _useContext.isFormItemInput,\n feedbackIcon = _useContext.feedbackIcon;\n var mergedStatus = getMergedStatus(contextStatus, customStatus);\n // ===================== Icons =====================\n var _getIcons = getIcons(_extends(_extends({}, props), {\n multiple: isMultiple,\n showArrow: mergedShowArrow,\n hasFeedback: hasFeedback,\n feedbackIcon: feedbackIcon,\n prefixCls: prefixCls\n })),\n suffixIcon = _getIcons.suffixIcon,\n removeIcon = _getIcons.removeIcon,\n clearIcon = _getIcons.clearIcon;\n // ===================== Empty =====================\n var mergedNotFound;\n if (notFoundContent !== undefined) {\n mergedNotFound = notFoundContent;\n } else {\n mergedNotFound = (renderEmpty || defaultRenderEmpty)('Select');\n }\n // ==================== Render =====================\n var selectProps = omit(props, ['suffixIcon', 'itemIcon', 'removeIcon', 'clearIcon', 'switcherIcon']);\n // ===================== Placement =====================\n var getPlacement = function getPlacement() {\n if (placement !== undefined) {\n return placement;\n }\n return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n };\n var mergedSize = compactSize || customizeSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var mergedClassName = classNames(!customizePrefixCls && treeSelectPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), mergedSize === 'large'), \"\".concat(prefixCls, \"-sm\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-borderless\"), !bordered), \"\".concat(prefixCls, \"-in-form-item\"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, className);\n var rootPrefixCls = getPrefixCls();\n return /*#__PURE__*/React.createElement(RcTreeSelect, _extends({\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n disabled: mergedDisabled\n }, selectProps, {\n ref: ref,\n prefixCls: prefixCls,\n className: mergedClassName,\n listHeight: listHeight,\n listItemHeight: listItemHeight,\n treeCheckable: treeCheckable ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-tree-checkbox-inner\")\n }) : treeCheckable,\n treeLine: !!treeLine,\n inputIcon: suffixIcon,\n multiple: multiple,\n placement: getPlacement(),\n removeIcon: removeIcon,\n clearIcon: clearIcon,\n switcherIcon: function switcherIcon(nodeProps) {\n return renderSwitcherIcon(treePrefixCls, _switcherIcon, treeLine, nodeProps);\n },\n showTreeIcon: treeIcon,\n notFoundContent: mergedNotFound,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n treeMotion: null,\n dropdownClassName: mergedDropdownClassName,\n choiceTransitionName: getTransitionName(rootPrefixCls, '', choiceTransitionName),\n transitionName: getTransitionName(rootPrefixCls, getTransitionDirection(placement), transitionName),\n showArrow: hasFeedback || showArrow,\n treeExpandAction: treeExpandAction\n }));\n};\nvar TreeSelectRef = /*#__PURE__*/React.forwardRef(InternalTreeSelect);\nvar TreeSelect = TreeSelectRef;\nTreeSelect.TreeNode = TreeNode;\nTreeSelect.SHOW_ALL = SHOW_ALL;\nTreeSelect.SHOW_PARENT = SHOW_PARENT;\nTreeSelect.SHOW_CHILD = SHOW_CHILD;\nexport { TreeNode };\nexport default TreeSelect;","import React from \"react\";\nimport { TreeSelect } from \"antd\";\nimport { Select } from \"antd\";\n\nconst { Option, OptGroup } = Select;\nconst { TreeNode } = TreeSelect;\nexport const CXSelect = ({ children, ...props }) => {\n return ;\n};\n\nexport const CXOption = ({ children, ...props }) => {\n return ;\n};\n\nexport const CXTreeSelect = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXTreeNode = ({ children, ...props }) => {\n return {children};\n};\nexport const CXOptGroup = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Skeleton } from \"antd\";\nimport \"./style.css\";\nexport const CXSkeleton = ({ children, ...props }) => {\n return ;\n};\nexport const CXSkeletonBtn = ({ children, ...props }) => {\n return ;\n};\nexport const CXSkeletonAVT = ({ children, ...props }) => {\n return ;\n};\nexport const CXSkeletonInp = ({ children, ...props }) => {\n return ;\n};\n\nexport const CXTaskManagerSkeleton = () => {\n return (\n
\n
\n \n \n \n
\n
\n \n \n
\n
\n \n
\n
\n );\n};\n\nexport const CXbotSkeleton = () => {\n return (\n \n \n \n );\n};\n\nexport const CXInboxUserSkeleton = () => {\n return (\n
\n {[...Array(6)].map((res) => {\n return (\n
\n \n \n \n
\n );\n })}\n
\n );\n};\nexport const CXTeamUserSkeleton = () => {\n return (\n
\n {[...Array(6)].map((res) => {\n return (\n
\n \n \n
\n );\n })}\n
\n );\n};\nexport const CXInboxInfoSkeleton = () => {\n return (\n
\n
\n \n \n {[...Array(3)].map((res) => {\n return (\n \n );\n })}\n
\n
\n );\n};\n\nexport const DashInfoSkeleton = () => {\n const DivSt = {\n display: \"flex\",\n };\n return (\n
\n
\n \n
\n
\n {[...Array(2)].map((res) => {\n return ;\n })}\n
\n
\n );\n};\n\nexport const ContactSkeleton = () => {\n return (\n
\n {[...Array(5)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n );\n};\nexport const ContactSkeletonTB = () => {\n return (\n
\n {[...Array(5)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n );\n};\nexport const CXInputSkeleton = () => {\n return ;\n};\n","import React from \"react\";\nimport { Spin } from \"antd\";\n\nexport const CXSpin = (props) => {\n return ;\n};\n","import { CXForm, CXFormItem } from \"component/Form\";\nimport { CXTextArea } from \"component/Input\";\nimport TagsSearch from \"component/TagsSearch\";\nimport React, { Fragment, useEffect, useState } from \"react\";\n\nconst AdditionalContent = ({ form, type = \"single\", name = \"reset\" }) => {\n const [tag, settag] = useState([]);\n useEffect(() => {\n settag([]);\n form.resetFields();\n\n return () => {\n settag([]);\n form.resetFields();\n };\n }, [name]);\n return (\n \n {\" \"}\n \n \n \n
\n Tag:\n {\n form.setFieldsValue({ tag: value });\n settag(value);\n }}\n />\n
\n
\n \n
Notes:
\n {\n form.setFieldsValue({ note: e.target.value });\n }}\n />\n
\n {type === \"bulk\" && (\n \n ** Changes apply to all selected candidates\n \n )}\n
\n
\n \n );\n};\n\nexport default AdditionalContent;\n","import { RightCircleOutlined } from \"@ant-design/icons\";\nimport { checkNextStageSequence } from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport AdditionalContent from \"./additionalContent\";\nimport { Form } from \"antd\";\n\nconst Index = ({\n name,\n stage,\n updateStageID,\n setconfirmModal,\n setTempValue,\n TempValue,\n openingId,\n sVal,\n}) => {\n const dispatch = useDispatch();\n const { stageNextSqLoading, stageNextSq } = useSelector(\n (state) => state.OpeningReducer\n );\n useEffect(() => {\n dispatch(checkNextStageSequence({ openingId, sVal }));\n }, [stage, sVal]);\n const [form] = Form.useForm();\n return (\n
\n
\n Do you want to move {name}\n to {stage}.\n {stageNextSqLoading && (\n
\n \n
Please wait...
\n
\n )}\n {stageNextSq?.length > 0 && !stageNextSqLoading && (\n
\n This will trigger the following sequence:\n
\n {stageNextSq?.map((res) => {\n return (\n
\n \n {res.name}\n
\n );\n })}\n
\n
\n )}\n
\n {!stageNextSqLoading && }\n {!stageNextSqLoading && (\n
\n {\n let formdata = form.getFieldsValue();\n updateStageID(TempValue, formdata);\n setconfirmModal(false);\n setTempValue(null);\n form.resetFields();\n }}\n >\n Yes\n \n {\n setconfirmModal(false);\n setTempValue(null);\n }}\n >\n No\n \n
\n )}\n
\n );\n};\n\nexport default Index;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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\";\nvar _excluded = [\"className\", \"prefixCls\", \"style\", \"active\", \"status\", \"iconPrefix\", \"icon\", \"wrapperStyle\", \"stepNumber\", \"disabled\", \"description\", \"title\", \"subTitle\", \"progressDot\", \"stepIcon\", \"tailContent\", \"icons\", \"stepIndex\", \"onStepClick\", \"onClick\"];\n\n/* eslint react/prop-types: 0 */\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nfunction isString(str) {\n return typeof str === 'string';\n}\n\nvar Step = /*#__PURE__*/function (_React$Component) {\n _inherits(Step, _React$Component);\n\n var _super = _createSuper(Step);\n\n function Step() {\n var _this;\n\n _classCallCheck(this, Step);\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(_args));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function () {\n var _this$props = _this.props,\n onClick = _this$props.onClick,\n onStepClick = _this$props.onStepClick,\n stepIndex = _this$props.stepIndex;\n\n if (onClick) {\n onClick.apply(void 0, arguments);\n }\n\n onStepClick(stepIndex);\n });\n\n return _this;\n }\n\n _createClass(Step, [{\n key: \"renderIconNode\",\n value: function renderIconNode() {\n var _classNames;\n\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n progressDot = _this$props2.progressDot,\n stepIcon = _this$props2.stepIcon,\n stepNumber = _this$props2.stepNumber,\n status = _this$props2.status,\n title = _this$props2.title,\n description = _this$props2.description,\n icon = _this$props2.icon,\n iconPrefix = _this$props2.iconPrefix,\n icons = _this$props2.icons;\n var iconNode;\n var iconClassName = classNames(\"\".concat(prefixCls, \"-icon\"), \"\".concat(iconPrefix, \"icon\"), (_classNames = {}, _defineProperty(_classNames, \"\".concat(iconPrefix, \"icon-\").concat(icon), icon && isString(icon)), _defineProperty(_classNames, \"\".concat(iconPrefix, \"icon-check\"), !icon && status === 'finish' && (icons && !icons.finish || !icons)), _defineProperty(_classNames, \"\".concat(iconPrefix, \"icon-cross\"), !icon && status === 'error' && (icons && !icons.error || !icons)), _classNames));\n var iconDot = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon-dot\")\n }); // `progressDot` enjoy the highest priority\n\n if (progressDot) {\n if (typeof progressDot === 'function') {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, progressDot(iconDot, {\n index: stepNumber - 1,\n status: status,\n title: title,\n description: description\n }));\n } else {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, iconDot);\n }\n } else if (icon && !isString(icon)) {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, icon);\n } else if (icons && icons.finish && status === 'finish') {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, icons.finish);\n } else if (icons && icons.error && status === 'error') {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, icons.error);\n } else if (icon || status === 'finish' || status === 'error') {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: iconClassName\n });\n } else {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, stepNumber);\n }\n\n if (stepIcon) {\n iconNode = stepIcon({\n index: stepNumber - 1,\n status: status,\n title: title,\n description: description,\n node: iconNode\n });\n }\n\n return iconNode;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames2;\n\n var _this$props3 = this.props,\n className = _this$props3.className,\n prefixCls = _this$props3.prefixCls,\n style = _this$props3.style,\n active = _this$props3.active,\n _this$props3$status = _this$props3.status,\n status = _this$props3$status === void 0 ? 'wait' : _this$props3$status,\n iconPrefix = _this$props3.iconPrefix,\n icon = _this$props3.icon,\n wrapperStyle = _this$props3.wrapperStyle,\n stepNumber = _this$props3.stepNumber,\n disabled = _this$props3.disabled,\n description = _this$props3.description,\n title = _this$props3.title,\n subTitle = _this$props3.subTitle,\n progressDot = _this$props3.progressDot,\n stepIcon = _this$props3.stepIcon,\n tailContent = _this$props3.tailContent,\n icons = _this$props3.icons,\n stepIndex = _this$props3.stepIndex,\n onStepClick = _this$props3.onStepClick,\n onClick = _this$props3.onClick,\n restProps = _objectWithoutProperties(_this$props3, _excluded);\n\n var classString = classNames(\"\".concat(prefixCls, \"-item\"), \"\".concat(prefixCls, \"-item-\").concat(status), className, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-custom\"), icon), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-active\"), active), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-disabled\"), disabled === true), _classNames2));\n\n var stepItemStyle = _objectSpread({}, style);\n\n var accessibilityProps = {};\n\n if (onStepClick && !disabled) {\n accessibilityProps.role = 'button';\n accessibilityProps.tabIndex = 0;\n accessibilityProps.onClick = this.onClick;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, restProps, {\n className: classString,\n style: stepItemStyle\n }), /*#__PURE__*/React.createElement(\"div\", _extends({\n onClick: onClick\n }, accessibilityProps, {\n className: \"\".concat(prefixCls, \"-item-container\")\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-tail\")\n }, tailContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-icon\")\n }, this.renderIconNode()), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-content\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-title\")\n }, title, subTitle && /*#__PURE__*/React.createElement(\"div\", {\n title: typeof subTitle === 'string' ? subTitle : undefined,\n className: \"\".concat(prefixCls, \"-item-subtitle\")\n }, subTitle)), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-description\")\n }, description))));\n }\n }]);\n\n return Step;\n}(React.Component);\n\nexport { Step as default };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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\";\nvar _excluded = [\"prefixCls\", \"style\", \"className\", \"children\", \"direction\", \"type\", \"labelPlacement\", \"iconPrefix\", \"status\", \"size\", \"current\", \"progressDot\", \"stepIcon\", \"initial\", \"icons\", \"onChange\", \"items\"];\n\n/* eslint react/no-did-mount-set-state: 0, react/prop-types: 0 */\nimport classNames from 'classnames';\nimport React from 'react';\nimport Step from \"./Step\";\n\nvar Steps = /*#__PURE__*/function (_React$Component) {\n _inherits(Steps, _React$Component);\n\n var _super = _createSuper(Steps);\n\n function Steps() {\n var _this;\n\n _classCallCheck(this, Steps);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"onStepClick\", function (next) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n current = _this$props.current;\n\n if (onChange && current !== next) {\n onChange(next);\n }\n });\n\n return _this;\n }\n\n _createClass(Steps, [{\n key: \"render\",\n value: function render() {\n var _classNames,\n _this2 = this;\n\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n _this$props2$style = _this$props2.style,\n style = _this$props2$style === void 0 ? {} : _this$props2$style,\n className = _this$props2.className,\n children = _this$props2.children,\n direction = _this$props2.direction,\n type = _this$props2.type,\n labelPlacement = _this$props2.labelPlacement,\n iconPrefix = _this$props2.iconPrefix,\n status = _this$props2.status,\n size = _this$props2.size,\n current = _this$props2.current,\n progressDot = _this$props2.progressDot,\n stepIcon = _this$props2.stepIcon,\n initial = _this$props2.initial,\n icons = _this$props2.icons,\n onChange = _this$props2.onChange,\n _this$props2$items = _this$props2.items,\n items = _this$props2$items === void 0 ? [] : _this$props2$items,\n restProps = _objectWithoutProperties(_this$props2, _excluded);\n\n var isNav = type === 'navigation';\n var adjustedLabelPlacement = progressDot ? 'vertical' : labelPlacement;\n var classString = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(direction), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(size), size), _defineProperty(_classNames, \"\".concat(prefixCls, \"-label-\").concat(adjustedLabelPlacement), direction === 'horizontal'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot\"), !!progressDot), _defineProperty(_classNames, \"\".concat(prefixCls, \"-navigation\"), isNav), _classNames));\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString,\n style: style\n }, restProps), items.filter(function (item) {\n return item;\n }).map(function (item, index) {\n var mergedItem = _objectSpread({}, item);\n\n var stepNumber = initial + index; // fix tail color\n\n if (status === 'error' && index === current - 1) {\n mergedItem.className = \"\".concat(prefixCls, \"-next-error\");\n }\n\n if (!mergedItem.status) {\n if (stepNumber === current) {\n mergedItem.status = status;\n } else if (stepNumber < current) {\n mergedItem.status = 'finish';\n } else {\n mergedItem.status = 'wait';\n }\n }\n\n return /*#__PURE__*/React.createElement(Step, _extends({}, mergedItem, {\n active: stepNumber === current,\n stepNumber: stepNumber + 1,\n stepIndex: stepNumber,\n key: stepNumber,\n prefixCls: prefixCls,\n iconPrefix: iconPrefix,\n wrapperStyle: style,\n progressDot: progressDot,\n stepIcon: stepIcon,\n icons: icons,\n onStepClick: onChange && _this2.onStepClick\n }));\n }));\n }\n }]);\n\n return Steps;\n}(React.Component);\n\n_defineProperty(Steps, \"Step\", Step);\n\n_defineProperty(Steps, \"defaultProps\", {\n type: 'default',\n prefixCls: 'rc-steps',\n iconPrefix: 'rc',\n direction: 'horizontal',\n labelPlacement: 'horizontal',\n initial: 0,\n current: 0,\n status: 'process',\n size: '',\n progressDot: false\n});\n\nexport { Steps as default };","import Steps from \"./Steps\";\nimport Step from \"./Step\";\nexport { Step };\nexport default Steps;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport RcSteps from 'rc-steps';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport Progress from '../progress';\nimport useLegacyItems from './useLegacyItems';\nvar Steps = function Steps(props) {\n var percent = props.percent,\n size = props.size,\n className = props.className,\n direction = props.direction,\n items = props.items,\n _props$responsive = props.responsive,\n responsive = _props$responsive === void 0 ? true : _props$responsive,\n _props$current = props.current,\n current = _props$current === void 0 ? 0 : _props$current,\n children = props.children,\n restProps = __rest(props, [\"percent\", \"size\", \"className\", \"direction\", \"items\", \"responsive\", \"current\", \"children\"]);\n var _useBreakpoint = useBreakpoint(responsive),\n xs = _useBreakpoint.xs;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n rtlDirection = _React$useContext.direction;\n var getDirection = React.useCallback(function () {\n return responsive && xs ? 'vertical' : direction;\n }, [xs, direction]);\n var prefixCls = getPrefixCls('steps', props.prefixCls);\n var iconPrefix = getPrefixCls('', props.iconPrefix);\n var mergedItems = useLegacyItems(items, children);\n var stepsClassName = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtlDirection === 'rtl'), \"\".concat(prefixCls, \"-with-progress\"), percent !== undefined), className);\n var icons = {\n finish: /*#__PURE__*/React.createElement(CheckOutlined, {\n className: \"\".concat(prefixCls, \"-finish-icon\")\n }),\n error: /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-error-icon\")\n })\n };\n var stepIconRender = function stepIconRender(_ref) {\n var node = _ref.node,\n status = _ref.status;\n if (status === 'process' && percent !== undefined) {\n // currently it's hard-coded, since we can't easily read the actually width of icon\n var progressWidth = size === 'small' ? 32 : 40;\n // iconWithProgress\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-progress-icon\")\n }, /*#__PURE__*/React.createElement(Progress, {\n type: \"circle\",\n percent: percent,\n width: progressWidth,\n strokeWidth: 4,\n format: function format() {\n return null;\n }\n }), node);\n }\n return node;\n };\n return /*#__PURE__*/React.createElement(RcSteps, _extends({\n icons: icons\n }, restProps, {\n current: current,\n size: size,\n items: mergedItems,\n direction: getDirection(),\n stepIcon: stepIconRender,\n prefixCls: prefixCls,\n iconPrefix: iconPrefix,\n className: stepsClassName\n }));\n};\nSteps.Step = RcSteps.Step;\nexport default Steps;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport warning from '../_util/warning';\nfunction filter(items) {\n return items.filter(function (item) {\n return item;\n });\n}\nexport default function useLegacyItems(items, children) {\n if (items) {\n return items;\n }\n process.env.NODE_ENV !== \"production\" ? warning(!children, 'Steps', 'Step is deprecated. Please use `items` directly.') : void 0;\n var childrenItems = toArray(children).map(function (node) {\n if ( /*#__PURE__*/React.isValidElement(node)) {\n var props = node.props;\n var item = _extends({}, props);\n return item;\n }\n return null;\n });\n return filter(childrenItems);\n}","import React from \"react\";\nimport { Steps } from \"antd\";\n\nexport const CXSteps = (props) => {\n return ;\n};\n\nexport const CXStep = (props) => {\n return ;\n};\n","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nvar Switch = React.forwardRef(function (_ref, ref) {\n var _classNames;\n\n var _ref$prefixCls = _ref.prefixCls,\n prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,\n className = _ref.className,\n checked = _ref.checked,\n defaultChecked = _ref.defaultChecked,\n disabled = _ref.disabled,\n loadingIcon = _ref.loadingIcon,\n checkedChildren = _ref.checkedChildren,\n unCheckedChildren = _ref.unCheckedChildren,\n onClick = _ref.onClick,\n onChange = _ref.onChange,\n onKeyDown = _ref.onKeyDown,\n restProps = _objectWithoutProperties(_ref, [\"prefixCls\", \"className\", \"checked\", \"defaultChecked\", \"disabled\", \"loadingIcon\", \"checkedChildren\", \"unCheckedChildren\", \"onClick\", \"onChange\", \"onKeyDown\"]);\n\n var _useMergedState = useMergedState(false, {\n value: checked,\n defaultValue: defaultChecked\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n innerChecked = _useMergedState2[0],\n setInnerChecked = _useMergedState2[1];\n\n function triggerChange(newChecked, event) {\n var mergedChecked = innerChecked;\n\n if (!disabled) {\n mergedChecked = newChecked;\n setInnerChecked(mergedChecked);\n onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);\n }\n\n return mergedChecked;\n }\n\n function onInternalKeyDown(e) {\n if (e.which === KeyCode.LEFT) {\n triggerChange(false, e);\n } else if (e.which === KeyCode.RIGHT) {\n triggerChange(true, e);\n }\n\n onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);\n }\n\n function onInternalClick(e) {\n var ret = triggerChange(!innerChecked, e); // [Legacy] trigger onClick with value\n\n onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);\n }\n\n var switchClassName = classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-checked\"), innerChecked), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _classNames));\n return React.createElement(\"button\", Object.assign({}, restProps, {\n type: \"button\",\n role: \"switch\",\n \"aria-checked\": innerChecked,\n disabled: disabled,\n className: switchClassName,\n ref: ref,\n onKeyDown: onInternalKeyDown,\n onClick: onInternalClick\n }), loadingIcon, React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }, innerChecked ? checkedChildren : unCheckedChildren));\n});\nSwitch.displayName = 'Switch';\nexport default Switch;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport RcSwitch from 'rc-switch';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport warning from '../_util/warning';\nimport Wave from '../_util/wave';\nvar Switch = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n customizeSize = _a.size,\n customDisabled = _a.disabled,\n loading = _a.loading,\n _a$className = _a.className,\n className = _a$className === void 0 ? '' : _a$className,\n props = __rest(_a, [\"prefixCls\", \"size\", \"disabled\", \"loading\", \"className\"]);\n process.env.NODE_ENV !== \"production\" ? warning('checked' in props || !('value' in props), 'Switch', '`value` is not a valid prop, do you mean `checked`?') : void 0;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var size = React.useContext(SizeContext);\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;\n var prefixCls = getPrefixCls('switch', customizePrefixCls);\n var loadingIcon = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-handle\")\n }, loading && /*#__PURE__*/React.createElement(LoadingOutlined, {\n className: \"\".concat(prefixCls, \"-loading-icon\")\n }));\n var classes = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-small\"), (customizeSize || size) === 'small'), \"\".concat(prefixCls, \"-loading\"), loading), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(Wave, {\n insertExtraNode: true\n }, /*#__PURE__*/React.createElement(RcSwitch, _extends({}, props, {\n prefixCls: prefixCls,\n className: classes,\n disabled: mergedDisabled,\n ref: ref,\n loadingIcon: loadingIcon\n })));\n});\nSwitch.__ANT_SWITCH = true;\nif (process.env.NODE_ENV !== 'production') {\n Switch.displayName = 'Switch';\n}\nexport default Switch;","import React from \"react\";\nimport { Switch } from \"antd\";\n\nimport \"./style.css\";\n\nexport const CXSwitch = (props) => {\n return ;\n};\n\nexport const CXSwitchMaterial = (props) => {\n return (\n
\n \n \n
\n );\n};\n","/* istanbul ignore next */\n\n/**\n * This is a syntactic sugar for `columns` prop.\n * So HOC will not work on this.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction ColumnGroup(_) {\n return null;\n}\n\nexport default ColumnGroup;","/* istanbul ignore next */\n\n/**\n * This is a syntactic sugar for `columns` prop.\n * So HOC will not work on this.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction Column(_) {\n return null;\n}\n\nexport default Column;","var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY';\n\nfunction toArray(arr) {\n if (arr === undefined || arr === null) {\n return [];\n }\n\n return Array.isArray(arr) ? arr : [arr];\n}\n\nexport function getPathValue(record, path) {\n // Skip if path is empty\n if (!path && typeof path !== 'number') {\n return record;\n }\n\n var pathList = toArray(path);\n var current = record;\n\n for (var i = 0; i < pathList.length; i += 1) {\n if (!current) {\n return null;\n }\n\n var prop = pathList[i];\n current = current[prop];\n }\n\n return current;\n}\nexport function getColumnsKey(columns) {\n var columnKeys = [];\n var keys = {};\n columns.forEach(function (column) {\n var _ref = column || {},\n key = _ref.key,\n dataIndex = _ref.dataIndex;\n\n var mergedKey = key || toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;\n\n while (keys[mergedKey]) {\n mergedKey = \"\".concat(mergedKey, \"_next\");\n }\n\n keys[mergedKey] = true;\n columnKeys.push(mergedKey);\n });\n return columnKeys;\n}\nexport function validateValue(val) {\n return val !== null && val !== undefined;\n}","import * as React from 'react'; // Tell cell that browser support sticky\n\nvar StickyContext = /*#__PURE__*/React.createContext(false);\nexport default StickyContext;","import { createContext } from '../ContextSelector';\nvar HoverContext = createContext();\nexport default HoverContext;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport shallowEqual from 'shallowequal';\nexport function createContext() {\n var Context = /*#__PURE__*/React.createContext(null);\n\n var Provider = function Provider(_ref) {\n var value = _ref.value,\n children = _ref.children;\n var valueRef = React.useRef(value);\n valueRef.current = value;\n\n var _React$useState = React.useState(function () {\n return {\n getValue: function getValue() {\n return valueRef.current;\n },\n listeners: new Set()\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n context = _React$useState2[0];\n\n useLayoutEffect(function () {\n context.listeners.forEach(function (listener) {\n listener(value);\n });\n }, [value]);\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: context\n }, children);\n };\n\n return {\n Context: Context,\n Provider: Provider\n };\n}\nexport function useContextSelector(holder, selector) {\n var eventSelector = useEvent(selector);\n var context = React.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);\n\n var _ref2 = context || {},\n listeners = _ref2.listeners,\n getValue = _ref2.getValue;\n\n var _React$useState3 = React.useState(function () {\n return eventSelector(context ? getValue() : null);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n value = _React$useState4[0],\n setValue = _React$useState4[1];\n\n useLayoutEffect(function () {\n if (!context) {\n return;\n }\n\n function trigger(nextValue) {\n setValue(function (prev) {\n var selectedValue = eventSelector(nextValue);\n return shallowEqual(prev, selectedValue) ? prev : selectedValue;\n });\n }\n\n listeners.add(trigger);\n return function () {\n listeners.delete(trigger);\n };\n }, [context]);\n return value;\n}","import * as React from 'react';\nvar BodyContext = /*#__PURE__*/React.createContext(null);\nexport default BodyContext;","import * as React from 'react';\nvar PerfContext = /*#__PURE__*/React.createContext({\n renderWithProps: false\n});\nexport default PerfContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"colSpan\", \"rowSpan\", \"style\", \"className\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport shallowEqual from 'shallowequal';\nimport { supportRef } from \"rc-util/es/ref\";\nimport { getPathValue, validateValue } from '../utils/valueUtil';\nimport StickyContext from '../context/StickyContext';\nimport HoverContext from '../context/HoverContext';\nimport BodyContext from '../context/BodyContext';\nimport warning from \"rc-util/es/warning\";\nimport PerfContext from '../context/PerfContext';\nimport { useContextSelector } from '../ContextSelector';\n/** Check if cell is in hover range */\n\nfunction inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {\n var cellEndRow = cellStartRow + cellRowSpan - 1;\n return cellStartRow <= endRow && cellEndRow >= startRow;\n}\n\nfunction isRenderCell(data) {\n return data && _typeof(data) === 'object' && !Array.isArray(data) && ! /*#__PURE__*/React.isValidElement(data);\n}\n\nfunction isRefComponent(component) {\n // String tag component also support ref\n if (typeof component === 'string') {\n return true;\n }\n\n return supportRef(component);\n}\n\nvar getTitleFromCellRenderChildren = function getTitleFromCellRenderChildren(_ref) {\n var ellipsis = _ref.ellipsis,\n rowType = _ref.rowType,\n children = _ref.children;\n var title;\n var ellipsisConfig = ellipsis === true ? {\n showTitle: true\n } : ellipsis;\n\n if (ellipsisConfig && (ellipsisConfig.showTitle || rowType === 'header')) {\n if (typeof children === 'string' || typeof children === 'number') {\n title = children.toString();\n } else if ( /*#__PURE__*/React.isValidElement(children) && typeof children.props.children === 'string') {\n title = children.props.children;\n }\n }\n\n return title;\n};\n\nfunction Cell(_ref2, ref) {\n var _ref4, _ref5, _classNames;\n\n var prefixCls = _ref2.prefixCls,\n className = _ref2.className,\n record = _ref2.record,\n index = _ref2.index,\n renderIndex = _ref2.renderIndex,\n dataIndex = _ref2.dataIndex,\n render = _ref2.render,\n children = _ref2.children,\n _ref2$component = _ref2.component,\n Component = _ref2$component === void 0 ? 'td' : _ref2$component,\n colSpan = _ref2.colSpan,\n rowSpan = _ref2.rowSpan,\n fixLeft = _ref2.fixLeft,\n fixRight = _ref2.fixRight,\n firstFixLeft = _ref2.firstFixLeft,\n lastFixLeft = _ref2.lastFixLeft,\n firstFixRight = _ref2.firstFixRight,\n lastFixRight = _ref2.lastFixRight,\n appendNode = _ref2.appendNode,\n _ref2$additionalProps = _ref2.additionalProps,\n additionalProps = _ref2$additionalProps === void 0 ? {} : _ref2$additionalProps,\n ellipsis = _ref2.ellipsis,\n align = _ref2.align,\n rowType = _ref2.rowType,\n isSticky = _ref2.isSticky,\n hovering = _ref2.hovering,\n onHover = _ref2.onHover;\n var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n var perfRecord = React.useContext(PerfContext);\n var supportSticky = React.useContext(StickyContext);\n\n var _React$useContext = React.useContext(BodyContext),\n allColumnsFixedLeft = _React$useContext.allColumnsFixedLeft; // ==================== Child Node ====================\n\n\n var _React$useMemo = React.useMemo(function () {\n if (validateValue(children)) {\n return [children];\n }\n\n var value = getPathValue(record, dataIndex); // Customize render node\n\n var returnChildNode = value;\n var returnCellProps = undefined;\n\n if (render) {\n var renderData = render(value, record, renderIndex);\n\n if (isRenderCell(renderData)) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, '`columns.render` return cell props is deprecated with perf issue, please use `onCell` instead.');\n }\n\n returnChildNode = renderData.children;\n returnCellProps = renderData.props;\n perfRecord.renderWithProps = true;\n } else {\n returnChildNode = renderData;\n }\n }\n\n return [returnChildNode, returnCellProps];\n }, [\n /* eslint-disable react-hooks/exhaustive-deps */\n // Always re-render if `renderWithProps`\n perfRecord.renderWithProps ? Math.random() : 0,\n /* eslint-enable */\n children, dataIndex, perfRecord, record, render, renderIndex]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n childNode = _React$useMemo2[0],\n legacyCellProps = _React$useMemo2[1];\n\n var mergedChildNode = childNode; // Not crash if final `childNode` is not validate ReactNode\n\n if (_typeof(mergedChildNode) === 'object' && !Array.isArray(mergedChildNode) && ! /*#__PURE__*/React.isValidElement(mergedChildNode)) {\n mergedChildNode = null;\n }\n\n if (ellipsis && (lastFixLeft || firstFixRight)) {\n mergedChildNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(cellPrefixCls, \"-content\")\n }, mergedChildNode);\n }\n\n var _ref3 = legacyCellProps || {},\n cellColSpan = _ref3.colSpan,\n cellRowSpan = _ref3.rowSpan,\n cellStyle = _ref3.style,\n cellClassName = _ref3.className,\n restCellProps = _objectWithoutProperties(_ref3, _excluded);\n\n var mergedColSpan = (_ref4 = cellColSpan !== undefined ? cellColSpan : colSpan) !== null && _ref4 !== void 0 ? _ref4 : 1;\n var mergedRowSpan = (_ref5 = cellRowSpan !== undefined ? cellRowSpan : rowSpan) !== null && _ref5 !== void 0 ? _ref5 : 1;\n\n if (mergedColSpan === 0 || mergedRowSpan === 0) {\n return null;\n } // ====================== Fixed =======================\n\n\n var fixedStyle = {};\n var isFixLeft = typeof fixLeft === 'number' && supportSticky;\n var isFixRight = typeof fixRight === 'number' && supportSticky;\n\n if (isFixLeft) {\n fixedStyle.position = 'sticky';\n fixedStyle.left = fixLeft;\n }\n\n if (isFixRight) {\n fixedStyle.position = 'sticky';\n fixedStyle.right = fixRight;\n } // ====================== Align =======================\n\n\n var alignStyle = {};\n\n if (align) {\n alignStyle.textAlign = align;\n } // ====================== Hover =======================\n\n\n var onMouseEnter = function onMouseEnter(event) {\n var _additionalProps$onMo;\n\n if (record) {\n onHover(index, index + mergedRowSpan - 1);\n }\n\n additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo = additionalProps.onMouseEnter) === null || _additionalProps$onMo === void 0 ? void 0 : _additionalProps$onMo.call(additionalProps, event);\n };\n\n var onMouseLeave = function onMouseLeave(event) {\n var _additionalProps$onMo2;\n\n if (record) {\n onHover(-1, -1);\n }\n\n additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo2 = additionalProps.onMouseLeave) === null || _additionalProps$onMo2 === void 0 ? void 0 : _additionalProps$onMo2.call(additionalProps, event);\n }; // ====================== Render ======================\n\n\n var title = getTitleFromCellRenderChildren({\n rowType: rowType,\n ellipsis: ellipsis,\n children: childNode\n });\n\n var componentProps = _objectSpread(_objectSpread(_objectSpread({\n title: title\n }, restCellProps), additionalProps), {}, {\n colSpan: mergedColSpan !== 1 ? mergedColSpan : null,\n rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null,\n className: classNames(cellPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-left\"), isFixLeft && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-left-first\"), firstFixLeft && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-left-last\"), lastFixLeft && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-left-all\"), lastFixLeft && allColumnsFixedLeft && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-right\"), isFixRight && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-right-first\"), firstFixRight && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-right-last\"), lastFixRight && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-ellipsis\"), ellipsis), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-with-append\"), appendNode), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-fix-sticky\"), (isFixLeft || isFixRight) && isSticky && supportSticky), _defineProperty(_classNames, \"\".concat(cellPrefixCls, \"-row-hover\"), !legacyCellProps && hovering), _classNames), additionalProps.className, cellClassName),\n style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, additionalProps.style), alignStyle), fixedStyle), cellStyle),\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n ref: isRefComponent(Component) ? ref : null\n });\n\n return /*#__PURE__*/React.createElement(Component, componentProps, appendNode, mergedChildNode);\n}\n\nvar RefCell = /*#__PURE__*/React.forwardRef(Cell);\nRefCell.displayName = 'Cell';\nvar comparePropList = ['expanded', 'className', 'hovering'];\nvar MemoCell = /*#__PURE__*/React.memo(RefCell, function (prev, next) {\n if (next.shouldCellUpdate) {\n return (// Additional handle of expanded logic\n comparePropList.every(function (propName) {\n return prev[propName] === next[propName];\n }) && // User control update logic\n !next.shouldCellUpdate(next.record, prev.record)\n );\n }\n\n return shallowEqual(prev, next);\n});\n/** Inject hover data here, we still wish MemoCell keep simple `shouldCellUpdate` logic */\n\nvar WrappedCell = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var index = props.index,\n _props$additionalProp = props.additionalProps,\n additionalProps = _props$additionalProp === void 0 ? {} : _props$additionalProp,\n colSpan = props.colSpan,\n rowSpan = props.rowSpan;\n var cellColSpan = additionalProps.colSpan,\n cellRowSpan = additionalProps.rowSpan;\n var mergedColSpan = colSpan !== null && colSpan !== void 0 ? colSpan : cellColSpan;\n var mergedRowSpan = rowSpan !== null && rowSpan !== void 0 ? rowSpan : cellRowSpan;\n\n var _useContextSelector = useContextSelector(HoverContext, function (cxt) {\n var isHovering = inHoverRange(index, mergedRowSpan || 1, cxt === null || cxt === void 0 ? void 0 : cxt.startRow, cxt === null || cxt === void 0 ? void 0 : cxt.endRow);\n return {\n onHover: cxt === null || cxt === void 0 ? void 0 : cxt.onHover,\n hovering: isHovering\n };\n }),\n onHover = _useContextSelector.onHover,\n hovering = _useContextSelector.hovering;\n\n return /*#__PURE__*/React.createElement(MemoCell, _extends({}, props, {\n colSpan: mergedColSpan,\n rowSpan: mergedRowSpan,\n hovering: hovering,\n ref: ref,\n onHover: onHover\n }));\n});\nWrappedCell.displayName = 'WrappedCell';\nexport default WrappedCell;","import * as React from 'react';\nvar TableContext = /*#__PURE__*/React.createContext(null);\nexport default TableContext;","export function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) {\n var startColumn = columns[colStart] || {};\n var endColumn = columns[colEnd] || {};\n var fixLeft;\n var fixRight;\n\n if (startColumn.fixed === 'left') {\n fixLeft = stickyOffsets.left[colStart];\n } else if (endColumn.fixed === 'right') {\n fixRight = stickyOffsets.right[colEnd];\n }\n\n var lastFixLeft = false;\n var firstFixRight = false;\n var lastFixRight = false;\n var firstFixLeft = false;\n var nextColumn = columns[colEnd + 1];\n var prevColumn = columns[colStart - 1];\n\n if (direction === 'rtl') {\n if (fixLeft !== undefined) {\n var prevFixLeft = prevColumn && prevColumn.fixed === 'left';\n firstFixLeft = !prevFixLeft;\n } else if (fixRight !== undefined) {\n var nextFixRight = nextColumn && nextColumn.fixed === 'right';\n lastFixRight = !nextFixRight;\n }\n } else if (fixLeft !== undefined) {\n var nextFixLeft = nextColumn && nextColumn.fixed === 'left';\n lastFixLeft = !nextFixLeft;\n } else if (fixRight !== undefined) {\n var prevFixRight = prevColumn && prevColumn.fixed === 'right';\n firstFixRight = !prevFixRight;\n }\n\n return {\n fixLeft: fixLeft,\n fixRight: fixRight,\n lastFixLeft: lastFixLeft,\n firstFixRight: firstFixRight,\n lastFixRight: lastFixRight,\n firstFixLeft: firstFixLeft,\n isSticky: stickyOffsets.isSticky\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\nimport { getCellFixedInfo } from '../utils/fixUtil';\nimport { getColumnsKey } from '../utils/valueUtil';\n\nfunction HeaderRow(_ref) {\n var cells = _ref.cells,\n stickyOffsets = _ref.stickyOffsets,\n flattenColumns = _ref.flattenColumns,\n RowComponent = _ref.rowComponent,\n CellComponent = _ref.cellComponent,\n onHeaderRow = _ref.onHeaderRow,\n index = _ref.index;\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls,\n direction = _React$useContext.direction;\n\n var rowProps;\n\n if (onHeaderRow) {\n rowProps = onHeaderRow(cells.map(function (cell) {\n return cell.column;\n }), index);\n }\n\n var columnsKey = getColumnsKey(cells.map(function (cell) {\n return cell.column;\n }));\n return /*#__PURE__*/React.createElement(RowComponent, rowProps, cells.map(function (cell, cellIndex) {\n var column = cell.column;\n var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction);\n var additionalProps;\n\n if (column && column.onHeaderCell) {\n additionalProps = cell.column.onHeaderCell(column);\n }\n\n return /*#__PURE__*/React.createElement(Cell, _extends({}, cell, {\n ellipsis: column.ellipsis,\n align: column.align,\n component: CellComponent,\n prefixCls: prefixCls,\n key: columnsKey[cellIndex]\n }, fixedInfo, {\n additionalProps: additionalProps,\n rowType: \"header\"\n }));\n }));\n}\n\nHeaderRow.displayName = 'HeaderRow';\nexport default HeaderRow;","import * as React from 'react';\nimport HeaderRow from './HeaderRow';\nimport TableContext from '../context/TableContext';\n\nfunction parseHeaderRows(rootColumns) {\n var rows = [];\n\n function fillRowCells(columns, colIndex) {\n var rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n // Init rows\n rows[rowIndex] = rows[rowIndex] || [];\n var currentColIndex = colIndex;\n var colSpans = columns.filter(Boolean).map(function (column) {\n var cell = {\n key: column.key,\n className: column.className || '',\n children: column.title,\n column: column,\n colStart: currentColIndex\n };\n var colSpan = 1;\n var subColumns = column.children;\n\n if (subColumns && subColumns.length > 0) {\n colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce(function (total, count) {\n return total + count;\n }, 0);\n cell.hasSubColumns = true;\n }\n\n if ('colSpan' in column) {\n colSpan = column.colSpan;\n }\n\n if ('rowSpan' in column) {\n cell.rowSpan = column.rowSpan;\n }\n\n cell.colSpan = colSpan;\n cell.colEnd = cell.colStart + colSpan - 1;\n rows[rowIndex].push(cell);\n currentColIndex += colSpan;\n return colSpan;\n });\n return colSpans;\n } // Generate `rows` cell data\n\n\n fillRowCells(rootColumns, 0); // Handle `rowSpan`\n\n var rowCount = rows.length;\n\n var _loop = function _loop(rowIndex) {\n rows[rowIndex].forEach(function (cell) {\n if (!('rowSpan' in cell) && !cell.hasSubColumns) {\n // eslint-disable-next-line no-param-reassign\n cell.rowSpan = rowCount - rowIndex;\n }\n });\n };\n\n for (var rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {\n _loop(rowIndex);\n }\n\n return rows;\n}\n\nfunction Header(_ref) {\n var stickyOffsets = _ref.stickyOffsets,\n columns = _ref.columns,\n flattenColumns = _ref.flattenColumns,\n onHeaderRow = _ref.onHeaderRow;\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls,\n getComponent = _React$useContext.getComponent;\n\n var rows = React.useMemo(function () {\n return parseHeaderRows(columns);\n }, [columns]);\n var WrapperComponent = getComponent(['header', 'wrapper'], 'thead');\n var trComponent = getComponent(['header', 'row'], 'tr');\n var thComponent = getComponent(['header', 'cell'], 'th');\n return /*#__PURE__*/React.createElement(WrapperComponent, {\n className: \"\".concat(prefixCls, \"-thead\")\n }, rows.map(function (row, rowIndex) {\n var rowNode = /*#__PURE__*/React.createElement(HeaderRow, {\n key: rowIndex,\n flattenColumns: flattenColumns,\n cells: row,\n stickyOffsets: stickyOffsets,\n rowComponent: trComponent,\n cellComponent: thComponent,\n onHeaderRow: onHeaderRow,\n index: rowIndex\n });\n return rowNode;\n }));\n}\n\nexport default Header;","import * as React from 'react';\nvar ExpandedRowContext = /*#__PURE__*/React.createContext(null);\nexport default ExpandedRowContext;","import * as React from 'react';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\nimport ExpandedRowContext from '../context/ExpandedRowContext';\n\nfunction ExpandedRow(_ref) {\n var prefixCls = _ref.prefixCls,\n children = _ref.children,\n Component = _ref.component,\n cellComponent = _ref.cellComponent,\n className = _ref.className,\n expanded = _ref.expanded,\n colSpan = _ref.colSpan,\n isEmpty = _ref.isEmpty;\n\n var _React$useContext = React.useContext(TableContext),\n scrollbarSize = _React$useContext.scrollbarSize;\n\n var _React$useContext2 = React.useContext(ExpandedRowContext),\n fixHeader = _React$useContext2.fixHeader,\n fixColumn = _React$useContext2.fixColumn,\n componentWidth = _React$useContext2.componentWidth,\n horizonScroll = _React$useContext2.horizonScroll; // Cache render node\n\n\n return React.useMemo(function () {\n var contentNode = children;\n\n if (isEmpty ? horizonScroll : fixColumn) {\n contentNode = /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: componentWidth - (fixHeader ? scrollbarSize : 0),\n position: 'sticky',\n left: 0,\n overflow: 'hidden'\n },\n className: \"\".concat(prefixCls, \"-expanded-row-fixed\")\n }, componentWidth !== 0 && contentNode);\n }\n\n return /*#__PURE__*/React.createElement(Component, {\n className: className,\n style: {\n display: expanded ? null : 'none'\n }\n }, /*#__PURE__*/React.createElement(Cell, {\n component: cellComponent,\n prefixCls: prefixCls,\n colSpan: colSpan\n }, contentNode));\n }, [children, Component, className, expanded, colSpan, isEmpty, scrollbarSize, componentWidth, fixColumn, fixHeader, horizonScroll]);\n}\n\nexport default ExpandedRow;","import * as React from 'react';\nvar ResizeContext = /*#__PURE__*/React.createContext(null);\nexport default ResizeContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\nimport BodyContext from '../context/BodyContext';\nimport { getColumnsKey } from '../utils/valueUtil';\nimport ExpandedRow from './ExpandedRow';\n\nfunction BodyRow(props) {\n var className = props.className,\n style = props.style,\n record = props.record,\n index = props.index,\n renderIndex = props.renderIndex,\n rowKey = props.rowKey,\n rowExpandable = props.rowExpandable,\n expandedKeys = props.expandedKeys,\n onRow = props.onRow,\n _props$indent = props.indent,\n indent = _props$indent === void 0 ? 0 : _props$indent,\n RowComponent = props.rowComponent,\n cellComponent = props.cellComponent,\n childrenColumnName = props.childrenColumnName;\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls,\n fixedInfoList = _React$useContext.fixedInfoList;\n\n var _React$useContext2 = React.useContext(BodyContext),\n flattenColumns = _React$useContext2.flattenColumns,\n expandableType = _React$useContext2.expandableType,\n expandRowByClick = _React$useContext2.expandRowByClick,\n onTriggerExpand = _React$useContext2.onTriggerExpand,\n rowClassName = _React$useContext2.rowClassName,\n expandedRowClassName = _React$useContext2.expandedRowClassName,\n indentSize = _React$useContext2.indentSize,\n expandIcon = _React$useContext2.expandIcon,\n expandedRowRender = _React$useContext2.expandedRowRender,\n expandIconColumnIndex = _React$useContext2.expandIconColumnIndex;\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n expandRended = _React$useState2[0],\n setExpandRended = _React$useState2[1];\n\n var expanded = expandedKeys && expandedKeys.has(props.recordKey);\n React.useEffect(function () {\n if (expanded) {\n setExpandRended(true);\n }\n }, [expanded]);\n var rowSupportExpand = expandableType === 'row' && (!rowExpandable || rowExpandable(record)); // Only when row is not expandable and `children` exist in record\n\n var nestExpandable = expandableType === 'nest';\n var hasNestChildren = childrenColumnName && record && record[childrenColumnName];\n var mergedExpandable = rowSupportExpand || nestExpandable; // ======================== Expandable =========================\n\n var onExpandRef = React.useRef(onTriggerExpand);\n onExpandRef.current = onTriggerExpand;\n\n var onInternalTriggerExpand = function onInternalTriggerExpand() {\n onExpandRef.current.apply(onExpandRef, arguments);\n }; // =========================== onRow ===========================\n\n\n var additionalProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, index);\n\n var onClick = function onClick(event) {\n var _additionalProps$onCl;\n\n if (expandRowByClick && mergedExpandable) {\n onInternalTriggerExpand(record, event);\n }\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onCl = additionalProps.onClick) === null || _additionalProps$onCl === void 0 ? void 0 : _additionalProps$onCl.call.apply(_additionalProps$onCl, [additionalProps, event].concat(args));\n }; // ======================== Base tr row ========================\n\n\n var computeRowClassName;\n\n if (typeof rowClassName === 'string') {\n computeRowClassName = rowClassName;\n } else if (typeof rowClassName === 'function') {\n computeRowClassName = rowClassName(record, index, indent);\n }\n\n var columnsKey = getColumnsKey(flattenColumns);\n var baseRowNode = /*#__PURE__*/React.createElement(RowComponent, _extends({}, additionalProps, {\n \"data-row-key\": rowKey,\n className: classNames(className, \"\".concat(prefixCls, \"-row\"), \"\".concat(prefixCls, \"-row-level-\").concat(indent), computeRowClassName, additionalProps && additionalProps.className),\n style: _objectSpread(_objectSpread({}, style), additionalProps ? additionalProps.style : null),\n onClick: onClick\n }), flattenColumns.map(function (column, colIndex) {\n var render = column.render,\n dataIndex = column.dataIndex,\n columnClassName = column.className;\n var key = columnsKey[colIndex];\n var fixedInfo = fixedInfoList[colIndex]; // ============= Used for nest expandable =============\n\n var appendCellNode;\n\n if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {\n appendCellNode = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n style: {\n paddingLeft: \"\".concat(indentSize * indent, \"px\")\n },\n className: \"\".concat(prefixCls, \"-row-indent indent-level-\").concat(indent)\n }), expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: hasNestChildren,\n record: record,\n onExpand: onInternalTriggerExpand\n }));\n }\n\n var additionalCellProps;\n\n if (column.onCell) {\n additionalCellProps = column.onCell(record, index);\n }\n\n return /*#__PURE__*/React.createElement(Cell, _extends({\n className: columnClassName,\n ellipsis: column.ellipsis,\n align: column.align,\n component: cellComponent,\n prefixCls: prefixCls,\n key: key,\n record: record,\n index: index,\n renderIndex: renderIndex,\n dataIndex: dataIndex,\n render: render,\n shouldCellUpdate: column.shouldCellUpdate,\n expanded: appendCellNode && expanded\n }, fixedInfo, {\n appendNode: appendCellNode,\n additionalProps: additionalCellProps\n }));\n })); // ======================== Expand Row =========================\n\n var expandRowNode;\n\n if (rowSupportExpand && (expandRended || expanded)) {\n var expandContent = expandedRowRender(record, index, indent + 1, expanded);\n var computedExpandedRowClassName = expandedRowClassName && expandedRowClassName(record, index, indent);\n expandRowNode = /*#__PURE__*/React.createElement(ExpandedRow, {\n expanded: expanded,\n className: classNames(\"\".concat(prefixCls, \"-expanded-row\"), \"\".concat(prefixCls, \"-expanded-row-level-\").concat(indent + 1), computedExpandedRowClassName),\n prefixCls: prefixCls,\n component: RowComponent,\n cellComponent: cellComponent,\n colSpan: flattenColumns.length,\n isEmpty: false\n }, expandContent);\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, baseRowNode, expandRowNode);\n}\n\nBodyRow.displayName = 'BodyRow';\nexport default BodyRow;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react'; // recursion (flat tree structure)\n\nfunction flatRecord(record, indent, childrenColumnName, expandedKeys, getRowKey, index) {\n var arr = [];\n arr.push({\n record: record,\n indent: indent,\n index: index\n });\n var key = getRowKey(record);\n var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);\n\n if (record && Array.isArray(record[childrenColumnName]) && expanded) {\n // expanded state, flat record\n for (var i = 0; i < record[childrenColumnName].length; i += 1) {\n var tempArr = flatRecord(record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);\n arr.push.apply(arr, _toConsumableArray(tempArr));\n }\n }\n\n return arr;\n}\n/**\n * flat tree data on expanded state\n *\n * @export\n * @template T\n * @param {*} data : table data\n * @param {string} childrenColumnName : 指定树形结构的列名\n * @param {Set} expandedKeys : 展开的行对应的keys\n * @param {GetRowKey} getRowKey : 获取当前rowKey的方法\n * @returns flattened data\n */\n\n\nexport default function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {\n var arr = React.useMemo(function () {\n if (expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.size) {\n var temp = []; // collect flattened record\n\n for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {\n var record = data[i];\n temp.push.apply(temp, _toConsumableArray(flatRecord(record, 0, childrenColumnName, expandedKeys, getRowKey, i)));\n }\n\n return temp;\n }\n\n return data === null || data === void 0 ? void 0 : data.map(function (item, index) {\n return {\n record: item,\n indent: 0,\n index: index\n };\n });\n }, [data, childrenColumnName, expandedKeys, getRowKey]);\n return arr;\n}","import * as React from 'react';\nimport ResizeObserver from 'rc-resize-observer';\nexport default function MeasureCell(_ref) {\n var columnKey = _ref.columnKey,\n onColumnResize = _ref.onColumnResize;\n var cellRef = React.useRef();\n React.useEffect(function () {\n if (cellRef.current) {\n onColumnResize(columnKey, cellRef.current.offsetWidth);\n }\n }, []);\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n data: columnKey\n }, /*#__PURE__*/React.createElement(\"td\", {\n ref: cellRef,\n style: {\n padding: 0,\n border: 0,\n height: 0\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n style: {\n height: 0,\n overflow: 'hidden'\n }\n }, \"\\xA0\")));\n}","import * as React from 'react';\nimport ResizeObserver from 'rc-resize-observer';\nimport MeasureCell from './MeasureCell';\nexport default function MeasureRow(_ref) {\n var prefixCls = _ref.prefixCls,\n columnsKey = _ref.columnsKey,\n onColumnResize = _ref.onColumnResize;\n return /*#__PURE__*/React.createElement(\"tr\", {\n \"aria-hidden\": \"true\",\n className: \"\".concat(prefixCls, \"-measure-row\"),\n style: {\n height: 0,\n fontSize: 0\n }\n }, /*#__PURE__*/React.createElement(ResizeObserver.Collection, {\n onBatchResize: function onBatchResize(infoList) {\n infoList.forEach(function (_ref2) {\n var columnKey = _ref2.data,\n size = _ref2.size;\n onColumnResize(columnKey, size.offsetWidth);\n });\n }\n }, columnsKey.map(function (columnKey) {\n return /*#__PURE__*/React.createElement(MeasureCell, {\n key: columnKey,\n columnKey: columnKey,\n onColumnResize: onColumnResize\n });\n })));\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport TableContext from '../context/TableContext';\nimport ExpandedRow from './ExpandedRow';\nimport BodyContext from '../context/BodyContext';\nimport { getColumnsKey } from '../utils/valueUtil';\nimport ResizeContext from '../context/ResizeContext';\nimport BodyRow from './BodyRow';\nimport useFlattenRecords from '../hooks/useFlattenRecords';\nimport HoverContext from '../context/HoverContext';\nimport PerfContext from '../context/PerfContext';\nimport MeasureRow from './MeasureRow';\n\nfunction Body(_ref) {\n var data = _ref.data,\n getRowKey = _ref.getRowKey,\n measureColumnWidth = _ref.measureColumnWidth,\n expandedKeys = _ref.expandedKeys,\n onRow = _ref.onRow,\n rowExpandable = _ref.rowExpandable,\n emptyNode = _ref.emptyNode,\n childrenColumnName = _ref.childrenColumnName;\n\n var _React$useContext = React.useContext(ResizeContext),\n onColumnResize = _React$useContext.onColumnResize;\n\n var _React$useContext2 = React.useContext(TableContext),\n prefixCls = _React$useContext2.prefixCls,\n getComponent = _React$useContext2.getComponent;\n\n var _React$useContext3 = React.useContext(BodyContext),\n flattenColumns = _React$useContext3.flattenColumns;\n\n var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey); // =================== Performance ====================\n\n var perfRef = React.useRef({\n renderWithProps: false\n }); // ====================== Hover =======================\n\n var _React$useState = React.useState(-1),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n startRow = _React$useState2[0],\n setStartRow = _React$useState2[1];\n\n var _React$useState3 = React.useState(-1),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n endRow = _React$useState4[0],\n setEndRow = _React$useState4[1];\n\n var onHover = React.useCallback(function (start, end) {\n setStartRow(start);\n setEndRow(end);\n }, []); // ====================== Render ======================\n\n var bodyNode = React.useMemo(function () {\n var WrapperComponent = getComponent(['body', 'wrapper'], 'tbody');\n var trComponent = getComponent(['body', 'row'], 'tr');\n var tdComponent = getComponent(['body', 'cell'], 'td');\n var rows;\n\n if (data.length) {\n rows = flattenData.map(function (item, idx) {\n var record = item.record,\n indent = item.indent,\n renderIndex = item.index;\n var key = getRowKey(record, idx);\n return /*#__PURE__*/React.createElement(BodyRow, {\n key: key,\n rowKey: key,\n record: record,\n recordKey: key,\n index: idx,\n renderIndex: renderIndex,\n rowComponent: trComponent,\n cellComponent: tdComponent,\n expandedKeys: expandedKeys,\n onRow: onRow,\n getRowKey: getRowKey,\n rowExpandable: rowExpandable,\n childrenColumnName: childrenColumnName,\n indent: indent\n });\n });\n } else {\n rows = /*#__PURE__*/React.createElement(ExpandedRow, {\n expanded: true,\n className: \"\".concat(prefixCls, \"-placeholder\"),\n prefixCls: prefixCls,\n component: trComponent,\n cellComponent: tdComponent,\n colSpan: flattenColumns.length,\n isEmpty: true\n }, emptyNode);\n }\n\n var columnsKey = getColumnsKey(flattenColumns);\n return /*#__PURE__*/React.createElement(WrapperComponent, {\n className: \"\".concat(prefixCls, \"-tbody\")\n }, measureColumnWidth && /*#__PURE__*/React.createElement(MeasureRow, {\n prefixCls: prefixCls,\n columnsKey: columnsKey,\n onColumnResize: onColumnResize\n }), rows);\n }, [data, prefixCls, onRow, measureColumnWidth, expandedKeys, getRowKey, getComponent, emptyNode, flattenColumns, childrenColumnName, onColumnResize, rowExpandable, flattenData]);\n return /*#__PURE__*/React.createElement(PerfContext.Provider, {\n value: perfRef.current\n }, /*#__PURE__*/React.createElement(HoverContext.Provider, {\n value: {\n startRow: startRow,\n endRow: endRow,\n onHover: onHover\n }\n }, bodyNode));\n}\n\nvar MemoBody = /*#__PURE__*/React.memo(Body);\nMemoBody.displayName = 'Body';\nexport default MemoBody;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"expandable\"];\nimport warning from \"rc-util/es/warning\";\nexport var INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';\nexport function getExpandableProps(props) {\n var expandable = props.expandable,\n legacyExpandableConfig = _objectWithoutProperties(props, _excluded);\n\n var config;\n\n if ('expandable' in props) {\n config = _objectSpread(_objectSpread({}, legacyExpandableConfig), expandable);\n } else {\n if (process.env.NODE_ENV !== 'production' && ['indentSize', 'expandedRowKeys', 'defaultExpandedRowKeys', 'defaultExpandAllRows', 'expandedRowRender', 'expandRowByClick', 'expandIcon', 'onExpand', 'onExpandedRowsChange', 'expandedRowClassName', 'expandIconColumnIndex', 'showExpandColumn'].some(function (prop) {\n return prop in props;\n })) {\n warning(false, 'expanded related props have been moved into `expandable`.');\n }\n\n config = legacyExpandableConfig;\n }\n\n if (config.showExpandColumn === false) {\n config.expandIconColumnIndex = -1;\n }\n\n return config;\n}","export var EXPAND_COLUMN = {};","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\"],\n _excluded2 = [\"fixed\"];\nimport * as React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { INTERNAL_COL_DEFINE } from '../utils/legacyUtil';\nimport { EXPAND_COLUMN } from '../constant';\nexport function convertChildrenToColumns(children) {\n return toArray(children).filter(function (node) {\n return /*#__PURE__*/React.isValidElement(node);\n }).map(function (_ref) {\n var key = _ref.key,\n props = _ref.props;\n\n var nodeChildren = props.children,\n restProps = _objectWithoutProperties(props, _excluded);\n\n var column = _objectSpread({\n key: key\n }, restProps);\n\n if (nodeChildren) {\n column.children = convertChildrenToColumns(nodeChildren);\n }\n\n return column;\n });\n}\n\nfunction flatColumns(columns) {\n return columns.reduce(function (list, column) {\n var fixed = column.fixed; // Convert `fixed='true'` to `fixed='left'` instead\n\n var parsedFixed = fixed === true ? 'left' : fixed;\n var subColumns = column.children;\n\n if (subColumns && subColumns.length > 0) {\n return [].concat(_toConsumableArray(list), _toConsumableArray(flatColumns(subColumns).map(function (subColum) {\n return _objectSpread({\n fixed: parsedFixed\n }, subColum);\n })));\n }\n\n return [].concat(_toConsumableArray(list), [_objectSpread(_objectSpread({}, column), {}, {\n fixed: parsedFixed\n })]);\n }, []);\n}\n\nfunction warningFixed(flattenColumns) {\n var allFixLeft = true;\n\n for (var i = 0; i < flattenColumns.length; i += 1) {\n var col = flattenColumns[i];\n\n if (allFixLeft && col.fixed !== 'left') {\n allFixLeft = false;\n } else if (!allFixLeft && col.fixed === 'left') {\n warning(false, \"Index \".concat(i - 1, \" of `columns` missing `fixed='left'` prop.\"));\n break;\n }\n }\n\n var allFixRight = true;\n\n for (var _i = flattenColumns.length - 1; _i >= 0; _i -= 1) {\n var _col = flattenColumns[_i];\n\n if (allFixRight && _col.fixed !== 'right') {\n allFixRight = false;\n } else if (!allFixRight && _col.fixed === 'right') {\n warning(false, \"Index \".concat(_i + 1, \" of `columns` missing `fixed='right'` prop.\"));\n break;\n }\n }\n}\n\nfunction revertForRtl(columns) {\n return columns.map(function (column) {\n var fixed = column.fixed,\n restProps = _objectWithoutProperties(column, _excluded2); // Convert `fixed='left'` to `fixed='right'` instead\n\n\n var parsedFixed = fixed;\n\n if (fixed === 'left') {\n parsedFixed = 'right';\n } else if (fixed === 'right') {\n parsedFixed = 'left';\n }\n\n return _objectSpread({\n fixed: parsedFixed\n }, restProps);\n });\n}\n/**\n * Parse `columns` & `children` into `columns`.\n */\n\n\nfunction useColumns(_ref2, transformColumns) {\n var prefixCls = _ref2.prefixCls,\n columns = _ref2.columns,\n children = _ref2.children,\n expandable = _ref2.expandable,\n expandedKeys = _ref2.expandedKeys,\n columnTitle = _ref2.columnTitle,\n getRowKey = _ref2.getRowKey,\n onTriggerExpand = _ref2.onTriggerExpand,\n expandIcon = _ref2.expandIcon,\n rowExpandable = _ref2.rowExpandable,\n expandIconColumnIndex = _ref2.expandIconColumnIndex,\n direction = _ref2.direction,\n expandRowByClick = _ref2.expandRowByClick,\n columnWidth = _ref2.columnWidth,\n fixed = _ref2.fixed;\n var baseColumns = React.useMemo(function () {\n return columns || convertChildrenToColumns(children);\n }, [columns, children]); // ========================== Expand ==========================\n\n var withExpandColumns = React.useMemo(function () {\n if (expandable) {\n var _expandColumn;\n\n var cloneColumns = baseColumns.slice(); // >>> Warning if use `expandIconColumnIndex`\n\n if (process.env.NODE_ENV !== 'production' && expandIconColumnIndex >= 0) {\n warning(false, '`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead.');\n } // >>> Insert expand column if not exist\n\n\n if (!cloneColumns.includes(EXPAND_COLUMN)) {\n var expandColIndex = expandIconColumnIndex || 0;\n\n if (expandColIndex >= 0) {\n cloneColumns.splice(expandColIndex, 0, EXPAND_COLUMN);\n }\n } // >>> Deduplicate additional expand column\n\n\n if (process.env.NODE_ENV !== 'production' && cloneColumns.filter(function (c) {\n return c === EXPAND_COLUMN;\n }).length > 1) {\n warning(false, 'There exist more than one `EXPAND_COLUMN` in `columns`.');\n }\n\n var expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);\n cloneColumns = cloneColumns.filter(function (column, index) {\n return column !== EXPAND_COLUMN || index === expandColumnIndex;\n }); // >>> Check if expand column need to fixed\n\n var prevColumn = baseColumns[expandColumnIndex];\n var fixedColumn;\n\n if ((fixed === 'left' || fixed) && !expandIconColumnIndex) {\n fixedColumn = 'left';\n } else if ((fixed === 'right' || fixed) && expandIconColumnIndex === baseColumns.length) {\n fixedColumn = 'right';\n } else {\n fixedColumn = prevColumn ? prevColumn.fixed : null;\n } // >>> Create expandable column\n\n\n var expandColumn = (_expandColumn = {}, _defineProperty(_expandColumn, INTERNAL_COL_DEFINE, {\n className: \"\".concat(prefixCls, \"-expand-icon-col\"),\n columnType: 'EXPAND_COLUMN'\n }), _defineProperty(_expandColumn, \"title\", columnTitle), _defineProperty(_expandColumn, \"fixed\", fixedColumn), _defineProperty(_expandColumn, \"className\", \"\".concat(prefixCls, \"-row-expand-icon-cell\")), _defineProperty(_expandColumn, \"width\", columnWidth), _defineProperty(_expandColumn, \"render\", function render(_, record, index) {\n var rowKey = getRowKey(record, index);\n var expanded = expandedKeys.has(rowKey);\n var recordExpandable = rowExpandable ? rowExpandable(record) : true;\n var icon = expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: recordExpandable,\n record: record,\n onExpand: onTriggerExpand\n });\n\n if (expandRowByClick) {\n return /*#__PURE__*/React.createElement(\"span\", {\n onClick: function onClick(e) {\n return e.stopPropagation();\n }\n }, icon);\n }\n\n return icon;\n }), _expandColumn);\n return cloneColumns.map(function (col) {\n return col === EXPAND_COLUMN ? expandColumn : col;\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && baseColumns.includes(EXPAND_COLUMN)) {\n warning(false, '`expandable` is not config but there exist `EXPAND_COLUMN` in `columns`.');\n }\n\n return baseColumns.filter(function (col) {\n return col !== EXPAND_COLUMN;\n });\n }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]); // ========================= Transform ========================\n\n var mergedColumns = React.useMemo(function () {\n var finalColumns = withExpandColumns;\n\n if (transformColumns) {\n finalColumns = transformColumns(finalColumns);\n } // Always provides at least one column for table display\n\n\n if (!finalColumns.length) {\n finalColumns = [{\n render: function render() {\n return null;\n }\n }];\n }\n\n return finalColumns;\n }, [transformColumns, withExpandColumns, direction]); // ========================== Flatten =========================\n\n var flattenColumns = React.useMemo(function () {\n if (direction === 'rtl') {\n return revertForRtl(flatColumns(mergedColumns));\n }\n\n return flatColumns(mergedColumns);\n }, [mergedColumns, direction]); // Only check out of production since it's waste for each render\n\n if (process.env.NODE_ENV !== 'production') {\n warningFixed(direction === 'rtl' ? flattenColumns.slice().reverse() : flattenColumns);\n }\n\n return [mergedColumns, flattenColumns];\n}\n\nexport default useColumns;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useRef, useState, useEffect } from 'react';\n/**\n * Execute code before next frame but async\n */\n\nexport function useLayoutState(defaultState) {\n var stateRef = useRef(defaultState);\n\n var _useState = useState({}),\n _useState2 = _slicedToArray(_useState, 2),\n forceUpdate = _useState2[1];\n\n var lastPromiseRef = useRef(null);\n var updateBatchRef = useRef([]);\n\n function setFrameState(updater) {\n updateBatchRef.current.push(updater);\n var promise = Promise.resolve();\n lastPromiseRef.current = promise;\n promise.then(function () {\n if (lastPromiseRef.current === promise) {\n var prevBatch = updateBatchRef.current;\n var prevState = stateRef.current;\n updateBatchRef.current = [];\n prevBatch.forEach(function (batchUpdater) {\n stateRef.current = batchUpdater(stateRef.current);\n });\n lastPromiseRef.current = null;\n\n if (prevState !== stateRef.current) {\n forceUpdate({});\n }\n }\n });\n }\n\n useEffect(function () {\n return function () {\n lastPromiseRef.current = null;\n };\n }, []);\n return [stateRef.current, setFrameState];\n}\n/** Lock frame, when frame pass reset the lock. */\n\nexport function useTimeoutLock(defaultState) {\n var frameRef = useRef(defaultState || null);\n var timeoutRef = useRef();\n\n function cleanUp() {\n window.clearTimeout(timeoutRef.current);\n }\n\n function setState(newState) {\n frameRef.current = newState;\n cleanUp();\n timeoutRef.current = window.setTimeout(function () {\n frameRef.current = null;\n timeoutRef.current = undefined;\n }, 100);\n }\n\n function getState() {\n return frameRef.current;\n }\n\n useEffect(function () {\n return cleanUp;\n }, []);\n return [setState, getState];\n}","import { useMemo } from 'react';\n/**\n * Get sticky column offset width\n */\n\nfunction useStickyOffsets(colWidths, columnCount, direction) {\n var stickyOffsets = useMemo(function () {\n var leftOffsets = [];\n var rightOffsets = [];\n var left = 0;\n var right = 0;\n\n for (var start = 0; start < columnCount; start += 1) {\n if (direction === 'rtl') {\n // Left offset\n rightOffsets[start] = right;\n right += colWidths[start] || 0; // Right offset\n\n var end = columnCount - start - 1;\n leftOffsets[end] = left;\n left += colWidths[end] || 0;\n } else {\n // Left offset\n leftOffsets[start] = left;\n left += colWidths[start] || 0; // Right offset\n\n var _end = columnCount - start - 1;\n\n rightOffsets[_end] = right;\n right += colWidths[_end] || 0;\n }\n }\n\n return {\n left: leftOffsets,\n right: rightOffsets\n };\n }, [colWidths, columnCount, direction]);\n return stickyOffsets;\n}\n\nexport default useStickyOffsets;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"columnType\"];\nimport * as React from 'react';\nimport { INTERNAL_COL_DEFINE } from './utils/legacyUtil';\n\nfunction ColGroup(_ref) {\n var colWidths = _ref.colWidths,\n columns = _ref.columns,\n columCount = _ref.columCount;\n var cols = [];\n var len = columCount || columns.length; // Only insert col with width & additional props\n // Skip if rest col do not have any useful info\n\n var mustInsert = false;\n\n for (var i = len - 1; i >= 0; i -= 1) {\n var width = colWidths[i];\n var column = columns && columns[i];\n var additionalProps = column && column[INTERNAL_COL_DEFINE];\n\n if (width || additionalProps || mustInsert) {\n var _ref2 = additionalProps || {},\n columnType = _ref2.columnType,\n restAdditionalProps = _objectWithoutProperties(_ref2, _excluded);\n\n cols.unshift( /*#__PURE__*/React.createElement(\"col\", _extends({\n key: i,\n style: {\n width: width\n }\n }, restAdditionalProps)));\n mustInsert = true;\n }\n }\n\n return /*#__PURE__*/React.createElement(\"colgroup\", null, cols);\n}\n\nexport default ColGroup;","import * as React from 'react';\n\nfunction Panel(_ref) {\n var className = _ref.className,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className\n }, children);\n}\n\nexport default Panel;","import * as React from 'react';\nvar SummaryContext = /*#__PURE__*/React.createContext({});\nexport default SummaryContext;","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\"];\nimport * as React from 'react';\nexport default function FooterRow(_ref) {\n var children = _ref.children,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"tr\", props, children);\n}","import Cell from './Cell';\nimport Row from './Row';\n/**\n * Syntactic sugar. Do not support HOC.\n */\n\nfunction Summary(_ref) {\n var children = _ref.children;\n return children;\n}\n\nSummary.Row = Row;\nSummary.Cell = Cell;\nexport default Summary;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SummaryContext from './SummaryContext';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\nimport { getCellFixedInfo } from '../utils/fixUtil';\nexport default function SummaryCell(_ref) {\n var className = _ref.className,\n index = _ref.index,\n children = _ref.children,\n _ref$colSpan = _ref.colSpan,\n colSpan = _ref$colSpan === void 0 ? 1 : _ref$colSpan,\n rowSpan = _ref.rowSpan,\n align = _ref.align;\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls,\n direction = _React$useContext.direction;\n\n var _React$useContext2 = React.useContext(SummaryContext),\n scrollColumnIndex = _React$useContext2.scrollColumnIndex,\n stickyOffsets = _React$useContext2.stickyOffsets,\n flattenColumns = _React$useContext2.flattenColumns;\n\n var lastIndex = index + colSpan - 1;\n var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;\n var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction);\n return /*#__PURE__*/React.createElement(Cell, _extends({\n className: className,\n index: index,\n component: \"td\",\n prefixCls: prefixCls,\n record: null,\n dataIndex: null,\n align: align,\n colSpan: mergedColSpan,\n rowSpan: rowSpan,\n render: function render() {\n return children;\n }\n }, fixedInfo));\n}","import * as React from 'react';\nimport TableContext from '../context/TableContext';\nimport Summary from './Summary';\nimport SummaryContext from './SummaryContext';\n\nfunction Footer(_ref) {\n var children = _ref.children,\n stickyOffsets = _ref.stickyOffsets,\n flattenColumns = _ref.flattenColumns;\n var tableContext = React.useContext(TableContext);\n var prefixCls = tableContext.prefixCls;\n var lastColumnIndex = flattenColumns.length - 1;\n var scrollColumn = flattenColumns[lastColumnIndex];\n var summaryContext = React.useMemo(function () {\n return {\n stickyOffsets: stickyOffsets,\n flattenColumns: flattenColumns,\n scrollColumnIndex: (scrollColumn === null || scrollColumn === void 0 ? void 0 : scrollColumn.scrollbar) ? lastColumnIndex : null\n };\n }, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets]);\n return /*#__PURE__*/React.createElement(SummaryContext.Provider, {\n value: summaryContext\n }, /*#__PURE__*/React.createElement(\"tfoot\", {\n className: \"\".concat(prefixCls, \"-summary\")\n }, children));\n}\n\nexport default Footer;\nexport var FooterComponents = Summary;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nexport function renderExpandIcon(_ref) {\n var _classNames;\n\n var prefixCls = _ref.prefixCls,\n record = _ref.record,\n onExpand = _ref.onExpand,\n expanded = _ref.expanded,\n expandable = _ref.expandable;\n var expandClassName = \"\".concat(prefixCls, \"-row-expand-icon\");\n\n if (!expandable) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(expandClassName, \"\".concat(prefixCls, \"-row-spaced\"))\n });\n }\n\n var onClick = function onClick(event) {\n onExpand(record, event);\n event.stopPropagation();\n };\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(expandClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-expanded\"), expanded), _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-collapsed\"), !expanded), _classNames)),\n onClick: onClick\n });\n}\nexport function findAllChildrenKeys(data, getRowKey, childrenColumnName) {\n var keys = [];\n\n function dig(list) {\n (list || []).forEach(function (item, index) {\n keys.push(getRowKey(item, index));\n dig(item[childrenColumnName]);\n });\n }\n\n dig(data);\n return keys;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport getScrollBarSize from \"rc-util/es/getScrollBarSize\";\nimport classNames from 'classnames';\nimport { getOffset } from \"rc-util/es/Dom/css\";\nimport TableContext from './context/TableContext';\nimport { useLayoutState } from './hooks/useFrame';\n\nvar StickyScrollBar = function StickyScrollBar(_ref, ref) {\n var _scrollBodyRef$curren, _scrollBodyRef$curren2;\n\n var scrollBodyRef = _ref.scrollBodyRef,\n onScroll = _ref.onScroll,\n offsetScroll = _ref.offsetScroll,\n container = _ref.container;\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls;\n\n var bodyScrollWidth = ((_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 ? void 0 : _scrollBodyRef$curren.scrollWidth) || 0;\n var bodyWidth = ((_scrollBodyRef$curren2 = scrollBodyRef.current) === null || _scrollBodyRef$curren2 === void 0 ? void 0 : _scrollBodyRef$curren2.clientWidth) || 0;\n var scrollBarWidth = bodyScrollWidth && bodyWidth * (bodyWidth / bodyScrollWidth);\n var scrollBarRef = React.useRef();\n\n var _useLayoutState = useLayoutState({\n scrollLeft: 0,\n isHiddenScrollBar: false\n }),\n _useLayoutState2 = _slicedToArray(_useLayoutState, 2),\n scrollState = _useLayoutState2[0],\n setScrollState = _useLayoutState2[1];\n\n var refState = React.useRef({\n delta: 0,\n x: 0\n });\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n isActive = _React$useState2[0],\n setActive = _React$useState2[1];\n\n var onMouseUp = function onMouseUp() {\n setActive(false);\n };\n\n var onMouseDown = function onMouseDown(event) {\n event.persist();\n refState.current.delta = event.pageX - scrollState.scrollLeft;\n refState.current.x = 0;\n setActive(true);\n event.preventDefault();\n };\n\n var onMouseMove = function onMouseMove(event) {\n var _window;\n\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n var _ref2 = event || ((_window = window) === null || _window === void 0 ? void 0 : _window.event),\n buttons = _ref2.buttons;\n\n if (!isActive || buttons === 0) {\n // If out body mouse up, we can set isActive false when mouse move\n if (isActive) {\n setActive(false);\n }\n\n return;\n }\n\n var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;\n\n if (left <= 0) {\n left = 0;\n }\n\n if (left + scrollBarWidth >= bodyWidth) {\n left = bodyWidth - scrollBarWidth;\n }\n\n onScroll({\n scrollLeft: left / bodyWidth * (bodyScrollWidth + 2)\n });\n refState.current.x = event.pageX;\n };\n\n var onContainerScroll = function onContainerScroll() {\n if (!scrollBodyRef.current) {\n return;\n }\n\n var tableOffsetTop = getOffset(scrollBodyRef.current).top;\n var tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;\n var currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : getOffset(container).top + container.clientHeight;\n\n if (tableBottomOffset - getScrollBarSize() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll) {\n setScrollState(function (state) {\n return _objectSpread(_objectSpread({}, state), {}, {\n isHiddenScrollBar: true\n });\n });\n } else {\n setScrollState(function (state) {\n return _objectSpread(_objectSpread({}, state), {}, {\n isHiddenScrollBar: false\n });\n });\n }\n };\n\n var setScrollLeft = function setScrollLeft(left) {\n setScrollState(function (state) {\n return _objectSpread(_objectSpread({}, state), {}, {\n scrollLeft: left / bodyScrollWidth * bodyWidth || 0\n });\n });\n };\n\n React.useImperativeHandle(ref, function () {\n return {\n setScrollLeft: setScrollLeft\n };\n });\n React.useEffect(function () {\n var onMouseUpListener = addEventListener(document.body, 'mouseup', onMouseUp, false);\n var onMouseMoveListener = addEventListener(document.body, 'mousemove', onMouseMove, false);\n onContainerScroll();\n return function () {\n onMouseUpListener.remove();\n onMouseMoveListener.remove();\n };\n }, [scrollBarWidth, isActive]);\n React.useEffect(function () {\n var onScrollListener = addEventListener(container, 'scroll', onContainerScroll, false);\n var onResizeListener = addEventListener(window, 'resize', onContainerScroll, false);\n return function () {\n onScrollListener.remove();\n onResizeListener.remove();\n };\n }, [container]);\n React.useEffect(function () {\n if (!scrollState.isHiddenScrollBar) {\n setScrollState(function (state) {\n var bodyNode = scrollBodyRef.current;\n\n if (!bodyNode) {\n return state;\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth\n });\n });\n }\n }, [scrollState.isHiddenScrollBar]);\n\n if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n style: {\n height: getScrollBarSize(),\n width: bodyWidth,\n bottom: offsetScroll\n },\n className: \"\".concat(prefixCls, \"-sticky-scroll\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n onMouseDown: onMouseDown,\n ref: scrollBarRef,\n className: classNames(\"\".concat(prefixCls, \"-sticky-scroll-bar\"), _defineProperty({}, \"\".concat(prefixCls, \"-sticky-scroll-bar-active\"), isActive)),\n style: {\n width: \"\".concat(scrollBarWidth, \"px\"),\n transform: \"translate3d(\".concat(scrollState.scrollLeft, \"px, 0, 0)\")\n }\n }));\n};\n\nexport default /*#__PURE__*/React.forwardRef(StickyScrollBar);","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\"; // fix ssr render\n\nvar defaultContainer = canUseDom() ? window : null;\n/** Sticky header hooks */\n\nexport default function useSticky(sticky, prefixCls) {\n var _ref = _typeof(sticky) === 'object' ? sticky : {},\n _ref$offsetHeader = _ref.offsetHeader,\n offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,\n _ref$offsetSummary = _ref.offsetSummary,\n offsetSummary = _ref$offsetSummary === void 0 ? 0 : _ref$offsetSummary,\n _ref$offsetScroll = _ref.offsetScroll,\n offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,\n _ref$getContainer = _ref.getContainer,\n getContainer = _ref$getContainer === void 0 ? function () {\n return defaultContainer;\n } : _ref$getContainer;\n\n var container = getContainer() || defaultContainer;\n return React.useMemo(function () {\n var isSticky = !!sticky;\n return {\n isSticky: isSticky,\n stickyClassName: isSticky ? \"\".concat(prefixCls, \"-sticky-holder\") : '',\n offsetHeader: offsetHeader,\n offsetSummary: offsetSummary,\n offsetScroll: offsetScroll,\n container: container\n };\n }, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"noData\", \"columns\", \"flattenColumns\", \"colWidths\", \"columCount\", \"stickyOffsets\", \"direction\", \"fixHeader\", \"stickyTopOffset\", \"stickyBottomOffset\", \"stickyClassName\", \"onScroll\", \"maxContentScroll\", \"children\"];\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport classNames from 'classnames';\nimport { fillRef } from \"rc-util/es/ref\";\nimport ColGroup from '../ColGroup';\nimport TableContext from '../context/TableContext';\n\nfunction useColumnWidth(colWidths, columCount) {\n return useMemo(function () {\n var cloneColumns = [];\n\n for (var i = 0; i < columCount; i += 1) {\n var val = colWidths[i];\n\n if (val !== undefined) {\n cloneColumns[i] = val;\n } else {\n return null;\n }\n }\n\n return cloneColumns;\n }, [colWidths.join('_'), columCount]);\n}\n\nvar FixedHolder = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var className = _ref.className,\n noData = _ref.noData,\n columns = _ref.columns,\n flattenColumns = _ref.flattenColumns,\n colWidths = _ref.colWidths,\n columCount = _ref.columCount,\n stickyOffsets = _ref.stickyOffsets,\n direction = _ref.direction,\n fixHeader = _ref.fixHeader,\n stickyTopOffset = _ref.stickyTopOffset,\n stickyBottomOffset = _ref.stickyBottomOffset,\n stickyClassName = _ref.stickyClassName,\n onScroll = _ref.onScroll,\n maxContentScroll = _ref.maxContentScroll,\n children = _ref.children,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _React$useContext = React.useContext(TableContext),\n prefixCls = _React$useContext.prefixCls,\n scrollbarSize = _React$useContext.scrollbarSize,\n isSticky = _React$useContext.isSticky;\n\n var combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize; // Pass wheel to scroll event\n\n var scrollRef = React.useRef(null);\n var setScrollRef = React.useCallback(function (element) {\n fillRef(ref, element);\n fillRef(scrollRef, element);\n }, []);\n React.useEffect(function () {\n var _scrollRef$current;\n\n function onWheel(e) {\n var currentTarget = e.currentTarget,\n deltaX = e.deltaX;\n\n if (deltaX) {\n onScroll({\n currentTarget: currentTarget,\n scrollLeft: currentTarget.scrollLeft + deltaX\n });\n e.preventDefault();\n }\n }\n\n (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.addEventListener('wheel', onWheel);\n return function () {\n var _scrollRef$current2;\n\n (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.removeEventListener('wheel', onWheel);\n };\n }, []); // Check if all flattenColumns has width\n\n var allFlattenColumnsWithWidth = React.useMemo(function () {\n return flattenColumns.every(function (column) {\n return column.width >= 0;\n });\n }, [flattenColumns]); // Add scrollbar column\n\n var lastColumn = flattenColumns[flattenColumns.length - 1];\n var ScrollBarColumn = {\n fixed: lastColumn ? lastColumn.fixed : null,\n scrollbar: true,\n onHeaderCell: function onHeaderCell() {\n return {\n className: \"\".concat(prefixCls, \"-cell-scrollbar\")\n };\n }\n };\n var columnsWithScrollbar = useMemo(function () {\n return combinationScrollBarSize ? [].concat(_toConsumableArray(columns), [ScrollBarColumn]) : columns;\n }, [combinationScrollBarSize, columns]);\n var flattenColumnsWithScrollbar = useMemo(function () {\n return combinationScrollBarSize ? [].concat(_toConsumableArray(flattenColumns), [ScrollBarColumn]) : flattenColumns;\n }, [combinationScrollBarSize, flattenColumns]); // Calculate the sticky offsets\n\n var headerStickyOffsets = useMemo(function () {\n var right = stickyOffsets.right,\n left = stickyOffsets.left;\n return _objectSpread(_objectSpread({}, stickyOffsets), {}, {\n left: direction === 'rtl' ? [].concat(_toConsumableArray(left.map(function (width) {\n return width + combinationScrollBarSize;\n })), [0]) : left,\n right: direction === 'rtl' ? right : [].concat(_toConsumableArray(right.map(function (width) {\n return width + combinationScrollBarSize;\n })), [0]),\n isSticky: isSticky\n });\n }, [combinationScrollBarSize, stickyOffsets, isSticky]);\n var mergedColumnWidth = useColumnWidth(colWidths, columCount);\n return /*#__PURE__*/React.createElement(\"div\", {\n style: _objectSpread({\n overflow: 'hidden'\n }, isSticky ? {\n top: stickyTopOffset,\n bottom: stickyBottomOffset\n } : {}),\n ref: setScrollRef,\n className: classNames(className, _defineProperty({}, stickyClassName, !!stickyClassName))\n }, /*#__PURE__*/React.createElement(\"table\", {\n style: {\n tableLayout: 'fixed',\n visibility: noData || mergedColumnWidth ? null : 'hidden'\n }\n }, (!noData || !maxContentScroll || allFlattenColumnsWithWidth) && /*#__PURE__*/React.createElement(ColGroup, {\n colWidths: mergedColumnWidth ? [].concat(_toConsumableArray(mergedColumnWidth), [combinationScrollBarSize]) : [],\n columCount: columCount + 1,\n columns: flattenColumnsWithScrollbar\n }), children(_objectSpread(_objectSpread({}, props), {}, {\n stickyOffsets: headerStickyOffsets,\n columns: columnsWithScrollbar,\n flattenColumns: flattenColumnsWithScrollbar\n }))));\n});\nFixedHolder.displayName = 'FixedHolder';\nexport default FixedHolder;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/**\n * Feature:\n * - fixed not need to set width\n * - support `rowExpandable` to config row expand logic\n * - add `summary` to support `() => ReactNode`\n *\n * Update:\n * - `dataIndex` is `array[]` now\n * - `expandable` wrap all the expand related props\n *\n * Removed:\n * - expandIconAsCell\n * - useFixedHeader\n * - rowRef\n * - columns[number].onCellClick\n * - onRowClick\n * - onRowDoubleClick\n * - onRowMouseEnter\n * - onRowMouseLeave\n * - getBodyWrapper\n * - bodyStyle\n *\n * Deprecated:\n * - All expanded props, move into expandable\n */\nimport * as React from 'react';\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport { isStyleSupport } from \"rc-util/es/Dom/styleChecker\";\nimport classNames from 'classnames';\nimport shallowEqual from 'shallowequal';\nimport warning from \"rc-util/es/warning\";\nimport ResizeObserver from 'rc-resize-observer';\nimport { getTargetScrollBarSize } from \"rc-util/es/getScrollBarSize\";\nimport ColumnGroup from './sugar/ColumnGroup';\nimport Column from './sugar/Column';\nimport Header from './Header/Header';\nimport TableContext from './context/TableContext';\nimport BodyContext from './context/BodyContext';\nimport Body from './Body';\nimport useColumns from './hooks/useColumns';\nimport { useLayoutState, useTimeoutLock } from './hooks/useFrame';\nimport { getPathValue, validateValue, getColumnsKey } from './utils/valueUtil';\nimport ResizeContext from './context/ResizeContext';\nimport useStickyOffsets from './hooks/useStickyOffsets';\nimport ColGroup from './ColGroup';\nimport { getExpandableProps } from './utils/legacyUtil';\nimport Panel from './Panel';\nimport Footer, { FooterComponents } from './Footer';\nimport { findAllChildrenKeys, renderExpandIcon } from './utils/expandUtil';\nimport { getCellFixedInfo } from './utils/fixUtil';\nimport StickyScrollBar from './stickyScrollBar';\nimport useSticky from './hooks/useSticky';\nimport FixedHolder from './FixedHolder';\nimport Summary from './Footer/Summary';\nimport StickyContext from './context/StickyContext';\nimport ExpandedRowContext from './context/ExpandedRowContext';\nimport { EXPAND_COLUMN } from './constant'; // Used for conditions cache\n\nvar EMPTY_DATA = []; // Used for customize scroll\n\nvar EMPTY_SCROLL_TARGET = {};\nexport var INTERNAL_HOOKS = 'rc-table-internal-hook';\nvar MemoTableContent = /*#__PURE__*/React.memo(function (_ref) {\n var children = _ref.children;\n return children;\n}, function (prev, next) {\n if (!shallowEqual(prev.props, next.props)) {\n return false;\n } // No additional render when pinged status change.\n // This is not a bug.\n\n\n return prev.pingLeft !== next.pingLeft || prev.pingRight !== next.pingRight;\n});\n\nfunction Table(props) {\n var _classNames;\n\n var prefixCls = props.prefixCls,\n className = props.className,\n rowClassName = props.rowClassName,\n style = props.style,\n data = props.data,\n rowKey = props.rowKey,\n scroll = props.scroll,\n tableLayout = props.tableLayout,\n direction = props.direction,\n title = props.title,\n footer = props.footer,\n summary = props.summary,\n id = props.id,\n showHeader = props.showHeader,\n components = props.components,\n emptyText = props.emptyText,\n onRow = props.onRow,\n onHeaderRow = props.onHeaderRow,\n internalHooks = props.internalHooks,\n transformColumns = props.transformColumns,\n internalRefs = props.internalRefs,\n sticky = props.sticky;\n var mergedData = data || EMPTY_DATA;\n var hasData = !!mergedData.length; // ===================== Warning ======================\n\n if (process.env.NODE_ENV !== 'production') {\n ['onRowClick', 'onRowDoubleClick', 'onRowContextMenu', 'onRowMouseEnter', 'onRowMouseLeave'].forEach(function (name) {\n warning(props[name] === undefined, \"`\".concat(name, \"` is removed, please use `onRow` instead.\"));\n });\n warning(!('getBodyWrapper' in props), '`getBodyWrapper` is deprecated, please use custom `components` instead.');\n } // ==================== Customize =====================\n\n\n var getComponent = React.useCallback(function (path, defaultComponent) {\n return getPathValue(components || {}, path) || defaultComponent;\n }, [components]);\n var getRowKey = React.useMemo(function () {\n if (typeof rowKey === 'function') {\n return rowKey;\n }\n\n return function (record) {\n var key = record && record[rowKey];\n\n if (process.env.NODE_ENV !== 'production') {\n warning(key !== undefined, 'Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key.');\n }\n\n return key;\n };\n }, [rowKey]); // ====================== Expand ======================\n\n var expandableConfig = getExpandableProps(props);\n var expandIcon = expandableConfig.expandIcon,\n expandedRowKeys = expandableConfig.expandedRowKeys,\n defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys,\n defaultExpandAllRows = expandableConfig.defaultExpandAllRows,\n expandedRowRender = expandableConfig.expandedRowRender,\n columnTitle = expandableConfig.columnTitle,\n onExpand = expandableConfig.onExpand,\n onExpandedRowsChange = expandableConfig.onExpandedRowsChange,\n expandRowByClick = expandableConfig.expandRowByClick,\n rowExpandable = expandableConfig.rowExpandable,\n expandIconColumnIndex = expandableConfig.expandIconColumnIndex,\n expandedRowClassName = expandableConfig.expandedRowClassName,\n childrenColumnName = expandableConfig.childrenColumnName,\n indentSize = expandableConfig.indentSize;\n var mergedExpandIcon = expandIcon || renderExpandIcon;\n var mergedChildrenColumnName = childrenColumnName || 'children';\n var expandableType = React.useMemo(function () {\n if (expandedRowRender) {\n return 'row';\n }\n /* eslint-disable no-underscore-dangle */\n\n /**\n * Fix https://github.com/ant-design/ant-design/issues/21154\n * This is a workaround to not to break current behavior.\n * We can remove follow code after final release.\n *\n * To other developer:\n * Do not use `__PARENT_RENDER_ICON__` in prod since we will remove this when refactor\n */\n\n\n if (props.expandable && internalHooks === INTERNAL_HOOKS && props.expandable.__PARENT_RENDER_ICON__ || mergedData.some(function (record) {\n return record && _typeof(record) === 'object' && record[mergedChildrenColumnName];\n })) {\n return 'nest';\n }\n /* eslint-enable */\n\n\n return false;\n }, [!!expandedRowRender, mergedData]);\n\n var _React$useState = React.useState(function () {\n if (defaultExpandedRowKeys) {\n return defaultExpandedRowKeys;\n }\n\n if (defaultExpandAllRows) {\n return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);\n }\n\n return [];\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerExpandedKeys = _React$useState2[0],\n setInnerExpandedKeys = _React$useState2[1];\n\n var mergedExpandedKeys = React.useMemo(function () {\n return new Set(expandedRowKeys || innerExpandedKeys || []);\n }, [expandedRowKeys, innerExpandedKeys]);\n var onTriggerExpand = React.useCallback(function (record) {\n var key = getRowKey(record, mergedData.indexOf(record));\n var newExpandedKeys;\n var hasKey = mergedExpandedKeys.has(key);\n\n if (hasKey) {\n mergedExpandedKeys.delete(key);\n newExpandedKeys = _toConsumableArray(mergedExpandedKeys);\n } else {\n newExpandedKeys = [].concat(_toConsumableArray(mergedExpandedKeys), [key]);\n }\n\n setInnerExpandedKeys(newExpandedKeys);\n\n if (onExpand) {\n onExpand(!hasKey, record);\n }\n\n if (onExpandedRowsChange) {\n onExpandedRowsChange(newExpandedKeys);\n }\n }, [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]); // Warning if use `expandedRowRender` and nest children in the same time\n\n if (process.env.NODE_ENV !== 'production' && expandedRowRender && mergedData.some(function (record) {\n return Array.isArray(record === null || record === void 0 ? void 0 : record[mergedChildrenColumnName]);\n })) {\n warning(false, '`expandedRowRender` should not use with nested Table');\n } // ====================== Column ======================\n\n\n var _React$useState3 = React.useState(0),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n componentWidth = _React$useState4[0],\n setComponentWidth = _React$useState4[1];\n\n var _useColumns = useColumns(_objectSpread(_objectSpread(_objectSpread({}, props), expandableConfig), {}, {\n expandable: !!expandedRowRender,\n columnTitle: columnTitle,\n expandedKeys: mergedExpandedKeys,\n getRowKey: getRowKey,\n // https://github.com/ant-design/ant-design/issues/23894\n onTriggerExpand: onTriggerExpand,\n expandIcon: mergedExpandIcon,\n expandIconColumnIndex: expandIconColumnIndex,\n direction: direction\n }), internalHooks === INTERNAL_HOOKS ? transformColumns : null),\n _useColumns2 = _slicedToArray(_useColumns, 2),\n columns = _useColumns2[0],\n flattenColumns = _useColumns2[1];\n\n var columnContext = React.useMemo(function () {\n return {\n columns: columns,\n flattenColumns: flattenColumns\n };\n }, [columns, flattenColumns]); // ====================== Scroll ======================\n\n var fullTableRef = React.useRef();\n var scrollHeaderRef = React.useRef();\n var scrollBodyRef = React.useRef();\n var scrollBodyContainerRef = React.useRef();\n var scrollSummaryRef = React.useRef();\n\n var _React$useState5 = React.useState(false),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n pingedLeft = _React$useState6[0],\n setPingedLeft = _React$useState6[1];\n\n var _React$useState7 = React.useState(false),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n pingedRight = _React$useState8[0],\n setPingedRight = _React$useState8[1];\n\n var _useLayoutState = useLayoutState(new Map()),\n _useLayoutState2 = _slicedToArray(_useLayoutState, 2),\n colsWidths = _useLayoutState2[0],\n updateColsWidths = _useLayoutState2[1]; // Convert map to number width\n\n\n var colsKeys = getColumnsKey(flattenColumns);\n var pureColWidths = colsKeys.map(function (columnKey) {\n return colsWidths.get(columnKey);\n });\n var colWidths = React.useMemo(function () {\n return pureColWidths;\n }, [pureColWidths.join('_')]);\n var stickyOffsets = useStickyOffsets(colWidths, flattenColumns.length, direction);\n var fixHeader = scroll && validateValue(scroll.y);\n var horizonScroll = scroll && validateValue(scroll.x) || Boolean(expandableConfig.fixed);\n var fixColumn = horizonScroll && flattenColumns.some(function (_ref2) {\n var fixed = _ref2.fixed;\n return fixed;\n }); // Sticky\n\n var stickyRef = React.useRef();\n\n var _useSticky = useSticky(sticky, prefixCls),\n isSticky = _useSticky.isSticky,\n offsetHeader = _useSticky.offsetHeader,\n offsetSummary = _useSticky.offsetSummary,\n offsetScroll = _useSticky.offsetScroll,\n stickyClassName = _useSticky.stickyClassName,\n container = _useSticky.container; // Footer (Fix footer must fixed header)\n\n\n var summaryNode = summary === null || summary === void 0 ? void 0 : summary(mergedData);\n var fixFooter = (fixHeader || isSticky) && /*#__PURE__*/React.isValidElement(summaryNode) && summaryNode.type === Summary && summaryNode.props.fixed; // Scroll\n\n var scrollXStyle;\n var scrollYStyle;\n var scrollTableStyle;\n\n if (fixHeader) {\n scrollYStyle = {\n overflowY: 'scroll',\n maxHeight: scroll.y\n };\n }\n\n if (horizonScroll) {\n scrollXStyle = {\n overflowX: 'auto'\n }; // When no vertical scrollbar, should hide it\n // https://github.com/ant-design/ant-design/pull/20705\n // https://github.com/ant-design/ant-design/issues/21879\n\n if (!fixHeader) {\n scrollYStyle = {\n overflowY: 'hidden'\n };\n }\n\n scrollTableStyle = {\n width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) === true ? 'auto' : scroll === null || scroll === void 0 ? void 0 : scroll.x,\n minWidth: '100%'\n };\n }\n\n var onColumnResize = React.useCallback(function (columnKey, width) {\n if (isVisible(fullTableRef.current)) {\n updateColsWidths(function (widths) {\n if (widths.get(columnKey) !== width) {\n var newWidths = new Map(widths);\n newWidths.set(columnKey, width);\n return newWidths;\n }\n\n return widths;\n });\n }\n }, []);\n\n var _useTimeoutLock = useTimeoutLock(null),\n _useTimeoutLock2 = _slicedToArray(_useTimeoutLock, 2),\n setScrollTarget = _useTimeoutLock2[0],\n getScrollTarget = _useTimeoutLock2[1];\n\n function forceScroll(scrollLeft, target) {\n if (!target) {\n return;\n }\n\n if (typeof target === 'function') {\n target(scrollLeft);\n } else if (target.scrollLeft !== scrollLeft) {\n // eslint-disable-next-line no-param-reassign\n target.scrollLeft = scrollLeft;\n }\n }\n\n var onScroll = function onScroll(_ref3) {\n var currentTarget = _ref3.currentTarget,\n scrollLeft = _ref3.scrollLeft;\n var isRTL = direction === 'rtl';\n var mergedScrollLeft = typeof scrollLeft === 'number' ? scrollLeft : currentTarget.scrollLeft;\n var compareTarget = currentTarget || EMPTY_SCROLL_TARGET;\n\n if (!getScrollTarget() || getScrollTarget() === compareTarget) {\n var _stickyRef$current;\n\n setScrollTarget(compareTarget);\n forceScroll(mergedScrollLeft, scrollHeaderRef.current);\n forceScroll(mergedScrollLeft, scrollBodyRef.current);\n forceScroll(mergedScrollLeft, scrollSummaryRef.current);\n forceScroll(mergedScrollLeft, (_stickyRef$current = stickyRef.current) === null || _stickyRef$current === void 0 ? void 0 : _stickyRef$current.setScrollLeft);\n }\n\n if (currentTarget) {\n var scrollWidth = currentTarget.scrollWidth,\n clientWidth = currentTarget.clientWidth; // There is no space to scroll\n\n if (scrollWidth === clientWidth) {\n setPingedLeft(false);\n setPingedRight(false);\n return;\n }\n\n if (isRTL) {\n setPingedLeft(-mergedScrollLeft < scrollWidth - clientWidth);\n setPingedRight(-mergedScrollLeft > 0);\n } else {\n setPingedLeft(mergedScrollLeft > 0);\n setPingedRight(mergedScrollLeft < scrollWidth - clientWidth);\n }\n }\n };\n\n var triggerOnScroll = function triggerOnScroll() {\n if (horizonScroll && scrollBodyRef.current) {\n onScroll({\n currentTarget: scrollBodyRef.current\n });\n } else {\n setPingedLeft(false);\n setPingedRight(false);\n }\n };\n\n var onFullTableResize = function onFullTableResize(_ref4) {\n var width = _ref4.width;\n\n if (width !== componentWidth) {\n triggerOnScroll();\n setComponentWidth(fullTableRef.current ? fullTableRef.current.offsetWidth : width);\n }\n }; // Sync scroll bar when init or `horizonScroll`, `data` and `columns.length` changed\n\n\n var mounted = React.useRef(false);\n React.useEffect(function () {\n // onFullTableResize will be trigger once when ResizeObserver is mounted\n // This will reduce one duplicated triggerOnScroll time\n if (mounted.current) {\n triggerOnScroll();\n }\n }, [horizonScroll, data, columns.length]);\n React.useEffect(function () {\n mounted.current = true;\n }, []); // ===================== Effects ======================\n\n var _React$useState9 = React.useState(0),\n _React$useState10 = _slicedToArray(_React$useState9, 2),\n scrollbarSize = _React$useState10[0],\n setScrollbarSize = _React$useState10[1];\n\n var _React$useState11 = React.useState(true),\n _React$useState12 = _slicedToArray(_React$useState11, 2),\n supportSticky = _React$useState12[0],\n setSupportSticky = _React$useState12[1]; // Only IE not support, we mark as support first\n\n\n React.useEffect(function () {\n if (scrollBodyRef.current instanceof Element) {\n setScrollbarSize(getTargetScrollBarSize(scrollBodyRef.current).width);\n } else {\n setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width);\n }\n\n setSupportSticky(isStyleSupport('position', 'sticky'));\n }, []); // ================== INTERNAL HOOKS ==================\n\n React.useEffect(function () {\n if (internalHooks === INTERNAL_HOOKS && internalRefs) {\n internalRefs.body.current = scrollBodyRef.current;\n }\n }); // ====================== Render ======================\n\n var TableComponent = getComponent(['table'], 'table'); // Table layout\n\n var mergedTableLayout = React.useMemo(function () {\n if (tableLayout) {\n return tableLayout;\n } // https://github.com/ant-design/ant-design/issues/25227\n // When scroll.x is max-content, no need to fix table layout\n // it's width should stretch out to fit content\n\n\n if (fixColumn) {\n return (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' ? 'auto' : 'fixed';\n }\n\n if (fixHeader || isSticky || flattenColumns.some(function (_ref5) {\n var ellipsis = _ref5.ellipsis;\n return ellipsis;\n })) {\n return 'fixed';\n }\n\n return 'auto';\n }, [fixHeader, fixColumn, flattenColumns, tableLayout, isSticky]);\n var groupTableNode; // Header props\n\n var headerProps = {\n colWidths: colWidths,\n columCount: flattenColumns.length,\n stickyOffsets: stickyOffsets,\n onHeaderRow: onHeaderRow,\n fixHeader: fixHeader,\n scroll: scroll\n }; // Empty\n\n var emptyNode = React.useMemo(function () {\n if (hasData) {\n return null;\n }\n\n if (typeof emptyText === 'function') {\n return emptyText();\n }\n\n return emptyText;\n }, [hasData, emptyText]); // Body\n\n var bodyTable = /*#__PURE__*/React.createElement(Body, {\n data: mergedData,\n measureColumnWidth: fixHeader || horizonScroll || isSticky,\n expandedKeys: mergedExpandedKeys,\n rowExpandable: rowExpandable,\n getRowKey: getRowKey,\n onRow: onRow,\n emptyNode: emptyNode,\n childrenColumnName: mergedChildrenColumnName\n });\n var bodyColGroup = /*#__PURE__*/React.createElement(ColGroup, {\n colWidths: flattenColumns.map(function (_ref6) {\n var width = _ref6.width;\n return width;\n }),\n columns: flattenColumns\n });\n var customizeScrollBody = getComponent(['body']);\n\n if (process.env.NODE_ENV !== 'production' && typeof customizeScrollBody === 'function' && hasData && !fixHeader) {\n warning(false, '`components.body` with render props is only work on `scroll.y`.');\n }\n\n if (fixHeader || isSticky) {\n // >>>>>> Fixed Header\n var bodyContent;\n\n if (typeof customizeScrollBody === 'function') {\n bodyContent = customizeScrollBody(mergedData, {\n scrollbarSize: scrollbarSize,\n ref: scrollBodyRef,\n onScroll: onScroll\n });\n headerProps.colWidths = flattenColumns.map(function (_ref7, index) {\n var width = _ref7.width;\n var colWidth = index === columns.length - 1 ? width - scrollbarSize : width;\n\n if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {\n return colWidth;\n }\n\n warning(false, 'When use `components.body` with render props. Each column should have a fixed `width` value.');\n return 0;\n });\n } else {\n bodyContent = /*#__PURE__*/React.createElement(\"div\", {\n style: _objectSpread(_objectSpread({}, scrollXStyle), scrollYStyle),\n onScroll: onScroll,\n ref: scrollBodyRef,\n className: classNames(\"\".concat(prefixCls, \"-body\"))\n }, /*#__PURE__*/React.createElement(TableComponent, {\n style: _objectSpread(_objectSpread({}, scrollTableStyle), {}, {\n tableLayout: mergedTableLayout\n })\n }, bodyColGroup, bodyTable, !fixFooter && summaryNode && /*#__PURE__*/React.createElement(Footer, {\n stickyOffsets: stickyOffsets,\n flattenColumns: flattenColumns\n }, summaryNode)));\n } // Fixed holder share the props\n\n\n var fixedHolderProps = _objectSpread(_objectSpread(_objectSpread({\n noData: !mergedData.length,\n maxContentScroll: horizonScroll && scroll.x === 'max-content'\n }, headerProps), columnContext), {}, {\n direction: direction,\n stickyClassName: stickyClassName,\n onScroll: onScroll\n });\n\n groupTableNode = /*#__PURE__*/React.createElement(React.Fragment, null, showHeader !== false && /*#__PURE__*/React.createElement(FixedHolder, _extends({}, fixedHolderProps, {\n stickyTopOffset: offsetHeader,\n className: \"\".concat(prefixCls, \"-header\"),\n ref: scrollHeaderRef\n }), function (fixedHolderPassProps) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, fixedHolderPassProps), fixFooter === 'top' && /*#__PURE__*/React.createElement(Footer, fixedHolderPassProps, summaryNode));\n }), bodyContent, fixFooter && fixFooter !== 'top' && /*#__PURE__*/React.createElement(FixedHolder, _extends({}, fixedHolderProps, {\n stickyBottomOffset: offsetSummary,\n className: \"\".concat(prefixCls, \"-summary\"),\n ref: scrollSummaryRef\n }), function (fixedHolderPassProps) {\n return /*#__PURE__*/React.createElement(Footer, fixedHolderPassProps, summaryNode);\n }), isSticky && /*#__PURE__*/React.createElement(StickyScrollBar, {\n ref: stickyRef,\n offsetScroll: offsetScroll,\n scrollBodyRef: scrollBodyRef,\n onScroll: onScroll,\n container: container\n }));\n } else {\n // >>>>>> Unique table\n groupTableNode = /*#__PURE__*/React.createElement(\"div\", {\n style: _objectSpread(_objectSpread({}, scrollXStyle), scrollYStyle),\n className: classNames(\"\".concat(prefixCls, \"-content\")),\n onScroll: onScroll,\n ref: scrollBodyRef\n }, /*#__PURE__*/React.createElement(TableComponent, {\n style: _objectSpread(_objectSpread({}, scrollTableStyle), {}, {\n tableLayout: mergedTableLayout\n })\n }, bodyColGroup, showHeader !== false && /*#__PURE__*/React.createElement(Header, _extends({}, headerProps, columnContext)), bodyTable, summaryNode && /*#__PURE__*/React.createElement(Footer, {\n stickyOffsets: stickyOffsets,\n flattenColumns: flattenColumns\n }, summaryNode)));\n }\n\n var ariaProps = pickAttrs(props, {\n aria: true,\n data: true\n });\n var fullTable = /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-ping-left\"), pingedLeft), _defineProperty(_classNames, \"\".concat(prefixCls, \"-ping-right\"), pingedRight), _defineProperty(_classNames, \"\".concat(prefixCls, \"-layout-fixed\"), tableLayout === 'fixed'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-fixed-header\"), fixHeader), _defineProperty(_classNames, \"\".concat(prefixCls, \"-fixed-column\"), fixColumn), _defineProperty(_classNames, \"\".concat(prefixCls, \"-scroll-horizontal\"), horizonScroll), _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-fix-left\"), flattenColumns[0] && flattenColumns[0].fixed), _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-fix-right\"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right'), _classNames)),\n style: style,\n id: id,\n ref: fullTableRef\n }, ariaProps), /*#__PURE__*/React.createElement(MemoTableContent, {\n pingLeft: pingedLeft,\n pingRight: pingedRight,\n props: _objectSpread(_objectSpread({}, props), {}, {\n stickyOffsets: stickyOffsets,\n mergedExpandedKeys: mergedExpandedKeys\n })\n }, title && /*#__PURE__*/React.createElement(Panel, {\n className: \"\".concat(prefixCls, \"-title\")\n }, title(mergedData)), /*#__PURE__*/React.createElement(\"div\", {\n ref: scrollBodyContainerRef,\n className: \"\".concat(prefixCls, \"-container\")\n }, groupTableNode), footer && /*#__PURE__*/React.createElement(Panel, {\n className: \"\".concat(prefixCls, \"-footer\")\n }, footer(mergedData))));\n\n if (horizonScroll) {\n fullTable = /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onFullTableResize\n }, fullTable);\n }\n\n var TableContextValue = React.useMemo(function () {\n return {\n prefixCls: prefixCls,\n getComponent: getComponent,\n scrollbarSize: scrollbarSize,\n direction: direction,\n fixedInfoList: flattenColumns.map(function (_, colIndex) {\n return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction);\n }),\n isSticky: isSticky\n };\n }, [prefixCls, getComponent, scrollbarSize, direction, flattenColumns, stickyOffsets, isSticky]);\n var BodyContextValue = React.useMemo(function () {\n return _objectSpread(_objectSpread({}, columnContext), {}, {\n tableLayout: mergedTableLayout,\n rowClassName: rowClassName,\n expandedRowClassName: expandedRowClassName,\n expandIcon: mergedExpandIcon,\n expandableType: expandableType,\n expandRowByClick: expandRowByClick,\n expandedRowRender: expandedRowRender,\n onTriggerExpand: onTriggerExpand,\n expandIconColumnIndex: expandIconColumnIndex,\n indentSize: indentSize,\n allColumnsFixedLeft: columnContext.flattenColumns.every(function (col) {\n return col.fixed === 'left';\n })\n });\n }, [columnContext, mergedTableLayout, rowClassName, expandedRowClassName, mergedExpandIcon, expandableType, expandRowByClick, expandedRowRender, onTriggerExpand, expandIconColumnIndex, indentSize]);\n var ExpandedRowContextValue = React.useMemo(function () {\n return {\n componentWidth: componentWidth,\n fixHeader: fixHeader,\n fixColumn: fixColumn,\n horizonScroll: horizonScroll\n };\n }, [componentWidth, fixHeader, fixColumn, horizonScroll]);\n var ResizeContextValue = React.useMemo(function () {\n return {\n onColumnResize: onColumnResize\n };\n }, [onColumnResize]);\n return /*#__PURE__*/React.createElement(StickyContext.Provider, {\n value: supportSticky\n }, /*#__PURE__*/React.createElement(TableContext.Provider, {\n value: TableContextValue\n }, /*#__PURE__*/React.createElement(BodyContext.Provider, {\n value: BodyContextValue\n }, /*#__PURE__*/React.createElement(ExpandedRowContext.Provider, {\n value: ExpandedRowContextValue\n }, /*#__PURE__*/React.createElement(ResizeContext.Provider, {\n value: ResizeContextValue\n }, fullTable)))));\n}\n\nTable.EXPAND_COLUMN = EXPAND_COLUMN;\nTable.Column = Column;\nTable.ColumnGroup = ColumnGroup;\nTable.Summary = FooterComponents;\nTable.defaultProps = {\n rowKey: 'key',\n prefixCls: 'rc-table',\n emptyText: function emptyText() {\n return 'No Data';\n }\n};\nexport default Table;","import Table from './Table';\nimport { FooterComponents as Summary } from './Footer';\nimport Column from './sugar/Column';\nimport ColumnGroup from './sugar/ColumnGroup';\nimport { INTERNAL_COL_DEFINE } from './utils/legacyUtil';\nexport { Summary, Column, ColumnGroup, INTERNAL_COL_DEFINE };\nexport default Table;","export function isWindow(obj) {\n return obj !== null && obj !== undefined && obj === obj.window;\n}\nexport default function getScroll(target, top) {\n var _a, _b;\n if (typeof window === 'undefined') {\n return 0;\n }\n var method = top ? 'scrollTop' : 'scrollLeft';\n var result = 0;\n if (isWindow(target)) {\n result = target[top ? 'pageYOffset' : 'pageXOffset'];\n } else if (target instanceof Document) {\n result = target.documentElement[method];\n } else if (target instanceof HTMLElement) {\n result = target[method];\n } else if (target) {\n // According to the type inference, the `target` is `never` type.\n // Since we configured the loose mode type checking, and supports mocking the target with such shape below::\n // `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`,\n // the program may falls into this branch.\n // Check the corresponding tests for details. Don't sure what is the real scenario this happens.\n result = target[method];\n }\n if (target && !isWindow(target) && typeof result !== 'number') {\n result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b[method];\n }\n return result;\n}","import raf from \"rc-util/es/raf\";\nimport { easeInOutCubic } from './easings';\nimport getScroll, { isWindow } from './getScroll';\nexport default function scrollTo(y) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$getContainer = options.getContainer,\n getContainer = _options$getContainer === void 0 ? function () {\n return window;\n } : _options$getContainer,\n callback = options.callback,\n _options$duration = options.duration,\n duration = _options$duration === void 0 ? 450 : _options$duration;\n var container = getContainer();\n var scrollTop = getScroll(container, true);\n var startTime = Date.now();\n var frameFunc = function frameFunc() {\n var timestamp = Date.now();\n var time = timestamp - startTime;\n var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);\n if (isWindow(container)) {\n container.scrollTo(window.pageXOffset, nextScrollTop);\n } else if (container instanceof Document || container.constructor.name === 'HTMLDocument') {\n container.documentElement.scrollTop = nextScrollTop;\n } else {\n container.scrollTop = nextScrollTop;\n }\n if (time < duration) {\n raf(frameFunc);\n } else if (typeof callback === 'function') {\n callback();\n }\n };\n raf(frameFunc);\n}","// eslint-disable-next-line import/prefer-default-export\nexport function easeInOutCubic(t, b, c, d) {\n var cc = c - b;\n t /= d / 2;\n if (t < 1) {\n return cc / 2 * t * t * t + b;\n }\n // eslint-disable-next-line no-return-assign\n return cc / 2 * ((t -= 2) * t * t + 2) + b;\n}","/* istanbul ignore next */\n/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */\n// eslint-disable-next-line no-unused-vars\nfunction Column(_) {\n return null;\n}\nexport default Column;","/* istanbul ignore next */\n/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */\n// eslint-disable-next-line no-unused-vars\nfunction ColumnGroup(_) {\n return null;\n}\nexport default ColumnGroup;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nfunction renderExpandIcon(locale) {\n return function expandIcon(_ref) {\n var prefixCls = _ref.prefixCls,\n onExpand = _ref.onExpand,\n record = _ref.record,\n expanded = _ref.expanded,\n expandable = _ref.expandable;\n var iconPrefix = \"\".concat(prefixCls, \"-row-expand-icon\");\n return /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: function onClick(e) {\n onExpand(record, e);\n e.stopPropagation();\n },\n className: classNames(iconPrefix, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(iconPrefix, \"-spaced\"), !expandable), \"\".concat(iconPrefix, \"-expanded\"), expandable && expanded), \"\".concat(iconPrefix, \"-collapsed\"), expandable && !expanded)),\n \"aria-label\": expanded ? locale.collapse : locale.expand,\n \"aria-expanded\": expanded\n });\n };\n}\nexport default renderExpandIcon;","export function getColumnKey(column, defaultKey) {\n if ('key' in column && column.key !== undefined && column.key !== null) {\n return column.key;\n }\n if (column.dataIndex) {\n return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;\n }\n return defaultKey;\n}\nexport function getColumnPos(index, pos) {\n return pos ? \"\".concat(pos, \"-\").concat(index) : \"\".concat(index);\n}\nexport function renderColumnTitle(title, props) {\n if (typeof title === 'function') {\n return title(props);\n }\n return title;\n}\n/**\n * Safe get column title\n *\n * Should filter [object Object]\n *\n * @param title\n * @returns\n */\nexport function safeColumnTitle(title, props) {\n var res = renderColumnTitle(title, props);\n if (Object.prototype.toString.call(res) === '[object Object]') return '';\n return res;\n}","// This icon file is generated automatically.\nvar FilterFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z\" } }] }, \"name\": \"filter\", \"theme\": \"filled\" };\nexport default FilterFilled;\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 FilterFilledSvg from \"@ant-design/icons-svg/es/asn/FilterFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar FilterFilled = function FilterFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FilterFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FilterFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FilterFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar HolderOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z\" } }] }, \"name\": \"holder\", \"theme\": \"outlined\" };\nexport default HolderOutlined;\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 HolderOutlinedSvg from \"@ant-design/icons-svg/es/asn/HolderOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar HolderOutlined = function HolderOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: HolderOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(HolderOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'HolderOutlined';\n}\nexport default RefIcon;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React from 'react';\nexport var offset = 4;\nexport default function dropIndicatorRender(props) {\n var dropPosition = props.dropPosition,\n dropLevelOffset = props.dropLevelOffset,\n prefixCls = props.prefixCls,\n indent = props.indent,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? 'ltr' : _props$direction;\n var startPosition = direction === 'ltr' ? 'left' : 'right';\n var endPosition = direction === 'ltr' ? 'right' : 'left';\n var style = _defineProperty(_defineProperty({}, startPosition, -dropLevelOffset * indent + offset), endPosition, 0);\n switch (dropPosition) {\n case -1:\n style.top = -3;\n break;\n case 1:\n style.bottom = -3;\n break;\n default:\n // dropPosition === 0\n style.bottom = -3;\n style[startPosition] = indent + offset;\n break;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style,\n className: \"\".concat(prefixCls, \"-drop-indicator\")\n });\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport collapseMotion from '../_util/motion';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport renderSwitcherIcon from './utils/iconUtil';\nvar Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction,\n virtual = _React$useContext.virtual;\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n _props$showIcon = props.showIcon,\n showIcon = _props$showIcon === void 0 ? false : _props$showIcon,\n showLine = props.showLine,\n _switcherIcon = props.switcherIcon,\n _props$blockNode = props.blockNode,\n blockNode = _props$blockNode === void 0 ? false : _props$blockNode,\n children = props.children,\n _props$checkable = props.checkable,\n checkable = _props$checkable === void 0 ? false : _props$checkable,\n _props$selectable = props.selectable,\n selectable = _props$selectable === void 0 ? true : _props$selectable,\n draggable = props.draggable,\n _props$motion = props.motion,\n motion = _props$motion === void 0 ? _extends(_extends({}, collapseMotion), {\n motionAppear: false\n }) : _props$motion;\n var prefixCls = getPrefixCls('tree', customizePrefixCls);\n var newProps = _extends(_extends({}, props), {\n checkable: checkable,\n selectable: selectable,\n showIcon: showIcon,\n motion: motion,\n blockNode: blockNode,\n showLine: Boolean(showLine),\n dropIndicatorRender: dropIndicatorRender\n });\n var draggableConfig = React.useMemo(function () {\n if (!draggable) {\n return false;\n }\n var mergedDraggable = {};\n switch (_typeof(draggable)) {\n case 'function':\n mergedDraggable.nodeDraggable = draggable;\n break;\n case 'object':\n mergedDraggable = _extends({}, draggable);\n break;\n default:\n break;\n // Do nothing\n }\n if (mergedDraggable.icon !== false) {\n mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n }\n return mergedDraggable;\n }, [draggable]);\n return /*#__PURE__*/React.createElement(RcTree, _extends({\n itemHeight: 20,\n ref: ref,\n virtual: virtual\n }, newProps, {\n prefixCls: prefixCls,\n className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-icon-hide\"), !showIcon), \"\".concat(prefixCls, \"-block-node\"), blockNode), \"\".concat(prefixCls, \"-unselectable\"), !selectable), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className),\n direction: direction,\n checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-checkbox-inner\")\n }) : checkable,\n selectable: selectable,\n switcherIcon: function switcherIcon(nodeProps) {\n return renderSwitcherIcon(prefixCls, _switcherIcon, showLine, nodeProps);\n },\n draggable: draggableConfig\n }), children);\n});\nexport default Tree;","// This icon file is generated automatically.\nvar FolderOpenOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z\" } }] }, \"name\": \"folder-open\", \"theme\": \"outlined\" };\nexport default FolderOpenOutlined;\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 FolderOpenOutlinedSvg from \"@ant-design/icons-svg/es/asn/FolderOpenOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FolderOpenOutlined = function FolderOpenOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FolderOpenOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FolderOpenOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FolderOpenOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar FolderOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z\" } }] }, \"name\": \"folder\", \"theme\": \"outlined\" };\nexport default FolderOutlined;\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 FolderOutlinedSvg from \"@ant-design/icons-svg/es/asn/FolderOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FolderOutlined = function FolderOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FolderOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FolderOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FolderOutlined';\n}\nexport default RefIcon;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar Record;\n(function (Record) {\n Record[Record[\"None\"] = 0] = \"None\";\n Record[Record[\"Start\"] = 1] = \"Start\";\n Record[Record[\"End\"] = 2] = \"End\";\n})(Record || (Record = {}));\nfunction traverseNodesKey(treeData, callback) {\n function processNode(dataNode) {\n var key = dataNode.key,\n children = dataNode.children;\n if (callback(key, dataNode) !== false) {\n traverseNodesKey(children || [], callback);\n }\n }\n treeData.forEach(processNode);\n}\n/** 计算选中范围,只考虑expanded情况以优化性能 */\nexport function calcRangeKeys(_ref) {\n var treeData = _ref.treeData,\n expandedKeys = _ref.expandedKeys,\n startKey = _ref.startKey,\n endKey = _ref.endKey;\n var keys = [];\n var record = Record.None;\n if (startKey && startKey === endKey) {\n return [startKey];\n }\n if (!startKey || !endKey) {\n return [];\n }\n function matchKey(key) {\n return key === startKey || key === endKey;\n }\n traverseNodesKey(treeData, function (key) {\n if (record === Record.End) {\n return false;\n }\n if (matchKey(key)) {\n // Match test\n keys.push(key);\n if (record === Record.None) {\n record = Record.Start;\n } else if (record === Record.Start) {\n record = Record.End;\n return false;\n }\n } else if (record === Record.Start) {\n // Append selection\n keys.push(key);\n }\n return expandedKeys.includes(key);\n });\n return keys;\n}\nexport function convertDirectoryKeysToNodes(treeData, keys) {\n var restKeys = _toConsumableArray(keys);\n var nodes = [];\n traverseNodesKey(treeData, function (key, node) {\n var index = restKeys.indexOf(key);\n if (index !== -1) {\n nodes.push(node);\n restKeys.splice(index, 1);\n }\n return !!restKeys.length;\n });\n return nodes;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport FileOutlined from \"@ant-design/icons/es/icons/FileOutlined\";\nimport FolderOpenOutlined from \"@ant-design/icons/es/icons/FolderOpenOutlined\";\nimport FolderOutlined from \"@ant-design/icons/es/icons/FolderOutlined\";\nimport classNames from 'classnames';\nimport { conductExpandParent } from \"rc-tree/es/util\";\nimport { convertDataToEntities, convertTreeToData } from \"rc-tree/es/utils/treeUtil\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Tree from './Tree';\nimport { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';\nfunction getIcon(props) {\n var isLeaf = props.isLeaf,\n expanded = props.expanded;\n if (isLeaf) {\n return /*#__PURE__*/React.createElement(FileOutlined, null);\n }\n return expanded ? /*#__PURE__*/React.createElement(FolderOpenOutlined, null) : /*#__PURE__*/React.createElement(FolderOutlined, null);\n}\nfunction getTreeData(_ref) {\n var treeData = _ref.treeData,\n children = _ref.children;\n return treeData || convertTreeToData(children);\n}\nvar DirectoryTree = function DirectoryTree(_a, ref) {\n var defaultExpandAll = _a.defaultExpandAll,\n defaultExpandParent = _a.defaultExpandParent,\n defaultExpandedKeys = _a.defaultExpandedKeys,\n props = __rest(_a, [\"defaultExpandAll\", \"defaultExpandParent\", \"defaultExpandedKeys\"]);\n // Shift click usage\n var lastSelectedKey = React.useRef();\n var cachedSelectedKeys = React.useRef();\n var getInitExpandedKeys = function getInitExpandedKeys() {\n var _convertDataToEntitie = convertDataToEntities(getTreeData(props)),\n keyEntities = _convertDataToEntitie.keyEntities;\n var initExpandedKeys;\n // Expanded keys\n if (defaultExpandAll) {\n initExpandedKeys = Object.keys(keyEntities);\n } else if (defaultExpandParent) {\n initExpandedKeys = conductExpandParent(props.expandedKeys || defaultExpandedKeys || [], keyEntities);\n } else {\n initExpandedKeys = props.expandedKeys || defaultExpandedKeys;\n }\n return initExpandedKeys;\n };\n var _React$useState = React.useState(props.selectedKeys || props.defaultSelectedKeys || []),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n selectedKeys = _React$useState2[0],\n setSelectedKeys = _React$useState2[1];\n var _React$useState3 = React.useState(function () {\n return getInitExpandedKeys();\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n expandedKeys = _React$useState4[0],\n setExpandedKeys = _React$useState4[1];\n React.useEffect(function () {\n if ('selectedKeys' in props) {\n setSelectedKeys(props.selectedKeys);\n }\n }, [props.selectedKeys]);\n React.useEffect(function () {\n if ('expandedKeys' in props) {\n setExpandedKeys(props.expandedKeys);\n }\n }, [props.expandedKeys]);\n var onExpand = function onExpand(keys, info) {\n var _a;\n if (!('expandedKeys' in props)) {\n setExpandedKeys(keys);\n }\n // Call origin function\n return (_a = props.onExpand) === null || _a === void 0 ? void 0 : _a.call(props, keys, info);\n };\n var onSelect = function onSelect(keys, event) {\n var _a;\n var multiple = props.multiple;\n var node = event.node,\n nativeEvent = event.nativeEvent;\n var _node$key = node.key,\n key = _node$key === void 0 ? '' : _node$key;\n var treeData = getTreeData(props);\n // const newState: DirectoryTreeState = {};\n // We need wrap this event since some value is not same\n var newEvent = _extends(_extends({}, event), {\n selected: true\n });\n // Windows / Mac single pick\n var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);\n var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;\n // Generate new selected keys\n var newSelectedKeys;\n if (multiple && ctrlPick) {\n // Control click\n newSelectedKeys = keys;\n lastSelectedKey.current = key;\n cachedSelectedKeys.current = newSelectedKeys;\n newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);\n } else if (multiple && shiftPick) {\n // Shift click\n newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray(cachedSelectedKeys.current || []), _toConsumableArray(calcRangeKeys({\n treeData: treeData,\n expandedKeys: expandedKeys,\n startKey: key,\n endKey: lastSelectedKey.current\n })))));\n newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);\n } else {\n // Single click\n newSelectedKeys = [key];\n lastSelectedKey.current = key;\n cachedSelectedKeys.current = newSelectedKeys;\n newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);\n }\n (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, newSelectedKeys, newEvent);\n if (!('selectedKeys' in props)) {\n setSelectedKeys(newSelectedKeys);\n }\n };\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n _props$showIcon = props.showIcon,\n showIcon = _props$showIcon === void 0 ? true : _props$showIcon,\n _props$expandAction = props.expandAction,\n expandAction = _props$expandAction === void 0 ? 'click' : _props$expandAction,\n otherProps = __rest(props, [\"prefixCls\", \"className\", \"showIcon\", \"expandAction\"]);\n var prefixCls = getPrefixCls('tree', customizePrefixCls);\n var connectClassName = classNames(\"\".concat(prefixCls, \"-directory\"), _defineProperty({}, \"\".concat(prefixCls, \"-directory-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(Tree, _extends({\n icon: getIcon,\n ref: ref,\n blockNode: true\n }, otherProps, {\n showIcon: showIcon,\n expandAction: expandAction,\n prefixCls: prefixCls,\n className: connectClassName,\n expandedKeys: expandedKeys,\n selectedKeys: selectedKeys,\n onSelect: onSelect,\n onExpand: onExpand\n }));\n};\nvar ForwardDirectoryTree = /*#__PURE__*/React.forwardRef(DirectoryTree);\nif (process.env.NODE_ENV !== 'production') {\n ForwardDirectoryTree.displayName = 'DirectoryTree';\n}\nexport default ForwardDirectoryTree;","import { TreeNode } from 'rc-tree';\nimport TreePure from './Tree';\nimport DirectoryTree from './DirectoryTree';\nvar Tree = TreePure;\nTree.DirectoryTree = DirectoryTree;\nTree.TreeNode = TreeNode;\nexport default Tree;","import SearchOutlined from \"@ant-design/icons/es/icons/SearchOutlined\";\nimport * as React from 'react';\nimport Input from '../../../input';\nfunction FilterSearch(_ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n filterSearch = _ref.filterSearch,\n tablePrefixCls = _ref.tablePrefixCls,\n locale = _ref.locale;\n if (!filterSearch) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(tablePrefixCls, \"-filter-dropdown-search\")\n }, /*#__PURE__*/React.createElement(Input, {\n prefix: /*#__PURE__*/React.createElement(SearchOutlined, null),\n placeholder: locale.filterSearchPlaceholder,\n onChange: onChange,\n value: value,\n // for skip min-width of input\n htmlSize: 1,\n className: \"\".concat(tablePrefixCls, \"-filter-dropdown-search-input\")\n }));\n}\nexport default FilterSearch;","import * as React from 'react';\nimport KeyCode from \"rc-util/es/KeyCode\";\nvar onKeyDown = function onKeyDown(event) {\n var keyCode = event.keyCode;\n if (keyCode === KeyCode.ENTER) {\n event.stopPropagation();\n }\n};\nvar FilterDropdownMenuWrapper = function FilterDropdownMenuWrapper(props) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: props.className,\n onClick: function onClick(e) {\n return e.stopPropagation();\n },\n onKeyDown: onKeyDown\n }, props.children);\n};\nexport default FilterDropdownMenuWrapper;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport FilterFilled from \"@ant-design/icons/es/icons/FilterFilled\";\nimport classNames from 'classnames';\nimport isEqual from 'lodash/isEqual';\nimport * as React from 'react';\nimport { flattenKeys } from '.';\nimport Button from '../../../button';\nimport Checkbox from '../../../checkbox';\nimport { ConfigContext } from '../../../config-provider/context';\nimport Dropdown from '../../../dropdown';\nimport Empty from '../../../empty';\nimport Menu from '../../../menu';\nimport { OverrideProvider } from '../../../menu/OverrideContext';\nimport Radio from '../../../radio';\nimport Tree from '../../../tree';\nimport useSyncState from '../../../_util/hooks/useSyncState';\nimport FilterSearch from './FilterSearch';\nimport FilterDropdownMenuWrapper from './FilterWrapper';\nfunction hasSubMenu(filters) {\n return filters.some(function (_ref) {\n var children = _ref.children;\n return children;\n });\n}\nfunction searchValueMatched(searchValue, text) {\n if (typeof text === 'string' || typeof text === 'number') {\n return text === null || text === void 0 ? void 0 : text.toString().toLowerCase().includes(searchValue.trim().toLowerCase());\n }\n return false;\n}\nfunction renderFilterItems(_ref2) {\n var filters = _ref2.filters,\n prefixCls = _ref2.prefixCls,\n filteredKeys = _ref2.filteredKeys,\n filterMultiple = _ref2.filterMultiple,\n searchValue = _ref2.searchValue,\n filterSearch = _ref2.filterSearch;\n return filters.map(function (filter, index) {\n var key = String(filter.value);\n if (filter.children) {\n return {\n key: key || index,\n label: filter.text,\n popupClassName: \"\".concat(prefixCls, \"-dropdown-submenu\"),\n children: renderFilterItems({\n filters: filter.children,\n prefixCls: prefixCls,\n filteredKeys: filteredKeys,\n filterMultiple: filterMultiple,\n searchValue: searchValue,\n filterSearch: filterSearch\n })\n };\n }\n var Component = filterMultiple ? Checkbox : Radio;\n var item = {\n key: filter.value !== undefined ? key : index,\n label: ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, {\n checked: filteredKeys.includes(key)\n }), /*#__PURE__*/React.createElement(\"span\", null, filter.text)))\n };\n if (searchValue.trim()) {\n if (typeof filterSearch === 'function') {\n return filterSearch(searchValue, filter) ? item : null;\n }\n return searchValueMatched(searchValue, filter.text) ? item : null;\n }\n return item;\n });\n}\nfunction wrapStringListType(keys) {\n return keys || [];\n}\nfunction FilterDropdown(props) {\n var _a;\n var tablePrefixCls = props.tablePrefixCls,\n prefixCls = props.prefixCls,\n column = props.column,\n dropdownPrefixCls = props.dropdownPrefixCls,\n columnKey = props.columnKey,\n filterMultiple = props.filterMultiple,\n _props$filterMode = props.filterMode,\n filterMode = _props$filterMode === void 0 ? 'menu' : _props$filterMode,\n _props$filterSearch = props.filterSearch,\n filterSearch = _props$filterSearch === void 0 ? false : _props$filterSearch,\n filterState = props.filterState,\n triggerFilter = props.triggerFilter,\n locale = props.locale,\n children = props.children,\n getPopupContainer = props.getPopupContainer;\n var filterDropdownOpen = column.filterDropdownOpen,\n onFilterDropdownOpenChange = column.onFilterDropdownOpenChange,\n filterDropdownVisible = column.filterDropdownVisible,\n onFilterDropdownVisibleChange = column.onFilterDropdownVisibleChange,\n filterResetToDefaultFilteredValue = column.filterResetToDefaultFilteredValue,\n defaultFilteredValue = column.defaultFilteredValue;\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n var filtered = !!(filterState && (((_a = filterState.filteredKeys) === null || _a === void 0 ? void 0 : _a.length) || filterState.forceFiltered));\n var triggerVisible = function triggerVisible(newVisible) {\n setVisible(newVisible);\n onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 ? void 0 : onFilterDropdownOpenChange(newVisible);\n onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 ? void 0 : onFilterDropdownVisibleChange(newVisible);\n };\n var mergedVisible;\n if (typeof filterDropdownOpen === 'boolean') {\n mergedVisible = filterDropdownOpen;\n } else {\n mergedVisible = typeof filterDropdownVisible === 'boolean' ? filterDropdownVisible : visible;\n }\n // ===================== Select Keys =====================\n var propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;\n var _useSyncState = useSyncState(wrapStringListType(propFilteredKeys)),\n _useSyncState2 = _slicedToArray(_useSyncState, 2),\n getFilteredKeysSync = _useSyncState2[0],\n setFilteredKeysSync = _useSyncState2[1];\n var onSelectKeys = function onSelectKeys(_ref3) {\n var selectedKeys = _ref3.selectedKeys;\n setFilteredKeysSync(selectedKeys);\n };\n var onCheck = function onCheck(keys, _ref4) {\n var node = _ref4.node,\n checked = _ref4.checked;\n if (!filterMultiple) {\n onSelectKeys({\n selectedKeys: checked && node.key ? [node.key] : []\n });\n } else {\n onSelectKeys({\n selectedKeys: keys\n });\n }\n };\n React.useEffect(function () {\n if (!visible) {\n return;\n }\n onSelectKeys({\n selectedKeys: wrapStringListType(propFilteredKeys)\n });\n }, [propFilteredKeys]);\n // ====================== Open Keys ======================\n var _React$useState3 = React.useState([]),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n openKeys = _React$useState4[0],\n setOpenKeys = _React$useState4[1];\n var onOpenChange = function onOpenChange(keys) {\n setOpenKeys(keys);\n };\n // search in tree mode column filter\n var _React$useState5 = React.useState(''),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n searchValue = _React$useState6[0],\n setSearchValue = _React$useState6[1];\n var onSearch = function onSearch(e) {\n var value = e.target.value;\n setSearchValue(value);\n };\n // clear search value after close filter dropdown\n React.useEffect(function () {\n if (!visible) {\n setSearchValue('');\n }\n }, [visible]);\n // ======================= Submit ========================\n var internalTriggerFilter = function internalTriggerFilter(keys) {\n var mergedKeys = keys && keys.length ? keys : null;\n if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {\n return null;\n }\n if (isEqual(mergedKeys, filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys)) {\n return null;\n }\n triggerFilter({\n column: column,\n key: columnKey,\n filteredKeys: mergedKeys\n });\n };\n var onConfirm = function onConfirm() {\n triggerVisible(false);\n internalTriggerFilter(getFilteredKeysSync());\n };\n var onReset = function onReset() {\n var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n confirm: false,\n closeDropdown: false\n },\n confirm = _ref5.confirm,\n closeDropdown = _ref5.closeDropdown;\n if (confirm) {\n internalTriggerFilter([]);\n }\n if (closeDropdown) {\n triggerVisible(false);\n }\n setSearchValue('');\n if (filterResetToDefaultFilteredValue) {\n setFilteredKeysSync((defaultFilteredValue || []).map(function (key) {\n return String(key);\n }));\n } else {\n setFilteredKeysSync([]);\n }\n };\n var doFilter = function doFilter() {\n var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n closeDropdown: true\n },\n closeDropdown = _ref6.closeDropdown;\n if (closeDropdown) {\n triggerVisible(false);\n }\n internalTriggerFilter(getFilteredKeysSync());\n };\n var onVisibleChange = function onVisibleChange(newVisible) {\n if (newVisible && propFilteredKeys !== undefined) {\n // Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefiend)\n setFilteredKeysSync(wrapStringListType(propFilteredKeys));\n }\n triggerVisible(newVisible);\n // Default will filter when closed\n if (!newVisible && !column.filterDropdown) {\n onConfirm();\n }\n };\n // ======================== Style ========================\n var dropdownMenuClass = classNames(_defineProperty({}, \"\".concat(dropdownPrefixCls, \"-menu-without-submenu\"), !hasSubMenu(column.filters || [])));\n var onCheckAll = function onCheckAll(e) {\n if (e.target.checked) {\n var allFilterKeys = flattenKeys(column === null || column === void 0 ? void 0 : column.filters).map(function (key) {\n return String(key);\n });\n setFilteredKeysSync(allFilterKeys);\n } else {\n setFilteredKeysSync([]);\n }\n };\n var getTreeData = function getTreeData(_ref7) {\n var filters = _ref7.filters;\n return (filters || []).map(function (filter, index) {\n var key = String(filter.value);\n var item = {\n title: filter.text,\n key: filter.value !== undefined ? key : String(index)\n };\n if (filter.children) {\n item.children = getTreeData({\n filters: filter.children\n });\n }\n return item;\n });\n };\n var getFilterData = function getFilterData(node) {\n var _a;\n return _extends(_extends({}, node), {\n text: node.title,\n value: node.key,\n children: ((_a = node.children) === null || _a === void 0 ? void 0 : _a.map(function (item) {\n return getFilterData(item);\n })) || []\n });\n };\n var dropdownContent;\n if (typeof column.filterDropdown === 'function') {\n dropdownContent = column.filterDropdown({\n prefixCls: \"\".concat(dropdownPrefixCls, \"-custom\"),\n setSelectedKeys: function setSelectedKeys(selectedKeys) {\n return onSelectKeys({\n selectedKeys: selectedKeys\n });\n },\n selectedKeys: getFilteredKeysSync(),\n confirm: doFilter,\n clearFilters: onReset,\n filters: column.filters,\n visible: mergedVisible,\n close: function close() {\n triggerVisible(false);\n }\n });\n } else if (column.filterDropdown) {\n dropdownContent = column.filterDropdown;\n } else {\n var selectedKeys = getFilteredKeysSync() || [];\n var getFilterComponent = function getFilterComponent() {\n if ((column.filters || []).length === 0) {\n return /*#__PURE__*/React.createElement(Empty, {\n image: Empty.PRESENTED_IMAGE_SIMPLE,\n description: locale.filterEmptyText,\n imageStyle: {\n height: 24\n },\n style: {\n margin: 0,\n padding: '16px 0'\n }\n });\n }\n if (filterMode === 'tree') {\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterSearch, {\n filterSearch: filterSearch,\n value: searchValue,\n onChange: onSearch,\n tablePrefixCls: tablePrefixCls,\n locale: locale\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(tablePrefixCls, \"-filter-dropdown-tree\")\n }, filterMultiple ? ( /*#__PURE__*/React.createElement(Checkbox, {\n checked: selectedKeys.length === flattenKeys(column.filters).length,\n indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,\n className: \"\".concat(tablePrefixCls, \"-filter-dropdown-checkall\"),\n onChange: onCheckAll\n }, locale.filterCheckall)) : null, /*#__PURE__*/React.createElement(Tree, {\n checkable: true,\n selectable: false,\n blockNode: true,\n multiple: filterMultiple,\n checkStrictly: !filterMultiple,\n className: \"\".concat(dropdownPrefixCls, \"-menu\"),\n onCheck: onCheck,\n checkedKeys: selectedKeys,\n selectedKeys: selectedKeys,\n showIcon: false,\n treeData: getTreeData({\n filters: column.filters\n }),\n autoExpandParent: true,\n defaultExpandAll: true,\n filterTreeNode: searchValue.trim() ? function (node) {\n if (typeof filterSearch === 'function') {\n return filterSearch(searchValue, getFilterData(node));\n }\n return searchValueMatched(searchValue, node.title);\n } : undefined\n })));\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterSearch, {\n filterSearch: filterSearch,\n value: searchValue,\n onChange: onSearch,\n tablePrefixCls: tablePrefixCls,\n locale: locale\n }), /*#__PURE__*/React.createElement(Menu, {\n selectable: true,\n multiple: filterMultiple,\n prefixCls: \"\".concat(dropdownPrefixCls, \"-menu\"),\n className: dropdownMenuClass,\n onSelect: onSelectKeys,\n onDeselect: onSelectKeys,\n selectedKeys: selectedKeys,\n getPopupContainer: getPopupContainer,\n openKeys: openKeys,\n onOpenChange: onOpenChange,\n items: renderFilterItems({\n filters: column.filters || [],\n filterSearch: filterSearch,\n prefixCls: prefixCls,\n filteredKeys: getFilteredKeysSync(),\n filterMultiple: filterMultiple,\n searchValue: searchValue\n })\n }));\n };\n var getResetDisabled = function getResetDisabled() {\n if (filterResetToDefaultFilteredValue) {\n return isEqual((defaultFilteredValue || []).map(function (key) {\n return String(key);\n }), selectedKeys);\n }\n return selectedKeys.length === 0;\n };\n dropdownContent = /*#__PURE__*/React.createElement(React.Fragment, null, getFilterComponent(), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-dropdown-btns\")\n }, /*#__PURE__*/React.createElement(Button, {\n type: \"link\",\n size: \"small\",\n disabled: getResetDisabled(),\n onClick: function onClick() {\n return onReset();\n }\n }, locale.filterReset), /*#__PURE__*/React.createElement(Button, {\n type: \"primary\",\n size: \"small\",\n onClick: onConfirm\n }, locale.filterConfirm)));\n }\n // We should not block customize Menu with additional props\n if (column.filterDropdown) {\n dropdownContent = /*#__PURE__*/React.createElement(OverrideProvider, {\n selectable: undefined\n }, dropdownContent);\n }\n var menu = function menu() {\n return /*#__PURE__*/React.createElement(FilterDropdownMenuWrapper, {\n className: \"\".concat(prefixCls, \"-dropdown\")\n }, dropdownContent);\n };\n var filterIcon;\n if (typeof column.filterIcon === 'function') {\n filterIcon = column.filterIcon(filtered);\n } else if (column.filterIcon) {\n filterIcon = column.filterIcon;\n } else {\n filterIcon = /*#__PURE__*/React.createElement(FilterFilled, null);\n }\n var _React$useContext = React.useContext(ConfigContext),\n direction = _React$useContext.direction;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-column\")\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(tablePrefixCls, \"-column-title\")\n }, children), /*#__PURE__*/React.createElement(Dropdown, {\n dropdownRender: menu,\n trigger: ['click'],\n open: mergedVisible,\n onOpenChange: onVisibleChange,\n getPopupContainer: getPopupContainer,\n placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight'\n }, /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n tabIndex: -1,\n className: classNames(\"\".concat(prefixCls, \"-trigger\"), {\n active: filtered\n }),\n onClick: function onClick(e) {\n e.stopPropagation();\n }\n }, filterIcon)));\n}\nexport default FilterDropdown;","import * as React from 'react';\nimport useForceUpdate from './useForceUpdate';\nexport default function useSyncState(initialValue) {\n var ref = React.useRef(initialValue);\n var forceUpdate = useForceUpdate();\n return [function () {\n return ref.current;\n }, function (newValue) {\n ref.current = newValue;\n // re-render\n forceUpdate();\n }];\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\nimport warning from '../../../_util/warning';\nimport { getColumnKey, getColumnPos, renderColumnTitle } from '../../util';\nimport FilterDropdown from './FilterDropdown';\nfunction collectFilterStates(columns, init, pos) {\n var filterStates = [];\n (columns || []).forEach(function (column, index) {\n var _a;\n var columnPos = getColumnPos(index, pos);\n if (column.filters || 'filterDropdown' in column || 'onFilter' in column) {\n if ('filteredValue' in column) {\n // Controlled\n var filteredValues = column.filteredValue;\n if (!('filterDropdown' in column)) {\n filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;\n }\n filterStates.push({\n column: column,\n key: getColumnKey(column, columnPos),\n filteredKeys: filteredValues,\n forceFiltered: column.filtered\n });\n } else {\n // Uncontrolled\n filterStates.push({\n column: column,\n key: getColumnKey(column, columnPos),\n filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : undefined,\n forceFiltered: column.filtered\n });\n }\n }\n if ('children' in column) {\n filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(collectFilterStates(column.children, init, columnPos)));\n }\n });\n return filterStates;\n}\nfunction injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, triggerFilter, getPopupContainer, locale, pos) {\n return columns.map(function (column, index) {\n var columnPos = getColumnPos(index, pos);\n var _column$filterMultipl = column.filterMultiple,\n filterMultiple = _column$filterMultipl === void 0 ? true : _column$filterMultipl,\n filterMode = column.filterMode,\n filterSearch = column.filterSearch;\n var newColumn = column;\n if (newColumn.filters || newColumn.filterDropdown) {\n var columnKey = getColumnKey(newColumn, columnPos);\n var filterState = filterStates.find(function (_ref) {\n var key = _ref.key;\n return columnKey === key;\n });\n newColumn = _extends(_extends({}, newColumn), {\n title: function title(renderProps) {\n return /*#__PURE__*/React.createElement(FilterDropdown, {\n tablePrefixCls: prefixCls,\n prefixCls: \"\".concat(prefixCls, \"-filter\"),\n dropdownPrefixCls: dropdownPrefixCls,\n column: newColumn,\n columnKey: columnKey,\n filterState: filterState,\n filterMultiple: filterMultiple,\n filterMode: filterMode,\n filterSearch: filterSearch,\n triggerFilter: triggerFilter,\n locale: locale,\n getPopupContainer: getPopupContainer\n }, renderColumnTitle(column.title, renderProps));\n }\n });\n }\n if ('children' in newColumn) {\n newColumn = _extends(_extends({}, newColumn), {\n children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, triggerFilter, getPopupContainer, locale, columnPos)\n });\n }\n return newColumn;\n });\n}\nexport function flattenKeys(filters) {\n var keys = [];\n (filters || []).forEach(function (_ref2) {\n var value = _ref2.value,\n children = _ref2.children;\n keys.push(value);\n if (children) {\n keys = [].concat(_toConsumableArray(keys), _toConsumableArray(flattenKeys(children)));\n }\n });\n return keys;\n}\nfunction generateFilterInfo(filterStates) {\n var currentFilters = {};\n filterStates.forEach(function (_ref3) {\n var key = _ref3.key,\n filteredKeys = _ref3.filteredKeys,\n column = _ref3.column;\n var keyAsString = key;\n var filters = column.filters,\n filterDropdown = column.filterDropdown;\n if (filterDropdown) {\n currentFilters[keyAsString] = filteredKeys || null;\n } else if (Array.isArray(filteredKeys)) {\n var keys = flattenKeys(filters);\n currentFilters[keyAsString] = keys.filter(function (originKey) {\n return filteredKeys.includes(String(originKey));\n });\n } else {\n currentFilters[keyAsString] = null;\n }\n });\n return currentFilters;\n}\nexport function getFilterData(data, filterStates) {\n return filterStates.reduce(function (currentData, filterState) {\n var _filterState$column = filterState.column,\n onFilter = _filterState$column.onFilter,\n filters = _filterState$column.filters,\n filteredKeys = filterState.filteredKeys;\n if (onFilter && filteredKeys && filteredKeys.length) {\n return currentData.filter(function (record) {\n return filteredKeys.some(function (key) {\n var keys = flattenKeys(filters);\n var keyIndex = keys.findIndex(function (k) {\n return String(k) === String(key);\n });\n var realKey = keyIndex !== -1 ? keys[keyIndex] : key;\n return onFilter(realKey, record);\n });\n });\n }\n return currentData;\n }, data);\n}\nfunction useFilter(_ref4) {\n var prefixCls = _ref4.prefixCls,\n dropdownPrefixCls = _ref4.dropdownPrefixCls,\n mergedColumns = _ref4.mergedColumns,\n onFilterChange = _ref4.onFilterChange,\n getPopupContainer = _ref4.getPopupContainer,\n tableLocale = _ref4.locale;\n var _React$useState = React.useState(function () {\n return collectFilterStates(mergedColumns, true);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n filterStates = _React$useState2[0],\n setFilterStates = _React$useState2[1];\n var mergedFilterStates = React.useMemo(function () {\n var collectedStates = collectFilterStates(mergedColumns, false);\n var filteredKeysIsAllNotControlled = true;\n var filteredKeysIsAllControlled = true;\n collectedStates.forEach(function (_ref5) {\n var filteredKeys = _ref5.filteredKeys;\n if (filteredKeys !== undefined) {\n filteredKeysIsAllNotControlled = false;\n } else {\n filteredKeysIsAllControlled = false;\n }\n });\n // Return if not controlled\n if (filteredKeysIsAllNotControlled) {\n return filterStates;\n }\n process.env.NODE_ENV !== \"production\" ? warning(filteredKeysIsAllControlled, 'Table', 'Columns should all contain `filteredValue` or not contain `filteredValue`.') : void 0;\n return collectedStates;\n }, [mergedColumns, filterStates]);\n var filters = React.useMemo(function () {\n return generateFilterInfo(mergedFilterStates);\n }, [mergedFilterStates]);\n var triggerFilter = function triggerFilter(filterState) {\n var newFilterStates = mergedFilterStates.filter(function (_ref6) {\n var key = _ref6.key;\n return key !== filterState.key;\n });\n newFilterStates.push(filterState);\n setFilterStates(newFilterStates);\n onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);\n };\n var transformColumns = function transformColumns(innerColumns) {\n return injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, triggerFilter, getPopupContainer, tableLocale);\n };\n return [transformColumns, mergedFilterStates, filters];\n}\nexport default useFilter;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { useState } from 'react';\nexport var DEFAULT_PAGE_SIZE = 10;\nexport function getPaginationParam(pagination, mergedPagination) {\n var param = {\n current: mergedPagination.current,\n pageSize: mergedPagination.pageSize\n };\n var paginationObj = pagination && _typeof(pagination) === 'object' ? pagination : {};\n Object.keys(paginationObj).forEach(function (pageProp) {\n var value = mergedPagination[pageProp];\n if (typeof value !== 'function') {\n param[pageProp] = value;\n }\n });\n return param;\n}\nfunction extendsObject() {\n var result = {};\n for (var _len = arguments.length, list = new Array(_len), _key = 0; _key < _len; _key++) {\n list[_key] = arguments[_key];\n }\n list.forEach(function (obj) {\n if (obj) {\n Object.keys(obj).forEach(function (key) {\n var val = obj[key];\n if (val !== undefined) {\n result[key] = val;\n }\n });\n }\n });\n return result;\n}\nexport default function usePagination(total, pagination, onChange) {\n var _a = pagination && _typeof(pagination) === 'object' ? pagination : {},\n _a$total = _a.total,\n paginationTotal = _a$total === void 0 ? 0 : _a$total,\n paginationObj = __rest(_a, [\"total\"]);\n var _useState = useState(function () {\n return {\n current: 'defaultCurrent' in paginationObj ? paginationObj.defaultCurrent : 1,\n pageSize: 'defaultPageSize' in paginationObj ? paginationObj.defaultPageSize : DEFAULT_PAGE_SIZE\n };\n }),\n _useState2 = _slicedToArray(_useState, 2),\n innerPagination = _useState2[0],\n setInnerPagination = _useState2[1];\n // ============ Basic Pagination Config ============\n var mergedPagination = extendsObject(innerPagination, paginationObj, {\n total: paginationTotal > 0 ? paginationTotal : total\n });\n // Reset `current` if data length or pageSize changed\n var maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);\n if (mergedPagination.current > maxPage) {\n // Prevent a maximum page count of 0\n mergedPagination.current = maxPage || 1;\n }\n var refreshPagination = function refreshPagination(current, pageSize) {\n setInnerPagination({\n current: current !== null && current !== void 0 ? current : 1,\n pageSize: pageSize || mergedPagination.pageSize\n });\n };\n var onInternalChange = function onInternalChange(current, pageSize) {\n var _a;\n if (pagination) {\n (_a = pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, current, pageSize);\n }\n refreshPagination(current, pageSize);\n onChange(current, pageSize || (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize));\n };\n if (pagination === false) {\n return [{}, function () {}];\n }\n return [_extends(_extends({}, mergedPagination), {\n onChange: onInternalChange\n }), refreshPagination];\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toArray from \"@babel/runtime/helpers/esm/toArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport DownOutlined from \"@ant-design/icons/es/icons/DownOutlined\";\nimport { INTERNAL_COL_DEFINE } from 'rc-table';\nimport { arrAdd, arrDel } from \"rc-tree/es/util\";\nimport { conductCheck } from \"rc-tree/es/utils/conductUtil\";\nimport { convertDataToEntities } from \"rc-tree/es/utils/treeUtil\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { useCallback, useMemo, useState } from 'react';\nimport Checkbox from '../../checkbox';\nimport Dropdown from '../../dropdown';\nimport Radio from '../../radio';\nimport warning from '../../_util/warning';\n// TODO: warning if use ajax!!!\nexport var SELECTION_COLUMN = {};\nexport var SELECTION_ALL = 'SELECT_ALL';\nexport var SELECTION_INVERT = 'SELECT_INVERT';\nexport var SELECTION_NONE = 'SELECT_NONE';\nvar EMPTY_LIST = [];\nfunction flattenData(data, childrenColumnName) {\n var list = [];\n (data || []).forEach(function (record) {\n list.push(record);\n if (record && _typeof(record) === 'object' && childrenColumnName in record) {\n list = [].concat(_toConsumableArray(list), _toConsumableArray(flattenData(record[childrenColumnName], childrenColumnName)));\n }\n });\n return list;\n}\nexport default function useSelection(rowSelection, config) {\n var _ref = rowSelection || {},\n preserveSelectedRowKeys = _ref.preserveSelectedRowKeys,\n selectedRowKeys = _ref.selectedRowKeys,\n defaultSelectedRowKeys = _ref.defaultSelectedRowKeys,\n getCheckboxProps = _ref.getCheckboxProps,\n onSelectionChange = _ref.onChange,\n onSelect = _ref.onSelect,\n onSelectAll = _ref.onSelectAll,\n onSelectInvert = _ref.onSelectInvert,\n onSelectNone = _ref.onSelectNone,\n onSelectMultiple = _ref.onSelectMultiple,\n selectionColWidth = _ref.columnWidth,\n selectionType = _ref.type,\n selections = _ref.selections,\n fixed = _ref.fixed,\n customizeRenderCell = _ref.renderCell,\n hideSelectAll = _ref.hideSelectAll,\n _ref$checkStrictly = _ref.checkStrictly,\n checkStrictly = _ref$checkStrictly === void 0 ? true : _ref$checkStrictly;\n var prefixCls = config.prefixCls,\n data = config.data,\n pageData = config.pageData,\n getRecordByKey = config.getRecordByKey,\n getRowKey = config.getRowKey,\n expandType = config.expandType,\n childrenColumnName = config.childrenColumnName,\n tableLocale = config.locale,\n getPopupContainer = config.getPopupContainer;\n // ========================= Keys =========================\n var _useMergedState = useMergedState(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST, {\n value: selectedRowKeys\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedSelectedKeys = _useMergedState2[0],\n setMergedSelectedKeys = _useMergedState2[1];\n // ======================== Caches ========================\n var preserveRecordsRef = React.useRef(new Map());\n var updatePreserveRecordsCache = useCallback(function (keys) {\n if (preserveSelectedRowKeys) {\n var newCache = new Map();\n // Keep key if mark as preserveSelectedRowKeys\n keys.forEach(function (key) {\n var record = getRecordByKey(key);\n if (!record && preserveRecordsRef.current.has(key)) {\n record = preserveRecordsRef.current.get(key);\n }\n newCache.set(key, record);\n });\n // Refresh to new cache\n preserveRecordsRef.current = newCache;\n }\n }, [getRecordByKey, preserveSelectedRowKeys]);\n // Update cache with selectedKeys\n React.useEffect(function () {\n updatePreserveRecordsCache(mergedSelectedKeys);\n }, [mergedSelectedKeys]);\n var _useMemo = useMemo(function () {\n return checkStrictly ? {\n keyEntities: null\n } : convertDataToEntities(data, {\n externalGetKey: getRowKey,\n childrenPropName: childrenColumnName\n });\n }, [data, getRowKey, checkStrictly, childrenColumnName]),\n keyEntities = _useMemo.keyEntities;\n // Get flatten data\n var flattedData = useMemo(function () {\n return flattenData(pageData, childrenColumnName);\n }, [pageData, childrenColumnName]);\n // Get all checkbox props\n var checkboxPropsMap = useMemo(function () {\n var map = new Map();\n flattedData.forEach(function (record, index) {\n var key = getRowKey(record, index);\n var checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};\n map.set(key, checkboxProps);\n process.env.NODE_ENV !== \"production\" ? warning(!('checked' in checkboxProps || 'defaultChecked' in checkboxProps), 'Table', 'Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead.') : void 0;\n });\n return map;\n }, [flattedData, getRowKey, getCheckboxProps]);\n var isCheckboxDisabled = useCallback(function (r) {\n var _a;\n return !!((_a = checkboxPropsMap.get(getRowKey(r))) === null || _a === void 0 ? void 0 : _a.disabled);\n }, [checkboxPropsMap, getRowKey]);\n var _useMemo2 = useMemo(function () {\n if (checkStrictly) {\n return [mergedSelectedKeys || [], []];\n }\n var _conductCheck = conductCheck(mergedSelectedKeys, true, keyEntities, isCheckboxDisabled),\n checkedKeys = _conductCheck.checkedKeys,\n halfCheckedKeys = _conductCheck.halfCheckedKeys;\n return [checkedKeys || [], halfCheckedKeys];\n }, [mergedSelectedKeys, checkStrictly, keyEntities, isCheckboxDisabled]),\n _useMemo3 = _slicedToArray(_useMemo2, 2),\n derivedSelectedKeys = _useMemo3[0],\n derivedHalfSelectedKeys = _useMemo3[1];\n var derivedSelectedKeySet = useMemo(function () {\n var keys = selectionType === 'radio' ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;\n return new Set(keys);\n }, [derivedSelectedKeys, selectionType]);\n var derivedHalfSelectedKeySet = useMemo(function () {\n return selectionType === 'radio' ? new Set() : new Set(derivedHalfSelectedKeys);\n }, [derivedHalfSelectedKeys, selectionType]);\n // Save last selected key to enable range selection\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n lastSelectedKey = _useState2[0],\n setLastSelectedKey = _useState2[1];\n // Reset if rowSelection reset\n React.useEffect(function () {\n if (!rowSelection) {\n setMergedSelectedKeys(EMPTY_LIST);\n }\n }, [!!rowSelection]);\n var setSelectedKeys = useCallback(function (keys, method) {\n var availableKeys;\n var records;\n updatePreserveRecordsCache(keys);\n if (preserveSelectedRowKeys) {\n availableKeys = keys;\n records = keys.map(function (key) {\n return preserveRecordsRef.current.get(key);\n });\n } else {\n // Filter key which not exist in the `dataSource`\n availableKeys = [];\n records = [];\n keys.forEach(function (key) {\n var record = getRecordByKey(key);\n if (record !== undefined) {\n availableKeys.push(key);\n records.push(record);\n }\n });\n }\n setMergedSelectedKeys(availableKeys);\n onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(availableKeys, records, {\n type: method\n });\n }, [setMergedSelectedKeys, getRecordByKey, onSelectionChange, preserveSelectedRowKeys]);\n // ====================== Selections ======================\n // Trigger single `onSelect` event\n var triggerSingleSelection = useCallback(function (key, selected, keys, event) {\n if (onSelect) {\n var rows = keys.map(function (k) {\n return getRecordByKey(k);\n });\n onSelect(getRecordByKey(key), selected, rows, event);\n }\n setSelectedKeys(keys, 'single');\n }, [onSelect, getRecordByKey, setSelectedKeys]);\n var mergedSelections = useMemo(function () {\n if (!selections || hideSelectAll) {\n return null;\n }\n var selectionList = selections === true ? [SELECTION_ALL, SELECTION_INVERT, SELECTION_NONE] : selections;\n return selectionList.map(function (selection) {\n if (selection === SELECTION_ALL) {\n return {\n key: 'all',\n text: tableLocale.selectionAll,\n onSelect: function onSelect() {\n setSelectedKeys(data.map(function (record, index) {\n return getRowKey(record, index);\n }).filter(function (key) {\n var checkProps = checkboxPropsMap.get(key);\n return !(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled) || derivedSelectedKeySet.has(key);\n }), 'all');\n }\n };\n }\n if (selection === SELECTION_INVERT) {\n return {\n key: 'invert',\n text: tableLocale.selectInvert,\n onSelect: function onSelect() {\n var keySet = new Set(derivedSelectedKeySet);\n pageData.forEach(function (record, index) {\n var key = getRowKey(record, index);\n var checkProps = checkboxPropsMap.get(key);\n if (!(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled)) {\n if (keySet.has(key)) {\n keySet[\"delete\"](key);\n } else {\n keySet.add(key);\n }\n }\n });\n var keys = Array.from(keySet);\n if (onSelectInvert) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Table', '`onSelectInvert` will be removed in future. Please use `onChange` instead.') : void 0;\n onSelectInvert(keys);\n }\n setSelectedKeys(keys, 'invert');\n }\n };\n }\n if (selection === SELECTION_NONE) {\n return {\n key: 'none',\n text: tableLocale.selectNone,\n onSelect: function onSelect() {\n onSelectNone === null || onSelectNone === void 0 ? void 0 : onSelectNone();\n setSelectedKeys(Array.from(derivedSelectedKeySet).filter(function (key) {\n var checkProps = checkboxPropsMap.get(key);\n return checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled;\n }), 'none');\n }\n };\n }\n return selection;\n }).map(function (selection) {\n return _extends(_extends({}, selection), {\n onSelect: function onSelect() {\n var _a2;\n var _a;\n for (var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {\n rest[_key] = arguments[_key];\n }\n (_a = selection.onSelect) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [selection].concat(rest));\n setLastSelectedKey(null);\n }\n });\n });\n }, [selections, derivedSelectedKeySet, pageData, getRowKey, onSelectInvert, setSelectedKeys]);\n // ======================= Columns ========================\n var transformColumns = useCallback(function (columns) {\n var _a;\n // >>>>>>>>>>> Skip if not exists `rowSelection`\n if (!rowSelection) {\n process.env.NODE_ENV !== \"production\" ? warning(!columns.includes(SELECTION_COLUMN), 'Table', '`rowSelection` is not config but `SELECTION_COLUMN` exists in the `columns`.') : void 0;\n return columns.filter(function (col) {\n return col !== SELECTION_COLUMN;\n });\n }\n // >>>>>>>>>>> Support selection\n var cloneColumns = _toConsumableArray(columns);\n var keySet = new Set(derivedSelectedKeySet);\n // Record key only need check with enabled\n var recordKeys = flattedData.map(getRowKey).filter(function (key) {\n return !checkboxPropsMap.get(key).disabled;\n });\n var checkedCurrentAll = recordKeys.every(function (key) {\n return keySet.has(key);\n });\n var checkedCurrentSome = recordKeys.some(function (key) {\n return keySet.has(key);\n });\n var onSelectAllChange = function onSelectAllChange() {\n var changeKeys = [];\n if (checkedCurrentAll) {\n recordKeys.forEach(function (key) {\n keySet[\"delete\"](key);\n changeKeys.push(key);\n });\n } else {\n recordKeys.forEach(function (key) {\n if (!keySet.has(key)) {\n keySet.add(key);\n changeKeys.push(key);\n }\n });\n }\n var keys = Array.from(keySet);\n onSelectAll === null || onSelectAll === void 0 ? void 0 : onSelectAll(!checkedCurrentAll, keys.map(function (k) {\n return getRecordByKey(k);\n }), changeKeys.map(function (k) {\n return getRecordByKey(k);\n }));\n setSelectedKeys(keys, 'all');\n setLastSelectedKey(null);\n };\n // ===================== Render =====================\n // Title Cell\n var title;\n if (selectionType !== 'radio') {\n var customizeSelections;\n if (mergedSelections) {\n var menu = {\n getPopupContainer: getPopupContainer,\n items: mergedSelections.map(function (selection, index) {\n var key = selection.key,\n text = selection.text,\n onSelectionClick = selection.onSelect;\n return {\n key: key || index,\n onClick: function onClick() {\n onSelectionClick === null || onSelectionClick === void 0 ? void 0 : onSelectionClick(recordKeys);\n },\n label: text\n };\n })\n };\n customizeSelections = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-selection-extra\")\n }, /*#__PURE__*/React.createElement(Dropdown, {\n menu: menu,\n getPopupContainer: getPopupContainer\n }, /*#__PURE__*/React.createElement(\"span\", null, /*#__PURE__*/React.createElement(DownOutlined, null))));\n }\n var allDisabledData = flattedData.map(function (record, index) {\n var key = getRowKey(record, index);\n var checkboxProps = checkboxPropsMap.get(key) || {};\n return _extends({\n checked: keySet.has(key)\n }, checkboxProps);\n }).filter(function (_ref2) {\n var disabled = _ref2.disabled;\n return disabled;\n });\n var allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;\n var allDisabledAndChecked = allDisabled && allDisabledData.every(function (_ref3) {\n var checked = _ref3.checked;\n return checked;\n });\n var allDisabledSomeChecked = allDisabled && allDisabledData.some(function (_ref4) {\n var checked = _ref4.checked;\n return checked;\n });\n title = !hideSelectAll && ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-selection\")\n }, /*#__PURE__*/React.createElement(Checkbox, {\n checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,\n indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,\n onChange: onSelectAllChange,\n disabled: flattedData.length === 0 || allDisabled,\n \"aria-label\": customizeSelections ? 'Custom selection' : 'Select all',\n skipGroup: true\n }), customizeSelections));\n }\n // Body Cell\n var renderCell;\n if (selectionType === 'radio') {\n renderCell = function renderCell(_, record, index) {\n var key = getRowKey(record, index);\n var checked = keySet.has(key);\n return {\n node: ( /*#__PURE__*/React.createElement(Radio, _extends({}, checkboxPropsMap.get(key), {\n checked: checked,\n onClick: function onClick(e) {\n return e.stopPropagation();\n },\n onChange: function onChange(event) {\n if (!keySet.has(key)) {\n triggerSingleSelection(key, true, [key], event.nativeEvent);\n }\n }\n }))),\n checked: checked\n };\n };\n } else {\n renderCell = function renderCell(_, record, index) {\n var _a;\n var key = getRowKey(record, index);\n var checked = keySet.has(key);\n var indeterminate = derivedHalfSelectedKeySet.has(key);\n var checkboxProps = checkboxPropsMap.get(key);\n var mergedIndeterminate;\n if (expandType === 'nest') {\n mergedIndeterminate = indeterminate;\n process.env.NODE_ENV !== \"production\" ? warning(typeof (checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== 'boolean', 'Table', 'set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.') : void 0;\n } else {\n mergedIndeterminate = (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== null && _a !== void 0 ? _a : indeterminate;\n }\n // Record checked\n return {\n node: ( /*#__PURE__*/React.createElement(Checkbox, _extends({}, checkboxProps, {\n indeterminate: mergedIndeterminate,\n checked: checked,\n skipGroup: true,\n onClick: function onClick(e) {\n return e.stopPropagation();\n },\n onChange: function onChange(_ref5) {\n var nativeEvent = _ref5.nativeEvent;\n var shiftKey = nativeEvent.shiftKey;\n var startIndex = -1;\n var endIndex = -1;\n // Get range of this\n if (shiftKey && checkStrictly) {\n var pointKeys = new Set([lastSelectedKey, key]);\n recordKeys.some(function (recordKey, recordIndex) {\n if (pointKeys.has(recordKey)) {\n if (startIndex === -1) {\n startIndex = recordIndex;\n } else {\n endIndex = recordIndex;\n return true;\n }\n }\n return false;\n });\n }\n if (endIndex !== -1 && startIndex !== endIndex && checkStrictly) {\n // Batch update selections\n var rangeKeys = recordKeys.slice(startIndex, endIndex + 1);\n var changedKeys = [];\n if (checked) {\n rangeKeys.forEach(function (recordKey) {\n if (keySet.has(recordKey)) {\n changedKeys.push(recordKey);\n keySet[\"delete\"](recordKey);\n }\n });\n } else {\n rangeKeys.forEach(function (recordKey) {\n if (!keySet.has(recordKey)) {\n changedKeys.push(recordKey);\n keySet.add(recordKey);\n }\n });\n }\n var keys = Array.from(keySet);\n onSelectMultiple === null || onSelectMultiple === void 0 ? void 0 : onSelectMultiple(!checked, keys.map(function (recordKey) {\n return getRecordByKey(recordKey);\n }), changedKeys.map(function (recordKey) {\n return getRecordByKey(recordKey);\n }));\n setSelectedKeys(keys, 'multiple');\n } else {\n // Single record selected\n var originCheckedKeys = derivedSelectedKeys;\n if (checkStrictly) {\n var checkedKeys = checked ? arrDel(originCheckedKeys, key) : arrAdd(originCheckedKeys, key);\n triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);\n } else {\n // Always fill first\n var result = conductCheck([].concat(_toConsumableArray(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);\n var _checkedKeys = result.checkedKeys,\n halfCheckedKeys = result.halfCheckedKeys;\n var nextCheckedKeys = _checkedKeys;\n // If remove, we do it again to correction\n if (checked) {\n var tempKeySet = new Set(_checkedKeys);\n tempKeySet[\"delete\"](key);\n nextCheckedKeys = conductCheck(Array.from(tempKeySet), {\n checked: false,\n halfCheckedKeys: halfCheckedKeys\n }, keyEntities, isCheckboxDisabled).checkedKeys;\n }\n triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);\n }\n }\n if (checked) {\n setLastSelectedKey(null);\n } else {\n setLastSelectedKey(key);\n }\n }\n }))),\n checked: checked\n };\n };\n }\n var renderSelectionCell = function renderSelectionCell(_, record, index) {\n var _renderCell = renderCell(_, record, index),\n node = _renderCell.node,\n checked = _renderCell.checked;\n if (customizeRenderCell) {\n return customizeRenderCell(checked, record, index, node);\n }\n return node;\n };\n // Insert selection column if not exist\n if (!cloneColumns.includes(SELECTION_COLUMN)) {\n // Always after expand icon\n if (cloneColumns.findIndex(function (col) {\n var _a;\n return ((_a = col[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN';\n }) === 0) {\n var _cloneColumns = cloneColumns,\n _cloneColumns2 = _toArray(_cloneColumns),\n expandColumn = _cloneColumns2[0],\n restColumns = _cloneColumns2.slice(1);\n cloneColumns = [expandColumn, SELECTION_COLUMN].concat(_toConsumableArray(restColumns));\n } else {\n // Normal insert at first column\n cloneColumns = [SELECTION_COLUMN].concat(_toConsumableArray(cloneColumns));\n }\n }\n // Deduplicate selection column\n var selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);\n process.env.NODE_ENV !== \"production\" ? warning(cloneColumns.filter(function (col) {\n return col === SELECTION_COLUMN;\n }).length <= 1, 'Table', 'Multiple `SELECTION_COLUMN` exist in `columns`.') : void 0;\n cloneColumns = cloneColumns.filter(function (column, index) {\n return column !== SELECTION_COLUMN || index === selectionColumnIndex;\n });\n // Fixed column logic\n var prevCol = cloneColumns[selectionColumnIndex - 1];\n var nextCol = cloneColumns[selectionColumnIndex + 1];\n var mergedFixed = fixed;\n if (mergedFixed === undefined) {\n if ((nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed) !== undefined) {\n mergedFixed = nextCol.fixed;\n } else if ((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) !== undefined) {\n mergedFixed = prevCol.fixed;\n }\n }\n if (mergedFixed && prevCol && ((_a = prevCol[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN' && prevCol.fixed === undefined) {\n prevCol.fixed = mergedFixed;\n }\n // Replace with real selection column\n var selectionColumn = _defineProperty({\n fixed: mergedFixed,\n width: selectionColWidth,\n className: \"\".concat(prefixCls, \"-selection-column\"),\n title: rowSelection.columnTitle || title,\n render: renderSelectionCell\n }, INTERNAL_COL_DEFINE, {\n className: \"\".concat(prefixCls, \"-selection-col\")\n });\n return cloneColumns.map(function (col) {\n return col === SELECTION_COLUMN ? selectionColumn : col;\n });\n }, [getRowKey, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, lastSelectedKey, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);\n return [transformColumns, derivedSelectedKeySet];\n}","// This icon file is generated automatically.\nvar CaretDownOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z\" } }] }, \"name\": \"caret-down\", \"theme\": \"outlined\" };\nexport default CaretDownOutlined;\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 CaretDownOutlinedSvg from \"@ant-design/icons-svg/es/asn/CaretDownOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CaretDownOutlined = function CaretDownOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CaretDownOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CaretDownOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CaretDownOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CaretUpOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z\" } }] }, \"name\": \"caret-up\", \"theme\": \"outlined\" };\nexport default CaretUpOutlined;\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 CaretUpOutlinedSvg from \"@ant-design/icons-svg/es/asn/CaretUpOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CaretUpOutlined = function CaretUpOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CaretUpOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CaretUpOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CaretUpOutlined';\n}\nexport default RefIcon;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport CaretDownOutlined from \"@ant-design/icons/es/icons/CaretDownOutlined\";\nimport CaretUpOutlined from \"@ant-design/icons/es/icons/CaretUpOutlined\";\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport Tooltip from '../../tooltip';\nimport { getColumnKey, getColumnPos, renderColumnTitle, safeColumnTitle } from '../util';\nvar ASCEND = 'ascend';\nvar DESCEND = 'descend';\nfunction getMultiplePriority(column) {\n if (_typeof(column.sorter) === 'object' && typeof column.sorter.multiple === 'number') {\n return column.sorter.multiple;\n }\n return false;\n}\nfunction getSortFunction(sorter) {\n if (typeof sorter === 'function') {\n return sorter;\n }\n if (sorter && _typeof(sorter) === 'object' && sorter.compare) {\n return sorter.compare;\n }\n return false;\n}\nfunction nextSortDirection(sortDirections, current) {\n if (!current) {\n return sortDirections[0];\n }\n return sortDirections[sortDirections.indexOf(current) + 1];\n}\nfunction collectSortStates(columns, init, pos) {\n var sortStates = [];\n function pushState(column, columnPos) {\n sortStates.push({\n column: column,\n key: getColumnKey(column, columnPos),\n multiplePriority: getMultiplePriority(column),\n sortOrder: column.sortOrder\n });\n }\n (columns || []).forEach(function (column, index) {\n var columnPos = getColumnPos(index, pos);\n if (column.children) {\n if ('sortOrder' in column) {\n // Controlled\n pushState(column, columnPos);\n }\n sortStates = [].concat(_toConsumableArray(sortStates), _toConsumableArray(collectSortStates(column.children, init, columnPos)));\n } else if (column.sorter) {\n if ('sortOrder' in column) {\n // Controlled\n pushState(column, columnPos);\n } else if (init && column.defaultSortOrder) {\n // Default sorter\n sortStates.push({\n column: column,\n key: getColumnKey(column, columnPos),\n multiplePriority: getMultiplePriority(column),\n sortOrder: column.defaultSortOrder\n });\n }\n }\n });\n return sortStates;\n}\nfunction injectSorter(prefixCls, columns, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, pos) {\n return (columns || []).map(function (column, index) {\n var columnPos = getColumnPos(index, pos);\n var newColumn = column;\n if (newColumn.sorter) {\n var sortDirections = newColumn.sortDirections || defaultSortDirections;\n var showSorterTooltip = newColumn.showSorterTooltip === undefined ? tableShowSorterTooltip : newColumn.showSorterTooltip;\n var columnKey = getColumnKey(newColumn, columnPos);\n var sorterState = sorterStates.find(function (_ref) {\n var key = _ref.key;\n return key === columnKey;\n });\n var sorterOrder = sorterState ? sorterState.sortOrder : null;\n var nextSortOrder = nextSortDirection(sortDirections, sorterOrder);\n var upNode = sortDirections.includes(ASCEND) && ( /*#__PURE__*/React.createElement(CaretUpOutlined, {\n className: classNames(\"\".concat(prefixCls, \"-column-sorter-up\"), {\n active: sorterOrder === ASCEND\n }),\n role: \"presentation\"\n }));\n var downNode = sortDirections.includes(DESCEND) && ( /*#__PURE__*/React.createElement(CaretDownOutlined, {\n className: classNames(\"\".concat(prefixCls, \"-column-sorter-down\"), {\n active: sorterOrder === DESCEND\n }),\n role: \"presentation\"\n }));\n var _ref2 = tableLocale || {},\n cancelSort = _ref2.cancelSort,\n triggerAsc = _ref2.triggerAsc,\n triggerDesc = _ref2.triggerDesc;\n var sortTip = cancelSort;\n if (nextSortOrder === DESCEND) {\n sortTip = triggerDesc;\n } else if (nextSortOrder === ASCEND) {\n sortTip = triggerAsc;\n }\n var tooltipProps = _typeof(showSorterTooltip) === 'object' ? showSorterTooltip : {\n title: sortTip\n };\n newColumn = _extends(_extends({}, newColumn), {\n className: classNames(newColumn.className, _defineProperty({}, \"\".concat(prefixCls, \"-column-sort\"), sorterOrder)),\n title: function title(renderProps) {\n var renderSortTitle = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-column-sorters\")\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-column-title\")\n }, renderColumnTitle(column.title, renderProps)), /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(\"\".concat(prefixCls, \"-column-sorter\"), _defineProperty({}, \"\".concat(prefixCls, \"-column-sorter-full\"), !!(upNode && downNode)))\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-column-sorter-inner\")\n }, upNode, downNode)));\n return showSorterTooltip ? ( /*#__PURE__*/React.createElement(Tooltip, _extends({}, tooltipProps), renderSortTitle)) : renderSortTitle;\n },\n onHeaderCell: function onHeaderCell(col) {\n var cell = column.onHeaderCell && column.onHeaderCell(col) || {};\n var originOnClick = cell.onClick;\n var originOKeyDown = cell.onKeyDown;\n cell.onClick = function (event) {\n triggerSorter({\n column: column,\n key: columnKey,\n sortOrder: nextSortOrder,\n multiplePriority: getMultiplePriority(column)\n });\n originOnClick === null || originOnClick === void 0 ? void 0 : originOnClick(event);\n };\n cell.onKeyDown = function (event) {\n if (event.keyCode === KeyCode.ENTER) {\n triggerSorter({\n column: column,\n key: columnKey,\n sortOrder: nextSortOrder,\n multiplePriority: getMultiplePriority(column)\n });\n originOKeyDown === null || originOKeyDown === void 0 ? void 0 : originOKeyDown(event);\n }\n };\n var renderTitle = safeColumnTitle(column.title, {});\n var displayTitle = renderTitle === null || renderTitle === void 0 ? void 0 : renderTitle.toString();\n // Inform the screen-reader so it can tell the visually impaired user which column is sorted\n if (sorterOrder) {\n cell['aria-sort'] = sorterOrder === 'ascend' ? 'ascending' : 'descending';\n } else {\n cell['aria-label'] = displayTitle || '';\n }\n cell.className = classNames(cell.className, \"\".concat(prefixCls, \"-column-has-sorters\"));\n cell.tabIndex = 0;\n if (column.ellipsis) {\n cell.title = (renderTitle !== null && renderTitle !== void 0 ? renderTitle : '').toString();\n }\n return cell;\n }\n });\n }\n if ('children' in newColumn) {\n newColumn = _extends(_extends({}, newColumn), {\n children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos)\n });\n }\n return newColumn;\n });\n}\nfunction stateToInfo(sorterStates) {\n var column = sorterStates.column,\n sortOrder = sorterStates.sortOrder;\n return {\n column: column,\n order: sortOrder,\n field: column.dataIndex,\n columnKey: column.key\n };\n}\nfunction generateSorterInfo(sorterStates) {\n var list = sorterStates.filter(function (_ref3) {\n var sortOrder = _ref3.sortOrder;\n return sortOrder;\n }).map(stateToInfo);\n // =========== Legacy compatible support ===========\n // https://github.com/ant-design/ant-design/pull/19226\n if (list.length === 0 && sorterStates.length) {\n return _extends(_extends({}, stateToInfo(sorterStates[sorterStates.length - 1])), {\n column: undefined\n });\n }\n if (list.length <= 1) {\n return list[0] || {};\n }\n return list;\n}\nexport function getSortData(data, sortStates, childrenColumnName) {\n var innerSorterStates = sortStates.slice().sort(function (a, b) {\n return b.multiplePriority - a.multiplePriority;\n });\n var cloneData = data.slice();\n var runningSorters = innerSorterStates.filter(function (_ref4) {\n var sorter = _ref4.column.sorter,\n sortOrder = _ref4.sortOrder;\n return getSortFunction(sorter) && sortOrder;\n });\n // Skip if no sorter needed\n if (!runningSorters.length) {\n return cloneData;\n }\n return cloneData.sort(function (record1, record2) {\n for (var i = 0; i < runningSorters.length; i += 1) {\n var sorterState = runningSorters[i];\n var sorter = sorterState.column.sorter,\n sortOrder = sorterState.sortOrder;\n var compareFn = getSortFunction(sorter);\n if (compareFn && sortOrder) {\n var compareResult = compareFn(record1, record2, sortOrder);\n if (compareResult !== 0) {\n return sortOrder === ASCEND ? compareResult : -compareResult;\n }\n }\n }\n return 0;\n }).map(function (record) {\n var subRecords = record[childrenColumnName];\n if (subRecords) {\n return _extends(_extends({}, record), _defineProperty({}, childrenColumnName, getSortData(subRecords, sortStates, childrenColumnName)));\n }\n return record;\n });\n}\nexport default function useFilterSorter(_ref5) {\n var prefixCls = _ref5.prefixCls,\n mergedColumns = _ref5.mergedColumns,\n onSorterChange = _ref5.onSorterChange,\n sortDirections = _ref5.sortDirections,\n tableLocale = _ref5.tableLocale,\n showSorterTooltip = _ref5.showSorterTooltip;\n var _React$useState = React.useState(collectSortStates(mergedColumns, true)),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n sortStates = _React$useState2[0],\n setSortStates = _React$useState2[1];\n var mergedSorterStates = React.useMemo(function () {\n var validate = true;\n var collectedStates = collectSortStates(mergedColumns, false);\n // Return if not controlled\n if (!collectedStates.length) {\n return sortStates;\n }\n var validateStates = [];\n function patchStates(state) {\n if (validate) {\n validateStates.push(state);\n } else {\n validateStates.push(_extends(_extends({}, state), {\n sortOrder: null\n }));\n }\n }\n var multipleMode = null;\n collectedStates.forEach(function (state) {\n if (multipleMode === null) {\n patchStates(state);\n if (state.sortOrder) {\n if (state.multiplePriority === false) {\n validate = false;\n } else {\n multipleMode = true;\n }\n }\n } else if (multipleMode && state.multiplePriority !== false) {\n patchStates(state);\n } else {\n validate = false;\n patchStates(state);\n }\n });\n return validateStates;\n }, [mergedColumns, sortStates]);\n // Get render columns title required props\n var columnTitleSorterProps = React.useMemo(function () {\n var sortColumns = mergedSorterStates.map(function (_ref6) {\n var column = _ref6.column,\n sortOrder = _ref6.sortOrder;\n return {\n column: column,\n order: sortOrder\n };\n });\n return {\n sortColumns: sortColumns,\n // Legacy\n sortColumn: sortColumns[0] && sortColumns[0].column,\n sortOrder: sortColumns[0] && sortColumns[0].order\n };\n }, [mergedSorterStates]);\n function triggerSorter(sortState) {\n var newSorterStates;\n if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) {\n newSorterStates = [sortState];\n } else {\n newSorterStates = [].concat(_toConsumableArray(mergedSorterStates.filter(function (_ref7) {\n var key = _ref7.key;\n return key !== sortState.key;\n })), [sortState]);\n }\n setSortStates(newSorterStates);\n onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);\n }\n var transformColumns = function transformColumns(innerColumns) {\n return injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip);\n };\n var getSorters = function getSorters() {\n return generateSorterInfo(mergedSorterStates);\n };\n return [transformColumns, mergedSorterStates, columnTitleSorterProps, getSorters];\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { renderColumnTitle } from '../util';\nfunction fillTitle(columns, columnTitleProps) {\n return columns.map(function (column) {\n var cloneColumn = _extends({}, column);\n cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);\n if ('children' in cloneColumn) {\n cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);\n }\n return cloneColumn;\n });\n}\nexport default function useTitleColumns(columnTitleProps) {\n var filledColumns = React.useCallback(function (columns) {\n return fillTitle(columns, columnTitleProps);\n }, [columnTitleProps]);\n return [filledColumns];\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport RcTable, { Summary } from 'rc-table';\nimport { convertChildrenToColumns } from \"rc-table/es/hooks/useColumns\";\nimport { INTERNAL_HOOKS } from \"rc-table/es/Table\";\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider/context';\nimport defaultRenderEmpty from '../config-provider/defaultRenderEmpty';\nimport SizeContext from '../config-provider/SizeContext';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport defaultLocale from '../locale/en_US';\nimport Pagination from '../pagination';\nimport Spin from '../spin';\nimport scrollTo from '../_util/scrollTo';\nimport warning from '../_util/warning';\nimport Column from './Column';\nimport ColumnGroup from './ColumnGroup';\nimport renderExpandIcon from './ExpandIcon';\nimport useFilter, { getFilterData } from './hooks/useFilter';\nimport useLazyKVMap from './hooks/useLazyKVMap';\nimport usePagination, { DEFAULT_PAGE_SIZE, getPaginationParam } from './hooks/usePagination';\nimport useSelection, { SELECTION_ALL, SELECTION_COLUMN, SELECTION_INVERT, SELECTION_NONE } from './hooks/useSelection';\nimport useSorter, { getSortData } from './hooks/useSorter';\nimport useTitleColumns from './hooks/useTitleColumns';\nvar EMPTY_LIST = [];\nfunction InternalTable(props, ref) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n customizeSize = props.size,\n bordered = props.bordered,\n customizeDropdownPrefixCls = props.dropdownPrefixCls,\n dataSource = props.dataSource,\n pagination = props.pagination,\n rowSelection = props.rowSelection,\n _props$rowKey = props.rowKey,\n rowKey = _props$rowKey === void 0 ? 'key' : _props$rowKey,\n rowClassName = props.rowClassName,\n columns = props.columns,\n children = props.children,\n legacyChildrenColumnName = props.childrenColumnName,\n onChange = props.onChange,\n getPopupContainer = props.getPopupContainer,\n loading = props.loading,\n expandIcon = props.expandIcon,\n expandable = props.expandable,\n expandedRowRender = props.expandedRowRender,\n expandIconColumnIndex = props.expandIconColumnIndex,\n indentSize = props.indentSize,\n scroll = props.scroll,\n sortDirections = props.sortDirections,\n locale = props.locale,\n _props$showSorterTool = props.showSorterTooltip,\n showSorterTooltip = _props$showSorterTool === void 0 ? true : _props$showSorterTool;\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof rowKey === 'function' && rowKey.length > 1), 'Table', '`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.') : void 0;\n [['filterDropdownVisible', 'filterDropdownOpen'], ['onFilterDropdownVisibleChange', 'onFilterDropdownOpenChange']].forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n deprecatedName = _ref2[0],\n newName = _ref2[1];\n process.env.NODE_ENV !== \"production\" ? warning(!(deprecatedName in props), 'Table', \"`\".concat(deprecatedName, \"` is deprecated which will be removed in next major version.Please use `\").concat(newName, \"` instead. \")) : void 0;\n });\n var baseColumns = React.useMemo(function () {\n return columns || convertChildrenToColumns(children);\n }, [columns, children]);\n var needResponsive = React.useMemo(function () {\n return baseColumns.some(function (col) {\n return col.responsive;\n });\n }, [baseColumns]);\n var screens = useBreakpoint(needResponsive);\n var mergedColumns = React.useMemo(function () {\n var matched = new Set(Object.keys(screens).filter(function (m) {\n return screens[m];\n }));\n return baseColumns.filter(function (c) {\n return !c.responsive || c.responsive.some(function (r) {\n return matched.has(r);\n });\n });\n }, [baseColumns, screens]);\n var tableProps = omit(props, ['className', 'style', 'columns']);\n var size = React.useContext(SizeContext);\n var _React$useContext = React.useContext(ConfigContext),\n _React$useContext$loc = _React$useContext.locale,\n contextLocale = _React$useContext$loc === void 0 ? defaultLocale : _React$useContext$loc,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction;\n var mergedSize = customizeSize || size;\n var tableLocale = _extends(_extends({}, contextLocale.Table), locale);\n var rawData = dataSource || EMPTY_LIST;\n var _React$useContext2 = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext2.getPrefixCls;\n var prefixCls = getPrefixCls('table', customizePrefixCls);\n var dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);\n var mergedExpandable = _extends({\n childrenColumnName: legacyChildrenColumnName,\n expandIconColumnIndex: expandIconColumnIndex\n }, expandable);\n var _mergedExpandable$chi = mergedExpandable.childrenColumnName,\n childrenColumnName = _mergedExpandable$chi === void 0 ? 'children' : _mergedExpandable$chi;\n var expandType = React.useMemo(function () {\n if (rawData.some(function (item) {\n return item === null || item === void 0 ? void 0 : item[childrenColumnName];\n })) {\n return 'nest';\n }\n if (expandedRowRender || expandable && expandable.expandedRowRender) {\n return 'row';\n }\n return null;\n }, [rawData]);\n var internalRefs = {\n body: React.useRef()\n };\n // ============================ RowKey ============================\n var getRowKey = React.useMemo(function () {\n if (typeof rowKey === 'function') {\n return rowKey;\n }\n return function (record) {\n return record === null || record === void 0 ? void 0 : record[rowKey];\n };\n }, [rowKey]);\n var _useLazyKVMap = useLazyKVMap(rawData, childrenColumnName, getRowKey),\n _useLazyKVMap2 = _slicedToArray(_useLazyKVMap, 1),\n getRecordByKey = _useLazyKVMap2[0];\n // ============================ Events =============================\n var changeEventInfo = {};\n var triggerOnChange = function triggerOnChange(info, action) {\n var reset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var changeInfo = _extends(_extends({}, changeEventInfo), info);\n if (reset) {\n changeEventInfo.resetPagination();\n // Reset event param\n if (changeInfo.pagination.current) {\n changeInfo.pagination.current = 1;\n }\n // Trigger pagination events\n if (pagination && pagination.onChange) {\n pagination.onChange(1, changeInfo.pagination.pageSize);\n }\n }\n if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {\n scrollTo(0, {\n getContainer: function getContainer() {\n return internalRefs.body.current;\n }\n });\n }\n onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {\n currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates),\n action: action\n });\n };\n /**\n * Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read\n * state out and then put it back to title render. Move these code into `hooks` but still too\n * complex. We should provides Table props like `sorter` & `filter` to handle control in next big\n * version.\n */\n // ============================ Sorter =============================\n var onSorterChange = function onSorterChange(sorter, sorterStates) {\n triggerOnChange({\n sorter: sorter,\n sorterStates: sorterStates\n }, 'sort', false);\n };\n var _useSorter = useSorter({\n prefixCls: prefixCls,\n mergedColumns: mergedColumns,\n onSorterChange: onSorterChange,\n sortDirections: sortDirections || ['ascend', 'descend'],\n tableLocale: tableLocale,\n showSorterTooltip: showSorterTooltip\n }),\n _useSorter2 = _slicedToArray(_useSorter, 4),\n transformSorterColumns = _useSorter2[0],\n sortStates = _useSorter2[1],\n sorterTitleProps = _useSorter2[2],\n getSorters = _useSorter2[3];\n var sortedData = React.useMemo(function () {\n return getSortData(rawData, sortStates, childrenColumnName);\n }, [rawData, sortStates]);\n changeEventInfo.sorter = getSorters();\n changeEventInfo.sorterStates = sortStates;\n // ============================ Filter ============================\n var onFilterChange = function onFilterChange(filters, filterStates) {\n triggerOnChange({\n filters: filters,\n filterStates: filterStates\n }, 'filter', true);\n };\n var _useFilter = useFilter({\n prefixCls: prefixCls,\n locale: tableLocale,\n dropdownPrefixCls: dropdownPrefixCls,\n mergedColumns: mergedColumns,\n onFilterChange: onFilterChange,\n getPopupContainer: getPopupContainer\n }),\n _useFilter2 = _slicedToArray(_useFilter, 3),\n transformFilterColumns = _useFilter2[0],\n filterStates = _useFilter2[1],\n filters = _useFilter2[2];\n var mergedData = getFilterData(sortedData, filterStates);\n changeEventInfo.filters = filters;\n changeEventInfo.filterStates = filterStates;\n // ============================ Column ============================\n var columnTitleProps = React.useMemo(function () {\n var mergedFilters = {};\n Object.keys(filters).forEach(function (filterKey) {\n if (filters[filterKey] !== null) {\n mergedFilters[filterKey] = filters[filterKey];\n }\n });\n return _extends(_extends({}, sorterTitleProps), {\n filters: mergedFilters\n });\n }, [sorterTitleProps, filters]);\n var _useTitleColumns = useTitleColumns(columnTitleProps),\n _useTitleColumns2 = _slicedToArray(_useTitleColumns, 1),\n transformTitleColumns = _useTitleColumns2[0];\n // ========================== Pagination ==========================\n var onPaginationChange = function onPaginationChange(current, pageSize) {\n triggerOnChange({\n pagination: _extends(_extends({}, changeEventInfo.pagination), {\n current: current,\n pageSize: pageSize\n })\n }, 'paginate');\n };\n var _usePagination = usePagination(mergedData.length, pagination, onPaginationChange),\n _usePagination2 = _slicedToArray(_usePagination, 2),\n mergedPagination = _usePagination2[0],\n resetPagination = _usePagination2[1];\n changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(pagination, mergedPagination);\n changeEventInfo.resetPagination = resetPagination;\n // ============================= Data =============================\n var pageData = React.useMemo(function () {\n if (pagination === false || !mergedPagination.pageSize) {\n return mergedData;\n }\n var _mergedPagination$cur = mergedPagination.current,\n current = _mergedPagination$cur === void 0 ? 1 : _mergedPagination$cur,\n total = mergedPagination.total,\n _mergedPagination$pag = mergedPagination.pageSize,\n pageSize = _mergedPagination$pag === void 0 ? DEFAULT_PAGE_SIZE : _mergedPagination$pag;\n process.env.NODE_ENV !== \"production\" ? warning(current > 0, 'Table', '`current` should be positive number.') : void 0;\n // Dynamic table data\n if (mergedData.length < total) {\n if (mergedData.length > pageSize) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Table', '`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.') : void 0;\n return mergedData.slice((current - 1) * pageSize, current * pageSize);\n }\n return mergedData;\n }\n return mergedData.slice((current - 1) * pageSize, current * pageSize);\n }, [!!pagination, mergedData, mergedPagination && mergedPagination.current, mergedPagination && mergedPagination.pageSize, mergedPagination && mergedPagination.total]);\n // ========================== Selections ==========================\n var _useSelection = useSelection(rowSelection, {\n prefixCls: prefixCls,\n data: mergedData,\n pageData: pageData,\n getRowKey: getRowKey,\n getRecordByKey: getRecordByKey,\n expandType: expandType,\n childrenColumnName: childrenColumnName,\n locale: tableLocale,\n getPopupContainer: getPopupContainer\n }),\n _useSelection2 = _slicedToArray(_useSelection, 2),\n transformSelectionColumns = _useSelection2[0],\n selectedKeySet = _useSelection2[1];\n var internalRowClassName = function internalRowClassName(record, index, indent) {\n var mergedRowClassName;\n if (typeof rowClassName === 'function') {\n mergedRowClassName = classNames(rowClassName(record, index, indent));\n } else {\n mergedRowClassName = classNames(rowClassName);\n }\n return classNames(_defineProperty({}, \"\".concat(prefixCls, \"-row-selected\"), selectedKeySet.has(getRowKey(record, index))), mergedRowClassName);\n };\n // ========================== Expandable ==========================\n // Pass origin render status into `rc-table`, this can be removed when refactor with `rc-table`\n mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;\n // Customize expandable icon\n mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || renderExpandIcon(tableLocale);\n // Adjust expand icon index, no overwrite expandIconColumnIndex if set.\n if (expandType === 'nest' && mergedExpandable.expandIconColumnIndex === undefined) {\n mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;\n } else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {\n mergedExpandable.expandIconColumnIndex -= 1;\n }\n // Indent size\n if (typeof mergedExpandable.indentSize !== 'number') {\n mergedExpandable.indentSize = typeof indentSize === 'number' ? indentSize : 15;\n }\n // ============================ Render ============================\n var transformColumns = React.useCallback(function (innerColumns) {\n return transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns))));\n }, [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);\n var topPaginationNode;\n var bottomPaginationNode;\n if (pagination !== false && (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total)) {\n var paginationSize;\n if (mergedPagination.size) {\n paginationSize = mergedPagination.size;\n } else {\n paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;\n }\n var renderPagination = function renderPagination(position) {\n return /*#__PURE__*/React.createElement(Pagination, _extends({}, mergedPagination, {\n className: classNames(\"\".concat(prefixCls, \"-pagination \").concat(prefixCls, \"-pagination-\").concat(position), mergedPagination.className),\n size: paginationSize\n }));\n };\n var defaultPosition = direction === 'rtl' ? 'left' : 'right';\n var position = mergedPagination.position;\n if (position !== null && Array.isArray(position)) {\n var topPos = position.find(function (p) {\n return p.includes('top');\n });\n var bottomPos = position.find(function (p) {\n return p.includes('bottom');\n });\n var isDisable = position.every(function (p) {\n return \"\".concat(p) === 'none';\n });\n if (!topPos && !bottomPos && !isDisable) {\n bottomPaginationNode = renderPagination(defaultPosition);\n }\n if (topPos) {\n topPaginationNode = renderPagination(topPos.toLowerCase().replace('top', ''));\n }\n if (bottomPos) {\n bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace('bottom', ''));\n }\n } else {\n bottomPaginationNode = renderPagination(defaultPosition);\n }\n }\n // >>>>>>>>> Spinning\n var spinProps;\n if (typeof loading === 'boolean') {\n spinProps = {\n spinning: loading\n };\n } else if (_typeof(loading) === 'object') {\n spinProps = _extends({\n spinning: true\n }, loading);\n }\n var wrapperClassNames = classNames(\"\".concat(prefixCls, \"-wrapper\"), _defineProperty({}, \"\".concat(prefixCls, \"-wrapper-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: ref,\n className: wrapperClassNames,\n style: style\n }, /*#__PURE__*/React.createElement(Spin, _extends({\n spinning: false\n }, spinProps), topPaginationNode, /*#__PURE__*/React.createElement(RcTable, _extends({}, tableProps, {\n columns: mergedColumns,\n direction: direction,\n expandable: mergedExpandable,\n prefixCls: prefixCls,\n className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-middle\"), mergedSize === 'middle'), \"\".concat(prefixCls, \"-small\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-bordered\"), bordered), \"\".concat(prefixCls, \"-empty\"), rawData.length === 0)),\n data: pageData,\n rowKey: getRowKey,\n rowClassName: internalRowClassName,\n emptyText: locale && locale.emptyText || (renderEmpty || defaultRenderEmpty)('Table'),\n // Internal\n internalHooks: INTERNAL_HOOKS,\n internalRefs: internalRefs,\n transformColumns: transformColumns\n })), bottomPaginationNode));\n}\nvar ForwardTable = /*#__PURE__*/React.forwardRef(InternalTable);\nvar Table = ForwardTable;\nTable.SELECTION_COLUMN = SELECTION_COLUMN;\nTable.EXPAND_COLUMN = RcTable.EXPAND_COLUMN;\nTable.SELECTION_ALL = SELECTION_ALL;\nTable.SELECTION_INVERT = SELECTION_INVERT;\nTable.SELECTION_NONE = SELECTION_NONE;\nTable.Column = Column;\nTable.ColumnGroup = ColumnGroup;\nTable.Summary = Summary;\nexport default Table;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nexport default function useLazyKVMap(data, childrenColumnName, getRowKey) {\n var mapCacheRef = React.useRef({});\n function getRecordByKey(key) {\n if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {\n var kvMap = new Map();\n /* eslint-disable no-inner-declarations */\n function dig(records) {\n records.forEach(function (record, index) {\n var rowKey = getRowKey(record, index);\n kvMap.set(rowKey, record);\n if (record && _typeof(record) === 'object' && childrenColumnName in record) {\n dig(record[childrenColumnName] || []);\n }\n });\n }\n /* eslint-enable */\n dig(data);\n mapCacheRef.current = {\n data: data,\n childrenColumnName: childrenColumnName,\n kvMap: kvMap,\n getRowKey: getRowKey\n };\n }\n return mapCacheRef.current.kvMap.get(key);\n }\n return [getRecordByKey];\n}","import Table from './Table';\nexport default Table;","import React from \"react\";\nimport { Table } from \"antd\";\nimport \"./style.css\";\n\nexport const CXTable = (props) => {\n return ;\n};\n","import React from \"react\";\nimport { Tabs } from \"antd\";\n\nconst { TabPane } = Tabs;\nexport const CXTabs = ({ children, ...props }) => {\n return {children};\n};\nexport const CXTabPane = ({ children, ...props }) => {\n return {children};\n};\n","import React from \"react\";\nimport { Tag } from \"antd\";\n\nconst { CheckableTag } = Tag;\n\nexport const CXTag = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXCheckableTag = ({ children, ...props }) => {\n return {children};\n};\nexport const CXTagRender = (props) => {\n const { label, value, closable, onClose } = props;\n const onPreventMouseDown = (event) => {\n event.preventDefault();\n event.stopPropagation();\n };\n return (\n \n {label}\n \n );\n};\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { Space, Tag, Tooltip, Select, Divider, Spin, notification } from \"antd\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXOption } from \"component/Select\";\nimport { getTag, searchTagActionTrigger, deleteTag } from \"action/TagAction\";\nimport { PlusOutlined } from \"@ant-design/icons\";\nimport { post } from \"helper/networkClient\";\nimport { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport { debounce } from \"lodash\";\n\nconst TagsSearch = ({ TagData = [], onChange, index = 0 }) => {\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const [tags, setTags] = useState([]);\n const [inputVisible, setInputVisible] = useState(false);\n const dispatch = useDispatch();\n const [options, setOptions] = useState(null);\n const stateTag = useSelector((state) => state.TagReducer);\n const [name, setName] = useState(\"\");\n // const [ActiveVal, setActiveVal] = useState(null);\n\n useEffect(() => {\n // no duplicate tags\n const uniqueTags = [...new Set(TagData)];\n setTags(uniqueTags);\n }, [TagData]);\n const handleClose = (removedTag) => {\n const newTags = tags.filter((tag) => tag !== removedTag);\n setTags(newTags);\n onChange(newTags);\n };\n const showInput = () => {\n setInputVisible(true);\n setName(\"\");\n };\n\n const handleInputConfirm = (ActiveVal) => {\n if (!tags.includes(ActiveVal)) {\n setTags([...tags, ActiveVal]);\n onChange([...tags, ActiveVal]);\n }\n setInputVisible(false);\n };\n const tagPlusStyle = {\n cursor: \"pointer\",\n color: \"#018FFF\",\n background: \"#fff\",\n borderColor: \"#018FFF\",\n borderRadius: \"50px\",\n padding: \"2px 8px 2px 8px\",\n };\n const colors = [\n \"#FFF7B3\",\n \"#FFE3C2\",\n \"#FFE5E5\",\n \"#FFE5E5\",\n \"#E5E5FF\",\n \"#E5E5FF\",\n ];\n const renderRendomBg = () => {\n const randomIndex = Math.floor(Math.random() * colors.length);\n return colors[randomIndex];\n };\n const tagPlusStyleAct = {\n cursor: \"pointer\",\n color: \"#6b6868\",\n // background: renderRendomBg(),\n // borderColor: \"#ABABAB38\",\n borderRadius: \"50px\",\n padding: \"2px 8px 2px 8px\",\n display: \"flex\",\n alignItems: \"center\",\n };\n const handleSearch = debounce((value) => {\n setName(value);\n if (value) {\n dispatch(searchTagActionTrigger(value, { type: \"contact\" }));\n } else {\n loadAlltags();\n }\n }, 300);\n\n const deleteTagHandler = (tag) => {\n if (name.length > 0) {\n let temp = stateTag?.search?.filter(\n (item) => item?._id?.name !== tag?._id?.name\n );\n dispatch({ type: \"SEARCH_TAG_ACTION_RESPONSE\", data: { data: temp } });\n dispatch(deleteTag(tag?._id._id));\n } else {\n let temp = stateTag?.tagList?.filter((item) => item?.name !== tag?.name);\n dispatch({ type: \"TAG_LIST_RESPONSE\", data: { data: temp } });\n dispatch(deleteTag(tag?._id));\n }\n };\n useEffect(() => {\n let opt =\n stateTag?.search?.length > 0 &&\n stateTag?.search?.map((tag) => (\n \n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n {\n e.stopPropagation();\n deleteTagHandler(tag);\n }}\n src={\"/images/deleteicon.svg\"}\n alt=\"icon\"\n height={12}\n className=\"mr-2\"\n />\n )}{\" \"}\n {tag?._id?.name} ({tag?.tc ?? 0})\n \n ));\n setOptions(opt);\n }, [stateTag?.search]);\n const tagInputStyle = {\n width: 180,\n };\n const addItem = async (e) => {\n e.preventDefault();\n try {\n await post(\"/tag\", {\n text: {\n q: name,\n },\n type: \"contact\",\n }).then((resp) => {\n if (!tags.includes(name)) {\n setTags([...tags, name]);\n onChange([...tags, name]);\n }\n setInputVisible(false);\n });\n } catch (error) {\n notification.success({\n message: `Already exist one tag with same name. `,\n });\n }\n\n setName(\"\");\n };\n\n useEffect(() => {\n if (index < 1) {\n dispatch(getTag({ type: \"contact\" }));\n }\n }, [dispatch]);\n\n const loadAlltags = () => {\n if (stateTag.tagList) {\n let opt =\n stateTag?.tagList?.length > 0 &&\n stateTag?.tagList?.map((tag) => (\n \n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n {\n e.stopPropagation();\n deleteTagHandler(tag);\n }}\n src={\"/images/deleteicon.svg\"}\n alt=\"icon\"\n height={12}\n className=\"mr-2\"\n />\n )}{\" \"}\n {tag?.name} ({tag?.tc ?? 0})\n \n ));\n setOptions(opt);\n }\n };\n useEffect(() => {\n loadAlltags();\n }, [stateTag.tagList]);\n return (\n \n \n {tags.map((tag, index) => {\n const isLongTag = tag?.length > 20;\n const tagElem = (\n handleClose(tag)}\n >\n {isLongTag ? `${tag.slice(0, 20)}...` : tag}\n \n );\n return isLongTag ? (\n \n {tagElem}\n \n ) : (\n tagElem\n );\n })}\n \n 0 && \"1px solid #ABABAB38\",\n paddingLeft: tags?.length > 0 && \"10px\",\n }}\n >\n {inputVisible ? (\n \n ) : (\n \n Search or Create new tag\n \n )\n }\n onChange={(val) => {\n handleInputConfirm(val);\n }}\n dropdownRender={(menu) => (\n <>\n {menu}\n \n \n {name?.length > 0 && !options && !stateTag?.loading && (\n
\n
\n }\n onClick={addItem}\n >\n {name}\n \n
\n
\n )}\n
\n \n )}\n >\n {options}\n \n ) : (\n \n Add tag\n \n )}\n \n \n );\n};\nexport default TagsSearch;\n","import React from \"react\";\nimport { Tooltip } from \"antd\";\n\nexport const CXTooltip = (props) => {\n return ;\n};\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n/**\n * Wrap of sub component which need use as Button capacity (like Icon component).\n *\n * This helps accessibility reader to tread as a interactive button to operation.\n */\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nvar inlineStyle = {\n border: 0,\n background: 'transparent',\n padding: 0,\n lineHeight: 'inherit',\n display: 'inline-block'\n};\nvar TransButton = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var onKeyDown = function onKeyDown(event) {\n var keyCode = event.keyCode;\n if (keyCode === KeyCode.ENTER) {\n event.preventDefault();\n }\n };\n var onKeyUp = function onKeyUp(event) {\n var keyCode = event.keyCode;\n var onClick = props.onClick;\n if (keyCode === KeyCode.ENTER && onClick) {\n onClick();\n }\n };\n var style = props.style,\n noStyle = props.noStyle,\n disabled = props.disabled,\n restProps = __rest(props, [\"style\", \"noStyle\", \"disabled\"]);\n var mergedStyle = {};\n if (!noStyle) {\n mergedStyle = _extends({}, inlineStyle);\n }\n if (disabled) {\n mergedStyle.pointerEvents = 'none';\n }\n mergedStyle = _extends(_extends({}, mergedStyle), style);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n role: \"button\",\n tabIndex: 0,\n ref: ref\n }, restProps, {\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n style: mergedStyle\n }));\n});\nexport default TransButton;","// This icon file is generated automatically.\nvar EnterOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"enter\", \"theme\": \"outlined\" };\nexport default EnterOutlined;\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 EnterOutlinedSvg from \"@ant-design/icons-svg/es/asn/EnterOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EnterOutlined = function EnterOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EnterOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EnterOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EnterOutlined';\n}\nexport default RefIcon;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport EnterOutlined from \"@ant-design/icons/es/icons/EnterOutlined\";\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport TextArea from '../input/TextArea';\nimport { cloneElement } from '../_util/reactNode';\nvar Editable = function Editable(_ref) {\n var prefixCls = _ref.prefixCls,\n ariaLabel = _ref['aria-label'],\n className = _ref.className,\n style = _ref.style,\n direction = _ref.direction,\n maxLength = _ref.maxLength,\n _ref$autoSize = _ref.autoSize,\n autoSize = _ref$autoSize === void 0 ? true : _ref$autoSize,\n value = _ref.value,\n onSave = _ref.onSave,\n onCancel = _ref.onCancel,\n onEnd = _ref.onEnd,\n component = _ref.component,\n _ref$enterIcon = _ref.enterIcon,\n enterIcon = _ref$enterIcon === void 0 ? /*#__PURE__*/React.createElement(EnterOutlined, null) : _ref$enterIcon;\n var ref = React.useRef(null);\n var inComposition = React.useRef(false);\n var lastKeyCode = React.useRef();\n var _React$useState = React.useState(value),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n current = _React$useState2[0],\n setCurrent = _React$useState2[1];\n React.useEffect(function () {\n setCurrent(value);\n }, [value]);\n React.useEffect(function () {\n if (ref.current && ref.current.resizableTextArea) {\n var textArea = ref.current.resizableTextArea.textArea;\n textArea.focus();\n var length = textArea.value.length;\n textArea.setSelectionRange(length, length);\n }\n }, []);\n var onChange = function onChange(_ref2) {\n var target = _ref2.target;\n setCurrent(target.value.replace(/[\\n\\r]/g, ''));\n };\n var onCompositionStart = function onCompositionStart() {\n inComposition.current = true;\n };\n var onCompositionEnd = function onCompositionEnd() {\n inComposition.current = false;\n };\n var onKeyDown = function onKeyDown(_ref3) {\n var keyCode = _ref3.keyCode;\n // We don't record keyCode when IME is using\n if (inComposition.current) return;\n lastKeyCode.current = keyCode;\n };\n var confirmChange = function confirmChange() {\n onSave(current.trim());\n };\n var onKeyUp = function onKeyUp(_ref4) {\n var keyCode = _ref4.keyCode,\n ctrlKey = _ref4.ctrlKey,\n altKey = _ref4.altKey,\n metaKey = _ref4.metaKey,\n shiftKey = _ref4.shiftKey;\n // Check if it's a real key\n if (lastKeyCode.current === keyCode && !inComposition.current && !ctrlKey && !altKey && !metaKey && !shiftKey) {\n if (keyCode === KeyCode.ENTER) {\n confirmChange();\n onEnd === null || onEnd === void 0 ? void 0 : onEnd();\n } else if (keyCode === KeyCode.ESC) {\n onCancel();\n }\n }\n };\n var onBlur = function onBlur() {\n confirmChange();\n };\n var textClassName = component ? \"\".concat(prefixCls, \"-\").concat(component) : '';\n var textAreaClassName = classNames(prefixCls, \"\".concat(prefixCls, \"-edit-content\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className, textClassName);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: textAreaClassName,\n style: style\n }, /*#__PURE__*/React.createElement(TextArea, {\n ref: ref,\n maxLength: maxLength,\n value: current,\n onChange: onChange,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onCompositionStart: onCompositionStart,\n onCompositionEnd: onCompositionEnd,\n onBlur: onBlur,\n \"aria-label\": ariaLabel,\n rows: 1,\n autoSize: autoSize\n }), enterIcon !== null ? cloneElement(enterIcon, {\n className: \"\".concat(prefixCls, \"-edit-content-confirm\")\n }) : null);\n};\nexport default Editable;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nexport default function useMergedConfig(propConfig, templateConfig) {\n return React.useMemo(function () {\n var support = !!propConfig;\n return [support, _extends(_extends({}, templateConfig), support && _typeof(propConfig) === 'object' ? propConfig : null)];\n }, [propConfig]);\n}","import * as React from 'react';\n/** Similar with `useEffect` but only trigger after mounted */\nvar useUpdatedEffect = function useUpdatedEffect(callback, conditions) {\n var mountRef = React.useRef(false);\n React.useEffect(function () {\n if (mountRef.current) {\n callback();\n } else {\n mountRef.current = true;\n }\n }, conditions);\n};\nexport default useUpdatedEffect;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport warning from '../_util/warning';\nvar Typography = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n _a$component = _a.component,\n Component = _a$component === void 0 ? 'article' : _a$component,\n className = _a.className,\n setContentRef = _a.setContentRef,\n children = _a.children,\n typographyDirection = _a.direction,\n restProps = __rest(_a, [\"prefixCls\", \"component\", \"className\", \"setContentRef\", \"children\", \"direction\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n contextDirection = _React$useContext.direction;\n var direction = typographyDirection !== null && typographyDirection !== void 0 ? typographyDirection : contextDirection;\n var mergedRef = ref;\n if (setContentRef) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Typography', '`setContentRef` is deprecated. Please use `ref` instead.') : void 0;\n mergedRef = composeRef(ref, setContentRef);\n }\n var prefixCls = getPrefixCls('typography', customizePrefixCls);\n var componentClassName = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return (\n /*#__PURE__*/\n // @ts-expect-error: Expression produces a union type that is too complex to represent.\n React.createElement(Component, _extends({\n className: componentClassName,\n ref: mergedRef\n }, restProps), children)\n );\n});\nif (process.env.NODE_ENV !== 'production') {\n Typography.displayName = 'Typography';\n}\n// es default export should use const instead of let\nexport default Typography;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport toArray from \"rc-util/es/Children/toArray\";\nimport useIsomorphicLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport * as React from 'react';\nfunction cuttable(node) {\n var type = _typeof(node);\n return type === 'string' || type === 'number';\n}\nfunction getNodesLen(nodeList) {\n var totalLen = 0;\n nodeList.forEach(function (node) {\n if (cuttable(node)) {\n totalLen += String(node).length;\n } else {\n totalLen += 1;\n }\n });\n return totalLen;\n}\nfunction sliceNodes(nodeList, len) {\n var currLen = 0;\n var currentNodeList = [];\n for (var i = 0; i < nodeList.length; i += 1) {\n // Match to return\n if (currLen === len) {\n return currentNodeList;\n }\n var node = nodeList[i];\n var canCut = cuttable(node);\n var nodeLen = canCut ? String(node).length : 1;\n var nextLen = currLen + nodeLen;\n // Exceed but current not which means we need cut this\n // This will not happen on validate ReactElement\n if (nextLen > len) {\n var restLen = len - currLen;\n currentNodeList.push(String(node).slice(0, restLen));\n return currentNodeList;\n }\n currentNodeList.push(node);\n currLen = nextLen;\n }\n return nodeList;\n}\nvar NONE = 0;\nvar PREPARE = 1;\nvar WALKING = 2;\nvar DONE_WITH_ELLIPSIS = 3;\nvar DONE_WITHOUT_ELLIPSIS = 4;\nvar Ellipsis = function Ellipsis(_ref) {\n var enabledMeasure = _ref.enabledMeasure,\n children = _ref.children,\n text = _ref.text,\n width = _ref.width,\n fontSize = _ref.fontSize,\n rows = _ref.rows,\n onEllipsis = _ref.onEllipsis;\n var _React$useState = React.useState([0, 0, 0]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n _React$useState2$ = _slicedToArray(_React$useState2[0], 3),\n startLen = _React$useState2$[0],\n midLen = _React$useState2$[1],\n endLen = _React$useState2$[2],\n setCutLength = _React$useState2[1];\n var _React$useState3 = React.useState(NONE),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n walkingState = _React$useState4[0],\n setWalkingState = _React$useState4[1];\n var _React$useState5 = React.useState(0),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n singleRowHeight = _React$useState6[0],\n setSingleRowHeight = _React$useState6[1];\n var singleRowRef = React.useRef(null);\n var midRowRef = React.useRef(null);\n var nodeList = React.useMemo(function () {\n return toArray(text);\n }, [text]);\n var totalLen = React.useMemo(function () {\n return getNodesLen(nodeList);\n }, [nodeList]);\n var mergedChildren = React.useMemo(function () {\n if (!enabledMeasure || walkingState !== DONE_WITH_ELLIPSIS) {\n return children(nodeList, false);\n }\n return children(sliceNodes(nodeList, midLen), midLen < totalLen);\n }, [enabledMeasure, walkingState, children, nodeList, midLen, totalLen]);\n // ======================== Walk ========================\n useIsomorphicLayoutEffect(function () {\n if (enabledMeasure && width && fontSize && totalLen) {\n setWalkingState(PREPARE);\n setCutLength([0, Math.ceil(totalLen / 2), totalLen]);\n }\n }, [enabledMeasure, width, fontSize, text, totalLen, rows]);\n useIsomorphicLayoutEffect(function () {\n var _a;\n if (walkingState === PREPARE) {\n setSingleRowHeight(((_a = singleRowRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0);\n }\n }, [walkingState]);\n useIsomorphicLayoutEffect(function () {\n var _a, _b;\n if (singleRowHeight) {\n if (walkingState === PREPARE) {\n // Ignore if position is enough\n var midHeight = ((_a = midRowRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;\n var maxHeight = rows * singleRowHeight;\n if (midHeight <= maxHeight) {\n setWalkingState(DONE_WITHOUT_ELLIPSIS);\n onEllipsis(false);\n } else {\n setWalkingState(WALKING);\n }\n } else if (walkingState === WALKING) {\n if (startLen !== endLen) {\n var _midHeight = ((_b = midRowRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;\n var _maxHeight = rows * singleRowHeight;\n var nextStartLen = startLen;\n var nextEndLen = endLen;\n // We reach the last round\n if (startLen === endLen - 1) {\n nextEndLen = startLen;\n } else if (_midHeight <= _maxHeight) {\n nextStartLen = midLen;\n } else {\n nextEndLen = midLen;\n }\n var nextMidLen = Math.ceil((nextStartLen + nextEndLen) / 2);\n setCutLength([nextStartLen, nextMidLen, nextEndLen]);\n } else {\n setWalkingState(DONE_WITH_ELLIPSIS);\n onEllipsis(true);\n }\n }\n }\n }, [walkingState, startLen, endLen, rows, singleRowHeight]);\n // ======================= Render =======================\n var measureStyle = {\n width: width,\n whiteSpace: 'normal',\n margin: 0,\n padding: 0\n };\n var renderMeasure = function renderMeasure(content, ref, style) {\n return /*#__PURE__*/React.createElement(\"span\", {\n \"aria-hidden\": true,\n ref: ref,\n style: _extends({\n position: 'fixed',\n display: 'block',\n left: 0,\n top: 0,\n zIndex: -9999,\n visibility: 'hidden',\n pointerEvents: 'none',\n fontSize: Math.floor(fontSize / 2) * 2\n }, style)\n }, content);\n };\n var renderMeasureSlice = function renderMeasureSlice(len, ref) {\n var sliceNodeList = sliceNodes(nodeList, len);\n return renderMeasure(children(sliceNodeList, true), ref, measureStyle);\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, mergedChildren, enabledMeasure && walkingState !== DONE_WITH_ELLIPSIS && walkingState !== DONE_WITHOUT_ELLIPSIS && ( /*#__PURE__*/React.createElement(React.Fragment, null, renderMeasure('lg', singleRowRef, {\n wordBreak: 'keep-all',\n whiteSpace: 'nowrap'\n }), walkingState === PREPARE ? renderMeasure(children(nodeList, false), midRowRef, measureStyle) : renderMeasureSlice(midLen, midRowRef))));\n};\nif (process.env.NODE_ENV !== 'production') {\n Ellipsis.displayName = 'Ellipsis';\n}\nexport default Ellipsis;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Tooltip from '../../tooltip';\nvar EllipsisTooltip = function EllipsisTooltip(_ref) {\n var enabledEllipsis = _ref.enabledEllipsis,\n isEllipsis = _ref.isEllipsis,\n children = _ref.children,\n tooltipProps = _ref.tooltipProps;\n if (!(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.title) || !enabledEllipsis) {\n return children;\n }\n return /*#__PURE__*/React.createElement(Tooltip, _extends({\n open: isEllipsis ? undefined : false\n }, tooltipProps), children);\n};\nif (process.env.NODE_ENV !== 'production') {\n EllipsisTooltip.displayName = 'EllipsisTooltip';\n}\nexport default EllipsisTooltip;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CopyOutlined from \"@ant-design/icons/es/icons/CopyOutlined\";\nimport EditOutlined from \"@ant-design/icons/es/icons/EditOutlined\";\nimport classNames from 'classnames';\nimport copy from 'copy-to-clipboard';\nimport ResizeObserver from 'rc-resize-observer';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport useIsomorphicLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport omit from \"rc-util/es/omit\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport { useLocaleReceiver } from '../../locale-provider/LocaleReceiver';\nimport TransButton from '../../_util/transButton';\nimport { isStyleSupport } from '../../_util/styleChecker';\nimport Tooltip from '../../tooltip';\nimport Editable from '../Editable';\nimport useMergedConfig from '../hooks/useMergedConfig';\nimport useUpdatedEffect from '../hooks/useUpdatedEffect';\nimport Typography from '../Typography';\nimport Ellipsis from './Ellipsis';\nimport EllipsisTooltip from './EllipsisTooltip';\nfunction wrapperDecorations(_ref, content) {\n var mark = _ref.mark,\n code = _ref.code,\n underline = _ref.underline,\n del = _ref[\"delete\"],\n strong = _ref.strong,\n keyboard = _ref.keyboard,\n italic = _ref.italic;\n var currentContent = content;\n function wrap(needed, tag) {\n if (!needed) return;\n currentContent = /*#__PURE__*/React.createElement(tag, {}, currentContent);\n }\n wrap(strong, 'strong');\n wrap(underline, 'u');\n wrap(del, 'del');\n wrap(code, 'code');\n wrap(mark, 'mark');\n wrap(keyboard, 'kbd');\n wrap(italic, 'i');\n return currentContent;\n}\nfunction getNode(dom, defaultNode, needDom) {\n if (dom === true || dom === undefined) {\n return defaultNode;\n }\n return dom || needDom && defaultNode;\n}\nfunction toList(val) {\n if (val === false) {\n return [false, false];\n }\n return Array.isArray(val) ? val : [val];\n}\nvar ELLIPSIS_STR = '...';\nvar Base = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _a, _b, _c;\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n type = props.type,\n disabled = props.disabled,\n children = props.children,\n ellipsis = props.ellipsis,\n editable = props.editable,\n copyable = props.copyable,\n component = props.component,\n title = props.title,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"style\", \"type\", \"disabled\", \"children\", \"ellipsis\", \"editable\", \"copyable\", \"component\", \"title\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var textLocale = useLocaleReceiver('Text')[0]; // Force TS get this\n var typographyRef = React.useRef(null);\n var editIconRef = React.useRef(null);\n // ============================ MISC ============================\n var prefixCls = getPrefixCls('typography', customizePrefixCls);\n var textProps = omit(restProps, ['mark', 'code', 'delete', 'underline', 'strong', 'keyboard', 'italic']);\n // ========================== Editable ==========================\n var _useMergedConfig = useMergedConfig(editable),\n _useMergedConfig2 = _slicedToArray(_useMergedConfig, 2),\n enableEdit = _useMergedConfig2[0],\n editConfig = _useMergedConfig2[1];\n var _useMergedState = useMergedState(false, {\n value: editConfig.editing\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n editing = _useMergedState2[0],\n setEditing = _useMergedState2[1];\n var _editConfig$triggerTy = editConfig.triggerType,\n triggerType = _editConfig$triggerTy === void 0 ? ['icon'] : _editConfig$triggerTy;\n var triggerEdit = function triggerEdit(edit) {\n var _a;\n if (edit) {\n (_a = editConfig.onStart) === null || _a === void 0 ? void 0 : _a.call(editConfig);\n }\n setEditing(edit);\n };\n // Focus edit icon when back\n useUpdatedEffect(function () {\n var _a;\n if (!editing) {\n (_a = editIconRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }, [editing]);\n var onEditClick = function onEditClick(e) {\n e === null || e === void 0 ? void 0 : e.preventDefault();\n triggerEdit(true);\n };\n var onEditChange = function onEditChange(value) {\n var _a;\n (_a = editConfig.onChange) === null || _a === void 0 ? void 0 : _a.call(editConfig, value);\n triggerEdit(false);\n };\n var onEditCancel = function onEditCancel() {\n var _a;\n (_a = editConfig.onCancel) === null || _a === void 0 ? void 0 : _a.call(editConfig);\n triggerEdit(false);\n };\n // ========================== Copyable ==========================\n var _useMergedConfig3 = useMergedConfig(copyable),\n _useMergedConfig4 = _slicedToArray(_useMergedConfig3, 2),\n enableCopy = _useMergedConfig4[0],\n copyConfig = _useMergedConfig4[1];\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n copied = _React$useState2[0],\n setCopied = _React$useState2[1];\n var copyIdRef = React.useRef();\n var copyOptions = {};\n if (copyConfig.format) {\n copyOptions.format = copyConfig.format;\n }\n var cleanCopyId = function cleanCopyId() {\n window.clearTimeout(copyIdRef.current);\n };\n var onCopyClick = function onCopyClick(e) {\n var _a;\n e === null || e === void 0 ? void 0 : e.preventDefault();\n e === null || e === void 0 ? void 0 : e.stopPropagation();\n copy(copyConfig.text || String(children) || '', copyOptions);\n setCopied(true);\n // Trigger tips update\n cleanCopyId();\n copyIdRef.current = window.setTimeout(function () {\n setCopied(false);\n }, 3000);\n (_a = copyConfig.onCopy) === null || _a === void 0 ? void 0 : _a.call(copyConfig, e);\n };\n React.useEffect(function () {\n return cleanCopyId;\n }, []);\n // ========================== Ellipsis ==========================\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n isLineClampSupport = _React$useState4[0],\n setIsLineClampSupport = _React$useState4[1];\n var _React$useState5 = React.useState(false),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n isTextOverflowSupport = _React$useState6[0],\n setIsTextOverflowSupport = _React$useState6[1];\n var _React$useState7 = React.useState(false),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n expanded = _React$useState8[0],\n setExpanded = _React$useState8[1];\n var _React$useState9 = React.useState(false),\n _React$useState10 = _slicedToArray(_React$useState9, 2),\n isJsEllipsis = _React$useState10[0],\n setIsJsEllipsis = _React$useState10[1];\n var _React$useState11 = React.useState(false),\n _React$useState12 = _slicedToArray(_React$useState11, 2),\n isNativeEllipsis = _React$useState12[0],\n setIsNativeEllipsis = _React$useState12[1];\n var _React$useState13 = React.useState(true),\n _React$useState14 = _slicedToArray(_React$useState13, 2),\n isNativeVisible = _React$useState14[0],\n setIsNativeVisible = _React$useState14[1];\n var _useMergedConfig5 = useMergedConfig(ellipsis, {\n expandable: false\n }),\n _useMergedConfig6 = _slicedToArray(_useMergedConfig5, 2),\n enableEllipsis = _useMergedConfig6[0],\n ellipsisConfig = _useMergedConfig6[1];\n var mergedEnableEllipsis = enableEllipsis && !expanded;\n // Shared prop to reduce bundle size\n var _ellipsisConfig$rows = ellipsisConfig.rows,\n rows = _ellipsisConfig$rows === void 0 ? 1 : _ellipsisConfig$rows;\n var needMeasureEllipsis = React.useMemo(function () {\n return (\n // Disable ellipsis\n !mergedEnableEllipsis ||\n // Provide suffix\n ellipsisConfig.suffix !== undefined || ellipsisConfig.onEllipsis ||\n // Can't use css ellipsis since we need to provide the place for button\n ellipsisConfig.expandable || enableEdit || enableCopy\n );\n }, [mergedEnableEllipsis, ellipsisConfig, enableEdit, enableCopy]);\n useIsomorphicLayoutEffect(function () {\n if (enableEllipsis && !needMeasureEllipsis) {\n setIsLineClampSupport(isStyleSupport('webkitLineClamp'));\n setIsTextOverflowSupport(isStyleSupport('textOverflow'));\n }\n }, [needMeasureEllipsis, enableEllipsis]);\n var cssEllipsis = React.useMemo(function () {\n if (needMeasureEllipsis) {\n return false;\n }\n if (rows === 1) {\n return isTextOverflowSupport;\n }\n return isLineClampSupport;\n }, [needMeasureEllipsis, isTextOverflowSupport, isLineClampSupport]);\n var isMergedEllipsis = mergedEnableEllipsis && (cssEllipsis ? isNativeEllipsis : isJsEllipsis);\n var cssTextOverflow = mergedEnableEllipsis && rows === 1 && cssEllipsis;\n var cssLineClamp = mergedEnableEllipsis && rows > 1 && cssEllipsis;\n // >>>>> Expand\n var onExpandClick = function onExpandClick(e) {\n var _a;\n setExpanded(true);\n (_a = ellipsisConfig.onExpand) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, e);\n };\n var _React$useState15 = React.useState(0),\n _React$useState16 = _slicedToArray(_React$useState15, 2),\n ellipsisWidth = _React$useState16[0],\n setEllipsisWidth = _React$useState16[1];\n var _React$useState17 = React.useState(0),\n _React$useState18 = _slicedToArray(_React$useState17, 2),\n ellipsisFontSize = _React$useState18[0],\n setEllipsisFontSize = _React$useState18[1];\n var onResize = function onResize(_ref2, element) {\n var offsetWidth = _ref2.offsetWidth;\n var _a;\n setEllipsisWidth(offsetWidth);\n setEllipsisFontSize(parseInt((_a = window.getComputedStyle) === null || _a === void 0 ? void 0 : _a.call(window, element).fontSize, 10) || 0);\n };\n // >>>>> JS Ellipsis\n var onJsEllipsis = function onJsEllipsis(jsEllipsis) {\n var _a;\n setIsJsEllipsis(jsEllipsis);\n // Trigger if changed\n if (isJsEllipsis !== jsEllipsis) {\n (_a = ellipsisConfig.onEllipsis) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, jsEllipsis);\n }\n };\n // >>>>> Native ellipsis\n React.useEffect(function () {\n var textEle = typographyRef.current;\n if (enableEllipsis && cssEllipsis && textEle) {\n var currentEllipsis = cssLineClamp ? textEle.offsetHeight < textEle.scrollHeight : textEle.offsetWidth < textEle.scrollWidth;\n if (isNativeEllipsis !== currentEllipsis) {\n setIsNativeEllipsis(currentEllipsis);\n }\n }\n }, [enableEllipsis, cssEllipsis, children, cssLineClamp, isNativeVisible]);\n // https://github.com/ant-design/ant-design/issues/36786\n // Use IntersectionObserver to check if element is invisible\n React.useEffect(function () {\n var textEle = typographyRef.current;\n if (typeof IntersectionObserver === 'undefined' || !textEle || !cssEllipsis || !mergedEnableEllipsis) {\n return;\n }\n /* eslint-disable-next-line compat/compat */\n var observer = new IntersectionObserver(function () {\n setIsNativeVisible(!!textEle.offsetParent);\n });\n observer.observe(textEle);\n return function () {\n observer.disconnect();\n };\n }, [cssEllipsis, mergedEnableEllipsis]);\n // ========================== Tooltip ===========================\n var tooltipProps = {};\n if (ellipsisConfig.tooltip === true) {\n tooltipProps = {\n title: (_a = editConfig.text) !== null && _a !== void 0 ? _a : children\n };\n } else if ( /*#__PURE__*/React.isValidElement(ellipsisConfig.tooltip)) {\n tooltipProps = {\n title: ellipsisConfig.tooltip\n };\n } else if (_typeof(ellipsisConfig.tooltip) === 'object') {\n tooltipProps = _extends({\n title: (_b = editConfig.text) !== null && _b !== void 0 ? _b : children\n }, ellipsisConfig.tooltip);\n } else {\n tooltipProps = {\n title: ellipsisConfig.tooltip\n };\n }\n var topAriaLabel = React.useMemo(function () {\n var isValid = function isValid(val) {\n return ['string', 'number'].includes(_typeof(val));\n };\n if (!enableEllipsis || cssEllipsis) {\n return undefined;\n }\n if (isValid(editConfig.text)) {\n return editConfig.text;\n }\n if (isValid(children)) {\n return children;\n }\n if (isValid(title)) {\n return title;\n }\n if (isValid(tooltipProps.title)) {\n return tooltipProps.title;\n }\n return undefined;\n }, [enableEllipsis, cssEllipsis, title, tooltipProps.title, isMergedEllipsis]);\n // =========================== Render ===========================\n // >>>>>>>>>>> Editing input\n if (editing) {\n return /*#__PURE__*/React.createElement(Editable, {\n value: (_c = editConfig.text) !== null && _c !== void 0 ? _c : typeof children === 'string' ? children : '',\n onSave: onEditChange,\n onCancel: onEditCancel,\n onEnd: editConfig.onEnd,\n prefixCls: prefixCls,\n className: className,\n style: style,\n direction: direction,\n component: component,\n maxLength: editConfig.maxLength,\n autoSize: editConfig.autoSize,\n enterIcon: editConfig.enterIcon\n });\n }\n // >>>>>>>>>>> Typography\n // Expand\n var renderExpand = function renderExpand() {\n var expandable = ellipsisConfig.expandable,\n symbol = ellipsisConfig.symbol;\n if (!expandable) return null;\n var expandContent;\n if (symbol) {\n expandContent = symbol;\n } else {\n expandContent = textLocale.expand;\n }\n return /*#__PURE__*/React.createElement(\"a\", {\n key: \"expand\",\n className: \"\".concat(prefixCls, \"-expand\"),\n onClick: onExpandClick,\n \"aria-label\": textLocale.expand\n }, expandContent);\n };\n // Edit\n var renderEdit = function renderEdit() {\n if (!enableEdit) return;\n var icon = editConfig.icon,\n tooltip = editConfig.tooltip;\n var editTitle = toArray(tooltip)[0] || textLocale.edit;\n var ariaLabel = typeof editTitle === 'string' ? editTitle : '';\n return triggerType.includes('icon') ? ( /*#__PURE__*/React.createElement(Tooltip, {\n key: \"edit\",\n title: tooltip === false ? '' : editTitle\n }, /*#__PURE__*/React.createElement(TransButton, {\n ref: editIconRef,\n className: \"\".concat(prefixCls, \"-edit\"),\n onClick: onEditClick,\n \"aria-label\": ariaLabel\n }, icon || /*#__PURE__*/React.createElement(EditOutlined, {\n role: \"button\"\n })))) : null;\n };\n // Copy\n var renderCopy = function renderCopy() {\n if (!enableCopy) return;\n var tooltips = copyConfig.tooltips,\n icon = copyConfig.icon;\n var tooltipNodes = toList(tooltips);\n var iconNodes = toList(icon);\n var copyTitle = copied ? getNode(tooltipNodes[1], textLocale.copied) : getNode(tooltipNodes[0], textLocale.copy);\n var systemStr = copied ? textLocale.copied : textLocale.copy;\n var ariaLabel = typeof copyTitle === 'string' ? copyTitle : systemStr;\n return /*#__PURE__*/React.createElement(Tooltip, {\n key: \"copy\",\n title: copyTitle\n }, /*#__PURE__*/React.createElement(TransButton, {\n className: classNames(\"\".concat(prefixCls, \"-copy\"), copied && \"\".concat(prefixCls, \"-copy-success\")),\n onClick: onCopyClick,\n \"aria-label\": ariaLabel\n }, copied ? getNode(iconNodes[1], /*#__PURE__*/React.createElement(CheckOutlined, null), true) : getNode(iconNodes[0], /*#__PURE__*/React.createElement(CopyOutlined, null), true)));\n };\n var renderOperations = function renderOperations(renderExpanded) {\n return [renderExpanded && renderExpand(), renderEdit(), renderCopy()];\n };\n var renderEllipsis = function renderEllipsis(needEllipsis) {\n return [needEllipsis && ( /*#__PURE__*/React.createElement(\"span\", {\n \"aria-hidden\": true,\n key: \"ellipsis\"\n }, ELLIPSIS_STR)), ellipsisConfig.suffix, renderOperations(needEllipsis)];\n };\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onResize,\n disabled: !mergedEnableEllipsis || cssEllipsis\n }, function (resizeRef) {\n return /*#__PURE__*/React.createElement(EllipsisTooltip, {\n tooltipProps: tooltipProps,\n enabledEllipsis: mergedEnableEllipsis,\n isEllipsis: isMergedEllipsis\n }, /*#__PURE__*/React.createElement(Typography, _extends({\n className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(type), type), \"\".concat(prefixCls, \"-disabled\"), disabled), \"\".concat(prefixCls, \"-ellipsis\"), enableEllipsis), \"\".concat(prefixCls, \"-single-line\"), mergedEnableEllipsis && rows === 1), \"\".concat(prefixCls, \"-ellipsis-single-line\"), cssTextOverflow), \"\".concat(prefixCls, \"-ellipsis-multiple-line\"), cssLineClamp), className),\n prefixCls: customizePrefixCls,\n style: _extends(_extends({}, style), {\n WebkitLineClamp: cssLineClamp ? rows : undefined\n }),\n component: component,\n ref: composeRef(resizeRef, typographyRef, ref),\n direction: direction,\n onClick: triggerType.includes('text') ? onEditClick : undefined,\n \"aria-label\": topAriaLabel === null || topAriaLabel === void 0 ? void 0 : topAriaLabel.toString(),\n title: title\n }, textProps), /*#__PURE__*/React.createElement(Ellipsis, {\n enabledMeasure: mergedEnableEllipsis && !cssEllipsis,\n text: children,\n rows: rows,\n width: ellipsisWidth,\n fontSize: ellipsisFontSize,\n onEllipsis: onJsEllipsis\n }, function (node, needEllipsis) {\n var renderNode = node;\n if (node.length && needEllipsis && topAriaLabel) {\n renderNode = /*#__PURE__*/React.createElement(\"span\", {\n key: \"show-content\",\n \"aria-hidden\": true\n }, renderNode);\n }\n var wrappedContext = wrapperDecorations(props, /*#__PURE__*/React.createElement(React.Fragment, null, renderNode, renderEllipsis(needEllipsis)));\n return wrappedContext;\n })));\n });\n});\nexport default Base;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport warning from '../_util/warning';\nimport Base from './Base';\nvar Link = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var ellipsis = _a.ellipsis,\n rel = _a.rel,\n restProps = __rest(_a, [\"ellipsis\", \"rel\"]);\n process.env.NODE_ENV !== \"production\" ? warning(_typeof(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.') : void 0;\n var mergedProps = _extends(_extends({}, restProps), {\n rel: rel === undefined && restProps.target === '_blank' ? 'noopener noreferrer' : rel\n });\n // @ts-expect-error: https://github.com/ant-design/ant-design/issues/26622\n delete mergedProps.navigate;\n return /*#__PURE__*/React.createElement(Base, _extends({}, mergedProps, {\n ref: ref,\n ellipsis: !!ellipsis,\n component: \"a\"\n }));\n});\nexport default Link;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Base from './Base';\nvar Paragraph = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(Base, _extends({\n ref: ref\n }, props, {\n component: \"div\"\n }));\n});\nexport default Paragraph;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport warning from '../_util/warning';\nimport Base from './Base';\nvar Text = function Text(_a, ref) {\n var ellipsis = _a.ellipsis,\n restProps = __rest(_a, [\"ellipsis\"]);\n var mergedEllipsis = React.useMemo(function () {\n if (ellipsis && _typeof(ellipsis) === 'object') {\n return omit(ellipsis, ['expandable', 'rows']);\n }\n return ellipsis;\n }, [ellipsis]);\n process.env.NODE_ENV !== \"production\" ? warning(_typeof(ellipsis) !== 'object' || !ellipsis || !('expandable' in ellipsis) && !('rows' in ellipsis), 'Typography.Text', '`ellipsis` do not support `expandable` or `rows` props.') : void 0;\n return /*#__PURE__*/React.createElement(Base, _extends({\n ref: ref\n }, restProps, {\n ellipsis: mergedEllipsis,\n component: \"span\"\n }));\n};\nexport default /*#__PURE__*/React.forwardRef(Text);","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { tupleNum } from '../_util/type';\nimport warning from '../_util/warning';\nimport Base from './Base';\nvar TITLE_ELE_LIST = tupleNum(1, 2, 3, 4, 5);\nvar Title = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$level = props.level,\n level = _props$level === void 0 ? 1 : _props$level,\n restProps = __rest(props, [\"level\"]);\n var component;\n if (TITLE_ELE_LIST.includes(level)) {\n component = \"h\".concat(level);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Typography.Title', 'Title only accept `1 | 2 | 3 | 4 | 5` as `level` value. And `5` need 4.6.0+ version.') : void 0;\n component = 'h1';\n }\n return /*#__PURE__*/React.createElement(Base, _extends({\n ref: ref\n }, restProps, {\n component: component\n }));\n});\nexport default Title;","import Link from './Link';\nimport Paragraph from './Paragraph';\nimport Text from './Text';\nimport Title from './Title';\nimport OriginTypography from './Typography';\nvar Typography = OriginTypography;\nTypography.Text = Text;\nTypography.Link = Link;\nTypography.Title = Title;\nTypography.Paragraph = Paragraph;\nexport default Typography;","import React from \"react\";\nimport { Typography } from \"antd\";\n\nexport const CXText = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXTitle = ({ children, ...props }) => {\n return {children};\n};\n\nexport const CXParagraph = ({ children, ...props }) => {\n return {children};\n};\n","function getError(option, xhr) {\n var msg = \"cannot \".concat(option.method, \" \").concat(option.action, \" \").concat(xhr.status, \"'\");\n var err = new Error(msg);\n err.status = xhr.status;\n err.method = option.method;\n err.url = option.action;\n return err;\n}\nfunction getBody(xhr) {\n var text = xhr.responseText || xhr.response;\n if (!text) {\n return text;\n }\n try {\n return JSON.parse(text);\n } catch (e) {\n return text;\n }\n}\nexport default function upload(option) {\n // eslint-disable-next-line no-undef\n var xhr = new XMLHttpRequest();\n if (option.onProgress && xhr.upload) {\n xhr.upload.onprogress = function progress(e) {\n if (e.total > 0) {\n e.percent = e.loaded / e.total * 100;\n }\n option.onProgress(e);\n };\n }\n // eslint-disable-next-line no-undef\n var formData = new FormData();\n if (option.data) {\n Object.keys(option.data).forEach(function (key) {\n var value = option.data[key];\n // support key-value array data\n if (Array.isArray(value)) {\n value.forEach(function (item) {\n // { list: [ 11, 22 ] }\n // formData.append('list[]', 11);\n formData.append(\"\".concat(key, \"[]\"), item);\n });\n return;\n }\n formData.append(key, value);\n });\n }\n // eslint-disable-next-line no-undef\n if (option.file instanceof Blob) {\n formData.append(option.filename, option.file, option.file.name);\n } else {\n formData.append(option.filename, option.file);\n }\n xhr.onerror = function error(e) {\n option.onError(e);\n };\n xhr.onload = function onload() {\n // allow success when 2xx status\n // see https://github.com/react-component/upload/issues/34\n if (xhr.status < 200 || xhr.status >= 300) {\n return option.onError(getError(option, xhr), getBody(xhr));\n }\n return option.onSuccess(getBody(xhr), xhr);\n };\n xhr.open(option.method, option.action, true);\n // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n if (option.withCredentials && 'withCredentials' in xhr) {\n xhr.withCredentials = true;\n }\n var headers = option.headers || {};\n // when set headers['X-Requested-With'] = null , can close default XHR header\n // see https://github.com/react-component/upload/issues/33\n if (headers['X-Requested-With'] !== null) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n Object.keys(headers).forEach(function (h) {\n if (headers[h] !== null) {\n xhr.setRequestHeader(h, headers[h]);\n }\n });\n xhr.send(formData);\n return {\n abort: function abort() {\n xhr.abort();\n }\n };\n}","var now = +new Date();\nvar index = 0;\nexport default function uid() {\n // eslint-disable-next-line no-plusplus\n return \"rc-upload-\".concat(now, \"-\").concat(++index);\n}","import warning from \"rc-util/es/warning\";\nexport default (function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = file.type || '';\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim();\n // This is something like */*,* allow all files\n if (/^\\*(\\/\\*)?$/.test(type)) {\n return true;\n }\n // like .jpg, .png\n if (validType.charAt(0) === '.') {\n var lowerFileName = fileName.toLowerCase();\n var lowerType = validType.toLowerCase();\n var affixList = [lowerType];\n if (lowerType === '.jpg' || lowerType === '.jpeg') {\n affixList = ['.jpg', '.jpeg'];\n }\n return affixList.some(function (affix) {\n return lowerFileName.endsWith(affix);\n });\n }\n // This is something like a image/* mime type\n if (/\\/\\*$/.test(validType)) {\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n // Full match\n if (mimeType === validType) {\n return true;\n }\n // Invalidate type should skip\n if (/^\\w+$/.test(validType)) {\n warning(false, \"Upload takes an invalidate 'accept' type '\".concat(validType, \"'.Skip for check.\"));\n return true;\n }\n return false;\n });\n }\n return true;\n});","function loopFiles(item, callback) {\n var dirReader = item.createReader();\n var fileList = [];\n function sequence() {\n dirReader.readEntries(function (entries) {\n var entryList = Array.prototype.slice.apply(entries);\n fileList = fileList.concat(entryList);\n // Check if all the file has been viewed\n var isFinished = !entryList.length;\n if (isFinished) {\n callback(fileList);\n } else {\n sequence();\n }\n });\n }\n sequence();\n}\nvar traverseFileTree = function traverseFileTree(files, callback, isAccepted) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n var _traverseFileTree = function _traverseFileTree(item, path) {\n if (!item) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n item.path = path || '';\n if (item.isFile) {\n item.file(function (file) {\n if (isAccepted(file)) {\n // https://github.com/ant-design/ant-design/issues/16426\n if (item.fullPath && !file.webkitRelativePath) {\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: true\n }\n });\n // eslint-disable-next-line no-param-reassign\n file.webkitRelativePath = item.fullPath.replace(/^\\//, '');\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: false\n }\n });\n }\n callback([file]);\n }\n });\n } else if (item.isDirectory) {\n loopFiles(item, function (entries) {\n entries.forEach(function (entryItem) {\n _traverseFileTree(entryItem, \"\".concat(path).concat(item.name, \"/\"));\n });\n });\n }\n };\n files.forEach(function (file) {\n _traverseFileTree(file.webkitGetAsEntry());\n });\n};\nexport default traverseFileTree;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nvar _excluded = [\"component\", \"prefixCls\", \"className\", \"disabled\", \"id\", \"style\", \"multiple\", \"accept\", \"capture\", \"children\", \"directory\", \"openFileDialogOnClick\", \"onMouseEnter\", \"onMouseLeave\"];\nimport React, { Component } from 'react';\nimport classNames from 'classnames';\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport defaultRequest from './request';\nimport getUid from './uid';\nimport attrAccept from './attr-accept';\nimport traverseFileTree from './traverseFileTree';\nvar AjaxUploader = /*#__PURE__*/function (_Component) {\n _inherits(AjaxUploader, _Component);\n var _super = _createSuper(AjaxUploader);\n function AjaxUploader() {\n var _this;\n _classCallCheck(this, AjaxUploader);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.state = {\n uid: getUid()\n };\n _this.reqs = {};\n _this.fileInput = void 0;\n _this._isMounted = void 0;\n _this.onChange = function (e) {\n var _this$props = _this.props,\n accept = _this$props.accept,\n directory = _this$props.directory;\n var files = e.target.files;\n var acceptedFiles = _toConsumableArray(files).filter(function (file) {\n return !directory || attrAccept(file, accept);\n });\n _this.uploadFiles(acceptedFiles);\n _this.reset();\n };\n _this.onClick = function (e) {\n var el = _this.fileInput;\n if (!el) {\n return;\n }\n var target = e.target;\n var onClick = _this.props.onClick;\n if (target && target.tagName === 'BUTTON') {\n var parent = el.parentNode;\n parent.focus();\n target.blur();\n }\n el.click();\n if (onClick) {\n onClick(e);\n }\n };\n _this.onKeyDown = function (e) {\n if (e.key === 'Enter') {\n _this.onClick(e);\n }\n };\n _this.onFileDrop = function (e) {\n var multiple = _this.props.multiple;\n e.preventDefault();\n if (e.type === 'dragover') {\n return;\n }\n if (_this.props.directory) {\n traverseFileTree(Array.prototype.slice.call(e.dataTransfer.items), _this.uploadFiles, function (_file) {\n return attrAccept(_file, _this.props.accept);\n });\n } else {\n var files = _toConsumableArray(e.dataTransfer.files).filter(function (file) {\n return attrAccept(file, _this.props.accept);\n });\n if (multiple === false) {\n files = files.slice(0, 1);\n }\n _this.uploadFiles(files);\n }\n };\n _this.uploadFiles = function (files) {\n var originFiles = _toConsumableArray(files);\n var postFiles = originFiles.map(function (file) {\n // eslint-disable-next-line no-param-reassign\n file.uid = getUid();\n return _this.processFile(file, originFiles);\n });\n // Batch upload files\n Promise.all(postFiles).then(function (fileList) {\n var onBatchStart = _this.props.onBatchStart;\n onBatchStart === null || onBatchStart === void 0 ? void 0 : onBatchStart(fileList.map(function (_ref) {\n var origin = _ref.origin,\n parsedFile = _ref.parsedFile;\n return {\n file: origin,\n parsedFile: parsedFile\n };\n }));\n fileList.filter(function (file) {\n return file.parsedFile !== null;\n }).forEach(function (file) {\n _this.post(file);\n });\n });\n };\n /**\n * Process file before upload. When all the file is ready, we start upload.\n */\n _this.processFile = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, fileList) {\n var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n beforeUpload = _this.props.beforeUpload;\n transformedFile = file;\n if (!beforeUpload) {\n _context.next = 14;\n break;\n }\n _context.prev = 3;\n _context.next = 6;\n return beforeUpload(file, fileList);\n case 6:\n transformedFile = _context.sent;\n _context.next = 12;\n break;\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](3);\n // Rejection will also trade as false\n transformedFile = false;\n case 12:\n if (!(transformedFile === false)) {\n _context.next = 14;\n break;\n }\n return _context.abrupt(\"return\", {\n origin: file,\n parsedFile: null,\n action: null,\n data: null\n });\n case 14:\n // Get latest action\n action = _this.props.action;\n if (!(typeof action === 'function')) {\n _context.next = 21;\n break;\n }\n _context.next = 18;\n return action(file);\n case 18:\n mergedAction = _context.sent;\n _context.next = 22;\n break;\n case 21:\n mergedAction = action;\n case 22:\n // Get latest data\n data = _this.props.data;\n if (!(typeof data === 'function')) {\n _context.next = 29;\n break;\n }\n _context.next = 26;\n return data(file);\n case 26:\n mergedData = _context.sent;\n _context.next = 30;\n break;\n case 29:\n mergedData = data;\n case 30:\n parsedData =\n // string type is from legacy `transformFile`.\n // Not sure if this will work since no related test case works with it\n (_typeof(transformedFile) === 'object' || typeof transformedFile === 'string') && transformedFile ? transformedFile : file;\n if (parsedData instanceof File) {\n parsedFile = parsedData;\n } else {\n parsedFile = new File([parsedData], file.name, {\n type: file.type\n });\n }\n mergedParsedFile = parsedFile;\n mergedParsedFile.uid = file.uid;\n return _context.abrupt(\"return\", {\n origin: file,\n data: mergedData,\n parsedFile: mergedParsedFile,\n action: mergedAction\n });\n case 35:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[3, 9]]);\n }));\n return function (_x, _x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n _this.saveFileInput = function (node) {\n _this.fileInput = node;\n };\n return _this;\n }\n _createClass(AjaxUploader, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this._isMounted = true;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this._isMounted = false;\n this.abort();\n }\n }, {\n key: \"post\",\n value: function post(_ref3) {\n var _this2 = this;\n var data = _ref3.data,\n origin = _ref3.origin,\n action = _ref3.action,\n parsedFile = _ref3.parsedFile;\n if (!this._isMounted) {\n return;\n }\n var _this$props2 = this.props,\n onStart = _this$props2.onStart,\n customRequest = _this$props2.customRequest,\n name = _this$props2.name,\n headers = _this$props2.headers,\n withCredentials = _this$props2.withCredentials,\n method = _this$props2.method;\n var uid = origin.uid;\n var request = customRequest || defaultRequest;\n var requestOption = {\n action: action,\n filename: name,\n data: data,\n file: parsedFile,\n headers: headers,\n withCredentials: withCredentials,\n method: method || 'post',\n onProgress: function onProgress(e) {\n var onProgress = _this2.props.onProgress;\n onProgress === null || onProgress === void 0 ? void 0 : onProgress(e, parsedFile);\n },\n onSuccess: function onSuccess(ret, xhr) {\n var onSuccess = _this2.props.onSuccess;\n onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(ret, parsedFile, xhr);\n delete _this2.reqs[uid];\n },\n onError: function onError(err, ret) {\n var onError = _this2.props.onError;\n onError === null || onError === void 0 ? void 0 : onError(err, ret, parsedFile);\n delete _this2.reqs[uid];\n }\n };\n onStart(origin);\n this.reqs[uid] = request(requestOption);\n }\n }, {\n key: \"reset\",\n value: function reset() {\n this.setState({\n uid: getUid()\n });\n }\n }, {\n key: \"abort\",\n value: function abort(file) {\n var reqs = this.reqs;\n if (file) {\n var uid = file.uid ? file.uid : file;\n if (reqs[uid] && reqs[uid].abort) {\n reqs[uid].abort();\n }\n delete reqs[uid];\n } else {\n Object.keys(reqs).forEach(function (uid) {\n if (reqs[uid] && reqs[uid].abort) {\n reqs[uid].abort();\n }\n delete reqs[uid];\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n Tag = _this$props3.component,\n prefixCls = _this$props3.prefixCls,\n className = _this$props3.className,\n disabled = _this$props3.disabled,\n id = _this$props3.id,\n style = _this$props3.style,\n multiple = _this$props3.multiple,\n accept = _this$props3.accept,\n capture = _this$props3.capture,\n children = _this$props3.children,\n directory = _this$props3.directory,\n openFileDialogOnClick = _this$props3.openFileDialogOnClick,\n onMouseEnter = _this$props3.onMouseEnter,\n onMouseLeave = _this$props3.onMouseLeave,\n otherProps = _objectWithoutProperties(_this$props3, _excluded);\n var cls = classNames(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), \"\".concat(prefixCls, \"-disabled\"), disabled), className, className));\n // because input don't have directory/webkitdirectory type declaration\n var dirProps = directory ? {\n directory: 'directory',\n webkitdirectory: 'webkitdirectory'\n } : {};\n var events = disabled ? {} : {\n onClick: openFileDialogOnClick ? this.onClick : function () {},\n onKeyDown: openFileDialogOnClick ? this.onKeyDown : function () {},\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onDrop: this.onFileDrop,\n onDragOver: this.onFileDrop,\n tabIndex: '0'\n };\n return /*#__PURE__*/React.createElement(Tag, _extends({}, events, {\n className: cls,\n role: \"button\",\n style: style\n }), /*#__PURE__*/React.createElement(\"input\", _extends({}, pickAttrs(otherProps, {\n aria: true,\n data: true\n }), {\n id: id,\n disabled: disabled,\n type: \"file\",\n ref: this.saveFileInput,\n onClick: function onClick(e) {\n return e.stopPropagation();\n } // https://github.com/ant-design/ant-design/issues/19948\n ,\n key: this.state.uid,\n style: {\n display: 'none'\n },\n accept: accept\n }, dirProps, {\n multiple: multiple,\n onChange: this.onChange\n }, capture != null ? {\n capture: capture\n } : {})), children);\n }\n }]);\n return AjaxUploader;\n}(Component);\nexport default AjaxUploader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\n/* eslint react/prop-types:0 */\nimport React, { Component } from 'react';\nimport AjaxUpload from './AjaxUploader';\nfunction empty() {}\nvar Upload = /*#__PURE__*/function (_Component) {\n _inherits(Upload, _Component);\n var _super = _createSuper(Upload);\n function Upload() {\n var _this;\n _classCallCheck(this, Upload);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.uploader = void 0;\n _this.saveUploader = function (node) {\n _this.uploader = node;\n };\n return _this;\n }\n _createClass(Upload, [{\n key: \"abort\",\n value: function abort(file) {\n this.uploader.abort(file);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(AjaxUpload, _extends({}, this.props, {\n ref: this.saveUploader\n }));\n }\n }]);\n return Upload;\n}(Component);\nUpload.defaultProps = {\n component: 'span',\n prefixCls: 'rc-upload',\n data: {},\n headers: {},\n name: 'file',\n multipart: false,\n onStart: empty,\n onError: empty,\n onSuccess: empty,\n multiple: false,\n beforeUpload: null,\n customRequest: null,\n withCredentials: false,\n openFileDialogOnClick: true\n};\nexport default Upload;","import Upload from './Upload';\nexport default Upload;","// This icon file is generated automatically.\nvar FileTwoTone = { \"icon\": function render(primaryColor, secondaryColor) { return { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z\", \"fill\": secondaryColor } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z\", \"fill\": primaryColor } }] }; }, \"name\": \"file\", \"theme\": \"twotone\" };\nexport default FileTwoTone;\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 FileTwoToneSvg from \"@ant-design/icons-svg/es/asn/FileTwoTone\";\nimport AntdIcon from '../components/AntdIcon';\nvar FileTwoTone = function FileTwoTone(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FileTwoToneSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FileTwoTone);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FileTwoTone';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PictureTwoTone = { \"icon\": function render(primaryColor, secondaryColor) { return { \"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 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z\", \"fill\": primaryColor } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z\", \"fill\": secondaryColor } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z\", \"fill\": secondaryColor } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M276 368a28 28 0 1056 0 28 28 0 10-56 0z\", \"fill\": secondaryColor } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z\", \"fill\": primaryColor } }] }; }, \"name\": \"picture\", \"theme\": \"twotone\" };\nexport default PictureTwoTone;\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 PictureTwoToneSvg from \"@ant-design/icons-svg/es/asn/PictureTwoTone\";\nimport AntdIcon from '../components/AntdIcon';\nvar PictureTwoTone = function PictureTwoTone(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PictureTwoToneSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PictureTwoTone);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PictureTwoTone';\n}\nexport default RefIcon;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function file2Obj(file) {\n return _extends(_extends({}, file), {\n lastModified: file.lastModified,\n lastModifiedDate: file.lastModifiedDate,\n name: file.name,\n size: file.size,\n type: file.type,\n uid: file.uid,\n percent: 0,\n originFileObj: file\n });\n}\n/** Upload fileList. Replace file if exist or just push into it. */\nexport function updateFileList(file, fileList) {\n var nextFileList = _toConsumableArray(fileList);\n var fileIndex = nextFileList.findIndex(function (_ref) {\n var uid = _ref.uid;\n return uid === file.uid;\n });\n if (fileIndex === -1) {\n nextFileList.push(file);\n } else {\n nextFileList[fileIndex] = file;\n }\n return nextFileList;\n}\nexport function getFileItem(file, fileList) {\n var matchKey = file.uid !== undefined ? 'uid' : 'name';\n return fileList.filter(function (item) {\n return item[matchKey] === file[matchKey];\n })[0];\n}\nexport function removeFileItem(file, fileList) {\n var matchKey = file.uid !== undefined ? 'uid' : 'name';\n var removed = fileList.filter(function (item) {\n return item[matchKey] !== file[matchKey];\n });\n if (removed.length === fileList.length) {\n return null;\n }\n return removed;\n}\n// ==================== Default Image Preview ====================\nvar extname = function extname() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var temp = url.split('/');\n var filename = temp[temp.length - 1];\n var filenameWithoutSuffix = filename.split(/#|\\?/)[0];\n return (/\\.[^./\\\\]*$/.exec(filenameWithoutSuffix) || [''])[0];\n};\nvar isImageFileType = function isImageFileType(type) {\n return type.indexOf('image/') === 0;\n};\nexport var isImageUrl = function isImageUrl(file) {\n if (file.type && !file.thumbUrl) {\n return isImageFileType(file.type);\n }\n var url = file.thumbUrl || file.url || '';\n var extension = extname(url);\n if (/^data:image\\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(extension)) {\n return true;\n }\n if (/^data:/.test(url)) {\n // other file types of base64\n return false;\n }\n if (extension) {\n // other file types which have extension\n return false;\n }\n return true;\n};\nvar MEASURE_SIZE = 200;\nexport function previewImage(file) {\n return new Promise(function (resolve) {\n if (!file.type || !isImageFileType(file.type)) {\n resolve('');\n return;\n }\n var canvas = document.createElement('canvas');\n canvas.width = MEASURE_SIZE;\n canvas.height = MEASURE_SIZE;\n canvas.style.cssText = \"position: fixed; left: 0; top: 0; width: \".concat(MEASURE_SIZE, \"px; height: \").concat(MEASURE_SIZE, \"px; z-index: 9999; display: none;\");\n document.body.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n var img = new Image();\n img.onload = function () {\n var width = img.width,\n height = img.height;\n var drawWidth = MEASURE_SIZE;\n var drawHeight = MEASURE_SIZE;\n var offsetX = 0;\n var offsetY = 0;\n if (width > height) {\n drawHeight = height * (MEASURE_SIZE / width);\n offsetY = -(drawHeight - drawWidth) / 2;\n } else {\n drawWidth = width * (MEASURE_SIZE / height);\n offsetX = -(drawWidth - drawHeight) / 2;\n }\n ctx.drawImage(img, offsetX, offsetY, drawWidth, drawHeight);\n var dataURL = canvas.toDataURL();\n document.body.removeChild(canvas);\n window.URL.revokeObjectURL(img.src);\n resolve(dataURL);\n };\n img.crossOrigin = 'anonymous';\n if (file.type.startsWith('image/svg+xml')) {\n var reader = new FileReader();\n reader.onload = function () {\n if (reader.result) img.src = reader.result;\n };\n reader.readAsDataURL(file);\n } else if (file.type.startsWith('image/gif')) {\n var _reader = new FileReader();\n _reader.onload = function () {\n if (_reader.result) resolve(_reader.result);\n };\n _reader.readAsDataURL(file);\n } else {\n img.src = window.URL.createObjectURL(file);\n }\n });\n}","// This icon file is generated automatically.\nvar DownloadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"download\", \"theme\": \"outlined\" };\nexport default DownloadOutlined;\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 DownloadOutlinedSvg from \"@ant-design/icons-svg/es/asn/DownloadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DownloadOutlined = function DownloadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DownloadOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DownloadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DownloadOutlined';\n}\nexport default RefIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport DeleteOutlined from \"@ant-design/icons/es/icons/DeleteOutlined\";\nimport DownloadOutlined from \"@ant-design/icons/es/icons/DownloadOutlined\";\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport * as React from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport Progress from '../../progress';\nimport Tooltip from '../../tooltip';\nvar ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var prefixCls = _ref.prefixCls,\n className = _ref.className,\n style = _ref.style,\n locale = _ref.locale,\n listType = _ref.listType,\n file = _ref.file,\n items = _ref.items,\n progressProps = _ref.progress,\n iconRender = _ref.iconRender,\n actionIconRender = _ref.actionIconRender,\n itemRender = _ref.itemRender,\n isImgUrl = _ref.isImgUrl,\n showPreviewIcon = _ref.showPreviewIcon,\n showRemoveIcon = _ref.showRemoveIcon,\n showDownloadIcon = _ref.showDownloadIcon,\n customPreviewIcon = _ref.previewIcon,\n customRemoveIcon = _ref.removeIcon,\n customDownloadIcon = _ref.downloadIcon,\n onPreview = _ref.onPreview,\n onDownload = _ref.onDownload,\n onClose = _ref.onClose;\n var _a, _b;\n // Status: which will ignore `removed` status\n var status = file.status;\n var _React$useState = React.useState(status),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n mergedStatus = _React$useState2[0],\n setMergedStatus = _React$useState2[1];\n React.useEffect(function () {\n if (status !== 'removed') {\n setMergedStatus(status);\n }\n }, [status]);\n // Delay to show the progress bar\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n showProgress = _React$useState4[0],\n setShowProgress = _React$useState4[1];\n var progressRafRef = React.useRef(null);\n React.useEffect(function () {\n progressRafRef.current = setTimeout(function () {\n setShowProgress(true);\n }, 300);\n return function () {\n if (progressRafRef.current) {\n clearTimeout(progressRafRef.current);\n }\n };\n }, []);\n // This is used for legacy span make scrollHeight the wrong value.\n // We will force these to be `display: block` with non `picture-card`\n var spanClassName = \"\".concat(prefixCls, \"-span\");\n var iconNode = iconRender(file);\n var icon = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-text-icon\")\n }, iconNode);\n if (listType === 'picture' || listType === 'picture-card') {\n if (mergedStatus === 'uploading' || !file.thumbUrl && !file.url) {\n var uploadingClassName = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-list-item-thumbnail\"), true), \"\".concat(prefixCls, \"-list-item-file\"), mergedStatus !== 'uploading'));\n icon = /*#__PURE__*/React.createElement(\"div\", {\n className: uploadingClassName\n }, iconNode);\n } else {\n var thumbnail = (isImgUrl === null || isImgUrl === void 0 ? void 0 : isImgUrl(file)) ? ( /*#__PURE__*/React.createElement(\"img\", {\n src: file.thumbUrl || file.url,\n alt: file.name,\n className: \"\".concat(prefixCls, \"-list-item-image\"),\n crossOrigin: file.crossOrigin\n })) : iconNode;\n var aClassName = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-list-item-thumbnail\"), true), \"\".concat(prefixCls, \"-list-item-file\"), isImgUrl && !isImgUrl(file)));\n icon = /*#__PURE__*/React.createElement(\"a\", {\n className: aClassName,\n onClick: function onClick(e) {\n return onPreview(file, e);\n },\n href: file.url || file.thumbUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, thumbnail);\n }\n }\n var infoUploadingClass = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-list-item\"), true), \"\".concat(prefixCls, \"-list-item-\").concat(mergedStatus), true), \"\".concat(prefixCls, \"-list-item-list-type-\").concat(listType), true));\n var linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps;\n var removeIcon = showRemoveIcon ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || ( /*#__PURE__*/React.createElement(DeleteOutlined, null)), function () {\n return onClose(file);\n }, prefixCls, locale.removeFile) : null;\n var downloadIcon = showDownloadIcon && mergedStatus === 'done' ? actionIconRender((typeof customDownloadIcon === 'function' ? customDownloadIcon(file) : customDownloadIcon) || /*#__PURE__*/React.createElement(DownloadOutlined, null), function () {\n return onDownload(file);\n }, prefixCls, locale.downloadFile) : null;\n var downloadOrDelete = listType !== 'picture-card' && ( /*#__PURE__*/React.createElement(\"span\", {\n key: \"download-delete\",\n className: classNames(\"\".concat(prefixCls, \"-list-item-card-actions\"), {\n picture: listType === 'picture'\n })\n }, downloadIcon, removeIcon));\n var listItemNameClass = classNames(\"\".concat(prefixCls, \"-list-item-name\"));\n var preview = file.url ? [/*#__PURE__*/React.createElement(\"a\", _extends({\n key: \"view\",\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: listItemNameClass,\n title: file.name\n }, linkProps, {\n href: file.url,\n onClick: function onClick(e) {\n return onPreview(file, e);\n }\n }), file.name), downloadOrDelete] : [/*#__PURE__*/React.createElement(\"span\", {\n key: \"view\",\n className: listItemNameClass,\n onClick: function onClick(e) {\n return onPreview(file, e);\n },\n title: file.name\n }, file.name), downloadOrDelete];\n var previewStyle = {\n pointerEvents: 'none',\n opacity: 0.5\n };\n var previewIcon = showPreviewIcon ? ( /*#__PURE__*/React.createElement(\"a\", {\n href: file.url || file.thumbUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n style: file.url || file.thumbUrl ? undefined : previewStyle,\n onClick: function onClick(e) {\n return onPreview(file, e);\n },\n title: locale.previewFile\n }, typeof customPreviewIcon === 'function' ? customPreviewIcon(file) : customPreviewIcon || /*#__PURE__*/React.createElement(EyeOutlined, null))) : null;\n var actions = listType === 'picture-card' && mergedStatus !== 'uploading' && ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-list-item-actions\")\n }, previewIcon, mergedStatus === 'done' && downloadIcon, removeIcon));\n var message;\n if (file.response && typeof file.response === 'string') {\n message = file.response;\n } else {\n message = ((_a = file.error) === null || _a === void 0 ? void 0 : _a.statusText) || ((_b = file.error) === null || _b === void 0 ? void 0 : _b.message) || locale.uploadError;\n }\n var iconAndPreview = /*#__PURE__*/React.createElement(\"span\", {\n className: spanClassName\n }, icon, preview);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var rootPrefixCls = getPrefixCls();\n var dom = /*#__PURE__*/React.createElement(\"div\", {\n className: infoUploadingClass\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-list-item-info\")\n }, iconAndPreview), actions, showProgress && ( /*#__PURE__*/React.createElement(CSSMotion, {\n motionName: \"\".concat(rootPrefixCls, \"-fade\"),\n visible: mergedStatus === 'uploading',\n motionDeadline: 2000\n }, function (_ref2) {\n var motionClassName = _ref2.className;\n // show loading icon if upload progress listener is disabled\n var loadingProgress = 'percent' in file ? ( /*#__PURE__*/React.createElement(Progress, _extends({}, progressProps, {\n type: \"line\",\n percent: file.percent\n }))) : null;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-list-item-progress\"), motionClassName)\n }, loadingProgress);\n })));\n var listContainerNameClass = classNames(\"\".concat(prefixCls, \"-list-\").concat(listType, \"-container\"), className);\n var item = mergedStatus === 'error' ? ( /*#__PURE__*/React.createElement(Tooltip, {\n title: message,\n getPopupContainer: function getPopupContainer(node) {\n return node.parentNode;\n }\n }, dom)) : dom;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: listContainerNameClass,\n style: style,\n ref: ref\n }, itemRender ? itemRender(item, file, items, {\n download: onDownload.bind(null, file),\n preview: onPreview.bind(null, file),\n remove: onClose.bind(null, file)\n }) : item);\n});\nexport default ListItem;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport FileTwoTone from \"@ant-design/icons/es/icons/FileTwoTone\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport PaperClipOutlined from \"@ant-design/icons/es/icons/PaperClipOutlined\";\nimport PictureTwoTone from \"@ant-design/icons/es/icons/PictureTwoTone\";\nimport classNames from 'classnames';\nimport CSSMotion, { CSSMotionList } from 'rc-motion';\nimport * as React from 'react';\nimport Button from '../../button';\nimport { ConfigContext } from '../../config-provider';\nimport useForceUpdate from '../../_util/hooks/useForceUpdate';\nimport collapseMotion from '../../_util/motion';\nimport { cloneElement, isValidElement } from '../../_util/reactNode';\nimport { isImageUrl, previewImage } from '../utils';\nimport ListItem from './ListItem';\nvar listItemMotion = _extends({}, collapseMotion);\ndelete listItemMotion.onAppearEnd;\ndelete listItemMotion.onEnterEnd;\ndelete listItemMotion.onLeaveEnd;\nvar InternalUploadList = function InternalUploadList(props, ref) {\n var _props$listType = props.listType,\n listType = _props$listType === void 0 ? 'text' : _props$listType,\n _props$previewFile = props.previewFile,\n previewFile = _props$previewFile === void 0 ? previewImage : _props$previewFile,\n onPreview = props.onPreview,\n onDownload = props.onDownload,\n onRemove = props.onRemove,\n locale = props.locale,\n iconRender = props.iconRender,\n _props$isImageUrl = props.isImageUrl,\n isImgUrl = _props$isImageUrl === void 0 ? isImageUrl : _props$isImageUrl,\n customizePrefixCls = props.prefixCls,\n _props$items = props.items,\n items = _props$items === void 0 ? [] : _props$items,\n _props$showPreviewIco = props.showPreviewIcon,\n showPreviewIcon = _props$showPreviewIco === void 0 ? true : _props$showPreviewIco,\n _props$showRemoveIcon = props.showRemoveIcon,\n showRemoveIcon = _props$showRemoveIcon === void 0 ? true : _props$showRemoveIcon,\n _props$showDownloadIc = props.showDownloadIcon,\n showDownloadIcon = _props$showDownloadIc === void 0 ? false : _props$showDownloadIc,\n removeIcon = props.removeIcon,\n previewIcon = props.previewIcon,\n downloadIcon = props.downloadIcon,\n _props$progress = props.progress,\n progress = _props$progress === void 0 ? {\n strokeWidth: 2,\n showInfo: false\n } : _props$progress,\n appendAction = props.appendAction,\n _props$appendActionVi = props.appendActionVisible,\n appendActionVisible = _props$appendActionVi === void 0 ? true : _props$appendActionVi,\n itemRender = props.itemRender,\n disabled = props.disabled;\n var forceUpdate = useForceUpdate();\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n motionAppear = _React$useState2[0],\n setMotionAppear = _React$useState2[1];\n // ============================= Effect =============================\n React.useEffect(function () {\n if (listType !== 'picture' && listType !== 'picture-card') {\n return;\n }\n (items || []).forEach(function (file) {\n if (typeof document === 'undefined' || typeof window === 'undefined' || !window.FileReader || !window.File || !(file.originFileObj instanceof File || file.originFileObj instanceof Blob) || file.thumbUrl !== undefined) {\n return;\n }\n file.thumbUrl = '';\n if (previewFile) {\n previewFile(file.originFileObj).then(function (previewDataUrl) {\n // Need append '' to avoid dead loop\n file.thumbUrl = previewDataUrl || '';\n forceUpdate();\n });\n }\n });\n }, [listType, items, previewFile]);\n React.useEffect(function () {\n setMotionAppear(true);\n }, []);\n // ============================= Events =============================\n var onInternalPreview = function onInternalPreview(file, e) {\n if (!onPreview) {\n return;\n }\n e === null || e === void 0 ? void 0 : e.preventDefault();\n return onPreview(file);\n };\n var onInternalDownload = function onInternalDownload(file) {\n if (typeof onDownload === 'function') {\n onDownload(file);\n } else if (file.url) {\n window.open(file.url);\n }\n };\n var onInternalClose = function onInternalClose(file) {\n onRemove === null || onRemove === void 0 ? void 0 : onRemove(file);\n };\n var internalIconRender = function internalIconRender(file) {\n if (iconRender) {\n return iconRender(file, listType);\n }\n var isLoading = file.status === 'uploading';\n var fileIcon = isImgUrl && isImgUrl(file) ? /*#__PURE__*/React.createElement(PictureTwoTone, null) : /*#__PURE__*/React.createElement(FileTwoTone, null);\n var icon = isLoading ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : /*#__PURE__*/React.createElement(PaperClipOutlined, null);\n if (listType === 'picture') {\n icon = isLoading ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : fileIcon;\n } else if (listType === 'picture-card') {\n icon = isLoading ? locale.uploading : fileIcon;\n }\n return icon;\n };\n var actionIconRender = function actionIconRender(customIcon, callback, prefixCls, title) {\n var btnProps = {\n type: 'text',\n size: 'small',\n title: title,\n disabled: disabled,\n onClick: function onClick(e) {\n callback();\n if (isValidElement(customIcon) && customIcon.props.onClick) {\n customIcon.props.onClick(e);\n }\n },\n className: \"\".concat(prefixCls, \"-list-item-card-actions-btn\")\n };\n if (isValidElement(customIcon)) {\n var btnIcon = cloneElement(customIcon, _extends(_extends({}, customIcon.props), {\n onClick: function onClick() {}\n }));\n return /*#__PURE__*/React.createElement(Button, _extends({}, btnProps, {\n icon: btnIcon\n }));\n }\n return /*#__PURE__*/React.createElement(Button, _extends({}, btnProps), /*#__PURE__*/React.createElement(\"span\", null, customIcon));\n };\n // ============================== Ref ===============================\n // Test needs\n React.useImperativeHandle(ref, function () {\n return {\n handlePreview: onInternalPreview,\n handleDownload: onInternalDownload\n };\n });\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n // ============================= Render =============================\n var prefixCls = getPrefixCls('upload', customizePrefixCls);\n var listClassNames = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-list\"), true), \"\".concat(prefixCls, \"-list-\").concat(listType), true), \"\".concat(prefixCls, \"-list-rtl\"), direction === 'rtl'));\n // >>> Motion config\n var motionKeyList = _toConsumableArray(items.map(function (file) {\n return {\n key: file.uid,\n file: file\n };\n }));\n var animationDirection = listType === 'picture-card' ? 'animate-inline' : 'animate';\n // const transitionName = list.length === 0 ? '' : `${prefixCls}-${animationDirection}`;\n var motionConfig = {\n motionDeadline: 2000,\n motionName: \"\".concat(prefixCls, \"-\").concat(animationDirection),\n keys: motionKeyList,\n motionAppear: motionAppear\n };\n if (listType !== 'picture-card') {\n motionConfig = _extends(_extends({}, listItemMotion), motionConfig);\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: listClassNames\n }, /*#__PURE__*/React.createElement(CSSMotionList, _extends({}, motionConfig, {\n component: false\n }), function (_ref) {\n var key = _ref.key,\n file = _ref.file,\n motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(ListItem, {\n key: key,\n locale: locale,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n file: file,\n items: items,\n progress: progress,\n listType: listType,\n isImgUrl: isImgUrl,\n showPreviewIcon: showPreviewIcon,\n showRemoveIcon: showRemoveIcon,\n showDownloadIcon: showDownloadIcon,\n removeIcon: removeIcon,\n previewIcon: previewIcon,\n downloadIcon: downloadIcon,\n iconRender: internalIconRender,\n actionIconRender: actionIconRender,\n itemRender: itemRender,\n onPreview: onInternalPreview,\n onDownload: onInternalDownload,\n onClose: onInternalClose\n });\n }), appendAction && ( /*#__PURE__*/React.createElement(CSSMotion, _extends({}, motionConfig, {\n visible: appendActionVisible,\n forceRender: true\n }), function (_ref2) {\n var motionClassName = _ref2.className,\n motionStyle = _ref2.style;\n return cloneElement(appendAction, function (oriProps) {\n return {\n className: classNames(oriProps.className, motionClassName),\n style: _extends(_extends(_extends({}, motionStyle), {\n // prevent the element has hover css pseudo-class that may cause animation to end prematurely.\n pointerEvents: motionClassName ? 'none' : undefined\n }), oriProps.style)\n };\n });\n })));\n};\nvar UploadList = /*#__PURE__*/React.forwardRef(InternalUploadList);\nif (process.env.NODE_ENV !== 'production') {\n UploadList.displayName = 'UploadList';\n}\nexport default UploadList;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nvar __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport classNames from 'classnames';\nimport RcUpload from 'rc-upload';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport warning from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport defaultLocale from '../locale/default';\nimport UploadList from './UploadList';\nimport { file2Obj, getFileItem, removeFileItem, updateFileList } from './utils';\nexport var LIST_IGNORE = \"__LIST_IGNORE_\".concat(Date.now(), \"__\");\nvar InternalUpload = function InternalUpload(props, ref) {\n var fileList = props.fileList,\n defaultFileList = props.defaultFileList,\n onRemove = props.onRemove,\n _props$showUploadList = props.showUploadList,\n showUploadList = _props$showUploadList === void 0 ? true : _props$showUploadList,\n _props$listType = props.listType,\n listType = _props$listType === void 0 ? 'text' : _props$listType,\n onPreview = props.onPreview,\n onDownload = props.onDownload,\n onChange = props.onChange,\n onDrop = props.onDrop,\n previewFile = props.previewFile,\n customDisabled = props.disabled,\n propLocale = props.locale,\n iconRender = props.iconRender,\n isImageUrl = props.isImageUrl,\n progress = props.progress,\n customizePrefixCls = props.prefixCls,\n className = props.className,\n _props$type = props.type,\n type = _props$type === void 0 ? 'select' : _props$type,\n children = props.children,\n style = props.style,\n itemRender = props.itemRender,\n maxCount = props.maxCount,\n _props$data = props.data,\n data = _props$data === void 0 ? {} : _props$data,\n _props$multiple = props.multiple,\n multiple = _props$multiple === void 0 ? false : _props$multiple,\n _props$action = props.action,\n action = _props$action === void 0 ? '' : _props$action,\n _props$accept = props.accept,\n accept = _props$accept === void 0 ? '' : _props$accept,\n _props$supportServerR = props.supportServerRender,\n supportServerRender = _props$supportServerR === void 0 ? true : _props$supportServerR;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var _useMergedState = useMergedState(defaultFileList || [], {\n value: fileList,\n postState: function postState(list) {\n return list !== null && list !== void 0 ? list : [];\n }\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedFileList = _useMergedState2[0],\n setMergedFileList = _useMergedState2[1];\n var _React$useState = React.useState('drop'),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n dragState = _React$useState2[0],\n setDragState = _React$useState2[1];\n var upload = React.useRef(null);\n process.env.NODE_ENV !== \"production\" ? warning('fileList' in props || !('value' in props), 'Upload', '`value` is not a valid prop, do you mean `fileList`?') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!('transformFile' in props), 'Upload', '`transformFile` is deprecated. Please use `beforeUpload` directly.') : void 0;\n // Control mode will auto fill file uid if not provided\n React.useMemo(function () {\n var timestamp = Date.now();\n (fileList || []).forEach(function (file, index) {\n if (!file.uid && !Object.isFrozen(file)) {\n file.uid = \"__AUTO__\".concat(timestamp, \"_\").concat(index, \"__\");\n }\n });\n }, [fileList]);\n var onInternalChange = function onInternalChange(file, changedFileList, event) {\n var cloneList = _toConsumableArray(changedFileList);\n // Cut to match count\n if (maxCount === 1) {\n cloneList = cloneList.slice(-1);\n } else if (maxCount) {\n cloneList = cloneList.slice(0, maxCount);\n }\n // Prevent React18 auto batch since input[upload] trigger process at same time\n // which makes fileList closure problem\n flushSync(function () {\n setMergedFileList(cloneList);\n });\n var changeInfo = {\n file: file,\n fileList: cloneList\n };\n if (event) {\n changeInfo.event = event;\n }\n flushSync(function () {\n onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo);\n });\n };\n var mergedBeforeUpload = function mergedBeforeUpload(file, fileListArgs) {\n return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var beforeUpload, transformFile, parsedFile, result;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n beforeUpload = props.beforeUpload, transformFile = props.transformFile;\n parsedFile = file;\n if (!beforeUpload) {\n _context.next = 13;\n break;\n }\n _context.next = 5;\n return beforeUpload(file, fileListArgs);\n case 5:\n result = _context.sent;\n if (!(result === false)) {\n _context.next = 8;\n break;\n }\n return _context.abrupt(\"return\", false);\n case 8:\n // Hack for LIST_IGNORE, we add additional info to remove from the list\n delete file[LIST_IGNORE];\n if (!(result === LIST_IGNORE)) {\n _context.next = 12;\n break;\n }\n Object.defineProperty(file, LIST_IGNORE, {\n value: true,\n configurable: true\n });\n return _context.abrupt(\"return\", false);\n case 12:\n if (_typeof(result) === 'object' && result) {\n parsedFile = result;\n }\n case 13:\n if (!transformFile) {\n _context.next = 17;\n break;\n }\n _context.next = 16;\n return transformFile(parsedFile);\n case 16:\n parsedFile = _context.sent;\n case 17:\n return _context.abrupt(\"return\", parsedFile);\n case 18:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n };\n var onBatchStart = function onBatchStart(batchFileInfoList) {\n // Skip file which marked as `LIST_IGNORE`, these file will not add to file list\n var filteredFileInfoList = batchFileInfoList.filter(function (info) {\n return !info.file[LIST_IGNORE];\n });\n // Nothing to do since no file need upload\n if (!filteredFileInfoList.length) {\n return;\n }\n var objectFileList = filteredFileInfoList.map(function (info) {\n return file2Obj(info.file);\n });\n // Concat new files with prev files\n var newFileList = _toConsumableArray(mergedFileList);\n objectFileList.forEach(function (fileObj) {\n // Replace file if exist\n newFileList = updateFileList(fileObj, newFileList);\n });\n objectFileList.forEach(function (fileObj, index) {\n // Repeat trigger `onChange` event for compatible\n var triggerFileObj = fileObj;\n if (!filteredFileInfoList[index].parsedFile) {\n // `beforeUpload` return false\n var originFileObj = fileObj.originFileObj;\n var clone;\n try {\n clone = new File([originFileObj], originFileObj.name, {\n type: originFileObj.type\n });\n } catch (e) {\n clone = new Blob([originFileObj], {\n type: originFileObj.type\n });\n clone.name = originFileObj.name;\n clone.lastModifiedDate = new Date();\n clone.lastModified = new Date().getTime();\n }\n clone.uid = fileObj.uid;\n triggerFileObj = clone;\n } else {\n // Inject `uploading` status\n fileObj.status = 'uploading';\n }\n onInternalChange(triggerFileObj, newFileList);\n });\n };\n var onSuccess = function onSuccess(response, file, xhr) {\n try {\n if (typeof response === 'string') {\n response = JSON.parse(response);\n }\n } catch (e) {\n /* do nothing */\n }\n // removed\n if (!getFileItem(file, mergedFileList)) {\n return;\n }\n var targetItem = file2Obj(file);\n targetItem.status = 'done';\n targetItem.percent = 100;\n targetItem.response = response;\n targetItem.xhr = xhr;\n var nextFileList = updateFileList(targetItem, mergedFileList);\n onInternalChange(targetItem, nextFileList);\n };\n var onProgress = function onProgress(e, file) {\n // removed\n if (!getFileItem(file, mergedFileList)) {\n return;\n }\n var targetItem = file2Obj(file);\n targetItem.status = 'uploading';\n targetItem.percent = e.percent;\n var nextFileList = updateFileList(targetItem, mergedFileList);\n onInternalChange(targetItem, nextFileList, e);\n };\n var onError = function onError(error, response, file) {\n // removed\n if (!getFileItem(file, mergedFileList)) {\n return;\n }\n var targetItem = file2Obj(file);\n targetItem.error = error;\n targetItem.response = response;\n targetItem.status = 'error';\n var nextFileList = updateFileList(targetItem, mergedFileList);\n onInternalChange(targetItem, nextFileList);\n };\n var handleRemove = function handleRemove(file) {\n var currentFile;\n Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(function (ret) {\n var _a;\n // Prevent removing file\n if (ret === false) {\n return;\n }\n var removedFileList = removeFileItem(file, mergedFileList);\n if (removedFileList) {\n currentFile = _extends(_extends({}, file), {\n status: 'removed'\n });\n mergedFileList === null || mergedFileList === void 0 ? void 0 : mergedFileList.forEach(function (item) {\n var matchKey = currentFile.uid !== undefined ? 'uid' : 'name';\n if (item[matchKey] === currentFile[matchKey] && !Object.isFrozen(item)) {\n item.status = 'removed';\n }\n });\n (_a = upload.current) === null || _a === void 0 ? void 0 : _a.abort(currentFile);\n onInternalChange(currentFile, removedFileList);\n }\n });\n };\n var onFileDrop = function onFileDrop(e) {\n setDragState(e.type);\n if (e.type === 'drop') {\n onDrop === null || onDrop === void 0 ? void 0 : onDrop(e);\n }\n };\n // Test needs\n React.useImperativeHandle(ref, function () {\n return {\n onBatchStart: onBatchStart,\n onSuccess: onSuccess,\n onProgress: onProgress,\n onError: onError,\n fileList: mergedFileList,\n upload: upload.current\n };\n });\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('upload', customizePrefixCls);\n var rcUploadProps = _extends(_extends({\n onBatchStart: onBatchStart,\n onError: onError,\n onProgress: onProgress,\n onSuccess: onSuccess\n }, props), {\n data: data,\n multiple: multiple,\n action: action,\n accept: accept,\n supportServerRender: supportServerRender,\n prefixCls: prefixCls,\n disabled: mergedDisabled,\n beforeUpload: mergedBeforeUpload,\n onChange: undefined\n });\n delete rcUploadProps.className;\n delete rcUploadProps.style;\n // Remove id to avoid open by label when trigger is hidden\n // !children: https://github.com/ant-design/ant-design/issues/14298\n // disabled: https://github.com/ant-design/ant-design/issues/16478\n // https://github.com/ant-design/ant-design/issues/24197\n if (!children || mergedDisabled) {\n delete rcUploadProps.id;\n }\n var renderUploadList = function renderUploadList(button, buttonVisible) {\n return showUploadList ? ( /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: 'Upload',\n defaultLocale: defaultLocale.Upload\n }, function (contextLocale) {\n var _ref = typeof showUploadList === 'boolean' ? {} : showUploadList,\n showRemoveIcon = _ref.showRemoveIcon,\n showPreviewIcon = _ref.showPreviewIcon,\n showDownloadIcon = _ref.showDownloadIcon,\n removeIcon = _ref.removeIcon,\n previewIcon = _ref.previewIcon,\n downloadIcon = _ref.downloadIcon;\n return /*#__PURE__*/React.createElement(UploadList, {\n prefixCls: prefixCls,\n listType: listType,\n items: mergedFileList,\n previewFile: previewFile,\n onPreview: onPreview,\n onDownload: onDownload,\n onRemove: handleRemove,\n showRemoveIcon: !mergedDisabled && showRemoveIcon,\n showPreviewIcon: showPreviewIcon,\n showDownloadIcon: showDownloadIcon,\n removeIcon: removeIcon,\n previewIcon: previewIcon,\n downloadIcon: downloadIcon,\n iconRender: iconRender,\n locale: _extends(_extends({}, contextLocale), propLocale),\n isImageUrl: isImageUrl,\n progress: progress,\n appendAction: button,\n appendActionVisible: buttonVisible,\n itemRender: itemRender,\n disabled: mergedDisabled\n });\n })) : button;\n };\n if (type === 'drag') {\n var dragCls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-drag\"), true), \"\".concat(prefixCls, \"-drag-uploading\"), mergedFileList.some(function (file) {\n return file.status === 'uploading';\n })), \"\".concat(prefixCls, \"-drag-hover\"), dragState === 'dragover'), \"\".concat(prefixCls, \"-disabled\"), mergedDisabled), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"span\", null, /*#__PURE__*/React.createElement(\"div\", {\n className: dragCls,\n onDrop: onFileDrop,\n onDragOver: onFileDrop,\n onDragLeave: onFileDrop,\n style: style\n }, /*#__PURE__*/React.createElement(RcUpload, _extends({}, rcUploadProps, {\n ref: upload,\n className: \"\".concat(prefixCls, \"-btn\")\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-drag-container\")\n }, children))), renderUploadList());\n }\n var uploadButtonCls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-select\"), true), \"\".concat(prefixCls, \"-select-\").concat(listType), true), \"\".concat(prefixCls, \"-disabled\"), mergedDisabled), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'));\n var renderUploadButton = function renderUploadButton(uploadButtonStyle) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: uploadButtonCls,\n style: uploadButtonStyle\n }, /*#__PURE__*/React.createElement(RcUpload, _extends({}, rcUploadProps, {\n ref: upload\n })));\n };\n var uploadButton = renderUploadButton(children ? undefined : {\n display: 'none'\n });\n if (listType === 'picture-card') {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(\"\".concat(prefixCls, \"-picture-card-wrapper\"), className)\n }, renderUploadList(uploadButton, !!children));\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: className\n }, uploadButton, renderUploadList());\n};\nvar Upload = /*#__PURE__*/React.forwardRef(InternalUpload);\nif (process.env.NODE_ENV !== 'production') {\n Upload.displayName = 'Upload';\n}\nexport default Upload;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport Upload from './Upload';\nvar Dragger = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var style = _a.style,\n height = _a.height,\n restProps = __rest(_a, [\"style\", \"height\"]);\n return /*#__PURE__*/React.createElement(Upload, _extends({\n ref: ref\n }, restProps, {\n type: \"drag\",\n style: _extends(_extends({}, style), {\n height: height\n })\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n Dragger.displayName = 'Dragger';\n}\nexport default Dragger;","import Dragger from './Dragger';\nimport InternalUpload, { LIST_IGNORE } from './Upload';\nvar Upload = InternalUpload;\nUpload.Dragger = Dragger;\nUpload.LIST_IGNORE = LIST_IGNORE;\nexport default Upload;","import React from \"react\";\nimport { Upload } from \"antd\";\n\nconst CXUpload = (props) => {\n return ;\n};\n\nexport default CXUpload;\n","import { Roles } from \"config\";\n\n// Components\nimport Dashboard from \"screen/UserPortal/Dashboard\";\nimport DummyScreen from \"screen/DummyScreen\";\n// import ListContent from \"screen/UserPortal/Knowledge/Articles/ListContent\";\n// import AddContent from \"screen/UserPortal/Knowledge/Articles/AddContent\";\n// import EditContent from \"screen/UserPortal/Knowledge/Articles/EditContent\";\n// import FaqAdd from \"screen/UserPortal/Knowledge/Collections/CreateFaq/KnowledgeBase\";\n// import FaqList from \"screen/UserPortal/Knowledge/Collections/ListFaq\";\n// import Files from \"screen/UserPortal/Knowledge/Files\";\nimport CreateTemplate from \"screen/UserPortal/Knowledge/Template/CreateTemplate\";\nimport ListTemplate from \"screen/UserPortal/Knowledge/Template/ListTemplate\";\n// import GlobalPlaceholder from \"screen/UserPortal/Knowledge/GlobalPlaceholder\";\nimport ChatInbox from \"screen/UserPortal/Communication/Inbox\";\n// import CollectionArticles from \"screen/UserPortal/Knowledge/Collections/ListFaq/CollectionArticles\";\n// import CreateCollections from \"screen/UserPortal/Knowledge/Collections/CreateFaq\";\nimport { TranslateText } from \"../i18n\";\nimport BotListing from \"screen/UserPortal/WorkbenchV2/BotConfiguration/index\";\nimport Admin from \"screen/UserPortal/Admin\";\nimport Oath from \"screen/UserPortal/oathComp\";\nimport WorkbenchV2 from \"screen/UserPortal/WorkbenchV2\";\nimport Logout from \"screen/SignOn/Logout\";\nimport Campaigns from \"screen/UserPortal/Campaigns\";\nimport UserProfile from \"screen/UserProfile\";\nimport WhatsappStore from \"screen/UserPortal/Admin/whatsappStore\";\nimport EmailTemplate from \"screen/UserPortal/Knowledge/EmailTemplate\";\nimport EmailTemplateCreate from \"screen/UserPortal/Knowledge/EmailTemplate/EmailTemplateCreate\";\nimport SMSTemplate from \"screen/UserPortal/Knowledge/SmsTemplate\";\n// import EmailTemplateCreate from \"screen/UserPortal/Knowledge/EmailTemplate/EmailTemplateCreate\";\nimport EmailTemplateEdit from \"screen/UserPortal/Knowledge/EmailTemplate/EmailTemplateEdit\";\nimport WhatsAppBusinessAccRedirect from \"screen/UserPortal/Admin/Connected/Whatsapp/WhatsAppBusinessAccRedirect\";\nimport Openings from \"screen/UserPortal/Openings\";\nimport Company from \"screen/UserPortal/Company\";\nimport OpeningsDetails from \"screen/UserPortal/Openings/OpeningsDetails\";\nimport AddPosition from \"screen/UserPortal/Openings/AddPosition\";\nimport AddCompany from \"screen/UserPortal/Company/AddCompany\";\nimport AddCandidate from \"screen/UserPortal/Openings/AddCandidate\";\nimport { ReactComponent as InboxIcon } from \"./assets/NavigationAssets/inbox.svg\";\nimport { ReactComponent as DashboardIcon } from \"./assets/NavigationAssets/dashboard.svg\";\nimport { ReactComponent as CompanyIcon } from \"./assets/NavigationAssets/company.svg\";\nimport { ReactComponent as OpeningsIcon } from \"./assets/NavigationAssets/openings.svg\";\nimport { ReactComponent as KnowledgeIcon } from \"./assets/NavigationAssets/knowledge.svg\";\nimport { ReactComponent as WorkbenchIcon } from \"./assets/NavigationAssets/botWb.svg\";\nimport { ReactComponent as AdminIcon } from \"./assets/NavigationAssets/admin.svg\";\nimport OpeningsCandidateDetails from \"screen/UserPortal/Openings/OpeningsCandidateDetails\";\n// import Contacts from \"screen/UserPortal/Contacts\";\n\nimport SmsTemplateCreate from \"screen/UserPortal/Knowledge/SmsTemplate/SmsTemplateCreate\";\n\n// eslint-disable-next-line import/no-anonymous-default-export\nexport default [\n {\n component: Dashboard,\n path: \"/\",\n title: TranslateText(\"dashboard\"),\n icon: ,\n exact: true,\n menu: true,\n key: \"dashboard\",\n },\n {\n component: ChatInbox,\n path: \"/communication/inbox\",\n title:
{TranslateText(\"inbox\")}
,\n icon: ,\n menu: true,\n // rightItem: ,\n exact: true,\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n key: \"inbox\",\n },\n {\n component: ChatInbox,\n path: \"/communication/inbox/:convId\",\n title: TranslateText(\"inbox\"),\n icon: ,\n menu: false,\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: Openings,\n path: \"/openings\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: true,\n key: \"openings\",\n },\n {\n component: AddPosition,\n path: \"/openings/add\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: false,\n key: \"openings\",\n },\n {\n component: AddPosition,\n path: \"/openings/:openingsId/edit\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: false,\n key: \"openings\",\n },\n {\n component: AddCandidate,\n path: \"/openings/:openingsId/add-candidate\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: false,\n key: \"openings\",\n },\n {\n component: OpeningsCandidateDetails,\n path: \"/openings/:openingsId/candidate/:cid\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: false,\n key: \"openings\",\n },\n {\n component: OpeningsDetails,\n path: \"/openings/:openingsId/:tab/:stage?/:id?\",\n title: \"Openings\",\n icon: ,\n exact: true,\n menu: false,\n key: \"openings\",\n },\n\n {\n component: Company,\n path: \"/company\",\n title: \"Company\",\n icon: ,\n exact: true,\n menu: true,\n key: \"company\",\n },\n {\n component: AddCompany,\n path: \"/company/add\",\n title: \"Company\",\n icon: ,\n exact: true,\n menu: false,\n key: \"company\",\n },\n {\n component: AddCompany,\n path: \"/company/:companyId/edit\",\n title: \"Company\",\n icon: ,\n exact: true,\n menu: false,\n key: \"company\",\n },\n {\n component: DummyScreen,\n path: \"/product-mater\",\n title: \"Product Master\",\n icon: ,\n exact: true,\n menu: false,\n },\n {\n component: DummyScreen,\n path: \"/calendar\",\n title: \"Calendar\",\n icon: ,\n exact: true,\n menu: false,\n },\n {\n component: Campaigns,\n path: \"/campaign\",\n title: \"Campaign\",\n icon: ,\n exact: false,\n menu: true,\n key: \"campaign\",\n },\n // {\n // component: Review,\n // path: \"/review/dashboard\",\n // title: \"Review\",\n // icon: ,\n // exact: false,\n // menu: true,\n // },\n // {\n // component: Review,\n // path: \"/review/:id\",\n // title: \"Review\",\n // icon: ,\n // exact: false,\n // menu: false,\n // },\n // {\n // component: DummyScreen,\n // path: \"/feedback\",\n // title: \"Feedback\",\n // icon: ,\n // exact: true,\n // menu: true,\n // },\n // {\n // component: Payment,\n // path: \"/payment\",\n // title:
Payment
,\n // icon: ,\n // exact: true,\n // menu: true,\n // key: \"payment\",\n // },\n {\n component: ListTemplate,\n path: \"/knowledge-base\",\n title:
Templates
,\n icon: ,\n exact: true,\n menu: true,\n key: \"knowledge\",\n },\n {\n component: WorkbenchV2,\n path: \"/bot-workbench/botList/:id\",\n icon: ,\n exact: false,\n },\n {\n component: BotListing,\n path: \"/bot-workbench\",\n title: \"Bot Workbench\",\n icon: ,\n exact: false,\n // menu: CP(\"CreateBot\"),\n menu: true,\n key: \"botworkbench\",\n },\n {\n component: Admin,\n path: \"/admin\",\n title:
Admin
,\n icon: ,\n exact: false,\n menu: true,\n key: \"admin\",\n },\n {\n component: WhatsappStore,\n path: \"/whatsapp_store\",\n title:
Whatsapp Store
,\n icon: ,\n exact: false,\n menu: true,\n key: \"whatsappstore\",\n },\n {\n component: Oath,\n path: \"/connect-oath\",\n title: \"Admin\",\n icon: ,\n exact: true,\n menu: false,\n },\n {\n component: WhatsAppBusinessAccRedirect,\n path: \"/whatsapp-business-acc-redirect\",\n title: \"Whatsapp Business Account\",\n exact: true,\n menu: false,\n },\n\n // {\n // component: IntentData,\n // path: \"/bot-ai/:bid/:id\",\n // title: \"Intent List\",\n // exact: true,\n // },\n // {\n // component: SelectList,\n // path: \"/bot-ai/:id\",\n // title: \"Intent List\",\n // exact: true,\n // },\n // {\n // component: BotAi,\n // path: \"/bot-ai\",\n // title: \"BotAi\",\n // icon: (\n // \n // ),\n // exact: true,\n // menu: true,\n // },\n {\n component: UserProfile,\n path: \"/user-profile\",\n title: \"User Profile\",\n icon: ,\n exact: true,\n bottom: true,\n },\n\n {\n component: DummyScreen,\n path: \"/support\",\n title: \"Support\",\n icon: ,\n exact: true,\n bottom: true,\n },\n {\n component: Logout,\n path: \"/logout\",\n title: \"Logout\",\n icon: ,\n exact: true,\n bottom: true,\n },\n {\n component: CreateTemplate,\n path: \"/knowledge-base/create-template\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: ListTemplate,\n path: \"/knowledge-base/template\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: EmailTemplateCreate,\n path: \"/knowledge-base/email-template/create\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: EmailTemplateEdit,\n path: \"/knowledge-base/email-template/update/:id\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: EmailTemplate,\n path: \"/knowledge-base/email-template\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n\n {\n component: CreateTemplate,\n path: \"/knowledge-base/view-template/:id\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: SmsTemplateCreate,\n path: \"/knowledge-base/sms-template/create\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: SmsTemplateCreate,\n path: \"/knowledge-base/sms-template/edit/:id\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n {\n component: SMSTemplate,\n path: \"/knowledge-base/sms-template\",\n title: \"Template\",\n permission: [Roles.SUPER_ADMIN, Roles.ADMIN],\n },\n];\n","/*\n * These are the placeholder roles you can replace these with yours\n */\nexport default {\n SUPER_ADMIN: \"super_admin\",\n ADMIN: \"admin\",\n MANAGER: \"manager\",\n CUSTOMER: \"customer\",\n GUEST: \"guest\",\n};\n","module.exports = {\n authUrl: \"https://api.hirebound.io/auth\",\n appId: \"885af225-2142-44ba-b647-79a875e0e39f\",\n apiUrl: \"https://api.hirebound.io/v1\",\n // apiUrl: \"http://localhost:8900/v1\",\n socketUrl: \"wss://wss.hirebound.io\",\n workbenchUrl: \"https://api.hirebound.io/admin/api\",\n oauthUrl: \"https://api.hirebound.io/public/oauth2\",\n publicUrl: \"https://api.hirebound.io/admin/api\",\n publicAuthUrl: \"https://api.hirebound.io\",\n notificationUrl: \"https://inapiprod.hirebound.io/messaging\",\n time: 3000,\n};\n","// Handles the main site navigation\nexport const TOGGLE_MAIN_MENU = \"TOGGLE_MAIN_MENU\";\nexport const RESPONSIVE_MAIN_MENU = \"RESPONSIVE_MAIN_MENU\";\nexport const RESPONSIVE_WIDTH = \"RESPONSIVE_WIDTH\";\n\n// Handles the chat screen side bar\nexport const TOGGLE_CHAT_SIDE_BAR = \"TOGGLE_CHAT_SIDE_BAR\";\n\n// Handles the chat screen tool bar\nexport const TOGGLE_CHAT_TOOL_BAR = \"TOGGLE_CHAT_TOOL_BAR\";\n\n// Handles the chat screen component\nexport const CHAT_SCREEN_COMPONENT = \"CHAT_SCREEN_COMPONENT\";\n\n// Handles the chat container component\nexport const CHAT_CONTAINER_COMPONENT = \"CHAT_CONTAINER_COMPONENT\";\n\n// Handles the settings screen side bar\nexport const TOGGLE_SETTINGS_SIDE_BAR = \"TOGGLE_SETTINGS_SIDE_BAR\";\n\n//Handles tasks > addNewCard side bar\nexport const TOGGLE_ADD_CARD_SIDE_BAR = \"TOGGLE_ADD_CARD_SIDE_BAR\";\n\n//Handles tasks > addNewBot side bar\nexport const TOGGLE_ADD_BOT_SIDE_BAR = \"TOGGLE_ADD_BOT_SIDE_BAR\";\n\nexport const DROP_CONTENT = \"DROP_CONTENT\";\n\nexport const SET_ACTIVE_CONVID = \"SET_ACTIVE_CONVID\";\nexport const SET_ACTIVE_CH_CONVID = \"SET_ACTIVE_CH_CONVID\";\nexport const SET_ACTIVE_TM_CONVID = \"SET_ACTIVE_TM_CONVID\";\nexport const SET_CHAT_BOT_SWITCH = \"SET_CHAT_BOT_SWITCH\";\n\nexport const MARK_READ_TRIGGER = \"MARK_READ_TRIGGER\";\nexport const SET_NOTIF_COUNT = \"SET_NOTIF_COUNT\";\n","export const LOGIN_ACTION_TRIGGER = \"LOGIN_ACTION_TRIGGER\";\nexport const LOGIN_ACTION_RESPONSE = \"LOGIN_ACTION_RESPONSE\";\nexport const LOGIN_ACTION_ERROR = \"LOGIN_ACTION_ERROR\";\nexport const SET_MFA = \"SET_MFA\";\n\nexport const GET_USER_ACTION_TRIGGER = \"GET_USER_ACTION_TRIGGER\";\nexport const GET_USER_ACTION_RESPONSE = \"GET_USER_ACTION_RESPONSE\";\nexport const GET_USER_ACTION_ERROR = \"GET_USER_ACTION_ERROR\";\nexport const GET_SYSTEM_ACTION_TRIGGER = \"GET_SYSTEM_ACTION_TRIGGER\";\nexport const GET_SYSTEM_ACTION_RESPONSE = \"GET_SYSTEM_ACTION_RESPONSE\";\nexport const GET_SYSTEM_ACTION_ERROR = \"GET_SYSTEM_ACTION_ERROR\";\n\n// Content\nexport const GET_CONTENT_ACTION_TRIGGER = \"GET_CONTENT_ACTION_TRIGGER\";\nexport const GET_CONTENT_ACTION_RESPONSE = \"GET_CONTENT_ACTION_RESPONSE\";\nexport const GET_CONTENT_ACTION_ERROR = \"GET_CONTENT_ACTION_ERROR\";\nexport const REPLY_THREAD_ACTIVE = \"REPLY_THREAD_ACTIVE\";\nexport const REPLY_ID = \"REPLY_ID\";\nexport const THREAD_LOAD = \"THREAD_LOAD\";\n\nexport const GET_SINGLE_CONTENT_ACTION_TRIGGER =\n \"GET_SINGLE_CONTENT_ACTION_TRIGGER\";\nexport const GET_SINGLE_CONTENT_ACTION_RESPONSE =\n \"GET_SINGLE_CONTENT_ACTION_RESPONSE\";\nexport const GET_SINGLE_CONTENT_ACTION_ERROR =\n \"GET_SINGLE_CONTENT_ACTION_ERROR\";\n\nexport const CREATE_CONTENT_ACTION_TRIGGER = \"CREATE_CONTENT_ACTION_TRIGGER\";\nexport const CREATE_CONTENT_ACTION_RESPONSE = \"CREATE_CONTENT_ACTION_RESPONSE\";\nexport const CREATE_CONTENT_ACTION_ERROR = \"CREATE_CONTENT_ACTION_ERROR\";\n\nexport const UPDATE_CONTENT_ACTION_TRIGGER = \"UPDATE_CONTENT_ACTION_TRIGGER\";\nexport const UPDATE_CONTENT_ACTION_RESPONSE = \"UPDATE_CONTENT_ACTION_RESPONSE\";\nexport const UPDATE_CONTENT_ACTION_ERROR = \"UPDATE_CONTENT_ACTION_ERROR\";\n\nexport const UPDATE_CONTENT_TAG_ACTION_TRIGGER =\n \"UPDATE_CONTENT_TAG_ACTION_TRIGGER\";\nexport const UPDATE_CONTENT_TAG_ACTION_RESPONSE =\n \"UPDATE_CONTENT_TAG_ACTION_RESPONSE\";\nexport const UPDATE_CONTENT_TAG_ACTION_ERROR =\n \"UPDATE_CONTENT_TAG_ACTION_ERROR\";\n\nexport const DELETE_CONTENT_ACTION_TRIGGER = \"DELETE_CONTENT_ACTION_TRIGGER\";\nexport const DELETE_CONTENT_ACTION_RESPONSE = \"DELETE_CONTENT_ACTION_RESPONSE\";\nexport const DELETE_CONTENT_ACTION_ERROR = \"DELETE_CONTENT_ACTION_ERROR\";\n\nexport const SEARCH_CONTENT_ACTION_TRIGGER = \"SEARCH_CONTENT_ACTION_TRIGGER\";\nexport const SEARCH_CONTENT_ACTION_RESPONSE = \"SEARCH_CONTENT_ACTION_RESPONSE\";\nexport const SEARCH_CONTENT_ACTION_ERROR = \"SEARCH_CONTENT_ACTION_ERROR\";\n\n// Faq\nexport const GET_FAQ_ACTION_TRIGGER = \"GET_FAQ_ACTION_TRIGGER\";\nexport const GET_FAQ_ACTION_RESPONSE = \"GET_FAQ_ACTION_RESPONSE\";\nexport const GET_FAQ_ACTION_ERROR = \"GET_FAQ_ACTION_ERROR\";\n\nexport const CREATE_FAQ_ACTION_TRIGGER = \"CREATE_FAQ_ACTION_TRIGGER\";\nexport const CREATE_FAQ_ACTION_RESPONSE = \"CREATE_FAQ_ACTION_RESPONSE\";\nexport const CREATE_FAQ_ACTION_ERROR = \"CREATE_FAQ_ACTION_ERROR\";\n\nexport const UPDATE_FAQ_ACTION_TRIGGER = \"UPDATE_FAQ_ACTION_TRIGGER\";\nexport const UPDATE_FAQ_ACTION_RESPONSE = \"UPDATE_FAQ_ACTION_RESPONSE\";\nexport const UPDATE_FAQ_ACTION_ERROR = \"UPDATE_FAQ_ACTION_ERROR\";\n\nexport const DELETE_FAQ_ACTION_TRIGGER = \"DELETE_FAQ_ACTION_TRIGGER\";\nexport const DELETE_FAQ_ACTION_RESPONSE = \"DELETE_FAQ_ACTION_RESPONSE\";\nexport const DELETE_FAQ_ACTION_ERROR = \"DELETE_FAQ_ACTION_ERROR\";\n\nexport const SEARCH_FAQ_ACTION_TRIGGER = \"SEARCH_FAQ_ACTION_TRIGGER\";\nexport const SEARCH_FAQ_ACTION_RESPONSE = \"SEARCH_FAQ_ACTION_RESPONSE\";\nexport const SEARCH_FAQ_ACTION_ERROR = \"SEARCH_FAQ_ACTION_ERROR\";\n\nexport const FAQ_LIST_TRIGGER = \"FAQ_LIST_TRIGGER\";\nexport const GET_FAQ_LIST_RESPONSE = \"GET_FAQ_LIST_RESPONSE\";\nexport const FAQ_LIST_RESPONSE_ERROR = \"FAQ_LIST_RESPONSE_ERROR\";\n\nexport const GET_FAQ_CONTENTS_ACTION_TRIGGER =\n \"GET_FAQ_CONTENTS_ACTION_TRIGGER\";\nexport const GET_FAQ_CONTENTS_ACTION_RESPONSE =\n \"GET_FAQ_CONTENTS_ACTION_RESPONSE\";\nexport const GET_FAQ_CONTENTS_ACTION_ERROR = \"GET_FAQ_CONTENTS_ACTION_ERROR\";\nexport const GET_COLLECTION_LIST_RESPONSE = \"GET_COLLECTION_LIST_RESPONSE\";\nexport const GET_ARTICLE_LIST_RESPONSE = \"GET_ARTICLE_LIST_RESPONSE\";\n\n// Tag\nexport const CREATE_TAG_ACTION_TRIGGER = \"CREATE_TAG_ACTION_TRIGGER\";\nexport const CREATE_TAG_ACTION_RESPONSE = \"CREATE_TAG_ACTION_RESPONSE\";\nexport const CREATE_TAG_ACTION_ERROR = \"CREATE_TAG_ACTION_ERROR\";\n\nexport const GET_TEAMCONV_ACTION_TRIGGER = \"GET_TEAMCONV_ACTION_TRIGGER\";\nexport const GET_TEAMCONV_ACTION_RESPONSE = \"GET_TEAMCONV_ACTION_RESPONSE\";\nexport const GET_TEAMCONV_ACTION_ERROR = \"GET_TEAMCONV_ACTION_ERROR\";\n\nexport const SEARCH_TAG_ACTION_TRIGGER = \"SEARCH_TAG_ACTION_TRIGGER\";\nexport const SEARCH_TAG_ACTION_RESPONSE = \"SEARCH_TAG_ACTION_RESPONSE\";\nexport const SEARCH_TAG_ACTION_ERROR = \"SEARCH_TAG_ACTION_ERROR\";\n\n// Conv\nexport const GET_CONV_ACTION_TRIGGER = \"GET_CONV_ACTION_TRIGGER\";\nexport const GET_CONV_ACTION_RESPONSE = \"GET_CONV_ACTION_RESPONSE\";\nexport const GET_CONV_ACTION_ERROR = \"GET_CONV_ACTION_ERROR\";\nexport const GET_CONV_NOTIFICATION_RESPONSE = \"GET_CONV_NOTIFICATION_RESPONSE\";\nexport const GET_TEAMCONV_NOATIFICATION_RESPONSE =\n \"GET_TEAMCONV_NOATIFICATION_RESPONSE\";\nexport const ASSIGN_AGENT_ACTION_TRIGGER = \"ASSIGN_AGENT_ACTION_TRIGGER\";\nexport const ASSIGN_AGENT_ACTION_RESPONSE = \"ASSIGN_AGENT_ACTION_RESPONSE\";\nexport const ASSIGN_AGENT_ACTION_ERROR = \"ASSIGN_AGENT_ACTION_ERROR\";\nexport const GET_GROUP_NOATIFICATION_RESPONSE =\n \"GET_GROUP_NOATIFICATION_RESPONSE\";\n\nexport const GET_SINGLE_CONV_ACTION_TRIGGER = \"GET_SINGLE_CONV_ACTION_TRIGGER\";\nexport const GET_SINGLE_CONV_ACTION_RESPONSE =\n \"GET_SINGLE_CONV_ACTION_RESPONSE\";\nexport const GET_SINGLE_CONV_ACTION_ERROR = \"GET_SINGLE_CONV_ACTION_ERROR\";\n\nexport const UPDATE_CONV_ACTION_TRIGGER = \"UPDATE_CONV_ACTION_TRIGGER\";\nexport const UPDATE_CONV_ACTION_RESPONSE = \"UPDATE_CONV_ACTION_RESPONSE\";\nexport const UPDATE_CONV_ACTION_ERROR = \"UPDATE_CONV_ACTION_ERROR\";\nexport const GET_CONV_SEARCH_RESPONSE = \"GET_CONV_SEARCH_RESPONSE\";\n\nexport const SET_WIDGET_REQUEST = \"SET_WIDGET_REQUEST\";\n\n// Message\nexport const NEW_MESSAGE_ACTION_TRIGGER = \"NEW_MESSAGE_ACTION_TRIGGER\";\nexport const SEND_MESSAGE_ACTION_TRIGGER = \"SEND_MESSAGE_ACTION_TRIGGER\";\nexport const SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER =\n \"SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER\";\nexport const SOCKET_SENT_MESSAGE_ACTION_TRIGGER =\n \"SOCKET_SENT_MESSAGE_ACTION_TRIGGER\";\nexport const SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER =\n \"SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER\";\nexport const SOCKET_READ_MESSAGE_ACTION_TRIGGER =\n \"SOCKET_READ_MESSAGE_ACTION_TRIGGER\";\nexport const SOCKET_FAILED_MESSAGE_ACTION_TRIGGER =\n \"SOCKET_FAILED_MESSAGE_ACTION_TRIGGER\";\nexport const LOGOUT_ACTION_TRIGGER = \"LOGOUT_ACTION_TRIGGER\";\nexport const CLEAR_MESSAGE = \"CLEAR_MESSAGE\";\n\nexport const HISTORICAL_MESSAGE_ACTION_TRIGGER =\n \"HISTORICAL_MESSAGE_ACTION_TRIGGER\";\nexport const HISTORICAL_MESSAGE_ACTION_RESPONSE =\n \"HISTORICAL_MESSAGE_ACTION_RESPONSE\";\nexport const HISTORICAL_MESSAGE_ACTION_ERROR =\n \"HISTORICAL_MESSAGE_ACTION_ERROR\";\nexport const TOTAL_UNREAD_MSG_COUNT = \"TOTAL_UNREAD_MSG_COUNT\";\nexport const SET_TEAM_MESSAGE = \"SET_TEAM_MESSAGE\";\nexport const SET_CHANNEL_MESSAGE = \"SET_CHANNEL_MESSAGE\";\nexport const CLEAR_TEAM_MESSAGE = \"CLEAR_TEAM_MESSAGE\";\nexport const CLEAR_CHANNEL_MESSAGE = \"CLEAR_CHANNEL_MESSAGE\";\n\n// Call\nexport const INITIATE_CALL_ACTION_TRIGGER = \"INITIATE_CALL_ACTION_TRIGGER\";\nexport const INITIATE_CALL_ACTION_RESPONSE = \"INITIATE_CALL_ACTION_RESPONSE\";\nexport const INITIATE_CALL_ACTION_ERROR = \"INITIATE_CALL_ACTION_ERROR\";\n\n// Task\nexport const GET_PROJECT_DATA = \"GET_PROJECT_DATA\";\nexport const BOARD_ACTION_TRIGGER = \"BOARD_ACTION_TRIGGER\";\nexport const BOARD_ACTION_ERROR = \"BOARD_ACTION_ERROR\";\nexport const GET_TASK_BOARD = \"GET_TASK_BOARD\";\nexport const SET_CARD_VIEW = \"SET_CARD_VIEW\";\nexport const CARD_VIEW_DATA = \"CARD_VIEW_DATA\";\nexport const GET_LABEL_DATA = \"GET_LABEL_DATA\";\nexport const GET_USER_TASK_ACTION_TRIGGER = \"GET_USER_TASK_ACTION_TRIGGER\";\nexport const GET_USER_TASK_ACTION_RESPONSE = \"GET_USER_TASK_ACTION_RESPONSE\";\nexport const GET_USER_TASK_ACTION_ERROR = \"GET_USER_TASK_ACTION_ERROR\";\n//TaskModals\nexport const SET_CARD_ASSIGN_POP = \"SET_CARD_ASSIGN_POP\";\nexport const SET_CARD_LABEL_POP = \"SET_CARD_LABEL_POP\";\n\n// Agent\nexport const GET_AGENTS_ACTION_TRIGGER = \"GET_AGENTS_ACTION_TRIGGER\";\nexport const GET_AGENTS_ACTION_RESPONSE = \"GET_AGENTS_ACTION_RESPONSE\";\nexport const GET_AGENTS_ACTION_ERROR = \"GET_AGENTS_ACTION_ERROR\";\n\n// Contact\nexport const GET_ALL_CONTACT_ACTION_TRIGGER = \"GET_ALL_CONTACT_ACTION_TRIGGER\";\nexport const GET_ALL_CONTACT_ACTION_RESPONSE =\n \"GET_ALL_CONTACT_ACTION_RESPONSE\";\nexport const GET_ALL_CONTACT_ACTION_ERROR = \"GET_ALL_CONTACT_ACTION_ERROR\";\n\nexport const GET_CONTACT_ACTION_TRIGGER = \"GET_CONTACT_ACTION_TRIGGER\";\nexport const GET_CONTACT_ACTION_RESPONSE = \"GET_CONTACT_ACTION_RESPONSE\";\nexport const GET_CONTACT_ACTION_ERROR = \"GET_CONTACT_ACTION_ERROR\";\n\nexport const UPDATE_CONTACT_ACTION_TRIGGER = \"UPDATE_CONTACT_ACTION_TRIGGER\";\nexport const UPDATE_CONTACT_ACTION_RESPONSE = \"UPDATE_CONTACT_ACTION_RESPONSE\";\nexport const UPDATE_CONTACT_ACTION_ERROR = \"UPDATE_CONTACT_ACTION_ERROR\";\nexport const ACTIVE_LIST_CONTACT = \"ACTIVE_LIST_CONTACT\";\nexport const GET_CONTACT_FORM = \"GET_CONTACT_FORM\";\nexport const GET_CONTACT_FORM_RESPONSE = \"GET_CONTACT_FORM_RESPONSE\";\nexport const GET_CONTACT_GRP_RESPONSE = \"GET_CONTACT_GRP_RESPONSE\";\nexport const GET_ACTIVE_GRP_RESPONSE = \"GET_ACTIVE_GRP_RESPONSE\";\nexport const GET_LOCATION_ACTION_TRIGGER = \"GET_LOCATION_ACTION_TRIGGER\";\nexport const GET_LOCATION_ACTION_RESPONSE = \"GET_LOCATION_ACTION_RESPONSE\";\nexport const GET_LOCATION_ACTION_ERROR = \"GET_LOCATION_ACTION_ERROR\";\nexport const CREATE_CONTACT_FORM_FIELD_RESPONSE =\n \"CREATE_CONTACT_FORM_FIELD_RESPONSE\";\nexport const CREATE_CONTACT_FORM_FIELD_ERROR =\n \"CREATE_CONTACT_FORM_FIELD_ERROR\";\nexport const SEARCH_CONTACT_RESPONSE = \"SEARCH_CONTACT_RESPONSE\";\n\n// File\nexport const GET_FILE_ACTION_TRIGGER = \"GET_FILE_ACTION_TRIGGER\";\nexport const GET_FILE_ACTION_RESPONSE = \"GET_FILE_ACTION_RESPONSE\";\nexport const GET_FILE_ACTION_ERROR = \"GET_FILE_ACTION_ERROR\";\n\nexport const SEARCH_FILE_ACTION_RESPONSE = \"SEARCH_FILE_ACTION_RESPONSE\";\nexport const SEARCH_FILE_ACTION_ERROR = \"SEARCH_FILE_ACTION_ERROR\";\nexport const SEARCH_FILE_ACTION_TRIGGER = \"SEARCH_FILE_ACTION_TRIGGER\";\n\nexport const UPLOAD_FILE_ACTION_RESPONSE = \"UPLOAD_FILE_ACTION_RESPONSE\";\nexport const UPLOAD_FILE_ACTION_ERROR = \"UPLOAD_FILE_ACTION_ERROR\";\nexport const UPLOAD_FILE_ACTION_TRIGGER = \"UPLOAD_FILE_ACTION_TRIGGER\";\n\nexport const UPLOAD_MESSAGE_FILE_ACTION_RESPONSE =\n \"UPLOAD_MESSAGE_FILE_ACTION_RESPONSE\";\nexport const UPLOAD_MESSAGE_FILE_ACTION_ERROR =\n \"UPLOAD_MESSAGE_FILE_ACTION_ERROR\";\nexport const UPLOAD_MESSAGE_FILE_ACTION_TRIGGER =\n \"UPLOAD_MESSAGE_FILE_ACTION_TRIGGER\";\n// workBench\nexport const CREATE_CONVERSATION = \"CREATE_CONVERSATION\";\nexport const GET_ALL_CONVERSATION = \"GET_ALL_CONVERSATION\";\nexport const GET_ALL_CONVERSATION_BY_IDS = \"GET_ALL_CONVERSATION_BY_IDS\";\nexport const CREATE_CONV_NODE = \"CREATE_CONV_NODE\";\nexport const LINK_CONV_NODE = \"LINK_CONV_NODE\";\nexport const ACTIVE_WORKBENCH = \"ACTIVE_WORKBENCH\";\nexport const SET_LOGOURL = \"SET_LOGOURL\";\nexport const SET_LAUNCHERURL = \"SET_LAUNCHERURL\";\nexport const SET_WIDGET_COLOR = \"SET_WIDGET_COLOR\";\nexport const SET_WIDGET_ENABLED = \"SET_WIDGET_ENABLED\";\nexport const WB_DESIGN_JSON = \"WB_DESIGN_JSON\";\nexport const LOGO_UPLOAD = \"LOGO_UPLOAD\";\nexport const LAUNCHER_UPLOAD = \"LAUNCHER_UPLOAD\";\nexport const DEPLOY_URL = \"DEPLOY_URL\";\nexport const SELECTED_NODE = \"SELECTED_NODE\";\nexport const UPDATE_SELECTED_NODE = \"UPDATE_SELECTED_NODE\";\nexport const SET_WIDGET = \"SET_WIDGET\";\nexport const SET_WIDGET_DRAWER = \"SET_WIDGET_DRAWER\";\nexport const DATA_LOAD = \"DATA_LOAD\";\nexport const ADD_NODE = \"ADD_NODE\";\nexport const BOT_SKELETON = \"BOT_SKELETON\";\nexport const SET_ACTIVE_STEPPER = \"SET_ACTIVE_STEPPER\";\nexport const SET_NODE_DRAG = \"SET_NODE_DRAG\";\nexport const LANGUAGE_SET = \"LANGUAGE_SET\";\nexport const CONDITIONS_VAR_SET = \"CONDITIONS_VAR_SET\";\nexport const JUMP_LOCATIONS_SET = \"JUMP_LOCATIONS_SET\";\nexport const WB_BASE_URL = \"WB_BASE_URL\";\nexport const WB_ALL_API = \"WB_ALL_API\";\nexport const WB_WEBHOOK_BY_ID = \"WB_WEBHOOK_BY_ID\";\nexport const WB_SOPIFI_CAT = \"WB_SOPIFI_CAT\";\nexport const WB_SOPIFI_ITEM = \"WB_SOPIFI_ITEM\";\nexport const WB_SOPIFI_VAR = \"WB_SOPIFI_VAR\";\nexport const CONFIG_CHANNELS = \"CONFIG_CHANNELS\";\n\n//Botapi\nexport const GET_ALL_BOTS = \"GET_ALL_BOTS\";\nexport const ACTIVE_BOT = \"ACTIVE_BOT\";\n// Tenant\nexport const GET_TENANT_ACTION_TRIGGER = \"GET_TENANT_ACTION_TRIGGER\";\nexport const GET_TENANT_ACTION_RESPONSE = \"GET_TENANT_ACTION_RESPONSE\";\nexport const GET_TENANT_ACTION_ERROR = \"GET_TENANT_ACTION_ERROR\";\n\n// botAi\n\nexport const ACTIVE_LIST_BOT_AI = \"ACTIVE_LIST_BOT_AI\";\nexport const BOT_AI_SIDER = \"BOT_AI_SIDER\";\nexport const USED_ENTITIES = \"USED_ENTITIES\";\nexport const INTENT_QUESTIONS = \"INTENT_QUESTIONS\";\nexport const INTENT_LIST = \"INTENT_LIST\";\nexport const INTENT_DATA = \"INTENT_DATA\";\nexport const ACTIVE_INTENT = \"ACTIVE_INTENT\";\nexport const ENTITY_LIST = \"ENTITY_LIST\";\nexport const ACTIVE_ENTITY = \"ACTIVE_ENTITY\";\n\n//Admin\nexport const LOADING_TRIGGER = \"LOADING_TRIGGER\";\nexport const ACTIVE_LIST_ADMIN = \"ACTIVE_LIST_ADMIN\";\nexport const SIDEBAR_ADMIN = \"SIDEBAR_ADMIN\";\nexport const CONN_ACCOUNT = \"CONN_ACCOUNT\";\nexport const CONNECT_SIDEBAR_VIEW = \"CONNECT_SIDEBAR_VIEW\";\nexport const CHECK_EMAIL_AVL = \"CHECK_EMAIL_AVL\";\nexport const DEF_EMAIL_CONFIG = \"DEF_EMAIL_CONFIG\";\nexport const DEF_SMS_CONFIG = \"DEF_SMS_CONFIG\";\nexport const ALL_CONFIG = \"ALL_CONFIG\";\nexport const ACTIVE_INDEX = \"ACTIVE_INDEX\";\nexport const CHECK_PHONE_AVL = \"CHECK_PHONE_AVL\";\nexport const SMS_SEARCH = \"SMS_SEARCH\";\nexport const USER_TENANT_LIST = \"USER_TENANT_LIST\";\nexport const CHANNEL_ACCOUNT = \"CHANNEL_ACCOUNT\";\nexport const EMAIL_RECIPIENT = \"EMAIL_RECIPIENT\";\nexport const CC_EMAIL_RECIPERNT = \"CC_EMAIL_RECIPERNT\";\nexport const BCC_EMAIL_RECIPERNT = \"BCC_EMAIL_RECIPERNT\";\nexport const EMAIL_SUBJECT = \"EMAIL_SUBJECT\";\nexport const CHECKED_LIST = \"CHECKED_LIST\";\nexport const SMS_NO_DATA = \"SMS_NO_DATA\";\nexport const CONTENT_LOADING = \"CONTENT_LOADING\";\nexport const WHATSAPP_RESPONSE = \"WHATSAPP_RESPONSE\";\nexport const WHATSAPP_ERROR = \"WHATSAPP_ERROR\";\nexport const GET_LANGUAGES = \"GET_LANGUAGES\";\nexport const GET_LANGUAGES_FORM = \"GET_LANGUAGES_FORM\";\nexport const STORE_SHOPIFY = \"STORE_SHOPIFY\";\nexport const STORE_FACEBOOK = \"STORE_FACEBOOK\";\nexport const STORE_SETTINGS = \"STORE_SETTINGS\";\nexport const STORE_COLLECTIONS = \"STORE_COLLECTIONS\";\nexport const STORE_DATA = \"STORE_DATA\";\nexport const PRODUCT_COLLECTIONS = \"PRODUCT_COLLECTIONS\";\nexport const BUSINESS_INFO = \"BUSINESS_INFO\";\nexport const META_CONNECTION_INFO = \"META_CONNECTION_INFO\";\nexport const WHATSAPP_WEBHOOK = \"WHATSAPP_WEBHOOK\";\nexport const CONNECTED_BOT = \"CONNECTED_BOT\";\nexport const GET_INTEGRATION_PAYMENT_TRIGGER =\n \"GET_INTEGRATION_PAYMENT_TRIGGER\";\nexport const GET_INTEGRATION_PAYMENT_RESPONSE =\n \"GET_INTEGRATION_PAYMENT_RESPONSE\";\nexport const GET_INTEGRATION_PAYMENT_ERROR = \"GET_INTEGRATION_PAYMENT_ERROR\";\nexport const GET_INTEGRATION_SHOPIFY_TRIGGER =\n \"GET_INTEGRATION_SHOPIFY_TRIGGER\";\nexport const GET_INTEGRATION_SHOPIFY_RESPONSE =\n \"GET_INTEGRATION_SHOPIFY_RESPONSE\";\nexport const GET_INTEGRATION_SHOPIFY_ERROR = \"GET_INTEGRATION_SHOPIFY_ERROR\";\nexport const NOTIFICATION_PREFERENCE_TRIGGER =\n \"NOTIFICATION_PREFERENCE_TRIGGER\";\nexport const NOTIFICATION_PREFERENCE_RESPONSE =\n \"NOTIFICATION_PREFERENCE_RESPONSE\";\n\nexport const WHATSAPP_CONNECT_SETTINGS = \"WHATSAPP_CONNECT_SETTINGS\";\nexport const META_APIS_BUSINESS_INFO = \"META_APIS_BUSINESS_INFO\";\nexport const META_APIS_WEB_ID = \"META_APIS_WEB_ID\";\nexport const META_APIS_NUMBER = \"META_APIS_NUMBER\";\n\n//notification\nexport const READ_MESSAGE_ACTION_TRIGGER = \"READ_MESSAGE_ACTION_TRIGGER\";\nexport const READ_MESSAGE_ACTION_RESPONSE = \"READ_MESSAGE_ACTION_RESPONSE\";\nexport const READ_MESSAGE_ACTION_ERROR = \"READ_MESSAGE_ACTION_ERROR\";\n\nexport const CREATE_GROUP_CONV_ACTION_TRIGGER =\n \"CREATE_GROUP_CONV_ACTION_TRIGGER\";\n\nexport const CREATE_GROUP_CONV_ACTION_RESPONSE =\n \"CREATE_GROUP_CONV_ACTION_RESPONSE\";\nexport const CREATE_GROUP_CONV_ACTION_ERROR = \"CREATE_GROUP_CONV_ACTION_ERROR\";\nexport const GET_GROUP_CONV_ACTION_TRIGGER = \"GET_GROUP_CONV_ACTION_TRIGGER\";\nexport const GET_GROUP_CONV_ACTION_RESPONSE = \"GET_GROUP_CONV_ACTION_RESPONSE\";\nexport const GET_GROUP_CONV_ACTION_ERROR = \"GET_GROUP_CONV_ACTION_ERROR\";\nexport const SET_CHANNEL_TOPBAR = \"SET_CHANNEL_TOPBAR\";\nexport const UPDATE_GROUP_CONV_ACTION_TRIGGER =\n \"UPDATE_GROUP_CONV_ACTION_TRIGGER\";\nexport const UPDATE_GROUP_CONV_ACTION_RESPONSE =\n \"UPDATE_GROUP_CONV_ACTION_RESPONSE\";\nexport const UPDATE_GROUP_CONV_ACTION_ERROR = \"UPDATE_GROUP_CONV_ACTION_ERROR\";\n\n// dashboard\nexport const DASHBOARD_CARDS = \"DASHBOARD_CARDS\";\nexport const DASHBOARD_VISITORS = \"DASHBOARD_VISITORS\";\nexport const DASHBOARD_CONTACT = \"DASHBOARD_CONTACT\";\nexport const DASHBOARD_CARDS_TRIGGER = \"DASHBOARD_CARDS_TRIGGER\";\nexport const DASHBOARD_UNMOUNT = \"DASHBOARD_UNMOUNT\";\n\n// payment\nexport const CREATE_PAYMENTS_ACTION_TRIGGER = \"CREATE_PAYMENTS_ACTION_TRIGGER\";\nexport const CREATE_PAYMENTS_ACTION_RESPONSE =\n \"CREATE_PAYMENTS_ACTION_RESPONSE\";\nexport const CREATE_PAYMENTS_ACTION_ERROR = \"CREATE_PAYMENTS_ACTION_ERROR\";\n\nexport const GET_PAYMENTS_ACTION_TRIGGER = \"GET_PAYMENTS_ACTION_TRIGGER\";\nexport const GET_PAYMENTS_ACTION_RESPONSE = \"GET_PAYMENTS_ACTION_RESPONSE\";\nexport const GET_PAYMENTS_ACTION_ERROR = \"GET_PAYMENTS_ACTION_ERROR\";\n\nexport const GET_PAYMENTS_CARD_ACTION_TRIGGER =\n \"GET_PAYMENTS_CARD_ACTION_TRIGGER\";\nexport const GET_PAYMENTS_CARD_ACTION_RESPONSE =\n \"GET_PAYMENTS_CARD_ACTION_RESPONSE\";\nexport const GET_PAYMENTS_CARD_ACTION_ERROR = \"GET_PAYMENTS_CARD_ACTION_ERROR\";\n\nexport const GET_ALL_ITEM_ACTION_TRIGGER = \"GET_ALL_ITEM_ACTION_TRIGGER\";\nexport const GET_ALL_ITEM_ACTION_RESPONSE = \"GET_ALL_ITEM_ACTION_RESPONSE\";\nexport const GET_ALL_ITEM_ACTION_ERROR = \"GET_ALL_ITEM_ACTION_ERROR\";\n\nexport const GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER =\n \"GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER\";\nexport const GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE =\n \"GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE\";\nexport const GET_INTEGRATION_ACCOUNT_ACTION_ERROR =\n \"GET_INTEGRATION_ACCOUNT_ACTION_ERROR\";\n\nexport const GET_TEMPLATES_ACTION_TRIGGER = \"GET_TEMPLATES_ACTION_TRIGGER\";\nexport const GET_TEMPLATES_ACTION_RESPONSE = \"GET_TEMPLATES_ACTION_RESPONSE\";\nexport const GET_TEMPLATES_ACTION_ERROR = \"GET_TEMPLATES_ACTION_ERROR\";\nexport const CREATE_TEMPLATES_ACTION_TRIGGER =\n \"CREATE_TEMPLATES_ACTION_TRIGGER\";\nexport const CREATE_TEMPLATES_ACTION_RESPONSE =\n \"CREATE_TEMPLATES_ACTION_RESPONSE\";\nexport const CREATE_TEMPLATES_ACTION_ERROR = \"CREATE_TEMPLATES_ACTION_ERROR\";\n\nexport const BOT_PROCESSING_START = \"BOT_PROCESSING_START\";\nexport const BOT_PROCESSING_END = \"BOT_PROCESSING_END\";\nexport const TYPING_START = \"TYPING_START\";\nexport const TYPING_END = \"TYPING_END\";\nexport const EMIT_TYPING = \"EMIT_TYPING\";\n\n// campaign\nexport const GET_CAMPAIGNS_TRIGGER = \"GET_CAMPAIGNS_TRIGGER\";\nexport const GET_CAMPAIGNS_RESPONSE = \"GET_CAMPAIGNS_RESPONSE\";\nexport const GET_CAMPAIGNS_ERROR = \"GET_CAMPAIGNS_ERROR\";\nexport const CAMPAIGN_UPDATE_SIDEBAR = \"CAMPAIGN_UPDATE_SIDEBAR\";\nexport const WAIT_FOR_CAMPAIGN_RESPONSE = \"WAIT_FOR_CAMPAIGN_RESPONSE\";\nexport const GET_CAMPAIGNS_PLAN_STATUS_TRIGGER =\n \"GET_CAMPAIGNS_PLAN_STATUS_TRIGGER\";\nexport const GET_CAMPAIGNS_PLAN_STATUS_RESPONSE =\n \"GET_CAMPAIGNS_PLAN_STATUS_RESPONSE\";\nexport const GET_CAMPAIGNS_PLAN_STATUS_ERROR =\n \"GET_CAMPAIGNS_PLAN_STATUS_ERROR\";\n// create campaign\nexport const CREATE_CAMPAIGNS_TRIGGER = \"CREATE_CAMPAIGNS_TRIGGER\";\nexport const CREATE_CAMPAIGNS_RESPONSE = \"CREATE_CAMPAIGNS_RESPONSE\";\n// create campaign step\nexport const CREATE_CAMPAIGN_STEP_TRIGGER = \"CREATE_CAMPAIGN_STEP_TRIGGER\";\nexport const CREATE_CAMPAIGN_STEP_RESPONSE = \"CREATE_CAMPAIGN_STEP_RESPONSE\";\n// Get campaign by id\nexport const GET_CAMPAIGN_BY_ID_TRIGGER = \"GET_CAMPAIGN_BY_ID_TRIGGER\";\nexport const GET_CAMPAIGN_BY_ID_RESPONSE = \"GET_CAMPAIGN_BY_ID_RESPONSE\";\nexport const ACTIVE_CAMPAIGN_SIDEBAR = \"ACTIVE_CAMPAIGN_SIDEBAR\";\nexport const CAMPAIGN_UPDATE_DATA = \"CAMPAIGN_UPDATE_DATA\";\nexport const CAMPAIGN_AT_VIEW = \"CAMPAIGN_AT_VIEW\";\nexport const GET_CAMPAIGNS_PLANS_RESPONSE = \"GET_CAMPAIGNS_PLANS_RESPONSE\";\n\nexport const GET_CAMPAIGNS_STEPS_CONDITIONS_TRIGGER =\n \"GET_CAMPAIGNS_STEPS_CONDITIONS_TRIGGER\";\nexport const GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE =\n \"GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE\";\nexport const GET_CAMPAIGNS_STEPS_CONDITIONS_ERROR =\n \"GET_CAMPAIGNS_STEPS_CONDITIONS_ERROR\";\n\n// User\nexport const GET_USER_DETAILS = \"GET_USER_DETAILS\";\nexport const GET_USER_DETAILS_ERROR = \"GET_USER_DETAILS_ERROR\";\nexport const GET_USER_DETAILS_SUCCESS = \"GET_USER_DETAILS_SUCCESS\";\n\n// SignUP\nexport const SUPPORTED_LANGUAGES = \"SUPPORTED_LANGUAGES\";\nexport const POSTAL_CODE = \"POSTAL_CODE\";\nexport const STEP_ONE_DATA = \"STEP_ONE_DATA\";\n\n// UnVarified User\nexport const UNVERIFIED_USER = \"UNVERIFIED_USER\";\n\n// email Template\n\nexport const EMAIL_TEMPLATES_ACTION_RESPONSE =\n \"EMAIL_TEMPLATES_ACTION_RESPONSE\";\nexport const EMAIL_TEMPLATES_ACTION_ERROR = \"EMAIL_TEMPLATES_ACTION_ERROR\";\n\nexport const GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE =\n \"GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE\";\nexport const GET_EMAIL_TEMPLATES_VARIABLES_ERROR =\n \"GET_EMAIL_TEMPLATES_VARIABLES_ERROR\";\nexport const TEMPLATE_DETAILS_BY_ID_RESPONSE =\n \"TEMPLATE_DETAILS_BY_ID_RESPONSE\";\nexport const TEMPLATE_DETAILS_BY_ID_ERROR = \"TEMPLATE_DETAILS_BY_ID_ERROR\";\n\nexport const GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE =\n \"GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE\";\n\nexport const GET_EMAIL_PLATEFORM_TEMPLATES_ERROR =\n \"GET_EMAIL_PLATEFORM_TEMPLATES_ERROR\";\nexport const EMAIL_TEMPLATES_ACTION_CLEAR = \"EMAIL_TEMPLATES_ACTION_CLEAR\";\nexport const STORE_DATA_LIST = \"STORE_DATA_LIST\";\n\nexport const GET_WHATSAPP_TEMPLATES_TRIGGER = \"GET_WHATSAPP_TEMPLATES_TRIGGER\";\nexport const GET_WHATSAPP_TEMPLATES_RESPONSE =\n \"GET_WHATSAPP_TEMPLATES_RESPONSE\";\nexport const GET_WHATSAPP_TEMPLATES_ERROR = \"GET_WHATSAPP_TEMPLATES_ERROR\";\nexport const PUT_WHATSAPP_TEMPLATE_TRIGGER = \"PUT_WHATSAPP_TEMPLATE_TRIGGER\";\nexport const PUT_WHATSAPP_TEMPLATE_RESPONSE = \"PUT_WHATSAPP_TEMPLATE_RESPONSE\";\nexport const PUT_WHATSAPP_TEMPLATE_ERROR = \"PUT_WHATSAPP_TEMPLATE_ERROR\";\nexport const GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER =\n \"GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER\";\nexport const GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE =\n \"GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE\";\nexport const GET_WHATSAPP_TEMPLATE_BY_ID_ERROR =\n \"GET_WHATSAPP_TEMPLATE_BY_ID_ERROR\";\nexport const CLEAN_UP = \"CLEAN_UP\";\nexport const GET_TEMPLATE_VARIABLES_RESPONSE =\n \"GET_TEMPLATE_VARIABLES_RESPONSE\";\nexport const GET_TEMPLATE_VARIABLES_ERROR = \"GET_TEMPLATE_VARIABLES_ERROR\";\n\nexport const TAG_LIST_TRIGGER = \"TAG_LIST_TRIGGER\";\nexport const TAG_LIST_RESPONSE = \"TAG_LIST_RESPONSE\";\nexport const TAG_LIST_ERROR = \"TAG_LIST_ERROR\";\nexport const IMPORT_TEMPLATE_RESPONSE = \"IMPORT_TEMPLATE_RESPONSE\";\nexport const RESET_TEMPLATE_RESPONSE = \"RESET_TEMPLATE_RESPONSE\";\n\n// notification\n\nexport const GET_UNREAD_NOTIFICATION = \"GET_UNREAD_NOTIFICATION\";\nexport const GET_UNREAD_NOTIFICATION_RESPONSE =\n \"GET_UNREAD_NOTIFICATION_RESPONSE\";\nexport const SET_INCOMMING_MSG = \"SET_INCOMMING_MSG\";\n\n// subscription\nexport const GET_SUBSCRIPTIONS_TRIGGER = \"GET_SUBSCRIPTIONS_TRIGGER\";\nexport const GET_SUBSCRIPTIONS_RESPONSE = \"GET_SUBSCRIPTIONS_RESPONSE\";\nexport const GET_SUBSCRIPTIONS_ERROR = \"GET_SUBSCRIPTIONS_ERROR\";\n\n// opening\nexport const SET_OPENING_TAB = \"SET_OPENING_TAB\";\nexport const SET_OPENING_SIDEBAR_VIEW = \"SET_OPENING_SIDEBAR_VIEW\";\nexport const SET_OPENING_SIDEBAR_DATA = \"SET_OPENING_SIDEBAR_DATA\";\nexport const GET_OPEN_POSITIONS_TRIGGER = \"GET_OPEN_POSITIONS_TRIGGER\";\nexport const GET_OPEN_POSITIONS_RESPONSE = \"GET_OPEN_POSITIONS_RESPONSE\";\nexport const GET_OPEN_POSITIONS_ERROR = \"GET_OPEN_POSITIONS_ERROR\";\nexport const GET_ALL_CANDIDATES_BY_POSITION_TRIGGER =\n \"GET_ALL_CANDIDATES_BY_POSITION_TRIGGER\";\nexport const GET_ALL_CANDIDATES_BY_POSITION_RESPONSE =\n \"GET_ALL_CANDIDATES_BY_POSITION_RESPONSE\";\nexport const GET_ALL_CANDIDATES_BY_POSITION_ERROR =\n \"GET_ALL_CANDIDATES_BY_POSITION_ERROR\";\n\nexport const GET_ALL_COMPANIES_TRIGGER = \"GET_ALL_COMPANIES_TRIGGER\";\nexport const GET_ALL_COMPANIES_RESPONSE = \"GET_ALL_COMPANIES_RESPONSE\";\nexport const GET_ALL_COMPANIES_ERROR = \"GET_ALL_COMPANIES_ERROR\";\nexport const GET_CANDIDATE_STAGE_TRIGGER = \"GET_CANDIDATE_STAGE_TRIGGER\";\nexport const GET_CANDIDATE_STAGE_RESPONSE = \"GET_CANDIDATE_STAGE_RESPONSE\";\nexport const GET_CANDIDATE_STAGE_ERROR = \"GET_CANDIDATE_STAGE_ERROR\";\n\n// MailPreview from inbox\nexport const SET_MAIL_PREVIEW_DATA = \"SET_MAIL_PREVIEW_DATA\";\nexport const REMOVE_MAIL_PREVIEW_DATA = \"REMOVE_MAIL_PREVIEW_DATA\";\nexport const SET_MAIL_PREVIEW_DATA_THREAD = \"SET_MAIL_PREVIEW_DATA_THREAD\";\n\n// account variables\nexport const GET_ACCOUNT_VARIABLES_RESPONSE = \"GET_ACCOUNT_VARIABLES_RESPONSE\";\nexport const GET_ACCOUNT_VARIABLES_ERROR = \"GET_ACCOUNT_VARIABLES_ERROR\";\n\n// Thread email\n\nexport const GET_THREAD_EMAIL_MESSAGES_TRIGGER =\n \"GET_THREAD_EMAIL_MESSAGES_TRIGGER\";\nexport const GET_THREAD_EMAIL_MESSAGES_RESPONSE =\n \"GET_THREAD_EMAIL_MESSAGES_RESPONSE\";\nexport const GET_THREAD_EMAIL_MESSAGES_ERROR =\n \"GET_THREAD_EMAIL_MESSAGES_ERROR\";\n","/**\n * FingerprintJS v3.4.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArray } from 'tslib';\n\nvar version = \"3.4.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return !!value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction mapWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var results, lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n results = Array(items.length);\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n results[i] = callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\n _a.sent();\n _a.label = 3;\n case 3:\n ++i;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, results];\n }\n });\n });\n}\n/**\n * Makes the given promise never emit an unhandled promise rejection console warning.\n * The promise will still pass errors to the next promises.\n *\n * Otherwise, promise emits a console warning unless it has a `catch` listener.\n */\nfunction suppressUnhandledRejectionWarning(promise) {\n promise.then(undefined, function () { return undefined; });\n}\n\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\".concat(selector, \"'\");\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\nfunction isFinalResultLoaded(loadResult) {\n return typeof loadResult !== 'function';\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n suppressUnhandledRejectionWarning(sourceLoadPromise);\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n // Using `mapWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n var sourceGettersPromise = mapWithBreaks(includedSources, function (sourceKey) {\n return loadSource(sources[sourceKey], sourceOptions);\n });\n suppressUnhandledRejectionWarning(sourceGettersPromise);\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var sourceGetters, componentPromises, componentArray, components, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, sourceGettersPromise];\n case 1:\n sourceGetters = _a.sent();\n return [4 /*yield*/, mapWithBreaks(sourceGetters, function (sourceGetter) {\n var componentPromise = sourceGetter();\n suppressUnhandledRejectionWarning(componentPromise);\n return componentPromise;\n })];\n case 2:\n componentPromises = _a.sent();\n return [4 /*yield*/, Promise.all(componentPromises)\n // Keeping the component keys order the same as the source keys order\n ];\n case 3:\n componentArray = _a.sent();\n components = {};\n for (index = 0; index < includedSources.length; ++index) {\n components[includedSources[index]] = componentArray[index];\n }\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n/**\n * Modifies an entropy source by transforming its returned value with the given function.\n * Keeps the source properties: sync/async, 1/2 stages.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction transformSource(source, transformValue) {\n var transformLoadResult = function (loadResult) {\n if (isFinalResultLoaded(loadResult)) {\n return transformValue(loadResult);\n }\n return function () {\n var getResult = loadResult();\n if (isPromise(getResult)) {\n return getResult.then(transformValue);\n }\n return transformValue(getResult);\n };\n };\n return function (options) {\n var loadResult = source(options);\n if (isPromise(loadResult)) {\n return loadResult.then(transformLoadResult);\n }\n return transformLoadResult(loadResult);\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprint.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* SpecialFingerprint.NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* SpecialFingerprint.KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* InnerErrorName.Timeout */ || error.name === \"suspended\" /* InnerErrorName.Suspended */) {\n return -3 /* SpecialFingerprint.Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n suppressUnhandledRejectionWarning(fingerprintPromise);\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* InnerErrorName.Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n var renderingPromise = context.startRendering();\n // `context.startRendering` has two APIs: Promise and callback, we check that it's really a promise just in case\n if (isPromise(renderingPromise)) {\n // Suppresses all unhadled rejections in case of scheduled redundant retries after successful rendering\n suppressUnhandledRejectionWarning(renderingPromise);\n }\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* InnerErrorName.Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n var value = attributes[name_1].join(' ');\n // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.\n // https://github.com/fingerprintjs/fingerprintjs/issues/733\n if (name_1 === 'style') {\n addStyleString(element.style, value);\n }\n else {\n element.setAttribute(name_1, value);\n }\n }\n return element;\n}\n/**\n * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)\n */\nfunction addStyleString(style, source) {\n // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note\n // Even though the browsers ignore this standard, we don't use `cssText` just in case.\n for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {\n var property = _a[_i];\n var match = /^\\s*([\\w-]+)\\s*:\\s*(.+?)(\\s*!([\\w-]+))?\\s*$/.exec(property);\n if (match) {\n var name_2 = match[1], value = match[2], priority = match[4];\n style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11\n }\n }\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\".concat(fontToDetect, \"',\").concat(baseFont));\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var winding = false;\n var geometry;\n var text;\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n geometry = text = ''; // The value will be 'unsupported' in v3.4\n }\n else {\n winding = doesSupportWinding(context);\n renderTextImage(canvas, context);\n var textImage1 = canvasToString(canvas);\n var textImage2 = canvasToString(canvas); // It's slightly faster to double-encode the text image\n // Some browsers add a noise to the canvas: https://github.com/fingerprintjs/fingerprintjs/issues/791\n // The canvas is excluded from the fingerprint in this case\n if (textImage1 !== textImage2) {\n geometry = text = 'unstable';\n }\n else {\n text = textImage1;\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n renderGeometryImage(canvas, context);\n geometry = canvasToString(canvas);\n }\n }\n return { winding: winding, geometry: geometry, text: text };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction renderTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \".concat(String.fromCharCode(55357, 56835) /* 😃 */);\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n}\nfunction renderGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n}\nfunction canvasToString(canvas) {\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArray([], screenFrameBackup, true)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\".concat(offset >= 0 ? '+' : '').concat(Math.abs(offset));\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n // UC on iOS and Opera on Android have no specific global variables\n // Edge for Android isn't checked\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * The \"inappropriate\" selectors are obfuscated. See https://github.com/fingerprintjs/fingerprintjs/issues/734.\n * A function is used instead of a plain object to help tree-shaking.\n *\n * The function code is generated automatically. See docs/content_blockers.md to learn how to make the list.\n */\nfunction getFilters() {\n var fromB64 = atob; // Just for better minification\n return {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n '[title=\"ALIENBOLA\" i]',\n fromB64('I0JveC1CYW5uZXItYWRz'),\n ],\n abpvn: ['.quangcao', '#mobileCatfish', fromB64('LmNsb3NlLWFkcw=='), '[id^=\"bn_bottom_fixed_\"]', '#pmadv'],\n adBlockFinland: [\n '.mainostila',\n fromB64('LnNwb25zb3JpdA=='),\n '.ylamainos',\n fromB64('YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd'),\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n fromB64('YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd'),\n ],\n adBlockWarningRemoval: [\n '#adblock-honeypot',\n '.adblocker-root',\n '.wp_adblock_detect',\n fromB64('LmhlYWRlci1ibG9ja2VkLWFk'),\n fromB64('I2FkX2Jsb2NrZXI='),\n ],\n adGuardAnnoyances: [\n '.hs-sosyal',\n '#cookieconsentdiv',\n 'div[class^=\"app_gdpr\"]',\n '.as-oil',\n '[data-cypress=\"soft-push-notification-modal\"]',\n ],\n adGuardBase: [\n '.BetterJsPopOverlay',\n fromB64('I2FkXzMwMFgyNTA='),\n fromB64('I2Jhbm5lcmZsb2F0MjI='),\n fromB64('I2NhbXBhaWduLWJhbm5lcg=='),\n fromB64('I0FkLUNvbnRlbnQ='),\n ],\n adGuardChinese: [\n fromB64('LlppX2FkX2FfSA=='),\n fromB64('YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd'),\n '#widget-quan',\n fromB64('YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd'),\n fromB64('YVtocmVmKj0iLjE5NTZobC5jb20vIl0='),\n ],\n adGuardFrench: [\n '#pavePub',\n fromB64('LmFkLWRlc2t0b3AtcmVjdGFuZ2xl'),\n '.mobile_adhesion',\n '.widgetadv',\n fromB64('LmFkc19iYW4='),\n ],\n adGuardGerman: ['aside[data-portal-id=\"leaderboard\"]'],\n adGuardJapanese: [\n '#kauli_yad_1',\n fromB64('YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0='),\n fromB64('Ll9wb3BJbl9pbmZpbml0ZV9hZA=='),\n fromB64('LmFkZ29vZ2xl'),\n fromB64('Ll9faXNib29zdFJldHVybkFk'),\n ],\n adGuardMobile: [\n fromB64('YW1wLWF1dG8tYWRz'),\n fromB64('LmFtcF9hZA=='),\n 'amp-embed[type=\"24smi\"]',\n '#mgid_iframe1',\n fromB64('I2FkX2ludmlld19hcmVh'),\n ],\n adGuardRussian: [\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0='),\n fromB64('LnJlY2xhbWE='),\n 'div[id^=\"smi2adblock\"]',\n fromB64('ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd'),\n '#psyduckpockeball',\n ],\n adGuardSocial: [\n fromB64('YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0='),\n fromB64('YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0='),\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: ['#barraPublicidade', '#Publicidade', '#publiEspecial', '#queTooltip', '.cnt-publi'],\n adGuardTrackingProtection: [\n '#qoo-counter',\n fromB64('YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=='),\n '#top100counter',\n ],\n adGuardTurkish: [\n '#backkapat',\n fromB64('I3Jla2xhbWk='),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ=='),\n ],\n bulgarian: [fromB64('dGQjZnJlZW5ldF90YWJsZV9hZHM='), '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: [\n '.yb-floorad',\n fromB64('LndpZGdldF9wb19hZHNfd2lkZ2V0'),\n fromB64('LnRyYWZmaWNqdW5reS1hZA=='),\n '.textad_headline',\n fromB64('LnNwb25zb3JlZC10ZXh0LWxpbmtz'),\n ],\n easyListChina: [\n fromB64('LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=='),\n fromB64('LmZyb250cGFnZUFkdk0='),\n '#taotaole',\n '#aafoot.top_box',\n '.cfa_popup',\n ],\n easyListCookie: [\n '.ezmob-footer',\n '.cc-CookieWarning',\n '[data-cookie-number]',\n fromB64('LmF3LWNvb2tpZS1iYW5uZXI='),\n '.sygnal24-gdpr-modal-wrap',\n ],\n easyListCzechSlovak: [\n '#onlajny-stickers',\n fromB64('I3Jla2xhbW5pLWJveA=='),\n fromB64('LnJla2xhbWEtbWVnYWJvYXJk'),\n '.sklik',\n fromB64('W2lkXj0ic2tsaWtSZWtsYW1hIl0='),\n ],\n easyListDutch: [\n fromB64('I2FkdmVydGVudGll'),\n fromB64('I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=='),\n '.adstekst',\n fromB64('YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0='),\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n '#SSpotIMPopSlider',\n fromB64('LnNwb25zb3JsaW5rZ3J1ZW4='),\n fromB64('I3dlcmJ1bmdza3k='),\n fromB64('I3Jla2xhbWUtcmVjaHRzLW1pdHRl'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0='),\n ],\n easyListItaly: [\n fromB64('LmJveF9hZHZfYW5udW5jaQ=='),\n '.sb-box-pubbliredazionale',\n fromB64('YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ=='),\n ],\n easyListLithuania: [\n fromB64('LnJla2xhbW9zX3RhcnBhcw=='),\n fromB64('LnJla2xhbW9zX251b3JvZG9z'),\n fromB64('aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd'),\n fromB64('aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd'),\n fromB64('aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd'),\n ],\n estonian: [fromB64('QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==')],\n fanboyAnnoyances: ['#ac-lre-player', '.navigate-to-top', '#subscribe_popup', '.newsletter_holder', '#back-top'],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: ['#FollowUs', '#meteored_share', '#social_follow', '.article-sharer', '.community__social-desc'],\n frellwitSwedish: [\n fromB64('YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=='),\n fromB64('YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=='),\n 'article.category-samarbete',\n fromB64('ZGl2LmhvbGlkQWRz'),\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n fromB64('QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd'),\n fromB64('QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=='),\n fromB64('QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd'),\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n '#cemp_doboz',\n '.optimonk-iframe-container',\n fromB64('LmFkX19tYWlu'),\n fromB64('W2NsYXNzKj0iR29vZ2xlQWRzIl0='),\n '#hirdetesek_box',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '#cookies-policy-sticky',\n '#stickyCookieBar',\n ],\n icelandicAbp: [fromB64('QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==')],\n latvian: [\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0O' +\n 'iA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0='),\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6I' +\n 'DMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ=='),\n ],\n listKr: [\n fromB64('YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0='),\n fromB64('I2xpdmVyZUFkV3JhcHBlcg=='),\n fromB64('YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=='),\n fromB64('aW5zLmZhc3R2aWV3LWFk'),\n '.revenue_unit_item.dable',\n ],\n listeAr: [\n fromB64('LmdlbWluaUxCMUFk'),\n '.right-and-left-sponsers',\n fromB64('YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=='),\n fromB64('YVtocmVmKj0iYm9vcmFxLm9yZyJd'),\n fromB64('YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd'),\n ],\n listeFr: [\n fromB64('YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=='),\n fromB64('I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=='),\n fromB64('YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0='),\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n fromB64('W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=='),\n fromB64('ZGl2I3NrYXBpZWNfYWQ='),\n ],\n ro: [\n fromB64('YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0='),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd'),\n 'a[href^=\"/url/\"]',\n ],\n ruAd: [\n fromB64('YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd'),\n fromB64('YVtocmVmKj0iLy91dGltZy5ydS8iXQ=='),\n fromB64('YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0='),\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: [\n 'a[href*=macau-uta-popup]',\n fromB64('I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=='),\n fromB64('LmFkczMwMHM='),\n '.bumq',\n '.img-kosana',\n ],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n fromB64('LmN0cGwtZnVsbGJhbm5lcg=='),\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n };\n}\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var _b = _a === void 0 ? {} : _a, debug = _b.debug;\n return __awaiter(this, void 0, void 0, function () {\n var filters, filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filters = getFilters();\n filterNames = Object.keys(filters);\n allSelectors = (_c = []).concat.apply(_c, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _d.sent();\n if (debug) {\n printDebug(filters, blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n if (element.tagName === 'DIALOG') {\n element.show();\n }\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(filters, blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\".concat(filterName, \":\");\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \".concat(blockedSelectors[selector] ? '🚫' : '➡️', \" \").concat(selector);\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"\".concat(message, \"\\n```\"));\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \".concat(gamut, \")\")).matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch$4('inverted')) {\n return true;\n }\n if (doesMatch$4('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(inverted-colors: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$3('active')) {\n return true;\n }\n if (doesMatch$3('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(forced-colors: \".concat(value, \")\")).matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \".concat(i, \")\")).matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* ContrastPreference.None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* ContrastPreference.More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* ContrastPreference.Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ContrastPreference.ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$1('reduce')) {\n return true;\n }\n if (doesMatch$1('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(prefers-reduced-motion: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch('high')) {\n return true;\n }\n if (doesMatch('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(dynamic-range: \".concat(value, \")\")).matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = \"\".concat(containerWidthPx, \"px\");\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\".concat(1 / iframeWindow.devicePixelRatio);\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArray([], Array((containerWidthPx / 20) << 0), true).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * @see Credits: https://stackoverflow.com/a/49267844\n */\nfunction getVideoCard() {\n var _a;\n var canvas = document.createElement('canvas');\n var gl = (_a = canvas.getContext('webgl')) !== null && _a !== void 0 ? _a : canvas.getContext('experimental-webgl');\n if (gl && 'getExtension' in gl) {\n var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');\n if (debugInfo) {\n return {\n vendor: (gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) || '').toString(),\n renderer: (gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) || '').toString(),\n };\n }\n }\n return undefined;\n}\n\nfunction isPdfViewerEnabled() {\n return navigator.pdfViewerEnabled;\n}\n\n/**\n * Unlike most other architectures, on x86/x86-64 when floating-point instructions\n * have no NaN arguments, but produce NaN output, the output NaN has sign bit set.\n * We use it to distinguish x86/x86-64 from other architectures, by doing subtraction\n * of two infinities (must produce NaN per IEEE 754 standard).\n *\n * See https://codebrowser.bddppq.com/pytorch/pytorch/third_party/XNNPACK/src/init.c.html#79\n */\nfunction getArchitecture() {\n var f = new Float32Array(1);\n var u8 = new Uint8Array(f.buffer);\n f[0] = Infinity;\n f[0] = f[0] - f[0];\n return u8[3];\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n *\n * Note: Rollup and Webpack are smart enough to remove unused properties of this object during tree-shaking, so there is\n * no need to export the sources individually.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n videoCard: getVideoCard,\n pdfViewerEnabled: isPdfViewerEnabled,\n architecture: getArchitecture,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\".concat(proConfidenceScore)) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\".concat(result ? '|' : '').concat(componentKey.replace(/([:|\\\\])/g, '\\\\$1'), \":\").concat(value);\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \".concat(result.version, \"\\nuserAgent: \").concat(navigator.userAgent, \"\\ntimeBetweenLoadAndGet: \").concat(startTime - creationTime, \"\\nvisitorId: \").concat(result.visitorId, \"\\ncomponents: \").concat(componentsToDebugString(components), \"\\n```\"));\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.001) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://m1.openfpcdn.io/fingerprintjs/v\".concat(version, \"/npm-monitoring\"), true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport { componentsToDebugString, index as default, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources, transformSource, withIframe };\n","import React, { useEffect } from \"react\";\nimport FingerprintJS from \"@fingerprintjs/fingerprintjs\";\n\nconst FingerprintHelper = () => {\n useEffect(() => {\n FingerprintJS.load()\n .then((fp) => fp.get())\n .then((result) => {\n localStorage.setItem(\"FINGERPRINT\", result.visitorId);\n });\n }, []);\n return
;\n};\n\nexport default FingerprintHelper;\n","/**\n * HTTP Service Wrapper\n */\nimport axios from \"axios\";\nimport { getCookie, cxmessage } from \"utils\";\nimport {\n apiUrl,\n apiUrlProd,\n authUrl,\n workbenchUrl,\n workbenchProdUrl,\n qaOneApi,\n prodOneApi,\n publicUrl,\n oauthUrl,\n publicAuthUrl,\n notificationUrl,\n} from \"config/config\";\nimport history from \"utils/history\";\n\naxios.defaults.withCredentials = false;\naxios.defaults.crossdomain = true;\n\nfunction getURL(service) {\n const tenantId = getCookie(\"tenant\");\n switch (service) {\n case \"workbench\":\n return workbenchUrl + `/${tenantId}`;\n case \"oauth\":\n return oauthUrl;\n case \"notification\":\n return notificationUrl;\n default:\n return apiUrl + `/${tenantId}`;\n }\n}\nfunction getUserPref(service) {\n switch (service) {\n case \"workbench\":\n return workbenchUrl;\n default:\n return apiUrl;\n }\n}\nfunction postSignup(service) {\n switch (service) {\n case \"workbench\":\n return workbenchUrl;\n default:\n return publicAuthUrl;\n }\n}\n\n// * request interceptor to add the auth token header to requests\naxios.interceptors.request.use(\n (config) => {\n const accessToken = getCookie(\"ob_a\");\n const tenantId = getCookie(\"tenant\");\n if (accessToken) {\n config.headers[\"Authorization\"] = `Bearer ${accessToken}`;\n config.headers[\"Content-Type\"] = \"application/json\";\n config.headers[\"tenantid\"] = tenantId;\n }\n return config;\n },\n (error) => {\n Promise.reject(error);\n }\n);\n\n// * response interceptor to refresh token on receiving token expired error\naxios.interceptors.response.use(\n (response) => {\n return response;\n },\n function (error) {\n const originalRequest = error.config;\n // let refreshToken = getCookie(\"ob_r\");\n let typeToken = getCookie(\"token_type\");\n if (\n // refreshToken &&\n error.response &&\n error.response.status === 401 &&\n typeToken !== \"mfa\" &&\n !originalRequest._retry\n ) {\n // TODO: implement the refresh token logic\n localStorage.clear();\n history.push(\"/\");\n originalRequest._retry = true;\n } else {\n cxmessage.error(\n error.response?.data?.description\n ? error.response?.data?.description\n : error.message\n );\n }\n return Promise.reject(error);\n }\n);\n\nexport async function postLogin(url, body, params, headers) {\n return new Promise((resolve, reject) => {\n axios\n .post(authUrl + url, body, {\n headers: headers || {\n \"Content-Type\": \"application/json\",\n Authorization: `${getCookie(\"ob_a\")}`,\n },\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\n\nexport async function getpublic(url) {\n try {\n const response = await axios.get(publicUrl + url);\n return response;\n } catch (error) {\n return error;\n }\n}\nexport async function postpublic(url, body, params) {\n return new Promise((resolve, reject) => {\n axios\n .post(publicUrl + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\nexport async function get(url, params, service = null) {\n try {\n const response = await axios.get(getURL(service) + url, {\n params: params,\n });\n return response;\n } catch (error) {\n return error;\n }\n}\nexport async function usrpref(url, params, service = null) {\n try {\n const response = await axios.get(getUserPref(service) + url, {\n params: params,\n });\n return response;\n } catch (error) {\n return error;\n }\n}\n\nexport async function post(url, body, params, service = null) {\n return new Promise((resolve, reject) => {\n axios\n .post(getURL(service) + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\nexport async function post1(url, body, params) {\n return new Promise((resolve, reject) => {\n axios\n .post(authUrl + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\nexport async function postsign(url, body, params, service = null) {\n return new Promise((resolve, reject) => {\n axios\n .post(postSignup(service) + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\n\nexport async function put(url, body, params, service = null) {\n return new Promise((resolve, reject) => {\n axios\n .put(getURL(service) + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\n\nexport async function patch(url, body, params, service = null) {\n return new Promise((resolve, reject) => {\n axios\n .patch(getURL(service) + url, body, {\n params: params,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\n\nexport async function del(url, body, params, service = null) {\n try {\n const response = await axios.delete(getURL(service) + url, {\n data: body,\n params: params,\n });\n return response;\n } catch (error) {\n return error;\n }\n}\n\nexport async function postFormData(url, body, service = null) {\n return new Promise((resolve, reject) => {\n axios\n .post(getURL(service) + url, body, {\n \"Content-Type\": \"multipart/form-data\",\n Authorization: `${getCookie(\"ob_a\")}`,\n })\n .then((responce) => {\n resolve(responce);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MissingTranslationError, MessageFormatError } from './error';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport function formatMessage(_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar NUMBER_FORMAT_OPTIONS = [\n 'localeMatcher',\n 'style',\n 'currency',\n 'currencyDisplay',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return [];\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { __assign } from \"tslib\";\nimport { filterProps, getNamedFormat } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'localeMatcher',\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var timeZone = config.timeZone, locale = config.locale, onError = config.onError;\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});\n try {\n return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date time range.', e));\n }\n return String(from);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { IntlFormatError } from './error';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nvar PLURAL_FORMAT_OPTIONS = [\n 'localeMatcher',\n 'type',\n];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { __assign } from \"tslib\";\nimport { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlError, IntlErrorCode } from './error';\nvar LIST_FORMAT_OPTIONS = [\n 'localeMatcher',\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });\n });\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting list.', e));\n }\n // @ts-ignore\n return values;\n}\n","import { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlErrorCode, IntlError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'localeMatcher',\n 'style',\n 'type',\n 'fallback',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting display name.', e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatRelativeTime } from './relativeTime';\nimport { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';\nimport { formatPlural } from './plural';\nimport { formatMessage } from './message';\nimport { formatList, formatListToParts } from './list';\nimport { formatDisplayName } from './displayName';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __assign, __extends, __rest, __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { Provider } from './injectIntl';\nimport { DEFAULT_INTL_CONFIG, invariantIntlContext, assignUniqueKeysToParts, shallowEqual, } from '../utils';\nimport { formatMessage as coreFormatMessage, createIntl as coreCreateIntl, createIntlCache, } from '@formatjs/intl';\nimport { isFormatXMLElementFn, } from 'intl-messageformat';\nfunction processIntlConfig(config) {\n return {\n locale: config.locale,\n timeZone: config.timeZone,\n fallbackOnEmptyString: config.fallbackOnEmptyString,\n formats: config.formats,\n textComponent: config.textComponent,\n messages: config.messages,\n defaultLocale: config.defaultLocale,\n defaultFormats: config.defaultFormats,\n onError: config.onError,\n onWarn: config.onWarn,\n wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment,\n defaultRichTextElements: config.defaultRichTextElements,\n };\n}\nfunction assignUniqueKeysToFormatXMLElementFnArgument(values) {\n if (!values) {\n return values;\n }\n return Object.keys(values).reduce(function (acc, k) {\n var v = values[k];\n acc[k] = isFormatXMLElementFn(v)\n ? assignUniqueKeysToParts(v)\n : v;\n return acc;\n }, {});\n}\nvar formatMessage = function (config, formatters, descriptor, rawValues) {\n var rest = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n rest[_i - 4] = arguments[_i];\n }\n var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues);\n var chunks = coreFormatMessage.apply(void 0, __spreadArray([config,\n formatters,\n descriptor,\n values], rest, false));\n if (Array.isArray(chunks)) {\n return React.Children.toArray(chunks);\n }\n return chunks;\n};\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport var createIntl = function (_a, cache) {\n var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, [\"defaultRichTextElements\"]);\n var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);\n var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);\n return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, {\n locale: coreIntl.locale,\n timeZone: coreIntl.timeZone,\n fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,\n formats: coreIntl.formats,\n defaultLocale: coreIntl.defaultLocale,\n defaultFormats: coreIntl.defaultFormats,\n messages: coreIntl.messages,\n onError: coreIntl.onError,\n defaultRichTextElements: defaultRichTextElements,\n }, coreIntl.formatters) });\n};\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cache = createIntlCache();\n _this.state = {\n cache: _this.cache,\n intl: createIntl(processIntlConfig(_this.props), _this.cache),\n prevConfig: processIntlConfig(_this.props),\n };\n return _this;\n }\n IntlProvider.getDerivedStateFromProps = function (props, _a) {\n var prevConfig = _a.prevConfig, cache = _a.cache;\n var config = processIntlConfig(props);\n if (!shallowEqual(prevConfig, config)) {\n return {\n intl: createIntl(config, cache),\n prevConfig: config,\n };\n }\n return null;\n };\n IntlProvider.prototype.render = function () {\n invariantIntlContext(this.state.intl);\n return React.createElement(Provider, { value: this.state.intl }, this.props.children);\n };\n IntlProvider.displayName = 'IntlProvider';\n IntlProvider.defaultProps = DEFAULT_INTL_CONFIG;\n return IntlProvider;\n}(React.PureComponent));\nexport default IntlProvider;\n","export const LOCALES = {\n ENGLISH: \"en-US\",\n BENGALI: \"bn\",\n HINDI: \"hi\",\n};\n","import en from \"./en-US\";\nimport bn from \"./bn-IN\";\n\nexport default {\n ...en,\n ...bn,\n};\n","import { LOCALES } from \"../locales\";\nexport default {\n [LOCALES.ENGLISH]: {\n inbox: \"Inbox\",\n dashboard: \"Dashboard\",\n },\n};\n","import { LOCALES } from \"../locales\";\nexport default {\n [LOCALES.BENGALI]: {\n inbox: \"ইনবক্স\",\n dashboard: \"ড্যাশবোর্ড\",\n },\n};\n","import React, { Fragment } from \"react\";\nimport { IntlProvider } from \"react-intl\";\nimport { LOCALES } from \"./locales\";\nimport languages from \"./language\";\n\nconst Provider = ({ children, locale = LOCALES.ENGLISH }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default Provider;\n","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\n\nconst TranslateText = (id) => {\n return ;\n};\n\nexport default TranslateText;\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport App from \"./App\";\nimport reportWebVitals from \"./reportWebVitals\";\nimport * as Sentry from \"@sentry/react\";\nif (process.env.REACT_APP_NODE_ENV !== \"development\") {\n Sentry.init({\n dsn: \"https://e84b519742c0293ce7afa0f6eb6f7a5d@o4507184960045056.ingest.us.sentry.io/4507184962666496\",\n integrations: [\n Sentry.browserTracingIntegration(),\n Sentry.replayIntegration(),\n ],\n // Performance Monitoring\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: [\"localhost\", /^https:\\/\\/yourserver\\.io\\/api/],\n // Session Replay\n replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.\n replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.\n });\n}\n\nReactDOM.render(\n \n \n ,\n document.getElementById(\"root\")\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n","const reportWebVitals = (onPerfEntry) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import(\"web-vitals\").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import * as Yup from \"yup\";\n\nexport const SignInSchema = Yup.object().shape({\n email: Yup.string()\n .email(\"Invalid username\")\n .max(50, \"Username too long\")\n .required(\"Username is required\"),\n password: Yup.string()\n .min(6, \"Password too short\")\n .max(50, \"Password too long\")\n .required(\"Password is required\"),\n});\n","import { GlobalOutlined } from \"@ant-design/icons\";\nimport { Row } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport React, { Children } from \"react\";\n\nconst Container = ({ children }) => {\n const demobtn = {\n borderRadius: \"5px\",\n background: \"#4bb580\",\n color: \"white\",\n borderColor: \"#4bb580\",\n };\n return (\n
\n
\n
\n
window.location.replace(\"/\")} className=\"\">\n \n
\n
\n
\n \n Request Demo\n
\n
\n
\n \n {children}\n \n
\n
\n );\n};\n\nexport default Container;\n","import { Card } from \"antd\";\nimport React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nconst Unvarified = () => {\n return (\n
\n \n
\n
Activation Pending
\n
\n There seems to be some trouble logging you into your account\n
\n
\n Please reach out to us \n \n support@HireBound.io\n \n \n and someone from our team would be happy to help you out!\n \n
\n
\n \n
\n );\n};\n\nexport default Unvarified;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { Formik } from \"formik\";\nimport { Row, Col, Card, Divider, Form } from \"antd\";\nimport history from \"utils/history\";\nimport {\n loginActionTrigger,\n getUserActionTrigger,\n mfaActionTrigger,\n reMfaActionTrigger,\n} from \"action/LogonAction\";\nimport { appId } from \"config/config\";\nimport {\n LOGIN_ACTION_RESPONSE,\n GET_USER_ACTION_RESPONSE,\n SET_MFA,\n} from \"constant\";\nimport { SignInSchema } from \"./Login.validation\";\nimport { CXPassword } from \"component/Input\";\nimport { CXInput } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { getCookie } from \"utils\";\nimport { CXGroup } from \"component/Input\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport Container from \"./Container\";\nimport \"./index.css\";\nimport Unvarified from \"./unvarified\";\n\nconst LogIn = (props) => {\n const [didMount, setDidMount] = useState(false);\n const [textInp, settextInp] = useState(null);\n const [mfaVal, setmfaVal] = useState(\"\");\n const state = useSelector((state) => state.dittoAdminReducer);\n const action = useSelector((state) => state.dittoAdminReducer.action);\n const { unverified } = useSelector((state) => state.SignUpReducer);\n const [loginWithShopify, setloginWithShopify] = useState(false);\n const dispatch = useDispatch();\n\n useEffect(() => {\n setDidMount(true);\n }, []);\n\n useEffect(() => {\n if (didMount) {\n switch (action) {\n case LOGIN_ACTION_RESPONSE:\n let tokenType = getCookie(\"token_type\");\n if (tokenType !== \"mfa\") {\n dispatch(getUserActionTrigger());\n } else {\n dispatch({ type: SET_MFA, data: true });\n }\n break;\n case GET_USER_ACTION_RESPONSE:\n localStorage.setItem(\"roles\", JSON.stringify([\"admin\"]));\n history.push(\"/admin\");\n break;\n default:\n break;\n }\n }\n }, [action]);\n\n const handleSubmit = (values) => {\n dispatch(\n loginActionTrigger({\n appId,\n pwd: values.password.trim(),\n un: values.email.trim(),\n })\n );\n };\n const btnStyle = {\n background: \"#FFFFFF\",\n borderColor: \"#F3F3F3\",\n height: 40,\n borderRadius: 2,\n color: \"#000000\",\n width: 336,\n };\n const imgPos = {\n position: \"absolute\",\n left: \"20px\",\n top: \"10px\",\n };\n const mfaVarify = () => {\n const accessToken = getCookie(\"ob_a\");\n if (mfaVal?.length > 0) {\n dispatch(\n mfaActionTrigger({\n appId,\n mfa_token: accessToken,\n mfa_code: mfaVal,\n })\n );\n }\n };\n const resendOtp = () => {\n const accessToken = getCookie(\"ob_a\");\n dispatch(reMfaActionTrigger({ appId, mfa_token: accessToken }));\n };\n const demobtn = {\n borderRadius: \"5px\",\n background: \"#4bb580\",\n color: \"white\",\n borderColor: \"#4bb580\",\n };\n return (\n \n {!unverified && (\n
\n \n {state.mfaActive && (\n \n dispatch({ type: SET_MFA, data: false })}\n />\n \n )}\n \n
\n
\n {!state.mfaActive && (\n \n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit,\n isValid,\n }) => (\n {\n if (e.key === \"Enter\") {\n handleSubmit();\n }\n }}\n >\n \n {!loginWithShopify && (\n
\n \n \n Sign in to your account\n \n
\n\n \n \n \n \n
Password
\n \n history.push(\"/forgot-password\")\n }\n >\n Forgot your password ?\n \n \n }\n validateStatus={\n errors.password && touched.password\n ? \"error\"\n : null\n }\n help={\n errors.password && touched.password\n ? errors.password\n : null\n }\n >\n \n \n\n \n Login to Hirebound\n \n \n )}\n \n \n \n )}\n \n )}\n {state.mfaActive && (\n \n
\n \n Two Step Authentication{\" \"}\n
\n
\n A verification code has been sent to your email\n
\n \n setmfaVal(e.target.value)}\n />\n mfaVarify()}>\n VERIFY\n \n \n \n resendOtp()}\n >\n Resend OTP Request\n \n \n \n \n )}\n \n \n \n \n \n )}\n {unverified && (\n
\n \n
\n )}\n \n );\n};\n\nexport default LogIn;\n","import { GlobalOutlined } from \"@ant-design/icons\";\nimport { Card, Row } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput, CXPassword } from \"component/Input\";\nimport { useLocation } from \"react-router-dom\";\nimport { resetPasswordActionTrigger } from \"action/LogonAction\";\n\nconst ResetPassword = () => {\n const demobtn = {\n borderRadius: \"5px\",\n background: \"#4bb580\",\n color: \"white\",\n borderColor: \"#4bb580\",\n };\n const dispatch = useDispatch();\n const search = useLocation().search;\n const [form] = Form.useForm();\n const onFinish = (values) => {\n const token = new URLSearchParams(search).get(\"token\");\n // dispatch(forgetPasswordActionTrigger(values));\n let obj = {\n token,\n pwd1: btoa(values.pwd1),\n pwd2: btoa(values.pwd2),\n };\n dispatch(resetPasswordActionTrigger(obj));\n form.resetFields();\n };\n return (\n
\n
\n
window.location.replace(\"/\")} className=\"\">\n \n
\n
\n \n Request Demo\n
\n
\n
\n \n \n \n {\" \"}\n \n Reset your password\n \n
\n \n \n \n \n ({\n validator(_, value) {\n if (!value || getFieldValue(\"pwd1\") === value) {\n return Promise.resolve();\n }\n return Promise.reject(\n new Error(\n \"The two passwords that you entered do not match!\"\n )\n );\n },\n }),\n ]}\n >\n \n \n \n \n Set your new password\n \n \n \n \n \n
\n \n );\n};\n\nexport default ResetPassword;\n","import { Card } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput } from \"component/Input\";\nimport { Form } from \"antd\";\nimport React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { forgetPasswordActionTrigger } from \"action/LogonAction\";\nimport Container from \"./Container\";\nimport history from \"utils/history\";\n\nconst ForgetPass = () => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const onFinish = (values) => {\n dispatch(forgetPasswordActionTrigger(values));\n form.resetFields();\n };\n return (\n \n \n \n \n Request your password\n \n \n \n \n \n \n \n \n Request your password\n \n \n \n history.push(\"/\")}\n >\n Back to Login ?\n \n \n \n );\n};\n\nexport default ForgetPass;\n","import React, { useEffect } from \"react\";\nimport Container from \"./Container\";\nimport { useLocation } from \"react-router-dom\";\nimport { setCookie } from \"utils\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getUserActionTrigger } from \"action/LogonAction\";\nimport { GET_USER_ACTION_RESPONSE } from \"constant\";\nimport history from \"utils/history\";\nimport { CXLottie } from \"component/Lottie\";\n\nconst OuthRedirect = () => {\n const location = useLocation();\n const dispatch = useDispatch();\n const action = useSelector((state) => state.dittoAdminReducer.action);\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n const access_token = searchParams.get(\"access_token\");\n const refresh_token = searchParams.get(\"refresh_token\");\n const expires_in = searchParams.get(\"expires_in\");\n setCookie(\"ob_a\", access_token, expires_in * 1000);\n setCookie(\"ob_r\", refresh_token, 7 * 24 * 60 * 60 * 1000);\n setCookie(\"token_type\", \"bearer\", 7 * 24 * 60 * 60 * 1000);\n dispatch(getUserActionTrigger());\n }, [location]);\n useEffect(() => {\n switch (action) {\n case GET_USER_ACTION_RESPONSE:\n localStorage.setItem(\"roles\", JSON.stringify([\"admin\"]));\n history.push(\"/admin\");\n break;\n default:\n break;\n }\n }, [action]);\n return (\n \n \n \n );\n};\n\nexport default OuthRedirect;\n","import React, { Fragment } from \"react\";\nimport { Route, Switch, Redirect } from \"react-router-dom\";\nimport { CXLayout, CXContent } from \"component/Layout\";\nimport LogIn from \"screen/SignOn/LogIn\";\nimport ResetPassword from \"screen/ResetPassword\";\nimport ForgotPassword from \"screen/SignOn/LogIn/forgetPass\";\nimport SignUp from \"screen/SignOn/Signup/signUp\";\nimport OuthRedirect from \"screen/SignOn/LogIn/outhRedirect\";\n\nfunction PublicRoutes() {\n return (\n \n \n \n \n \n \n \n \n \n {/* \n \n \n \n \n \n */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n\nexport default PublicRoutes;\n","import React, { memo } from \"react\";\nimport { Redirect } from \"react-router-dom\";\nimport { isLoggedIn } from \"utils\";\nimport PublicRoutes from \"./PublicRoutes\";\n\nfunction Auth() {\n return isLoggedIn() ? : ;\n}\n\nexport default memo(Auth);\n","import React, { memo } from \"react\";\nimport { Switch, Route, useRouteMatch } from \"react-router-dom\";\n\nimport NotFound404 from \"screen/Error/NotFound404\";\n\nfunction MapAllowedRoutes({ routes, basePath, isAddNotFound }) {\n const match = useRouteMatch(basePath);\n return (\n \n {routes.map((route) => {\n const {\n path,\n component: Component,\n children,\n title,\n permission,\n ...rest\n } = route;\n\n return (\n \n \n \n );\n })}\n {isAddNotFound && (\n \n \n \n )}\n \n );\n}\n\nexport default memo(MapAllowedRoutes);\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { Redirect, useRouteMatch } from \"react-router-dom\";\nimport { CXLayout, CXContent } from \"component/Layout\";\nimport { getAllowedRoutes, isLoggedIn, getCookie } from \"utils\";\nimport { PrivateRoutesConfig } from \"config\";\nimport Sidebar from \"screen/Common/Sidebar\";\nimport Workspace from \"screen/Common/Workspace\";\nimport Wrapper from \"screen/Common/Wrapper\";\nimport SocketWrapper from \"screen/Common/SocketWrapper\";\nimport MapAllowedRoutes from \"route/MapAllowedRoutes\";\nimport { hotjar } from \"react-hotjar\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\nimport history from \"utils/history\";\nconst PrivateRoutes = () => {\n const [Switching, setSwitching] = useState(false);\n const [chAlert, setchAlert] = useState(false);\n const [emailAuthCheck, setemailAuthCheck] = useState(false);\n let allowedRoutes = [];\n if (isLoggedIn()) allowedRoutes = getAllowedRoutes(PrivateRoutesConfig);\n else return ;\n\n if (process.env.REACT_APP_NODE_ENV === \"production\") {\n console.log(`In Prod mode. HJ`);\n hotjar.initialize(3423034, 6);\n\n // Identify the user\n hotjar.identify(\"USER_ID\", { userProperty: getCookie(\"tenant\") });\n\n // Add an event\n hotjar.event(\"button-click\");\n\n // Update SPA state\n hotjar.stateChange(\"/\");\n\n // Check if Hotjar has been initialized before calling its methods\n if (hotjar.initialized()) {\n hotjar.identify(\"USER_ID\", { userProperty: getCookie(\"tenant\") });\n }\n }\n console.log(\"checkLOL\", chAlert, emailAuthCheck, Switching);\n setTimeout(() => {\n let c = getCookie(\"ch-alert\");\n let e = getCookie(\"email-auth-failed\");\n if (c) {\n setchAlert(c);\n }\n if (e) {\n setemailAuthCheck(e);\n }\n }, 1000);\n return (\n \n \n \n {/* add conditionl rendring for workspace when api available */}\n \n \n \n \n {Switching && (\n \n
\n \n \n Please wait while we switch the workspace\n \n
\n
\n )}\n {!Switching && (\n \n {chAlert && (\n
\n \n \n To start using our services, please connect your Email and\n Signature to your account{\" \"}\n {\n history.push(\"/admin/admin/Connected/Email\");\n }}\n >\n SET NOW\n \n \n
\n )}\n {emailAuthCheck && (\n
\n \n \n Your email authentication failed. Please Reauthenticate your\n Email{\" \"}\n {\n history.push(\"/admin/admin/Connected/Email\");\n }}\n >\n NOW\n \n \n
\n )}\n \n
\n )}\n {/* */}\n
\n
\n
\n );\n};\n\nexport default PrivateRoutes;\n","import React, { memo } from \"react\";\nimport { Router, Route, Switch } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport PrivateRoutes from \"./PrivateRoutes\";\nimport Auth from \"./Auth\";\nimport NotFound404 from \"screen/Error/NotFound404\";\nfunction Routes() {\n return (\n \n \n \n \n \n \n \n {\" \"}\n \n \n \n \n \n );\n}\n\nexport default memo(Routes);\n","import React, { useState, forwardRef, useEffect } from \"react\";\nimport { CXButton } from \"component/Button\";\nimport DatePicker from \"react-datepicker\";\nimport \"react-datepicker/dist/react-datepicker.css\";\n\nconst DatePickerComp = (props) => {\n const BtnSt = {\n background: \"#018FFF\",\n borderRadius: \"8px\",\n color: \"#fff\",\n marginTop: \"-10px\",\n };\n const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (\n \n {value}{\" \"}\n \n \n ));\n return (\n
\n props.changeVal([\"day\"])}\n style={{\n color: props.activeVisorFilter.includes(\"day\") && \"#018fff\",\n fontWeight: props.activeVisorFilter.includes(\"day\") && 600,\n }}\n >\n Today\n
\n {/* props.changeVal([\"week\"])}\n style={{\n color: props.activeVisorFilter.includes(\"week\") && \"#018fff\",\n fontWeight: props.activeVisorFilter.includes(\"week\") && 600,\n }}\n >\n This Week\n */}\n props.changeVal([\"month\"])}\n style={{\n color: props.activeVisorFilter.includes(\"month\") && \"#018fff\",\n fontWeight: props.activeVisorFilter.includes(\"month\") && 600,\n }}\n >\n This Month\n \n
\n }\n />\n
\n \n );\n};\n\nexport default DatePickerComp;\n","var NodeType;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n const host = n === null || n === void 0 ? void 0 : n.host;\r\n return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n if (cssText.includes(' background-clip: text;') &&\r\n !cssText.includes(' -webkit-background-clip: text;')) {\r\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n }\r\n return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n const { cssText } = rule;\r\n if (cssText.split('\"').length < 3)\r\n return cssText;\r\n const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n if (rule.layerName === '') {\r\n statement.push(`layer`);\r\n }\r\n else if (rule.layerName) {\r\n statement.push(`layer(${rule.layerName})`);\r\n }\r\n if (rule.supportsText) {\r\n statement.push(`supports(${rule.supportsText})`);\r\n }\r\n if (rule.media.length) {\r\n statement.push(rule.media.mediaText);\r\n }\r\n return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n try {\r\n const rules = s.rules || s.cssRules;\r\n return rules\r\n ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n}\r\nfunction stringifyRule(rule) {\r\n let importStringified;\r\n if (isCSSImportRule(rule)) {\r\n try {\r\n importStringified =\r\n stringifyStylesheet(rule.styleSheet) ||\r\n escapeImportStatement(rule);\r\n }\r\n catch (error) {\r\n }\r\n }\r\n else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n return fixSafariColons(rule.cssText);\r\n }\r\n return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n var _a;\r\n if (!n)\r\n return -1;\r\n const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n return id !== null && id !== void 0 ? id : -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction createMirror() {\r\n return new Mirror();\r\n}\r\nfunction maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }) {\r\n let text = value || '';\r\n const actualType = type && toLowerCase(type);\r\n if (maskInputOptions[tagName.toLowerCase()] ||\r\n (actualType && maskInputOptions[actualType])) {\r\n if (maskInputFn) {\r\n text = maskInputFn(text, element);\r\n }\r\n else {\r\n text = '*'.repeat(text.length);\r\n }\r\n }\r\n return text;\r\n}\r\nfunction toLowerCase(str) {\r\n return str.toLowerCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx)\r\n return true;\r\n const chunkSize = 50;\r\n for (let x = 0; x < canvas.width; x += chunkSize) {\r\n for (let y = 0; y < canvas.height; y += chunkSize) {\r\n const getImageData = ctx.getImageData;\r\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n : getImageData;\r\n const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n if (pixelBuffer.some((pixel) => pixel !== 0))\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction getInputType(element) {\r\n const type = element.type;\r\n return element.hasAttribute('data-rr-is-password')\r\n ? 'password'\r\n : type\r\n ?\r\n toLowerCase(type)\r\n : null;\r\n}\r\nfunction extractFileExtension(path, baseURL) {\r\n var _a;\r\n let url;\r\n try {\r\n url = new URL(path, baseURL !== null && baseURL !== void 0 ? baseURL : window.location.href);\r\n }\r\n catch (err) {\r\n return null;\r\n }\r\n const regex = /\\.([0-9a-z]+)(?:$)/i;\r\n const match = url.pathname.match(regex);\r\n return (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n if (element instanceof HTMLFormElement) {\r\n return 'form';\r\n }\r\n const processedTagName = toLowerCase(element.tagName);\r\n if (tagNameRegex.test(processedTagName)) {\r\n return 'div';\r\n }\r\n return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n let origin = '';\r\n if (url.indexOf('//') > -1) {\r\n origin = url.split('/').slice(0, 3).join('/');\r\n }\r\n else {\r\n origin = url.split('/')[0];\r\n }\r\n origin = origin.split('?')[0];\r\n return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n const filePath = path1 || path2 || path3;\r\n const maybeQuote = quote1 || quote2 || '';\r\n if (!filePath) {\r\n return origin;\r\n }\r\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (DATA_URI.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (filePath[0] === '/') {\r\n return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n }\r\n const stack = href.split('/');\r\n const parts = filePath.split('/');\r\n stack.pop();\r\n for (const part of parts) {\r\n if (part === '.') {\r\n continue;\r\n }\r\n else if (part === '..') {\r\n stack.pop();\r\n }\r\n else {\r\n stack.push(part);\r\n }\r\n }\r\n return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n if (attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n let pos = 0;\r\n function collectCharacters(regEx) {\r\n let chars;\r\n const match = regEx.exec(attributeValue.substring(pos));\r\n if (match) {\r\n chars = match[0];\r\n pos += chars.length;\r\n return chars;\r\n }\r\n return '';\r\n }\r\n const output = [];\r\n while (true) {\r\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n if (pos >= attributeValue.length) {\r\n break;\r\n }\r\n let url = collectCharacters(SRCSET_NOT_SPACES);\r\n if (url.slice(-1) === ',') {\r\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n output.push(url);\r\n }\r\n else {\r\n let descriptorsStr = '';\r\n url = absoluteToDoc(doc, url);\r\n let inParens = false;\r\n while (true) {\r\n const c = attributeValue.charAt(pos);\r\n if (c === '') {\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (!inParens) {\r\n if (c === ',') {\r\n pos += 1;\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (c === '(') {\r\n inParens = true;\r\n }\r\n }\r\n else {\r\n if (c === ')') {\r\n inParens = false;\r\n }\r\n }\r\n descriptorsStr += c;\r\n pos += 1;\r\n }\r\n }\r\n }\r\n return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n if (!attributeValue || attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n const a = doc.createElement('a');\r\n a.href = attributeValue;\r\n return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n const a = document.createElement('a');\r\n a.href = '';\r\n return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value) {\r\n if (!value) {\r\n return value;\r\n }\r\n if (name === 'src' ||\r\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'xlink:href' && value[0] !== '#') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'background' &&\r\n (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'srcset') {\r\n return getAbsoluteSrcsetString(doc, value);\r\n }\r\n else if (name === 'style') {\r\n return absoluteToStylesheet(value, getHref());\r\n }\r\n else if (tagName === 'object' && name === 'data') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector) {\r\n try {\r\n if (typeof blockClass === 'string') {\r\n if (element.classList.contains(blockClass)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n for (let eIndex = element.classList.length; eIndex--;) {\r\n const className = element.classList[eIndex];\r\n if (blockClass.test(className)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (blockSelector) {\r\n return element.matches(blockSelector);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction classMatchesRegex(node, regex, checkAncestors) {\r\n if (!node)\r\n return false;\r\n if (node.nodeType !== node.ELEMENT_NODE) {\r\n if (!checkAncestors)\r\n return false;\r\n return classMatchesRegex(node.parentNode, regex, checkAncestors);\r\n }\r\n for (let eIndex = node.classList.length; eIndex--;) {\r\n const className = node.classList[eIndex];\r\n if (regex.test(className)) {\r\n return true;\r\n }\r\n }\r\n if (!checkAncestors)\r\n return false;\r\n return classMatchesRegex(node.parentNode, regex, checkAncestors);\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors) {\r\n try {\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n if (el === null)\r\n return false;\r\n if (typeof maskTextClass === 'string') {\r\n if (checkAncestors) {\r\n if (el.closest(`.${maskTextClass}`))\r\n return true;\r\n }\r\n else {\r\n if (el.classList.contains(maskTextClass))\r\n return true;\r\n }\r\n }\r\n else {\r\n if (classMatchesRegex(el, maskTextClass, checkAncestors))\r\n return true;\r\n }\r\n if (maskTextSelector) {\r\n if (checkAncestors) {\r\n if (el.closest(maskTextSelector))\r\n return true;\r\n }\r\n else {\r\n if (el.matches(maskTextSelector))\r\n return true;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n const win = iframeEl.contentWindow;\r\n if (!win) {\r\n return;\r\n }\r\n let fired = false;\r\n let readyState;\r\n try {\r\n readyState = win.document.readyState;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (readyState !== 'complete') {\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, iframeLoadTimeout);\r\n iframeEl.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n return;\r\n }\r\n const blankUrl = 'about:blank';\r\n if (win.location.href !== blankUrl ||\r\n iframeEl.src === blankUrl ||\r\n iframeEl.src === '') {\r\n setTimeout(listener, 0);\r\n return iframeEl.addEventListener('load', listener);\r\n }\r\n iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n let fired = false;\r\n let styleSheetLoaded;\r\n try {\r\n styleSheetLoaded = link.sheet;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (styleSheetLoaded)\r\n return;\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, styleSheetLoadTimeout);\r\n link.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n}\r\nfunction serializeNode(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, needsMask, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n const rootId = getRootId(doc, mirror);\r\n switch (n.nodeType) {\r\n case n.DOCUMENT_NODE:\r\n if (n.compatMode !== 'CSS1Compat') {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n compatMode: n.compatMode,\r\n };\r\n }\r\n else {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n };\r\n }\r\n case n.DOCUMENT_TYPE_NODE:\r\n return {\r\n type: NodeType.DocumentType,\r\n name: n.name,\r\n publicId: n.publicId,\r\n systemId: n.systemId,\r\n rootId,\r\n };\r\n case n.ELEMENT_NODE:\r\n return serializeElementNode(n, {\r\n doc,\r\n blockClass,\r\n blockSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n rootId,\r\n });\r\n case n.TEXT_NODE:\r\n return serializeTextNode(n, {\r\n needsMask,\r\n maskTextFn,\r\n rootId,\r\n });\r\n case n.CDATA_SECTION_NODE:\r\n return {\r\n type: NodeType.CDATA,\r\n textContent: '',\r\n rootId,\r\n };\r\n case n.COMMENT_NODE:\r\n return {\r\n type: NodeType.Comment,\r\n textContent: n.textContent || '',\r\n rootId,\r\n };\r\n default:\r\n return false;\r\n }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n if (!mirror.hasNode(doc))\r\n return undefined;\r\n const docId = mirror.getId(doc);\r\n return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n var _a;\r\n const { needsMask, maskTextFn, rootId } = options;\r\n const parentTagName = n.parentNode && n.parentNode.tagName;\r\n let textContent = n.textContent;\r\n const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n if (isStyle && textContent) {\r\n try {\r\n if (n.nextSibling || n.previousSibling) {\r\n }\r\n else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\r\n textContent = stringifyStylesheet(n.parentNode.sheet);\r\n }\r\n }\r\n catch (err) {\r\n console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n }\r\n textContent = absoluteToStylesheet(textContent, getHref());\r\n }\r\n if (isScript) {\r\n textContent = 'SCRIPT_PLACEHOLDER';\r\n }\r\n if (!isStyle && !isScript && textContent && needsMask) {\r\n textContent = maskTextFn\r\n ? maskTextFn(textContent, n.parentElement)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n return {\r\n type: NodeType.Text,\r\n textContent: textContent || '',\r\n isStyle,\r\n rootId,\r\n };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n const { doc, blockClass, blockSelector, inlineStylesheet, maskInputOptions = {}, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, } = options;\r\n const needBlock = _isBlockedElement(n, blockClass, blockSelector);\r\n const tagName = getValidTagName(n);\r\n let attributes = {};\r\n const len = n.attributes.length;\r\n for (let i = 0; i < len; i++) {\r\n const attr = n.attributes[i];\r\n if (!ignoreAttribute(tagName, attr.name, attr.value)) {\r\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value);\r\n }\r\n }\r\n if (tagName === 'link' && inlineStylesheet) {\r\n const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n return s.href === n.href;\r\n });\r\n let cssText = null;\r\n if (stylesheet) {\r\n cssText = stringifyStylesheet(stylesheet);\r\n }\r\n if (cssText) {\r\n delete attributes.rel;\r\n delete attributes.href;\r\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n }\r\n }\r\n if (tagName === 'style' &&\r\n n.sheet &&\r\n !(n.innerText || n.textContent || '').trim().length) {\r\n const cssText = stringifyStylesheet(n.sheet);\r\n if (cssText) {\r\n attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n }\r\n }\r\n if (tagName === 'input' || tagName === 'textarea' || tagName === 'select') {\r\n const value = n.value;\r\n const checked = n.checked;\r\n if (attributes.type !== 'radio' &&\r\n attributes.type !== 'checkbox' &&\r\n attributes.type !== 'submit' &&\r\n attributes.type !== 'button' &&\r\n value) {\r\n attributes.value = maskInputValue({\r\n element: n,\r\n type: getInputType(n),\r\n tagName,\r\n value,\r\n maskInputOptions,\r\n maskInputFn,\r\n });\r\n }\r\n else if (checked) {\r\n attributes.checked = checked;\r\n }\r\n }\r\n if (tagName === 'option') {\r\n if (n.selected && !maskInputOptions['select']) {\r\n attributes.selected = true;\r\n }\r\n else {\r\n delete attributes.selected;\r\n }\r\n }\r\n if (tagName === 'canvas' && recordCanvas) {\r\n if (n.__context === '2d') {\r\n if (!is2DCanvasBlank(n)) {\r\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n }\r\n else if (!('__context' in n)) {\r\n const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n const blankCanvas = document.createElement('canvas');\r\n blankCanvas.width = n.width;\r\n blankCanvas.height = n.height;\r\n const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n if (canvasDataURL !== blankCanvasDataURL) {\r\n attributes.rr_dataURL = canvasDataURL;\r\n }\r\n }\r\n }\r\n if (tagName === 'img' && inlineImages) {\r\n if (!canvasService) {\r\n canvasService = doc.createElement('canvas');\r\n canvasCtx = canvasService.getContext('2d');\r\n }\r\n const image = n;\r\n const oldValue = image.crossOrigin;\r\n image.crossOrigin = 'anonymous';\r\n const recordInlineImage = () => {\r\n image.removeEventListener('load', recordInlineImage);\r\n try {\r\n canvasService.width = image.naturalWidth;\r\n canvasService.height = image.naturalHeight;\r\n canvasCtx.drawImage(image, 0, 0);\r\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n catch (err) {\r\n console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n }\r\n oldValue\r\n ? (attributes.crossOrigin = oldValue)\r\n : image.removeAttribute('crossorigin');\r\n };\r\n if (image.complete && image.naturalWidth !== 0)\r\n recordInlineImage();\r\n else\r\n image.addEventListener('load', recordInlineImage);\r\n }\r\n if (tagName === 'audio' || tagName === 'video') {\r\n const mediaAttributes = attributes;\r\n mediaAttributes.rr_mediaState = n.paused\r\n ? 'paused'\r\n : 'played';\r\n mediaAttributes.rr_mediaCurrentTime = n.currentTime;\r\n mediaAttributes.rr_mediaPlaybackRate = n.playbackRate;\r\n mediaAttributes.rr_mediaMuted = n.muted;\r\n mediaAttributes.rr_mediaLoop = n.loop;\r\n mediaAttributes.rr_mediaVolume = n.volume;\r\n }\r\n if (!newlyAddedElement) {\r\n if (n.scrollLeft) {\r\n attributes.rr_scrollLeft = n.scrollLeft;\r\n }\r\n if (n.scrollTop) {\r\n attributes.rr_scrollTop = n.scrollTop;\r\n }\r\n }\r\n if (needBlock) {\r\n const { width, height } = n.getBoundingClientRect();\r\n attributes = {\r\n class: attributes.class,\r\n rr_width: `${width}px`,\r\n rr_height: `${height}px`,\r\n };\r\n }\r\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n if (!n.contentDocument) {\r\n attributes.rr_src = attributes.src;\r\n }\r\n delete attributes.src;\r\n }\r\n let isCustomElement;\r\n try {\r\n if (customElements.get(tagName))\r\n isCustomElement = true;\r\n }\r\n catch (e) {\r\n }\r\n return {\r\n type: NodeType.Element,\r\n tagName,\r\n attributes,\r\n childNodes: [],\r\n isSVG: isSVGElement(n) || undefined,\r\n needBlock,\r\n rootId,\r\n isCustom: isCustomElement,\r\n };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n if (maybeAttr === undefined || maybeAttr === null) {\r\n return '';\r\n }\r\n else {\r\n return maybeAttr.toLowerCase();\r\n }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n return true;\r\n }\r\n else if (sn.type === NodeType.Element) {\r\n if (slimDOMOptions.script &&\r\n (sn.tagName === 'script' ||\r\n (sn.tagName === 'link' &&\r\n (sn.attributes.rel === 'preload' ||\r\n sn.attributes.rel === 'modulepreload') &&\r\n sn.attributes.as === 'script') ||\r\n (sn.tagName === 'link' &&\r\n sn.attributes.rel === 'prefetch' &&\r\n typeof sn.attributes.href === 'string' &&\r\n extractFileExtension(sn.attributes.href) === 'js'))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headFavicon &&\r\n ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n (sn.tagName === 'meta' &&\r\n (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n return true;\r\n }\r\n else if (sn.tagName === 'meta') {\r\n if (slimDOMOptions.headMetaDescKeywords &&\r\n lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaSocial &&\r\n (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaRobots &&\r\n (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaHttpEquiv &&\r\n sn.attributes['http-equiv'] !== undefined) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaAuthorship &&\r\n (lowerIfExists(sn.attributes.name) === 'author' ||\r\n lowerIfExists(sn.attributes.name) === 'generator' ||\r\n lowerIfExists(sn.attributes.name) === 'framework' ||\r\n lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n lowerIfExists(sn.attributes.name) === 'progid' ||\r\n lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaVerification &&\r\n (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n lowerIfExists(sn.attributes.name) === 'verification' ||\r\n lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, maskTextClass, maskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n let { needsMask } = options;\r\n let { preserveWhiteSpace = true } = options;\r\n if (!needsMask &&\r\n n.childNodes) {\r\n const checkAncestors = needsMask === undefined;\r\n needsMask = needMaskingText(n, maskTextClass, maskTextSelector, checkAncestors);\r\n }\r\n const _serializedNode = serializeNode(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n });\r\n if (!_serializedNode) {\r\n console.warn(n, 'not serialized');\r\n return null;\r\n }\r\n let id;\r\n if (mirror.hasNode(n)) {\r\n id = mirror.getId(n);\r\n }\r\n else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n (!preserveWhiteSpace &&\r\n _serializedNode.type === NodeType.Text &&\r\n !_serializedNode.isStyle &&\r\n !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n id = IGNORED_NODE;\r\n }\r\n else {\r\n id = genId();\r\n }\r\n const serializedNode = Object.assign(_serializedNode, { id });\r\n mirror.add(n, serializedNode);\r\n if (id === IGNORED_NODE) {\r\n return null;\r\n }\r\n if (onSerialize) {\r\n onSerialize(n);\r\n }\r\n let recordChild = !skipChild;\r\n if (serializedNode.type === NodeType.Element) {\r\n recordChild = recordChild && !serializedNode.needBlock;\r\n delete serializedNode.needBlock;\r\n const shadowRoot = n.shadowRoot;\r\n if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n serializedNode.isShadowHost = true;\r\n }\r\n if ((serializedNode.type === NodeType.Document ||\r\n serializedNode.type === NodeType.Element) &&\r\n recordChild) {\r\n if (slimDOMOptions.headWhitespace &&\r\n serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'head') {\r\n preserveWhiteSpace = false;\r\n }\r\n const bypassOptions = {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n };\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'textarea' &&\r\n serializedNode.attributes.value !== undefined) ;\r\n else {\r\n for (const childN of Array.from(n.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n if (isElement(n) && n.shadowRoot) {\r\n for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n isNativeShadowDom(n.shadowRoot) &&\r\n (serializedChildNode.isShadow = true);\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n }\r\n if (n.parentNode &&\r\n isShadowRoot(n.parentNode) &&\r\n isNativeShadowDom(n.parentNode)) {\r\n serializedNode.isShadow = true;\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'iframe') {\r\n onceIframeLoaded(n, () => {\r\n const iframeDoc = n.contentDocument;\r\n if (iframeDoc && onIframeLoad) {\r\n const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n doc: iframeDoc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedIframeNode) {\r\n onIframeLoad(n, serializedIframeNode);\r\n }\r\n }\r\n }, iframeLoadTimeout);\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'link' &&\r\n typeof serializedNode.attributes.rel === 'string' &&\r\n (serializedNode.attributes.rel === 'stylesheet' ||\r\n (serializedNode.attributes.rel === 'preload' &&\r\n typeof serializedNode.attributes.href === 'string' &&\r\n extractFileExtension(serializedNode.attributes.href) === 'css'))) {\r\n onceStylesheetLoaded(n, () => {\r\n if (onStylesheetLoad) {\r\n const serializedLinkNode = serializeNodeWithId(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedLinkNode) {\r\n onStylesheetLoad(n, serializedLinkNode);\r\n }\r\n }\r\n }, stylesheetLoadTimeout);\r\n }\r\n return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n password: true,\r\n }\r\n : maskAllInputs === false\r\n ? {\r\n password: true,\r\n }\r\n : maskAllInputs;\r\n const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n ?\r\n {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaDescKeywords: slimDOM === 'all',\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaAuthorship: true,\r\n headMetaVerification: true,\r\n }\r\n : slimDOM === false\r\n ? {}\r\n : slimDOM;\r\n return serializeNodeWithId(n, {\r\n doc: n,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n newlyAddedElement: false,\r\n });\r\n}\n\nfunction on(type, fn, target = document) {\r\n const options = { capture: true, passive: true };\r\n target.addEventListener(type, fn, options);\r\n return () => target.removeEventListener(type, fn, options);\r\n}\r\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\r\n '\\r\\n' +\r\n 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\r\n '\\r\\n' +\r\n 'or you can use record.mirror to access the mirror instance during recording.';\r\nlet _mirror = {\r\n map: {},\r\n getId() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return -1;\r\n },\r\n getNode() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return null;\r\n },\r\n removeNodeFromMap() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n has() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return false;\r\n },\r\n reset() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n};\r\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\r\n _mirror = new Proxy(_mirror, {\r\n get(target, prop, receiver) {\r\n if (prop === 'map') {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n }\r\n return Reflect.get(target, prop, receiver);\r\n },\r\n });\r\n}\r\nfunction throttle(func, wait, options = {}) {\r\n let timeout = null;\r\n let previous = 0;\r\n return function (...args) {\r\n const now = Date.now();\r\n if (!previous && options.leading === false) {\r\n previous = now;\r\n }\r\n const remaining = wait - (now - previous);\r\n const context = this;\r\n if (remaining <= 0 || remaining > wait) {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n timeout = null;\r\n }\r\n previous = now;\r\n func.apply(context, args);\r\n }\r\n else if (!timeout && options.trailing !== false) {\r\n timeout = setTimeout(() => {\r\n previous = options.leading === false ? 0 : Date.now();\r\n timeout = null;\r\n func.apply(context, args);\r\n }, remaining);\r\n }\r\n };\r\n}\r\nfunction hookSetter(target, key, d, isRevoked, win = window) {\r\n const original = win.Object.getOwnPropertyDescriptor(target, key);\r\n win.Object.defineProperty(target, key, isRevoked\r\n ? d\r\n : {\r\n set(value) {\r\n setTimeout(() => {\r\n d.set.call(this, value);\r\n }, 0);\r\n if (original && original.set) {\r\n original.set.call(this, value);\r\n }\r\n },\r\n });\r\n return () => hookSetter(target, key, original || {}, true);\r\n}\r\nfunction patch(source, name, replacement) {\r\n try {\r\n if (!(name in source)) {\r\n return () => {\r\n };\r\n }\r\n const original = source[name];\r\n const wrapped = replacement(original);\r\n if (typeof wrapped === 'function') {\r\n wrapped.prototype = wrapped.prototype || {};\r\n Object.defineProperties(wrapped, {\r\n __rrweb_original__: {\r\n enumerable: false,\r\n value: original,\r\n },\r\n });\r\n }\r\n source[name] = wrapped;\r\n return () => {\r\n source[name] = original;\r\n };\r\n }\r\n catch (_a) {\r\n return () => {\r\n };\r\n }\r\n}\r\nlet nowTimestamp = Date.now;\r\nif (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {\r\n nowTimestamp = () => new Date().getTime();\r\n}\r\nfunction getWindowScroll(win) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const doc = win.document;\r\n return {\r\n left: doc.scrollingElement\r\n ? doc.scrollingElement.scrollLeft\r\n : win.pageXOffset !== undefined\r\n ? win.pageXOffset\r\n : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollLeft) ||\r\n ((_b = (_a = doc === null || doc === void 0 ? void 0 : doc.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||\r\n ((_c = doc === null || doc === void 0 ? void 0 : doc.body) === null || _c === void 0 ? void 0 : _c.scrollLeft) ||\r\n 0,\r\n top: doc.scrollingElement\r\n ? doc.scrollingElement.scrollTop\r\n : win.pageYOffset !== undefined\r\n ? win.pageYOffset\r\n : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollTop) ||\r\n ((_e = (_d = doc === null || doc === void 0 ? void 0 : doc.body) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop) ||\r\n ((_f = doc === null || doc === void 0 ? void 0 : doc.body) === null || _f === void 0 ? void 0 : _f.scrollTop) ||\r\n 0,\r\n };\r\n}\r\nfunction getWindowHeight() {\r\n return (window.innerHeight ||\r\n (document.documentElement && document.documentElement.clientHeight) ||\r\n (document.body && document.body.clientHeight));\r\n}\r\nfunction getWindowWidth() {\r\n return (window.innerWidth ||\r\n (document.documentElement && document.documentElement.clientWidth) ||\r\n (document.body && document.body.clientWidth));\r\n}\r\nfunction closestElementOfNode(node) {\r\n if (!node) {\r\n return null;\r\n }\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n return el;\r\n}\r\nfunction isBlocked(node, blockClass, blockSelector, checkAncestors) {\r\n if (!node) {\r\n return false;\r\n }\r\n const el = closestElementOfNode(node);\r\n if (!el) {\r\n return false;\r\n }\r\n try {\r\n if (typeof blockClass === 'string') {\r\n if (el.classList.contains(blockClass))\r\n return true;\r\n if (checkAncestors && el.closest('.' + blockClass) !== null)\r\n return true;\r\n }\r\n else {\r\n if (classMatchesRegex(el, blockClass, checkAncestors))\r\n return true;\r\n }\r\n }\r\n catch (e) {\r\n }\r\n if (blockSelector) {\r\n if (el.matches(blockSelector))\r\n return true;\r\n if (checkAncestors && el.closest(blockSelector) !== null)\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSerialized(n, mirror) {\r\n return mirror.getId(n) !== -1;\r\n}\r\nfunction isIgnored(n, mirror) {\r\n return mirror.getId(n) === IGNORED_NODE;\r\n}\r\nfunction isAncestorRemoved(target, mirror) {\r\n if (isShadowRoot(target)) {\r\n return false;\r\n }\r\n const id = mirror.getId(target);\r\n if (!mirror.has(id)) {\r\n return true;\r\n }\r\n if (target.parentNode &&\r\n target.parentNode.nodeType === target.DOCUMENT_NODE) {\r\n return false;\r\n }\r\n if (!target.parentNode) {\r\n return true;\r\n }\r\n return isAncestorRemoved(target.parentNode, mirror);\r\n}\r\nfunction legacy_isTouchEvent(event) {\r\n return Boolean(event.changedTouches);\r\n}\r\nfunction polyfill(win = window) {\r\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\r\n win.NodeList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\r\n win.DOMTokenList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if (!Node.prototype.contains) {\r\n Node.prototype.contains = (...args) => {\r\n let node = args[0];\r\n if (!(0 in args)) {\r\n throw new TypeError('1 argument is required');\r\n }\r\n do {\r\n if (this === node) {\r\n return true;\r\n }\r\n } while ((node = node && node.parentNode));\r\n return false;\r\n };\r\n }\r\n}\r\nfunction isSerializedIframe(n, mirror) {\r\n return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\r\n}\r\nfunction isSerializedStylesheet(n, mirror) {\r\n return Boolean(n.nodeName === 'LINK' &&\r\n n.nodeType === n.ELEMENT_NODE &&\r\n n.getAttribute &&\r\n n.getAttribute('rel') === 'stylesheet' &&\r\n mirror.getMeta(n));\r\n}\r\nfunction hasShadowRoot(n) {\r\n return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\r\n}\r\nclass StyleSheetMirror {\r\n constructor() {\r\n this.id = 1;\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n }\r\n getId(stylesheet) {\r\n var _a;\r\n return (_a = this.styleIDMap.get(stylesheet)) !== null && _a !== void 0 ? _a : -1;\r\n }\r\n has(stylesheet) {\r\n return this.styleIDMap.has(stylesheet);\r\n }\r\n add(stylesheet, id) {\r\n if (this.has(stylesheet))\r\n return this.getId(stylesheet);\r\n let newId;\r\n if (id === undefined) {\r\n newId = this.id++;\r\n }\r\n else\r\n newId = id;\r\n this.styleIDMap.set(stylesheet, newId);\r\n this.idStyleMap.set(newId, stylesheet);\r\n return newId;\r\n }\r\n getStyle(id) {\r\n return this.idStyleMap.get(id) || null;\r\n }\r\n reset() {\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n this.id = 1;\r\n }\r\n generateId() {\r\n return this.id++;\r\n }\r\n}\r\nfunction getShadowHost(n) {\r\n var _a, _b;\r\n let shadowHost = null;\r\n if (((_b = (_a = n.getRootNode) === null || _a === void 0 ? void 0 : _a.call(n)) === null || _b === void 0 ? void 0 : _b.nodeType) === Node.DOCUMENT_FRAGMENT_NODE &&\r\n n.getRootNode().host)\r\n shadowHost = n.getRootNode().host;\r\n return shadowHost;\r\n}\r\nfunction getRootShadowHost(n) {\r\n let rootShadowHost = n;\r\n let shadowHost;\r\n while ((shadowHost = getShadowHost(rootShadowHost)))\r\n rootShadowHost = shadowHost;\r\n return rootShadowHost;\r\n}\r\nfunction shadowHostInDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n const shadowHost = getRootShadowHost(n);\r\n return doc.contains(shadowHost);\r\n}\r\nfunction inDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n return doc.contains(n) || shadowHostInDom(n);\r\n}\n\nvar EventType$1 = /* @__PURE__ */ ((EventType2) => {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n})(EventType$1 || {});\nvar IncrementalSource$1 = /* @__PURE__ */ ((IncrementalSource2) => {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n})(IncrementalSource$1 || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n return CanvasContext2;\n})(CanvasContext || {});\n\nfunction isNodeInLinkedList(n) {\r\n return '__ln' in n;\r\n}\r\nclass DoubleLinkedList {\r\n constructor() {\r\n this.length = 0;\r\n this.head = null;\r\n this.tail = null;\r\n }\r\n get(position) {\r\n if (position >= this.length) {\r\n throw new Error('Position outside of list range');\r\n }\r\n let current = this.head;\r\n for (let index = 0; index < position; index++) {\r\n current = (current === null || current === void 0 ? void 0 : current.next) || null;\r\n }\r\n return current;\r\n }\r\n addNode(n) {\r\n const node = {\r\n value: n,\r\n previous: null,\r\n next: null,\r\n };\r\n n.__ln = node;\r\n if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\r\n const current = n.previousSibling.__ln.next;\r\n node.next = current;\r\n node.previous = n.previousSibling.__ln;\r\n n.previousSibling.__ln.next = node;\r\n if (current) {\r\n current.previous = node;\r\n }\r\n }\r\n else if (n.nextSibling &&\r\n isNodeInLinkedList(n.nextSibling) &&\r\n n.nextSibling.__ln.previous) {\r\n const current = n.nextSibling.__ln.previous;\r\n node.previous = current;\r\n node.next = n.nextSibling.__ln;\r\n n.nextSibling.__ln.previous = node;\r\n if (current) {\r\n current.next = node;\r\n }\r\n }\r\n else {\r\n if (this.head) {\r\n this.head.previous = node;\r\n }\r\n node.next = this.head;\r\n this.head = node;\r\n }\r\n if (node.next === null) {\r\n this.tail = node;\r\n }\r\n this.length++;\r\n }\r\n removeNode(n) {\r\n const current = n.__ln;\r\n if (!this.head) {\r\n return;\r\n }\r\n if (!current.previous) {\r\n this.head = current.next;\r\n if (this.head) {\r\n this.head.previous = null;\r\n }\r\n else {\r\n this.tail = null;\r\n }\r\n }\r\n else {\r\n current.previous.next = current.next;\r\n if (current.next) {\r\n current.next.previous = current.previous;\r\n }\r\n else {\r\n this.tail = current.previous;\r\n }\r\n }\r\n if (n.__ln) {\r\n delete n.__ln;\r\n }\r\n this.length--;\r\n }\r\n}\r\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\r\nclass MutationBuffer {\r\n constructor() {\r\n this.frozen = false;\r\n this.locked = false;\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.mapRemoves = [];\r\n this.movedMap = {};\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.processMutations = (mutations) => {\r\n mutations.forEach(this.processMutation);\r\n this.emit();\r\n };\r\n this.emit = () => {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const adds = [];\r\n const addedIds = new Set();\r\n const addList = new DoubleLinkedList();\r\n const getNextId = (n) => {\r\n let ns = n;\r\n let nextId = IGNORED_NODE;\r\n while (nextId === IGNORED_NODE) {\r\n ns = ns && ns.nextSibling;\r\n nextId = ns && this.mirror.getId(ns);\r\n }\r\n return nextId;\r\n };\r\n const pushAdd = (n) => {\r\n if (!n.parentNode ||\r\n !inDom(n) ||\r\n n.parentNode.tagName === 'TEXTAREA') {\r\n return;\r\n }\r\n const parentId = isShadowRoot(n.parentNode)\r\n ? this.mirror.getId(getShadowHost(n))\r\n : this.mirror.getId(n.parentNode);\r\n const nextId = getNextId(n);\r\n if (parentId === -1 || nextId === -1) {\r\n return addList.addNode(n);\r\n }\r\n const sn = serializeNodeWithId(n, {\r\n doc: this.doc,\r\n mirror: this.mirror,\r\n blockClass: this.blockClass,\r\n blockSelector: this.blockSelector,\r\n maskTextClass: this.maskTextClass,\r\n maskTextSelector: this.maskTextSelector,\r\n skipChild: true,\r\n newlyAddedElement: true,\r\n inlineStylesheet: this.inlineStylesheet,\r\n maskInputOptions: this.maskInputOptions,\r\n maskTextFn: this.maskTextFn,\r\n maskInputFn: this.maskInputFn,\r\n slimDOMOptions: this.slimDOMOptions,\r\n dataURLOptions: this.dataURLOptions,\r\n recordCanvas: this.recordCanvas,\r\n inlineImages: this.inlineImages,\r\n onSerialize: (currentN) => {\r\n if (isSerializedIframe(currentN, this.mirror)) {\r\n this.iframeManager.addIframe(currentN);\r\n }\r\n if (isSerializedStylesheet(currentN, this.mirror)) {\r\n this.stylesheetManager.trackLinkElement(currentN);\r\n }\r\n if (hasShadowRoot(n)) {\r\n this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n this.iframeManager.attachIframe(iframe, childSn);\r\n this.shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (link, childSn) => {\r\n this.stylesheetManager.attachLinkElement(link, childSn);\r\n },\r\n });\r\n if (sn) {\r\n adds.push({\r\n parentId,\r\n nextId,\r\n node: sn,\r\n });\r\n addedIds.add(sn.id);\r\n }\r\n };\r\n while (this.mapRemoves.length) {\r\n this.mirror.removeNodeFromMap(this.mapRemoves.shift());\r\n }\r\n for (const n of this.movedSet) {\r\n if (isParentRemoved(this.removes, n, this.mirror) &&\r\n !this.movedSet.has(n.parentNode)) {\r\n continue;\r\n }\r\n pushAdd(n);\r\n }\r\n for (const n of this.addedSet) {\r\n if (!isAncestorInSet(this.droppedSet, n) &&\r\n !isParentRemoved(this.removes, n, this.mirror)) {\r\n pushAdd(n);\r\n }\r\n else if (isAncestorInSet(this.movedSet, n)) {\r\n pushAdd(n);\r\n }\r\n else {\r\n this.droppedSet.add(n);\r\n }\r\n }\r\n let candidate = null;\r\n while (addList.length) {\r\n let node = null;\r\n if (candidate) {\r\n const parentId = this.mirror.getId(candidate.value.parentNode);\r\n const nextId = getNextId(candidate.value);\r\n if (parentId !== -1 && nextId !== -1) {\r\n node = candidate;\r\n }\r\n }\r\n if (!node) {\r\n let tailNode = addList.tail;\r\n while (tailNode) {\r\n const _node = tailNode;\r\n tailNode = tailNode.previous;\r\n if (_node) {\r\n const parentId = this.mirror.getId(_node.value.parentNode);\r\n const nextId = getNextId(_node.value);\r\n if (nextId === -1)\r\n continue;\r\n else if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n else {\r\n const unhandledNode = _node.value;\r\n if (unhandledNode.parentNode &&\r\n unhandledNode.parentNode.nodeType ===\r\n Node.DOCUMENT_FRAGMENT_NODE) {\r\n const shadowHost = unhandledNode.parentNode\r\n .host;\r\n const parentId = this.mirror.getId(shadowHost);\r\n if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!node) {\r\n while (addList.head) {\r\n addList.removeNode(addList.head.value);\r\n }\r\n break;\r\n }\r\n candidate = node.previous;\r\n addList.removeNode(node.value);\r\n pushAdd(node.value);\r\n }\r\n const payload = {\r\n texts: this.texts\r\n .map((text) => {\r\n const n = text.node;\r\n if (n.parentNode &&\r\n n.parentNode.tagName === 'TEXTAREA') {\r\n this.genTextAreaValueMutation(n.parentNode);\r\n }\r\n return {\r\n id: this.mirror.getId(n),\r\n value: text.value,\r\n };\r\n })\r\n .filter((text) => !addedIds.has(text.id))\r\n .filter((text) => this.mirror.has(text.id)),\r\n attributes: this.attributes\r\n .map((attribute) => {\r\n const { attributes } = attribute;\r\n if (typeof attributes.style === 'string') {\r\n const diffAsStr = JSON.stringify(attribute.styleDiff);\r\n const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\r\n if (diffAsStr.length < attributes.style.length) {\r\n if ((diffAsStr + unchangedAsStr).split('var(').length ===\r\n attributes.style.split('var(').length) {\r\n attributes.style = attribute.styleDiff;\r\n }\r\n }\r\n }\r\n return {\r\n id: this.mirror.getId(attribute.node),\r\n attributes: attributes,\r\n };\r\n })\r\n .filter((attribute) => !addedIds.has(attribute.id))\r\n .filter((attribute) => this.mirror.has(attribute.id)),\r\n removes: this.removes,\r\n adds,\r\n };\r\n if (!payload.texts.length &&\r\n !payload.attributes.length &&\r\n !payload.removes.length &&\r\n !payload.adds.length) {\r\n return;\r\n }\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.movedMap = {};\r\n this.mutationCb(payload);\r\n };\r\n this.genTextAreaValueMutation = (textarea) => {\r\n let item = this.attributeMap.get(textarea);\r\n if (!item) {\r\n item = {\r\n node: textarea,\r\n attributes: {},\r\n styleDiff: {},\r\n _unchangedStyles: {},\r\n };\r\n this.attributes.push(item);\r\n this.attributeMap.set(textarea, item);\r\n }\r\n item.attributes.value = Array.from(textarea.childNodes, (cn) => cn.textContent || '').join('');\r\n };\r\n this.processMutation = (m) => {\r\n if (isIgnored(m.target, this.mirror)) {\r\n return;\r\n }\r\n switch (m.type) {\r\n case 'characterData': {\r\n const value = m.target.textContent;\r\n if (!isBlocked(m.target, this.blockClass, this.blockSelector, false) &&\r\n value !== m.oldValue) {\r\n this.texts.push({\r\n value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, true) && value\r\n ? this.maskTextFn\r\n ? this.maskTextFn(value, closestElementOfNode(m.target))\r\n : value.replace(/[\\S]/g, '*')\r\n : value,\r\n node: m.target,\r\n });\r\n }\r\n break;\r\n }\r\n case 'attributes': {\r\n const target = m.target;\r\n let attributeName = m.attributeName;\r\n let value = m.target.getAttribute(attributeName);\r\n if (attributeName === 'value') {\r\n const type = getInputType(target);\r\n value = maskInputValue({\r\n element: target,\r\n maskInputOptions: this.maskInputOptions,\r\n tagName: target.tagName,\r\n type,\r\n value,\r\n maskInputFn: this.maskInputFn,\r\n });\r\n }\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, false) ||\r\n value === m.oldValue) {\r\n return;\r\n }\r\n let item = this.attributeMap.get(m.target);\r\n if (target.tagName === 'IFRAME' &&\r\n attributeName === 'src' &&\r\n !this.keepIframeSrcFn(value)) {\r\n if (!target.contentDocument) {\r\n attributeName = 'rr_src';\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n if (!item) {\r\n item = {\r\n node: m.target,\r\n attributes: {},\r\n styleDiff: {},\r\n _unchangedStyles: {},\r\n };\r\n this.attributes.push(item);\r\n this.attributeMap.set(m.target, item);\r\n }\r\n if (attributeName === 'type' &&\r\n target.tagName === 'INPUT' &&\r\n (m.oldValue || '').toLowerCase() === 'password') {\r\n target.setAttribute('data-rr-is-password', 'true');\r\n }\r\n if (!ignoreAttribute(target.tagName, attributeName)) {\r\n item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value);\r\n if (attributeName === 'style') {\r\n if (!this.unattachedDoc) {\r\n try {\r\n this.unattachedDoc =\r\n document.implementation.createHTMLDocument();\r\n }\r\n catch (e) {\r\n this.unattachedDoc = this.doc;\r\n }\r\n }\r\n const old = this.unattachedDoc.createElement('span');\r\n if (m.oldValue) {\r\n old.setAttribute('style', m.oldValue);\r\n }\r\n for (const pname of Array.from(target.style)) {\r\n const newValue = target.style.getPropertyValue(pname);\r\n const newPriority = target.style.getPropertyPriority(pname);\r\n if (newValue !== old.style.getPropertyValue(pname) ||\r\n newPriority !== old.style.getPropertyPriority(pname)) {\r\n if (newPriority === '') {\r\n item.styleDiff[pname] = newValue;\r\n }\r\n else {\r\n item.styleDiff[pname] = [newValue, newPriority];\r\n }\r\n }\r\n else {\r\n item._unchangedStyles[pname] = [newValue, newPriority];\r\n }\r\n }\r\n for (const pname of Array.from(old.style)) {\r\n if (target.style.getPropertyValue(pname) === '') {\r\n item.styleDiff[pname] = false;\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case 'childList': {\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, true))\r\n return;\r\n if (m.target.tagName === 'TEXTAREA') {\r\n this.genTextAreaValueMutation(m.target);\r\n return;\r\n }\r\n m.addedNodes.forEach((n) => this.genAdds(n, m.target));\r\n m.removedNodes.forEach((n) => {\r\n const nodeId = this.mirror.getId(n);\r\n const parentId = isShadowRoot(m.target)\r\n ? this.mirror.getId(m.target.host)\r\n : this.mirror.getId(m.target);\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, false) ||\r\n isIgnored(n, this.mirror) ||\r\n !isSerialized(n, this.mirror)) {\r\n return;\r\n }\r\n if (this.addedSet.has(n)) {\r\n deepDelete(this.addedSet, n);\r\n this.droppedSet.add(n);\r\n }\r\n else if (this.addedSet.has(m.target) && nodeId === -1) ;\r\n else if (isAncestorRemoved(m.target, this.mirror)) ;\r\n else if (this.movedSet.has(n) &&\r\n this.movedMap[moveKey(nodeId, parentId)]) {\r\n deepDelete(this.movedSet, n);\r\n }\r\n else {\r\n this.removes.push({\r\n parentId,\r\n id: nodeId,\r\n isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)\r\n ? true\r\n : undefined,\r\n });\r\n }\r\n this.mapRemoves.push(n);\r\n });\r\n break;\r\n }\r\n }\r\n };\r\n this.genAdds = (n, target) => {\r\n if (this.processedNodeManager.inOtherBuffer(n, this))\r\n return;\r\n if (this.addedSet.has(n) || this.movedSet.has(n))\r\n return;\r\n if (this.mirror.hasNode(n)) {\r\n if (isIgnored(n, this.mirror)) {\r\n return;\r\n }\r\n this.movedSet.add(n);\r\n let targetId = null;\r\n if (target && this.mirror.hasNode(target)) {\r\n targetId = this.mirror.getId(target);\r\n }\r\n if (targetId && targetId !== -1) {\r\n this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\r\n }\r\n }\r\n else {\r\n this.addedSet.add(n);\r\n this.droppedSet.delete(n);\r\n }\r\n if (!isBlocked(n, this.blockClass, this.blockSelector, false)) {\r\n n.childNodes.forEach((childN) => this.genAdds(childN));\r\n if (hasShadowRoot(n)) {\r\n n.shadowRoot.childNodes.forEach((childN) => {\r\n this.processedNodeManager.add(childN, this);\r\n this.genAdds(childN, n);\r\n });\r\n }\r\n }\r\n };\r\n }\r\n init(options) {\r\n [\r\n 'mutationCb',\r\n 'blockClass',\r\n 'blockSelector',\r\n 'maskTextClass',\r\n 'maskTextSelector',\r\n 'inlineStylesheet',\r\n 'maskInputOptions',\r\n 'maskTextFn',\r\n 'maskInputFn',\r\n 'keepIframeSrcFn',\r\n 'recordCanvas',\r\n 'inlineImages',\r\n 'slimDOMOptions',\r\n 'dataURLOptions',\r\n 'doc',\r\n 'mirror',\r\n 'iframeManager',\r\n 'stylesheetManager',\r\n 'shadowDomManager',\r\n 'canvasManager',\r\n 'processedNodeManager',\r\n ].forEach((key) => {\r\n this[key] = options[key];\r\n });\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n this.canvasManager.freeze();\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n this.canvasManager.unfreeze();\r\n this.emit();\r\n }\r\n isFrozen() {\r\n return this.frozen;\r\n }\r\n lock() {\r\n this.locked = true;\r\n this.canvasManager.lock();\r\n }\r\n unlock() {\r\n this.locked = false;\r\n this.canvasManager.unlock();\r\n this.emit();\r\n }\r\n reset() {\r\n this.shadowDomManager.reset();\r\n this.canvasManager.reset();\r\n }\r\n}\r\nfunction deepDelete(addsSet, n) {\r\n addsSet.delete(n);\r\n n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\r\n}\r\nfunction isParentRemoved(removes, n, mirror) {\r\n if (removes.length === 0)\r\n return false;\r\n return _isParentRemoved(removes, n, mirror);\r\n}\r\nfunction _isParentRemoved(removes, n, mirror) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n const parentId = mirror.getId(parentNode);\r\n if (removes.some((r) => r.id === parentId)) {\r\n return true;\r\n }\r\n return _isParentRemoved(removes, parentNode, mirror);\r\n}\r\nfunction isAncestorInSet(set, n) {\r\n if (set.size === 0)\r\n return false;\r\n return _isAncestorInSet(set, n);\r\n}\r\nfunction _isAncestorInSet(set, n) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n if (set.has(parentNode)) {\r\n return true;\r\n }\r\n return _isAncestorInSet(set, parentNode);\r\n}\n\nlet errorHandler;\r\nfunction registerErrorHandler(handler) {\r\n errorHandler = handler;\r\n}\r\nfunction unregisterErrorHandler() {\r\n errorHandler = undefined;\r\n}\r\nconst callbackWrapper = (cb) => {\r\n if (!errorHandler) {\r\n return cb;\r\n }\r\n const rrwebWrapped = ((...rest) => {\r\n try {\r\n return cb(...rest);\r\n }\r\n catch (error) {\r\n if (errorHandler && errorHandler(error) === true) {\r\n return;\r\n }\r\n throw error;\r\n }\r\n });\r\n return rrwebWrapped;\r\n};\n\nconst mutationBuffers = [];\r\nfunction getEventTarget(event) {\r\n try {\r\n if ('composedPath' in event) {\r\n const path = event.composedPath();\r\n if (path.length) {\r\n return path[0];\r\n }\r\n }\r\n else if ('path' in event && event.path.length) {\r\n return event.path[0];\r\n }\r\n }\r\n catch (_a) {\r\n }\r\n return event && event.target;\r\n}\r\nfunction initMutationObserver(options, rootEl) {\r\n var _a, _b;\r\n const mutationBuffer = new MutationBuffer();\r\n mutationBuffers.push(mutationBuffer);\r\n mutationBuffer.init(options);\r\n let mutationObserverCtor = window.MutationObserver ||\r\n window.__rrMutationObserver;\r\n const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\r\n if (angularZoneSymbol &&\r\n window[angularZoneSymbol]) {\r\n mutationObserverCtor = window[angularZoneSymbol];\r\n }\r\n const observer = new mutationObserverCtor(callbackWrapper(mutationBuffer.processMutations.bind(mutationBuffer)));\r\n observer.observe(rootEl, {\r\n attributes: true,\r\n attributeOldValue: true,\r\n characterData: true,\r\n characterDataOldValue: true,\r\n childList: true,\r\n subtree: true,\r\n });\r\n return observer;\r\n}\r\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\r\n if (sampling.mousemove === false) {\r\n return () => {\r\n };\r\n }\r\n const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\r\n const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\r\n ? sampling.mousemoveCallback\r\n : 500;\r\n let positions = [];\r\n let timeBaseline;\r\n const wrappedCb = throttle(callbackWrapper((source) => {\r\n const totalOffset = Date.now() - timeBaseline;\r\n mousemoveCb(positions.map((p) => {\r\n p.timeOffset -= totalOffset;\r\n return p;\r\n }), source);\r\n positions = [];\r\n timeBaseline = null;\r\n }), callbackThreshold);\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n const { clientX, clientY } = legacy_isTouchEvent(evt)\r\n ? evt.changedTouches[0]\r\n : evt;\r\n if (!timeBaseline) {\r\n timeBaseline = nowTimestamp();\r\n }\r\n positions.push({\r\n x: clientX,\r\n y: clientY,\r\n id: mirror.getId(target),\r\n timeOffset: nowTimestamp() - timeBaseline,\r\n });\r\n wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\r\n ? IncrementalSource$1.Drag\r\n : evt instanceof MouseEvent\r\n ? IncrementalSource$1.MouseMove\r\n : IncrementalSource$1.TouchMove);\r\n }), threshold, {\r\n trailing: false,\r\n }));\r\n const handlers = [\r\n on('mousemove', updatePosition, doc),\r\n on('touchmove', updatePosition, doc),\r\n on('drag', updatePosition, doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, sampling, }) {\r\n if (sampling.mouseInteraction === false) {\r\n return () => {\r\n };\r\n }\r\n const disableMap = sampling.mouseInteraction === true ||\r\n sampling.mouseInteraction === undefined\r\n ? {}\r\n : sampling.mouseInteraction;\r\n const handlers = [];\r\n let currentPointerType = null;\r\n const getHandler = (eventKey) => {\r\n return (event) => {\r\n const target = getEventTarget(event);\r\n if (isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n let pointerType = null;\r\n let thisEventKey = eventKey;\r\n if ('pointerType' in event) {\r\n switch (event.pointerType) {\r\n case 'mouse':\r\n pointerType = PointerTypes.Mouse;\r\n break;\r\n case 'touch':\r\n pointerType = PointerTypes.Touch;\r\n break;\r\n case 'pen':\r\n pointerType = PointerTypes.Pen;\r\n break;\r\n }\r\n if (pointerType === PointerTypes.Touch) {\r\n if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\r\n thisEventKey = 'TouchStart';\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\r\n thisEventKey = 'TouchEnd';\r\n }\r\n }\r\n else if (pointerType === PointerTypes.Pen) ;\r\n }\r\n else if (legacy_isTouchEvent(event)) {\r\n pointerType = PointerTypes.Touch;\r\n }\r\n if (pointerType !== null) {\r\n currentPointerType = pointerType;\r\n if ((thisEventKey.startsWith('Touch') &&\r\n pointerType === PointerTypes.Touch) ||\r\n (thisEventKey.startsWith('Mouse') &&\r\n pointerType === PointerTypes.Mouse)) {\r\n pointerType = null;\r\n }\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\r\n pointerType = currentPointerType;\r\n currentPointerType = null;\r\n }\r\n const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\r\n if (!e) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n const { clientX, clientY } = e;\r\n callbackWrapper(mouseInteractionCb)(Object.assign({ type: MouseInteractions[thisEventKey], id, x: clientX, y: clientY }, (pointerType !== null && { pointerType })));\r\n };\r\n };\r\n Object.keys(MouseInteractions)\r\n .filter((key) => Number.isNaN(Number(key)) &&\r\n !key.endsWith('_Departed') &&\r\n disableMap[key] !== false)\r\n .forEach((eventKey) => {\r\n let eventName = toLowerCase(eventKey);\r\n const handler = getHandler(eventKey);\r\n if (window.PointerEvent) {\r\n switch (MouseInteractions[eventKey]) {\r\n case MouseInteractions.MouseDown:\r\n case MouseInteractions.MouseUp:\r\n eventName = eventName.replace('mouse', 'pointer');\r\n break;\r\n case MouseInteractions.TouchStart:\r\n case MouseInteractions.TouchEnd:\r\n return;\r\n }\r\n }\r\n handlers.push(on(eventName, handler, doc));\r\n });\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, sampling, }) {\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n if (target === doc && doc.defaultView) {\r\n const scrollLeftTop = getWindowScroll(doc.defaultView);\r\n scrollCb({\r\n id,\r\n x: scrollLeftTop.left,\r\n y: scrollLeftTop.top,\r\n });\r\n }\r\n else {\r\n scrollCb({\r\n id,\r\n x: target.scrollLeft,\r\n y: target.scrollTop,\r\n });\r\n }\r\n }), sampling.scroll || 100));\r\n return on('scroll', updatePosition, doc);\r\n}\r\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\r\n let lastH = -1;\r\n let lastW = -1;\r\n const updateDimension = callbackWrapper(throttle(callbackWrapper(() => {\r\n const height = getWindowHeight();\r\n const width = getWindowWidth();\r\n if (lastH !== height || lastW !== width) {\r\n viewportResizeCb({\r\n width: Number(width),\r\n height: Number(height),\r\n });\r\n lastH = height;\r\n lastW = width;\r\n }\r\n }), 200));\r\n return on('resize', updateDimension, win);\r\n}\r\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\r\nconst lastInputValueMap = new WeakMap();\r\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {\r\n function eventHandler(event) {\r\n let target = getEventTarget(event);\r\n const userTriggered = event.isTrusted;\r\n const tagName = target && target.tagName;\r\n if (target && tagName === 'OPTION') {\r\n target = target.parentElement;\r\n }\r\n if (!target ||\r\n !tagName ||\r\n INPUT_TAGS.indexOf(tagName) < 0 ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n if (target.classList.contains(ignoreClass) ||\r\n (ignoreSelector && target.matches(ignoreSelector))) {\r\n return;\r\n }\r\n let text = target.value;\r\n let isChecked = false;\r\n const type = getInputType(target) || '';\r\n if (type === 'radio' || type === 'checkbox') {\r\n isChecked = target.checked;\r\n }\r\n else if (maskInputOptions[tagName.toLowerCase()] ||\r\n maskInputOptions[type]) {\r\n text = maskInputValue({\r\n element: target,\r\n maskInputOptions,\r\n tagName,\r\n type,\r\n value: text,\r\n maskInputFn,\r\n });\r\n }\r\n cbWithDedup(target, userTriggeredOnInput\r\n ? { text, isChecked, userTriggered }\r\n : { text, isChecked });\r\n const name = target.name;\r\n if (type === 'radio' && name && isChecked) {\r\n doc\r\n .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\r\n .forEach((el) => {\r\n if (el !== target) {\r\n const text = el.value;\r\n cbWithDedup(el, userTriggeredOnInput\r\n ? { text, isChecked: !isChecked, userTriggered: false }\r\n : { text, isChecked: !isChecked });\r\n }\r\n });\r\n }\r\n }\r\n function cbWithDedup(target, v) {\r\n const lastInputValue = lastInputValueMap.get(target);\r\n if (!lastInputValue ||\r\n lastInputValue.text !== v.text ||\r\n lastInputValue.isChecked !== v.isChecked) {\r\n lastInputValueMap.set(target, v);\r\n const id = mirror.getId(target);\r\n callbackWrapper(inputCb)(Object.assign(Object.assign({}, v), { id }));\r\n }\r\n }\r\n const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\r\n const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\r\n const currentWindow = doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n }\r\n const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\r\n const hookProperties = [\r\n [currentWindow.HTMLInputElement.prototype, 'value'],\r\n [currentWindow.HTMLInputElement.prototype, 'checked'],\r\n [currentWindow.HTMLSelectElement.prototype, 'value'],\r\n [currentWindow.HTMLTextAreaElement.prototype, 'value'],\r\n [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'],\r\n [currentWindow.HTMLOptionElement.prototype, 'selected'],\r\n ];\r\n if (propertyDescriptor && propertyDescriptor.set) {\r\n handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\r\n set() {\r\n callbackWrapper(eventHandler)({\r\n target: this,\r\n isTrusted: false,\r\n });\r\n },\r\n }, false, currentWindow)));\r\n }\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction getNestedCSSRulePositions(rule) {\r\n const positions = [];\r\n function recurse(childRule, pos) {\r\n if ((hasNestedCSSRule('CSSGroupingRule') &&\r\n childRule.parentRule instanceof CSSGroupingRule) ||\r\n (hasNestedCSSRule('CSSMediaRule') &&\r\n childRule.parentRule instanceof CSSMediaRule) ||\r\n (hasNestedCSSRule('CSSSupportsRule') &&\r\n childRule.parentRule instanceof CSSSupportsRule) ||\r\n (hasNestedCSSRule('CSSConditionRule') &&\r\n childRule.parentRule instanceof CSSConditionRule)) {\r\n const rules = Array.from(childRule.parentRule.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n else if (childRule.parentStyleSheet) {\r\n const rules = Array.from(childRule.parentStyleSheet.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n return pos;\r\n }\r\n return recurse(rule, positions);\r\n}\r\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\r\n let id, styleId;\r\n if (!sheet)\r\n return {};\r\n if (sheet.ownerNode)\r\n id = mirror.getId(sheet.ownerNode);\r\n else\r\n styleId = styleMirror.getId(sheet);\r\n return {\r\n styleId,\r\n id,\r\n };\r\n}\r\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) {\r\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\r\n return () => {\r\n };\r\n }\r\n const insertRule = win.CSSStyleSheet.prototype.insertRule;\r\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [{ rule, index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\r\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [{ index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n let replace;\r\n if (win.CSSStyleSheet.prototype.replace) {\r\n replace = win.CSSStyleSheet.prototype.replace;\r\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replace: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n let replaceSync;\r\n if (win.CSSStyleSheet.prototype.replaceSync) {\r\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\r\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replaceSync: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n const supportedNestedCSSRuleTypes = {};\r\n if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\r\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\r\n }\r\n else {\r\n if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\r\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\r\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\r\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\r\n }\r\n }\r\n const unmodifiedFunctions = {};\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n unmodifiedFunctions[typeKey] = {\r\n insertRule: type.prototype.insertRule,\r\n deleteRule: type.prototype.deleteRule,\r\n };\r\n type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [\r\n {\r\n rule,\r\n index: [\r\n ...getNestedCSSRulePositions(thisArg),\r\n index || 0,\r\n ],\r\n },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [\r\n { index: [...getNestedCSSRulePositions(thisArg), index] },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleSheet.prototype.insertRule = insertRule;\r\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\r\n replace && (win.CSSStyleSheet.prototype.replace = replace);\r\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\r\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\r\n });\r\n });\r\n}\r\nfunction initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) {\r\n var _a, _b, _c;\r\n let hostId = null;\r\n if (host.nodeName === '#document')\r\n hostId = mirror.getId(host);\r\n else\r\n hostId = mirror.getId(host.host);\r\n const patchTarget = host.nodeName === '#document'\r\n ? (_a = host.defaultView) === null || _a === void 0 ? void 0 : _a.Document\r\n : (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot;\r\n const originalPropertyDescriptor = (patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype)\r\n ? Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets')\r\n : undefined;\r\n if (hostId === null ||\r\n hostId === -1 ||\r\n !patchTarget ||\r\n !originalPropertyDescriptor)\r\n return () => {\r\n };\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get() {\r\n var _a;\r\n return (_a = originalPropertyDescriptor.get) === null || _a === void 0 ? void 0 : _a.call(this);\r\n },\r\n set(sheets) {\r\n var _a;\r\n const result = (_a = originalPropertyDescriptor.set) === null || _a === void 0 ? void 0 : _a.call(this, sheets);\r\n if (hostId !== null && hostId !== -1) {\r\n try {\r\n stylesheetManager.adoptStyleSheets(sheets, hostId);\r\n }\r\n catch (e) {\r\n }\r\n }\r\n return result;\r\n },\r\n });\r\n return callbackWrapper(() => {\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get: originalPropertyDescriptor.get,\r\n set: originalPropertyDescriptor.set,\r\n });\r\n });\r\n}\r\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) {\r\n const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\r\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n var _a;\r\n const [property, value, priority] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return setProperty.apply(thisArg, [property, value, priority]);\r\n }\r\n const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n set: {\r\n property,\r\n value,\r\n priority,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n var _a;\r\n const [property] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return removeProperty.apply(thisArg, [property]);\r\n }\r\n const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n remove: {\r\n property,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\r\n });\r\n}\r\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, mirror, sampling, doc, }) {\r\n const handler = callbackWrapper((type) => throttle(callbackWrapper((event) => {\r\n const target = getEventTarget(event);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n const { currentTime, volume, muted, playbackRate, loop } = target;\r\n mediaInteractionCb({\r\n type,\r\n id: mirror.getId(target),\r\n currentTime,\r\n volume,\r\n muted,\r\n playbackRate,\r\n loop,\r\n });\r\n }), sampling.media || 500));\r\n const handlers = [\r\n on('play', handler(0), doc),\r\n on('pause', handler(1), doc),\r\n on('seeked', handler(2), doc),\r\n on('volumechange', handler(3), doc),\r\n on('ratechange', handler(4), doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initFontObserver({ fontCb, doc }) {\r\n const win = doc.defaultView;\r\n if (!win) {\r\n return () => {\r\n };\r\n }\r\n const handlers = [];\r\n const fontMap = new WeakMap();\r\n const originalFontFace = win.FontFace;\r\n win.FontFace = function FontFace(family, source, descriptors) {\r\n const fontFace = new originalFontFace(family, source, descriptors);\r\n fontMap.set(fontFace, {\r\n family,\r\n buffer: typeof source !== 'string',\r\n descriptors,\r\n fontSource: typeof source === 'string'\r\n ? source\r\n : JSON.stringify(Array.from(new Uint8Array(source))),\r\n });\r\n return fontFace;\r\n };\r\n const restoreHandler = patch(doc.fonts, 'add', function (original) {\r\n return function (fontFace) {\r\n setTimeout(callbackWrapper(() => {\r\n const p = fontMap.get(fontFace);\r\n if (p) {\r\n fontCb(p);\r\n fontMap.delete(fontFace);\r\n }\r\n }), 0);\r\n return original.apply(this, [fontFace]);\r\n };\r\n });\r\n handlers.push(() => {\r\n win.FontFace = originalFontFace;\r\n });\r\n handlers.push(restoreHandler);\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initSelectionObserver(param) {\r\n const { doc, mirror, blockClass, blockSelector, selectionCb } = param;\r\n let collapsed = true;\r\n const updateSelection = callbackWrapper(() => {\r\n const selection = doc.getSelection();\r\n if (!selection || (collapsed && (selection === null || selection === void 0 ? void 0 : selection.isCollapsed)))\r\n return;\r\n collapsed = selection.isCollapsed || false;\r\n const ranges = [];\r\n const count = selection.rangeCount || 0;\r\n for (let i = 0; i < count; i++) {\r\n const range = selection.getRangeAt(i);\r\n const { startContainer, startOffset, endContainer, endOffset } = range;\r\n const blocked = isBlocked(startContainer, blockClass, blockSelector, true) ||\r\n isBlocked(endContainer, blockClass, blockSelector, true);\r\n if (blocked)\r\n continue;\r\n ranges.push({\r\n start: mirror.getId(startContainer),\r\n startOffset,\r\n end: mirror.getId(endContainer),\r\n endOffset,\r\n });\r\n }\r\n selectionCb({ ranges });\r\n });\r\n updateSelection();\r\n return on('selectionchange', updateSelection);\r\n}\r\nfunction initCustomElementObserver({ doc, customElementCb, }) {\r\n const win = doc.defaultView;\r\n if (!win || !win.customElements)\r\n return () => { };\r\n const restoreHandler = patch(win.customElements, 'define', function (original) {\r\n return function (name, constructor, options) {\r\n try {\r\n customElementCb({\r\n define: {\r\n name,\r\n },\r\n });\r\n }\r\n catch (e) {\r\n console.warn(`Custom element callback failed for ${name}`);\r\n }\r\n return original.apply(this, [name, constructor, options]);\r\n };\r\n });\r\n return restoreHandler;\r\n}\r\nfunction mergeHooks(o, hooks) {\r\n const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, customElementCb, } = o;\r\n o.mutationCb = (...p) => {\r\n if (hooks.mutation) {\r\n hooks.mutation(...p);\r\n }\r\n mutationCb(...p);\r\n };\r\n o.mousemoveCb = (...p) => {\r\n if (hooks.mousemove) {\r\n hooks.mousemove(...p);\r\n }\r\n mousemoveCb(...p);\r\n };\r\n o.mouseInteractionCb = (...p) => {\r\n if (hooks.mouseInteraction) {\r\n hooks.mouseInteraction(...p);\r\n }\r\n mouseInteractionCb(...p);\r\n };\r\n o.scrollCb = (...p) => {\r\n if (hooks.scroll) {\r\n hooks.scroll(...p);\r\n }\r\n scrollCb(...p);\r\n };\r\n o.viewportResizeCb = (...p) => {\r\n if (hooks.viewportResize) {\r\n hooks.viewportResize(...p);\r\n }\r\n viewportResizeCb(...p);\r\n };\r\n o.inputCb = (...p) => {\r\n if (hooks.input) {\r\n hooks.input(...p);\r\n }\r\n inputCb(...p);\r\n };\r\n o.mediaInteractionCb = (...p) => {\r\n if (hooks.mediaInteaction) {\r\n hooks.mediaInteaction(...p);\r\n }\r\n mediaInteractionCb(...p);\r\n };\r\n o.styleSheetRuleCb = (...p) => {\r\n if (hooks.styleSheetRule) {\r\n hooks.styleSheetRule(...p);\r\n }\r\n styleSheetRuleCb(...p);\r\n };\r\n o.styleDeclarationCb = (...p) => {\r\n if (hooks.styleDeclaration) {\r\n hooks.styleDeclaration(...p);\r\n }\r\n styleDeclarationCb(...p);\r\n };\r\n o.canvasMutationCb = (...p) => {\r\n if (hooks.canvasMutation) {\r\n hooks.canvasMutation(...p);\r\n }\r\n canvasMutationCb(...p);\r\n };\r\n o.fontCb = (...p) => {\r\n if (hooks.font) {\r\n hooks.font(...p);\r\n }\r\n fontCb(...p);\r\n };\r\n o.selectionCb = (...p) => {\r\n if (hooks.selection) {\r\n hooks.selection(...p);\r\n }\r\n selectionCb(...p);\r\n };\r\n o.customElementCb = (...c) => {\r\n if (hooks.customElement) {\r\n hooks.customElement(...c);\r\n }\r\n customElementCb(...c);\r\n };\r\n}\r\nfunction initObservers(o, hooks = {}) {\r\n const currentWindow = o.doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n };\r\n }\r\n mergeHooks(o, hooks);\r\n let mutationObserver;\r\n if (o.recordDOM) {\r\n mutationObserver = initMutationObserver(o, o.doc);\r\n }\r\n const mousemoveHandler = initMoveObserver(o);\r\n const mouseInteractionHandler = initMouseInteractionObserver(o);\r\n const scrollHandler = initScrollObserver(o);\r\n const viewportResizeHandler = initViewportResizeObserver(o, {\r\n win: currentWindow,\r\n });\r\n const inputHandler = initInputObserver(o);\r\n const mediaInteractionHandler = initMediaInteractionObserver(o);\r\n let styleSheetObserver = () => { };\r\n let adoptedStyleSheetObserver = () => { };\r\n let styleDeclarationObserver = () => { };\r\n let fontObserver = () => { };\r\n if (o.recordDOM) {\r\n styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\r\n adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\r\n styleDeclarationObserver = initStyleDeclarationObserver(o, {\r\n win: currentWindow,\r\n });\r\n if (o.collectFonts) {\r\n fontObserver = initFontObserver(o);\r\n }\r\n }\r\n const selectionObserver = initSelectionObserver(o);\r\n const customElementObserver = initCustomElementObserver(o);\r\n const pluginHandlers = [];\r\n for (const plugin of o.plugins) {\r\n pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\r\n }\r\n return callbackWrapper(() => {\r\n mutationBuffers.forEach((b) => b.reset());\r\n mutationObserver === null || mutationObserver === void 0 ? void 0 : mutationObserver.disconnect();\r\n mousemoveHandler();\r\n mouseInteractionHandler();\r\n scrollHandler();\r\n viewportResizeHandler();\r\n inputHandler();\r\n mediaInteractionHandler();\r\n styleSheetObserver();\r\n adoptedStyleSheetObserver();\r\n styleDeclarationObserver();\r\n fontObserver();\r\n selectionObserver();\r\n customElementObserver();\r\n pluginHandlers.forEach((h) => h());\r\n });\r\n}\r\nfunction hasNestedCSSRule(prop) {\r\n return typeof window[prop] !== 'undefined';\r\n}\r\nfunction canMonkeyPatchNestedCSSRule(prop) {\r\n return Boolean(typeof window[prop] !== 'undefined' &&\r\n window[prop].prototype &&\r\n 'insertRule' in window[prop].prototype &&\r\n 'deleteRule' in window[prop].prototype);\r\n}\n\nclass CrossOriginIframeMirror {\r\n constructor(generateIdFn) {\r\n this.generateIdFn = generateIdFn;\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n }\r\n getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\r\n const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\r\n let id = idToRemoteIdMap.get(remoteId);\r\n if (!id) {\r\n id = this.generateIdFn();\r\n idToRemoteIdMap.set(remoteId, id);\r\n remoteIdToIdMap.set(id, remoteId);\r\n }\r\n return id;\r\n }\r\n getIds(iframe, remoteId) {\r\n const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap));\r\n }\r\n getRemoteId(iframe, id, map) {\r\n const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\r\n if (typeof id !== 'number')\r\n return id;\r\n const remoteId = remoteIdToIdMap.get(id);\r\n if (!remoteId)\r\n return -1;\r\n return remoteId;\r\n }\r\n getRemoteIds(iframe, ids) {\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\r\n }\r\n reset(iframe) {\r\n if (!iframe) {\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n return;\r\n }\r\n this.iframeIdToRemoteIdMap.delete(iframe);\r\n this.iframeRemoteIdToIdMap.delete(iframe);\r\n }\r\n getIdToRemoteIdMap(iframe) {\r\n let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\r\n if (!idToRemoteIdMap) {\r\n idToRemoteIdMap = new Map();\r\n this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\r\n }\r\n return idToRemoteIdMap;\r\n }\r\n getRemoteIdToIdMap(iframe) {\r\n let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\r\n if (!remoteIdToIdMap) {\r\n remoteIdToIdMap = new Map();\r\n this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\r\n }\r\n return remoteIdToIdMap;\r\n }\r\n}\n\nclass IframeManager {\r\n constructor(options) {\r\n this.iframes = new WeakMap();\r\n this.crossOriginIframeMap = new WeakMap();\r\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\r\n this.crossOriginIframeRootIdMap = new WeakMap();\r\n this.mutationCb = options.mutationCb;\r\n this.wrappedEmit = options.wrappedEmit;\r\n this.stylesheetManager = options.stylesheetManager;\r\n this.recordCrossOriginIframes = options.recordCrossOriginIframes;\r\n this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\r\n this.mirror = options.mirror;\r\n if (this.recordCrossOriginIframes) {\r\n window.addEventListener('message', this.handleMessage.bind(this));\r\n }\r\n }\r\n addIframe(iframeEl) {\r\n this.iframes.set(iframeEl, true);\r\n if (iframeEl.contentWindow)\r\n this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\r\n }\r\n addLoadListener(cb) {\r\n this.loadListener = cb;\r\n }\r\n attachIframe(iframeEl, childSn) {\r\n var _a;\r\n this.mutationCb({\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: childSn,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n });\r\n (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\r\n if (iframeEl.contentDocument &&\r\n iframeEl.contentDocument.adoptedStyleSheets &&\r\n iframeEl.contentDocument.adoptedStyleSheets.length > 0)\r\n this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\r\n }\r\n handleMessage(message) {\r\n const crossOriginMessageEvent = message;\r\n if (crossOriginMessageEvent.data.type !== 'rrweb' ||\r\n crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\r\n return;\r\n const iframeSourceWindow = message.source;\r\n if (!iframeSourceWindow)\r\n return;\r\n const iframeEl = this.crossOriginIframeMap.get(message.source);\r\n if (!iframeEl)\r\n return;\r\n const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\r\n if (transformedEvent)\r\n this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\r\n }\r\n transformCrossOriginEvent(iframeEl, e) {\r\n var _a;\r\n switch (e.type) {\r\n case EventType$1.FullSnapshot: {\r\n this.crossOriginIframeMirror.reset(iframeEl);\r\n this.crossOriginIframeStyleMirror.reset(iframeEl);\r\n this.replaceIdOnNode(e.data.node, iframeEl);\r\n const rootId = e.data.node.id;\r\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\r\n this.patchRootIdOnNode(e.data.node, rootId);\r\n return {\r\n timestamp: e.timestamp,\r\n type: EventType$1.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource$1.Mutation,\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: e.data.node,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n },\r\n };\r\n }\r\n case EventType$1.Meta:\r\n case EventType$1.Load:\r\n case EventType$1.DomContentLoaded: {\r\n return false;\r\n }\r\n case EventType$1.Plugin: {\r\n return e;\r\n }\r\n case EventType$1.Custom: {\r\n this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\r\n return e;\r\n }\r\n case EventType$1.IncrementalSnapshot: {\r\n switch (e.data.source) {\r\n case IncrementalSource$1.Mutation: {\r\n e.data.adds.forEach((n) => {\r\n this.replaceIds(n, iframeEl, [\r\n 'parentId',\r\n 'nextId',\r\n 'previousId',\r\n ]);\r\n this.replaceIdOnNode(n.node, iframeEl);\r\n const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\r\n rootId && this.patchRootIdOnNode(n.node, rootId);\r\n });\r\n e.data.removes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['parentId', 'id']);\r\n });\r\n e.data.attributes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n e.data.texts.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource$1.Drag:\r\n case IncrementalSource$1.TouchMove:\r\n case IncrementalSource$1.MouseMove: {\r\n e.data.positions.forEach((p) => {\r\n this.replaceIds(p, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource$1.ViewportResize: {\r\n return false;\r\n }\r\n case IncrementalSource$1.MediaInteraction:\r\n case IncrementalSource$1.MouseInteraction:\r\n case IncrementalSource$1.Scroll:\r\n case IncrementalSource$1.CanvasMutation:\r\n case IncrementalSource$1.Input: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n return e;\r\n }\r\n case IncrementalSource$1.StyleSheetRule:\r\n case IncrementalSource$1.StyleDeclaration: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleId']);\r\n return e;\r\n }\r\n case IncrementalSource$1.Font: {\r\n return e;\r\n }\r\n case IncrementalSource$1.Selection: {\r\n e.data.ranges.forEach((range) => {\r\n this.replaceIds(range, iframeEl, ['start', 'end']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource$1.AdoptedStyleSheet: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\r\n (_a = e.data.styles) === null || _a === void 0 ? void 0 : _a.forEach((style) => {\r\n this.replaceStyleIds(style, iframeEl, ['styleId']);\r\n });\r\n return e;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n replace(iframeMirror, obj, iframeEl, keys) {\r\n for (const key of keys) {\r\n if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number')\r\n continue;\r\n if (Array.isArray(obj[key])) {\r\n obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\r\n }\r\n else {\r\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\r\n }\r\n }\r\n return obj;\r\n }\r\n replaceIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\r\n }\r\n replaceStyleIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\r\n }\r\n replaceIdOnNode(node, iframeEl) {\r\n this.replaceIds(node, iframeEl, ['id', 'rootId']);\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.replaceIdOnNode(child, iframeEl);\r\n });\r\n }\r\n }\r\n patchRootIdOnNode(node, rootId) {\r\n if (node.type !== NodeType.Document && !node.rootId)\r\n node.rootId = rootId;\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.patchRootIdOnNode(child, rootId);\r\n });\r\n }\r\n }\r\n}\n\nclass ShadowDomManager {\r\n constructor(options) {\r\n this.shadowDoms = new WeakSet();\r\n this.restoreHandlers = [];\r\n this.mutationCb = options.mutationCb;\r\n this.scrollCb = options.scrollCb;\r\n this.bypassOptions = options.bypassOptions;\r\n this.mirror = options.mirror;\r\n this.init();\r\n }\r\n init() {\r\n this.reset();\r\n this.patchAttachShadow(Element, document);\r\n }\r\n addShadowRoot(shadowRoot, doc) {\r\n if (!isNativeShadowDom(shadowRoot))\r\n return;\r\n if (this.shadowDoms.has(shadowRoot))\r\n return;\r\n this.shadowDoms.add(shadowRoot);\r\n const observer = initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);\r\n this.restoreHandlers.push(() => observer.disconnect());\r\n this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror })));\r\n setTimeout(() => {\r\n if (shadowRoot.adoptedStyleSheets &&\r\n shadowRoot.adoptedStyleSheets.length > 0)\r\n this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host));\r\n this.restoreHandlers.push(initAdoptedStyleSheetObserver({\r\n mirror: this.mirror,\r\n stylesheetManager: this.bypassOptions.stylesheetManager,\r\n }, shadowRoot));\r\n }, 0);\r\n }\r\n observeAttachShadow(iframeElement) {\r\n if (!iframeElement.contentWindow || !iframeElement.contentDocument)\r\n return;\r\n this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\r\n }\r\n patchAttachShadow(element, doc) {\r\n const manager = this;\r\n this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\r\n return function (option) {\r\n const shadowRoot = original.call(this, option);\r\n if (this.shadowRoot && inDom(this))\r\n manager.addShadowRoot(this.shadowRoot, doc);\r\n return shadowRoot;\r\n };\r\n }));\r\n }\r\n reset() {\r\n this.restoreHandlers.forEach((handler) => {\r\n try {\r\n handler();\r\n }\r\n catch (e) {\r\n }\r\n });\r\n this.restoreHandlers = [];\r\n this.shadowDoms = new WeakSet();\r\n }\r\n}\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\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 __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\n/*\n * base64-arraybuffer 1.0.1 \n * Copyright (c) 2021 Niklas von Hertzen \n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\n\nconst canvasVarMap = new Map();\r\nfunction variableListFor(ctx, ctor) {\r\n let contextMap = canvasVarMap.get(ctx);\r\n if (!contextMap) {\r\n contextMap = new Map();\r\n canvasVarMap.set(ctx, contextMap);\r\n }\r\n if (!contextMap.has(ctor)) {\r\n contextMap.set(ctor, []);\r\n }\r\n return contextMap.get(ctor);\r\n}\r\nconst saveWebGLVar = (value, win, ctx) => {\r\n if (!value ||\r\n !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))\r\n return;\r\n const name = value.constructor.name;\r\n const list = variableListFor(ctx, name);\r\n let index = list.indexOf(value);\r\n if (index === -1) {\r\n index = list.length;\r\n list.push(value);\r\n }\r\n return index;\r\n};\r\nfunction serializeArg(value, win, ctx) {\r\n if (value instanceof Array) {\r\n return value.map((arg) => serializeArg(arg, win, ctx));\r\n }\r\n else if (value === null) {\r\n return value;\r\n }\r\n else if (value instanceof Float32Array ||\r\n value instanceof Float64Array ||\r\n value instanceof Int32Array ||\r\n value instanceof Uint32Array ||\r\n value instanceof Uint8Array ||\r\n value instanceof Uint16Array ||\r\n value instanceof Int16Array ||\r\n value instanceof Int8Array ||\r\n value instanceof Uint8ClampedArray) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [Object.values(value)],\r\n };\r\n }\r\n else if (value instanceof ArrayBuffer) {\r\n const name = value.constructor.name;\r\n const base64 = encode(value);\r\n return {\r\n rr_type: name,\r\n base64,\r\n };\r\n }\r\n else if (value instanceof DataView) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [\r\n serializeArg(value.buffer, win, ctx),\r\n value.byteOffset,\r\n value.byteLength,\r\n ],\r\n };\r\n }\r\n else if (value instanceof HTMLImageElement) {\r\n const name = value.constructor.name;\r\n const { src } = value;\r\n return {\r\n rr_type: name,\r\n src,\r\n };\r\n }\r\n else if (value instanceof HTMLCanvasElement) {\r\n const name = 'HTMLImageElement';\r\n const src = value.toDataURL();\r\n return {\r\n rr_type: name,\r\n src,\r\n };\r\n }\r\n else if (value instanceof ImageData) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [serializeArg(value.data, win, ctx), value.width, value.height],\r\n };\r\n }\r\n else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\r\n const name = value.constructor.name;\r\n const index = saveWebGLVar(value, win, ctx);\r\n return {\r\n rr_type: name,\r\n index: index,\r\n };\r\n }\r\n return value;\r\n}\r\nconst serializeArgs = (args, win, ctx) => {\r\n return args.map((arg) => serializeArg(arg, win, ctx));\r\n};\r\nconst isInstanceOfWebGLObject = (value, win) => {\r\n const webGLConstructorNames = [\r\n 'WebGLActiveInfo',\r\n 'WebGLBuffer',\r\n 'WebGLFramebuffer',\r\n 'WebGLProgram',\r\n 'WebGLRenderbuffer',\r\n 'WebGLShader',\r\n 'WebGLShaderPrecisionFormat',\r\n 'WebGLTexture',\r\n 'WebGLUniformLocation',\r\n 'WebGLVertexArrayObject',\r\n 'WebGLVertexArrayObjectOES',\r\n ];\r\n const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');\r\n return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));\r\n};\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector) {\r\n const handlers = [];\r\n const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\r\n for (const prop of props2D) {\r\n try {\r\n if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\r\n continue;\r\n }\r\n const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\r\n return function (...args) {\r\n if (!isBlocked(this.canvas, blockClass, blockSelector, true)) {\r\n setTimeout(() => {\r\n const recordArgs = serializeArgs(args, win, this);\r\n cb(this.canvas, {\r\n type: CanvasContext['2D'],\r\n property: prop,\r\n args: recordArgs,\r\n });\r\n }, 0);\r\n }\r\n return original.apply(this, args);\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\r\n set(v) {\r\n cb(this.canvas, {\r\n type: CanvasContext['2D'],\r\n property: prop,\r\n args: [v],\r\n setter: true,\r\n });\r\n },\r\n });\r\n handlers.push(hookHandler);\r\n }\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nfunction getNormalizedContextName(contextType) {\r\n return contextType === 'experimental-webgl' ? 'webgl' : contextType;\r\n}\r\nfunction initCanvasContextObserver(win, blockClass, blockSelector, setPreserveDrawingBufferToTrue) {\r\n const handlers = [];\r\n try {\r\n const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\r\n return function (contextType, ...args) {\r\n if (!isBlocked(this, blockClass, blockSelector, true)) {\r\n const ctxName = getNormalizedContextName(contextType);\r\n if (!('__context' in this))\r\n this.__context = ctxName;\r\n if (setPreserveDrawingBufferToTrue &&\r\n ['webgl', 'webgl2'].includes(ctxName)) {\r\n if (args[0] && typeof args[0] === 'object') {\r\n const contextAttributes = args[0];\r\n if (!contextAttributes.preserveDrawingBuffer) {\r\n contextAttributes.preserveDrawingBuffer = true;\r\n }\r\n }\r\n else {\r\n args.splice(0, 1, {\r\n preserveDrawingBuffer: true,\r\n });\r\n }\r\n }\r\n }\r\n return original.apply(this, [contextType, ...args]);\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n console.error('failed to patch HTMLCanvasElement.prototype.getContext');\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, mirror, win) {\r\n const handlers = [];\r\n const props = Object.getOwnPropertyNames(prototype);\r\n for (const prop of props) {\r\n if ([\r\n 'isContextLost',\r\n 'canvas',\r\n 'drawingBufferWidth',\r\n 'drawingBufferHeight',\r\n ].includes(prop)) {\r\n continue;\r\n }\r\n try {\r\n if (typeof prototype[prop] !== 'function') {\r\n continue;\r\n }\r\n const restoreHandler = patch(prototype, prop, function (original) {\r\n return function (...args) {\r\n const result = original.apply(this, args);\r\n saveWebGLVar(result, win, this);\r\n if ('tagName' in this.canvas &&\r\n !isBlocked(this.canvas, blockClass, blockSelector, true)) {\r\n const recordArgs = serializeArgs(args, win, this);\r\n const mutation = {\r\n type,\r\n property: prop,\r\n args: recordArgs,\r\n };\r\n cb(this.canvas, mutation);\r\n }\r\n return result;\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n const hookHandler = hookSetter(prototype, prop, {\r\n set(v) {\r\n cb(this.canvas, {\r\n type,\r\n property: prop,\r\n args: [v],\r\n setter: true,\r\n });\r\n },\r\n });\r\n handlers.push(hookHandler);\r\n }\r\n }\r\n return handlers;\r\n}\r\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, mirror) {\r\n const handlers = [];\r\n handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, mirror, win));\r\n if (typeof win.WebGL2RenderingContext !== 'undefined') {\r\n handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, mirror, win));\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nfunction funcToSource(fn, sourcemapArg) {\n var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;\n var source = fn.toString();\n var lines = source.split('\\n');\n lines.pop();\n lines.shift();\n var blankPrefixLength = lines[0].search(/\\S/);\n var regex = /(['\"])__worker_loader_strict__(['\"])/g;\n for (var i = 0, n = lines.length; i < n; ++i) {\n lines[i] = lines[i].substring(blankPrefixLength).replace(regex, '$1use strict$2') + '\\n';\n }\n if (sourcemap) {\n lines.push('\\/\\/# sourceMappingURL=' + sourcemap + '\\n');\n }\n return lines;\n}\n\nfunction createURL(fn, sourcemapArg) {\n var lines = funcToSource(fn, sourcemapArg);\n var blob = new Blob(lines, { type: 'application/javascript' });\n return URL.createObjectURL(blob);\n}\n\nfunction createInlineWorkerFactory(fn, sourcemapArg) {\n var url;\n return function WorkerFactory(options) {\n url = url || createURL(fn, sourcemapArg);\n return new Worker(url, options);\n };\n}\n\nvar WorkerFactory = createInlineWorkerFactory(/* rollup-plugin-web-worker-loader */function () {\n(function () {\n '__worker_loader_strict__';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\n\n /*\n * base64-arraybuffer 1.0.1 \n * Copyright (c) 2021 Niklas von Hertzen \n * Released under MIT License\n */\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n };\n\n const lastBlobMap = new Map();\r\n const transparentBlobMap = new Map();\r\n function getTransparentBlobFor(width, height, dataURLOptions) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const id = `${width}-${height}`;\r\n if ('OffscreenCanvas' in globalThis) {\r\n if (transparentBlobMap.has(id))\r\n return transparentBlobMap.get(id);\r\n const offscreen = new OffscreenCanvas(width, height);\r\n offscreen.getContext('2d');\r\n const blob = yield offscreen.convertToBlob(dataURLOptions);\r\n const arrayBuffer = yield blob.arrayBuffer();\r\n const base64 = encode(arrayBuffer);\r\n transparentBlobMap.set(id, base64);\r\n return base64;\r\n }\r\n else {\r\n return '';\r\n }\r\n });\r\n }\r\n const worker = self;\r\n worker.onmessage = function (e) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if ('OffscreenCanvas' in globalThis) {\r\n const { id, bitmap, width, height, dataURLOptions } = e.data;\r\n const transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);\r\n const offscreen = new OffscreenCanvas(width, height);\r\n const ctx = offscreen.getContext('2d');\r\n ctx.drawImage(bitmap, 0, 0);\r\n bitmap.close();\r\n const blob = yield offscreen.convertToBlob(dataURLOptions);\r\n const type = blob.type;\r\n const arrayBuffer = yield blob.arrayBuffer();\r\n const base64 = encode(arrayBuffer);\r\n if (!lastBlobMap.has(id) && (yield transparentBase64) === base64) {\r\n lastBlobMap.set(id, base64);\r\n return worker.postMessage({ id });\r\n }\r\n if (lastBlobMap.get(id) === base64)\r\n return worker.postMessage({ id });\r\n worker.postMessage({\r\n id,\r\n type,\r\n base64,\r\n width,\r\n height,\r\n });\r\n lastBlobMap.set(id, base64);\r\n }\r\n else {\r\n return worker.postMessage({ id: e.data.id });\r\n }\r\n });\r\n };\n\n})();\n}, null);\n\nclass CanvasManager {\r\n reset() {\r\n this.pendingCanvasMutations.clear();\r\n this.resetObservers && this.resetObservers();\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n }\r\n lock() {\r\n this.locked = true;\r\n }\r\n unlock() {\r\n this.locked = false;\r\n }\r\n constructor(options) {\r\n this.pendingCanvasMutations = new Map();\r\n this.rafStamps = { latestId: 0, invokeId: null };\r\n this.frozen = false;\r\n this.locked = false;\r\n this.processMutation = (target, mutation) => {\r\n const newFrame = this.rafStamps.invokeId &&\r\n this.rafStamps.latestId !== this.rafStamps.invokeId;\r\n if (newFrame || !this.rafStamps.invokeId)\r\n this.rafStamps.invokeId = this.rafStamps.latestId;\r\n if (!this.pendingCanvasMutations.has(target)) {\r\n this.pendingCanvasMutations.set(target, []);\r\n }\r\n this.pendingCanvasMutations.get(target).push(mutation);\r\n };\r\n const { sampling = 'all', win, blockClass, blockSelector, recordCanvas, dataURLOptions, } = options;\r\n this.mutationCb = options.mutationCb;\r\n this.mirror = options.mirror;\r\n if (recordCanvas && sampling === 'all')\r\n this.initCanvasMutationObserver(win, blockClass, blockSelector);\r\n if (recordCanvas && typeof sampling === 'number')\r\n this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, {\r\n dataURLOptions,\r\n });\r\n }\r\n initCanvasFPSObserver(fps, win, blockClass, blockSelector, options) {\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, true);\r\n const snapshotInProgressMap = new Map();\r\n const worker = new WorkerFactory();\r\n worker.onmessage = (e) => {\r\n const { id } = e.data;\r\n snapshotInProgressMap.set(id, false);\r\n if (!('base64' in e.data))\r\n return;\r\n const { base64, type, width, height } = e.data;\r\n this.mutationCb({\r\n id,\r\n type: CanvasContext['2D'],\r\n commands: [\r\n {\r\n property: 'clearRect',\r\n args: [0, 0, width, height],\r\n },\r\n {\r\n property: 'drawImage',\r\n args: [\r\n {\r\n rr_type: 'ImageBitmap',\r\n args: [\r\n {\r\n rr_type: 'Blob',\r\n data: [{ rr_type: 'ArrayBuffer', base64 }],\r\n type,\r\n },\r\n ],\r\n },\r\n 0,\r\n 0,\r\n ],\r\n },\r\n ],\r\n });\r\n };\r\n const timeBetweenSnapshots = 1000 / fps;\r\n let lastSnapshotTime = 0;\r\n let rafId;\r\n const getCanvas = () => {\r\n const matchedCanvas = [];\r\n win.document.querySelectorAll('canvas').forEach((canvas) => {\r\n if (!isBlocked(canvas, blockClass, blockSelector, true)) {\r\n matchedCanvas.push(canvas);\r\n }\r\n });\r\n return matchedCanvas;\r\n };\r\n const takeCanvasSnapshots = (timestamp) => {\r\n if (lastSnapshotTime &&\r\n timestamp - lastSnapshotTime < timeBetweenSnapshots) {\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n return;\r\n }\r\n lastSnapshotTime = timestamp;\r\n getCanvas()\r\n .forEach((canvas) => __awaiter(this, void 0, void 0, function* () {\r\n var _a;\r\n const id = this.mirror.getId(canvas);\r\n if (snapshotInProgressMap.get(id))\r\n return;\r\n if (canvas.width === 0 || canvas.height === 0)\r\n return;\r\n snapshotInProgressMap.set(id, true);\r\n if (['webgl', 'webgl2'].includes(canvas.__context)) {\r\n const context = canvas.getContext(canvas.__context);\r\n if (((_a = context === null || context === void 0 ? void 0 : context.getContextAttributes()) === null || _a === void 0 ? void 0 : _a.preserveDrawingBuffer) === false) {\r\n context.clear(context.COLOR_BUFFER_BIT);\r\n }\r\n }\r\n const bitmap = yield createImageBitmap(canvas);\r\n worker.postMessage({\r\n id,\r\n bitmap,\r\n width: canvas.width,\r\n height: canvas.height,\r\n dataURLOptions: options.dataURLOptions,\r\n }, [bitmap]);\r\n }));\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n };\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n cancelAnimationFrame(rafId);\r\n };\r\n }\r\n initCanvasMutationObserver(win, blockClass, blockSelector) {\r\n this.startRAFTimestamping();\r\n this.startPendingCanvasMutationFlusher();\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, false);\r\n const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector);\r\n const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, this.mirror);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n canvas2DReset();\r\n canvasWebGL1and2Reset();\r\n };\r\n }\r\n startPendingCanvasMutationFlusher() {\r\n requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n startRAFTimestamping() {\r\n const setLatestRAFTimestamp = (timestamp) => {\r\n this.rafStamps.latestId = timestamp;\r\n requestAnimationFrame(setLatestRAFTimestamp);\r\n };\r\n requestAnimationFrame(setLatestRAFTimestamp);\r\n }\r\n flushPendingCanvasMutations() {\r\n this.pendingCanvasMutations.forEach((values, canvas) => {\r\n const id = this.mirror.getId(canvas);\r\n this.flushPendingCanvasMutationFor(canvas, id);\r\n });\r\n requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n flushPendingCanvasMutationFor(canvas, id) {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const valuesWithType = this.pendingCanvasMutations.get(canvas);\r\n if (!valuesWithType || id === -1)\r\n return;\r\n const values = valuesWithType.map((value) => {\r\n const rest = __rest(value, [\"type\"]);\r\n return rest;\r\n });\r\n const { type } = valuesWithType[0];\r\n this.mutationCb({ id, type, commands: values });\r\n this.pendingCanvasMutations.delete(canvas);\r\n }\r\n}\n\nclass StylesheetManager {\r\n constructor(options) {\r\n this.trackedLinkElements = new WeakSet();\r\n this.styleMirror = new StyleSheetMirror();\r\n this.mutationCb = options.mutationCb;\r\n this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\r\n }\r\n attachLinkElement(linkEl, childSn) {\r\n if ('_cssText' in childSn.attributes)\r\n this.mutationCb({\r\n adds: [],\r\n removes: [],\r\n texts: [],\r\n attributes: [\r\n {\r\n id: childSn.id,\r\n attributes: childSn\r\n .attributes,\r\n },\r\n ],\r\n });\r\n this.trackLinkElement(linkEl);\r\n }\r\n trackLinkElement(linkEl) {\r\n if (this.trackedLinkElements.has(linkEl))\r\n return;\r\n this.trackedLinkElements.add(linkEl);\r\n this.trackStylesheetInLinkElement(linkEl);\r\n }\r\n adoptStyleSheets(sheets, hostId) {\r\n if (sheets.length === 0)\r\n return;\r\n const adoptedStyleSheetData = {\r\n id: hostId,\r\n styleIds: [],\r\n };\r\n const styles = [];\r\n for (const sheet of sheets) {\r\n let styleId;\r\n if (!this.styleMirror.has(sheet)) {\r\n styleId = this.styleMirror.add(sheet);\r\n styles.push({\r\n styleId,\r\n rules: Array.from(sheet.rules || CSSRule, (r, index) => ({\r\n rule: stringifyRule(r),\r\n index,\r\n })),\r\n });\r\n }\r\n else\r\n styleId = this.styleMirror.getId(sheet);\r\n adoptedStyleSheetData.styleIds.push(styleId);\r\n }\r\n if (styles.length > 0)\r\n adoptedStyleSheetData.styles = styles;\r\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\r\n }\r\n reset() {\r\n this.styleMirror.reset();\r\n this.trackedLinkElements = new WeakSet();\r\n }\r\n trackStylesheetInLinkElement(linkEl) {\r\n }\r\n}\n\nclass ProcessedNodeManager {\r\n constructor() {\r\n this.nodeMap = new WeakMap();\r\n this.loop = true;\r\n this.periodicallyClear();\r\n }\r\n periodicallyClear() {\r\n requestAnimationFrame(() => {\r\n this.clear();\r\n if (this.loop)\r\n this.periodicallyClear();\r\n });\r\n }\r\n inOtherBuffer(node, thisBuffer) {\r\n const buffers = this.nodeMap.get(node);\r\n return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer));\r\n }\r\n add(node, buffer) {\r\n this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\r\n }\r\n clear() {\r\n this.nodeMap = new WeakMap();\r\n }\r\n destroy() {\r\n this.loop = false;\r\n }\r\n}\n\nfunction wrapEvent(e) {\r\n return Object.assign(Object.assign({}, e), { timestamp: nowTimestamp() });\r\n}\r\nlet wrappedEmit;\r\nlet takeFullSnapshot;\r\nlet canvasManager;\r\nlet recording = false;\r\nconst mirror = createMirror();\r\nfunction record(options = {}) {\r\n const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordDOM = true, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'\r\n ? options.recordAfter\r\n : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, } = options;\r\n registerErrorHandler(errorHandler);\r\n const inEmittingFrame = recordCrossOriginIframes\r\n ? window.parent === window\r\n : true;\r\n let passEmitsToParent = false;\r\n if (!inEmittingFrame) {\r\n try {\r\n if (window.parent.document) {\r\n passEmitsToParent = false;\r\n }\r\n }\r\n catch (e) {\r\n passEmitsToParent = true;\r\n }\r\n }\r\n if (inEmittingFrame && !emit) {\r\n throw new Error('emit function is required');\r\n }\r\n if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\r\n sampling.mousemove = mousemoveWait;\r\n }\r\n mirror.reset();\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n password: true,\r\n }\r\n : _maskInputOptions !== undefined\r\n ? _maskInputOptions\r\n : { password: true };\r\n const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\r\n ? {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaVerification: true,\r\n headMetaAuthorship: _slimDOMOptions === 'all',\r\n headMetaDescKeywords: _slimDOMOptions === 'all',\r\n }\r\n : _slimDOMOptions\r\n ? _slimDOMOptions\r\n : {};\r\n polyfill();\r\n let lastFullSnapshotEvent;\r\n let incrementalSnapshotCount = 0;\r\n const eventProcessor = (e) => {\r\n for (const plugin of plugins || []) {\r\n if (plugin.eventProcessor) {\r\n e = plugin.eventProcessor(e);\r\n }\r\n }\r\n if (packFn &&\r\n !passEmitsToParent) {\r\n e = packFn(e);\r\n }\r\n return e;\r\n };\r\n wrappedEmit = (e, isCheckout) => {\r\n var _a;\r\n if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&\r\n e.type !== EventType$1.FullSnapshot &&\r\n !(e.type === EventType$1.IncrementalSnapshot &&\r\n e.data.source === IncrementalSource$1.Mutation)) {\r\n mutationBuffers.forEach((buf) => buf.unfreeze());\r\n }\r\n if (inEmittingFrame) {\r\n emit === null || emit === void 0 ? void 0 : emit(eventProcessor(e), isCheckout);\r\n }\r\n else if (passEmitsToParent) {\r\n const message = {\r\n type: 'rrweb',\r\n event: eventProcessor(e),\r\n origin: window.location.origin,\r\n isCheckout,\r\n };\r\n window.parent.postMessage(message, '*');\r\n }\r\n if (e.type === EventType$1.FullSnapshot) {\r\n lastFullSnapshotEvent = e;\r\n incrementalSnapshotCount = 0;\r\n }\r\n else if (e.type === EventType$1.IncrementalSnapshot) {\r\n if (e.data.source === IncrementalSource$1.Mutation &&\r\n e.data.isAttachIframe) {\r\n return;\r\n }\r\n incrementalSnapshotCount++;\r\n const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\r\n const exceedTime = checkoutEveryNms &&\r\n e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\r\n if (exceedCount || exceedTime) {\r\n takeFullSnapshot(true);\r\n }\r\n }\r\n };\r\n const wrappedMutationEmit = (m) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.Mutation }, m),\r\n }));\r\n };\r\n const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.Scroll }, p),\r\n }));\r\n const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.CanvasMutation }, p),\r\n }));\r\n const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.AdoptedStyleSheet }, a),\r\n }));\r\n const stylesheetManager = new StylesheetManager({\r\n mutationCb: wrappedMutationEmit,\r\n adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit,\r\n });\r\n const iframeManager = new IframeManager({\r\n mirror,\r\n mutationCb: wrappedMutationEmit,\r\n stylesheetManager: stylesheetManager,\r\n recordCrossOriginIframes,\r\n wrappedEmit,\r\n });\r\n for (const plugin of plugins || []) {\r\n if (plugin.getMirror)\r\n plugin.getMirror({\r\n nodeMirror: mirror,\r\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\r\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror,\r\n });\r\n }\r\n const processedNodeManager = new ProcessedNodeManager();\r\n canvasManager = new CanvasManager({\r\n recordCanvas,\r\n mutationCb: wrappedCanvasMutationEmit,\r\n win: window,\r\n blockClass,\r\n blockSelector,\r\n mirror,\r\n sampling: sampling.canvas,\r\n dataURLOptions,\r\n });\r\n const shadowDomManager = new ShadowDomManager({\r\n mutationCb: wrappedMutationEmit,\r\n scrollCb: wrappedScrollEmit,\r\n bypassOptions: {\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n dataURLOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n recordCanvas,\r\n inlineImages,\r\n sampling,\r\n slimDOMOptions,\r\n iframeManager,\r\n stylesheetManager,\r\n canvasManager,\r\n keepIframeSrcFn,\r\n processedNodeManager,\r\n },\r\n mirror,\r\n });\r\n takeFullSnapshot = (isCheckout = false) => {\r\n if (!recordDOM) {\r\n return;\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.Meta,\r\n data: {\r\n href: window.location.href,\r\n width: getWindowWidth(),\r\n height: getWindowHeight(),\r\n },\r\n }), isCheckout);\r\n stylesheetManager.reset();\r\n shadowDomManager.init();\r\n mutationBuffers.forEach((buf) => buf.lock());\r\n const node = snapshot(document, {\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n inlineStylesheet,\r\n maskAllInputs: maskInputOptions,\r\n maskTextFn,\r\n slimDOM: slimDOMOptions,\r\n dataURLOptions,\r\n recordCanvas,\r\n inlineImages,\r\n onSerialize: (n) => {\r\n if (isSerializedIframe(n, mirror)) {\r\n iframeManager.addIframe(n);\r\n }\r\n if (isSerializedStylesheet(n, mirror)) {\r\n stylesheetManager.trackLinkElement(n);\r\n }\r\n if (hasShadowRoot(n)) {\r\n shadowDomManager.addShadowRoot(n.shadowRoot, document);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n iframeManager.attachIframe(iframe, childSn);\r\n shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (linkEl, childSn) => {\r\n stylesheetManager.attachLinkElement(linkEl, childSn);\r\n },\r\n keepIframeSrcFn,\r\n });\r\n if (!node) {\r\n return console.warn('Failed to snapshot the document');\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.FullSnapshot,\r\n data: {\r\n node,\r\n initialOffset: getWindowScroll(window),\r\n },\r\n }), isCheckout);\r\n mutationBuffers.forEach((buf) => buf.unlock());\r\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\r\n stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\r\n };\r\n try {\r\n const handlers = [];\r\n const observe = (doc) => {\r\n var _a;\r\n return callbackWrapper(initObservers)({\r\n mutationCb: wrappedMutationEmit,\r\n mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: {\r\n source,\r\n positions,\r\n },\r\n })),\r\n mouseInteractionCb: (d) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.MouseInteraction }, d),\r\n })),\r\n scrollCb: wrappedScrollEmit,\r\n viewportResizeCb: (d) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.ViewportResize }, d),\r\n })),\r\n inputCb: (v) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.Input }, v),\r\n })),\r\n mediaInteractionCb: (p) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.MediaInteraction }, p),\r\n })),\r\n styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.StyleSheetRule }, r),\r\n })),\r\n styleDeclarationCb: (r) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.StyleDeclaration }, r),\r\n })),\r\n canvasMutationCb: wrappedCanvasMutationEmit,\r\n fontCb: (p) => wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.Font }, p),\r\n })),\r\n selectionCb: (p) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.Selection }, p),\r\n }));\r\n },\r\n customElementCb: (c) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource$1.CustomElement }, c),\r\n }));\r\n },\r\n blockClass,\r\n ignoreClass,\r\n ignoreSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n maskInputOptions,\r\n inlineStylesheet,\r\n sampling,\r\n recordDOM,\r\n recordCanvas,\r\n inlineImages,\r\n userTriggeredOnInput,\r\n collectFonts,\r\n doc,\r\n maskInputFn,\r\n maskTextFn,\r\n keepIframeSrcFn,\r\n blockSelector,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n mirror,\r\n iframeManager,\r\n stylesheetManager,\r\n shadowDomManager,\r\n processedNodeManager,\r\n canvasManager,\r\n ignoreCSSAttributes,\r\n plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({\r\n observer: p.observer,\r\n options: p.options,\r\n callback: (payload) => wrappedEmit(wrapEvent({\r\n type: EventType$1.Plugin,\r\n data: {\r\n plugin: p.name,\r\n payload,\r\n },\r\n })),\r\n }))) || [],\r\n }, hooks);\r\n };\r\n iframeManager.addLoadListener((iframeEl) => {\r\n try {\r\n handlers.push(observe(iframeEl.contentDocument));\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n });\r\n const init = () => {\r\n takeFullSnapshot();\r\n handlers.push(observe(document));\r\n recording = true;\r\n };\r\n if (document.readyState === 'interactive' ||\r\n document.readyState === 'complete') {\r\n init();\r\n }\r\n else {\r\n handlers.push(on('DOMContentLoaded', () => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.DomContentLoaded,\r\n data: {},\r\n }));\r\n if (recordAfter === 'DOMContentLoaded')\r\n init();\r\n }));\r\n handlers.push(on('load', () => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.Load,\r\n data: {},\r\n }));\r\n if (recordAfter === 'load')\r\n init();\r\n }, window));\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n processedNodeManager.destroy();\r\n recording = false;\r\n unregisterErrorHandler();\r\n };\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n}\r\nrecord.addCustomEvent = (tag, payload) => {\r\n if (!recording) {\r\n throw new Error('please add custom event after start recording');\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType$1.Custom,\r\n data: {\r\n tag,\r\n payload,\r\n },\r\n }));\r\n};\r\nrecord.freezePage = () => {\r\n mutationBuffers.forEach((buf) => buf.freeze());\r\n};\r\nrecord.takeFullSnapshot = (isCheckout) => {\r\n if (!recording) {\r\n throw new Error('please take full snapshot after start recording');\r\n }\r\n takeFullSnapshot(isCheckout);\r\n};\r\nrecord.mirror = mirror;\n\nvar EventType = /* @__PURE__ */ ((EventType2) => {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n})(IncrementalSource || {});\n\nvar Config = {\n DEBUG: false,\n LIB_VERSION: '2.55.1'\n};\n\n/* eslint camelcase: \"off\", eqeqeq: \"off\" */\n\n// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file\nvar win;\nif (typeof(window) === 'undefined') {\n var loc = {\n hostname: ''\n };\n win = {\n navigator: { userAgent: '', onLine: true },\n document: {\n location: loc,\n referrer: ''\n },\n screen: { width: 0, height: 0 },\n location: loc\n };\n} else {\n win = window;\n}\n\n// Maximum allowed session recording length\nvar MAX_RECORDING_MS = 24 * 60 * 60 * 1000; // 24 hours\n// Maximum allowed value for minimum session recording length\nvar MAX_VALUE_FOR_MIN_RECORDING_MS = 8 * 1000; // 8 seconds\n\n/*\n * Saved references to long variable names, so that closure compiler can\n * minimize file size.\n */\n\nvar ArrayProto = Array.prototype,\n FuncProto = Function.prototype,\n ObjProto = Object.prototype,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty,\n windowConsole = win.console,\n navigator = win.navigator,\n document$1 = win.document,\n windowOpera = win.opera,\n screen = win.screen,\n userAgent = navigator.userAgent;\n\nvar nativeBind = FuncProto.bind,\n nativeForEach = ArrayProto.forEach,\n nativeIndexOf = ArrayProto.indexOf,\n nativeMap = ArrayProto.map,\n nativeIsArray = Array.isArray,\n breaker = {};\n\nvar _ = {\n trim: function(str) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n};\n\n// Console override\nvar console$1 = {\n /** @type {function(...*)} */\n log: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n try {\n windowConsole.log.apply(windowConsole, arguments);\n } catch (err) {\n _.each(arguments, function(arg) {\n windowConsole.log(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n warn: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel warning:'].concat(_.toArray(arguments));\n try {\n windowConsole.warn.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.warn(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n error: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n critical: function() {\n if (!_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n }\n};\n\nvar log_func_with_prefix = function(func, prefix) {\n return function() {\n arguments[0] = '[' + prefix + '] ' + arguments[0];\n return func.apply(console$1, arguments);\n };\n};\nvar console_with_prefix = function(prefix) {\n return {\n log: log_func_with_prefix(console$1.log, prefix),\n error: log_func_with_prefix(console$1.error, prefix),\n critical: log_func_with_prefix(console$1.critical, prefix)\n };\n};\n\n\n// UNDERSCORE\n// Embed part of the Underscore Library\n_.bind = function(func, context) {\n var args, bound;\n if (nativeBind && func.bind === nativeBind) {\n return nativeBind.apply(func, slice.call(arguments, 1));\n }\n if (!_.isFunction(func)) {\n throw new TypeError();\n }\n args = slice.call(arguments, 2);\n bound = function() {\n if (!(this instanceof bound)) {\n return func.apply(context, args.concat(slice.call(arguments)));\n }\n var ctor = {};\n ctor.prototype = func.prototype;\n var self = new ctor();\n ctor.prototype = null;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) {\n return result;\n }\n return self;\n };\n return bound;\n};\n\n/**\n * @param {*=} obj\n * @param {function(...*)=} iterator\n * @param {Object=} context\n */\n_.each = function(obj, iterator, context) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) {\n return;\n }\n }\n } else {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) {\n return;\n }\n }\n }\n }\n};\n\n_.extend = function(obj) {\n _.each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n if (source[prop] !== void 0) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n};\n\n_.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n};\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// var bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\n_.isFunction = function(f) {\n try {\n return /^\\s*\\bfunction\\b/.test(f);\n } catch (x) {\n return false;\n }\n};\n\n_.isArguments = function(obj) {\n return !!(obj && hasOwnProperty.call(obj, 'callee'));\n};\n\n_.toArray = function(iterable) {\n if (!iterable) {\n return [];\n }\n if (iterable.toArray) {\n return iterable.toArray();\n }\n if (_.isArray(iterable)) {\n return slice.call(iterable);\n }\n if (_.isArguments(iterable)) {\n return slice.call(iterable);\n }\n return _.values(iterable);\n};\n\n_.map = function(arr, callback, context) {\n if (nativeMap && arr.map === nativeMap) {\n return arr.map(callback, context);\n } else {\n var results = [];\n _.each(arr, function(item) {\n results.push(callback.call(context, item));\n });\n return results;\n }\n};\n\n_.keys = function(obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function(value, key) {\n results[results.length] = key;\n });\n return results;\n};\n\n_.values = function(obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function(value) {\n results[results.length] = value;\n });\n return results;\n};\n\n_.include = function(obj, target) {\n var found = false;\n if (obj === null) {\n return found;\n }\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) {\n return obj.indexOf(target) != -1;\n }\n _.each(obj, function(value) {\n if (found || (found = (value === target))) {\n return breaker;\n }\n });\n return found;\n};\n\n_.includes = function(str, needle) {\n return str.indexOf(needle) !== -1;\n};\n\n// Underscore Addons\n_.inherit = function(subclass, superclass) {\n subclass.prototype = new superclass();\n subclass.prototype.constructor = subclass;\n subclass.superclass = superclass.prototype;\n return subclass;\n};\n\n_.isObject = function(obj) {\n return (obj === Object(obj) && !_.isArray(obj));\n};\n\n_.isEmptyObject = function(obj) {\n if (_.isObject(obj)) {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\n\n_.isUndefined = function(obj) {\n return obj === void 0;\n};\n\n_.isString = function(obj) {\n return toString.call(obj) == '[object String]';\n};\n\n_.isDate = function(obj) {\n return toString.call(obj) == '[object Date]';\n};\n\n_.isNumber = function(obj) {\n return toString.call(obj) == '[object Number]';\n};\n\n_.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n};\n\n_.encodeDates = function(obj) {\n _.each(obj, function(v, k) {\n if (_.isDate(v)) {\n obj[k] = _.formatDate(v);\n } else if (_.isObject(v)) {\n obj[k] = _.encodeDates(v); // recurse\n }\n });\n return obj;\n};\n\n_.timestamp = function() {\n Date.now = Date.now || function() {\n return +new Date;\n };\n return Date.now();\n};\n\n_.formatDate = function(d) {\n // YYYY-MM-DDTHH:MM:SS in UTC\n function pad(n) {\n return n < 10 ? '0' + n : n;\n }\n return d.getUTCFullYear() + '-' +\n pad(d.getUTCMonth() + 1) + '-' +\n pad(d.getUTCDate()) + 'T' +\n pad(d.getUTCHours()) + ':' +\n pad(d.getUTCMinutes()) + ':' +\n pad(d.getUTCSeconds());\n};\n\n_.strip_empty_properties = function(p) {\n var ret = {};\n _.each(p, function(v, k) {\n if (_.isString(v) && v.length > 0) {\n ret[k] = v;\n }\n });\n return ret;\n};\n\n/*\n * this function returns a copy of object after truncating it. If\n * passed an Array or Object it will iterate through obj and\n * truncate all the values recursively.\n */\n_.truncate = function(obj, length) {\n var ret;\n\n if (typeof(obj) === 'string') {\n ret = obj.slice(0, length);\n } else if (_.isArray(obj)) {\n ret = [];\n _.each(obj, function(val) {\n ret.push(_.truncate(val, length));\n });\n } else if (_.isObject(obj)) {\n ret = {};\n _.each(obj, function(val, key) {\n ret[key] = _.truncate(val, length);\n });\n } else {\n ret = obj;\n }\n\n return ret;\n};\n\n_.JSONEncode = (function() {\n return function(mixed_val) {\n var value = mixed_val;\n var quote = function(string) {\n var escapable = /[\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g; // eslint-disable-line no-control-regex\n var meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n };\n\n escapable.lastIndex = 0;\n return escapable.test(string) ?\n '\"' + string.replace(escapable, function(a) {\n var c = meta[a];\n return typeof c === 'string' ? c :\n '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' :\n '\"' + string + '\"';\n };\n\n var str = function(key, holder) {\n var gap = '';\n var indent = ' ';\n var i = 0; // The loop counter.\n var k = ''; // The member key.\n var v = ''; // The member value.\n var length = 0;\n var mind = gap;\n var partial = [];\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n // What happens next depends on the value's type.\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce 'null'. The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n case 'object':\n // If the type is 'object', we might be dealing with an object or an array or\n // null.\n // Due to a specification blunder in ECMAScript, typeof null is 'object',\n // so watch out for that case.\n if (!value) {\n return 'null';\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n gap += indent;\n partial = [];\n\n // Is the value an array?\n if (toString.apply(value) === '[object Array]') {\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n v = partial.length === 0 ? '[]' :\n gap ? '[\\n' + gap +\n partial.join(',\\n' + gap) + '\\n' +\n mind + ']' :\n '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n // Iterate through all of the keys in the object.\n for (k in value) {\n if (hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n v = partial.length === 0 ? '{}' :\n gap ? '{' + partial.join(',') + '' +\n mind + '}' : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n };\n\n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {\n '': value\n });\n };\n})();\n\n/**\n * From https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js\n * Slightly modified to throw a real Error rather than a POJO\n */\n_.JSONDecode = (function() {\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n 'b': '\\b',\n 'f': '\\f',\n 'n': '\\n',\n 'r': '\\r',\n 't': '\\t'\n },\n text,\n error = function(m) {\n var e = new SyntaxError(m);\n e.at = at;\n e.text = text;\n throw e;\n },\n next = function(c) {\n // If a c parameter is provided, verify that it matches the current character.\n if (c && c !== ch) {\n error('Expected \\'' + c + '\\' instead of \\'' + ch + '\\'');\n }\n // Get the next character. When there are no more characters,\n // return the empty string.\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function() {\n // Parse a number value.\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n return number;\n }\n },\n\n string = function() {\n // Parse a string value.\n var hex,\n i,\n string = '',\n uffff;\n // When parsing for string values, we must look for \" and \\ characters.\n if (ch === '\"') {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n }\n if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n error('Bad string');\n },\n white = function() {\n // Skip whitespace.\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function() {\n // true, false, or null.\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error('Unexpected \"' + ch + '\"');\n },\n value, // Placeholder for the value function.\n array = function() {\n // Parse an array value.\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function() {\n // Parse an object value.\n var key,\n object = {};\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function() {\n // Parse a JSON value. It could be an object, an array, a string,\n // a number, or a word.\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the\n // above functions and variables.\n return function(source) {\n var result;\n\n text = source;\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n return result;\n };\n})();\n\n_.base64Encode = function(data) {\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n data = _.utf8Encode(data);\n\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n switch (data.length % 3) {\n case 1:\n enc = enc.slice(0, -2) + '==';\n break;\n case 2:\n enc = enc.slice(0, -1) + '=';\n break;\n }\n\n return enc;\n};\n\n_.utf8Encode = function(string) {\n string = (string + '').replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\n var utftext = '',\n start,\n end;\n var stringl = 0,\n n;\n\n start = end = 0;\n stringl = string.length;\n\n for (n = 0; n < stringl; n++) {\n var c1 = string.charCodeAt(n);\n var enc = null;\n\n if (c1 < 128) {\n end++;\n } else if ((c1 > 127) && (c1 < 2048)) {\n enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);\n } else {\n enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);\n }\n if (enc !== null) {\n if (end > start) {\n utftext += string.substring(start, end);\n }\n utftext += enc;\n start = end = n + 1;\n }\n }\n\n if (end > start) {\n utftext += string.substring(start, string.length);\n }\n\n return utftext;\n};\n\n_.UUID = (function() {\n\n // Time-based entropy\n var T = function() {\n var time = 1 * new Date(); // cross-browser version of Date.now()\n var ticks;\n if (win.performance && win.performance.now) {\n ticks = win.performance.now();\n } else {\n // fall back to busy loop\n ticks = 0;\n\n // this while loop figures how many browser ticks go by\n // before 1*new Date() returns a new number, ie the amount\n // of ticks that go by per millisecond\n while (time == 1 * new Date()) {\n ticks++;\n }\n }\n return time.toString(16) + Math.floor(ticks).toString(16);\n };\n\n // Math.Random entropy\n var R = function() {\n return Math.random().toString(16).replace('.', '');\n };\n\n // User agent entropy\n // This function takes the user agent string, and then xors\n // together each sequence of 8 bytes. This produces a final\n // sequence of 8 bytes which it returns as hex.\n var UA = function() {\n var ua = userAgent,\n i, ch, buffer = [],\n ret = 0;\n\n function xor(result, byte_array) {\n var j, tmp = 0;\n for (j = 0; j < byte_array.length; j++) {\n tmp |= (buffer[j] << j * 8);\n }\n return result ^ tmp;\n }\n\n for (i = 0; i < ua.length; i++) {\n ch = ua.charCodeAt(i);\n buffer.unshift(ch & 0xFF);\n if (buffer.length >= 4) {\n ret = xor(ret, buffer);\n buffer = [];\n }\n }\n\n if (buffer.length > 0) {\n ret = xor(ret, buffer);\n }\n\n return ret.toString(16);\n };\n\n return function() {\n var se = (screen.height * screen.width).toString(16);\n return (T() + '-' + R() + '-' + UA() + '-' + se + '-' + T());\n };\n})();\n\n// _.isBlockedUA()\n// This is to block various web spiders from executing our JS and\n// sending false tracking data\nvar BLOCKED_UA_STRS = [\n 'ahrefsbot',\n 'ahrefssiteaudit',\n 'baiduspider',\n 'bingbot',\n 'bingpreview',\n 'chrome-lighthouse',\n 'facebookexternal',\n 'petalbot',\n 'pinterest',\n 'screaming frog',\n 'yahoo! slurp',\n 'yandexbot',\n\n // a whole bunch of goog-specific crawlers\n // https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers\n 'adsbot-google',\n 'apis-google',\n 'duplexweb-google',\n 'feedfetcher-google',\n 'google favicon',\n 'google web preview',\n 'google-read-aloud',\n 'googlebot',\n 'googleweblight',\n 'mediapartners-google',\n 'storebot-google'\n];\n_.isBlockedUA = function(ua) {\n var i;\n ua = ua.toLowerCase();\n for (i = 0; i < BLOCKED_UA_STRS.length; i++) {\n if (ua.indexOf(BLOCKED_UA_STRS[i]) !== -1) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * @param {Object=} formdata\n * @param {string=} arg_separator\n */\n_.HTTPBuildQuery = function(formdata, arg_separator) {\n var use_val, use_key, tmp_arr = [];\n\n if (_.isUndefined(arg_separator)) {\n arg_separator = '&';\n }\n\n _.each(formdata, function(val, key) {\n use_val = encodeURIComponent(val.toString());\n use_key = encodeURIComponent(key);\n tmp_arr[tmp_arr.length] = use_key + '=' + use_val;\n });\n\n return tmp_arr.join(arg_separator);\n};\n\n_.getQueryParam = function(url, param) {\n // Expects a raw URL\n\n param = param.replace(/[[]/g, '\\\\[').replace(/[\\]]/g, '\\\\]');\n var regexS = '[\\\\?&]' + param + '=([^&#]*)',\n regex = new RegExp(regexS),\n results = regex.exec(url);\n if (results === null || (results && typeof(results[1]) !== 'string' && results[1].length)) {\n return '';\n } else {\n var result = results[1];\n try {\n result = decodeURIComponent(result);\n } catch(err) {\n console$1.error('Skipping decoding for malformed query param: ' + result);\n }\n return result.replace(/\\+/g, ' ');\n }\n};\n\n\n// _.cookie\n// Methods partially borrowed from quirksmode.org/js/cookies.html\n_.cookie = {\n get: function(name) {\n var nameEQ = name + '=';\n var ca = document$1.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n }\n return null;\n },\n\n parse: function(name) {\n var cookie;\n try {\n cookie = _.JSONDecode(_.cookie.get(name)) || {};\n } catch (err) {\n // noop\n }\n return cookie;\n },\n\n set_seconds: function(name, value, seconds, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '',\n expires = '',\n secure = '';\n\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n\n if (seconds) {\n var date = new Date();\n date.setTime(date.getTime() + (seconds * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n\n document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n },\n\n set: function(name, value, days, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '', expires = '', secure = '';\n\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n\n var new_cookie_val = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n document$1.cookie = new_cookie_val;\n return new_cookie_val;\n },\n\n remove: function(name, is_cross_subdomain, domain_override) {\n _.cookie.set(name, '', -1, is_cross_subdomain, false, false, domain_override);\n }\n};\n\nvar _localStorageSupported = null;\nvar localStorageSupported = function(storage, forceCheck) {\n if (_localStorageSupported !== null && !forceCheck) {\n return _localStorageSupported;\n }\n\n var supported = true;\n try {\n storage = storage || window.localStorage;\n var key = '__mplss_' + cheap_guid(8),\n val = 'xyz';\n storage.setItem(key, val);\n if (storage.getItem(key) !== val) {\n supported = false;\n }\n storage.removeItem(key);\n } catch (err) {\n supported = false;\n }\n\n _localStorageSupported = supported;\n return supported;\n};\n\n// _.localStorage\n_.localStorage = {\n is_supported: function(force_check) {\n var supported = localStorageSupported(null, force_check);\n if (!supported) {\n console$1.error('localStorage unsupported; falling back to cookie store');\n }\n return supported;\n },\n\n error: function(msg) {\n console$1.error('localStorage error: ' + msg);\n },\n\n get: function(name) {\n try {\n return window.localStorage.getItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n return null;\n },\n\n parse: function(name) {\n try {\n return _.JSONDecode(_.localStorage.get(name)) || {};\n } catch (err) {\n // noop\n }\n return null;\n },\n\n set: function(name, value) {\n try {\n window.localStorage.setItem(name, value);\n } catch (err) {\n _.localStorage.error(err);\n }\n },\n\n remove: function(name) {\n try {\n window.localStorage.removeItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n }\n};\n\n_.register_event = (function() {\n // written by Dean Edwards, 2005\n // with input from Tino Zijdel - crisp@xs4all.nl\n // with input from Carl Sverre - mail@carlsverre.com\n // with input from Mixpanel\n // http://dean.edwards.name/weblog/2005/10/add-event/\n // https://gist.github.com/1930440\n\n /**\n * @param {Object} element\n * @param {string} type\n * @param {function(...*)} handler\n * @param {boolean=} oldSchool\n * @param {boolean=} useCapture\n */\n var register_event = function(element, type, handler, oldSchool, useCapture) {\n if (!element) {\n console$1.error('No valid element provided to register_event');\n return;\n }\n\n if (element.addEventListener && !oldSchool) {\n element.addEventListener(type, handler, !!useCapture);\n } else {\n var ontype = 'on' + type;\n var old_handler = element[ontype]; // can be undefined\n element[ontype] = makeHandler(element, handler, old_handler);\n }\n };\n\n function makeHandler(element, new_handler, old_handlers) {\n var handler = function(event) {\n event = event || fixEvent(window.event);\n\n // this basically happens in firefox whenever another script\n // overwrites the onload callback and doesn't pass the event\n // object to previously defined callbacks. All the browsers\n // that don't define window.event implement addEventListener\n // so the dom_loaded handler will still be fired as usual.\n if (!event) {\n return undefined;\n }\n\n var ret = true;\n var old_result, new_result;\n\n if (_.isFunction(old_handlers)) {\n old_result = old_handlers(event);\n }\n new_result = new_handler.call(element, event);\n\n if ((false === old_result) || (false === new_result)) {\n ret = false;\n }\n\n return ret;\n };\n\n return handler;\n }\n\n function fixEvent(event) {\n if (event) {\n event.preventDefault = fixEvent.preventDefault;\n event.stopPropagation = fixEvent.stopPropagation;\n }\n return event;\n }\n fixEvent.preventDefault = function() {\n this.returnValue = false;\n };\n fixEvent.stopPropagation = function() {\n this.cancelBubble = true;\n };\n\n return register_event;\n})();\n\n\nvar TOKEN_MATCH_REGEX = new RegExp('^(\\\\w*)\\\\[(\\\\w+)([=~\\\\|\\\\^\\\\$\\\\*]?)=?\"?([^\\\\]\"]*)\"?\\\\]$');\n\n_.dom_query = (function() {\n /* document.getElementsBySelector(selector)\n - returns an array of element objects from the current document\n matching the CSS selector. Selectors can contain element names,\n class names and ids and can be nested. For example:\n\n elements = document.getElementsBySelector('div#main p a.external')\n\n Will return an array of all 'a' elements with 'external' in their\n class attribute that are contained inside 'p' elements that are\n contained inside the 'div' element which has id=\"main\"\n\n New in version 0.4: Support for CSS2 and CSS3 attribute selectors:\n See http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\n Version 0.4 - Simon Willison, March 25th 2003\n -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows\n -- Opera 7 fails\n\n Version 0.5 - Carl Sverre, Jan 7th 2013\n -- Now uses jQuery-esque `hasClass` for testing class name\n equality. This fixes a bug related to '-' characters being\n considered not part of a 'word' in regex.\n */\n\n function getAllChildren(e) {\n // Returns all children of element. Workaround required for IE5/Windows. Ugh.\n return e.all ? e.all : e.getElementsByTagName('*');\n }\n\n var bad_whitespace = /[\\t\\r\\n]/g;\n\n function hasClass(elem, selector) {\n var className = ' ' + selector + ' ';\n return ((' ' + elem.className + ' ').replace(bad_whitespace, ' ').indexOf(className) >= 0);\n }\n\n function getElementsBySelector(selector) {\n // Attempt to fail gracefully in lesser browsers\n if (!document$1.getElementsByTagName) {\n return [];\n }\n // Split selector in to tokens\n var tokens = selector.split(' ');\n var token, bits, tagName, found, foundCount, i, j, k, elements, currentContextIndex;\n var currentContext = [document$1];\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i].replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (token.indexOf('#') > -1) {\n // Token is an ID selector\n bits = token.split('#');\n tagName = bits[0];\n var id = bits[1];\n var element = document$1.getElementById(id);\n if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) {\n // element not found or tag with that ID not found, return false\n return [];\n }\n // Set currentContext to contain just this element\n currentContext = [element];\n continue; // Skip to next token\n }\n if (token.indexOf('.') > -1) {\n // Token contains a class selector\n bits = token.split('.');\n tagName = bits[0];\n var className = bits[1];\n if (!tagName) {\n tagName = '*';\n }\n // Get elements matching tag, filter them for class selector\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (found[j].className &&\n _.isString(found[j].className) && // some SVG elements have classNames which are not strings\n hasClass(found[j], className)\n ) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n continue; // Skip to next token\n }\n // Code to deal with attribute selectors\n var token_match = token.match(TOKEN_MATCH_REGEX);\n if (token_match) {\n tagName = token_match[1];\n var attrName = token_match[2];\n var attrOperator = token_match[3];\n var attrValue = token_match[4];\n if (!tagName) {\n tagName = '*';\n }\n // Grab all of the tagName elements within current context\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n var checkFunction; // This function will be used to filter the elements\n switch (attrOperator) {\n case '=': // Equality\n checkFunction = function(e) {\n return (e.getAttribute(attrName) == attrValue);\n };\n break;\n case '~': // Match one of space seperated words\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('\\\\b' + attrValue + '\\\\b')));\n };\n break;\n case '|': // Match start with value followed by optional hyphen\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('^' + attrValue + '-?')));\n };\n break;\n case '^': // Match starts with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) === 0);\n };\n break;\n case '$': // Match ends with value - fails with \"Warning\" in Opera 7\n checkFunction = function(e) {\n return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length);\n };\n break;\n case '*': // Match ends with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) > -1);\n };\n break;\n default:\n // Just test for existence of attribute\n checkFunction = function(e) {\n return e.getAttribute(attrName);\n };\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (checkFunction(found[j])) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);\n continue; // Skip to next token\n }\n // If we get here, token is JUST an element (not a class or ID selector)\n tagName = token;\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n elements = currentContext[j].getElementsByTagName(tagName);\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = found;\n }\n return currentContext;\n }\n\n return function(query) {\n if (_.isElement(query)) {\n return [query];\n } else if (_.isObject(query) && !_.isUndefined(query.length)) {\n return query;\n } else {\n return getElementsBySelector.call(this, query);\n }\n };\n})();\n\nvar CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'utm_id', 'utm_source_platform','utm_campaign_id', 'utm_creative_format', 'utm_marketing_tactic'];\nvar CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'sccid', 'ttclid', 'twclid', 'wbraid'];\n\n_.info = {\n campaignParams: function(default_value) {\n var kw = '',\n params = {};\n _.each(CAMPAIGN_KEYWORDS, function(kwkey) {\n kw = _.getQueryParam(document$1.URL, kwkey);\n if (kw.length) {\n params[kwkey] = kw;\n } else if (default_value !== undefined) {\n params[kwkey] = default_value;\n }\n });\n\n return params;\n },\n\n clickParams: function() {\n var id = '',\n params = {};\n _.each(CLICK_IDS, function(idkey) {\n id = _.getQueryParam(document$1.URL, idkey);\n if (id.length) {\n params[idkey] = id;\n }\n });\n\n return params;\n },\n\n marketingParams: function() {\n return _.extend(_.info.campaignParams(), _.info.clickParams());\n },\n\n searchEngine: function(referrer) {\n if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {\n return 'google';\n } else if (referrer.search('https?://(.*)bing.com') === 0) {\n return 'bing';\n } else if (referrer.search('https?://(.*)yahoo.com') === 0) {\n return 'yahoo';\n } else if (referrer.search('https?://(.*)duckduckgo.com') === 0) {\n return 'duckduckgo';\n } else {\n return null;\n }\n },\n\n searchInfo: function(referrer) {\n var search = _.info.searchEngine(referrer),\n param = (search != 'yahoo') ? 'q' : 'p',\n ret = {};\n\n if (search !== null) {\n ret['$search_engine'] = search;\n\n var keyword = _.getQueryParam(referrer, param);\n if (keyword.length) {\n ret['mp_keyword'] = keyword;\n }\n }\n\n return ret;\n },\n\n /**\n * This function detects which browser is running this script.\n * The order of the checks are important since many user agents\n * include key words used in later checks.\n */\n browser: function(user_agent, vendor, opera) {\n vendor = vendor || ''; // vendor is undefined for at least IE9\n if (opera || _.includes(user_agent, ' OPR/')) {\n if (_.includes(user_agent, 'Mini')) {\n return 'Opera Mini';\n }\n return 'Opera';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (_.includes(user_agent, 'IEMobile') || _.includes(user_agent, 'WPDesktop')) {\n return 'Internet Explorer Mobile';\n } else if (_.includes(user_agent, 'SamsungBrowser/')) {\n // https://developer.samsung.com/internet/user-agent-string-format\n return 'Samsung Internet';\n } else if (_.includes(user_agent, 'Edge') || _.includes(user_agent, 'Edg/')) {\n return 'Microsoft Edge';\n } else if (_.includes(user_agent, 'FBIOS')) {\n return 'Facebook Mobile';\n } else if (_.includes(user_agent, 'Chrome')) {\n return 'Chrome';\n } else if (_.includes(user_agent, 'CriOS')) {\n return 'Chrome iOS';\n } else if (_.includes(user_agent, 'UCWEB') || _.includes(user_agent, 'UCBrowser')) {\n return 'UC Browser';\n } else if (_.includes(user_agent, 'FxiOS')) {\n return 'Firefox iOS';\n } else if (_.includes(vendor, 'Apple')) {\n if (_.includes(user_agent, 'Mobile')) {\n return 'Mobile Safari';\n }\n return 'Safari';\n } else if (_.includes(user_agent, 'Android')) {\n return 'Android Mobile';\n } else if (_.includes(user_agent, 'Konqueror')) {\n return 'Konqueror';\n } else if (_.includes(user_agent, 'Firefox')) {\n return 'Firefox';\n } else if (_.includes(user_agent, 'MSIE') || _.includes(user_agent, 'Trident/')) {\n return 'Internet Explorer';\n } else if (_.includes(user_agent, 'Gecko')) {\n return 'Mozilla';\n } else {\n return '';\n }\n },\n\n /**\n * This function detects which browser version is running this script,\n * parsing major and minor version (e.g., 42.1). User agent strings from:\n * http://www.useragentstring.com/pages/useragentstring.php\n */\n browserVersion: function(userAgent, vendor, opera) {\n var browser = _.info.browser(userAgent, vendor, opera);\n var versionRegexs = {\n 'Internet Explorer Mobile': /rv:(\\d+(\\.\\d+)?)/,\n 'Microsoft Edge': /Edge?\\/(\\d+(\\.\\d+)?)/,\n 'Chrome': /Chrome\\/(\\d+(\\.\\d+)?)/,\n 'Chrome iOS': /CriOS\\/(\\d+(\\.\\d+)?)/,\n 'UC Browser' : /(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)/,\n 'Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Mobile Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Opera': /(Opera|OPR)\\/(\\d+(\\.\\d+)?)/,\n 'Firefox': /Firefox\\/(\\d+(\\.\\d+)?)/,\n 'Firefox iOS': /FxiOS\\/(\\d+(\\.\\d+)?)/,\n 'Konqueror': /Konqueror:(\\d+(\\.\\d+)?)/,\n 'BlackBerry': /BlackBerry (\\d+(\\.\\d+)?)/,\n 'Android Mobile': /android\\s(\\d+(\\.\\d+)?)/,\n 'Samsung Internet': /SamsungBrowser\\/(\\d+(\\.\\d+)?)/,\n 'Internet Explorer': /(rv:|MSIE )(\\d+(\\.\\d+)?)/,\n 'Mozilla': /rv:(\\d+(\\.\\d+)?)/\n };\n var regex = versionRegexs[browser];\n if (regex === undefined) {\n return null;\n }\n var matches = userAgent.match(regex);\n if (!matches) {\n return null;\n }\n return parseFloat(matches[matches.length - 2]);\n },\n\n os: function() {\n var a = userAgent;\n if (/Windows/i.test(a)) {\n if (/Phone/.test(a) || /WPDesktop/.test(a)) {\n return 'Windows Phone';\n }\n return 'Windows';\n } else if (/(iPhone|iPad|iPod)/.test(a)) {\n return 'iOS';\n } else if (/Android/.test(a)) {\n return 'Android';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) {\n return 'BlackBerry';\n } else if (/Mac/i.test(a)) {\n return 'Mac OS X';\n } else if (/Linux/.test(a)) {\n return 'Linux';\n } else if (/CrOS/.test(a)) {\n return 'Chrome OS';\n } else {\n return '';\n }\n },\n\n device: function(user_agent) {\n if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) {\n return 'Windows Phone';\n } else if (/iPad/.test(user_agent)) {\n return 'iPad';\n } else if (/iPod/.test(user_agent)) {\n return 'iPod Touch';\n } else if (/iPhone/.test(user_agent)) {\n return 'iPhone';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (/Android/.test(user_agent)) {\n return 'Android';\n } else {\n return '';\n }\n },\n\n referringDomain: function(referrer) {\n var split = referrer.split('/');\n if (split.length >= 3) {\n return split[2];\n }\n return '';\n },\n\n currentUrl: function() {\n return win.location.href;\n },\n\n properties: function(extra_props) {\n if (typeof extra_props !== 'object') {\n extra_props = {};\n }\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator.vendor, windowOpera),\n '$referrer': document$1.referrer,\n '$referring_domain': _.info.referringDomain(document$1.referrer),\n '$device': _.info.device(userAgent)\n }), {\n '$current_url': _.info.currentUrl(),\n '$browser_version': _.info.browserVersion(userAgent, navigator.vendor, windowOpera),\n '$screen_height': screen.height,\n '$screen_width': screen.width,\n 'mp_lib': 'web',\n '$lib_version': Config.LIB_VERSION,\n '$insert_id': cheap_guid(),\n 'time': _.timestamp() / 1000 // epoch time in seconds\n }, _.strip_empty_properties(extra_props));\n },\n\n people_properties: function() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator.vendor, windowOpera)\n }), {\n '$browser_version': _.info.browserVersion(userAgent, navigator.vendor, windowOpera)\n });\n },\n\n mpPageViewProperties: function() {\n return _.strip_empty_properties({\n 'current_page_title': document$1.title,\n 'current_domain': win.location.hostname,\n 'current_url_path': win.location.pathname,\n 'current_url_protocol': win.location.protocol,\n 'current_url_search': win.location.search\n });\n }\n};\n\nvar cheap_guid = function(maxlen) {\n var guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);\n return maxlen ? guid.substring(0, maxlen) : guid;\n};\n\n// naive way to extract domain name (example.com) from full hostname (my.sub.example.com)\nvar SIMPLE_DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]*\\.[a-z]+$/i;\n// this next one attempts to account for some ccSLDs, e.g. extracting oxford.ac.uk from www.oxford.ac.uk\nvar DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]+\\.[a-z.]{2,6}$/i;\n/**\n * Attempts to extract main domain name from full hostname, using a few blunt heuristics. For\n * common TLDs like .com/.org that always have a simple SLD.TLD structure (example.com), we\n * simply extract the last two .-separated parts of the hostname (SIMPLE_DOMAIN_MATCH_REGEX).\n * For others, we attempt to account for short ccSLD+TLD combos (.ac.uk) with the legacy\n * DOMAIN_MATCH_REGEX (kept to maintain backwards compatibility with existing Mixpanel\n * integrations). The only _reliable_ way to extract domain from hostname is with an up-to-date\n * list like at https://publicsuffix.org/ so for cases that this helper fails at, the SDK\n * offers the 'cookie_domain' config option to set it explicitly.\n * @example\n * extract_domain('my.sub.example.com')\n * // 'example.com'\n */\nvar extract_domain = function(hostname) {\n var domain_regex = DOMAIN_MATCH_REGEX;\n var parts = hostname.split('.');\n var tld = parts[parts.length - 1];\n if (tld.length > 4 || tld === 'com' || tld === 'org') {\n domain_regex = SIMPLE_DOMAIN_MATCH_REGEX;\n }\n var matches = hostname.match(domain_regex);\n return matches ? matches[0] : '';\n};\n\n/**\n * Check whether we have network connection. default to true for browsers that don't support navigator.onLine (IE)\n * @returns {boolean}\n */\nvar isOnline = function() {\n var onLine = win.navigator['onLine'];\n return _.isUndefined(onLine) || onLine;\n};\n\nvar JSONStringify = null, JSONParse = null;\nif (typeof JSON !== 'undefined') {\n JSONStringify = JSON.stringify;\n JSONParse = JSON.parse;\n}\nJSONStringify = JSONStringify || _.JSONEncode;\nJSONParse = JSONParse || _.JSONDecode;\n\n// EXPORTS (for closure compiler)\n_['toArray'] = _.toArray;\n_['isObject'] = _.isObject;\n_['JSONEncode'] = _.JSONEncode;\n_['JSONDecode'] = _.JSONDecode;\n_['isBlockedUA'] = _.isBlockedUA;\n_['isEmptyObject'] = _.isEmptyObject;\n_['info'] = _.info;\n_['info']['device'] = _.info.device;\n_['info']['browser'] = _.info.browser;\n_['info']['browserVersion'] = _.info.browserVersion;\n_['info']['properties'] = _.info.properties;\n\n/**\n * GDPR utils\n *\n * The General Data Protection Regulation (GDPR) is a regulation in EU law on data protection\n * and privacy for all individuals within the European Union. It addresses the export of personal\n * data outside the EU. The GDPR aims primarily to give control back to citizens and residents\n * over their personal data and to simplify the regulatory environment for international business\n * by unifying the regulation within the EU.\n *\n * This set of utilities is intended to enable opt in/out functionality in the Mixpanel JS SDK.\n * These functions are used internally by the SDK and are not intended to be publicly exposed.\n */\n\n/**\n * A function used to track a Mixpanel event (e.g. MixpanelLib.track)\n * @callback trackFunction\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n */\n\n/** Public **/\n\nvar GDPR_DEFAULT_PERSISTENCE_PREFIX = '__mp_opt_in_out_';\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction optIn(token, options) {\n _optInOut(true, token, options);\n}\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-out cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-out cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-out cookie is set as secure or not\n */\nfunction optOut(token, options) {\n _optInOut(false, token, options);\n}\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} whether the user has opted in to the given opt type\n */\nfunction hasOptedIn(token, options) {\n return _getStorageValue(token, options) === '1';\n}\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the user has opted out of the given opt type\n */\nfunction hasOptedOut(token, options) {\n if (_hasDoNotTrackFlagOn(options)) {\n console$1.warn('This browser has \"Do Not Track\" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the \"Do Not Track\" browser setting, initialize the Mixpanel instance with the config \"ignore_dnt: true\"');\n return true;\n }\n var optedOut = _getStorageValue(token, options) === '0';\n if (optedOut) {\n console$1.warn('You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.');\n }\n return optedOut;\n}\n\n/**\n * Wrap a MixpanelLib method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelLib(method) {\n return _addOptOutCheck(method, function(name) {\n return this.get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelPeople method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelPeople(method) {\n return _addOptOutCheck(method, function(name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelGroup method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelGroup(method) {\n return _addOptOutCheck(method, function(name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction clearOptInOut(token, options) {\n options = options || {};\n _getStorage(options).remove(\n _getStorageKey(token, options), !!options.crossSubdomainCookie, options.cookieDomain\n );\n}\n\n/** Private **/\n\n/**\n * Get storage util\n * @param {Object} [options]\n * @param {string} [options.persistenceType]\n * @returns {object} either _.cookie or _.localstorage\n */\nfunction _getStorage(options) {\n options = options || {};\n return options.persistenceType === 'localStorage' ? _.localStorage : _.cookie;\n}\n\n/**\n * Get the name of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the name of the cookie for the given opt type\n */\nfunction _getStorageKey(token, options) {\n options = options || {};\n return (options.persistencePrefix || GDPR_DEFAULT_PERSISTENCE_PREFIX) + token;\n}\n\n/**\n * Get the value of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the value of the cookie for the given opt type\n */\nfunction _getStorageValue(token, options) {\n return _getStorage(options).get(_getStorageKey(token, options));\n}\n\n/**\n * Check whether the user has set the DNT/doNotTrack setting to true in their browser\n * @param {Object} [options]\n * @param {string} [options.window] - alternate window object to check; used to force various DNT settings in browser tests\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the DNT setting is true\n */\nfunction _hasDoNotTrackFlagOn(options) {\n if (options && options.ignoreDnt) {\n return false;\n }\n var win$1 = (options && options.window) || win;\n var nav = win$1['navigator'] || {};\n var hasDntOn = false;\n\n _.each([\n nav['doNotTrack'], // standard\n nav['msDoNotTrack'],\n win$1['doNotTrack']\n ], function(dntValue) {\n if (_.includes([true, 1, '1', 'yes'], dntValue)) {\n hasDntOn = true;\n }\n });\n\n return hasDntOn;\n}\n\n/**\n * Set cookie/localstorage for the user indicating that they are opted in or out for the given opt type\n * @param {boolean} optValue - whether to opt the user in or out for the given opt type\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction _optInOut(optValue, token, options) {\n if (!_.isString(token) || !token.length) {\n console$1.error('gdpr.' + (optValue ? 'optIn' : 'optOut') + ' called with an invalid token');\n return;\n }\n\n options = options || {};\n\n _getStorage(options).set(\n _getStorageKey(token, options),\n optValue ? 1 : 0,\n _.isNumber(options.cookieExpiration) ? options.cookieExpiration : null,\n !!options.crossSubdomainCookie,\n !!options.secureCookie,\n !!options.crossSiteCookie,\n options.cookieDomain\n );\n\n if (options.track && optValue) { // only track event if opting in (optValue=true)\n options.track(options.trackEventName || '$opt_in', options.trackProperties, {\n 'send_immediately': true\n });\n }\n}\n\n/**\n * Wrap a method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @param {function} getConfigValue - getter function for the Mixpanel API token and other options to be used with opt-out check\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction _addOptOutCheck(method, getConfigValue) {\n return function() {\n var optedOut = false;\n\n try {\n var token = getConfigValue.call(this, 'token');\n var ignoreDnt = getConfigValue.call(this, 'ignore_dnt');\n var persistenceType = getConfigValue.call(this, 'opt_out_tracking_persistence_type');\n var persistencePrefix = getConfigValue.call(this, 'opt_out_tracking_cookie_prefix');\n var win = getConfigValue.call(this, 'window'); // used to override window during browser tests\n\n if (token) { // if there was an issue getting the token, continue method execution as normal\n optedOut = hasOptedOut(token, {\n ignoreDnt: ignoreDnt,\n persistenceType: persistenceType,\n persistencePrefix: persistencePrefix,\n window: win\n });\n }\n } catch(err) {\n console$1.error('Unexpected error when checking tracking opt-out status: ' + err);\n }\n\n if (!optedOut) {\n return method.apply(this, arguments);\n }\n\n var callback = arguments[arguments.length - 1];\n if (typeof(callback) === 'function') {\n callback(0);\n }\n\n return;\n };\n}\n\nvar logger$3 = console_with_prefix('lock');\n\n/**\n * SharedLock: a mutex built on HTML5 localStorage, to ensure that only one browser\n * window/tab at a time will be able to access shared resources.\n *\n * Based on the Alur and Taubenfeld fast lock\n * (http://www.cs.rochester.edu/research/synchronization/pseudocode/fastlock.html)\n * with an added timeout to ensure there will be eventual progress in the event\n * that a window is closed in the middle of the callback.\n *\n * Implementation based on the original version by David Wolever (https://github.com/wolever)\n * at https://gist.github.com/wolever/5fd7573d1ef6166e8f8c4af286a69432.\n *\n * @example\n * const myLock = new SharedLock('some-key');\n * myLock.withLock(function() {\n * console.log('I hold the mutex!');\n * });\n *\n * @constructor\n */\nvar SharedLock = function(key, options) {\n options = options || {};\n\n this.storageKey = key;\n this.storage = options.storage || window.localStorage;\n this.pollIntervalMS = options.pollIntervalMS || 100;\n this.timeoutMS = options.timeoutMS || 2000;\n};\n\n// pass in a specific pid to test contention scenarios; otherwise\n// it is chosen randomly for each acquisition attempt\nSharedLock.prototype.withLock = function(lockedCB, errorCB, pid) {\n if (!pid && typeof errorCB !== 'function') {\n pid = errorCB;\n errorCB = null;\n }\n\n var i = pid || (new Date().getTime() + '|' + Math.random());\n var startTime = new Date().getTime();\n\n var key = this.storageKey;\n var pollIntervalMS = this.pollIntervalMS;\n var timeoutMS = this.timeoutMS;\n var storage = this.storage;\n\n var keyX = key + ':X';\n var keyY = key + ':Y';\n var keyZ = key + ':Z';\n\n var reportError = function(err) {\n errorCB && errorCB(err);\n };\n\n var delay = function(cb) {\n if (new Date().getTime() - startTime > timeoutMS) {\n logger$3.error('Timeout waiting for mutex on ' + key + '; clearing lock. [' + i + ']');\n storage.removeItem(keyZ);\n storage.removeItem(keyY);\n loop();\n return;\n }\n setTimeout(function() {\n try {\n cb();\n } catch(err) {\n reportError(err);\n }\n }, pollIntervalMS * (Math.random() + 0.1));\n };\n\n var waitFor = function(predicate, cb) {\n if (predicate()) {\n cb();\n } else {\n delay(function() {\n waitFor(predicate, cb);\n });\n }\n };\n\n var getSetY = function() {\n var valY = storage.getItem(keyY);\n if (valY && valY !== i) { // if Y == i then this process already has the lock (useful for test cases)\n return false;\n } else {\n storage.setItem(keyY, i);\n if (storage.getItem(keyY) === i) {\n return true;\n } else {\n if (!localStorageSupported(storage, true)) {\n throw new Error('localStorage support dropped while acquiring lock');\n }\n return false;\n }\n }\n };\n\n var loop = function() {\n storage.setItem(keyX, i);\n\n waitFor(getSetY, function() {\n if (storage.getItem(keyX) === i) {\n criticalSection();\n return;\n }\n\n delay(function() {\n if (storage.getItem(keyY) !== i) {\n loop();\n return;\n }\n waitFor(function() {\n return !storage.getItem(keyZ);\n }, criticalSection);\n });\n });\n };\n\n var criticalSection = function() {\n storage.setItem(keyZ, '1');\n try {\n lockedCB();\n } finally {\n storage.removeItem(keyZ);\n if (storage.getItem(keyY) === i) {\n storage.removeItem(keyY);\n }\n if (storage.getItem(keyX) === i) {\n storage.removeItem(keyX);\n }\n }\n };\n\n try {\n if (localStorageSupported(storage, true)) {\n loop();\n } else {\n throw new Error('localStorage support check failed');\n }\n } catch(err) {\n reportError(err);\n }\n};\n\nvar logger$2 = console_with_prefix('batch');\n\n/**\n * RequestQueue: queue for batching API requests with localStorage backup for retries.\n * Maintains an in-memory queue which represents the source of truth for the current\n * page, but also writes all items out to a copy in the browser's localStorage, which\n * can be read on subsequent pageloads and retried. For batchability, all the request\n * items in the queue should be of the same type (events, people updates, group updates)\n * so they can be sent in a single request to the same API endpoint.\n *\n * LocalStorage keying and locking: In order for reloads and subsequent pageloads of\n * the same site to access the same persisted data, they must share the same localStorage\n * key (for instance based on project token and queue type). Therefore access to the\n * localStorage entry is guarded by an asynchronous mutex (SharedLock) to prevent\n * simultaneously open windows/tabs from overwriting each other's data (which would lead\n * to data loss in some situations).\n * @constructor\n */\nvar RequestQueue = function(storageKey, options) {\n options = options || {};\n this.storageKey = storageKey;\n this.storage = options.storage || window.localStorage;\n this.reportError = options.errorReporter || _.bind(logger$2.error, logger$2);\n this.lock = new SharedLock(storageKey, {storage: this.storage});\n\n this.usePersistence = options.usePersistence;\n this.pid = options.pid || null; // pass pid to test out storage lock contention scenarios\n\n this.memQueue = [];\n};\n\n/**\n * Add one item to queues (memory and localStorage). The queued entry includes\n * the given item along with an auto-generated ID and a \"flush-after\" timestamp.\n * It is expected that the item will be sent over the network and dequeued\n * before the flush-after time; if this doesn't happen it is considered orphaned\n * (e.g., the original tab where it was enqueued got closed before it could be\n * sent) and the item can be sent by any tab that finds it in localStorage.\n *\n * The final callback param is called with a param indicating success or\n * failure of the enqueue operation; it is asynchronous because the localStorage\n * lock is asynchronous.\n */\nRequestQueue.prototype.enqueue = function(item, flushInterval, cb) {\n var queueEntry = {\n 'id': cheap_guid(),\n 'flushAfter': new Date().getTime() + flushInterval * 2,\n 'payload': item\n };\n\n if (!this.usePersistence) {\n this.memQueue.push(queueEntry);\n if (cb) {\n cb(true);\n }\n } else {\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue.push(queueEntry);\n succeeded = this.saveToStorage(storedQueue);\n if (succeeded) {\n // only add to in-memory queue when storage succeeds\n this.memQueue.push(queueEntry);\n }\n } catch(err) {\n this.reportError('Error enqueueing item', item);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), _.bind(function lockFailure(err) {\n this.reportError('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this), this.pid);\n }\n};\n\n/**\n * Read out the given number of queue entries. If this.memQueue\n * has fewer than batchSize items, then look for \"orphaned\" items\n * in the persisted queue (items where the 'flushAfter' time has\n * already passed).\n */\nRequestQueue.prototype.fillBatch = function(batchSize) {\n var batch = this.memQueue.slice(0, batchSize);\n if (this.usePersistence && batch.length < batchSize) {\n // don't need lock just to read events; localStorage is thread-safe\n // and the worst that could happen is a duplicate send of some\n // orphaned events, which will be deduplicated on the server side\n var storedQueue = this.readFromStorage();\n if (storedQueue.length) {\n // item IDs already in batch; don't duplicate out of storage\n var idsInBatch = {}; // poor man's Set\n _.each(batch, function(item) { idsInBatch[item['id']] = true; });\n\n for (var i = 0; i < storedQueue.length; i++) {\n var item = storedQueue[i];\n if (new Date().getTime() > item['flushAfter'] && !idsInBatch[item['id']]) {\n item.orphaned = true;\n batch.push(item);\n if (batch.length >= batchSize) {\n break;\n }\n }\n }\n }\n }\n return batch;\n};\n\n/**\n * Remove items with matching 'id' from array (immutably)\n * also remove any item without a valid id (e.g., malformed\n * storage entries).\n */\nvar filterOutIDsAndInvalid = function(items, idSet) {\n var filteredItems = [];\n _.each(items, function(item) {\n if (item['id'] && !idSet[item['id']]) {\n filteredItems.push(item);\n }\n });\n return filteredItems;\n};\n\n/**\n * Remove items with matching IDs from both in-memory queue\n * and persisted queue\n */\nRequestQueue.prototype.removeItemsByID = function(ids, cb) {\n var idSet = {}; // poor man's Set\n _.each(ids, function(id) { idSet[id] = true; });\n\n this.memQueue = filterOutIDsAndInvalid(this.memQueue, idSet);\n if (!this.usePersistence) {\n if (cb) {\n cb(true);\n }\n } else {\n var removeFromStorage = _.bind(function() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = filterOutIDsAndInvalid(storedQueue, idSet);\n succeeded = this.saveToStorage(storedQueue);\n\n // an extra check: did storage report success but somehow\n // the items are still there?\n if (succeeded) {\n storedQueue = this.readFromStorage();\n for (var i = 0; i < storedQueue.length; i++) {\n var item = storedQueue[i];\n if (item['id'] && !!idSet[item['id']]) {\n this.reportError('Item not removed from storage');\n return false;\n }\n }\n }\n } catch(err) {\n this.reportError('Error removing items', ids);\n succeeded = false;\n }\n return succeeded;\n }, this);\n\n this.lock.withLock(function lockAcquired() {\n var succeeded = removeFromStorage();\n if (cb) {\n cb(succeeded);\n }\n }, _.bind(function lockFailure(err) {\n var succeeded = false;\n this.reportError('Error acquiring storage lock', err);\n if (!localStorageSupported(this.storage, true)) {\n // Looks like localStorage writes have stopped working sometime after\n // initialization (probably full), and so nobody can acquire locks\n // anymore. Consider it temporarily safe to remove items without the\n // lock, since nobody's writing successfully anyway.\n succeeded = removeFromStorage();\n if (!succeeded) {\n // OK, we couldn't even write out the smaller queue. Try clearing it\n // entirely.\n try {\n this.storage.removeItem(this.storageKey);\n } catch(err) {\n this.reportError('Error clearing queue', err);\n }\n }\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), this.pid);\n }\n\n};\n\n// internal helper for RequestQueue.updatePayloads\nvar updatePayloads = function(existingItems, itemsToUpdate) {\n var newItems = [];\n _.each(existingItems, function(item) {\n var id = item['id'];\n if (id in itemsToUpdate) {\n var newPayload = itemsToUpdate[id];\n if (newPayload !== null) {\n item['payload'] = newPayload;\n newItems.push(item);\n }\n } else {\n // no update\n newItems.push(item);\n }\n });\n return newItems;\n};\n\n/**\n * Update payloads of given items in both in-memory queue and\n * persisted queue. Items set to null are removed from queues.\n */\nRequestQueue.prototype.updatePayloads = function(itemsToUpdate, cb) {\n this.memQueue = updatePayloads(this.memQueue, itemsToUpdate);\n if (!this.usePersistence) {\n if (cb) {\n cb(true);\n }\n } else {\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = updatePayloads(storedQueue, itemsToUpdate);\n succeeded = this.saveToStorage(storedQueue);\n } catch(err) {\n this.reportError('Error updating items', itemsToUpdate);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), _.bind(function lockFailure(err) {\n this.reportError('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this), this.pid);\n }\n\n};\n\n/**\n * Read and parse items array from localStorage entry, handling\n * malformed/missing data if necessary.\n */\nRequestQueue.prototype.readFromStorage = function() {\n var storageEntry;\n try {\n storageEntry = this.storage.getItem(this.storageKey);\n if (storageEntry) {\n storageEntry = JSONParse(storageEntry);\n if (!_.isArray(storageEntry)) {\n this.reportError('Invalid storage entry:', storageEntry);\n storageEntry = null;\n }\n }\n } catch (err) {\n this.reportError('Error retrieving queue', err);\n storageEntry = null;\n }\n return storageEntry || [];\n};\n\n/**\n * Serialize the given items array to localStorage.\n */\nRequestQueue.prototype.saveToStorage = function(queue) {\n try {\n this.storage.setItem(this.storageKey, JSONStringify(queue));\n return true;\n } catch (err) {\n this.reportError('Error saving queue', err);\n return false;\n }\n};\n\n/**\n * Clear out queues (memory and localStorage).\n */\nRequestQueue.prototype.clear = function() {\n this.memQueue = [];\n\n if (this.usePersistence) {\n this.storage.removeItem(this.storageKey);\n }\n};\n\n// maximum interval between request retries after exponential backoff\nvar MAX_RETRY_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes\n\nvar logger$1 = console_with_prefix('batch');\n\n/**\n * RequestBatcher: manages the queueing, flushing, retry etc of requests of one\n * type (events, people, groups).\n * Uses RequestQueue to manage the backing store.\n * @constructor\n */\nvar RequestBatcher = function(storageKey, options) {\n this.errorReporter = options.errorReporter;\n this.queue = new RequestQueue(storageKey, {\n errorReporter: _.bind(this.reportError, this),\n storage: options.storage,\n usePersistence: options.usePersistence\n });\n\n this.libConfig = options.libConfig;\n this.sendRequest = options.sendRequestFunc;\n this.beforeSendHook = options.beforeSendHook;\n this.stopAllBatching = options.stopAllBatchingFunc;\n\n // seed variable batch size + flush interval with configured values\n this.batchSize = this.libConfig['batch_size'];\n this.flushInterval = this.libConfig['batch_flush_interval_ms'];\n\n this.stopped = !this.libConfig['batch_autostart'];\n this.consecutiveRemovalFailures = 0;\n\n // extra client-side dedupe\n this.itemIdsSentSuccessfully = {};\n\n // Make the flush occur at the interval specified by flushIntervalMs, default behavior will attempt consecutive flushes\n // as long as the queue is not empty. This is useful for high-frequency events like Session Replay where we might end up\n // in a request loop and get ratelimited by the server.\n this.flushOnlyOnInterval = options.flushOnlyOnInterval || false;\n};\n\n/**\n * Add one item to queue.\n */\nRequestBatcher.prototype.enqueue = function(item, cb) {\n this.queue.enqueue(item, this.flushInterval, cb);\n};\n\n/**\n * Start flushing batches at the configured time interval. Must call\n * this method upon SDK init in order to send anything over the network.\n */\nRequestBatcher.prototype.start = function() {\n this.stopped = false;\n this.consecutiveRemovalFailures = 0;\n this.flush();\n};\n\n/**\n * Stop flushing batches. Can be restarted by calling start().\n */\nRequestBatcher.prototype.stop = function() {\n this.stopped = true;\n if (this.timeoutID) {\n clearTimeout(this.timeoutID);\n this.timeoutID = null;\n }\n};\n\n/**\n * Clear out queue.\n */\nRequestBatcher.prototype.clear = function() {\n this.queue.clear();\n};\n\n/**\n * Restore batch size configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetBatchSize = function() {\n this.batchSize = this.libConfig['batch_size'];\n};\n\n/**\n * Restore flush interval time configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetFlush = function() {\n this.scheduleFlush(this.libConfig['batch_flush_interval_ms']);\n};\n\n/**\n * Schedule the next flush in the given number of milliseconds.\n */\nRequestBatcher.prototype.scheduleFlush = function(flushMS) {\n this.flushInterval = flushMS;\n if (!this.stopped) { // don't schedule anymore if batching has been stopped\n this.timeoutID = setTimeout(_.bind(function() {\n if (!this.stopped) {\n this.flush();\n }\n }, this), this.flushInterval);\n }\n};\n\n/**\n * Flush one batch to network. Depending on success/failure modes, it will either\n * remove the batch from the queue or leave it in for retry, and schedule the next\n * flush. In cases of most network or API failures, it will back off exponentially\n * when retrying.\n * @param {Object} [options]\n * @param {boolean} [options.sendBeacon] - whether to send batch with\n * navigator.sendBeacon (only useful for sending batches before page unloads, as\n * sendBeacon offers no callbacks or status indications)\n */\nRequestBatcher.prototype.flush = function(options) {\n try {\n\n if (this.requestInProgress) {\n logger$1.log('Flush: Request already in progress');\n return;\n }\n\n options = options || {};\n var timeoutMS = this.libConfig['batch_request_timeout_ms'];\n var startTime = new Date().getTime();\n var currentBatchSize = this.batchSize;\n var batch = this.queue.fillBatch(currentBatchSize);\n // if there's more items in the queue than the batch size, attempt\n // to flush again after the current batch is done.\n var attemptSecondaryFlush = batch.length === currentBatchSize;\n var dataForRequest = [];\n var transformedItems = {};\n _.each(batch, function(item) {\n var payload = item['payload'];\n if (this.beforeSendHook && !item.orphaned) {\n payload = this.beforeSendHook(payload);\n }\n if (payload) {\n // mp_sent_by_lib_version prop captures which lib version actually\n // sends each event (regardless of which version originally queued\n // it for sending)\n if (payload['event'] && payload['properties']) {\n payload['properties'] = _.extend(\n {},\n payload['properties'],\n {'mp_sent_by_lib_version': Config.LIB_VERSION}\n );\n }\n var addPayload = true;\n var itemId = item['id'];\n if (itemId) {\n if ((this.itemIdsSentSuccessfully[itemId] || 0) > 5) {\n this.reportError('[dupe] item ID sent too many times, not sending', {\n item: item,\n batchSize: batch.length,\n timesSent: this.itemIdsSentSuccessfully[itemId]\n });\n addPayload = false;\n }\n } else {\n this.reportError('[dupe] found item with no ID', {item: item});\n }\n\n if (addPayload) {\n dataForRequest.push(payload);\n }\n }\n transformedItems[item['id']] = payload;\n }, this);\n if (dataForRequest.length < 1) {\n this.resetFlush();\n return; // nothing to do\n }\n\n this.requestInProgress = true;\n\n var batchSendCallback = _.bind(function(res) {\n this.requestInProgress = false;\n\n try {\n\n // handle API response in a try-catch to make sure we can reset the\n // flush operation if something goes wrong\n\n var removeItemsFromQueue = false;\n if (options.unloading) {\n // update persisted data to include hook transformations\n this.queue.updatePayloads(transformedItems);\n } else if (\n _.isObject(res) &&\n res.error === 'timeout' &&\n new Date().getTime() - startTime >= timeoutMS\n ) {\n this.reportError('Network timeout; retrying');\n this.flush();\n } else if (\n _.isObject(res) &&\n (\n res.httpStatusCode >= 500\n || res.httpStatusCode === 429\n || (res.httpStatusCode <= 0 && !isOnline())\n || res.error === 'timeout'\n )\n ) {\n // network or API error, or 429 Too Many Requests, retry\n var retryMS = this.flushInterval * 2;\n if (res.retryAfter) {\n retryMS = (parseInt(res.retryAfter, 10) * 1000) || retryMS;\n }\n retryMS = Math.min(MAX_RETRY_INTERVAL_MS, retryMS);\n this.reportError('Error; retry in ' + retryMS + ' ms');\n this.scheduleFlush(retryMS);\n } else if (_.isObject(res) && res.httpStatusCode === 413) {\n // 413 Payload Too Large\n if (batch.length > 1) {\n var halvedBatchSize = Math.max(1, Math.floor(currentBatchSize / 2));\n this.batchSize = Math.min(this.batchSize, halvedBatchSize, batch.length - 1);\n this.reportError('413 response; reducing batch size to ' + this.batchSize);\n this.resetFlush();\n } else {\n this.reportError('Single-event request too large; dropping', batch);\n this.resetBatchSize();\n removeItemsFromQueue = true;\n }\n } else {\n // successful network request+response; remove each item in batch from queue\n // (even if it was e.g. a 400, in which case retrying won't help)\n removeItemsFromQueue = true;\n }\n\n if (removeItemsFromQueue) {\n this.queue.removeItemsByID(\n _.map(batch, function(item) { return item['id']; }),\n _.bind(function(succeeded) {\n if (succeeded) {\n this.consecutiveRemovalFailures = 0;\n if (this.flushOnlyOnInterval && !attemptSecondaryFlush) {\n this.resetFlush(); // schedule next batch with a delay\n } else {\n this.flush(); // handle next batch if the queue isn't empty\n }\n } else {\n this.reportError('Failed to remove items from queue');\n if (++this.consecutiveRemovalFailures > 5) {\n this.reportError('Too many queue failures; disabling batching system.');\n this.stopAllBatching();\n } else {\n this.resetFlush();\n }\n }\n }, this)\n );\n\n // client-side dedupe\n _.each(batch, _.bind(function(item) {\n var itemId = item['id'];\n if (itemId) {\n this.itemIdsSentSuccessfully[itemId] = this.itemIdsSentSuccessfully[itemId] || 0;\n this.itemIdsSentSuccessfully[itemId]++;\n if (this.itemIdsSentSuccessfully[itemId] > 5) {\n this.reportError('[dupe] item ID sent too many times', {\n item: item,\n batchSize: batch.length,\n timesSent: this.itemIdsSentSuccessfully[itemId]\n });\n }\n } else {\n this.reportError('[dupe] found item with no ID while removing', {item: item});\n }\n }, this));\n }\n\n } catch(err) {\n this.reportError('Error handling API response', err);\n this.resetFlush();\n }\n }, this);\n var requestOptions = {\n method: 'POST',\n verbose: true,\n ignore_json_errors: true, // eslint-disable-line camelcase\n timeout_ms: timeoutMS // eslint-disable-line camelcase\n };\n if (options.unloading) {\n requestOptions.transport = 'sendBeacon';\n }\n logger$1.log('MIXPANEL REQUEST:', dataForRequest);\n this.sendRequest(dataForRequest, requestOptions, batchSendCallback);\n } catch(err) {\n this.reportError('Error flushing request queue', err);\n this.resetFlush();\n }\n};\n\n/**\n * Log error to global logger and optional user-defined logger.\n */\nRequestBatcher.prototype.reportError = function(msg, err) {\n logger$1.error.apply(logger$1.error, arguments);\n if (this.errorReporter) {\n try {\n if (!(err instanceof Error)) {\n err = new Error(msg);\n }\n this.errorReporter(msg, err);\n } catch(err) {\n logger$1.error(err);\n }\n }\n};\n\nvar logger = console_with_prefix('recorder');\nvar CompressionStream = win['CompressionStream'];\n\nvar RECORDER_BATCHER_LIB_CONFIG = {\n 'batch_size': 1000,\n 'batch_flush_interval_ms': 10 * 1000,\n 'batch_request_timeout_ms': 90 * 1000,\n 'batch_autostart': true\n};\n\nvar ACTIVE_SOURCES = new Set([\n IncrementalSource.MouseMove,\n IncrementalSource.MouseInteraction,\n IncrementalSource.Scroll,\n IncrementalSource.ViewportResize,\n IncrementalSource.Input,\n IncrementalSource.TouchMove,\n IncrementalSource.MediaInteraction,\n IncrementalSource.Drag,\n IncrementalSource.Selection,\n]);\n\nfunction isUserEvent(ev) {\n return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);\n}\n\nvar MixpanelRecorder = function(mixpanelInstance) {\n this._mixpanel = mixpanelInstance;\n\n // internal rrweb stopRecording function\n this._stopRecording = null;\n\n this.recEvents = [];\n this.seqNo = 0;\n this.replayId = null;\n this.replayStartTime = null;\n this.sendBatchId = null;\n\n this.idleTimeoutId = null;\n this.maxTimeoutId = null;\n\n this.recordMaxMs = MAX_RECORDING_MS;\n this.recordMinMs = 0;\n this._initBatcher();\n};\n\n\nMixpanelRecorder.prototype._initBatcher = function () {\n this.batcher = new RequestBatcher('__mprec', {\n libConfig: RECORDER_BATCHER_LIB_CONFIG,\n sendRequestFunc: _.bind(this.flushEventsWithOptOut, this),\n errorReporter: _.bind(this.reportError, this),\n flushOnlyOnInterval: true,\n usePersistence: false\n });\n};\n\n// eslint-disable-next-line camelcase\nMixpanelRecorder.prototype.get_config = function(configVar) {\n return this._mixpanel.get_config(configVar);\n};\n\nMixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {\n if (this._stopRecording !== null) {\n logger.log('Recording already in progress, skipping startRecording.');\n return;\n }\n\n this.recordMaxMs = this.get_config('record_max_ms');\n if (this.recordMaxMs > MAX_RECORDING_MS) {\n this.recordMaxMs = MAX_RECORDING_MS;\n logger.critical('record_max_ms cannot be greater than ' + MAX_RECORDING_MS + 'ms. Capping value.');\n }\n\n this.recordMinMs = this.get_config('record_min_ms');\n if (this.recordMinMs > MAX_VALUE_FOR_MIN_RECORDING_MS) {\n this.recordMinMs = MAX_VALUE_FOR_MIN_RECORDING_MS;\n logger.critical('record_min_ms cannot be greater than ' + MAX_VALUE_FOR_MIN_RECORDING_MS + 'ms. Capping value.');\n }\n\n this.recEvents = [];\n this.seqNo = 0;\n this.replayStartTime = new Date().getTime();\n\n this.replayId = _.UUID();\n\n if (shouldStopBatcher || this.recordMinMs > 0) {\n // the primary case for shouldStopBatcher is when we're starting recording after a reset\n // and don't want to send anything over the network until there's\n // actual user activity\n // this also applies if the minimum recording length has not been hit yet\n // so that we don't send data until we know the recording will be long enough\n this.batcher.stop();\n } else {\n this.batcher.start();\n }\n\n var resetIdleTimeout = _.bind(function () {\n clearTimeout(this.idleTimeoutId);\n this.idleTimeoutId = setTimeout(_.bind(function () {\n logger.log('Idle timeout reached, restarting recording.');\n this.resetRecording();\n }, this), this.get_config('record_idle_timeout_ms'));\n }, this);\n\n var blockSelector = this.get_config('record_block_selector');\n if (blockSelector === '' || blockSelector === null) {\n blockSelector = undefined;\n }\n\n this._stopRecording = record({\n 'emit': _.bind(function (ev) {\n this.batcher.enqueue(ev);\n if (isUserEvent(ev)) {\n if (this.batcher.stopped && new Date().getTime() - this.replayStartTime >= this.recordMinMs) {\n // start flushing again after user activity\n this.batcher.start();\n }\n resetIdleTimeout();\n }\n }, this),\n 'blockClass': this.get_config('record_block_class'),\n 'blockSelector': blockSelector,\n 'collectFonts': this.get_config('record_collect_fonts'),\n 'inlineImages': this.get_config('record_inline_images'),\n 'maskAllInputs': true,\n 'maskTextClass': this.get_config('record_mask_text_class'),\n 'maskTextSelector': this.get_config('record_mask_text_selector')\n });\n\n resetIdleTimeout();\n\n this.maxTimeoutId = setTimeout(_.bind(this.resetRecording, this), this.recordMaxMs);\n};\n\nMixpanelRecorder.prototype.resetRecording = function () {\n this.stopRecording();\n this.startRecording(true);\n};\n\nMixpanelRecorder.prototype.stopRecording = function () {\n if (this._stopRecording !== null) {\n this._stopRecording();\n this._stopRecording = null;\n }\n\n if (this.batcher.stopped) {\n // never got user activity to flush after reset, so just clear the batcher\n this.batcher.clear();\n } else {\n // flush any remaining events from running batcher\n this.batcher.flush();\n this.batcher.stop();\n }\n this.replayId = null;\n\n clearTimeout(this.idleTimeoutId);\n clearTimeout(this.maxTimeoutId);\n};\n\n/**\n * Flushes the current batch of events to the server, but passes an opt-out callback to make sure\n * we stop recording and dump any queued events if the user has opted out.\n */\nMixpanelRecorder.prototype.flushEventsWithOptOut = function (data, options, cb) {\n this._flushEvents(data, options, cb, _.bind(this._onOptOut, this));\n};\n\nMixpanelRecorder.prototype._onOptOut = function (code) {\n // addOptOutCheckMixpanelLib invokes this function with code=0 when the user has opted out\n if (code === 0) {\n this.recEvents = [];\n this.stopRecording();\n }\n};\n\nMixpanelRecorder.prototype._sendRequest = function(currentReplayId, reqParams, reqBody, callback) {\n var onSuccess = _.bind(function (response, responseBody) {\n // Increment sequence counter only if the request was successful to guarantee ordering.\n // RequestBatcher will always flush the next batch after the previous one succeeds.\n // extra check to see if the replay ID has changed so that we don't increment the seqNo on the wrong replay\n if (response.status === 200 && this.replayId === currentReplayId) {\n this.seqNo++;\n }\n callback({\n status: 0,\n httpStatusCode: response.status,\n responseBody: responseBody,\n retryAfter: response.headers.get('Retry-After')\n });\n }, this);\n\n win['fetch'](this.get_config('api_host') + '/' + this.get_config('api_routes')['record'] + '?' + new URLSearchParams(reqParams), {\n 'method': 'POST',\n 'headers': {\n 'Authorization': 'Basic ' + btoa(this.get_config('token') + ':'),\n 'Content-Type': 'application/octet-stream'\n },\n 'body': reqBody,\n }).then(function (response) {\n response.json().then(function (responseBody) {\n onSuccess(response, responseBody);\n }).catch(function (error) {\n callback({error: error});\n });\n }).catch(function (error) {\n callback({error: error, httpStatusCode: 0});\n });\n};\n\nMixpanelRecorder.prototype._flushEvents = addOptOutCheckMixpanelLib(function (data, options, callback) {\n const numEvents = data.length;\n\n if (numEvents > 0) {\n var replayId = this.replayId;\n // each rrweb event has a timestamp - leverage those to get time properties\n var batchStartTime = data[0].timestamp;\n if (this.seqNo === 0 || !this.replayStartTime) {\n // extra safety net so that we don't send a null replay start time\n if (this.seqNo !== 0) {\n this.reportError('Replay start time not set but seqNo is not 0. Using current batch start time as a fallback.');\n }\n\n this.replayStartTime = batchStartTime;\n }\n var replayLengthMs = data[numEvents - 1].timestamp - this.replayStartTime;\n\n var reqParams = {\n 'distinct_id': String(this._mixpanel.get_distinct_id()),\n 'seq': this.seqNo,\n 'batch_start_time': batchStartTime / 1000,\n 'replay_id': replayId,\n 'replay_length_ms': replayLengthMs,\n 'replay_start_time': this.replayStartTime / 1000\n };\n var eventsJson = _.JSONEncode(data);\n\n // send ID management props if they exist\n var deviceId = this._mixpanel.get_property('$device_id');\n if (deviceId) {\n reqParams['$device_id'] = deviceId;\n }\n var userId = this._mixpanel.get_property('$user_id');\n if (userId) {\n reqParams['$user_id'] = userId;\n }\n\n if (CompressionStream) {\n var jsonStream = new Blob([eventsJson], {type: 'application/json'}).stream();\n var gzipStream = jsonStream.pipeThrough(new CompressionStream('gzip'));\n new Response(gzipStream)\n .blob()\n .then(_.bind(function(compressedBlob) {\n reqParams['format'] = 'gzip';\n this._sendRequest(replayId, reqParams, compressedBlob, callback);\n }, this));\n } else {\n reqParams['format'] = 'body';\n this._sendRequest(replayId, reqParams, eventsJson, callback);\n }\n }\n});\n\n\nMixpanelRecorder.prototype.reportError = function(msg, err) {\n logger.error.apply(logger.error, arguments);\n try {\n if (!err && !(msg instanceof Error)) {\n msg = new Error(msg);\n }\n this.get_config('error_reporter')(msg, err);\n } catch(err) {\n logger.error(err);\n }\n};\n\n\nwin['__mp_recorder'] = MixpanelRecorder;\n\n/* eslint camelcase: \"off\" */\n\n/**\n * DomTracker Object\n * @constructor\n */\nvar DomTracker = function() {};\n\n\n// interface\nDomTracker.prototype.create_properties = function() {};\nDomTracker.prototype.event_handler = function() {};\nDomTracker.prototype.after_track_handler = function() {};\n\nDomTracker.prototype.init = function(mixpanel_instance) {\n this.mp = mixpanel_instance;\n return this;\n};\n\n/**\n * @param {Object|string} query\n * @param {string} event_name\n * @param {Object=} properties\n * @param {function=} user_callback\n */\nDomTracker.prototype.track = function(query, event_name, properties, user_callback) {\n var that = this;\n var elements = _.dom_query(query);\n\n if (elements.length === 0) {\n console$1.error('The DOM query (' + query + ') returned 0 elements');\n return;\n }\n\n _.each(elements, function(element) {\n _.register_event(element, this.override_event, function(e) {\n var options = {};\n var props = that.create_properties(properties, this);\n var timeout = that.mp.get_config('track_links_timeout');\n\n that.event_handler(e, this, options);\n\n // in case the mixpanel servers don't get back to us in time\n window.setTimeout(that.track_callback(user_callback, props, options, true), timeout);\n\n // fire the tracking event\n that.mp.track(event_name, props, that.track_callback(user_callback, props, options));\n });\n }, this);\n\n return true;\n};\n\n/**\n * @param {function} user_callback\n * @param {Object} props\n * @param {boolean=} timeout_occured\n */\nDomTracker.prototype.track_callback = function(user_callback, props, options, timeout_occured) {\n timeout_occured = timeout_occured || false;\n var that = this;\n\n return function() {\n // options is referenced from both callbacks, so we can have\n // a 'lock' of sorts to ensure only one fires\n if (options.callback_fired) { return; }\n options.callback_fired = true;\n\n if (user_callback && user_callback(timeout_occured, props) === false) {\n // user can prevent the default functionality by\n // returning false from their callback\n return;\n }\n\n that.after_track_handler(props, options, timeout_occured);\n };\n};\n\nDomTracker.prototype.create_properties = function(properties, element) {\n var props;\n\n if (typeof(properties) === 'function') {\n props = properties(element);\n } else {\n props = _.extend({}, properties);\n }\n\n return props;\n};\n\n/**\n * LinkTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar LinkTracker = function() {\n this.override_event = 'click';\n};\n_.inherit(LinkTracker, DomTracker);\n\nLinkTracker.prototype.create_properties = function(properties, element) {\n var props = LinkTracker.superclass.create_properties.apply(this, arguments);\n\n if (element.href) { props['url'] = element.href; }\n\n return props;\n};\n\nLinkTracker.prototype.event_handler = function(evt, element, options) {\n options.new_tab = (\n evt.which === 2 ||\n evt.metaKey ||\n evt.ctrlKey ||\n element.target === '_blank'\n );\n options.href = element.href;\n\n if (!options.new_tab) {\n evt.preventDefault();\n }\n};\n\nLinkTracker.prototype.after_track_handler = function(props, options) {\n if (options.new_tab) { return; }\n\n setTimeout(function() {\n window.location = options.href;\n }, 0);\n};\n\n/**\n * FormTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar FormTracker = function() {\n this.override_event = 'submit';\n};\n_.inherit(FormTracker, DomTracker);\n\nFormTracker.prototype.event_handler = function(evt, element, options) {\n options.element = element;\n evt.preventDefault();\n};\n\nFormTracker.prototype.after_track_handler = function(props, options) {\n setTimeout(function() {\n options.element.submit();\n }, 0);\n};\n\n/* eslint camelcase: \"off\" */\n\n/** @const */ var SET_ACTION = '$set';\n/** @const */ var SET_ONCE_ACTION = '$set_once';\n/** @const */ var UNSET_ACTION = '$unset';\n/** @const */ var ADD_ACTION = '$add';\n/** @const */ var APPEND_ACTION = '$append';\n/** @const */ var UNION_ACTION = '$union';\n/** @const */ var REMOVE_ACTION = '$remove';\n/** @const */ var DELETE_ACTION = '$delete';\n\n// Common internal methods for mixpanel.people and mixpanel.group APIs.\n// These methods shouldn't involve network I/O.\nvar apiActions = {\n set_action: function(prop, to) {\n var data = {};\n var $set = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set[k] = v;\n }\n }, this);\n } else {\n $set[prop] = to;\n }\n\n data[SET_ACTION] = $set;\n return data;\n },\n\n unset_action: function(prop) {\n var data = {};\n var $unset = [];\n if (!_.isArray(prop)) {\n prop = [prop];\n }\n\n _.each(prop, function(k) {\n if (!this._is_reserved_property(k)) {\n $unset.push(k);\n }\n }, this);\n\n data[UNSET_ACTION] = $unset;\n return data;\n },\n\n set_once_action: function(prop, to) {\n var data = {};\n var $set_once = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set_once[k] = v;\n }\n }, this);\n } else {\n $set_once[prop] = to;\n }\n data[SET_ONCE_ACTION] = $set_once;\n return data;\n },\n\n union_action: function(list_name, values) {\n var data = {};\n var $union = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $union[k] = _.isArray(v) ? v : [v];\n }\n }, this);\n } else {\n $union[list_name] = _.isArray(values) ? values : [values];\n }\n data[UNION_ACTION] = $union;\n return data;\n },\n\n append_action: function(list_name, value) {\n var data = {};\n var $append = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $append[k] = v;\n }\n }, this);\n } else {\n $append[list_name] = value;\n }\n data[APPEND_ACTION] = $append;\n return data;\n },\n\n remove_action: function(list_name, value) {\n var data = {};\n var $remove = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $remove[k] = v;\n }\n }, this);\n } else {\n $remove[list_name] = value;\n }\n data[REMOVE_ACTION] = $remove;\n return data;\n },\n\n delete_action: function() {\n var data = {};\n data[DELETE_ACTION] = '';\n return data;\n }\n};\n\n/* eslint camelcase: \"off\" */\n\n/**\n * Mixpanel Group Object\n * @constructor\n */\nvar MixpanelGroup = function() {};\n\n_.extend(MixpanelGroup.prototype, apiActions);\n\nMixpanelGroup.prototype._init = function(mixpanel_instance, group_key, group_id) {\n this._mixpanel = mixpanel_instance;\n this._group_key = group_key;\n this._group_id = group_id;\n};\n\n/**\n * Set properties on a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, dates, or lists\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set = addOptOutCheckMixpanelGroup(function(prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Set properties on a group, only if they do not yet exist.\n * This will not overwrite previous group property values, unlike\n * group.set().\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set_once('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set_once({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, lists or dates\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set_once = addOptOutCheckMixpanelGroup(function(prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Unset properties on a group permanently.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').unset('Founded');\n *\n * @param {String} prop The name of the property.\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.unset = addOptOutCheckMixpanelGroup(function(prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/**\n * Merge a given list with a list-valued group property, excluding duplicate values.\n *\n * ### Usage:\n *\n * // merge a value to a list, creating it if needed\n * mixpanel.get_group('company', 'mixpanel').union('Location', ['San Francisco', 'London']);\n *\n * @param {String} list_name Name of the property.\n * @param {Array} values Values to merge with the given property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.union = addOptOutCheckMixpanelGroup(function(list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/**\n * Permanently delete a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').delete();\n *\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype['delete'] = addOptOutCheckMixpanelGroup(function(callback) {\n // bracket notation above prevents a minification error related to reserved words\n var data = this.delete_action();\n return this._send_request(data, callback);\n});\n\n/**\n * Remove a property from a group. The value will be ignored if doesn't exist.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').remove('Location', 'London');\n *\n * @param {String} list_name Name of the property.\n * @param {Object} value Value to remove from the given group property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.remove = addOptOutCheckMixpanelGroup(function(list_name, value, callback) {\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\n\nMixpanelGroup.prototype._send_request = function(data, callback) {\n data['$group_key'] = this._group_key;\n data['$group_id'] = this._group_id;\n data['$token'] = this._get_config('token');\n\n var date_encoded_data = _.encodeDates(data);\n return this._mixpanel._track_or_batch({\n type: 'groups',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/' + this._get_config('api_routes')['groups'],\n batcher: this._mixpanel.request_batchers.groups\n }, callback);\n};\n\nMixpanelGroup.prototype._is_reserved_property = function(prop) {\n return prop === '$group_key' || prop === '$group_id';\n};\n\nMixpanelGroup.prototype._get_config = function(conf) {\n return this._mixpanel.get_config(conf);\n};\n\nMixpanelGroup.prototype.toString = function() {\n return this._mixpanel.toString() + '.group.' + this._group_key + '.' + this._group_id;\n};\n\n// MixpanelGroup Exports\nMixpanelGroup.prototype['remove'] = MixpanelGroup.prototype.remove;\nMixpanelGroup.prototype['set'] = MixpanelGroup.prototype.set;\nMixpanelGroup.prototype['set_once'] = MixpanelGroup.prototype.set_once;\nMixpanelGroup.prototype['union'] = MixpanelGroup.prototype.union;\nMixpanelGroup.prototype['unset'] = MixpanelGroup.prototype.unset;\nMixpanelGroup.prototype['toString'] = MixpanelGroup.prototype.toString;\n\n/* eslint camelcase: \"off\" */\n\n/**\n * Mixpanel People Object\n * @constructor\n */\nvar MixpanelPeople = function() {};\n\n_.extend(MixpanelPeople.prototype, apiActions);\n\nMixpanelPeople.prototype._init = function(mixpanel_instance) {\n this._mixpanel = mixpanel_instance;\n};\n\n/*\n* Set properties on a user record.\n*\n* ### Usage:\n*\n* mixpanel.people.set('gender', 'm');\n*\n* // or set multiple properties at once\n* mixpanel.people.set({\n* 'Company': 'Acme',\n* 'Plan': 'Premium',\n* 'Upgrade date': new Date()\n* });\n* // properties can be strings, integers, dates, or lists\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set = addOptOutCheckMixpanelPeople(function(prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n // make sure that the referrer info has been updated and saved\n if (this._get_config('save_referrer')) {\n this._mixpanel['persistence'].update_referrer_info(document.referrer);\n }\n\n // update $set object with default people properties\n data[SET_ACTION] = _.extend(\n {},\n _.info.people_properties(),\n data[SET_ACTION]\n );\n return this._send_request(data, callback);\n});\n\n/*\n* Set properties on a user record, only if they do not yet exist.\n* This will not overwrite previous people property values, unlike\n* people.set().\n*\n* ### Usage:\n*\n* mixpanel.people.set_once('First Login Date', new Date());\n*\n* // or set multiple properties at once\n* mixpanel.people.set_once({\n* 'First Login Date': new Date(),\n* 'Starting Plan': 'Premium'\n* });\n*\n* // properties can be strings, integers or dates\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set_once = addOptOutCheckMixpanelPeople(function(prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/*\n* Unset properties on a user record (permanently removes the properties and their values from a profile).\n*\n* ### Usage:\n*\n* mixpanel.people.unset('gender');\n*\n* // or unset multiple properties at once\n* mixpanel.people.unset(['gender', 'Company']);\n*\n* @param {Array|String} prop If a string, this is the name of the property. If an array, this is a list of property names.\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.unset = addOptOutCheckMixpanelPeople(function(prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/*\n* Increment/decrement numeric people analytics properties.\n*\n* ### Usage:\n*\n* mixpanel.people.increment('page_views', 1);\n*\n* // or, for convenience, if you're just incrementing a counter by\n* // 1, you can simply do\n* mixpanel.people.increment('page_views');\n*\n* // to decrement a counter, pass a negative number\n* mixpanel.people.increment('credits_left', -1);\n*\n* // like mixpanel.people.set(), you can increment multiple\n* // properties at once:\n* mixpanel.people.increment({\n* counter1: 1,\n* counter2: 6\n* });\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and numeric values.\n* @param {Number} [by] An amount to increment the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.increment = addOptOutCheckMixpanelPeople(function(prop, by, callback) {\n var data = {};\n var $add = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n if (isNaN(parseFloat(v))) {\n console$1.error('Invalid increment value passed to mixpanel.people.increment - must be a number');\n return;\n } else {\n $add[k] = v;\n }\n }\n }, this);\n callback = by;\n } else {\n // convenience: mixpanel.people.increment('property'); will\n // increment 'property' by 1\n if (_.isUndefined(by)) {\n by = 1;\n }\n $add[prop] = by;\n }\n data[ADD_ACTION] = $add;\n\n return this._send_request(data, callback);\n});\n\n/*\n* Append a value to a list-valued people analytics property.\n*\n* ### Usage:\n*\n* // append a value to a list, creating it if needed\n* mixpanel.people.append('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.append({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value An item to append to the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.append = addOptOutCheckMixpanelPeople(function(list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.append_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Remove a value from a list-valued people analytics property.\n*\n* ### Usage:\n*\n* mixpanel.people.remove('School', 'UCB');\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value Item to remove from the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.remove = addOptOutCheckMixpanelPeople(function(list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Merge a given list with a list-valued people analytics property,\n* excluding duplicate values.\n*\n* ### Usage:\n*\n* // merge a value to a list, creating it if needed\n* mixpanel.people.union('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.union({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* // like mixpanel.people.append(), you can append multiple\n* // values to the same list:\n* mixpanel.people.union({\n* list1: ['bob', 'billy']\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] Value / values to merge with the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/*\n * Record that you have charged the current user a certain amount\n * of money. Charges recorded with track_charge() will appear in the\n * Mixpanel revenue report.\n *\n * ### Usage:\n *\n * // charge a user $50\n * mixpanel.people.track_charge(50);\n *\n * // charge a user $30.50 on the 2nd of january\n * mixpanel.people.track_charge(30.50, {\n * '$time': new Date('jan 1 2012')\n * });\n *\n * @param {Number} amount The amount of money charged to the current user\n * @param {Object} [properties] An associative array of properties associated with the charge\n * @param {Function} [callback] If provided, the callback will be called when the server responds\n * @deprecated\n */\nMixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {\n if (!_.isNumber(amount)) {\n amount = parseFloat(amount);\n if (isNaN(amount)) {\n console$1.error('Invalid value passed to mixpanel.people.track_charge - must be a number');\n return;\n }\n }\n\n return this.append('$transactions', _.extend({\n '$amount': amount\n }, properties), callback);\n});\n\n/*\n * Permanently clear all revenue report transactions from the\n * current user's people analytics profile.\n *\n * ### Usage:\n *\n * mixpanel.people.clear_charges();\n *\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n * @deprecated\n */\nMixpanelPeople.prototype.clear_charges = function(callback) {\n return this.set('$transactions', [], callback);\n};\n\n/*\n* Permanently deletes the current people analytics profile from\n* Mixpanel (using the current distinct_id).\n*\n* ### Usage:\n*\n* // remove the all data you have stored about the current user\n* mixpanel.people.delete_user();\n*\n*/\nMixpanelPeople.prototype.delete_user = function() {\n if (!this._identify_called()) {\n console$1.error('mixpanel.people.delete_user() requires you to call identify() first');\n return;\n }\n var data = {'$delete': this._mixpanel.get_distinct_id()};\n return this._send_request(data);\n};\n\nMixpanelPeople.prototype.toString = function() {\n return this._mixpanel.toString() + '.people';\n};\n\nMixpanelPeople.prototype._send_request = function(data, callback) {\n data['$token'] = this._get_config('token');\n data['$distinct_id'] = this._mixpanel.get_distinct_id();\n var device_id = this._mixpanel.get_property('$device_id');\n var user_id = this._mixpanel.get_property('$user_id');\n var had_persisted_distinct_id = this._mixpanel.get_property('$had_persisted_distinct_id');\n if (device_id) {\n data['$device_id'] = device_id;\n }\n if (user_id) {\n data['$user_id'] = user_id;\n }\n if (had_persisted_distinct_id) {\n data['$had_persisted_distinct_id'] = had_persisted_distinct_id;\n }\n\n var date_encoded_data = _.encodeDates(data);\n\n if (!this._identify_called()) {\n this._enqueue(data);\n if (!_.isUndefined(callback)) {\n if (this._get_config('verbose')) {\n callback({status: -1, error: null});\n } else {\n callback(-1);\n }\n }\n return _.truncate(date_encoded_data, 255);\n }\n\n return this._mixpanel._track_or_batch({\n type: 'people',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/' + this._get_config('api_routes')['engage'],\n batcher: this._mixpanel.request_batchers.people\n }, callback);\n};\n\nMixpanelPeople.prototype._get_config = function(conf_var) {\n return this._mixpanel.get_config(conf_var);\n};\n\nMixpanelPeople.prototype._identify_called = function() {\n return this._mixpanel._flags.identify_called === true;\n};\n\n// Queue up engage operations if identify hasn't been called yet.\nMixpanelPeople.prototype._enqueue = function(data) {\n if (SET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, data);\n } else if (SET_ONCE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, data);\n } else if (UNSET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNSET_ACTION, data);\n } else if (ADD_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, data);\n } else if (APPEND_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, data);\n } else if (REMOVE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, data);\n } else if (UNION_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, data);\n } else {\n console$1.error('Invalid call to _enqueue():', data);\n }\n};\n\nMixpanelPeople.prototype._flush_one_queue = function(action, action_method, callback, queue_to_params_fn) {\n var _this = this;\n var queued_data = _.extend({}, this._mixpanel['persistence'].load_queue(action));\n var action_params = queued_data;\n\n if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) {\n _this._mixpanel['persistence']._pop_from_people_queue(action, queued_data);\n _this._mixpanel['persistence'].save();\n if (queue_to_params_fn) {\n action_params = queue_to_params_fn(queued_data);\n }\n action_method.call(_this, action_params, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(action, queued_data);\n }\n if (!_.isUndefined(callback)) {\n callback(response, data);\n }\n });\n }\n};\n\n// Flush queued engage operations - order does not matter,\n// and there are network level race conditions anyway\nMixpanelPeople.prototype._flush = function(\n _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback\n) {\n var _this = this;\n\n this._flush_one_queue(SET_ACTION, this.set, _set_callback);\n this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback);\n this._flush_one_queue(UNSET_ACTION, this.unset, _unset_callback, function(queue) { return _.keys(queue); });\n this._flush_one_queue(ADD_ACTION, this.increment, _add_callback);\n this._flush_one_queue(UNION_ACTION, this.union, _union_callback);\n\n // we have to fire off each $append individually since there is\n // no concat method server side\n var $append_queue = this._mixpanel['persistence'].load_queue(APPEND_ACTION);\n if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {\n var $append_item;\n var append_callback = function(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, $append_item);\n }\n if (!_.isUndefined(_append_callback)) {\n _append_callback(response, data);\n }\n };\n for (var i = $append_queue.length - 1; i >= 0; i--) {\n $append_queue = this._mixpanel['persistence'].load_queue(APPEND_ACTION);\n $append_item = $append_queue.pop();\n _this._mixpanel['persistence'].save();\n if (!_.isEmptyObject($append_item)) {\n _this.append($append_item, append_callback);\n }\n }\n }\n\n // same for $remove\n var $remove_queue = this._mixpanel['persistence'].load_queue(REMOVE_ACTION);\n if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) {\n var $remove_item;\n var remove_callback = function(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, $remove_item);\n }\n if (!_.isUndefined(_remove_callback)) {\n _remove_callback(response, data);\n }\n };\n for (var j = $remove_queue.length - 1; j >= 0; j--) {\n $remove_queue = this._mixpanel['persistence'].load_queue(REMOVE_ACTION);\n $remove_item = $remove_queue.pop();\n _this._mixpanel['persistence'].save();\n if (!_.isEmptyObject($remove_item)) {\n _this.remove($remove_item, remove_callback);\n }\n }\n }\n};\n\nMixpanelPeople.prototype._is_reserved_property = function(prop) {\n return prop === '$distinct_id' || prop === '$token' || prop === '$device_id' || prop === '$user_id' || prop === '$had_persisted_distinct_id';\n};\n\n// MixpanelPeople Exports\nMixpanelPeople.prototype['set'] = MixpanelPeople.prototype.set;\nMixpanelPeople.prototype['set_once'] = MixpanelPeople.prototype.set_once;\nMixpanelPeople.prototype['unset'] = MixpanelPeople.prototype.unset;\nMixpanelPeople.prototype['increment'] = MixpanelPeople.prototype.increment;\nMixpanelPeople.prototype['append'] = MixpanelPeople.prototype.append;\nMixpanelPeople.prototype['remove'] = MixpanelPeople.prototype.remove;\nMixpanelPeople.prototype['union'] = MixpanelPeople.prototype.union;\nMixpanelPeople.prototype['track_charge'] = MixpanelPeople.prototype.track_charge;\nMixpanelPeople.prototype['clear_charges'] = MixpanelPeople.prototype.clear_charges;\nMixpanelPeople.prototype['delete_user'] = MixpanelPeople.prototype.delete_user;\nMixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString;\n\n/* eslint camelcase: \"off\" */\n\n/*\n * Constants\n */\n/** @const */ var SET_QUEUE_KEY = '__mps';\n/** @const */ var SET_ONCE_QUEUE_KEY = '__mpso';\n/** @const */ var UNSET_QUEUE_KEY = '__mpus';\n/** @const */ var ADD_QUEUE_KEY = '__mpa';\n/** @const */ var APPEND_QUEUE_KEY = '__mpap';\n/** @const */ var REMOVE_QUEUE_KEY = '__mpr';\n/** @const */ var UNION_QUEUE_KEY = '__mpu';\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\n/** @const */ var PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id';\n/** @const */ var ALIAS_ID_KEY = '__alias';\n/** @const */ var EVENT_TIMERS_KEY = '__timers';\n/** @const */ var RESERVED_PROPERTIES = [\n SET_QUEUE_KEY,\n SET_ONCE_QUEUE_KEY,\n UNSET_QUEUE_KEY,\n ADD_QUEUE_KEY,\n APPEND_QUEUE_KEY,\n REMOVE_QUEUE_KEY,\n UNION_QUEUE_KEY,\n PEOPLE_DISTINCT_ID_KEY,\n ALIAS_ID_KEY,\n EVENT_TIMERS_KEY\n];\n\n/**\n * Mixpanel Persistence Object\n * @constructor\n */\nvar MixpanelPersistence = function(config) {\n this['props'] = {};\n this.campaign_params_saved = false;\n\n if (config['persistence_name']) {\n this.name = 'mp_' + config['persistence_name'];\n } else {\n this.name = 'mp_' + config['token'] + '_mixpanel';\n }\n\n var storage_type = config['persistence'];\n if (storage_type !== 'cookie' && storage_type !== 'localStorage') {\n console$1.critical('Unknown persistence type ' + storage_type + '; falling back to cookie');\n storage_type = config['persistence'] = 'cookie';\n }\n\n if (storage_type === 'localStorage' && _.localStorage.is_supported()) {\n this.storage = _.localStorage;\n } else {\n this.storage = _.cookie;\n }\n\n this.load();\n this.update_config(config);\n this.upgrade();\n this.save();\n};\n\nMixpanelPersistence.prototype.properties = function() {\n var p = {};\n\n this.load();\n\n // Filter out reserved properties\n _.each(this['props'], function(v, k) {\n if (!_.include(RESERVED_PROPERTIES, k)) {\n p[k] = v;\n }\n });\n return p;\n};\n\nMixpanelPersistence.prototype.load = function() {\n if (this.disabled) { return; }\n\n var entry = this.storage.parse(this.name);\n\n if (entry) {\n this['props'] = _.extend({}, entry);\n }\n};\n\nMixpanelPersistence.prototype.upgrade = function() {\n var old_cookie,\n old_localstorage;\n\n // if transferring from cookie to localStorage or vice-versa, copy existing\n // super properties over to new storage mode\n if (this.storage === _.localStorage) {\n old_cookie = _.cookie.parse(this.name);\n\n _.cookie.remove(this.name);\n _.cookie.remove(this.name, true);\n\n if (old_cookie) {\n this.register_once(old_cookie);\n }\n } else if (this.storage === _.cookie) {\n old_localstorage = _.localStorage.parse(this.name);\n\n _.localStorage.remove(this.name);\n\n if (old_localstorage) {\n this.register_once(old_localstorage);\n }\n }\n};\n\nMixpanelPersistence.prototype.save = function() {\n if (this.disabled) { return; }\n\n this.storage.set(\n this.name,\n _.JSONEncode(this['props']),\n this.expire_days,\n this.cross_subdomain,\n this.secure,\n this.cross_site,\n this.cookie_domain\n );\n};\n\nMixpanelPersistence.prototype.load_prop = function(key) {\n this.load();\n return this['props'][key];\n};\n\nMixpanelPersistence.prototype.remove = function() {\n // remove both domain and subdomain cookies\n this.storage.remove(this.name, false, this.cookie_domain);\n this.storage.remove(this.name, true, this.cookie_domain);\n};\n\n// removes the storage entry and deletes all loaded data\n// forced name for tests\nMixpanelPersistence.prototype.clear = function() {\n this.remove();\n this['props'] = {};\n};\n\n/**\n* @param {Object} props\n* @param {*=} default_value\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register_once = function(props, default_value, days) {\n if (_.isObject(props)) {\n if (typeof(default_value) === 'undefined') { default_value = 'None'; }\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n this.load();\n\n _.each(props, function(val, prop) {\n if (!this['props'].hasOwnProperty(prop) || this['props'][prop] === default_value) {\n this['props'][prop] = val;\n }\n }, this);\n\n this.save();\n\n return true;\n }\n return false;\n};\n\n/**\n* @param {Object} props\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register = function(props, days) {\n if (_.isObject(props)) {\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n this.load();\n _.extend(this['props'], props);\n this.save();\n\n return true;\n }\n return false;\n};\n\nMixpanelPersistence.prototype.unregister = function(prop) {\n this.load();\n if (prop in this['props']) {\n delete this['props'][prop];\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.update_search_keyword = function(referrer) {\n this.register(_.info.searchInfo(referrer));\n};\n\n// EXPORTED METHOD, we test this directly.\nMixpanelPersistence.prototype.update_referrer_info = function(referrer) {\n // If referrer doesn't exist, we want to note the fact that it was type-in traffic.\n this.register_once({\n '$initial_referrer': referrer || '$direct',\n '$initial_referring_domain': _.info.referringDomain(referrer) || '$direct'\n }, '');\n};\n\nMixpanelPersistence.prototype.get_referrer_info = function() {\n return _.strip_empty_properties({\n '$initial_referrer': this['props']['$initial_referrer'],\n '$initial_referring_domain': this['props']['$initial_referring_domain']\n });\n};\n\nMixpanelPersistence.prototype.update_config = function(config) {\n this.default_expiry = this.expire_days = config['cookie_expiration'];\n this.set_disabled(config['disable_persistence']);\n this.set_cookie_domain(config['cookie_domain']);\n this.set_cross_site(config['cross_site_cookie']);\n this.set_cross_subdomain(config['cross_subdomain_cookie']);\n this.set_secure(config['secure_cookie']);\n};\n\nMixpanelPersistence.prototype.set_disabled = function(disabled) {\n this.disabled = disabled;\n if (this.disabled) {\n this.remove();\n } else {\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cookie_domain = function(cookie_domain) {\n if (cookie_domain !== this.cookie_domain) {\n this.remove();\n this.cookie_domain = cookie_domain;\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cross_site = function(cross_site) {\n if (cross_site !== this.cross_site) {\n this.cross_site = cross_site;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cross_subdomain = function(cross_subdomain) {\n if (cross_subdomain !== this.cross_subdomain) {\n this.cross_subdomain = cross_subdomain;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.get_cross_subdomain = function() {\n return this.cross_subdomain;\n};\n\nMixpanelPersistence.prototype.set_secure = function(secure) {\n if (secure !== this.secure) {\n this.secure = secure ? true : false;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._add_to_people_queue = function(queue, data) {\n var q_key = this._get_queue_key(queue),\n q_data = data[queue],\n set_q = this._get_or_create_queue(SET_ACTION),\n set_once_q = this._get_or_create_queue(SET_ONCE_ACTION),\n unset_q = this._get_or_create_queue(UNSET_ACTION),\n add_q = this._get_or_create_queue(ADD_ACTION),\n union_q = this._get_or_create_queue(UNION_ACTION),\n remove_q = this._get_or_create_queue(REMOVE_ACTION, []),\n append_q = this._get_or_create_queue(APPEND_ACTION, []);\n\n if (q_key === SET_QUEUE_KEY) {\n // Update the set queue - we can override any existing values\n _.extend(set_q, q_data);\n // if there was a pending increment, override it\n // with the set.\n this._pop_from_people_queue(ADD_ACTION, q_data);\n // if there was a pending union, override it\n // with the set.\n this._pop_from_people_queue(UNION_ACTION, q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === SET_ONCE_QUEUE_KEY) {\n // only queue the data if there is not already a set_once call for it.\n _.each(q_data, function(v, k) {\n if (!(k in set_once_q)) {\n set_once_q[k] = v;\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNSET_QUEUE_KEY) {\n _.each(q_data, function(prop) {\n\n // undo previously-queued actions on this key\n _.each([set_q, set_once_q, add_q, union_q], function(enqueued_obj) {\n if (prop in enqueued_obj) {\n delete enqueued_obj[prop];\n }\n });\n _.each(append_q, function(append_obj) {\n if (prop in append_obj) {\n delete append_obj[prop];\n }\n });\n\n unset_q[prop] = true;\n\n });\n } else if (q_key === ADD_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n // If it exists in the set queue, increment\n // the value\n if (k in set_q) {\n set_q[k] += v;\n } else {\n // If it doesn't exist, update the add\n // queue\n if (!(k in add_q)) {\n add_q[k] = 0;\n }\n add_q[k] += v;\n }\n }, this);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNION_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n if (_.isArray(v)) {\n if (!(k in union_q)) {\n union_q[k] = [];\n }\n // We may send duplicates, the server will dedup them.\n union_q[k] = union_q[k].concat(v);\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === REMOVE_QUEUE_KEY) {\n remove_q.push(q_data);\n this._pop_from_people_queue(APPEND_ACTION, q_data);\n } else if (q_key === APPEND_QUEUE_KEY) {\n append_q.push(q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n }\n\n console$1.log('MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):');\n console$1.log(data);\n\n this.save();\n};\n\nMixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {\n var q = this['props'][this._get_queue_key(queue)];\n if (!_.isUndefined(q)) {\n _.each(data, function(v, k) {\n if (queue === APPEND_ACTION || queue === REMOVE_ACTION) {\n // list actions: only remove if both k+v match\n // e.g. remove should not override append in a case like\n // append({foo: 'bar'}); remove({foo: 'qux'})\n _.each(q, function(queued_action) {\n if (queued_action[k] === v) {\n delete queued_action[k];\n }\n });\n } else {\n delete q[k];\n }\n }, this);\n }\n};\n\nMixpanelPersistence.prototype.load_queue = function(queue) {\n return this.load_prop(this._get_queue_key(queue));\n};\n\nMixpanelPersistence.prototype._get_queue_key = function(queue) {\n if (queue === SET_ACTION) {\n return SET_QUEUE_KEY;\n } else if (queue === SET_ONCE_ACTION) {\n return SET_ONCE_QUEUE_KEY;\n } else if (queue === UNSET_ACTION) {\n return UNSET_QUEUE_KEY;\n } else if (queue === ADD_ACTION) {\n return ADD_QUEUE_KEY;\n } else if (queue === APPEND_ACTION) {\n return APPEND_QUEUE_KEY;\n } else if (queue === REMOVE_ACTION) {\n return REMOVE_QUEUE_KEY;\n } else if (queue === UNION_ACTION) {\n return UNION_QUEUE_KEY;\n } else {\n console$1.error('Invalid queue:', queue);\n }\n};\n\nMixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) {\n var key = this._get_queue_key(queue);\n default_val = _.isUndefined(default_val) ? {} : default_val;\n return this['props'][key] || (this['props'][key] = default_val);\n};\n\nMixpanelPersistence.prototype.set_event_timer = function(event_name, timestamp) {\n var timers = this.load_prop(EVENT_TIMERS_KEY) || {};\n timers[event_name] = timestamp;\n this['props'][EVENT_TIMERS_KEY] = timers;\n this.save();\n};\n\nMixpanelPersistence.prototype.remove_event_timer = function(event_name) {\n var timers = this.load_prop(EVENT_TIMERS_KEY) || {};\n var timestamp = timers[event_name];\n if (!_.isUndefined(timestamp)) {\n delete this['props'][EVENT_TIMERS_KEY][event_name];\n this.save();\n }\n return timestamp;\n};\n\n/* eslint camelcase: \"off\" */\n\n/*\n * Mixpanel JS Library\n *\n * Copyright 2012, Mixpanel, Inc. All Rights Reserved\n * http://mixpanel.com/\n *\n * Includes portions of Underscore.js\n * http://documentcloud.github.com/underscore/\n * (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.\n * Released under the MIT License.\n */\n\n// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @output_file_name mixpanel-2.8.min.js\n// ==/ClosureCompiler==\n\n/*\nSIMPLE STYLE GUIDE:\n\nthis.x === public function\nthis._x === internal - only use within this file\nthis.__x === private - only use within the class\n\nGlobals should be all caps\n*/\n\nvar init_type; // MODULE or SNIPPET loader\n// allow bundlers to specify how extra code (recorder bundle) should be loaded\n// eslint-disable-next-line no-unused-vars\nvar load_extra_bundle = function(src, _onload) {\n throw new Error(src + ' not available in this build.');\n};\n\nvar mixpanel_master; // main mixpanel instance / object\nvar INIT_MODULE = 0;\nvar INIT_SNIPPET = 1;\n\nvar IDENTITY_FUNC = function(x) {return x;};\nvar NOOP_FUNC = function() {};\n\n/** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';\n/** @const */ var PAYLOAD_TYPE_BASE64 = 'base64';\n/** @const */ var PAYLOAD_TYPE_JSON = 'json';\n/** @const */ var DEVICE_ID_PREFIX = '$device:';\n\n\n/*\n * Dynamic... constants? Is that an oxymoron?\n */\n// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/\n// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#withCredentials\nvar USE_XHR = (win.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest());\n\n// IE<10 does not support cross-origin XHR's but script tags\n// with defer won't block window.onload; ENQUEUE_REQUESTS\n// should only be true for Opera<12\nvar ENQUEUE_REQUESTS = !USE_XHR && (userAgent.indexOf('MSIE') === -1) && (userAgent.indexOf('Mozilla') === -1);\n\n// save reference to navigator.sendBeacon so it can be minified\nvar sendBeacon = null;\nif (navigator['sendBeacon']) {\n sendBeacon = function() {\n // late reference to navigator.sendBeacon to allow patching/spying\n return navigator['sendBeacon'].apply(navigator, arguments);\n };\n}\n\nvar DEFAULT_API_ROUTES = {\n 'track': 'track/',\n 'engage': 'engage/',\n 'groups': 'groups/',\n 'record': 'record/'\n};\n\n/*\n * Module-level globals\n */\nvar DEFAULT_CONFIG = {\n 'api_host': 'https://api-js.mixpanel.com',\n 'api_routes': DEFAULT_API_ROUTES,\n 'api_method': 'POST',\n 'api_transport': 'XHR',\n 'api_payload_format': PAYLOAD_TYPE_BASE64,\n 'app_host': 'https://mixpanel.com',\n 'cdn': 'https://cdn.mxpnl.com',\n 'cross_site_cookie': false,\n 'cross_subdomain_cookie': true,\n 'error_reporter': NOOP_FUNC,\n 'persistence': 'cookie',\n 'persistence_name': '',\n 'cookie_domain': '',\n 'cookie_name': '',\n 'loaded': NOOP_FUNC,\n 'mp_loader': null,\n 'track_marketing': true,\n 'track_pageview': false,\n 'skip_first_touch_marketing': false,\n 'store_google': true,\n 'stop_utm_persistence': false,\n 'save_referrer': true,\n 'test': false,\n 'verbose': false,\n 'img': false,\n 'debug': false,\n 'track_links_timeout': 300,\n 'cookie_expiration': 365,\n 'upgrade': false,\n 'disable_persistence': false,\n 'disable_cookie': false,\n 'secure_cookie': false,\n 'ip': true,\n 'opt_out_tracking_by_default': false,\n 'opt_out_persistence_by_default': false,\n 'opt_out_tracking_persistence_type': 'localStorage',\n 'opt_out_tracking_cookie_prefix': null,\n 'property_blacklist': [],\n 'xhr_headers': {}, // { header: value, header2: value }\n 'ignore_dnt': false,\n 'batch_requests': true,\n 'batch_size': 50,\n 'batch_flush_interval_ms': 5000,\n 'batch_request_timeout_ms': 90000,\n 'batch_autostart': true,\n 'hooks': {},\n 'record_block_class': new RegExp('^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$'),\n 'record_block_selector': 'img, video',\n 'record_collect_fonts': false,\n 'record_idle_timeout_ms': 30 * 60 * 1000, // 30 minutes\n 'record_inline_images': false,\n 'record_mask_text_class': new RegExp('^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$'),\n 'record_mask_text_selector': '*',\n 'record_max_ms': MAX_RECORDING_MS,\n 'record_min_ms': 0,\n 'record_sessions_percent': 0,\n 'recorder_src': 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js'\n};\n\nvar DOM_LOADED = false;\n\n/**\n * Mixpanel Library Object\n * @constructor\n */\nvar MixpanelLib = function() {};\n\n\n/**\n * create_mplib(token:string, config:object, name:string)\n *\n * This function is used by the init method of MixpanelLib objects\n * as well as the main initializer at the end of the JSLib (that\n * initializes document.mixpanel as well as any additional instances\n * declared before this file has loaded).\n */\nvar create_mplib = function(token, config, name) {\n var instance,\n target = (name === PRIMARY_INSTANCE_NAME) ? mixpanel_master : mixpanel_master[name];\n\n if (target && init_type === INIT_MODULE) {\n instance = target;\n } else {\n if (target && !_.isArray(target)) {\n console$1.error('You have already initialized ' + name);\n return;\n }\n instance = new MixpanelLib();\n }\n\n instance._cached_groups = {}; // cache groups in a pool\n\n instance._init(token, config, name);\n\n instance['people'] = new MixpanelPeople();\n instance['people']._init(instance);\n\n if (!instance.get_config('skip_first_touch_marketing')) {\n // We need null UTM params in the object because\n // UTM parameters act as a tuple. If any UTM param\n // is present, then we set all UTM params including\n // empty ones together\n var utm_params = _.info.campaignParams(null);\n var initial_utm_params = {};\n var has_utm = false;\n _.each(utm_params, function(utm_value, utm_key) {\n initial_utm_params['initial_' + utm_key] = utm_value;\n if (utm_value) {\n has_utm = true;\n }\n });\n if (has_utm) {\n instance['people'].set_once(initial_utm_params);\n }\n }\n\n // if any instance on the page has debug = true, we set the\n // global debug to be true\n Config.DEBUG = Config.DEBUG || instance.get_config('debug');\n\n // if target is not defined, we called init after the lib already\n // loaded, so there won't be an array of things to execute\n if (!_.isUndefined(target) && _.isArray(target)) {\n // Crunch through the people queue first - we queue this data up &\n // flush on identify, so it's better to do all these operations first\n instance._execute_array.call(instance['people'], target['people']);\n instance._execute_array(target);\n }\n\n return instance;\n};\n\n// Initialization methods\n\n/**\n * This function initializes a new instance of the Mixpanel tracking object.\n * All new instances are added to the main mixpanel object as sub properties (such as\n * mixpanel.library_name) and also returned by this function. To define a\n * second instance on the page, you would call:\n *\n * mixpanel.init('new token', { your: 'config' }, 'library_name');\n *\n * and use it like so:\n *\n * mixpanel.library_name.track(...);\n *\n * @param {String} token Your Mixpanel API token\n * @param {Object} [config] A dictionary of config options to override. See a list of default config options.\n * @param {String} [name] The name for the new mixpanel instance that you want created\n */\nMixpanelLib.prototype.init = function (token, config, name) {\n if (_.isUndefined(name)) {\n this.report_error('You must name your new library: init(token, config, name)');\n return;\n }\n if (name === PRIMARY_INSTANCE_NAME) {\n this.report_error('You must initialize the main mixpanel object right after you include the Mixpanel js snippet');\n return;\n }\n\n var instance = create_mplib(token, config, name);\n mixpanel_master[name] = instance;\n instance._loaded();\n\n return instance;\n};\n\n// mixpanel._init(token:string, config:object, name:string)\n//\n// This function sets up the current instance of the mixpanel\n// library. The difference between this method and the init(...)\n// method is this one initializes the actual instance, whereas the\n// init(...) method sets up a new library and calls _init on it.\n//\nMixpanelLib.prototype._init = function(token, config, name) {\n config = config || {};\n\n this['__loaded'] = true;\n this['config'] = {};\n\n var variable_features = {};\n\n // default to JSON payload for standard mixpanel.com API hosts\n if (!('api_payload_format' in config)) {\n var api_host = config['api_host'] || DEFAULT_CONFIG['api_host'];\n if (api_host.match(/\\.mixpanel\\.com/)) {\n variable_features['api_payload_format'] = PAYLOAD_TYPE_JSON;\n }\n }\n\n this.set_config(_.extend({}, DEFAULT_CONFIG, variable_features, config, {\n 'name': name,\n 'token': token,\n 'callback_fn': ((name === PRIMARY_INSTANCE_NAME) ? name : PRIMARY_INSTANCE_NAME + '.' + name) + '._jsc'\n }));\n\n this['_jsc'] = NOOP_FUNC;\n\n this.__dom_loaded_queue = [];\n this.__request_queue = [];\n this.__disabled_events = [];\n this._flags = {\n 'disable_all_events': false,\n 'identify_called': false\n };\n\n // set up request queueing/batching\n this.request_batchers = {};\n this._batch_requests = this.get_config('batch_requests');\n if (this._batch_requests) {\n if (!_.localStorage.is_supported(true) || !USE_XHR) {\n this._batch_requests = false;\n console$1.log('Turning off Mixpanel request-queueing; needs XHR and localStorage support');\n _.each(this.get_batcher_configs(), function(batcher_config) {\n console$1.log('Clearing batch queue ' + batcher_config.queue_key);\n _.localStorage.remove(batcher_config.queue_key);\n });\n } else {\n this.init_batchers();\n if (sendBeacon && win.addEventListener) {\n // Before page closes or hides (user tabs away etc), attempt to flush any events\n // queued up via navigator.sendBeacon. Since sendBeacon doesn't report success/failure,\n // events will not be removed from the persistent store; if the site is loaded again,\n // the events will be flushed again on startup and deduplicated on the Mixpanel server\n // side.\n // There is no reliable way to capture only page close events, so we lean on the\n // visibilitychange and pagehide events as recommended at\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event#usage_notes.\n // These events fire when the user clicks away from the current page/tab, so will occur\n // more frequently than page unload, but are the only mechanism currently for capturing\n // this scenario somewhat reliably.\n var flush_on_unload = _.bind(function() {\n if (!this.request_batchers.events.stopped) {\n this.request_batchers.events.flush({unloading: true});\n }\n }, this);\n win.addEventListener('pagehide', function(ev) {\n if (ev['persisted']) {\n flush_on_unload();\n }\n });\n win.addEventListener('visibilitychange', function() {\n if (document$1['visibilityState'] === 'hidden') {\n flush_on_unload();\n }\n });\n }\n }\n }\n\n this['persistence'] = this['cookie'] = new MixpanelPersistence(this['config']);\n this.unpersisted_superprops = {};\n this._gdpr_init();\n\n var uuid = _.UUID();\n if (!this.get_distinct_id()) {\n // There is no need to set the distinct id\n // or the device id if something was already stored\n // in the persitence\n this.register_once({\n 'distinct_id': DEVICE_ID_PREFIX + uuid,\n '$device_id': uuid\n }, '');\n }\n\n var track_pageview_option = this.get_config('track_pageview');\n if (track_pageview_option) {\n this._init_url_change_tracking(track_pageview_option);\n }\n\n if (this.get_config('record_sessions_percent') > 0 && Math.random() * 100 <= this.get_config('record_sessions_percent')) {\n this.start_session_recording();\n }\n};\n\nMixpanelLib.prototype.start_session_recording = addOptOutCheckMixpanelLib(function () {\n if (!win['MutationObserver']) {\n console$1.critical('Browser does not support MutationObserver; skipping session recording');\n return;\n }\n\n var handleLoadedRecorder = _.bind(function() {\n this._recorder = this._recorder || new win['__mp_recorder'](this);\n this._recorder['startRecording']();\n }, this);\n\n if (_.isUndefined(win['__mp_recorder'])) {\n load_extra_bundle(this.get_config('recorder_src'), handleLoadedRecorder);\n } else {\n handleLoadedRecorder();\n }\n});\n\nMixpanelLib.prototype.stop_session_recording = function () {\n if (this._recorder) {\n this._recorder['stopRecording']();\n } else {\n console$1.critical('Session recorder module not loaded');\n }\n};\n\nMixpanelLib.prototype.get_session_recording_properties = function () {\n var props = {};\n if (this._recorder) {\n var replay_id = this._recorder['replayId'];\n if (replay_id) {\n props['$mp_replay_id'] = replay_id;\n }\n }\n return props;\n};\n\n// Private methods\n\nMixpanelLib.prototype._loaded = function() {\n this.get_config('loaded')(this);\n this._set_default_superprops();\n this['people'].set_once(this['persistence'].get_referrer_info());\n\n // `store_google` is now deprecated and previously stored UTM parameters are cleared\n // from persistence by default.\n if (this.get_config('store_google') && this.get_config('stop_utm_persistence')) {\n var utm_params = _.info.campaignParams(null);\n _.each(utm_params, function(_utm_value, utm_key) {\n // We need to unregister persisted UTM parameters so old values\n // are not mixed with the new UTM parameters\n this.unregister(utm_key);\n }.bind(this));\n }\n};\n\n// update persistence with info on referrer, UTM params, etc\nMixpanelLib.prototype._set_default_superprops = function() {\n this['persistence'].update_search_keyword(document$1.referrer);\n // Registering super properties for UTM persistence by 'store_google' is deprecated.\n if (this.get_config('store_google') && !this.get_config('stop_utm_persistence')) {\n this.register(_.info.campaignParams());\n }\n if (this.get_config('save_referrer')) {\n this['persistence'].update_referrer_info(document$1.referrer);\n }\n};\n\nMixpanelLib.prototype._dom_loaded = function() {\n _.each(this.__dom_loaded_queue, function(item) {\n this._track_dom.apply(this, item);\n }, this);\n\n if (!this.has_opted_out_tracking()) {\n _.each(this.__request_queue, function(item) {\n this._send_request.apply(this, item);\n }, this);\n }\n\n delete this.__dom_loaded_queue;\n delete this.__request_queue;\n};\n\nMixpanelLib.prototype._track_dom = function(DomClass, args) {\n if (this.get_config('img')) {\n this.report_error('You can\\'t use DOM tracking functions with img = true.');\n return false;\n }\n\n if (!DOM_LOADED) {\n this.__dom_loaded_queue.push([DomClass, args]);\n return false;\n }\n\n var dt = new DomClass().init(this);\n return dt.track.apply(dt, args);\n};\n\nMixpanelLib.prototype._init_url_change_tracking = function(track_pageview_option) {\n var previous_tracked_url = '';\n var tracked = this.track_pageview();\n if (tracked) {\n previous_tracked_url = _.info.currentUrl();\n }\n\n if (_.include(['full-url', 'url-with-path-and-query-string', 'url-with-path'], track_pageview_option)) {\n win.addEventListener('popstate', function() {\n win.dispatchEvent(new Event('mp_locationchange'));\n });\n win.addEventListener('hashchange', function() {\n win.dispatchEvent(new Event('mp_locationchange'));\n });\n var nativePushState = win.history.pushState;\n if (typeof nativePushState === 'function') {\n win.history.pushState = function(state, unused, url) {\n nativePushState.call(win.history, state, unused, url);\n win.dispatchEvent(new Event('mp_locationchange'));\n };\n }\n var nativeReplaceState = win.history.replaceState;\n if (typeof nativeReplaceState === 'function') {\n win.history.replaceState = function(state, unused, url) {\n nativeReplaceState.call(win.history, state, unused, url);\n win.dispatchEvent(new Event('mp_locationchange'));\n };\n }\n win.addEventListener('mp_locationchange', function() {\n var current_url = _.info.currentUrl();\n var should_track = false;\n if (track_pageview_option === 'full-url') {\n should_track = current_url !== previous_tracked_url;\n } else if (track_pageview_option === 'url-with-path-and-query-string') {\n should_track = current_url.split('#')[0] !== previous_tracked_url.split('#')[0];\n } else if (track_pageview_option === 'url-with-path') {\n should_track = current_url.split('#')[0].split('?')[0] !== previous_tracked_url.split('#')[0].split('?')[0];\n }\n\n if (should_track) {\n var tracked = this.track_pageview();\n if (tracked) {\n previous_tracked_url = current_url;\n }\n }\n }.bind(this));\n }\n};\n\n/**\n * _prepare_callback() should be called by callers of _send_request for use\n * as the callback argument.\n *\n * If there is no callback, this returns null.\n * If we are going to make XHR/XDR requests, this returns a function.\n * If we are going to use script tags, this returns a string to use as the\n * callback GET param.\n */\nMixpanelLib.prototype._prepare_callback = function(callback, data) {\n if (_.isUndefined(callback)) {\n return null;\n }\n\n if (USE_XHR) {\n var callback_function = function(response) {\n callback(response, data);\n };\n return callback_function;\n } else {\n // if the user gives us a callback, we store as a random\n // property on this instances jsc function and update our\n // callback string to reflect that.\n var jsc = this['_jsc'];\n var randomized_cb = '' + Math.floor(Math.random() * 100000000);\n var callback_string = this.get_config('callback_fn') + '[' + randomized_cb + ']';\n jsc[randomized_cb] = function(response) {\n delete jsc[randomized_cb];\n callback(response, data);\n };\n return callback_string;\n }\n};\n\nMixpanelLib.prototype._send_request = function(url, data, options, callback) {\n var succeeded = true;\n\n if (ENQUEUE_REQUESTS) {\n this.__request_queue.push(arguments);\n return succeeded;\n }\n\n var DEFAULT_OPTIONS = {\n method: this.get_config('api_method'),\n transport: this.get_config('api_transport'),\n verbose: this.get_config('verbose')\n };\n var body_data = null;\n\n if (!callback && (_.isFunction(options) || typeof options === 'string')) {\n callback = options;\n options = null;\n }\n options = _.extend(DEFAULT_OPTIONS, options || {});\n if (!USE_XHR) {\n options.method = 'GET';\n }\n var use_post = options.method === 'POST';\n var use_sendBeacon = sendBeacon && use_post && options.transport.toLowerCase() === 'sendbeacon';\n\n // needed to correctly format responses\n var verbose_mode = options.verbose;\n if (data['verbose']) { verbose_mode = true; }\n\n if (this.get_config('test')) { data['test'] = 1; }\n if (verbose_mode) { data['verbose'] = 1; }\n if (this.get_config('img')) { data['img'] = 1; }\n if (!USE_XHR) {\n if (callback) {\n data['callback'] = callback;\n } else if (verbose_mode || this.get_config('test')) {\n // Verbose output (from verbose mode, or an error in test mode) is a json blob,\n // which by itself is not valid javascript. Without a callback, this verbose output will\n // cause an error when returned via jsonp, so we force a no-op callback param.\n // See the ECMA script spec: http://www.ecma-international.org/ecma-262/5.1/#sec-12.4\n data['callback'] = '(function(){})';\n }\n }\n\n data['ip'] = this.get_config('ip')?1:0;\n data['_'] = new Date().getTime().toString();\n\n if (use_post) {\n body_data = 'data=' + encodeURIComponent(data['data']);\n delete data['data'];\n }\n\n url += '?' + _.HTTPBuildQuery(data);\n\n var lib = this;\n if ('img' in data) {\n var img = document$1.createElement('img');\n img.src = url;\n document$1.body.appendChild(img);\n } else if (use_sendBeacon) {\n try {\n succeeded = sendBeacon(url, body_data);\n } catch (e) {\n lib.report_error(e);\n succeeded = false;\n }\n try {\n if (callback) {\n callback(succeeded ? 1 : 0);\n }\n } catch (e) {\n lib.report_error(e);\n }\n } else if (USE_XHR) {\n try {\n var req = new XMLHttpRequest();\n req.open(options.method, url, true);\n\n var headers = this.get_config('xhr_headers');\n if (use_post) {\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n }\n _.each(headers, function(headerValue, headerName) {\n req.setRequestHeader(headerName, headerValue);\n });\n\n if (options.timeout_ms && typeof req.timeout !== 'undefined') {\n req.timeout = options.timeout_ms;\n var start_time = new Date().getTime();\n }\n\n // send the mp_optout cookie\n // withCredentials cannot be modified until after calling .open on Android and Mobile Safari\n req.withCredentials = true;\n req.onreadystatechange = function () {\n if (req.readyState === 4) { // XMLHttpRequest.DONE == 4, except in safari 4\n if (req.status === 200) {\n if (callback) {\n if (verbose_mode) {\n var response;\n try {\n response = _.JSONDecode(req.responseText);\n } catch (e) {\n lib.report_error(e);\n if (options.ignore_json_errors) {\n response = req.responseText;\n } else {\n return;\n }\n }\n callback(response);\n } else {\n callback(Number(req.responseText));\n }\n }\n } else {\n var error;\n if (\n req.timeout &&\n !req.status &&\n new Date().getTime() - start_time >= req.timeout\n ) {\n error = 'timeout';\n } else {\n error = 'Bad HTTP status: ' + req.status + ' ' + req.statusText;\n }\n lib.report_error(error);\n if (callback) {\n if (verbose_mode) {\n var response_headers = req['responseHeaders'] || {};\n callback({status: 0, httpStatusCode: req['status'], error: error, retryAfter: response_headers['Retry-After']});\n } else {\n callback(0);\n }\n }\n }\n }\n };\n req.send(body_data);\n } catch (e) {\n lib.report_error(e);\n succeeded = false;\n }\n } else {\n var script = document$1.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n var s = document$1.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(script, s);\n }\n\n return succeeded;\n};\n\n/**\n * _execute_array() deals with processing any mixpanel function\n * calls that were called before the Mixpanel library were loaded\n * (and are thus stored in an array so they can be called later)\n *\n * Note: we fire off all the mixpanel function calls && user defined\n * functions BEFORE we fire off mixpanel tracking calls. This is so\n * identify/register/set_config calls can properly modify early\n * tracking calls.\n *\n * @param {Array} array\n */\nMixpanelLib.prototype._execute_array = function(array) {\n var fn_name, alias_calls = [], other_calls = [], tracking_calls = [];\n _.each(array, function(item) {\n if (item) {\n fn_name = item[0];\n if (_.isArray(fn_name)) {\n tracking_calls.push(item); // chained call e.g. mixpanel.get_group().set()\n } else if (typeof(item) === 'function') {\n item.call(this);\n } else if (_.isArray(item) && fn_name === 'alias') {\n alias_calls.push(item);\n } else if (_.isArray(item) && fn_name.indexOf('track') !== -1 && typeof(this[fn_name]) === 'function') {\n tracking_calls.push(item);\n } else {\n other_calls.push(item);\n }\n }\n }, this);\n\n var execute = function(calls, context) {\n _.each(calls, function(item) {\n if (_.isArray(item[0])) {\n // chained call\n var caller = context;\n _.each(item, function(call) {\n caller = caller[call[0]].apply(caller, call.slice(1));\n });\n } else {\n this[item[0]].apply(this, item.slice(1));\n }\n }, context);\n };\n\n execute(alias_calls, this);\n execute(other_calls, this);\n execute(tracking_calls, this);\n};\n\n// request queueing utils\n\nMixpanelLib.prototype.are_batchers_initialized = function() {\n return !!this.request_batchers.events;\n};\n\nMixpanelLib.prototype.get_batcher_configs = function() {\n var queue_prefix = '__mpq_' + this.get_config('token');\n var api_routes = this.get_config('api_routes');\n this._batcher_configs = this._batcher_configs || {\n events: {type: 'events', endpoint: '/' + api_routes['track'], queue_key: queue_prefix + '_ev'},\n people: {type: 'people', endpoint: '/' + api_routes['engage'], queue_key: queue_prefix + '_pp'},\n groups: {type: 'groups', endpoint: '/' + api_routes['groups'], queue_key: queue_prefix + '_gr'}\n };\n return this._batcher_configs;\n};\n\nMixpanelLib.prototype.init_batchers = function() {\n if (!this.are_batchers_initialized()) {\n var batcher_for = _.bind(function(attrs) {\n return new RequestBatcher(\n attrs.queue_key,\n {\n libConfig: this['config'],\n errorReporter: this.get_config('error_reporter'),\n sendRequestFunc: _.bind(function(data, options, cb) {\n this._send_request(\n this.get_config('api_host') + attrs.endpoint,\n this._encode_data_for_request(data),\n options,\n this._prepare_callback(cb, data)\n );\n }, this),\n beforeSendHook: _.bind(function(item) {\n return this._run_hook('before_send_' + attrs.type, item);\n }, this),\n stopAllBatchingFunc: _.bind(this.stop_batch_senders, this),\n usePersistence: true\n }\n );\n }, this);\n var batcher_configs = this.get_batcher_configs();\n this.request_batchers = {\n events: batcher_for(batcher_configs.events),\n people: batcher_for(batcher_configs.people),\n groups: batcher_for(batcher_configs.groups)\n };\n }\n if (this.get_config('batch_autostart')) {\n this.start_batch_senders();\n }\n};\n\nMixpanelLib.prototype.start_batch_senders = function() {\n this._batchers_were_started = true;\n if (this.are_batchers_initialized()) {\n this._batch_requests = true;\n _.each(this.request_batchers, function(batcher) {\n batcher.start();\n });\n }\n};\n\nMixpanelLib.prototype.stop_batch_senders = function() {\n this._batch_requests = false;\n _.each(this.request_batchers, function(batcher) {\n batcher.stop();\n batcher.clear();\n });\n};\n\n/**\n * push() keeps the standard async-array-push\n * behavior around after the lib is loaded.\n * This is only useful for external integrations that\n * do not wish to rely on our convenience methods\n * (created in the snippet).\n *\n * ### Usage:\n * mixpanel.push(['register', { a: 'b' }]);\n *\n * @param {Array} item A [function_name, args...] array to be executed\n */\nMixpanelLib.prototype.push = function(item) {\n this._execute_array([item]);\n};\n\n/**\n * Disable events on the Mixpanel object. If passed no arguments,\n * this function disables tracking of any event. If passed an\n * array of event names, those events will be disabled, but other\n * events will continue to be tracked.\n *\n * Note: this function does not stop other mixpanel functions from\n * firing, such as register() or people.set().\n *\n * @param {Array} [events] An array of event names to disable\n */\nMixpanelLib.prototype.disable = function(events) {\n if (typeof(events) === 'undefined') {\n this._flags.disable_all_events = true;\n } else {\n this.__disabled_events = this.__disabled_events.concat(events);\n }\n};\n\nMixpanelLib.prototype._encode_data_for_request = function(data) {\n var encoded_data = _.JSONEncode(data);\n if (this.get_config('api_payload_format') === PAYLOAD_TYPE_BASE64) {\n encoded_data = _.base64Encode(encoded_data);\n }\n return {'data': encoded_data};\n};\n\n// internal method for handling track vs batch-enqueue logic\nMixpanelLib.prototype._track_or_batch = function(options, callback) {\n var truncated_data = _.truncate(options.data, 255);\n var endpoint = options.endpoint;\n var batcher = options.batcher;\n var should_send_immediately = options.should_send_immediately;\n var send_request_options = options.send_request_options || {};\n callback = callback || NOOP_FUNC;\n\n var request_enqueued_or_initiated = true;\n var send_request_immediately = _.bind(function() {\n if (!send_request_options.skip_hooks) {\n truncated_data = this._run_hook('before_send_' + options.type, truncated_data);\n }\n if (truncated_data) {\n console$1.log('MIXPANEL REQUEST:');\n console$1.log(truncated_data);\n return this._send_request(\n endpoint,\n this._encode_data_for_request(truncated_data),\n send_request_options,\n this._prepare_callback(callback, truncated_data)\n );\n } else {\n return null;\n }\n }, this);\n\n if (this._batch_requests && !should_send_immediately) {\n batcher.enqueue(truncated_data, function(succeeded) {\n if (succeeded) {\n callback(1, truncated_data);\n } else {\n send_request_immediately();\n }\n });\n } else {\n request_enqueued_or_initiated = send_request_immediately();\n }\n\n return request_enqueued_or_initiated && truncated_data;\n};\n\n/**\n * Track an event. This is the most important and\n * frequently used Mixpanel function.\n *\n * ### Usage:\n *\n * // track an event named 'Registered'\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * // track an event using navigator.sendBeacon\n * mixpanel.track('Left page', {'duration_seconds': 35}, {transport: 'sendBeacon'});\n *\n * To track link clicks or form submissions, see track_links() or track_forms().\n *\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Object} [options] Optional configuration for this track request.\n * @param {String} [options.transport] Transport method for network request ('xhr' or 'sendBeacon').\n * @param {Boolean} [options.send_immediately] Whether to bypass batching/queueing and send track request immediately.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object\n * with the tracking payload sent to the API server is returned; otherwise false.\n */\nMixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, properties, options, callback) {\n if (!callback && typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n var transport = options['transport']; // external API, don't minify 'transport' prop\n if (transport) {\n options.transport = transport; // 'transport' prop name can be minified internally\n }\n var should_send_immediately = options['send_immediately'];\n if (typeof callback !== 'function') {\n callback = NOOP_FUNC;\n }\n\n if (_.isUndefined(event_name)) {\n this.report_error('No event name provided to mixpanel.track');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n callback(0);\n return;\n }\n\n // set defaults\n properties = _.extend({}, properties);\n properties['token'] = this.get_config('token');\n\n // set $duration if time_event was previously called for this event\n var start_timestamp = this['persistence'].remove_event_timer(event_name);\n if (!_.isUndefined(start_timestamp)) {\n var duration_in_ms = new Date().getTime() - start_timestamp;\n properties['$duration'] = parseFloat((duration_in_ms / 1000).toFixed(3));\n }\n\n this._set_default_superprops();\n\n var marketing_properties = this.get_config('track_marketing')\n ? _.info.marketingParams()\n : {};\n\n // note: extend writes to the first object, so lets make sure we\n // don't write to the persistence properties object and info\n // properties object by passing in a new object\n\n // update properties with pageview info and super-properties\n properties = _.extend(\n {},\n _.info.properties({'mp_loader': this.get_config('mp_loader')}),\n marketing_properties,\n this['persistence'].properties(),\n this.unpersisted_superprops,\n this.get_session_recording_properties(),\n properties\n );\n\n var property_blacklist = this.get_config('property_blacklist');\n if (_.isArray(property_blacklist)) {\n _.each(property_blacklist, function(blacklisted_prop) {\n delete properties[blacklisted_prop];\n });\n } else {\n this.report_error('Invalid value for property_blacklist config: ' + property_blacklist);\n }\n\n var data = {\n 'event': event_name,\n 'properties': properties\n };\n var ret = this._track_or_batch({\n type: 'events',\n data: data,\n endpoint: this.get_config('api_host') + '/' + this.get_config('api_routes')['track'],\n batcher: this.request_batchers.events,\n should_send_immediately: should_send_immediately,\n send_request_options: options\n }, callback);\n\n return ret;\n});\n\n/**\n * Register the current user into one/many groups.\n *\n * ### Usage:\n *\n * mixpanel.set_group('company', ['mixpanel', 'google']) // an array of IDs\n * mixpanel.set_group('company', 'mixpanel')\n * mixpanel.set_group('company', 128746312)\n *\n * @param {String} group_key Group key\n * @param {Array|String|Number} group_ids An array of group IDs, or a singular group ID\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n *\n */\nMixpanelLib.prototype.set_group = addOptOutCheckMixpanelLib(function(group_key, group_ids, callback) {\n if (!_.isArray(group_ids)) {\n group_ids = [group_ids];\n }\n var prop = {};\n prop[group_key] = group_ids;\n this.register(prop);\n return this['people'].set(group_key, group_ids, callback);\n});\n\n/**\n * Add a new group for this user.\n *\n * ### Usage:\n *\n * mixpanel.add_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.add_group = addOptOutCheckMixpanelLib(function(group_key, group_id, callback) {\n var old_values = this.get_property(group_key);\n var prop = {};\n if (old_values === undefined) {\n prop[group_key] = [group_id];\n this.register(prop);\n } else {\n if (old_values.indexOf(group_id) === -1) {\n old_values.push(group_id);\n prop[group_key] = old_values;\n this.register(prop);\n }\n }\n return this['people'].union(group_key, group_id, callback);\n});\n\n/**\n * Remove a group from this user.\n *\n * ### Usage:\n *\n * mixpanel.remove_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.remove_group = addOptOutCheckMixpanelLib(function(group_key, group_id, callback) {\n var old_value = this.get_property(group_key);\n // if the value doesn't exist, the persistent store is unchanged\n if (old_value !== undefined) {\n var idx = old_value.indexOf(group_id);\n if (idx > -1) {\n old_value.splice(idx, 1);\n this.register({group_key: old_value});\n }\n if (old_value.length === 0) {\n this.unregister(group_key);\n }\n }\n return this['people'].remove(group_key, group_id, callback);\n});\n\n/**\n * Track an event with specific groups.\n *\n * ### Usage:\n *\n * mixpanel.track_with_groups('purchase', {'product': 'iphone'}, {'University': ['UCB', 'UCLA']})\n *\n * @param {String} event_name The name of the event (see `mixpanel.track()`)\n * @param {Object=} properties A set of properties to include with the event you're sending (see `mixpanel.track()`)\n * @param {Object=} groups An object mapping group name keys to one or more values\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.track_with_groups = addOptOutCheckMixpanelLib(function(event_name, properties, groups, callback) {\n var tracking_props = _.extend({}, properties || {});\n _.each(groups, function(v, k) {\n if (v !== null && v !== undefined) {\n tracking_props[k] = v;\n }\n });\n return this.track(event_name, tracking_props, callback);\n});\n\nMixpanelLib.prototype._create_map_key = function (group_key, group_id) {\n return group_key + '_' + JSON.stringify(group_id);\n};\n\nMixpanelLib.prototype._remove_group_from_cache = function (group_key, group_id) {\n delete this._cached_groups[this._create_map_key(group_key, group_id)];\n};\n\n/**\n * Look up reference to a Mixpanel group\n *\n * ### Usage:\n *\n * mixpanel.get_group(group_key, group_id)\n *\n * @param {String} group_key Group key\n * @param {Object} group_id A valid Mixpanel property type\n * @returns {Object} A MixpanelGroup identifier\n */\nMixpanelLib.prototype.get_group = function (group_key, group_id) {\n var map_key = this._create_map_key(group_key, group_id);\n var group = this._cached_groups[map_key];\n if (group === undefined || group._group_key !== group_key || group._group_id !== group_id) {\n group = new MixpanelGroup();\n group._init(this, group_key, group_id);\n this._cached_groups[map_key] = group;\n }\n return group;\n};\n\n/**\n * Track a default Mixpanel page view event, which includes extra default event properties to\n * improve page view data.\n *\n * ### Usage:\n *\n * // track a default $mp_web_page_view event\n * mixpanel.track_pageview();\n *\n * // track a page view event with additional event properties\n * mixpanel.track_pageview({'ab_test_variant': 'card-layout-b'});\n *\n * // example approach to track page views on different page types as event properties\n * mixpanel.track_pageview({'page': 'pricing'});\n * mixpanel.track_pageview({'page': 'homepage'});\n *\n * // UNCOMMON: Tracking a page view event with a custom event_name option. NOT expected to be used for\n * // individual pages on the same site or product. Use cases for custom event_name may be page\n * // views on different products or internal applications that are considered completely separate\n * mixpanel.track_pageview({'page': 'customer-search'}, {'event_name': '[internal] Admin Page View'});\n *\n * ### Notes:\n *\n * The `config.track_pageview` option for mixpanel.init()\n * may be turned on for tracking page loads automatically.\n *\n * // track only page loads\n * mixpanel.init(PROJECT_TOKEN, {track_pageview: true});\n *\n * // track when the URL changes in any manner\n * mixpanel.init(PROJECT_TOKEN, {track_pageview: 'full-url'});\n *\n * // track when the URL changes, ignoring any changes in the hash part\n * mixpanel.init(PROJECT_TOKEN, {track_pageview: 'url-with-path-and-query-string'});\n *\n * // track when the path changes, ignoring any query parameter or hash changes\n * mixpanel.init(PROJECT_TOKEN, {track_pageview: 'url-with-path'});\n *\n * @param {Object} [properties] An optional set of additional properties to send with the page view event\n * @param {Object} [options] Page view tracking options\n * @param {String} [options.event_name] - Alternate name for the tracking event\n * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object\n * with the tracking payload sent to the API server is returned; otherwise false.\n */\nMixpanelLib.prototype.track_pageview = addOptOutCheckMixpanelLib(function(properties, options) {\n if (typeof properties !== 'object') {\n properties = {};\n }\n options = options || {};\n var event_name = options['event_name'] || '$mp_web_page_view';\n\n var default_page_properties = _.extend(\n _.info.mpPageViewProperties(),\n _.info.campaignParams(),\n _.info.clickParams()\n );\n\n var event_properties = _.extend(\n {},\n default_page_properties,\n properties\n );\n\n return this.track(event_name, event_properties);\n});\n\n/**\n * Track clicks on a set of document elements. Selector must be a\n * valid query. Elements must exist on the page at the time track_links is called.\n *\n * ### Usage:\n *\n * // track click for link id #nav\n * mixpanel.track_links('#nav', 'Clicked Nav Link');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the Mixpanel\n * servers to respond. If they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] A properties object or function that returns a dictionary of properties when passed a DOMElement\n */\nMixpanelLib.prototype.track_links = function() {\n return this._track_dom.call(this, LinkTracker, arguments);\n};\n\n/**\n * Track form submissions. Selector must be a valid query.\n *\n * ### Usage:\n *\n * // track submission for form id 'register'\n * mixpanel.track_forms('#register', 'Created Account');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the mixpanel\n * servers to respond, if they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement\n */\nMixpanelLib.prototype.track_forms = function() {\n return this._track_dom.call(this, FormTracker, arguments);\n};\n\n/**\n * Time an event by including the time between this call and a\n * later 'track' call for the same event in the properties sent\n * with the event.\n *\n * ### Usage:\n *\n * // time an event named 'Registered'\n * mixpanel.time_event('Registered');\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * When called for a particular event name, the next track call for that event\n * name will include the elapsed time between the 'time_event' and 'track'\n * calls. This value is stored as seconds in the '$duration' property.\n *\n * @param {String} event_name The name of the event.\n */\nMixpanelLib.prototype.time_event = function(event_name) {\n if (_.isUndefined(event_name)) {\n this.report_error('No event name provided to mixpanel.time_event');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n return;\n }\n\n this['persistence'].set_event_timer(event_name, new Date().getTime());\n};\n\nvar REGISTER_DEFAULTS = {\n 'persistent': true\n};\n/**\n * Helper to parse options param for register methods, maintaining\n * legacy support for plain \"days\" param instead of options object\n * @param {Number|Object} [days_or_options] 'days' option (Number), or Options object for register methods\n * @returns {Object} options object\n */\nvar options_for_register = function(days_or_options) {\n var options;\n if (_.isObject(days_or_options)) {\n options = days_or_options;\n } else if (!_.isUndefined(days_or_options)) {\n options = {'days': days_or_options};\n } else {\n options = {};\n }\n return _.extend({}, REGISTER_DEFAULTS, options);\n};\n\n/**\n * Register a set of super properties, which are included with all\n * events. This will overwrite previous super property values.\n *\n * ### Usage:\n *\n * // register 'Gender' as a super property\n * mixpanel.register({'Gender': 'Female'});\n *\n * // register several super properties when a user signs up\n * mixpanel.register({\n * 'Email': 'jdoe@example.com',\n * 'Account Type': 'Free'\n * });\n *\n * // register only for the current pageload\n * mixpanel.register({'Name': 'Pat'}, {persistent: false});\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register = function(props, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register(props, options['days']);\n } else {\n _.extend(this.unpersisted_superprops, props);\n }\n};\n\n/**\n * Register a set of super properties only once. This will not\n * overwrite previous super property values, unlike register().\n *\n * ### Usage:\n *\n * // register a super property for the first time only\n * mixpanel.register_once({\n * 'First Login Date': new Date().toISOString()\n * });\n *\n * // register once, only for the current pageload\n * mixpanel.register_once({\n * 'First interaction time': new Date().toISOString()\n * }, 'None', {persistent: false});\n *\n * ### Notes:\n *\n * If default_value is specified, current super properties\n * with that value will be overwritten.\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {*} [default_value] Value to override if already set in super properties (ex: 'False') Default: 'None'\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register_once = function(props, default_value, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register_once(props, default_value, options['days']);\n } else {\n if (typeof(default_value) === 'undefined') {\n default_value = 'None';\n }\n _.each(props, function(val, prop) {\n if (!this.unpersisted_superprops.hasOwnProperty(prop) || this.unpersisted_superprops[prop] === default_value) {\n this.unpersisted_superprops[prop] = val;\n }\n }, this);\n }\n};\n\n/**\n * Delete a super property stored with the current user.\n *\n * @param {String} property The name of the super property to remove\n * @param {Object} [options]\n * @param {boolean} [options.persistent=true] - whether to look in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.unregister = function(property, options) {\n options = options_for_register(options);\n if (options['persistent']) {\n this['persistence'].unregister(property);\n } else {\n delete this.unpersisted_superprops[property];\n }\n};\n\nMixpanelLib.prototype._register_single = function(prop, value) {\n var props = {};\n props[prop] = value;\n this.register(props);\n};\n\n/**\n * Identify a user with a unique ID to track user activity across\n * devices, tie a user to their events, and create a user profile.\n * If you never call this method, unique visitors are tracked using\n * a UUID generated the first time they visit the site.\n *\n * Call identify when you know the identity of the current user,\n * typically after login or signup. We recommend against using\n * identify for anonymous visitors to your site.\n *\n * ### Notes:\n * If your project has\n * ID Merge\n * enabled, the identify method will connect pre- and\n * post-authentication events when appropriate.\n *\n * If your project does not have ID Merge enabled, identify will\n * change the user's local distinct_id to the unique ID you pass.\n * Events tracked prior to authentication will not be connected\n * to the same user identity. If ID Merge is disabled, alias can\n * be used to connect pre- and post-registration events.\n *\n * @param {String} [unique_id] A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used.\n */\nMixpanelLib.prototype.identify = function(\n new_distinct_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback\n) {\n // Optional Parameters\n // _set_callback:function A callback to be run if and when the People set queue is flushed\n // _add_callback:function A callback to be run if and when the People add queue is flushed\n // _append_callback:function A callback to be run if and when the People append queue is flushed\n // _set_once_callback:function A callback to be run if and when the People set_once queue is flushed\n // _union_callback:function A callback to be run if and when the People union queue is flushed\n // _unset_callback:function A callback to be run if and when the People unset queue is flushed\n\n var previous_distinct_id = this.get_distinct_id();\n if (new_distinct_id && previous_distinct_id !== new_distinct_id) {\n // we allow the following condition if previous distinct_id is same as new_distinct_id\n // so that you can force flush people updates for anonymous profiles.\n if (typeof new_distinct_id === 'string' && new_distinct_id.indexOf(DEVICE_ID_PREFIX) === 0) {\n this.report_error('distinct_id cannot have $device: prefix');\n return -1;\n }\n this.register({'$user_id': new_distinct_id});\n }\n\n if (!this.get_property('$device_id')) {\n // The persisted distinct id might not actually be a device id at all\n // it might be a distinct id of the user from before\n var device_id = previous_distinct_id;\n this.register_once({\n '$had_persisted_distinct_id': true,\n '$device_id': device_id\n }, '');\n }\n\n // identify only changes the distinct id if it doesn't match either the existing or the alias;\n // if it's new, blow away the alias as well.\n if (new_distinct_id !== previous_distinct_id && new_distinct_id !== this.get_property(ALIAS_ID_KEY)) {\n this.unregister(ALIAS_ID_KEY);\n this.register({'distinct_id': new_distinct_id});\n }\n this._flags.identify_called = true;\n // Flush any queued up people requests\n this['people']._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback);\n\n // send an $identify event any time the distinct_id is changing - logic on the server\n // will determine whether or not to do anything with it.\n if (new_distinct_id !== previous_distinct_id) {\n this.track('$identify', {\n 'distinct_id': new_distinct_id,\n '$anon_distinct_id': previous_distinct_id\n }, {skip_hooks: true});\n }\n};\n\n/**\n * Clears super properties and generates a new random distinct_id for this instance.\n * Useful for clearing data when a user logs out.\n */\nMixpanelLib.prototype.reset = function() {\n this['persistence'].clear();\n this._flags.identify_called = false;\n var uuid = _.UUID();\n this.register_once({\n 'distinct_id': DEVICE_ID_PREFIX + uuid,\n '$device_id': uuid\n }, '');\n};\n\n/**\n * Returns the current distinct id of the user. This is either the id automatically\n * generated by the library or the id that has been passed by a call to identify().\n *\n * ### Notes:\n *\n * get_distinct_id() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // set distinct_id after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * distinct_id = mixpanel.get_distinct_id();\n * }\n * });\n */\nMixpanelLib.prototype.get_distinct_id = function() {\n return this.get_property('distinct_id');\n};\n\n/**\n * The alias method creates an alias which Mixpanel will use to\n * remap one id to another. Multiple aliases can point to the\n * same identifier.\n *\n * The following is a valid use of alias:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // You can add multiple id aliases to the existing ID\n * mixpanel.alias('newer_id', 'existing_id');\n *\n * Aliases can also be chained - the following is a valid example:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // chain newer_id - new_id - existing_id\n * mixpanel.alias('newer_id', 'new_id');\n *\n * Aliases cannot point to multiple identifiers - the following\n * example will not work:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // this is invalid as 'new_id' already points to 'existing_id'\n * mixpanel.alias('new_id', 'newer_id');\n *\n * ### Notes:\n *\n * If your project does not have\n * ID Merge\n * enabled, the best practice is to call alias once when a unique\n * ID is first created for a user (e.g., when a user first registers\n * for an account). Do not use alias multiple times for a single\n * user without ID Merge enabled.\n *\n * @param {String} alias A unique identifier that you want to use for this user in the future.\n * @param {String} [original] The current identifier being used for this user.\n */\nMixpanelLib.prototype.alias = function(alias, original) {\n // If the $people_distinct_id key exists in persistence, there has been a previous\n // mixpanel.people.identify() call made for this user. It is VERY BAD to make an alias with\n // this ID, as it will duplicate users.\n if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) {\n this.report_error('Attempting to create alias for existing People user - aborting.');\n return -2;\n }\n\n var _this = this;\n if (_.isUndefined(original)) {\n original = this.get_distinct_id();\n }\n if (alias !== original) {\n this._register_single(ALIAS_ID_KEY, alias);\n return this.track('$create_alias', {\n 'alias': alias,\n 'distinct_id': original\n }, {\n skip_hooks: true\n }, function() {\n // Flush the people queue\n _this.identify(alias);\n });\n } else {\n this.report_error('alias matches current distinct_id - skipping api call.');\n this.identify(alias);\n return -1;\n }\n};\n\n/**\n * Provide a string to recognize the user by. The string passed to\n * this method will appear in the Mixpanel Streams product rather\n * than an automatically generated name. Name tags do not have to\n * be unique.\n *\n * This value will only be included in Streams data.\n *\n * @param {String} name_tag A human readable name for the user\n * @deprecated\n */\nMixpanelLib.prototype.name_tag = function(name_tag) {\n this._register_single('mp_name_tag', name_tag);\n};\n\n/**\n * Update the configuration of a mixpanel library instance.\n *\n * The default config is:\n *\n * {\n * // host for requests (customizable for e.g. a local proxy)\n * api_host: 'https://api-js.mixpanel.com',\n *\n * // endpoints for different types of requests\n * api_routes: {\n * track: 'track/',\n * engage: 'engage/',\n * groups: 'groups/',\n * }\n *\n * // HTTP method for tracking requests\n * api_method: 'POST'\n *\n * // transport for sending requests ('XHR' or 'sendBeacon')\n * // NB: sendBeacon should only be used for scenarios such as\n * // page unload where a \"best-effort\" attempt to send is\n * // acceptable; the sendBeacon API does not support callbacks\n * // or any way to know the result of the request. Mixpanel\n * // tracking via sendBeacon will not support any event-\n * // batching or retry mechanisms.\n * api_transport: 'XHR'\n *\n * // request-batching/queueing/retry\n * batch_requests: true,\n *\n * // maximum number of events/updates to send in a single\n * // network request\n * batch_size: 50,\n *\n * // milliseconds to wait between sending batch requests\n * batch_flush_interval_ms: 5000,\n *\n * // milliseconds to wait for network responses to batch requests\n * // before they are considered timed-out and retried\n * batch_request_timeout_ms: 90000,\n *\n * // override value for cookie domain, only useful for ensuring\n * // correct cross-subdomain cookies on unusual domains like\n * // subdomain.mainsite.avocat.fr; NB this cannot be used to\n * // set cookies on a different domain than the current origin\n * cookie_domain: ''\n *\n * // super properties cookie expiration (in days)\n * cookie_expiration: 365\n *\n * // if true, cookie will be set with SameSite=None; Secure\n * // this is only useful in special situations, like embedded\n * // 3rd-party iframes that set up a Mixpanel instance\n * cross_site_cookie: false\n *\n * // super properties span subdomains\n * cross_subdomain_cookie: true\n *\n * // debug mode\n * debug: false\n *\n * // if this is true, the mixpanel cookie or localStorage entry\n * // will be deleted, and no user persistence will take place\n * disable_persistence: false\n *\n * // if this is true, Mixpanel will automatically determine\n * // City, Region and Country data using the IP address of\n * //the client\n * ip: true\n *\n * // opt users out of tracking by this Mixpanel instance by default\n * opt_out_tracking_by_default: false\n *\n * // opt users out of browser data storage by this Mixpanel instance by default\n * opt_out_persistence_by_default: false\n *\n * // persistence mechanism used by opt-in/opt-out methods - cookie\n * // or localStorage - falls back to cookie if localStorage is unavailable\n * opt_out_tracking_persistence_type: 'localStorage'\n *\n * // customize the name of cookie/localStorage set by opt-in/opt-out methods\n * opt_out_tracking_cookie_prefix: null\n *\n * // type of persistent store for super properties (cookie/\n * // localStorage) if set to 'localStorage', any existing\n * // mixpanel cookie value with the same persistence_name\n * // will be transferred to localStorage and deleted\n * persistence: 'cookie'\n *\n * // name for super properties persistent store\n * persistence_name: ''\n *\n * // names of properties/superproperties which should never\n * // be sent with track() calls\n * property_blacklist: []\n *\n * // if this is true, mixpanel cookies will be marked as\n * // secure, meaning they will only be transmitted over https\n * secure_cookie: false\n *\n * // disables enriching user profiles with first touch marketing data\n * skip_first_touch_marketing: false\n *\n * // the amount of time track_links will\n * // wait for Mixpanel's servers to respond\n * track_links_timeout: 300\n *\n * // adds any UTM parameters and click IDs present on the page to any events fired\n * track_marketing: true\n *\n * // enables automatic page view tracking using default page view events through\n * // the track_pageview() method\n * track_pageview: false\n *\n * // if you set upgrade to be true, the library will check for\n * // a cookie from our old js library and import super\n * // properties from it, then the old cookie is deleted\n * // The upgrade config option only works in the initialization,\n * // so make sure you set it when you create the library.\n * upgrade: false\n *\n * // extra HTTP request headers to set for each API request, in\n * // the format {'Header-Name': value}\n * xhr_headers: {}\n *\n * // whether to ignore or respect the web browser's Do Not Track setting\n * ignore_dnt: false\n * }\n *\n *\n * @param {Object} config A dictionary of new configuration values to update\n */\nMixpanelLib.prototype.set_config = function(config) {\n if (_.isObject(config)) {\n _.extend(this['config'], config);\n\n var new_batch_size = config['batch_size'];\n if (new_batch_size) {\n _.each(this.request_batchers, function(batcher) {\n batcher.resetBatchSize();\n });\n }\n\n if (!this.get_config('persistence_name')) {\n this['config']['persistence_name'] = this['config']['cookie_name'];\n }\n if (!this.get_config('disable_persistence')) {\n this['config']['disable_persistence'] = this['config']['disable_cookie'];\n }\n\n if (this['persistence']) {\n this['persistence'].update_config(this['config']);\n }\n Config.DEBUG = Config.DEBUG || this.get_config('debug');\n }\n};\n\n/**\n * returns the current config object for the library.\n */\nMixpanelLib.prototype.get_config = function(prop_name) {\n return this['config'][prop_name];\n};\n\n/**\n * Fetch a hook function from config, with safe default, and run it\n * against the given arguments\n * @param {string} hook_name which hook to retrieve\n * @returns {any|null} return value of user-provided hook, or null if nothing was returned\n */\nMixpanelLib.prototype._run_hook = function(hook_name) {\n var ret = (this['config']['hooks'][hook_name] || IDENTITY_FUNC).apply(this, slice.call(arguments, 1));\n if (typeof ret === 'undefined') {\n this.report_error(hook_name + ' hook did not return a value');\n ret = null;\n }\n return ret;\n};\n\n/**\n * Returns the value of the super property named property_name. If no such\n * property is set, get_property() will return the undefined value.\n *\n * ### Notes:\n *\n * get_property() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // grab value for 'user_id' after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * user_id = mixpanel.get_property('user_id');\n * }\n * });\n *\n * @param {String} property_name The name of the super property you want to retrieve\n */\nMixpanelLib.prototype.get_property = function(property_name) {\n return this['persistence'].load_prop([property_name]);\n};\n\nMixpanelLib.prototype.toString = function() {\n var name = this.get_config('name');\n if (name !== PRIMARY_INSTANCE_NAME) {\n name = PRIMARY_INSTANCE_NAME + '.' + name;\n }\n return name;\n};\n\nMixpanelLib.prototype._event_is_disabled = function(event_name) {\n return _.isBlockedUA(userAgent) ||\n this._flags.disable_all_events ||\n _.include(this.__disabled_events, event_name);\n};\n\n// perform some housekeeping around GDPR opt-in/out state\nMixpanelLib.prototype._gdpr_init = function() {\n var is_localStorage_requested = this.get_config('opt_out_tracking_persistence_type') === 'localStorage';\n\n // try to convert opt-in/out cookies to localStorage if possible\n if (is_localStorage_requested && _.localStorage.is_supported()) {\n if (!this.has_opted_in_tracking() && this.has_opted_in_tracking({'persistence_type': 'cookie'})) {\n this.opt_in_tracking({'enable_persistence': false});\n }\n if (!this.has_opted_out_tracking() && this.has_opted_out_tracking({'persistence_type': 'cookie'})) {\n this.opt_out_tracking({'clear_persistence': false});\n }\n this.clear_opt_in_out_tracking({\n 'persistence_type': 'cookie',\n 'enable_persistence': false\n });\n }\n\n // check whether the user has already opted out - if so, clear & disable persistence\n if (this.has_opted_out_tracking()) {\n this._gdpr_update_persistence({'clear_persistence': true});\n\n // check whether we should opt out by default\n // note: we don't clear persistence here by default since opt-out default state is often\n // used as an initial state while GDPR information is being collected\n } else if (!this.has_opted_in_tracking() && (\n this.get_config('opt_out_tracking_by_default') || _.cookie.get('mp_optout')\n )) {\n _.cookie.remove('mp_optout');\n this.opt_out_tracking({\n 'clear_persistence': this.get_config('opt_out_persistence_by_default')\n });\n }\n};\n\n/**\n * Enable or disable persistence based on options\n * only enable/disable if persistence is not already in this state\n * @param {boolean} [options.clear_persistence] If true, will delete all data stored by the sdk in persistence and disable it\n * @param {boolean} [options.enable_persistence] If true, will re-enable sdk persistence\n */\nMixpanelLib.prototype._gdpr_update_persistence = function(options) {\n var disabled;\n if (options && options['clear_persistence']) {\n disabled = true;\n } else if (options && options['enable_persistence']) {\n disabled = false;\n } else {\n return;\n }\n\n if (!this.get_config('disable_persistence') && this['persistence'].disabled !== disabled) {\n this['persistence'].set_disabled(disabled);\n }\n\n if (disabled) {\n this.stop_batch_senders();\n } else {\n // only start batchers after opt-in if they have previously been started\n // in order to avoid unintentionally starting up batching for the first time\n if (this._batchers_were_started) {\n this.start_batch_senders();\n }\n }\n};\n\n// call a base gdpr function after constructing the appropriate token and options args\nMixpanelLib.prototype._gdpr_call_func = function(func, options) {\n options = _.extend({\n 'track': _.bind(this.track, this),\n 'persistence_type': this.get_config('opt_out_tracking_persistence_type'),\n 'cookie_prefix': this.get_config('opt_out_tracking_cookie_prefix'),\n 'cookie_expiration': this.get_config('cookie_expiration'),\n 'cross_site_cookie': this.get_config('cross_site_cookie'),\n 'cross_subdomain_cookie': this.get_config('cross_subdomain_cookie'),\n 'cookie_domain': this.get_config('cookie_domain'),\n 'secure_cookie': this.get_config('secure_cookie'),\n 'ignore_dnt': this.get_config('ignore_dnt')\n }, options);\n\n // check if localStorage can be used for recording opt out status, fall back to cookie if not\n if (!_.localStorage.is_supported()) {\n options['persistence_type'] = 'cookie';\n }\n\n return func(this.get_config('token'), {\n track: options['track'],\n trackEventName: options['track_event_name'],\n trackProperties: options['track_properties'],\n persistenceType: options['persistence_type'],\n persistencePrefix: options['cookie_prefix'],\n cookieDomain: options['cookie_domain'],\n cookieExpiration: options['cookie_expiration'],\n crossSiteCookie: options['cross_site_cookie'],\n crossSubdomainCookie: options['cross_subdomain_cookie'],\n secureCookie: options['secure_cookie'],\n ignoreDnt: options['ignore_dnt']\n });\n};\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage:\n *\n * // opt user in\n * mixpanel.opt_in_tracking();\n *\n * // opt user in with specific event name, properties, cookie configuration\n * mixpanel.opt_in_tracking({\n * track_event_name: 'User opted in',\n * track_event_properties: {\n * 'Email': 'jdoe@example.com'\n * },\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {function} [options.track] Function used for tracking a Mixpanel event to record the opt-in action (default is this Mixpanel instance's track method)\n * @param {string} [options.track_event_name=$opt_in] Event name to be used for tracking the opt-in action\n * @param {Object} [options.track_properties] Set of properties to be tracked along with the opt-in action\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_in_tracking = function(options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n\n this._gdpr_call_func(optIn, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage:\n *\n * // opt user out\n * mixpanel.opt_out_tracking();\n *\n * // opt user out with different cookie configuration from Mixpanel instance\n * mixpanel.opt_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.delete_user=true] If true, will delete the currently identified user's profile and clear all charges after opting the user out\n * @param {boolean} [options.clear_persistence=true] If true, will delete all data stored by the sdk in persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_out_tracking = function(options) {\n options = _.extend({\n 'clear_persistence': true,\n 'delete_user': true\n }, options);\n\n // delete user and clear charges since these methods may be disabled by opt-out\n if (options['delete_user'] && this['people'] && this['people']._identify_called()) {\n this['people'].delete_user();\n this['people'].clear_charges();\n }\n\n this._gdpr_call_func(optOut, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage:\n *\n * var has_opted_in = mixpanel.has_opted_in_tracking();\n * // use has_opted_in value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-in status\n */\nMixpanelLib.prototype.has_opted_in_tracking = function(options) {\n return this._gdpr_call_func(hasOptedIn, options);\n};\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage:\n *\n * var has_opted_out = mixpanel.has_opted_out_tracking();\n * // use has_opted_out value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-out status\n */\nMixpanelLib.prototype.has_opted_out_tracking = function(options) {\n return this._gdpr_call_func(hasOptedOut, options);\n};\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage:\n *\n * // clear user's opt-in/out status\n * mixpanel.clear_opt_in_out_tracking();\n *\n * // clear user's opt-in/out status with specific cookie configuration - should match\n * // configuration used when opt_in_tracking/opt_out_tracking methods were called.\n * mixpanel.clear_opt_in_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.clear_opt_in_out_tracking = function(options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n\n this._gdpr_call_func(clearOptInOut, options);\n this._gdpr_update_persistence(options);\n};\n\nMixpanelLib.prototype.report_error = function(msg, err) {\n console$1.error.apply(console$1.error, arguments);\n try {\n if (!err && !(msg instanceof Error)) {\n msg = new Error(msg);\n }\n this.get_config('error_reporter')(msg, err);\n } catch(err) {\n console$1.error(err);\n }\n};\n\n// EXPORTS (for closure compiler)\n\n// MixpanelLib Exports\nMixpanelLib.prototype['init'] = MixpanelLib.prototype.init;\nMixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;\nMixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;\nMixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;\nMixpanelLib.prototype['track'] = MixpanelLib.prototype.track;\nMixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;\nMixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;\nMixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;\nMixpanelLib.prototype['register'] = MixpanelLib.prototype.register;\nMixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;\nMixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;\nMixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;\nMixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;\nMixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;\nMixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;\nMixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;\nMixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;\nMixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;\nMixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;\nMixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;\nMixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;\nMixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;\nMixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;\nMixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;\nMixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;\nMixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;\nMixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;\nMixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;\nMixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;\nMixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;\nMixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;\nMixpanelLib.prototype['start_session_recording'] = MixpanelLib.prototype.start_session_recording;\nMixpanelLib.prototype['stop_session_recording'] = MixpanelLib.prototype.stop_session_recording;\nMixpanelLib.prototype['get_session_recording_properties'] = MixpanelLib.prototype.get_session_recording_properties;\nMixpanelLib.prototype['DEFAULT_API_ROUTES'] = DEFAULT_API_ROUTES;\n\n// MixpanelPersistence Exports\nMixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;\nMixpanelPersistence.prototype['update_search_keyword'] = MixpanelPersistence.prototype.update_search_keyword;\nMixpanelPersistence.prototype['update_referrer_info'] = MixpanelPersistence.prototype.update_referrer_info;\nMixpanelPersistence.prototype['get_cross_subdomain'] = MixpanelPersistence.prototype.get_cross_subdomain;\nMixpanelPersistence.prototype['clear'] = MixpanelPersistence.prototype.clear;\n\n\nvar instances = {};\nvar extend_mp = function() {\n // add all the sub mixpanel instances\n _.each(instances, function(instance, name) {\n if (name !== PRIMARY_INSTANCE_NAME) { mixpanel_master[name] = instance; }\n });\n\n // add private functions as _\n mixpanel_master['_'] = _;\n};\n\nvar override_mp_init_func = function() {\n // we override the snippets init function to handle the case where a\n // user initializes the mixpanel library after the script loads & runs\n mixpanel_master['init'] = function(token, config, name) {\n if (name) {\n // initialize a sub library\n if (!mixpanel_master[name]) {\n mixpanel_master[name] = instances[name] = create_mplib(token, config, name);\n mixpanel_master[name]._loaded();\n }\n return mixpanel_master[name];\n } else {\n var instance = mixpanel_master;\n\n if (instances[PRIMARY_INSTANCE_NAME]) {\n // main mixpanel lib already initialized\n instance = instances[PRIMARY_INSTANCE_NAME];\n } else if (token) {\n // intialize the main mixpanel lib\n instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME);\n instance._loaded();\n instances[PRIMARY_INSTANCE_NAME] = instance;\n }\n\n mixpanel_master = instance;\n if (init_type === INIT_SNIPPET) {\n win[PRIMARY_INSTANCE_NAME] = mixpanel_master;\n }\n extend_mp();\n }\n };\n};\n\nvar add_dom_loaded_handler = function() {\n // Cross browser DOM Loaded support\n function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }\n\n function do_scroll_check() {\n try {\n document$1.documentElement.doScroll('left');\n } catch(e) {\n setTimeout(do_scroll_check, 1);\n return;\n }\n\n dom_loaded_handler();\n }\n\n if (document$1.addEventListener) {\n if (document$1.readyState === 'complete') {\n // safari 4 can fire the DOMContentLoaded event before loading all\n // external JS (including this file). you will see some copypasta\n // on the internet that checks for 'complete' and 'loaded', but\n // 'loaded' is an IE thing\n dom_loaded_handler();\n } else {\n document$1.addEventListener('DOMContentLoaded', dom_loaded_handler, false);\n }\n } else if (document$1.attachEvent) {\n // IE\n document$1.attachEvent('onreadystatechange', dom_loaded_handler);\n\n // check to make sure we arn't in a frame\n var toplevel = false;\n try {\n toplevel = win.frameElement === null;\n } catch(e) {\n // noop\n }\n\n if (document$1.documentElement.doScroll && toplevel) {\n do_scroll_check();\n }\n }\n\n // fallback handler, always will work\n _.register_event(win, 'load', dom_loaded_handler, true);\n};\n\nfunction init_as_module(bundle_loader) {\n load_extra_bundle = bundle_loader;\n init_type = INIT_MODULE;\n mixpanel_master = new MixpanelLib();\n\n override_mp_init_func();\n mixpanel_master['init']();\n add_dom_loaded_handler();\n\n return mixpanel_master;\n}\n\n// For loading separate bundles asynchronously via script tag\n\n// For builds that have everything in one bundle, no extra work.\nfunction loadNoop (_src, onload) {\n onload();\n}\n\n/* eslint camelcase: \"off\" */\n\nvar mixpanel = init_as_module(loadNoop);\n\nexport { mixpanel as default };\n","import React, { useState, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXSider } from \"component/Layout\";\nimport { CXMenu, CXSubMenu, CXMenuItem } from \"component/Menu\";\nimport {\n MenuUnfoldOutlined,\n MenuFoldOutlined,\n SettingOutlined,\n} from \"@ant-design/icons\";\n\nimport history from \"utils/history\";\nimport { NavLink, useLocation } from \"react-router-dom\";\nimport {\n TOGGLE_MAIN_MENU,\n RESPONSIVE_MAIN_MENU,\n RESPONSIVE_WIDTH,\n} from \"constant/app.constant\";\nimport \"./style.css\";\nimport { CXBadge } from \"component/Badge\";\nimport { disconnectSocket } from \"action/SocketAction\";\nimport { CXPopover } from \"component/Popover\";\nimport Intercom from \"@intercom/messenger-js-sdk\";\nimport mixpanel from \"mixpanel-browser\";\n\nconst Sidebar = (props) => {\n const location = useLocation();\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n const ConvReducer = useSelector((state) => state.ConvReducer);\n const { sideBarNotif } = useSelector((state) => state.NotificationReducer);\n const dittoAdminReducer = useSelector((state) => state.dittoAdminReducer);\n const [footerMenuActive, setfooterMenuActive] = useState([]);\n const [InboxNotif, setInboxNotif] = useState(0);\n const [openingNotif, setopeningNotif] = useState(0);\n\n const handleRoute = (path = \"/\") => {\n if (path === \"/admin/logout\") {\n dispatch(disconnectSocket());\n } else {\n history.push(path);\n }\n };\n const toggle = (val) => {\n dispatch({ type: TOGGLE_MAIN_MENU });\n };\n\n const bottomMenu = props.routes.filter((route) => route.bottom);\n const reportWindowSize = (val) => {\n dispatch({\n type: RESPONSIVE_WIDTH,\n data: val.currentTarget.innerWidth,\n });\n if (val.currentTarget.innerWidth < 1250) {\n dispatch({ type: RESPONSIVE_MAIN_MENU, data: true });\n }\n if (val.currentTarget.innerWidth > 1250) {\n dispatch({ type: RESPONSIVE_MAIN_MENU, data: false });\n }\n };\n useEffect(() => {\n console.log(window.innerWidth);\n dispatch({\n type: RESPONSIVE_WIDTH,\n data: window.innerWidth,\n });\n if (window.innerWidth < 1250) {\n dispatch({ type: RESPONSIVE_MAIN_MENU, data: true });\n }\n window?.addEventListener(\"resize\", reportWindowSize);\n }, [window.innerWidth]);\n\n const checkForNOtification = (route) => {\n if (route.path === \"/communication/inbox\")\n return (\n \n );\n else if (route.path === \"/openings\")\n return (\n \n );\n // else if (route.path === \"/admin\")\n // return (\n // \n // );\n };\n\n useEffect(() => {\n if (sideBarNotif?.inboxCount >= 0) {\n setInboxNotif(sideBarNotif?.inboxCount);\n }\n if (sideBarNotif?.openingCount >= 0) {\n setopeningNotif(sideBarNotif?.openingCount);\n }\n }, [sideBarNotif]);\n\n const PathName = (locationPathname) => {\n // this function strip pathname for two level > active menu logic\n let path = locationPathname.split(\"/\");\n if (path.length > 3) {\n path = path.slice(0, 3);\n }\n return path.join(\"/\");\n };\n const checkPermission = (route) => {\n let activePlan = dittoAdminReducer?.user?.userTenants?.find(\n (tenant) => tenant?.userId === dittoAdminReducer?.user?.userProfile?._id\n )?.plan;\n if (activePlan?.packages?.length > 0) {\n let packageArray = activePlan?.packages?.map((item) =>\n item.toLowerCase()\n );\n packageArray.push(\"openings\");\n packageArray.push(\"company\");\n if (packageArray?.includes(route.key?.toLowerCase())) {\n return true;\n } else {\n return false;\n }\n }\n };\n useEffect(() => {\n let active = dittoAdminReducer?.user?.userTenants?.find(\n (d) => d.userId === dittoAdminReducer?.user.userProfile?._id\n );\n let userName =\n (dittoAdminReducer?.user?.userProfile?.fname ?? \"\") +\n \" \" +\n (dittoAdminReducer?.user?.userProfile?.lname ?? \"\");\n if (active) {\n Intercom({\n app_id: \"wfxkaxzj\",\n user_id: `${active?.userId}_${active.tenantId?._id}`,\n name: userName,\n email: dittoAdminReducer?.user?.userProfile?.email,\n user_hash: active?.iuserHash ?? \"\",\n });\n\n mixpanel.init(\"a629fc78a346150187ace3ddb2716bfe\", {\n debug: true,\n track_pageview: true,\n persistence: \"localStorage\",\n });\n\n mixpanel.identify(`${active?.userId}_${active.tenantId}`);\n\n mixpanel.people.set({\n $name: userName,\n $email: dittoAdminReducer?.user?.userProfile?.email,\n last_seen: new Date().toISOString(),\n // Add anything else about the user here\n });\n }\n }, [dittoAdminReducer?.user?.userTenants]);\n return (\n \n
\n \n \n {appConfig.mainMenuCollapsed ? (\n \n ) : (\n \"logo\"\n )}\n {/* TODO: Collapse button for menu */}\n {appConfig.mainMenuCollapsed ? (\n toggle(true)}\n className=\"mt-3\"\n style={{ fontSize: 16 }}\n />\n ) : (\n toggle(false)}\n className=\"ml-auto\"\n style={{ fontSize: 18 }}\n />\n )}\n
\n {/* [PathName(location.pathname)] */}\n
\n {props?.routes?.map((route, index) => {\n if (route.menu && checkPermission(route)) {\n return (\n \n \n \n {\n \n {route.icon}\n \n }\n \n {!appConfig.mainMenuCollapsed && route.title}\n {!appConfig.mainMenuCollapsed && (\n
\n {checkForNOtification(route)}\n
\n )}\n
\n \n );\n } else {\n return null;\n }\n })}\n \n \n \n setfooterMenuActive([\"footerMenu\"])}\n key={\"footerMenu\"}\n mode=\"inline\"\n className=\"sidebar-menu bottomMenu\"\n icon={}\n title={\n dittoAdminReducer?.user?.userProfile?.fname\n ? dittoAdminReducer?.user?.userProfile?.fname\n : \"USER\"\n }\n >\n {bottomMenu.map((route) => (\n \n !route.path ? null : handleRoute(\"/admin\" + route.path)\n }\n className=\"w-100 d-flex m-0 gg\"\n style={{\n alignItems: \"center\",\n color: \"#FFFFFF\",\n backgroundColor: \"#1e2822\",\n }}\n >\n
\n {route.title}\n
{route.rightItem}
\n
\n \n ))}\n \n \n \n \n );\n};\n\nexport default Sidebar;\n","const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n","import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n","// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n","import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n","import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* State.READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* State.READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* State.READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* State.READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* State.READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* State.READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* State.READ_PAYLOAD */;\n }\n else if (state === 2 /* State.READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* State.READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* State.READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n","/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n","import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n","import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n","// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n","// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n","// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n","// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n","import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: Polling,\n};\n","import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n","// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 2000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n","import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n","import { Socket } from \"./socket.js\";\nexport { Socket };\nexport const protocol = Socket.protocol;\nexport { Transport, TransportError } from \"./transport.js\";\nexport { transports } from \"./transports/index.js\";\nexport { installTimerFunctions } from \"./util.js\";\nexport { parse } from \"./contrib/parseuri.js\";\nexport { nextTick } from \"./transports/websocket-constructor.js\";\n","const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n","import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n","import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\",\n \"connect_error\",\n \"disconnect\",\n \"disconnecting\",\n \"newListener\",\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\n","export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n","import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n }\n else if (this.connected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n // the packet has already been acknowledged\n return;\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n this._drainQueue(true);\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n","/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n","import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason, description) {\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n","import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\n","import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n","// This icon file is generated automatically.\nvar SmileOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z\" } }] }, \"name\": \"smile\", \"theme\": \"outlined\" };\nexport default SmileOutlined;\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 SmileOutlinedSvg from \"@ant-design/icons-svg/es/asn/SmileOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SmileOutlined = function SmileOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SmileOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SmileOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SmileOutlined';\n}\nexport default RefIcon;","import { useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { io } from \"socket.io-client\";\nimport { socketUrl } from \"config/config\";\nimport { getCookie, deleteAllCookies, deleteCookie, truncateSt } from \"utils\";\nimport { notification } from \"antd\";\nimport history from \"utils/history\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { store } from \"store\";\nimport {\n NEW_MESSAGE_ACTION_TRIGGER,\n LOGOUT_ACTION_TRIGGER,\n SET_WIDGET_REQUEST,\n SOCKET_SENT_MESSAGE_ACTION_TRIGGER,\n SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER,\n SOCKET_READ_MESSAGE_ACTION_TRIGGER,\n SOCKET_FAILED_MESSAGE_ACTION_TRIGGER,\n BOT_PROCESSING_START,\n BOT_PROCESSING_END,\n TYPING_START,\n TYPING_END,\n} from \"constant\";\nimport { SmileOutlined } from \"@ant-design/icons\";\nimport {\n getConvUnreadNotifications,\n getSidebarNotifications,\n} from \"action/NotificationActions\";\n\nconst SocketWrapper = ({ children, ...props }) => {\n const dispatch = useDispatch();\n let socketRef = useRef();\n const state = store.getState();\n const { action, newMessage } = useSelector((state) => state.MessageReducer);\n const { actionType, candidateViewed } = useSelector(\n (state) => state.NotificationReducer\n );\n\n useEffect(() => {\n connectSocket();\n // connectSocketNotification();\n }, []);\n\n useEffect(() => {\n switch (state.MessageReducer.action) {\n case \"SEND_MESSAGE_ACTION_TRIGGER\":\n socketRef.current.emit(\n \"message\",\n state.MessageReducer.newMessage,\n (response) => {\n dispatch({ type: NEW_MESSAGE_ACTION_TRIGGER, data: response.msg });\n }\n );\n break;\n case \"SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER\":\n socketRef.current.emit(\n \"TEMPLATE_MESSAGE\",\n { msg: state.MessageReducer.newMessage },\n (response) => {\n // template message response need to be fixed from backend\n dispatch(\n dispatch({ type: NEW_MESSAGE_ACTION_TRIGGER, data: response.msg })\n );\n }\n );\n break;\n default:\n break;\n }\n }, [action, newMessage]);\n\n useEffect(() => {\n switch (state.NotificationReducer.actionType) {\n case \"CANDIDATE_VIEWED\":\n socketRef.current.emit(\n \"CANDIDATE_VIEWED\",\n state.NotificationReducer.candidateViewed,\n (response) => {\n console.log(\"candidate viewed\");\n }\n );\n break;\n default:\n break;\n }\n }, [actionType, candidateViewed]);\n\n useEffect(() => {\n switch (state.dittoAdminReducer.action) {\n case LOGOUT_ACTION_TRIGGER:\n logout();\n break;\n default:\n break;\n }\n }, [state.dittoAdminReducer.action]);\n\n useEffect(() => {\n const emitMsg = {\n msg: { md: \"web\", convId: state?.AppReducer?.activeConvId?.conv?._id },\n };\n socketRef?.current?.emit(\n state.MessageReducer.emitTyping ? \"TYPING_START\" : \"TYPING_END\",\n emitMsg,\n (response) => {}\n );\n }, [state.MessageReducer.emitTyping]);\n\n useEffect(() => {\n if (\n state?.AppReducer?.activeConvId?._id &&\n state?.AppReducer?.MarkReadTrigger\n ) {\n socketRef.current.emit(\n \"MARK_READ\",\n {\n msg: {\n convId: state?.AppReducer?.activeConvId?.conv?._id,\n caid: state?.MessageReducer?.checkedList[0]?.id,\n },\n },\n (readMessage) => {}\n );\n dispatch({ type: \"MARK_READ_TRIGGER\", data: false });\n dispatch(getSidebarNotifications());\n }\n }, [state?.AppReducer?.MarkReadTrigger]);\n\n const logout = () => {\n socketRef?.current?.disconnect();\n localStorage.clear();\n deleteAllCookies();\n deleteCookie(\"tenant\");\n deleteCookie(\"ch-Skip\");\n deleteCookie(\"ch-alert\");\n deleteCookie(\"email-auth-failed\");\n history.push(\"/admin/logout\");\n const scripts = document.querySelectorAll(\"#usetifulScript\");\n // need to check better way to remove script or usetiful's react sdk\n scripts.forEach((script) => {\n script.parentNode.removeChild(script);\n });\n window.location.reload();\n };\n\n let icons = {\n whatsapp: (\n \"whatsapp\"\n ),\n email: \"email\",\n };\n\n const connectSocket = async () => {\n if (!getCookie(\"ob_a\") || getCookie(\"ob_a\") === \"\") {\n return;\n }\n if (socketRef.current && socketRef.current.connected) {\n return;\n }\n const tenantId = getCookie(\"tenant\");\n const fingerprint = await localStorage.getItem(\"FINGERPRINT\");\n const socket = io(`${socketUrl}/messaging`, {\n auth: {\n authorization: `Bearer ${getCookie(\"ob_a\")}`,\n tenantid: tenantId,\n fingerprint,\n os: \"web\",\n },\n transports: [\"websocket\", \"polling\"],\n });\n socketRef.current = socket;\n socketRef.current.on(\"NOTIFICATION\", (data) => {\n if (data?.eventType === \"CANDIDATE_STAGE_CHANGED\") {\n processStageChangeNotification(data);\n console.log(\"stage change Dispatched\");\n }\n if (data?.eventType === \"MESSAGE_RECEIVED\") {\n processMessageNotification(data);\n }\n });\n\n // socketRef.current.on(\"MESSAGE\", (message) => {\n // let state = store.getState();\n // if (!message.msg) {\n // return null;\n // }\n // if (state?.AppReducer?.activeConvId?.conv?._id !== message?.msg?.convId) {\n // notification.success({\n // message: \"You have a new message\",\n // description:\n // message?.msg.md === \"email\" ? (\n //
\n // \n // {ReactHtmlParser(message?.msg?.text)}\n //
\n // \n // history.push({\n // pathname: `/admin/communication/inbox/${message?.msg?.convId}`,\n // state: {\n // channelAccountId: message?.msg?.channelAccountId,\n // },\n // })\n // }\n // >\n // View\n // \n // \n // ) : (\n //
\n // {truncateSt(message?.msg?.text, 30)}{\" \"}\n // \n // history.push({\n // pathname: `/admin/communication/inbox/${message?.msg?.convId}`,\n // state: {\n // channelAccountId: message?.msg?.channelAccountId,\n // },\n // })\n // }\n // >\n // View\n //
\n // \n // ),\n // icon: icons[message?.msg.md] ?? ,\n // });\n // // dispatch(getSingleConvActionTrigger(message?.msg?.convId));\n // dispatch({ type: NEW_MESSAGE_ACTION_TRIGGER, data: message.msg });\n // } else {\n // dispatch({ type: NEW_MESSAGE_ACTION_TRIGGER, data: message.msg });\n // // dispatch(readMessageActionTrigger({ convId: message?.msg?.convId }));\n // if (\n // state.AdminReducer.checkedList[0].id === message.msg.channelAccountId\n // )\n // socketRef.current.emit(\n // \"MARK_READ\",\n // {\n // msg: {\n // convId: message?.msg?.convId,\n // caid: state.AdminReducer.checkedList[0].id,\n // },\n // },\n // (readMessage) => {}\n // );\n // }\n // });\n\n socketRef.current.on(\"MESSAGE_SENT\", (sentMessage) => {\n dispatch({\n type: SOCKET_SENT_MESSAGE_ACTION_TRIGGER,\n data: sentMessage.msg,\n });\n });\n\n socketRef.current.on(\"MESSAGE_DELIVERED\", (deliveredMessage) => {\n dispatch({\n type: SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER,\n data: deliveredMessage.msg,\n });\n });\n\n socketRef.current.on(\"MESSAGE_READ\", (readMessage) => {\n dispatch({\n type: SOCKET_READ_MESSAGE_ACTION_TRIGGER,\n data: readMessage.msg,\n });\n });\n\n socketRef.current.on(\"MESSAGE_FAILED\", (failedMessage) => {\n dispatch({\n type: SOCKET_FAILED_MESSAGE_ACTION_TRIGGER,\n data: failedMessage.msg,\n });\n });\n\n socketRef.current.on(\"NEW_CHAT\", (chatData) => {\n dispatch({ type: SET_WIDGET_REQUEST, data: chatData.msg });\n });\n\n socketRef.current.on(\"BOT_PROCESSING_START\", (startTyping) => {\n let state = store.getState();\n if (startTyping?.msg?.convId === state?.AppReducer?.activeConvId?._id) {\n dispatch({\n type: BOT_PROCESSING_START,\n });\n }\n });\n\n socketRef.current.on(\"BOT_PROCESSING_END\", (endTyping) => {\n // if (endTyping?.msg?.convId === state?.AppReducer?.activeConvId?._id)\n dispatch({\n type: BOT_PROCESSING_END,\n });\n });\n\n socketRef.current.on(\"TYPING_START\", (startTyping) => {\n let state = store.getState();\n if (startTyping?.msg?.convId === state?.AppReducer?.activeConvId?._id) {\n dispatch({\n type: TYPING_START,\n });\n }\n });\n\n socketRef.current.on(\"TYPING_END\", (endTyping) => {\n // if (endTyping?.msg?.convId === state?.AppReducer?.activeConvId?._id)\n dispatch({\n type: TYPING_END,\n });\n });\n };\n\n const processStageChangeNotification = (notifData) => {\n const currentUrl = window.location.href;\n const parsedUrl = new URL(currentUrl);\n const pathname = parsedUrl.pathname;\n const openingsMatch = pathname.match(/openings\\/([^/]+)/);\n const candidatesMatch = pathname.match(/Candidates\\/([^/]+)/);\n const openingId = openingsMatch ? openingsMatch[1] : null;\n const stage = candidatesMatch ? candidatesMatch[1] : null;\n if (openingId !== notifData?.data?.openingId) {\n dispatch({\n type: \"ADD_NOTIF_COUNT_STAGE_CHANGE\",\n data: {\n type: \"stage\",\n stage_idSC: stage,\n opening_idSC: openingId,\n },\n });\n }\n };\n\n const processMessageNotification = (notifData) => {\n const currentUrl = window.location.href;\n const parsedUrl = new URL(currentUrl);\n const pathname = parsedUrl.pathname;\n const inboxMatch = pathname.match(/inbox\\/([^/]+)/);\n const convId = inboxMatch ? inboxMatch[1] : null;\n if (convId !== notifData.convData.convId) {\n dispatch({\n type: \"ADD_MESSAGE_COUNT\",\n data: {\n convId: notifData?.convData?.convId,\n md: notifData?.convData?.md,\n },\n });\n notification.success({\n message: \"You have a new message\",\n description:\n notifData?.convData.md === \"email\" ? (\n
\n \n {ReactHtmlParser(notifData?.convData?.text)}\n
\n \n history.push({\n pathname: `/admin/communication/inbox/${notifData?.convData?.convId}`,\n state: {\n channelAccountId: notifData?.convData?.channelAccountId,\n },\n })\n }\n >\n View\n \n \n ) : (\n
\n {truncateSt(notifData?.convData?.text, 30)}{\" \"}\n \n history.push({\n pathname: `/admin/communication/inbox/${notifData?.convData?.convId}`,\n state: {\n channelAccountId: notifData?.convData?.channelAccountId,\n },\n })\n }\n >\n View\n
\n \n ),\n icon: icons[notifData?.convData.md] ?? ,\n });\n dispatch({\n type: NEW_MESSAGE_ACTION_TRIGGER,\n data: notifData.convData,\n });\n } else {\n dispatch({ type: NEW_MESSAGE_ACTION_TRIGGER, data: notifData?.convData });\n }\n };\n\n return
{children}
;\n};\n\nexport default SocketWrapper;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { getCookie, setCookie } from \"utils\";\nimport history from \"utils/history\";\nconst Workspace = ({ setSwitching }) => {\n const [Active, setActive] = useState(\"\");\n const userTenants = useSelector(\n (state) => state.dittoAdminReducer?.user?.userTenants\n );\n const WpStyle = {\n border: \"1px solid #787f7b\",\n color: \"#787f7b\",\n width: \"40px\",\n margin: \"0px\",\n height: \"40px\",\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"center\",\n borderRadius: \"5px\",\n marginRight: 8,\n marginBottom: 10,\n cursor: \"pointer\",\n };\n const WpActive = {\n ...WpStyle,\n border: \"3px solid #ffffff\",\n color: \"#ffffff\",\n fontWeight: \"600\",\n };\n const handleChange = (i) => {\n setActive(i);\n setCookie(\"tenant\", i, 7 * 24 * 60 * 60 * 1000);\n\n setSwitching(true);\n setTimeout(() => {\n setSwitching(false);\n history.push(\"/\");\n }, 2000);\n };\n useEffect(() => {\n const tenantId = getCookie(\"tenant\");\n tenantId && setActive(tenantId);\n }, []);\n return (\n
\n {userTenants?.length > 1 && (\n
\n
\n {userTenants?.map((res) => {\n return (\n handleChange(res.tenantId)}\n >\n {res?.rolePerm?.name?.charAt(0)}\n
\n );\n })}\n
\n
\n )}\n \n );\n};\n\nexport default Workspace;\n","import {\n GET_TENANT_ACTION_ERROR,\n GET_TENANT_ACTION_RESPONSE,\n GET_TENANT_ACTION_TRIGGER,\n} from \"constant\";\n\nimport { get } from \"helper/networkClient\";\nimport { store } from \"../store\";\n\nconst getTenantActionResponse = (data) => ({\n type: GET_TENANT_ACTION_RESPONSE,\n data: data,\n});\n\nconst getTenantActionError = (data) => ({\n type: GET_TENANT_ACTION_ERROR,\n data: data,\n});\n\nexport const getTenantActionTrigger = () => async (dispatch) => {\n let Store = store.getState();\n let agents = Store?.AgentReducer?.agents;\n let tenants = Store?.TenantReducer?.tenants;\n if (agents?.data?.length === 0 || tenants?.length === 0) {\n dispatch({ type: GET_TENANT_ACTION_TRIGGER, data: {} });\n await get(\"/agents\").then((resp) => {\n if (resp.status === 200) {\n dispatch(getTenantActionResponse(resp.data));\n } else {\n dispatch(getTenantActionError(resp));\n }\n });\n }\n};\n","import React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXLayout } from \"component/Layout\";\nimport { getTenantActionTrigger } from \"action/TenantAction\";\nimport {\n getTenantSettings,\n getUserActionTrigger,\n mwfAllowedCheck,\n} from \"action/LogonAction\";\nimport { getSidebarNotifications } from \"action/NotificationActions\";\n\nconst Wrapper = (props) => {\n const dispatch = useDispatch();\n\n useEffect(() => {\n dispatch(getUserActionTrigger());\n dispatch(getTenantActionTrigger());\n dispatch(mwfAllowedCheck());\n dispatch(getTenantSettings());\n });\n useEffect(() => {\n dispatch(getSidebarNotifications());\n }, []);\n return ;\n};\n\nexport default Wrapper;\n","import React from \"react\";\n\nimport { CXContent } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\n\nconst DummyScreen = () => {\n return (\n \n
\n \n Comming Soon.....\n
\n
\n );\n};\n\nexport default DummyScreen;\n","import React from \"react\";\n\nimport { CXContent } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle, CXParagraph } from \"component/Typography\";\n\nconst NotFound404 = () => {\n return (\n \n
\n \n Back to Home\n \n The page you are looking for not exists...\n \n
\n
\n );\n};\n\nexport default NotFound404;\n","import React, { useEffect } from \"react\";\nimport { CXContent } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\n\nconst Logout = () => {\n return (\n \n
\n \n Signing Out.. \n
\n
\n );\n};\n\nexport default Logout;\n","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput, CXInputNumber } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { useEffect, useState } from \"react\";\nimport { Form } from \"antd\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n createContactFormField,\n updateContactFormField,\n} from \"action/ContactAction\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { generateUniqueKey } from \"utils\";\n\nconst CreateCustomFields = ({ setVisible, data = null }) => {\n const dispatch = useDispatch();\n const [AdvanceSettings, setAdvanceSettings] = useState(false);\n const [checkType, setcheckType] = useState(null);\n const { contactForm, action } = useSelector((state) => state.ContactReducer);\n const [loading, setloading] = useState(false);\n const [form] = Form.useForm();\n const CancelModal = () => {\n setloading(false);\n setVisible(false);\n setcheckType(null);\n setAdvanceSettings(false);\n form.resetFields();\n };\n const onFinish = (values) => {\n values.category = \"custom\";\n values.formId = contactForm._id;\n values.isActive = true;\n values.isCustom = true;\n values.type = typeOBj[values.element];\n values.multiselect = values.multiselect ? values.multiselect : false;\n if (data) {\n const { formId, ...rest } = values;\n dispatch(\n updateContactFormField(rest, {\n formId: contactForm._id,\n fieldId: data._id,\n })\n );\n } else {\n dispatch(createContactFormField(values));\n }\n\n setloading(true);\n };\n useEffect(() => {\n if (\n [\n \"CREATE_CONTACT_FORM_FIELD_RESPONSE\",\n \"CREATE_CONTACT_FORM_FIELD_ERROR\",\n \"GET_CONTACT_FORM_RESPONSE\",\n ].includes(action)\n ) {\n CancelModal();\n }\n }, [action]);\n\n let typeOBj = {\n input: \"text\",\n textArea: \"textArea\",\n dropDown: \"select\",\n calendar: \"date\",\n };\n\n useEffect(() => {\n if (data) {\n if (data.element === \"dropDown\") {\n setcheckType(\"dropDown\");\n }\n form.setFieldsValue({\n key: data.key,\n lebel: data.lebel,\n placeholder: data.placeholder,\n element: data.element,\n required: data.required,\n elementOptions: data.elementOptions,\n multiselect: data.multiselect,\n });\n setcheckType(data?.element);\n }\n }, [data]);\n\n return (\n
\n \n \n {data ? `Update custom field` : `Add custom field`}\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n setcheckType(value)}\n >\n Input\n Text Area\n Dropdown\n Calendar\n \n \n {checkType === \"dropDown\" && (\n \n \n \n )}\n
\n Is field mandatory ? \n \n \n \n \n \n
\n {checkType === \"dropDown\" && (\n
\n Is Multi-Select ? \n \n \n \n \n \n
\n )}\n\n \n Advance Settings\n \n \n \n \n\n {AdvanceSettings && (\n
\n
\n \n \n \n \n \n \n
\n
\n \n \n \n
\n
\n )}\n \n CancelModal()}\n className=\"CancelBtn mr-2\"\n >\n Cancel\n \n \n {data ? `Update` : `Save`}\n \n \n
\n
\n );\n};\n\nexport default CreateCustomFields;\n","import { CXLottie } from \"component/Lottie\";\nimport { post } from \"helper/networkClient\";\nimport React, { useEffect, useState } from \"react\";\n\nconst WhatsAppBusinessAccRedirect = () => {\n const [response, setresponse] = useState(null);\n const getParams = () => {\n const urlParams = new URLSearchParams(window.location.search);\n const params = {};\n for (let p of urlParams) {\n params[p[0]] = p[1];\n }\n return params;\n };\n const params = getParams();\n useEffect(() => {\n post(\"/channel-account/d360\", params)\n .then((res) => {\n setTimeout(() => {\n setresponse(\"success\");\n }, 1500);\n })\n .catch((err) => {\n setresponse(\"error\");\n });\n }, [params]);\n\n useEffect(() => {\n if (response === \"success\") {\n setTimeout(() => {\n window.close();\n }, 1500);\n }\n }, [response]);\n return (\n
\n
\n {!response && (\n
\n \n

\n Please wait while we are connecting your account.\n

\n
\n )}\n
\n
\n {response === \"success\" && (\n
\n \n

\n Thank you for connecting your WhatsApp Business Account.\n

\n
\n )}\n
\n
\n {response === \"error\" && (\n
\n \n

\n Sorry, we are unable to connect your WhatsApp Business Account,\n please try again later.\n

\n
\n )}\n
\n
\n );\n};\n\nexport default WhatsAppBusinessAccRedirect;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport {\n SIDEBAR_ADMIN,\n CONNECT_SIDEBAR_VIEW,\n ACTIVE_INDEX,\n ACTIVE_LIST_ADMIN,\n} from \"constant\";\nimport { CXText } from \"component/Typography\";\nimport { CXInput } from \"component/Input\";\nimport { CXSelect } from \"component/Select\";\nimport { CXMenu } from \"component/Menu\";\nimport { CXButton } from \"component/Button\";\nimport { GetUserTanent, SendInvite } from \"action/AdminActions\";\nimport { CXCard } from \"component/Card\";\nimport { CXCol } from \"component/Col\";\nimport { CXRow } from \"component/Row\";\nimport { CXAvatar } from \"component/Avatar\";\nimport { CXSearch } from \"component/Input\";\nimport { CXbotSkeleton, CXSkeleton } from \"component/Skeleton\";\nimport { CXEmpty } from \"component/Empty\";\nimport { truncateSt } from \"utils\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport \"./style.css\";\nimport { CXTag } from \"component/Tag\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { DeleteOutlined } from \"@ant-design/icons\";\nimport { deleteUser } from \"action/UserActions\";\nimport { CXModal } from \"component/Modal\";\n\nconst Index = () => {\n const [AgentData, setAgentData] = useState([]);\n const contentLoader = useSelector(\n (state) => state.AdminReducer.contentLoader\n );\n const [Email, setEmail] = useState([]);\n const [Access, setAccess] = useState(\"RECRUITER\");\n const dispatch = useDispatch();\n const handleAddNew = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"ADD\" });\n };\n const handleView = (id) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: id });\n };\n const handleInvite = () => {\n if (Email?.length > 0 && Access?.length > 0) {\n let data = Email.map((res) => {\n return {\n email: res.value,\n role: Access,\n };\n });\n dispatch(SendInvite(data));\n setEmail([]);\n setAccess(\"RECRUITER\");\n }\n };\n useEffect(() => {\n dispatch(getAgentsActionTrigger());\n dispatch({ type: ACTIVE_LIST_ADMIN, data: \"User\" });\n }, []);\n\n const userData = useSelector((state) => state.AdminReducer.userTenantList);\n const agentData = useSelector((state) => state.AgentReducer.agents);\n console.log(\"userData\", userData);\n\n useEffect(() => {\n if (userData?.length > 0) {\n dispatch({ type: \"CONTENT_LOADING\", data: false });\n setAgentData(userData);\n }\n if (agentData?.data?.length > 0) {\n dispatch({ type: \"CONTENT_LOADING\", data: false });\n setAgentData(agentData?.data);\n }\n }, [userData, agentData]);\n\n const [delUser, setdelUser] = useState(null);\n\n const selectAfter = (\n setAccess(val)}\n >\n OWNER\n ADMIN\n RECRUITER\n \n );\n\n const SearchData = (val) => {\n let data = userData?.filter((res) => {\n return (\n res?.fname?.toLowerCase()?.includes(val?.toLowerCase()) ||\n res?.lname?.toLowerCase()?.includes(val?.toLowerCase())\n );\n });\n setAgentData(data);\n };\n return (\n
\n \n \n User Management\n \n handleAddNew()}>\n Add User\n \n \n {/*
\n
Add Person
\n
\n
\n \n setEmail(val)}\n notFoundContent={null}\n defaultActiveFirstOption={false}\n labelInValue={true}\n showArrow={false}\n filterOption={false}\n >\n {options}\n \n
\n\n
\n as\n
\n
{selectAfter}
\n
\n\n
\n handleInvite()}\n >\n Invite\n \n handleAddNew()}\n >\n Add\n \n
\n
\n
Manage Access
\n SearchData(e.target.value)}\n />\n
*/}\n
\n {\" \"}\n
Manage Access
\n SearchData(e.target.value)}\n />\n
\n\n \n \n {contentLoader && (\n \n {[...Array(6)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {!contentLoader && AgentData?.length === 0 && (\n
\n \n
\n )}\n {!contentLoader &&\n AgentData?.map((res) => {\n return (\n
\n handleView(res?._id)}\n >\n {\n e.stopPropagation();\n setdelUser(res?._id);\n }}\n style={{\n position: \"absolute\",\n right: 10,\n top: 5,\n cursor: \"pointer\",\n }}\n >\n \n
\n \n \n \n {res?.fname?.length > 0\n ? res?.fname[0]?.toUpperCase()\n : \"UR\"}\n \n \n \n
\n {res?.fname\n ? truncateSt(\n res?.fname +\n \" \" +\n (res?.lname ? res?.lname : \"\"),\n 12\n )\n : \"User\"}\n
\n
\n Permission :{\" \"}\n {res?.roleInfo[0]?.role?.permissions[0]?.name.toUpperCase()}\n
\n
\n
\n \n {res?.roleInfo[0]?.role?.name.toUpperCase()}\n \n
\n
\n
\n {\" \"}\n {res.phone ?? \"NA\"}\n
\n
\n {\" \"}\n {truncateSt(res.email, 28) ?? \"NA\"}\n
\n
\n
\n \n \n );\n })}\n
\n {\n dispatch(deleteUser(delUser));\n setdelUser(null);\n }}\n onCancel={() => setdelUser(null)}\n className=\"ffm\"\n centered\n closable={false}\n >\n Are you sure you want to delete this user ?\n \n \n \n );\n};\n\nexport default Index;\n","import React, { useEffect } from \"react\";\nimport { CXCard } from \"component/Card\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXRow } from \"component/Row\";\nimport { CXText } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { SIDEBAR_ADMIN, CONNECT_SIDEBAR_VIEW, ACTIVE_INDEX } from \"constant\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { formatPhoneNumber } from \"utils\";\nimport { CXCol } from \"component/Col\";\nimport { CXbotSkeleton } from \"component/Skeleton\";\nimport { CXEmpty } from \"component/Empty\";\nimport { useParams } from \"react-router-dom\";\nconst Index = () => {\n const dispatch = useDispatch();\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const handleAddNew = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"ADD\" });\n };\n\n const handleView = (id) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: id });\n };\n const SMSList = useSelector((state) => state.AdminReducer.allConfigData);\n const contentLoader = useSelector(\n (state) => state.AdminReducer.contentLoader\n );\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n return (\n
\n \n {!contentLoader && (\n \n
handleAddNew()}>\n \n \"add\"\n \n \n \n Add New Number\n \n \n
\n \n )}\n {contentLoader && (\n \n {[...Array(6)].map((res) => {\n return (\n \n \n \n );\n })}\n \n )}\n {!contentLoader &&\n SMSList?.map((res) => {\n return (\n res?.md === \"sms\" && (\n \n \n {res?.status}\n \n handleView(res?._id)}\n />\n {res?.permissions?.find((v) => v?.name === \"Owner\")\n ?.principal === UserID && (\n \n )}\n \n \n
\n \n \n {(res?.configSms?.areaCode\n ? res?.configSms?.areaCode\n : \"\") +\n \" \" +\n formatPhoneNumber(res?.configSms?.number)}\n \n
\n
\n \n SMS\n \n MMS\n \n Voice\n
\n
\n )\n );\n })}\n
\n
\n );\n};\n\nexport default Index;\n","import React, { useEffect } from \"react\";\nimport { CXCard } from \"component/Card\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXRow } from \"component/Row\";\nimport { CXText } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { SIDEBAR_ADMIN, CONNECT_SIDEBAR_VIEW, ACTIVE_INDEX } from \"constant\";\nimport {\n GetAllConfig,\n deleteChannelAccount,\n patchMakeDefault,\n} from \"action/AdminActions\";\nimport moment from \"moment\";\nimport { CXSwitch } from \"component/Switch\";\nconst Index = () => {\n const dispatch = useDispatch();\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const handleAddNew = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"ADD\" });\n };\n const handleView = (index) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: index });\n };\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch({ type: \"CONN_ACCOUNT\", data: \"Email\" });\n }, []);\n const RemoveEmail = (id) => {\n dispatch(deleteChannelAccount(id));\n };\n useEffect(() => {\n const handleVisibilityChange = () => {\n if (!document.hidden) {\n dispatch(GetAllConfig());\n }\n };\n document?.addEventListener(\"visibilitychange\", handleVisibilityChange);\n return () => {\n document?.removeEventListener(\"visibilitychange\", handleVisibilityChange);\n };\n }, [dispatch]);\n return (\n
\n
\n \n \n
handleAddNew()}>\n \n \"add\"\n \n \n \n Add New Email\n \n \n
\n \n {EmailList?.map(\n (res, i) =>\n res?.md === \"email\" && (\n \n
\n
\n {\n if (val) {\n dispatch(\n patchMakeDefault({ channel_account_id: res._id })\n );\n }\n }}\n />\n
\n
\n {res.disableReason === \"authError\" && (\n \n )}\n handleView(res?._id)}\n />\n {res?.permissions?.find((v) => v.name === \"Owner\")\n ?.principal === UserID && (\n RemoveEmail(res._id)}\n />\n )}\n
\n
\n\n {res.configEmail?.provider === \"gmail\" && (\n
\n \n
\n )}\n {res.configEmail?.provider === \"smtp\" && (\n
\n \n
\n )}\n {res.configEmail?.provider !== \"gmail\" &&\n res.configEmail?.provider !== \"smtp\" && (\n
\n \n
\n )}\n
\n {res.configEmail?.email}\n
\n
\n {/*
\n \n
*/}\n
\n
\n Connected{\" \"}\n {moment(res.createdAt).startOf(\"day\").fromNow()}\n
\n
\n
\n
\n )\n )}\n
\n
\n \n HireBound's use and transfer of information received from Google APIs to\n any other app will adhere to\n \n \n Google API Services User Data Policy\n \n \n , including the Limited Use requirements.\n
\n \n );\n};\n\nexport default Index;\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { CXCard } from \"component/Card\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXRow } from \"component/Row\";\nimport { CXText } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport {\n SIDEBAR_ADMIN,\n CONNECT_SIDEBAR_VIEW,\n ACTIVE_INDEX,\n CONN_ACCOUNT,\n} from \"constant\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport moment from \"moment\";\nimport OauthPopup from \"component/OAuthPopup\";\nimport { CXSkeleton } from \"component/Skeleton\";\nconst Index = () => {\n const dispatch = useDispatch();\n const handleView = (index) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: index });\n };\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const { contentLoader } = useSelector((state) => state.AdminReducer);\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch({ type: CONN_ACCOUNT, data: \"Facebook\" });\n }, []);\n // const triggerFB = () => {\n // window.FB.login(\n // function (response) {\n // console.log(response);\n // },\n // {\n // config_id: \"782333f646513964\", // configuration ID goes here\n // response_type: \"code\", // must be set to 'code' for SUAT\n // }\n // );\n // };\n return (\n
\n
\n \n {(!contentLoader || EmailList?.length > 0) && (\n triggerFB()}\n >\n \n
\n \n \"add\"\n \n \n \n Add New Meta\n \n \n
\n
\n {/* \n \"add\"\n \n \n \n Add New Meta\n \n */}\n \n )}\n {contentLoader && EmailList?.length === 0 && (\n \n {[...Array(5)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {EmailList?.map(\n (res, i) =>\n res?.md === \"facebook\" && (\n \n
\n
\n {res?.status?.charAt(0)?.toUpperCase() +\n res?.status?.slice(1)}\n
\n handleView(res?._id)}\n />\n
\n\n
\n \n
\n
\n {res.configFb?.email\n ? res.configFb?.email\n : res.configFb?.userId}\n
\n
\n
\n
\n Connected{\" \"}\n {moment(res.createdAt).startOf(\"day\").fromNow()}\n
\n
\n
\n
\n )\n )}\n
\n
\n
\n );\n};\n\nexport default Index;\n","import React from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { WHATSAPP_CONNECT_SETTINGS } from \"constant\";\nimport FacebookConnect from \"component/FacebookConnect\";\n\nconst MetaConnect = () => {\n const dispatch = useDispatch();\n const { storeFacebook, whatsAppConnectSettings, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n const addSettings = (item, wabaId) => {\n dispatch({\n type: WHATSAPP_CONNECT_SETTINGS,\n data: { ...whatsAppConnectSettings, iaId: item, wabaId },\n });\n };\n return (\n
\n addSettings(item)}\n />\n
\n );\n};\n\nexport default MetaConnect;\n","import React, { useEffect } from \"react\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { WHATSAPP_CONNECT_SETTINGS } from \"constant\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getMetaNumber, getWBAphone } from \"action/AdminActions\";\nimport { formatPhoneNumberWithExt } from \"utils\";\nimport { CXCard } from \"component/Card\";\nimport { CXSkeleton } from \"component/Skeleton\";\n\nconst MetaWABANumbers = () => {\n const dispatch = useDispatch();\n const { whatsAppConnectSettings, MetaApisNumber, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n useEffect(() => {\n // dispatch(\n // getMetaNumber(\n // whatsAppConnectSettings.wabaId,\n // whatsAppConnectSettings.iaId\n // )\n // );\n dispatch(getWBAphone(whatsAppConnectSettings.iaId));\n }, []);\n const addSettings = (item) => {\n let numberData = MetaApisNumber?.data?.find((number) => number.id === item);\n dispatch({\n type: WHATSAPP_CONNECT_SETTINGS,\n data: {\n ...whatsAppConnectSettings,\n numberId: numberData.id,\n displayPhoneNumber: numberData.display_phone_number,\n qualityRating: numberData.quality_rating,\n name: numberData.verified_name,\n wabaId: numberData.wabaId,\n },\n });\n };\n return (\n
\n
Select your business Number
\n
\n {!Loading &&\n MetaApisNumber?.data?.map((item) => {\n return (\n addSettings(item.id)}\n >\n
\n \n
\n
\n
\n {formatPhoneNumberWithExt(item.display_phone_number)}\n
\n
{item.code_verification_status}
\n
\n \n );\n })}\n {Loading && (\n \n \n \n )}\n
\n
\n );\n};\n\nexport default MetaWABANumbers;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { CXStep, CXSteps } from \"component/Steps\";\nimport ConnectFacebook from \"screen/UserPortal/Admin/whatsappStore/createStore/connectFacebook\";\nimport {\n getStoreIntegartionFacebook,\n registerWhatsAppAccount,\n} from \"action/AdminActions\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Button } from \"antd\";\nimport MetaConnect from \"./MetaConnect\";\nimport MetaBusiness from \"./MetaBusiness\";\nimport MetaWABANumbers from \"./MetaWABA_numbers\";\nimport MetaWABA from \"./MetaWABA\";\nimport \"./style.css\";\nimport { CXLottie } from \"component/Lottie\";\n\nconst StoreSteps = ({ close }) => {\n const { whatsAppConnectSettings } = useSelector(\n (state) => state.AdminReducer\n );\n const [current, setCurrent] = useState(0);\n const [Finished, setFinished] = useState(false);\n const dispatch = useDispatch();\n const steps = [\n ,\n // ,\n // ,\n ,\n ];\n const obj = {\n 0: whatsAppConnectSettings?.iaId ? \"nextbtn\" : \"nextbtnDisabled\",\n // 1: whatsAppConnectSettings?.businessId ? \"nextbtn\" : \"nextbtnDisabled\",\n // 2: whatsAppConnectSettings?.wabaId ? \"nextbtn\" : \"nextbtnDisabled\",\n 1: whatsAppConnectSettings?.numberId ? \"nextbtn\" : \"nextbtnDisabled\",\n };\n const items = steps.map((item) => ({\n key: item.title,\n title: item.title,\n }));\n const stepItems = [\n {\n title: \"Connect Meta\",\n },\n {\n title: \"WBA Numbers\",\n },\n ];\n useEffect(() => {\n dispatch(getStoreIntegartionFacebook());\n }, []);\n const next = () => {\n setCurrent(current + 1);\n };\n const prev = () => {\n setCurrent(current - 1);\n };\n const Close = () => {\n setFinished(false);\n close(false);\n };\n const finshSteps = () => {\n setFinished(true);\n dispatch(registerWhatsAppAccount(whatsAppConnectSettings));\n };\n return (\n \n
\n
\n
\n \n {stepItems?.map((item) => {\n return ;\n })}\n \n
\n
\n {!Finished &&
{steps[current]}
}\n {Finished && (\n //
\n // \"end\"\n //
\n
\n \n
\n WhatsApp account added\n
\n
\n )}\n
\n
\n
\n
\n {!Finished && current < steps?.length - 1 && (\n next()}\n className={obj[current]}\n >\n Next step\n \n )}\n {!Finished && current === steps?.length - 1 && (\n finshSteps()}\n >\n Finish\n \n )}\n {!Finished && current > 0 && (\n prev()}\n >\n Previous\n \n )}\n
\n
\n {Finished && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default StoreSteps;\n","import React, { useState } from \"react\";\nimport StoreSteps from \"./StoreSteps\";\nimport \"../style.css\";\n\nconst WhatsAppOnboard = ({ close }) => {\n return (\n
\n
\n
Connect your whatsapp
\n
\n Please complete the following steps to setup whatsapp\n
\n
\n
\n \n
\n
\n );\n};\n\nexport default WhatsAppOnboard;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { CXCard } from \"component/Card\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXRow } from \"component/Row\";\nimport { CXText } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport {\n SIDEBAR_ADMIN,\n CONNECT_SIDEBAR_VIEW,\n ACTIVE_INDEX,\n CONN_ACCOUNT,\n} from \"constant\";\nimport { GetAllConfig, getWhatAppWebhook } from \"action/AdminActions\";\nimport moment from \"moment\";\nimport \"./style.css\";\nimport { CopyOutlined } from \"@ant-design/icons\";\nimport { copyHandler, formatPhoneNumberWithExt } from \"utils\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport WhatsAppOnboard from \"./WhatsAppOnboard/index\";\nconst Index = () => {\n const dispatch = useDispatch();\n const [WhatsAppOnboardComponent, setWhatsAppOnboardComponent] =\n useState(false);\n\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const handleAddNew = () => {\n setWhatsAppOnboardComponent(true);\n // waba logic comming from backend usePref api a/o\n // if (\n // user?.userTenants?.find((item) => item?.userId === user?.userProfile?._id)\n // ?.waba === \"o\"\n // ) {\n // setWhatsAppOnboardComponent(true);\n // } else {\n // dispatch({ type: SIDEBAR_ADMIN, data: false });\n // dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"ADD\" });\n // }\n };\n const handleView = (index) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: index });\n };\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const { WhatsAppWebhook, contentLoader } = useSelector(\n (state) => state.AdminReducer\n );\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch(getWhatAppWebhook());\n dispatch({ type: CONN_ACCOUNT, data: \"WhatsApp\" });\n }, []);\n\n (function (d, s, id) {\n var js,\n fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0\";\n fjs.parentNode.insertBefore(js, fjs);\n window.fbAsyncInit = function () {\n window.FB.init({\n appId: \"205273405747495\", // Facebook App ID\n cookie: true, // enable cookies\n xfbml: true, // parse social plugins on this page\n version: \"v18.0\", //Graph API version\n });\n };\n })(document, \"script\", \"facebook-jssdk\");\n\n const launchWhatsAppSignup = () => {\n if (window.FB) {\n window?.FB?.login(\n function (response) {\n if (response.authResponse) {\n const code = response.authResponse.code;\n console.log(\"code===>˝\", code);\n } else {\n console.log(\"User cancelled login or did not fully authorize.\");\n }\n },\n {\n config_id: \"353738990334993\", // configuration ID goes here\n response_type: \"code\", // must be set to 'code' for System User access token\n override_default_response_type: true, // when true, any response types passed in the \"response_type\" will take precedence over the default types\n extras: {\n featureType: \"only_waba_sharing\", // Bypass phone number selection\n },\n }\n );\n }\n };\n return (\n \n {!WhatsAppOnboardComponent && (\n
\n \n
\n {\" \"}\n Zipnip’s Webhook URL :{\" \"}\n {WhatsAppWebhook?.webhookUrl ?? \"NA\"}\n {WhatsAppWebhook?.webhookUrl && (\n \n \n copyHandler(\n WhatsAppWebhook?.webhookUrl,\n \"URL copied to clipboard\"\n )\n }\n />\n \n )}\n
\n
\n \n {(!contentLoader || EmailList?.length > 0) && (\n \n handleAddNew()}\n >\n \n \"add\"\n \n \n \n Add New WhatsApp\n \n \n
\n \n )}\n {/* \n launchWhatsAppSignup()}\n >\n \n \"add\"\n \n \n \n FaceBookTest\n \n \n \n */}\n {contentLoader && EmailList?.length === 0 && (\n \n {[...Array(5)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {EmailList?.map(\n (res, i) =>\n res?.md === \"whatsapp\" && (\n \n
\n
\n {res?.status?.charAt(0)?.toUpperCase() +\n res?.status?.slice(1)}\n
\n handleView(res?._id)}\n />\n
\n\n
\n \n
\n
\n {res.configWp?.name}\n
\n
\n {formatPhoneNumberWithExt(res.configWp?.senderId)}\n
\n\n
\n
\n
\n Connected{\" \"}\n {moment(res.createdAt).startOf(\"day\").fromNow()}\n
\n
\n
\n
\n )\n )}\n \n \n \n
\n )}\n {WhatsAppOnboardComponent && (\n \n )}\n
\n );\n};\n\nexport default Index;\n","import React, { useState } from \"react\";\nimport { CXTabs } from \"component/Tabs\";\nimport SMS from \"./Sms/index\";\nimport Email from \"./Email/index\";\nimport Facebook from \"./Facebook\";\nimport WhatsApp from \"./Whatsapp\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { useDispatch } from \"react-redux\";\nimport { CONN_ACCOUNT, SIDEBAR_ADMIN } from \"constant\";\nimport DummyScreen from \"screen/DummyScreen\";\n\nconst Tabs = ({ url }) => {\n const { subId } = useParams();\n const dispatch = useDispatch();\n const [Active, setActive] = useState(subId);\n const handleActive = (val) => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONN_ACCOUNT, data: val });\n history.push(`${url}/${val}`);\n };\n return (\n
\n handleActive(ac)}\n items={[\n {\n key: \"SMS\",\n label: \"SMS\",\n children: ,\n },\n {\n key: \"WhatsApp\",\n label: \"WhatsApp\",\n children: ,\n },\n {\n key: \"Facebook\",\n label: \"Facebook\",\n children: ,\n },\n {\n key: \"Email\",\n label: \"Email\",\n children: ,\n },\n {\n key: \"Google\",\n label: \"Google\",\n children: ,\n },\n ]}\n />\n
\n );\n};\n\nexport default Tabs;\n\n// SMS & EMAIL have working component just disabled for now, as it is not required.\n","import React from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { Switch, Route, useRouteMatch } from \"react-router-dom\";\nimport \"./style.css\";\nimport Tabs from \"./Tabs\";\n\nconst Index = () => {\n const { path, url } = useRouteMatch();\n return (\n
\n \n \n Connected Accounts\n \n \n
\n \n \n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default Index;\n","import {\n deleteCalendarAccount,\n getCalenderIntegrationAccounts,\n} from \"action/AdminActions\";\nimport { CXCard } from \"component/Card\";\nimport { CXCol } from \"component/Col\";\nimport { CXContent } from \"component/Layout\";\nimport { CXRow } from \"component/Row\";\nimport { CXbotSkeleton } from \"component/Skeleton\";\nimport { CXText } from \"component/Typography\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst Index = () => {\n const dispatch = useDispatch();\n const { CalendarAccountsLoading, CalendarAccounts, SideBarView } =\n useSelector((state) => state.AdminReducer);\n const handleAddNew = () => {\n dispatch({ type: \"SIDEBAR_ADMIN\", data: false });\n dispatch({ type: \"CONNECT_SIDEBAR_VIEW\", data: \"ADD\" });\n };\n useEffect(() => {\n if (SideBarView !== \"ADD\") {\n dispatch(getCalenderIntegrationAccounts());\n }\n dispatch({ type: \"CONN_ACCOUNT\", data: \"Calendar\" });\n }, []);\n useEffect(() => {\n const handleVisibilityChange = () => {\n if (!document.hidden) {\n dispatch(getCalenderIntegrationAccounts());\n }\n };\n document?.addEventListener(\"visibilitychange\", handleVisibilityChange);\n return () => {\n document?.removeEventListener(\"visibilitychange\", handleVisibilityChange);\n };\n }, [dispatch]);\n return (\n
\n \n {!CalendarAccountsLoading && (\n \n
handleAddNew()}>\n \n \"add\"\n \n \n \n Add New\n \n \n
\n \n )}\n {!CalendarAccountsLoading &&\n CalendarAccounts?.map((item, index) => {\n if (item?.dtls?.accessRole === \"owner\") {\n return (\n \n
\n
\n
\n \n dispatch(deleteCalendarAccount(item._id))\n }\n src={\"/images/Admin/deleteIcon.svg\"}\n className=\"mr-1 cursor-pointer iconconfig\"\n alt=\"delete\"\n />\n
\n
\n {item?.provider?.charAt(0)?.toUpperCase() +\n item?.provider?.slice(1) ===\n \"Google\" ? (\n
\n \n
\n ) : (\n item?.provider?.charAt(0)?.toUpperCase() +\n item?.provider?.slice(1)\n )}\n
\n
\n
\n
\n {item?.dtls?.name}\n
\n \n Access :{\" \"}\n {item?.dtls?.accessRole.charAt(0).toUpperCase() +\n item?.dtls?.accessRole.slice(1)}\n
\n \n \n \n );\n }\n })}\n {CalendarAccountsLoading && (\n \n {[...Array(6)].map((res) => {\n return (\n \n \n \n );\n })}\n \n )}\n \n \n );\n};\n\nexport default Index;\n","import React, { useEffect, useState } from \"react\";\nimport { CXTabs } from \"component/Tabs\";\nimport { useDispatch } from \"react-redux\";\nimport { CONN_ACCOUNT, SIDEBAR_ADMIN } from \"constant\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport Calendar from \"./Calendar\";\n\nconst Tabs = ({ url }) => {\n const { subId } = useParams();\n const dispatch = useDispatch();\n const [Active, setActive] = useState(subId);\n const handleActive = (val) => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONN_ACCOUNT, data: val });\n history.push(`${url}/${val}`);\n };\n return (\n
\n handleActive(ac)}\n items={[\n {\n key: \"Calendar\",\n label: \"Calendar\",\n children: ,\n },\n // {\n // key: \"Payment\",\n // label: \"Payment\",\n // children: ,\n // },\n // {\n // key: \"Shopify\",\n // label: \"Shopify\",\n // children: ,\n // },\n // {\n // key: \"Zendesk\",\n // label: \"Zendesk\",\n // children: ,\n // },\n ]}\n />\n
\n );\n};\n\nexport default Tabs;\n","import React, { useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport Tabs from \"./Tabs\";\nimport { Switch, Route, useRouteMatch } from \"react-router-dom\";\n\nconst Index = () => {\n const { path, url } = useRouteMatch();\n return (\n
\n \n \n Integrations\n \n \n
\n \n \n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default Index;\n","import { GetLanguages, updateLanguageSettings } from \"action/AdminActions\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\n\nimport { ACTIVE_INDEX, CONNECT_SIDEBAR_VIEW, SIDEBAR_ADMIN } from \"constant\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst LanguageSettings = () => {\n const [form] = Form.useForm();\n const { languages } = useSelector((state) => state.AdminReducer);\n const [Select, setSelect] = useState(null);\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch(GetLanguages());\n }, []);\n useEffect(() => {\n if (languages?.length > 0 && Select === null) {\n form.setFieldsValue({\n language: languages?.find((l) => l?.isDefault)?._id,\n });\n setSelect(languages?.find((l) => l?.isDefault)?._id);\n }\n }, [languages]);\n const onFinish = (values) => {\n const {\n language,\n typePlaceholder,\n startChatPlaceholder,\n btnText,\n articleTitle,\n collectionTitle,\n isDefault,\n } = values;\n let obj = {\n _id: language,\n screenId: \"faq\",\n isDefault: isDefault,\n keywords: [\n {\n label: \"Type placeholder\",\n key: \"typePlaceholder\",\n value: typePlaceholder ?? \"\",\n },\n {\n label: \"Start chat placeholder\",\n key: \"startChatPlaceholder\",\n value: startChatPlaceholder ?? \"\",\n },\n {\n label: \"Start chat button\",\n key: \"btnText\",\n value: btnText ?? \"\",\n },\n {\n label: \"Article title\",\n key: \"articleTitle\",\n value: articleTitle ?? \"\",\n },\n {\n label: \"Collection title\",\n key: \"collectionTitle\",\n value: collectionTitle ?? \"\",\n },\n ],\n };\n language && dispatch(updateLanguageSettings(obj));\n // form.resetFields();\n };\n const handleAddNew = (id) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"ADD\" });\n dispatch({ type: ACTIVE_INDEX, data: id });\n };\n useEffect(() => {\n if (languages?.length > 0) {\n form.setFieldsValue({\n typePlaceholder: languages\n ?.find((l) => l?._id === Select)\n ?.keywords.find((k) => k.key === \"typePlaceholder\")?.value,\n startChatPlaceholder: languages\n ?.find((l) => l?._id === Select)\n ?.keywords.find((k) => k.key === \"startChatPlaceholder\")?.value,\n btnText: languages\n ?.find((l) => l?._id === Select)\n ?.keywords.find((k) => k.key === \"btnText\")?.value,\n articleTitle: languages\n ?.find((l) => l?._id === Select)\n ?.keywords.find((k) => k.key === \"articleTitle\")?.value,\n collectionTitle: languages\n ?.find((l) => l?._id === Select)\n ?.keywords.find((k) => k.key === \"collectionTitle\")?.value,\n isDefault: languages?.find((l) => l?._id === Select)?.isDefault,\n });\n }\n }, [Select]);\n return (\n \n \n \n Language Settings\n \n handleAddNew()}>\n Add More\n \n \n
\n \n \n setSelect(val)}>\n {languages?.map((res) => {\n return (\n \n {res.displayName}\n \n );\n })}\n \n \n \n \n \n {/* map object */}\n
\n {languages\n ?.find((l) => l?._id === Select)\n ?.keywords?.map((res) => {\n return (\n \n \n \n );\n })}\n {/* {Select && renderForm()} */}\n {languages?.length > 0 && (\n \n \n Update & Submit\n \n \n )}\n
\n
\n
\n
\n );\n};\n\nexport default LanguageSettings;\n","import {\n getNotificationPreference,\n updateNotificationPreference,\n} from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXTable } from \"component/Table\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst Index = () => {\n const dispatch = useDispatch();\n const [datatable, setddatatable] = useState([]);\n const [updateTable, setupdateTable] = useState([]);\n const { NotificationPreference, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n const SaveSettings = () => {\n dispatch(updateNotificationPreference(updateTable));\n };\n useEffect(() => {\n dispatch(getNotificationPreference());\n }, []);\n\n const updateHandler = (id, check, val) => {\n let temp = updateTable.map((res) => {\n if (res.case === id) {\n if (check) {\n res.mds.push(val);\n } else {\n res.mds = res.mds.filter((item) => item !== val);\n }\n }\n return res;\n });\n setupdateTable(temp);\n };\n const columns = [\n {\n title: \"Event Type\",\n dataIndex: \"desc\",\n key: \"desc\",\n render: (text) => text ?? \"N/A\",\n },\n {\n title: \"Push Notification (Web / Mobile)\",\n dataIndex: \"data\",\n key: \"push\",\n render: (data) => {\n return (\n
\n updateHandler(data.case, val, \"push\")}\n />\n
\n );\n },\n },\n {\n title: \"Email\",\n dataIndex: \"data\",\n key: \"email\",\n render: (data) => {\n return (\n
\n updateHandler(data.case, val, \"email\")}\n />\n
\n );\n },\n },\n ];\n useEffect(() => {\n if (NotificationPreference?.enabled?.length > 0) {\n setupdateTable(NotificationPreference?.enabled);\n let temp = [];\n NotificationPreference?.enabled?.map((item) => {\n temp.push({\n desc: item.desc,\n data: { mds: item.mds, case: item.case },\n });\n });\n setddatatable(temp);\n }\n }, [NotificationPreference]);\n return (\n
\n \n \n Notification Settings\n \n SaveSettings()}>\n Save\n \n \n
\n
\n {Loading && }\n
\n {!Loading && (\n \n \n \n )}\n
\n
\n );\n};\n\nexport default Index;\n","import React from \"react\";\nimport { CXSider, CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { ACTIVE_LIST_ADMIN, SIDEBAR_ADMIN, CONTENT_LOADING } from \"constant\";\nimport history from \"utils/history\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport { CXTag } from \"component/Tag\";\nconst SideBar = () => {\n const dispatch = useDispatch();\n const { url } = useRouteMatch();\n const addBotSider = useSelector((state) => state.AdminReducer.ActiveList);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const handleActiveList = (val) => {\n dispatch({ type: ACTIVE_LIST_ADMIN, data: val });\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONTENT_LOADING, data: true });\n history.push(`${url}/${val}`);\n };\n return (\n \n \n \n Admin\n \n
\n \n {\n user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.plan?.name\n }{\" \"}\n Plan\n \n
\n
\n \n handleActiveList(\"User\")}\n >\n \n User Management\n \n handleActiveList(\"Connected\")}\n >\n
\n \n Connected Accounts\n
\n \n handleActiveList(\"Integration\")}\n >\n \n Integrations\n \n handleActiveList(\"Language\")}\n >\n \n Language\n \n handleActiveList(\"notificationSettings\")}\n >\n \n Notification Settings\n \n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n handleActiveList(\"candidateForm\")}\n >\n \n Candidate Form Configuration\n \n )}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n handleActiveList(\"AccountVariableDefinitions\")}\n >\n \n Account variable definitions\n \n )}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.tenantId?.tpd && (\n handleActiveList(\"organizationSettings\")}\n >\n \n Organization page settings\n \n )}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n handleActiveList(\"stageConfiguration\")}\n >\n \n Stage Configuration\n \n )}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n handleActiveList(\"QuestionnaireConfiguration\")}\n >\n \n Questionnaire Configuration\n \n )}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n handleActiveList(\"TrackerConfiguration\")}\n >\n \n Tracker Configuration\n \n )}\n {/* handleActiveList(\"whatsapp_store\")}\n >\n \n Setup Whatsapp Store\n */}\n \n \n );\n};\n\nexport default SideBar;\n","import * as Yup from \"yup\";\n\nexport const AddUser = Yup.object().shape({\n email: Yup.string()\n .email(\"Invalid username\")\n .max(50, \"Email too long\")\n .required(\"Email is required\"),\n password: Yup.string()\n .min(6, \"Password too short\")\n .max(50, \"Password too long\")\n .required(\"Password is required\"),\n fname: Yup.string().required(\"First Name is required\"),\n lname: Yup.string().required(\"Last Name is required\"),\n role: Yup.string().required(\"Role is required\"),\n phone: Yup.string()\n .required(\"Phone is required\")\n .matches(/^[0-9+]+$/, \"Phone must contain only numbers\"),\n});\n","import React, { useState } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { SIDEBAR_ADMIN, CONTENT_LOADING } from \"constant\";\nimport { CXInput } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { CreateNewUser } from \"action/AdminActions\";\nimport { CXSelect } from \"component/Select\";\nimport { CXMenu } from \"component/Menu\";\nimport { Formik } from \"formik\";\nimport { Form } from \"antd\";\nimport { CXPassword } from \"component/Input\";\nimport { AddUser } from \"./AddUser.validation\";\n\nconst AddNew = (props) => {\n const userData = useSelector((state) => state.AdminReducer.userTenantList);\n const [Eval, setEval] = useState(false);\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n };\n const handleAddNew = (values, props) => {\n if (userData.some((res) => res.email === values.email)) {\n setEval(true);\n } else {\n setEval(false);\n let obj = {\n fname: values.fname,\n lname: values.lname,\n email: values.email,\n password: values.password,\n phone: values.phone,\n roleId: values.role,\n };\n dispatch(CreateNewUser(obj));\n dispatch({ type: CONTENT_LOADING, data: true });\n props.resetForm();\n }\n };\n\n return (\n
\n \n \n Add New User\n \n
\n handleClose()}\n />\n
\n
\n \n {({\n values,\n errors,\n touched,\n handleChange,\n handleBlur,\n handleSubmit,\n isValid,\n setFieldValue,\n }) => (\n {\n if (e.key === \"Enter\") {\n handleSubmit();\n }\n }}\n >\n
\n \n \n \n \n \n \n \n setFieldValue(\"role\", value)}\n onBlur={handleBlur}\n value={values.role}\n >\n \n OWNER\n \n \n ADMIN\n \n RECRUITER\n \n \n \n \n \n \n \n \n \n \n \n \n ADD NEW USER\n \n \n \n )}\n \n {Eval && (\n
\n Email already exist !\n
\n )}\n
\n );\n};\n\nexport default AddNew;\n","import React, { useState, useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { SIDEBAR_ADMIN, SMS_SIDEBAR_VIEW } from \"constant\";\nimport { CXInput } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { CreateNewUser } from \"action/AdminActions\";\nimport { CXSelect } from \"component/Select\";\nimport { CXMenu } from \"component/Menu\";\nimport { CXSwitch } from \"component/Switch\";\nimport { updateUserDetails } from \"action/UserActions\";\n\nconst ViewData = () => {\n const userId = useSelector((state) => state.AdminReducer.ActiveIndex);\n const Agents = useSelector((state) => state.AgentReducer?.agents?.data);\n const options = [];\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n };\n const [Data, setData] = useState({});\n const handleChange = (key, val) => {\n setData({ ...Data, [key]: val });\n };\n const handleSubmit = () => {\n const { fname, lname, role, enable2fa, phone, ...rest } = Data;\n let obj = {\n _id: userId,\n fname,\n lname,\n role,\n phone,\n enable2fa,\n };\n dispatch(updateUserDetails(obj));\n setData({});\n handleClose();\n };\n useEffect(() => {\n let active = Agents?.filter((data) => data._id === userId);\n active?.length > 0 && setData(active[0]);\n }, [userId]);\n return (\n
\n \n \n User Details\n \n
\n handleClose()}\n />\n
\n
\n
\n
First Name
\n handleChange(\"fname\", e.target.value)}\n value={Data?.fname ? Data?.fname : \"\"}\n />\n
Last Name
\n handleChange(\"lname\", e.target.value)}\n value={Data?.lname ? Data?.lname : \"\"}\n />\n
Role
\n handleChange(\"role\", value)}\n value={Data?.roleInfo ? Data?.roleInfo[0].role?.name : \"\"}\n >\n \n OWNER\n \n ADMIN\n RECRUITER\n \n {/*
Email
\n handleChange(\"email\", e.target.value)}\n value={Data?.email ? Data?.email : \"\"}\n /> */}\n
Phone
\n handleChange(\"phone\", e.target.value)}\n value={Data?.phone ? Data?.phone : \"\"}\n />\n {/*
skills
\n handleChange(\"skills\", value)}\n >\n
\n
Enable 2fa
\n handleChange(\"enable2fa\", event)}\n />\n
*/}\n\n handleSubmit()}\n >\n UPDATE USER\n \n
\n
\n );\n};\n\nexport default ViewData;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddComp from \"./AddNew\";\nimport ViewComp from \"./ViewData\";\nconst UserData = () => {\n const SMSSider = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n ADD: ,\n VIEW: ,\n };\n return obj[SMSSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default UserData;\n","import React, { useState, useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport {\n SIDEBAR_ADMIN,\n CONNECT_SIDEBAR_VIEW,\n CHECK_PHONE_AVL,\n SMS_SEARCH,\n SMS_NO_DATA,\n} from \"constant\";\nimport { CXText } from \"component/Typography\";\nimport { CXSelect } from \"component/Select\";\nimport { CXOption } from \"component/Select\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CheckPhoneAvl, SmsCreateAction } from \"action/AdminActions\";\nimport { CXCard } from \"component/Card\";\nimport { CXSpin } from \"component/Spin\";\nconst AddNewNumber = () => {\n const [CountryCode, setCountryCode] = useState(+1);\n const [AreaCode, setAreaCode] = useState(\"\");\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch({ type: SMS_NO_DATA, data: false });\n }, []);\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: CHECK_PHONE_AVL, data: [] });\n };\n const handleSearch = () => {\n if (AreaCode?.length > 0) {\n dispatch({ type: SMS_NO_DATA, data: false });\n dispatch({ type: CHECK_PHONE_AVL, data: [] });\n dispatch({ type: SMS_SEARCH, data: true });\n dispatch(CheckPhoneAvl(\"%2b\" + CountryCode + AreaCode));\n }\n };\n const AvlPhnList = useSelector((state) => state.AdminReducer.CheckPhnAvl);\n const SmsData = useSelector((state) => state.AdminReducer.smsEmpty);\n const Loading = useSelector((state) => state.AdminReducer.Loading);\n const handleSelect = (data) => {\n let obj = {\n md: \"sms\",\n configSms: {\n provider: \"twilio\",\n number: data.friendlyName.replace(/[()\\ \\s-]+/g, \"\"),\n areaCode: \"+\" + CountryCode,\n },\n preHook: \"https://sample.com/prehooks\",\n postHook: \"https://sample.com/posthooks\",\n outgoingEnabled: true,\n incomingEnabled: true,\n systemDefault: true,\n status: \"active\",\n };\n dispatch(SmsCreateAction(obj));\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: CHECK_PHONE_AVL, data: [] });\n setAreaCode(\"\");\n };\n return (\n
\n \n \n Add New Number\n \n
\n handleClose()}\n />\n
\n
\n
\n
\n CountryCode\n setCountryCode(value)}\n value={CountryCode}\n >\n \n United States +1\n \n \n
\n
\n Area Code\n setAreaCode(e.target.value.trim())}\n value={AreaCode}\n />\n
\n
\n handleSearch()}\n >\n SEARCH\n \n
\n {Loading && (\n
\n \n
\n )}\n\n \n {SmsData && (\n \n Area Code Not Found\n
\n )}\n {AvlPhnList?.map((res) => {\n return (\n
\n handleSelect(res)}\n >\n
\n \n \n {res?.friendlyName}\n \n
\n
\n \n {res.locality + \" \" + res.region}\n \n
\n
\n \n SMS\n \n MMS\n \n Voice\n
\n \n
\n );\n })}\n
\n \n \n );\n};\n\nexport default AddNewNumber;\n","import { updateChannelAccountAccess } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXModal } from \"component/Modal\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst ShareWithModal = ({ OpenModal, setOpenModal, data }) => {\n const dispatch = useDispatch();\n const [SelectedUsers, setSelectedUsers] = useState([]);\n const [Access, setAccess] = useState(null);\n const { agents, loading } = useSelector((state) => state.AgentReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const HandleShare = () => {\n let Permissions = SelectedUsers.map((v) => {\n return {\n principal: v,\n name: Access,\n };\n });\n let obj = {\n caId: data?._id,\n Permissions,\n };\n dispatch(updateChannelAccountAccess(obj));\n setOpenModal(false);\n setSelectedUsers([]);\n setAccess(null);\n };\n return (\n
\n {\" \"}\n \n
\n
Share account with
\n
Accounts
\n setSelectedUsers(event)}\n value={SelectedUsers}\n >\n {agents?.data?.map((obj) => {\n if (!data?.permissions?.find((v) => v.principal === obj._id)) {\n return (\n \n
\n
\n {obj.fname} - ({obj.email})\n
\n
\n
\n );\n }\n })}\n \n
Access writes
\n setAccess(event)}\n value={Access}\n >\n \n
Read →
{\" \"}\n
Can view account, send and receive messages
\n
\n {data?.permissions?.find((v) => v.name === \"Owner\")?.principal ===\n UserID && (\n \n
Owner →
{\" \"}\n
Can add/remove accounts and send / receive messages
\n
\n )}\n \n
\n
\n {\n setOpenModal(false);\n setSelectedUsers([]);\n setAccess(null);\n }}\n className=\"CancelBtn\"\n >\n Cancel\n \n HandleShare()}\n className={\n SelectedUsers?.length === 0 || Access === null\n ? \"addCardbtn-disabled\"\n : \"addCardbtn\"\n }\n disabled={SelectedUsers?.length === 0 || Access === null}\n >\n Share\n \n
\n
\n
\n \n
\n );\n};\n\nexport default ShareWithModal;\n","import { updateChannelAccountAccess } from \"action/AdminActions\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst Index = ({ data }) => {\n const dispatch = useDispatch();\n const { agents, loading } = useSelector((state) => state.AgentReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n useEffect(() => {\n dispatch(getAgentsActionTrigger());\n }, []);\n const PatchAccess = (A, P) => {\n let obj = {\n caId: data?._id,\n Permissions: [\n {\n principal: P,\n name: A,\n },\n ],\n };\n dispatch(updateChannelAccountAccess(obj));\n };\n return (\n
\n
\n {agents && data?.permissions?.length > 1 && (\n
Shared With
\n )}\n {loading && }\n {!loading &&\n agents &&\n data?.permissions?.map((obj) => {\n if (obj?.principal !== UserID) {\n return (\n
\n
\n {agents?.data?.find((v) => v?._id === obj?.principal)\n ?.fname +\n \" \" +\n agents?.data?.find((v) => v?._id === obj?.principal)\n ?.lname}\n
\n PatchAccess(event, obj?.principal)}\n >\n Read\n {data?.permissions?.find((v) => v.name === \"Owner\")\n ?.principal === UserID && (\n Owner\n )}\n {data?.permissions?.find((v) => v.name === \"Owner\")\n ?.principal === UserID && (\n Remove\n )}\n \n
\n );\n }\n })}\n
\n
\n );\n};\n\nexport default Index;\n","import React, { useEffect, useState } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXRow } from \"component/Row\";\nimport { CXText } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport { SIDEBAR_ADMIN, CONNECT_SIDEBAR_VIEW, ACTIVE_INDEX } from \"constant\";\nimport { formatPhoneNumber } from \"utils\";\nimport ShareWithModal from \"../ShareWith/ShareWithModal\";\nimport ShareWith from \"../ShareWith\";\nconst ViewNumber = () => {\n const [data, setdata] = useState();\n const SMSList = useSelector((state) => state.AdminReducer.allConfigData);\n const Index = useSelector((state) => state.AdminReducer.ActiveIndex);\n const [OpenModal, setOpenModal] = useState(false);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: ACTIVE_INDEX, data: null });\n };\n useEffect(() => {\n let obj = SMSList.filter((obj) => obj._id === Index);\n setdata(obj[0]);\n }, [Index, SMSList]);\n return (\n
\n \n \n Analytics\n \n
\n handleClose()}\n />\n
\n
\n
\n
\n \n {data?.status}\n {data?.permissions?.find((v) => v.name === \"Owner\")?.principal ===\n UserID && (\n setOpenModal(true)}\n style={{\n fontSize: \"12px\",\n padding: \"6px\",\n }}\n >\n Share\n \n )}\n \n
\n \n \n {(data?.configSms?.areaCode ? data?.configSms?.areaCode : \"\") +\n \" \" +\n formatPhoneNumber(data?.configSms?.number)}\n \n
\n
\n \n SMS\n \n MMS\n \n Voice\n
\n
\n
\n Messages Sent\n
20
\n
\n
\n Messages Remaining\n
80
\n
\n
\n Upgrade Plan\n
\n
\n \n
\n
\n \n
\n );\n};\n\nexport default ViewNumber;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddComp from \"./AddNewNumber\";\nimport ViewComp from \"./ViewNumber\";\nconst SideBarData = () => {\n const SMSSider = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n ADD: ,\n VIEW: ,\n };\n return obj[SMSSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import {\n connectOath,\n GetAllConfig,\n getIntegrationPayment,\n} from \"action/AdminActions\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { get, post } from \"helper/networkClient\";\nimport { oauthUrl } from \"config/config\";\nimport { getCookie } from \"utils\";\nconst OauthComponent = ({ children, urls, codeUrl, name, mode = \"ca\", md }) => {\n const dispatch = useDispatch();\n const [externalPopup, setExternalPopup] = useState(null);\n const tenantId = getCookie(\"tenant\");\n const accessToken = getCookie(\"ob_a\");\n const connectClick = async () => {\n const width = 500;\n const height = 400;\n const left = window.screenX + (window.outerWidth - width) / 2;\n const top = window.screenY + (window.outerHeight - height) / 2.5;\n\n // Ensure the variables are properly encoded\n const encodedTenantId = encodeURIComponent(tenantId);\n const encodedMode = encodeURIComponent(mode);\n const encodedAccessToken = encodeURIComponent(accessToken);\n const encodedMd = encodeURIComponent(md);\n\n let completeUrl =\n oauthUrl +\n urls +\n \"?tid=\" +\n encodedTenantId +\n \"&mode=\" +\n encodedMode +\n \"&authorization=Bearer%20\" +\n encodedAccessToken +\n `&md=${encodedMd}`;\n const title = `Gmail Popup`;\n const popup = window.open(\n completeUrl,\n title,\n `width=${width},height=${height},left=${left},top=${top}`\n );\n setExternalPopup(popup);\n };\n useEffect(() => {\n if (!externalPopup) {\n return;\n }\n const timer = setInterval(() => {\n if (!externalPopup) {\n timer && clearInterval(timer);\n return;\n }\n const currentUrl = externalPopup?.location?.href;\n if (!currentUrl) {\n return;\n }\n const searchParams = new URL(currentUrl).searchParams;\n const code = searchParams.get(\"code\");\n let obj = { code: code, provider: name };\n if (code) {\n if (externalPopup) {\n externalPopup.close();\n post(`${codeUrl}`, obj)\n .then((resp) => {\n if (resp.status === 200) {\n dispatch(GetAllConfig());\n dispatch(getIntegrationPayment());\n }\n })\n .catch(() => {\n // API error\n })\n .finally(() => {\n // clear timer at the end\n setExternalPopup(null);\n timer && clearInterval(timer);\n });\n }\n }\n }, 500);\n }, [externalPopup]);\n return
connectClick()}>{children}
;\n};\n\nexport default OauthComponent;\n","import React, { useEffect, useState } from \"react\";\nimport OauthPopup from \"component/OauthComponent/index\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport \"./style.css\";\nimport { CXModal } from \"component/Modal\";\nimport { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXInput, CXPassword } from \"component/Input\";\nimport { Form } from \"antd\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getSmtpProviders, registerSMTPAccount } from \"action/AdminActions\";\nconst EmaliAccountLIst = (props) => {\n const dispatch = useDispatch();\n const [Concent, setConcent] = useState([]);\n const [smtpAct, setsmtpAct] = useState(false);\n const [form] = Form.useForm();\n const { SmtpProviders, SmtpProvidersLoading } = useSelector(\n (state) => state.AdminReducer\n );\n\n const AddRemoveConcent = (val) => {\n let index = Concent.findIndex((item) => item === val);\n if (index === -1) {\n setConcent([...Concent, val]);\n } else {\n let temp = Concent;\n temp.splice(index, 1);\n setConcent([...temp]);\n }\n };\n\n useEffect(() => {\n if (smtpAct) {\n dispatch(getSmtpProviders());\n }\n }, [smtpAct]);\n\n const onFinish = (values) => {\n dispatch(registerSMTPAccount(values));\n setsmtpAct(false);\n form.resetFields();\n };\n return (\n
\n
\n
\n \n
\n \n
\n \n
\n
\n AddRemoveConcent(\"gmail\")} /> I consent\n that HireBound can share data with AI models to provide better service\n in accordance with their{\" \"}\n \n privacy policy\n \n
\n
\n
\n
\n \n
\n \n {\" \"}\n Microsoft 365\n
\n
\n \n
\n
\n AddRemoveConcent(\"microsoft\")} /> I\n consent that HireBound can share data with AI models to provide better\n service in accordance with their{\" \"}\n \n privacy policy\n \n
\n \n
\n
\n {\n setsmtpAct(true);\n }}\n >\n \n {\" \"}\n Other\n
\n \n \n
\n AddRemoveConcent(\"smtp\")} /> I consent\n that HireBound can share data with AI models to provide better service\n in accordance with their{\" \"}\n \n privacy policy\n \n
\n
\n \n
\n
\n
Mail Configuration
\n
\n
\n \n \n \n {SmtpProviders?.map((res) => {\n return {res.name};\n })}\n \n \n \n \n \n \n \n \n {\n form.setFieldsValue({ email: e.target.value.trim() });\n }}\n >\n \n \n \n \n \n
\n {\n setsmtpAct(false);\n form.resetFields();\n }}\n className=\"CancelBtn\"\n >\n Cancel\n \n \n Submit\n \n
\n
\n
\n
\n \n \n );\n};\n\nexport default EmaliAccountLIst;\n","import React, { useState, useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport {\n CheckCircleOutlined,\n CloseCircleOutlined,\n CloseOutlined,\n} from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { SIDEBAR_ADMIN } from \"constant\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXText } from \"component/Typography\";\nimport { CheckEmailAvl, EmailCreateAction } from \"action/AdminActions\";\nimport EmaliAccountLIst from \"./EmaliAccountLIst\";\nconst AddEmail = () => {\n const dispatch = useDispatch();\n const EmailAvl = useSelector((state) => state.AdminReducer.CheckEmailAvl);\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n setAccount(\"\");\n };\n const [Email, setEmail] = useState(\"\");\n const [Account, setAccount] = useState(\"\");\n const HandleEmailCheck = (val) => {\n setEmail(val);\n dispatch(CheckEmailAvl(val + \"@onebox.ai\"));\n };\n const AddEmail = () => {\n let obj = {\n md: \"email\",\n configEmail: {\n provider: \"sendgrid\",\n email: Email + \"@onemail.onebox.ai\",\n },\n preHook: \"https://sample.com/prehooks\",\n postHook: \"https://sample.com/posthooks\",\n outgoingEnabled: true,\n incomingEnabled: true,\n systemDefault: true,\n status: \"active\",\n };\n dispatch(EmailCreateAction(obj));\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n setEmail(\"\");\n setAccount(\"\");\n };\n\n return (\n
\n \n \n Add New Email\n \n
\n handleClose()}\n />\n
\n
\n {Account?.length === 0 && }\n {Account === \"onebox\" && (\n
\n
\n First Name\n \n
\n
\n Last Name\n \n
\n
\n Email\n HandleEmailCheck(e.target.value)}\n />\n
\n {Email?.length > 0 && EmailAvl?.length === 0 && (\n
\n {\" \"}\n
Email Available
\n
\n )}\n {Email?.length > 0 && EmailAvl?.length > 0 && (\n
\n {\" \"}\n
Email Not Available
\n
\n )}\n
\n 0 || Email?.length === 0 ? true : false\n }\n className={`font-14 w-100 mt-4 ${\n EmailAvl?.length > 0 || Email?.length === 0\n ? \"AddBtnDis\"\n : \"AddBtn\"\n }`}\n onClick={() => AddEmail()}\n >\n ADD\n \n
\n
\n )}\n
\n );\n};\n\nexport default AddEmail;\n","import { CXButton } from \"component/Button\";\nimport { CXHTMLEditorEmail } from \"component/MarkdownEditor\";\nimport { CXModal } from \"component/Modal\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { Fragment, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { PlusCircleOutlined } from \"@ant-design/icons\";\nimport {\n addSignatureToChannelAccount,\n updateSmtpPassword,\n} from \"action/AdminActions\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput, CXPassword } from \"component/Input\";\nimport { Form } from \"antd\";\n\nconst Signature = ({ data }) => {\n const [form] = Form.useForm();\n let dispatch = useDispatch();\n const { agents } = useSelector((state) => state.AgentReducer);\n const [ViewSig, setViewSig] = useState(null);\n const UpdateSignature = () => {\n dispatch(addSignatureToChannelAccount(data?._id, ViewSig?.signature));\n setViewSig(null);\n };\n const [UpdatePassword, setUpdatePassword] = useState(false);\n const onFinish = (values) => {\n dispatch(\n updateSmtpPassword({\n email: data?.configEmail?.email.trim(),\n password: values.pwd1,\n })\n );\n form.resetFields();\n setUpdatePassword(false);\n };\n return (\n \n {agents?.data?.length > 0 &&\n data?.configEmail?.emailSignature?.length > 0 &&\n data?.configEmail?.emailSignature?.map((res) => {\n return (\n
\n
\n {agents?.data?.find((v) => v._id === res.uid)?.fname}\n
\n\n
\n {\" \"}\n
\n
\n setViewSig(res)}\n >\n View Signature\n
\n \n {/* handleChange(\"enable2fa\", event)}\n /> */}\n \n \n
\n );\n })}\n {data?.configEmail?.provider === \"smtp\" && (\n
\n setUpdatePassword(true)}\n >\n \"edit\"\n Reauthenticate Email\n
\n \n )}\n {data?.configEmail?.emailSignature?.length === 0 && (\n
\n {\n setViewSig({ signature: \"\", isDefault: false });\n }}\n >\n \n Add Signature\n
\n \n )}\n\n \n {\n setViewSig((prevViewSig) => ({\n ...prevViewSig,\n signature: data,\n }));\n }}\n data={ViewSig?.signature}\n />\n\n
\n {\n setViewSig(null);\n }}\n className=\"CancelBtn\"\n >\n Cancel\n \n {\n UpdateSignature();\n }}\n >\n Save\n \n
\n \n \n \n \n \n \n ({\n validator(_, value) {\n if (!value || getFieldValue(\"pwd1\") === value) {\n return Promise.resolve();\n }\n return Promise.reject(\n new Error(\n \"The two passwords that you entered do not match!\"\n )\n );\n },\n }),\n ]}\n >\n \n \n
\n {\n setUpdatePassword(false);\n form.resetFields();\n }}\n className=\"CancelBtn\"\n >\n Cancel\n \n \n Save\n \n
\n
\n \n
\n );\n};\n\nexport default Signature;\n","import React, { useEffect, useState } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined, ShareAltOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXCard } from \"component/Card\";\nimport { SIDEBAR_ADMIN, CONNECT_SIDEBAR_VIEW, ACTIVE_INDEX } from \"constant\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport moment from \"moment\";\nimport { CXSwitch } from \"component/Switch\";\nimport { updateConfig } from \"action/AdminActions\";\nimport { CXModal } from \"component/Modal\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXButton } from \"component/Button\";\nimport ShareWith from \"../ShareWith\";\nimport ShareWithModal from \"../ShareWith/ShareWithModal\";\nimport { generateUniqueKey } from \"utils\";\nimport Signature from \"./Signature\";\n\nconst ViewEmail = () => {\n const [data, setdata] = useState();\n const [OpenModal, setOpenModal] = useState(false);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: ACTIVE_INDEX, data: null });\n };\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const Index = useSelector((state) => state.AdminReducer.ActiveIndex);\n const handleOnSwitch = (event) => {\n let obj = {\n outgoingEnabled: false,\n incomingEnabled: false,\n systemDefault: true,\n configEmail: {\n provider: \"sendgrid\",\n email: data?.configEmail?.email,\n },\n preHook: \"https://sample.com/prehooks\",\n postHook: \"https://sample.com/posthooks\",\n };\n if (event) {\n obj.status = \"active\";\n dispatch(updateConfig(obj, data._id));\n } else {\n obj.status = \"disable\";\n dispatch(updateConfig(obj, data._id));\n }\n };\n useEffect(() => {\n let obj = EmailList.filter((obj) => obj._id === Index);\n setdata(obj[0]);\n }, [Index, EmailList]);\n return (\n
\n \n \n Email\n \n
\n handleClose()}\n />\n
\n
\n
\n \n {data?.permissions?.find((v) => v.name === \"Owner\")?.principal ===\n UserID && (\n
\n setOpenModal(true)}\n style={{\n fontSize: \"12px\",\n padding: \"6px\",\n }}\n >\n Share\n \n
\n )}\n
\n {data?.configEmail?.provider === \"gmail\" && (\n \n )}\n {data?.configEmail?.provider === \"smtp\" && (\n \n )}\n
\n
\n {data?.configEmail?.email}\n
\n
\n
\n \n
\n
\n
Connected On
\n
{moment(data?.createdAt).format(\"L\")}
\n
\n
\n
\n handleOnSwitch(event)}\n />\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n );\n};\n\nexport default ViewEmail;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddEmail from \"./AddEmail\";\nimport ViewEmail from \"./ViewEmail\";\nconst SideBarData = () => {\n const SMSSider = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n ADD: ,\n VIEW: ,\n };\n return obj[SMSSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import React, { useEffect, useState } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXCard } from \"component/Card\";\nimport { SIDEBAR_ADMIN, CONNECT_SIDEBAR_VIEW, ACTIVE_INDEX } from \"constant\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport moment from \"moment\";\nimport { CXSwitch } from \"component/Switch\";\nimport { updateConfig } from \"action/AdminActions\";\nimport ShareWithModal from \"../ShareWith/ShareWithModal\";\nimport ShareWith from \"../ShareWith\";\nimport { generateUniqueKey } from \"utils\";\n\nconst ViewEmail = () => {\n const [data, setdata] = useState();\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: ACTIVE_INDEX, data: null });\n };\n const MList = useSelector((state) => state.AdminReducer.allConfigData);\n const Index = useSelector((state) => state.AdminReducer.ActiveIndex);\n const [OpenModal, setOpenModal] = useState(false);\n const handleOnSwitch = (event) => {\n // let obj = {\n // outgoingEnabled: false,\n // incomingEnabled: false,\n // systemDefault: true,\n // configEmail: {\n // provider: \"sendgrid\",\n // email: data?.configEmail?.email,\n // },\n // preHook: \"https://sample.com/prehooks\",\n // postHook: \"https://sample.com/posthooks\",\n // };\n // if (event) {\n // obj.status = \"active\";\n // dispatch(updateConfig(obj, data._id));\n // } else {\n // obj.status = \"disable\";\n // dispatch(updateConfig(obj, data._id));\n // }\n };\n useEffect(() => {\n let obj = MList.filter((obj) => obj._id === Index);\n setdata(obj[0]);\n }, [Index, MList]);\n return (\n
\n \n \n facebook\n \n
\n handleClose()}\n />\n
\n
\n
\n \n
\n \"meta\"\n
\n
\n {data?.configFb?.email\n ? data?.configFb?.email\n : data?.configFb?.userId}\n
\n
\n
\n \n
\n
\n
Connected On
\n
{moment(data?.createdAt).format(\"L\")}
\n
\n
\n
\n handleOnSwitch(event)}\n />\n
\n
\n \n
\n
\n
\n \n
\n );\n};\n\nexport default ViewEmail;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport ViewMeta from \"./ViewMeta\";\nconst SideBarData = () => {\n const Meta = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n VIEW: ,\n };\n return obj[Meta];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { CloseOutlined, CopyOutlined } from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput, CXTextArea } from \"component/Input\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXText, CXTitle } from \"component/Typography\";\nimport { CXFormItem } from \"component/Form\";\nimport { CXForm } from \"component/Form\";\nimport { SIDEBAR_ADMIN, WHATSAPP_ERROR, WHATSAPP_RESPONSE } from \"constant\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { WhatsAppCreateAction } from \"action/AdminActions\";\nimport { notification } from \"antd\";\n\nconst AddWhatsapp = () => {\n const AdminRducer = useSelector((state) => state.AdminReducer);\n const [loading, setloading] = useState(false);\n const [Token, setToken] = useState(null);\n const [url, seturl] = useState(null);\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n form.resetFields();\n setToken(null);\n setloading(false);\n };\n const onFinish = (values) => {\n dispatch(WhatsAppCreateAction(values));\n form.resetFields();\n setloading(true);\n };\n useEffect(() => {\n switch (AdminRducer.action) {\n case WHATSAPP_RESPONSE:\n setloading(false);\n setToken(AdminRducer?.whatsAppToken?.data?.verifyToken);\n seturl(AdminRducer?.whatsAppToken?.data?.url);\n break;\n case WHATSAPP_ERROR:\n setloading(false);\n break;\n default:\n break;\n }\n }, [AdminRducer.action]);\n\n const copyHandler = (val, text) => {\n navigator.clipboard.writeText(val);\n notification.success({\n message: text,\n });\n };\n useEffect(() => {\n return () => {\n dispatch({ type: WHATSAPP_RESPONSE, data: null });\n };\n }, []);\n\n function launchWhatsAppSignup() {\n window?.FB?.login(\n function (response) {\n if (response.authResponse) {\n console.log(\"response======>\", response);\n const code = response.authResponse.code;\n console.log(\"code====>\", code);\n } else {\n console.log(\"User cancelled login or did not fully authorize.\");\n }\n },\n {\n config_id: \"353738990334993\", // configuration ID goes here\n response_type: \"code\", // must be set to 'code' for System User access token\n override_default_response_type: true, // when true, any response types passed in the \"response_type\" will take precedence over the default types\n extras: {\n setup: {},\n },\n }\n );\n }\n\n return (\n
\n \n \n Add Whatsapp\n \n
\n handleClose()}\n />\n
\n
\n {/*
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {loading ? \"Please Wait\" : \"ADD\"}\n \n \n \n {Token && (\n \n
\n Please save your token{\" \"}\n copyHandler(Token, \"Token copied to clipboard\")}\n />\n
\n
{Token}
\n
\n )}\n {url && (\n \n
\n Please save your url{\" \"}\n copyHandler(url, \"URL copied to clipboard\")}\n />\n
\n
{url}
\n
\n )}\n
*/}\n
\n launchWhatsAppSignup()}\n style={{\n backgroundColor: \"#1877f2\",\n border: 0,\n borderRadius: 4,\n color: \"#fff\",\n cursor: \"pointer\",\n fontFamily: \"Helvetica, Arial, sans-serif\",\n fontSize: 16,\n fontWeight: \"bold\",\n height: 40,\n padding: \"0 24px\",\n }}\n >\n Login with Facebook\n \n
\n
\n );\n};\n\nexport default AddWhatsapp;\n","import React, { useEffect, useState } from \"react\";\nimport { CloseOutlined, CopyOutlined, EditOutlined } from \"@ant-design/icons\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { ACTIVE_INDEX, CONNECT_SIDEBAR_VIEW, SIDEBAR_ADMIN } from \"constant\";\nimport { CXCard } from \"component/Card\";\nimport moment from \"moment\";\nimport { CXModal } from \"component/Modal\";\nimport { CXTextArea } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { updateConfig } from \"action/AdminActions\";\nimport { copyHandler } from \"utils\";\nimport ShareWithModal from \"../ShareWith/ShareWithModal\";\nimport ShareWith from \"../ShareWith\";\n\nconst ViewWhatsapp = () => {\n const Whtsapp = useSelector((state) => state.AdminReducer.allConfigData);\n const Index = useSelector((state) => state.AdminReducer.ActiveIndex);\n const [showModal, setShowModal] = useState(false);\n const [token, setToken] = useState(\"\");\n const [data, setdata] = useState();\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const UserID = user?.userProfile?._id;\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: ACTIVE_INDEX, data: null });\n };\n useEffect(() => {\n let obj = Whtsapp.filter((obj) => obj._id === Index);\n setdata(obj[0]);\n }, [Index, Whtsapp]);\n // const copyHandler = (val, text) => {\n // navigator.clipboard.writeText(val);\n // notification.success({\n // message: text,\n // });\n // };\n\n const handleSubmit = () => {\n dispatch(updateConfig({ configWp: { permanentToken: token } }, data._id));\n setShowModal(false);\n };\n const [OpenModal, setOpenModal] = useState(false);\n return (\n
\n \n \n View Data\n \n
\n handleClose()}\n />\n
\n
\n \n
\n \n
\n {data?.permissions?.find((v) => v.name === \"Owner\")?.principal ===\n UserID && (\n setOpenModal(true)}\n style={{\n fontSize: \"12px\",\n padding: \"6px\",\n }}\n >\n Share\n \n )}\n setShowModal(true)}\n />\n
\n
\n
\n
\n
\n Name : {data?.configWp?.name}\n
\n
\n Provider :{\" \"}\n {data?.configWp?.provider}\n
\n
\n Status : {data?.status}\n
\n
\n Connected On :{\" \"}\n \n {moment(data?.createdAt).format(\"L\")}\n \n
\n
\n url :{\" \"}\n \n {data?.configWp?.url ?? \"N/A\"}{\" \"}\n {data?.configWp?.url && (\n \n copyHandler(\n data?.configWp?.url,\n \"URL copied to clipboard\"\n )\n }\n />\n )}\n \n
\n
\n Verify Token :{\" \"}\n \n {data?.configWp?.verifyToken ?? \"N/A\"}{\" \"}\n {data?.configWp?.verifyToken && (\n \n copyHandler(\n data?.configWp?.verifyToken,\n \"Token copied to clipboard\"\n )\n }\n />\n )}\n \n
\n
\n
\n
\n \n
\n
\n Update Meta System User Token\n }\n onCancel={() => setShowModal(false)}\n footer={null}\n >\n \n setToken(e.target.value)}\n placeholder=\"Facebook (Meta) system user token\"\n >\n {token}\n \n handleSubmit()}\n >\n UPDATE\n \n \n \n
\n );\n};\n\nexport default ViewWhatsapp;\n","import React, { useEffect, useState } from \"react\";\nimport { CloseOutlined, CopyOutlined } from \"@ant-design/icons\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport moment from \"moment\";\nimport { ConnectButton } from \"360dialog-connect-button\";\nimport { Form } from \"antd\";\nimport { SIDEBAR_ADMIN, WHATSAPP_ERROR, WHATSAPP_RESPONSE } from \"constant\";\n\nconst ConnectWhatsapp = () => {\n const AdminRducer = useSelector((state) => state.AdminReducer);\n const [loading, setloading] = useState(false);\n const [url, seturl] = useState(null);\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n form.resetFields();\n setloading(false);\n };\n\n useEffect(() => {\n switch (AdminRducer.action) {\n case WHATSAPP_ERROR:\n setloading(false);\n break;\n default:\n break;\n }\n }, [AdminRducer.action]);\n\n return (\n
\n \n \n Add Whatsapp\n \n
\n handleClose()}\n />\n
\n
\n\n
\n \n
\n
\n );\n};\n\nexport default ConnectWhatsapp;\n","import React, { useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddWhatsapp from \"./AddWhatsapp\";\nimport ViewWhatsapp from \"./ViewWhatsapp\";\nimport ConnectWhatsapp from \"./ConnectWhatsapp\";\n\nconst SideBarData = () => {\n const wtappSider = useSelector((state) => state.AdminReducer.SideBarView);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n // usepref check a/o/d\n const handleAddNew = () => {\n if (\n user?.userTenants?.find((item) => item?.userId === user?.userProfile?._id)\n ?.waba === \"a\"\n ) {\n return false;\n } else {\n return true;\n }\n };\n const renderComponent = () => {\n let obj = {\n ADD: handleAddNew() ? : ,\n VIEW: ,\n };\n return obj[wtappSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import React from \"react\";\n\nconst SideBarData = () => {\n return
Google
;\n};\n\nexport default SideBarData;\n","import React from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport SmsSider from \"./Sms/SideBarData\";\nimport EmailSider from \"./Email/SideBarData\";\nimport FacebookSider from \"./Facebook/SideBarData\";\nimport WhatsappSider from \"./Whatsapp/SideBarData\";\nimport GoogleSider from \"./Google/SideBarData\";\nconst ConnectedData = () => {\n const ActiveTab = useSelector((state) => state.AdminReducer.ConnectedAccount);\n const renderComponent = () => {\n let obj = {\n SMS: ,\n Email: ,\n Facebook: ,\n WhatsApp: ,\n Google: ,\n };\n return obj[ActiveTab];\n };\n return
{renderComponent()}
;\n};\n\nexport default ConnectedData;\n","import { CloseOutlined } from \"@ant-design/icons\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXHeader } from \"component/Layout\";\nimport OAuthPopup from \"component/OauthComponent/index\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst AddCalendar = () => {\n const dispatch = useDispatch();\n const [Concent, setConcent] = useState([]);\n const [smtpAct, setsmtpAct] = useState(false);\n const handleClose = () => {\n dispatch({ type: \"SIDEBAR_ADMIN\", data: true });\n };\n const AddRemoveConcent = (val) => {\n let index = Concent.findIndex((item) => item === val);\n if (index === -1) {\n setConcent([...Concent, val]);\n } else {\n let temp = Concent;\n temp.splice(index, 1);\n setConcent([...temp]);\n }\n };\n return (\n
\n {\" \"}\n \n \n Add Calendar\n \n
\n handleClose()}\n />\n
\n
\n
\n {\" \"}\n
\n
\n \n
\n \n
\n \n
\n
\n AddRemoveConcent(\"gmail\")} /> I consent\n that HireBound can share data with AI models to provide better\n service in accordance with their{\" \"}\n \n privacy policy\n \n
\n
\n
\n
\n );\n};\n\nexport default AddCalendar;\n","import React from \"react\";\n\nconst ViewCalander = () => {\n return
ViewCalander
;\n};\n\nexport default ViewCalander;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddCalendar from \"./AddCalendar\";\nimport ViewCalander from \"./ViewCalander\";\nconst SideBarData = () => {\n const SMSSider = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n ADD: ,\n VIEW: ,\n };\n return obj[SMSSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport Calendar from \"./Calendar/SidebarData\";\nconst ConnectedData = () => {\n const ActiveTab = useSelector((state) => state.AdminReducer.ConnectedAccount);\n const renderComponent = () => {\n let obj = {\n Calendar: ,\n };\n return obj[ActiveTab];\n };\n return
{renderComponent()}
;\n};\n\nexport default ConnectedData;\n","import { CXForm, CXFormItem } from \"component/Form\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport React from \"react\";\nimport languageDate from \"./language.json\";\nimport { Form } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { SIDEBAR_ADMIN } from \"constant\";\nimport { addLanguageSettings } from \"action/AdminActions\";\n\nconst AddData = () => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n form.resetFields();\n };\n const onFinish = (values) => {\n let obj = {\n screenId: \"faq\",\n lang: values.lang,\n displayName: languageDate.find((d) => d.code === values.lang).name,\n isDefault: false,\n keywords: [\n {\n label: \"Type placeholder\",\n key: \"typePlaceholder\",\n value: \"\",\n },\n {\n label: \"Start chat placeholder\",\n key: \"startChatPlaceholder\",\n value: \"\",\n },\n {\n label: \"Start chat button\",\n key: \"btnText\",\n value: \"\",\n },\n {\n label: \"Article title\",\n key: \"articleTitle\",\n value: \"\",\n },\n {\n label: \"Collection title\",\n key: \"collectionTitle\",\n value: \"\",\n },\n ],\n };\n dispatch(addLanguageSettings(obj));\n form.resetFields();\n handleClose();\n };\n return (\n
\n \n \n Add language\n \n
\n handleClose()}\n />\n
\n
\n \n \n \n option.children.toLowerCase().includes(input.toLowerCase())\n }\n >\n {languageDate.map((d) => {\n return {d.name};\n })}\n \n \n \n \n Add language\n \n \n \n
\n );\n};\n\nexport default AddData;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport AddComp from \"./AddNew\";\nconst LanguageData = () => {\n const SMSSider = useSelector((state) => state.AdminReducer.SideBarView);\n const renderComponent = () => {\n let obj = {\n ADD: ,\n };\n return obj[SMSSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default LanguageData;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport UserData from \"./Users/UserData\";\nimport ConnectedData from \"./Connected/ConnectedData\";\nimport IntegrationData from \"./Integrations/IntegrationData\";\nimport LanguageData from \"./LanguageSettings/LanguageData\";\n\nconst SideBarData = () => {\n const addBotSider = useSelector((state) => state.AdminReducer.ActiveList);\n const renderComponent = () => {\n let obj = {\n User: ,\n Connected: ,\n Integration: ,\n Language: ,\n };\n return obj[addBotSider];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBarData;\n","import { DeleteFilled, EditFilled, SettingOutlined } from \"@ant-design/icons\";\nimport {\n deleteContactFormField,\n getContactForm,\n updateContactFormField,\n} from \"action/ContactAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CXModal } from \"component/Modal\";\nimport { ContactSkeleton } from \"component/Skeleton\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXTag } from \"component/Tag\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport CreateCustomFields from \"./CreateCustomFields\";\nimport \"./style.css\";\nimport { generateUniqueKey } from \"utils\";\n\nconst Configuration = () => {\n const dispatch = useDispatch();\n const { contactForm, loading } = useSelector((state) => state.ContactReducer);\n const [itemData, setItemData] = useState(null);\n const [visible, setVisible] = useState(false);\n useEffect(() => {\n dispatch(getContactForm());\n }, []);\n const tagStyle = {\n textAlign: \"center\",\n borderRadius: 5,\n fontWeight: 600,\n height: 22,\n };\n\n useEffect(() => {\n if (!visible) {\n setItemData(null);\n }\n }, [visible]);\n const menu = (item, key) => (\n \n \n \n \n {\n dispatch(\n updateContactFormField(\n { isActive: e },\n { formId: contactForm._id, fieldId: item._id }\n )\n );\n }}\n />\n \n \n {key !== \"CD\" && (\n {\n setItemData(item);\n setVisible(true);\n }}\n >\n \n Edit\n \n )}\n {\n dispatch(\n deleteContactFormField({\n formId: contactForm._id,\n _id: item._id,\n })\n );\n }}\n >\n \n delete\n \n \n );\n\n return (\n
\n \n \n Candidate form configuration\n \n
\n {!loading && (\n
\n setVisible(true)}>\n Add custom field\n \n {/* history.push(\"/admin/Contacts/list\")}\n >\n Cancel\n */}\n
\n )}\n
\n
\n {loading && }\n {!loading && (\n \n \n Default fields\n \n
\n {contactForm?.formItems?.map((item, index) => {\n if (item.category !== \"cd\" && item.category !== \"custom\") {\n return (\n
\n
\n
\n \n {item?.lebel}\n \n \n \n {item?.isActive ? \"Enabled\" : \"Disabled\"}\n \n \n
\n
\n
\n );\n }\n })}\n
\n {contactForm?.formItems.find((item) => item.category === \"cd\") && (\n \n CD fields\n \n )}\n
\n {contactForm?.formItems?.map((item, index) => {\n if (item.category === \"cd\") {\n return (\n
\n \n \n
\n \n
\n \n \n
\n
\n \n {item?.lebel}\n \n \n {item?.isActive ? \"Enabled\" : \"Disabled\"}\n \n
\n
\n
\n );\n }\n })}\n
\n {contactForm?.formItems.find(\n (item) => item.category === \"custom\"\n ) && (\n \n Custom fields\n \n )}\n
\n {contactForm?.formItems?.map((item, index) => {\n if (item.category === \"custom\") {\n return (\n
\n \n \n
\n \n
\n \n \n
\n
\n \n {item?.lebel}\n \n \n {item?.isActive ? \"Enabled\" : \"Disabled\"}\n \n
\n
\n
\n );\n }\n })}\n
\n
\n )}\n \n \n \n \n );\n};\n\nexport default Configuration;\n","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { Form } from \"antd\";\nimport { ExpandOutlined, LoadingOutlined } from \"@ant-design/icons\";\nimport { CXMarkdownDescriptionEditorHTML } from \"component/MarkdownEditor\";\nimport { CXModal } from \"component/Modal\";\nimport { CXInput } from \"component/Input\";\nimport CXUpload from \"component/Upload\";\nimport { postFormData } from \"helper/networkClient\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n getAgencySettings,\n getPlanDetailsTrigger,\n updateAgencySettingsTrigger,\n updatePlanDetailsTrigger,\n} from \"action/Subscription\";\nimport { CXLottie } from \"component/Lottie\";\nimport { generateUniqueKey, getCookie } from \"utils\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport Data from \"utils/industry.json\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst OrganizationSettings = () => {\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n const handleDiscription = (value) => {\n form.setFieldsValue({ about: value });\n };\n const [fullView, setfullView] = useState(false);\n const [UploadActiveLogo, setUploadActiveLogo] = useState(true);\n const [UploadActiveCover, setUploadActiveCover] = useState(true);\n const [coverLoader, setcoverLoader] = useState(false);\n const [CmCover, setCmCover] = useState(null);\n const [CmLogo, setCmLogo] = useState(null);\n const [logoLoader, setlogoLoader] = useState(false);\n const {\n pageDetails,\n pageDetailsLoading,\n pageDetailsUpdating,\n useAgency,\n useAgencyLoading,\n } = useSelector((state) => state.SubscriptionReducer);\n const tenantId = getCookie(\"tenant\");\n\n const handleUploadFileCover = async (file) => {\n setcoverLoader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setCmCover(null);\n setCmCover(resp?.data?.data?.url);\n form.setFieldsValue({ coverImage: resp?.data?.data?.url });\n setcoverLoader(false);\n } else {\n setcoverLoader(false);\n }\n });\n } catch (error) {\n setcoverLoader(false);\n }\n };\n const handleUploadFileLogo = async (file) => {\n setlogoLoader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setCmLogo(null);\n setCmLogo(resp?.data?.data?.url);\n form.setFieldsValue({ logo: resp?.data?.data?.url });\n setlogoLoader(false);\n setUploadActiveLogo(false);\n setUploadActiveCover(false);\n } else {\n setlogoLoader(false);\n setUploadActiveLogo(true);\n setUploadActiveCover(true);\n }\n });\n } catch (error) {\n setlogoLoader(false);\n }\n };\n const SaveSettings = async () => {\n try {\n const values = await form.validateFields();\n dispatch(updatePlanDetailsTrigger({ pageDetails: values }));\n } catch (errInfo) {\n console.log(\"Save failed:\", errInfo);\n }\n };\n const openUrl = () => {\n window.open(`https://careerpage.hirebound.io/org/${tenantId}`, \"_blank\");\n };\n\n useEffect(() => {\n dispatch(getAgencySettings());\n dispatch(getPlanDetailsTrigger());\n }, []);\n\n useEffect(() => {\n if (pageDetails) {\n let data = pageDetails[0]?.pageDetails;\n form.setFieldsValue({\n name: data?.name,\n industry: data?.industry,\n type: data?.type,\n numPeople: data?.numPeople,\n about: data?.about,\n website: data?.website,\n linkedinUrl: data?.linkedinUrl,\n logo: data?.logo,\n coverImage: data?.coverImage,\n });\n setCmCover(data?.coverImage);\n setCmLogo(data?.logo);\n setUploadActiveLogo(data?.logo ? false : true);\n setUploadActiveCover(data?.coverImage ? false : true);\n }\n }, [pageDetails]);\n\n const UpdateSettings = (value) => {\n dispatch(\n updateAgencySettingsTrigger({\n useAgency: value,\n })\n );\n };\n return (\n
\n \n \n Organization page settings\n \n
\n {pageDetails?.about?.length > 0 && (\n openUrl()}>\n Preview\n \n )}\n
\n {!useAgencyLoading && (\n
\n
Use as agency
\n \n
\n )}\n {useAgencyLoading && }\n\n SaveSettings()}\n loading={pageDetailsUpdating}\n disabled={pageDetailsUpdating || pageDetailsLoading}\n >\n Save\n \n
\n
\n
\n\n {pageDetailsLoading && (\n \n )}\n {!pageDetailsLoading && (\n <>\n {\" \"}\n \n \n
\n \n
\n
Name
\n
\n \n
\n
\n \n\n \n
\n
Industry
\n
\n {/* */}\n {\n form.setFieldsValue({ industry: value });\n }}\n defaultValue={form.getFieldValue(\"industry\") ?? \"\"}\n >\n {Data?.map((item) => {\n return (\n \n {item.label}\n \n );\n })}\n \n
\n
\n \n
\n
\n \n
\n
Type
\n
\n \n
\n
\n \n\n \n
\n
Employees
\n
\n {\n form.setFieldsValue({ numPeople: value });\n }}\n defaultValue={form.getFieldValue(\"numPeople\") ?? \"\"}\n >\n 1-10\n 11-50\n 51-200\n 201-500\n 501-1000\n 1001 -5000\n 5001-1000\n 10000+\n \n
\n
\n \n
\n
\n \n
\n
\n
About Company
\n
\n {\n setfullView(true);\n }}\n />\n
\n
\n
\n console.log(data)}\n onModelChange={(data) => handleDiscription(data)}\n data={\n form.getFieldValue(\"about\")\n ? form.getFieldValue(\"about\")\n : \"\"\n }\n />\n
\n
\n \n
\n\n
\n \n
\n
Website URL
\n
\n \n
\n
\n \n \n
\n
Linkedin URL
\n
\n \n
\n
\n
\n
\n
\n \n
\n
Company Logo
\n
\n {!logoLoader && (\n \n {CmLogo && !UploadActiveLogo ? (\n {\n setUploadActiveLogo(true);\n }}\n />\n ) : (\n
\n setUploadActiveLogo(false)}\n >\n x\n \n \n \n \n
\n )}\n
\n )}\n {logoLoader && }\n
\n
\n
\n \n
\n
\n Company Cover Picture\n
\n
\n {!coverLoader && (\n \n {CmCover && !UploadActiveCover ? (\n {\n setUploadActiveCover(true);\n }}\n />\n ) : (\n
\n setUploadActiveCover(false)}\n >\n x\n \n \n \n \n
\n )}\n
\n )}\n {coverLoader && }\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n About Company *\n
\n {\n setfullView(false);\n }}\n >\n Close\n \n
\n console.log(data)}\n onModelChange={(data) => handleDiscription(data)}\n data={\n form.getFieldValue(\"about\") ? form.getFieldValue(\"about\") : \"\"\n }\n placeholder=\"Enter company details\"\n />\n
\n \n \n )}\n \n );\n};\n\nexport default OrganizationSettings;\n","import React, { useEffect, useState } from \"react\";\nimport { Form } from \"antd\";\nimport { CXInput } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXModal } from \"component/Modal\";\nimport { CXTitle } from \"component/Typography\";\nimport {\n createAccountVariablesDefinition,\n deleteAccountVariablesDefinition,\n getAccountVariablesDefinition,\n updateAccountVariablesDefinition,\n} from \"action/AccountVariables\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTable } from \"component/Table\";\nimport { CXTag } from \"component/Tag\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst AccountVariableDefinitions = () => {\n const dispatch = useDispatch();\n const [datatable, setddatatable] = useState([]);\n const [visible, setVisible] = useState(false);\n const [updateKey, setupdateKey] = useState(null);\n const [form] = Form.useForm();\n const [checkType, setcheckType] = useState(null);\n const { accountVariablesDefinition, loading } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n const onFinish = (values) => {\n if (updateKey) {\n dispatch(updateAccountVariablesDefinition(updateKey, values));\n cancelModal();\n } else {\n dispatch(createAccountVariablesDefinition(values));\n cancelModal();\n }\n };\n\n useEffect(() => {\n dispatch(getAccountVariablesDefinition());\n }, []);\n\n useEffect(() => {\n if (updateKey) {\n const data = accountVariablesDefinition?.data?.find(\n (res) => res._id === updateKey\n );\n form.setFieldsValue(data);\n setVisible(true);\n }\n }, [updateKey]);\n\n const handleDelete = (key) => {\n dispatch(deleteAccountVariablesDefinition(key));\n };\n\n const columns = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n key: \"name\",\n },\n {\n title: \"Required\",\n dataIndex: \"required\",\n key: \"required\",\n },\n {\n title: \"Default Value\",\n dataIndex: \"defaultValue\",\n key: \"defaultValue\",\n },\n {\n title: \"Scope\",\n dataIndex: \"scope\",\n key: \"scope\",\n },\n {\n title: \"Type\",\n dataIndex: \"type\",\n key: \"type\",\n },\n {\n title: \"Variable Options\",\n dataIndex: \"variableOptions\",\n key: \"variableOptions\",\n render: (text, record) => {\n return (\n
\n {record.type === \"dropdown\" &&\n record?.variableOptions?.map((res) => {\n return {res};\n })}\n
\n );\n },\n },\n {\n title: \"Actions\",\n dataIndex: \"actions\",\n render: (_, record) => {\n return (\n
\n setupdateKey(record.key)}\n />\n handleDelete(record.key)}\n />\n
\n );\n },\n },\n ];\n\n const cancelModal = () => {\n setVisible(false);\n setupdateKey(null);\n setcheckType(null);\n form.resetFields();\n };\n\n useEffect(() => {\n if (accountVariablesDefinition?.data?.length > 0) {\n const data = accountVariablesDefinition?.data?.map((res) => {\n return {\n key: res._id,\n name: res.name,\n defaultValue: res.defaultValue ?? \"NA\",\n scope: res.scope,\n type: res.type ?? \"input\",\n variableOptions: res.variableOptions,\n required: res.required ? \"Yes\" : \"No\",\n };\n });\n setddatatable(data);\n }\n }, [accountVariablesDefinition]);\n return (\n
\n \n \n Account Variable Definitions\n \n
\n
\n setVisible(true)}>\n Add Variable\n \n
\n
\n
\n
\n {loading && }\n {!loading && (\n \n )}\n
\n \n \n Add Account Variable\n \n \n \n \n \n \n \n \n \n \n Role\n \n \n \n setcheckType(value)}\n defaultValue={\"input\"}\n >\n Input\n Dropdown\n \n \n {(form?.getFieldValue(\"type\") === \"dropdown\" ||\n checkType === \"dropdown\") && (\n \n \n \n )}\n \n \n \n \n
\n {\n cancelModal();\n }}\n >\n close\n \n \n Save\n \n
\n
\n
\n
\n
\n );\n};\n\nexport default AccountVariableDefinitions;\n","import React, { useEffect, useState } from \"react\";\nimport { SortableContainer, SortableElement } from \"react-sortable-hoc\";\nimport { arrayMoveImmutable } from \"array-move\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n UpdateIsDefaultStageSeqAction,\n createStageSeqAction,\n deleteStageSeqAction,\n getCandidateStageTrigger,\n updateStageSeqAction,\n UpdateIsFirstFollowup,\n} from \"action/OpeningsAction\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport { CXModal } from \"component/Modal\";\nimport { CXInput } from \"component/Input\";\nimport { CXInputSkeleton } from \"component/Skeleton\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst SortableComponent = () => {\n const SortableItem = SortableElement(({ value, index }) => {\n const handleDelete = () => {\n setvisible(value);\n };\n return (\n \n
\n
\n {\" \"}\n
{value?.name}
\n
\n
\n
\n Follow-up\n {\n dispatch(UpdateIsFirstFollowup(value._id, event));\n }}\n />\n
\n
\n is Default\n {\n dispatch(UpdateIsDefaultStageSeqAction(value._id));\n }}\n />\n
\n\n \n
\n
\n \n );\n });\n const [visible, setvisible] = useState(false);\n\n const SortableList = SortableContainer(\n ({ items }) => {\n return (\n
\n {items.map((value, index) => (\n \n ))}\n
\n );\n },\n { helperClass: \"sortable-helper\" }\n );\n const dispatch = useDispatch();\n const { candidateFilterStage, candidateLoading } = useSelector(\n (state) => state.OpeningReducer\n );\n const [addStage, setaddStage] = useState(false);\n useEffect(() => {\n dispatch(getCandidateStageTrigger());\n }, []);\n useEffect(() => {\n if (candidateFilterStage?.data) {\n setItems(candidateFilterStage.data.map((item) => item));\n }\n }, [candidateFilterStage]);\n const [items, setItems] = useState([]);\n const [StageName, setStageName] = useState(null);\n const onSortEnd = ({ oldIndex, newIndex }) => {\n setItems((prevItems) => arrayMoveImmutable(prevItems, oldIndex, newIndex));\n };\n\n const updateStageSeq = () => {\n let temp = items?.map((item, index) => {\n return {\n ...item,\n seq: index + 1,\n };\n });\n dispatch(updateStageSeqAction(temp));\n };\n const AddNewStage = () => {\n if (StageName?.length > 0) {\n dispatch(\n createStageSeqAction({\n name: StageName,\n seq: items?.length + 1,\n })\n );\n setaddStage(false);\n setStageName(null);\n }\n };\n return (\n
\n \n \n Stage Configuration\n \n {!candidateLoading && (\n
\n
\n setaddStage(true)}\n >\n Add Stage\n \n updateStageSeq()}>\n Update\n \n
\n
\n )}\n
\n {!candidateLoading && (\n \n )}\n {candidateLoading && (\n
\n {[...Array(7)].map((_) => {\n return ;\n })}\n
\n )}\n\n \n
\n \n Add Stage\n \n
\n
\n {\n setaddStage(false);\n setStageName(null);\n }}\n >\n Cancel\n \n 0 ? \"addCardbtn\" : \"addCardbtn-disabled\"\n }\n onClick={() => AddNewStage(true)}\n >\n Add Stage\n \n
\n
\n
\n
\n {\n setStageName(e.target.value);\n }}\n />\n
\n \n \n
\n
\n \n Delete Stage\n \n
\n
\n setvisible(false)}\n >\n Cancel\n \n {\n dispatch(deleteStageSeqAction(visible._id));\n setvisible(false);\n }}\n >\n Delete\n \n
\n
\n
\n
\n
\n Do you really want to remove the stage{\" \"}\n {visible?.name}? This action\n will affect the candidates{\" \"}\n within this stage and any{\" \"}\n campaigns linked to it.\n
\n
\n
\n \n
\n );\n};\n\nexport default SortableComponent;\n","import { getQuestionsConfig, SaveQuestionnaire } from \"action/AdminActions\";\nimport { notification } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport QualifierQuestions from \"screen/UserPortal/Openings/AddPosition/QualifierQuestions\";\n\nconst QuestionnaireConfiguration = () => {\n const dispatch = useDispatch();\n const [GlobalState, setGlobalState] = React.useState({\n qualifiers: [],\n });\n const saveConfig = () => {\n if (\n GlobalState.qualifiers.filter((item) => item.q.trim() === \"\").length > 0\n ) {\n notification.error({\n message: \"Error\",\n description: \"Please fill all the questions\",\n });\n } else {\n dispatch(SaveQuestionnaire(GlobalState?.qualifiers));\n }\n };\n useEffect(() => {\n dispatch(getQuestionsConfig());\n }, []);\n console.log(\"GlobalState\", GlobalState);\n return (\n
\n {\" \"}\n \n \n Questionnaire Configuration\n \n
\n {\n saveConfig();\n }}\n >\n Save\n \n
\n
\n \n \n
\n \n );\n};\n\nexport default QuestionnaireConfiguration;\n","import { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { CXPopover } from \"component/Popover\";\nimport { SortableContainer, SortableElement } from \"react-sortable-hoc\";\nimport { arrayMoveImmutable } from \"array-move\";\nimport React from \"react\";\n\nconst TrackerMain = ({ initialFields, activeFields, setActiveFields }) => {\n const SortableItem = SortableElement(({ field }) => {\n return (\n \n
{field}
\n \n );\n });\n\n const SortableList = SortableContainer(\n ({ items }) => {\n return (\n
\n {items.map((field, index) => (\n \n ))}\n
\n );\n },\n { helperClass: \"sortable-helper\" }\n );\n\n const onSortEnd = ({ oldIndex, newIndex }) => {\n if (typeof oldIndex === \"number\" && typeof newIndex === \"number\") {\n const orderedKeys = arrayMoveImmutable(\n Object.keys(activeFields),\n oldIndex,\n newIndex\n );\n const orderedActiveFields = orderedKeys.reduce((acc, key) => {\n return { ...acc, [key]: activeFields[key] };\n }, {});\n setActiveFields(orderedActiveFields);\n }\n };\n return (\n
\n {\" \"}\n
\n
\n Available Data{\" \"}\n \n Click to add or remove columns from the submission table\n \n }\n >\n \n \n
\n
\n {initialFields?.map((field, index) => {\n return (\n
\n {\n if (activeFields[field.name]) {\n const { [field.name]: _, ...rest } = activeFields;\n setActiveFields(rest);\n } else {\n setActiveFields({ ...activeFields, [field.name]: true });\n }\n }}\n className={\n activeFields[field.name]\n ? \"sbmTablekeysActive\"\n : \"CancelBtn\"\n }\n >\n {field.name}\n \n
\n );\n })}\n
\n
\n
\n
\n Arrange Sequence{\" \"}\n \n You can reorder the columns by dragging and dropping them\n \n }\n >\n \n \n
\n \n
\n
\n );\n};\n\nexport default TrackerMain;\n","import React, { useEffect, useState } from \"react\";\nimport TrackerMain from \"./TrackerMain\";\nimport { submissionInitialFields } from \"screen/UserPortal/Openings/SubmissionsReport/utils\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nimport {\n SaveTenantTracker,\n updateTenantTracker,\n deleteTenantTracker,\n} from \"action/AdminActions\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXInput } from \"component/Input\";\nimport { CXEmpty } from \"component/Empty\";\n\nconst CandidateTracker = ({ type }) => {\n const dispatch = useDispatch();\n const { contactForm, loading } = useSelector((state) => state.ContactReducer);\n const { TrackerConfiguration } = useSelector((state) => state.AdminReducer);\n const { accountVariablesDefinition } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n\n const [initialFields, setInitialFields] = useState(submissionInitialFields);\n const [activeFields, setActiveFields] = useState({});\n const [selectedTracker, setSelectedTracker] = useState(null);\n const [create, setCreate] = useState(false);\n const [trackerName, setTrackerName] = useState(null);\n\n useEffect(() => {\n if (!contactForm?.formItems) return;\n\n const customFields = contactForm.formItems.reduce((acc, item) => {\n if (\n item.category === \"custom\" &&\n !acc.some(\n (accItem) =>\n accItem.name === item.placeholder && accItem.value === item.key\n )\n ) {\n acc.push({ name: item.placeholder, value: item.key });\n }\n return acc;\n }, []);\n let AccountVariables = accountVariablesDefinition?.data?.map((res) => {\n return { name: res?.name, value: res?.name };\n });\n\n let uniqueAccountVariables = AccountVariables?.filter(\n (accountVariable) =>\n !initialFields.some(\n (initialField) =>\n initialField?.name === accountVariable?.name &&\n initialField?.value === accountVariable?.value\n )\n );\n\n const uniqueCustomFields = customFields?.filter(\n (customField) =>\n !initialFields.some(\n (initialField) =>\n initialField?.name === customField?.name &&\n initialField?.value === customField?.value\n )\n );\n setInitialFields((prevFields) => [\n ...(prevFields ?? []),\n ...(uniqueCustomFields ?? []),\n ...(uniqueAccountVariables ?? []),\n ]);\n }, [contactForm, create, accountVariablesDefinition]);\n\n const saveSubmissionTracker = () => {\n const data = {\n trackerName,\n trackerType: type,\n data: activeFields,\n };\n dispatch(SaveTenantTracker(data));\n setCreate(false);\n };\n\n const updateTracker = () => {\n dispatch(\n updateTenantTracker(selectedTracker._id, {\n data: activeFields,\n trackerName,\n })\n );\n };\n\n const deleteTracker = (res) => {\n dispatch(deleteTenantTracker(res._id));\n setCreate(false);\n };\n\n const handleCreateNewTracker = () => {\n setCreate(true);\n // setActiveFields(\n // submissionInitialFields.reduce(\n // (acc, field) => ({ ...acc, [field?.name]: true }),\n // {}\n // )\n // );\n };\n\n const handleViewEditTracker = (res) => {\n setSelectedTracker(res);\n setActiveFields(res?.data);\n setTrackerName(res?.trackerName);\n };\n\n return (\n
\n {!create && !selectedTracker && (\n \n
Tracker List
\n {!selectedTracker && (\n \n Create New Tracker\n \n )}\n
\n )}\n\n {(create || selectedTracker) && (\n
\n
Tracker Name
\n setTrackerName(e.target.value)}\n placeholder=\"Enter Tracker Name\"\n value={trackerName}\n />\n
\n )}\n\n {!loading && !create && !selectedTracker && (\n
\n {TrackerConfiguration?.map((res) => {\n if (res.trackerType === type) {\n return (\n \n
{res.trackerName}
\n
\n handleViewEditTracker(res)}\n >\n View/Edit\n \n deleteTracker(res)}\n />\n
\n
\n );\n }\n return null;\n })}\n \n )}\n\n {!loading && (selectedTracker || create) && (\n
\n \n
\n
\n {\n setCreate(false);\n setSelectedTracker(null);\n setTrackerName(null);\n }}\n >\n Cancel\n \n {\n if (create) {\n saveSubmissionTracker();\n } else {\n updateTracker();\n }\n }}\n >\n {`${create ? \"Create\" : \"Update\"} Tracker`}\n \n
\n
\n
\n )}\n\n
\n {loading && (\n
\n \n
Fetching tracker details...
\n
\n )}\n
\n\n {!loading && !create && !selectedTracker && (\n
\n {!TrackerConfiguration?.some((res) => res?.trackerType === type) && (\n \n )}\n
\n )}\n \n );\n};\n\nexport default CandidateTracker;\n","import React, { useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { CXTabs } from \"component/Tabs\";\nimport CandidateTracker from \"./candidateTracker\";\n// import SubmissionTracker from \"./submissionTracker\";\n\nconst TrackerTabs = ({ url }) => {\n const { subId } = useParams();\n const Active = subId;\n const handleActive = (val) => {\n history.push(`${url}/${val}`);\n };\n return (\n
\n handleActive(ac)}\n items={[\n // {\n // key: \"Candidate\",\n // label: \"Candidate Trackers\",\n // children: (\n // \n // ),\n // },\n {\n key: \"Submission\",\n label: \"Submission Trackers\",\n children: (\n \n ),\n },\n ]}\n />\n
\n );\n};\n\nexport default TrackerTabs;\n","import React, { useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { Switch, Route, useRouteMatch } from \"react-router-dom\";\nimport TrackerTabs from \"./trackerTabs\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { GetAllConfig, getTenantTracker } from \"action/AdminActions\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { getAccountVariablesDefinition } from \"action/AccountVariables\";\n\nconst TrackerConfiguration = () => {\n const dispatch = useDispatch();\n const { path, url } = useRouteMatch();\n useEffect(() => {\n dispatch(getTenantTracker());\n dispatch(GetAllConfig());\n dispatch(getContactForm());\n dispatch(getAccountVariablesDefinition());\n }, []);\n return (\n
\n \n \n Tracker Configuration\n \n \n
\n \n \n \n \n \n \n \n \n
\n
\n );\n};\n\nexport default TrackerConfiguration;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXContent } from \"component/Layout\";\nimport { CXLayout } from \"component/Layout\";\nimport { CXSider } from \"component/Layout\";\nimport User from \"./Users\";\nimport Connected from \"./Connected\";\nimport Integration from \"./Integrations\";\nimport LanguageSettings from \"./LanguageSettings\";\nimport NotificationSettings from \"./NotificationSettings\";\nimport SideBar from \"./SideBar\";\nimport SideBarData from \"./SideBarData\";\nimport { SIDEBAR_ADMIN, ACTIVE_LIST_ADMIN } from \"constant\";\nimport { Switch, Route, useParams, useRouteMatch } from \"react-router-dom\";\nimport CandidateForm from \"./CandidateForm\";\nimport OrganizationSettings from \"./OrganizationSettings\";\nimport AccountVariableDefinitions from \"./AccountVariableDefinitions\";\nimport StageConfiguration from \"./StageConfiguration\";\nimport QuestionnaireConfiguration from \"./QuestionnaireConfiguration\";\nimport TrackerConfiguration from \"./TrackerConfiguration\";\nconst Index = () => {\n const { path } = useRouteMatch();\n const dispatch = useDispatch();\n const DataSider = useSelector((state) => state.AdminReducer.DataSider);\n const RenderComponent = () => {\n let { topicId } = useParams();\n dispatch({ type: ACTIVE_LIST_ADMIN, data: topicId });\n let obj = {\n User: ,\n Connected: ,\n Integration: ,\n Language: ,\n notificationSettings: ,\n candidateForm: ,\n organizationSettings: ,\n AccountVariableDefinitions: ,\n stageConfiguration: ,\n QuestionnaireConfiguration: ,\n TrackerConfiguration: ,\n\n // whatsapp_store: ,\n };\n return obj[topicId === path ? \"User\" : topicId];\n };\n useEffect(() => {\n return () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: ACTIVE_LIST_ADMIN, data: \"User\" });\n };\n }, []);\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Index;\n","import { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport OAuthPopup from \"component/OAuthPopup\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { STORE_SETTINGS } from \"constant\";\nimport React from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { truncateSt } from \"utils\";\nimport FacebookConnect from \"component/FacebookConnect\";\n\nconst ConnectFacebook = () => {\n const dispatch = useDispatch();\n const { storeFacebook, storeSettings, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n const addSettings = (item) => {\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, metaId: item },\n });\n };\n return (\n addSettings(item)}\n />\n );\n};\n\nexport default ConnectFacebook;\n","import {\n GetAllConfig,\n getIntegrationShopify,\n getStore,\n getStoreIntegartionSopify,\n} from \"action/AdminActions\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { oauthUrl } from \"config/config\";\nimport { getCookie } from \"utils\";\nconst OauthShopify = ({ children, url }) => {\n const dispatch = useDispatch();\n const tenantId = getCookie(\"tenant\");\n const accessToken = getCookie(\"ob_a\");\n\n const [externalPopup, setExternalPopup] = useState(null);\n const connectClick = async () => {\n const width = 500;\n const height = 400;\n const left = window.screenX + (window.outerWidth - width) / 2;\n const top = window.screenY + (window.outerHeight - height) / 2.5;\n\n // Ensure the variables are properly encoded\n const encodedOauthUrl = encodeURIComponent(oauthUrl);\n const encodedUrl = encodeURIComponent(url);\n const encodedTenantId = encodeURIComponent(tenantId);\n const encodedAccessToken = encodeURIComponent(accessToken);\n\n let completeUrl =\n encodedOauthUrl +\n encodedUrl +\n \"&tid=\" +\n encodedTenantId +\n \"&authorization=Bearer%20\" +\n encodedAccessToken;\n\n const title = `Connect Account`;\n const popup = window.open(\n completeUrl,\n title,\n `width=${width},height=${height},left=${left},top=${top}`\n );\n setExternalPopup(popup);\n };\n useEffect(() => {\n if (!externalPopup) {\n return;\n }\n const timer = setInterval(() => {\n if (!externalPopup) {\n timer && clearInterval(timer);\n return;\n }\n if (externalPopup.closed) {\n dispatch(getStore());\n dispatch(getIntegrationShopify({ provider: \"shopify\" }));\n setExternalPopup(null);\n timer && clearInterval(timer);\n }\n }, 500);\n }, [externalPopup]);\n return
connectClick()}>{children}
;\n};\n\nexport default OauthShopify;\n","import { getStore, getStoreList } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXInput } from \"component/Input\";\nimport OauthShopify from \"component/OauthShopify\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { STORE_SETTINGS } from \"constant\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { truncateSt, urlcheck } from \"utils\";\n\nconst ConnectShopify = () => {\n const dispatch = useDispatch();\n const [textInp, settextInp] = useState(null);\n const { StoreData, storeSettings, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n const addSettings = (item) => {\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, storeId: item },\n });\n };\n const checkUrl = (e) => {\n if (!textInp) {\n e.stopPropagation();\n }\n };\n useEffect(() => {\n dispatch(getStore(true));\n dispatch(getStoreList(true));\n }, []);\n return (\n
\n
\n
\n
\n {\" \"}\n Connect your shopify store\n
\n
\n settextInp(urlcheck(e.target.value))}\n className=\"inputStyle\"\n placeholder=\"Enter your store Url\"\n />\n
\n
\n \n checkUrl(e)}>\n Connect\n \n \n
\n
\n
\n \n {Array.isArray(StoreData) &&\n StoreData?.map((item) => (\n addSettings(item?._id)}\n >\n
\n \n
\n
\n {truncateSt(item?.title, 26)}\n
\n
\n {truncateSt(item?.description, 26)}\n
\n \n ))}\n {Loading && StoreData?.length === 0 && (\n \n \n \n )}\n \n
\n );\n};\n\nexport default ConnectShopify;\n","// This icon file is generated automatically.\nvar ReadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 00324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z\" } }] }, \"name\": \"read\", \"theme\": \"outlined\" };\nexport default ReadOutlined;\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 ReadOutlinedSvg from \"@ant-design/icons-svg/es/asn/ReadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ReadOutlined = function ReadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ReadOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ReadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ReadOutlined';\n}\nexport default RefIcon;","import { MinusCircleFilled, ReadOutlined } from \"@ant-design/icons\";\nimport { createCatalouge, getBusinessInfo } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXInput } from \"component/Input\";\nimport { CXPopover } from \"component/Popover\";\nimport { STORE_SETTINGS } from \"constant\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Form } from \"antd\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXSelect, CXOption } from \"component/Select\";\n\nconst BussinessInfo = () => {\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n const [open, setOpen] = useState(false);\n const { storeSettings, BusinessInfo, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n const [ActiveCatalouge, setActiveCatalouge] = useState(null);\n\n useEffect(() => {\n if (storeSettings.metaId) {\n dispatch(getBusinessInfo(storeSettings.metaId));\n }\n }, []);\n const addSettings = (businessId, catalogId, catalogName) => {\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, businessId, catalogId, catalogName },\n });\n };\n\n const AddContent = (id) => {\n const onFinish = (values) => {\n let obj = {\n iaId: storeSettings.metaId,\n businessId: id,\n name: values.name,\n };\n dispatch(createCatalouge(obj));\n form.resetFields();\n setOpen(false);\n };\n return (\n
\n \n \n \n \n
\n \n \n ADD\n \n \n \n setOpen(false)}\n >\n Cancel\n \n \n
\n \n
\n );\n };\n return (\n \n {Loading && }\n {!Loading && (\n \n
Select catalogue
\n setActiveCatalouge(val)}\n value={ActiveCatalouge}\n >\n {BusinessInfo?.map((item, index) => {\n return (\n \n {item?.name}\n \n );\n })}\n \n {ActiveCatalouge &&\n BusinessInfo?.map((item, index) => {\n if (item.id === ActiveCatalouge) {\n return (\n
\n \n {item?.name}{\" \"}\n
\n setOpen(true)}\n >\n \n \n
\n \n
\n {item?.catalogs?.map((res) => {\n return (\n \n addSettings(item.id, res.id, res.name)\n }\n >\n
\n \n
\n
{res.name}
\n
\n );\n })}\n
\n \n );\n }\n })}\n
\n )}\n
\n );\n};\n\nexport default BussinessInfo;\n","import { getStore, getStoreCollection } from \"action/AdminActions\";\nimport { WBgetSopifiCat } from \"action/WorkbenchAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { STORE_SETTINGS } from \"constant\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { generateUniqueKey } from \"utils\";\n\nconst SelectCollections = () => {\n const dispatch = useDispatch();\n const { storeSettings, storeCollections, Loading } = useSelector(\n (state) => state.AdminReducer\n );\n useEffect(() => {\n storeSettings?.storeId &&\n dispatch(getStoreCollection(storeSettings?.storeId));\n }, [storeSettings?.storeId]);\n const addSettings = (item) => {\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, collections: item },\n });\n };\n useEffect(() => {\n if (!storeSettings?.collections) {\n let gg = storeCollections\n ?.filter((res) => res?.synced === true)\n .map((res) => res.providerId);\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, collections: gg },\n });\n }\n }, [storeCollections]);\n return (\n
\n {!storeCollections && Loading && (\n \n )}\n\n {(!Loading || storeCollections?.length > 0) && (\n \n
Select Collection
\n addSettings(val)}\n value={storeSettings?.collections}\n >\n {storeCollections?.map((item, index) => {\n return (\n \n {item?.title}\n \n );\n })}\n \n
\n )}\n
\n );\n};\n\nexport default SelectCollections;\n","import { RightOutlined } from \"@ant-design/icons\";\nimport {\n CreateCollectionProduct,\n getCollectionProduct,\n getStoreCollection,\n} from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXModal } from \"component/Modal\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { CXTable } from \"component/Table\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst SelectCollections = () => {\n const dispatch = useDispatch();\n const [Data, setData] = useState([]);\n const [showModal, setshowModal] = useState(false);\n const [selectedRowKeys, setSelectedRowKeys] = useState([]);\n const [checkKey, setcheckKey] = useState([]);\n const { storeSettings, storeCollections, ProductCollections, Loading } =\n useSelector((state) => state.AdminReducer);\n const [datatable, setddatatable] = useState([]);\n\n useEffect(() => {\n let arr = [];\n storeSettings?.collections?.forEach((item) => {\n let data = storeCollections?.find((i) => i?.providerId === item);\n arr.push(data);\n });\n setData(arr);\n }, [storeSettings, storeCollections]);\n\n const collectionProducts = (collectionId) => {\n dispatch(getCollectionProduct(storeSettings.storeId, collectionId));\n };\n\n const columns = [\n {\n title: \"Product\",\n dataIndex: \"title\",\n key: \"title\",\n render: (text) => text ?? \"N/A\",\n },\n {\n title: \"Image\",\n dataIndex: \"image\",\n key: \"image\",\n render: (text) =>\n (\n
\n \n }\n >\n \n \n
\n ) ?? \"N/A\",\n },\n {\n title: \"Status\",\n dataIndex: \"status\",\n key: \"status\",\n render: (text) => text ?? \"N/A\",\n },\n {\n title: \"Inventory\",\n dataIndex: \"inventory\",\n key: \"inventory\",\n render: (text) => text ?? \"N/A\",\n },\n {\n title: \"Type\",\n dataIndex: \"Type\",\n key: \"Type\",\n render: (text) => text ?? \"N/A\",\n },\n {\n title: \"Vendor\",\n dataIndex: \"Vendor\",\n key: \"Vendor\",\n render: (text) => text ?? \"N/A\",\n },\n ];\n const rowSelection = {\n onChange: (selectedRowKeys, selectedRows) => {\n setSelectedRowKeys(selectedRows.map((res) => res.id));\n setcheckKey(selectedRowKeys);\n },\n };\n useEffect(() => {\n setddatatable(\n ProductCollections?.products?.map((res, index) => {\n return {\n id: res?._id ?? res?.providerVId,\n key: index + 1,\n image: res?.image?.url,\n title: res?.title,\n status: res?.status,\n inventory: res?.quantity,\n Type: res?.type,\n Vendor: res?.vendor,\n };\n })\n );\n\n if (ProductCollections?.products?.length > 0) {\n setSelectedRowKeys(\n ProductCollections?.products\n .filter((res, index) => res?.synced === true)\n .map((t) => t._id)\n );\n // filter and return index\n let arr = [];\n ProductCollections?.products.forEach((res, index) => {\n if (res?.synced === true) {\n arr.push(index + 1);\n }\n });\n setcheckKey(arr);\n }\n }, [ProductCollections]);\n\n const createProductCol = () => {\n let arr = [];\n ProductCollections?.products.forEach((item) => {\n if (selectedRowKeys.includes(item._id)) {\n arr.push(item);\n }\n if (selectedRowKeys.includes(item.providerVId)) {\n arr.push(item);\n }\n });\n dispatch(\n CreateCollectionProduct(\n storeSettings.storeId,\n ProductCollections._id,\n arr\n )\n );\n setshowModal(false);\n };\n useEffect(() => {\n dispatch(getStoreCollection(storeSettings?.storeId));\n }, []);\n return (\n
\n
Select Products
\n
\n {Data?.map((item, index) => {\n return (\n
\n
\n \n {item?.title}\n
\n {\n setshowModal(true);\n collectionProducts(item?._id);\n }}\n >\n
{item?.prodCount ?? 0} products
{\" \"}\n \n \n
\n );\n })}\n
\n\n
\n setshowModal(false)}\n closable={false}\n >\n {!Loading && (\n
\n
\n
\n \n {ProductCollections?.title}\n
\n
\n createProductCol()}\n className={\n selectedRowKeys?.length > 0\n ? \"storeSaveBtn mr-2\"\n : \"storeSaveBtnDisabled mr-2\"\n }\n >\n Save\n \n setshowModal(false)}\n className=\"storeCancelBtn\"\n >\n Cancel\n \n
\n
\n \n
\n )}\n {Loading && }\n \n
\n
\n );\n};\n\nexport default SelectCollections;\n","import { Button, message, Steps } from \"antd\";\nimport React, { useEffect, useState } from \"react\";\nimport { CXStep, CXSteps } from \"component/Steps\";\nimport ConnectShopify from \"./connectShopify\";\nimport ConnectFacebook from \"./connectFacebook\";\nimport BussinessInfo from \"./bussinessInfo\";\nimport SelectCollections from \"./selectCollections\";\nimport SelectProducts from \"./selectProducts\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport {\n createStoreCollection,\n getStoreIntegartionFacebook,\n metaConnection,\n SyncStore,\n} from \"action/AdminActions\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom\";\nimport { STORE_SETTINGS } from \"constant\";\n\nconst StoreSteps = () => {\n let { updateId } = useParams();\n const dispatch = useDispatch();\n const [Finished, setFinished] = useState(false);\n const [current, setCurrent] = useState(0);\n const { storeSettings, storeCollections, StoreConnectionId, StoreDataList } =\n useSelector((state) => state.AdminReducer);\n const next = () => {\n setCurrent(current + 1);\n if (current === 3) {\n const arr = [];\n storeSettings?.collections?.forEach((item) => {\n let data = storeCollections?.find((i) => i?.providerId === item);\n arr.push({\n title: data?.title,\n provider: data?.provider,\n providerId: data?.providerId,\n });\n });\n dispatch(createStoreCollection(storeSettings.storeId, arr));\n }\n if (current === 2) {\n let obj = {\n storeId: storeSettings.storeId,\n iaId: storeSettings.metaId,\n catalogId: storeSettings.catalogId,\n catalogName: storeSettings.catalogName,\n businessId: storeSettings.businessId,\n };\n dispatch(metaConnection(obj));\n }\n };\n const prev = () => {\n setCurrent(current - 1);\n };\n const steps = [\n ,\n ,\n ,\n ,\n ,\n ];\n const items = steps.map((item) => ({\n key: item.title,\n title: item.title,\n }));\n\n const obj = {\n 0: storeSettings?.storeId ? \"nextbtn\" : \"nextbtnDisabled\",\n 1: storeSettings?.metaId ? \"nextbtn\" : \"nextbtnDisabled\",\n 2: storeSettings?.businessId ? \"nextbtn\" : \"nextbtnDisabled\",\n 3: storeSettings?.collections ? \"nextbtn\" : \"nextbtnDisabled\",\n 4: storeSettings?.step4 ? \"nextbtn\" : \"nextbtnDisabled\",\n };\n useEffect(() => {\n dispatch(getStoreIntegartionFacebook());\n }, []);\n useEffect(() => {\n if (updateId && StoreDataList) {\n let activeStore = StoreDataList?.find((item) => item?._id === updateId);\n if (activeStore) {\n let obj = {\n storeId: activeStore?.storeId?._id,\n iaId: activeStore?.iaId,\n catalogId: activeStore?.catalogId,\n catalogName: activeStore?.catalogName,\n businessId: activeStore?.businessId,\n };\n dispatch({\n type: STORE_SETTINGS,\n data: { ...storeSettings, ...obj },\n });\n dispatch(metaConnection(obj));\n }\n setCurrent(3);\n }\n }, [updateId, StoreDataList]);\n\n const finshSteps = () => {\n if (StoreConnectionId?._id) {\n dispatch(SyncStore({ connectionId: StoreConnectionId?._id }));\n setFinished(true);\n }\n };\n const Close = () => {\n history.push(\"/admin/whatsapp_store\");\n };\n const stepItems = [\n {\n title: \"Connect Store\",\n },\n {\n title: \"Connect Meta\",\n },\n {\n title: \"Bussiness Info\",\n },\n {\n title: \"Collections\",\n },\n {\n title: \"Products\",\n },\n ];\n return (\n <>\n
\n
\n \n {stepItems?.map((item) => {\n return ;\n })}\n \n
\n\n
\n {!Finished &&
{steps[current]}
}\n {Finished && (\n
\n \"end\"\n
\n )}\n
\n\n
\n {!Finished && current < steps?.length - 1 && (\n next()}\n className={obj[current]}\n >\n Next step\n \n )}\n {!Finished && current === steps?.length - 1 && (\n finshSteps()}\n >\n Finish\n \n )}\n {!Finished && current > 0 && !updateId && (\n prev()}\n >\n Previous\n \n )}\n {!Finished && updateId && current > 3 && (\n prev()}\n >\n Previous\n \n )}\n {Finished && (\n \n )}\n
\n \n );\n};\nexport default StoreSteps;\n","import React, { useState } from \"react\";\nimport StoreSteps from \"./StoreSteps\";\nimport \"../style.css\";\nconst CreateStore = () => {\n return (\n
\n
\n
Connect your store
\n
\n Please complete the following steps to setup whatsapp store\n
\n
\n
\n \n
\n
\n );\n};\n\nexport default CreateStore;\n","import { ACTIVE_INDEX, CONNECT_SIDEBAR_VIEW, SIDEBAR_ADMIN } from \"constant\";\nimport moment from \"moment\";\nimport React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport { truncateSt } from \"utils\";\nimport history from \"utils/history\";\nimport { EditOutlined } from \"@ant-design/icons\";\n\nconst StoreComponent = ({ item }) => {\n const dispatch = useDispatch();\n const { url } = useRouteMatch();\n const handleView = (id) => {\n dispatch({ type: SIDEBAR_ADMIN, data: false });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"VIEW\" });\n dispatch({ type: ACTIVE_INDEX, data: id });\n };\n return (\n
\n
\n
\n
{item?.storeId?.title}
\n
\n Modified On : {moment(item?.updatedAt).format(\"DD MMM YYYY\")}\n
\n
\n
\n history.push(`${url}/update/${item?._id}`)}\n style={{ color: \"#c8c8c8\" }}\n />\n handleView(item)}\n />\n DeleteBot(res.id)}\n />\n
\n
\n
{item?.description}
\n
\n
\n
Catalog
\n
\n {truncateSt(item?.catalogName, 12) ?? \"N/A\"}\n
\n
\n
\n
Products
\n
{item?.products?.count ?? 0}
\n
\n
\n {item?.storeId?.status === \"enabled\" ? (\n
Live
\n ) : (\n
Draft
\n )}\n
\n
\n
\n );\n};\n\nexport default StoreComponent;\n","import { getStoreList } from \"action/AdminActions\";\nimport { CXLayout } from \"component/Layout\";\nimport { CXRow } from \"component/Row\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport React, { Fragment, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport StoreComponent from \"./StoreComponent\";\nimport \"./index.css\";\n\nconst ListStore = () => {\n const dispatch = useDispatch();\n const { StoreDataList, Loading } = useSelector((state) => state.AdminReducer);\n const { url } = useRouteMatch();\n const addStore = () => {\n history.push(`${url}/create`);\n };\n useEffect(() => {\n dispatch(getStoreList());\n }, []);\n return (\n \n
\n {(!Loading || StoreDataList?.length > 0) && (\n
\n addStore()}\n style={{ color: \"#c8c8c8\" }}\n >\n \n \n Add New Store\n \n \n
\n )}\n {StoreDataList?.map((item, index) => {\n return ;\n })}\n {Loading && StoreDataList?.length === 0 && (\n \n {[...Array(6)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n
\n
\n );\n};\n\nexport default ListStore;\n","import React, { useState, useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined, InfoCircleOutlined } from \"@ant-design/icons\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { ACTIVE_INDEX, CONNECT_SIDEBAR_VIEW, SIDEBAR_ADMIN } from \"constant\";\nimport { CXSwitch } from \"component/Switch\";\nimport { generateUniqueKey, truncateSt } from \"utils\";\nimport { CXPopover } from \"component/Popover\";\nimport { updateStoreSettings } from \"action/AdminActions\";\n\nconst SiderData = () => {\n const dispatch = useDispatch();\n const Index = useSelector((state) => state.AdminReducer.ActiveIndex);\n const handleClose = () => {\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n dispatch({ type: CONNECT_SIDEBAR_VIEW, data: \"\" });\n dispatch({ type: ACTIVE_INDEX, data: null });\n };\n const SettingsUpdate = (check, data) => {\n let obj = {};\n if (data) {\n obj = {\n webhooks: [\n {\n _idname: data._idname,\n subscribed: check,\n },\n ],\n };\n } else {\n obj = {\n storeSettings: {\n cartRecovery: check,\n },\n };\n }\n\n dispatch(updateStoreSettings(Index?.storeId._id, obj));\n };\n console.log(Index?.storeId?.storeSettings?.cartRecovery);\n return (\n
\n \n \n Store Settings\n \n
\n handleClose()}\n />\n
\n
\n
\n {truncateSt(Index?.storeId?.title, 25)}\n
\n
\n {Index?.storeId?.webhooks.map((res) => {\n return (\n
\n
{res.name}
\n
\n {truncateSt(res.desc, 25)}{\" \"}\n {res?.desc?.length > 25 && (\n {res?.desc}
}\n >\n \n \n )}\n
\n
\n subscribed:{\" \"}\n SettingsUpdate(e, res)}\n />\n
\n \n );\n })}\n \n
Store Settings
\n
\n
\n
Cart Recovery
\n SettingsUpdate(e)}\n />\n
\n
\n \n );\n};\n\nexport default SiderData;\n","import { CXButton } from \"component/Button\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { STORE_SETTINGS } from \"constant\";\nimport React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Switch, useParams, useRouteMatch, Route } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport CreateStore from \"./createStore\";\nimport ListStore from \"./listStore\";\nimport { CXSider } from \"component/Layout\";\nimport \"./style.css\";\nimport SiderData from \"./listStore/SiderData\";\n\nconst Index = () => {\n const DataSider = useSelector((state) => state.AdminReducer.DataSider);\n const { path } = useRouteMatch();\n const dispatch = useDispatch();\n const [url, seturl] = useState(null);\n const RenderComponent = () => {\n let { topicId } = useParams();\n topicId ? seturl(topicId) : seturl(null);\n let obj = {\n create: ,\n update: ,\n };\n return obj[topicId];\n };\n return (\n \n \n \n \n \n Whatsapp Store\n \n {(url === \"create\" || url === \"update\") && (\n {\n history.push(\"/admin/whatsapp_store\");\n dispatch({ type: STORE_SETTINGS, data: null });\n seturl(null);\n }}\n >\n Cancel\n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Index;\n","import { PlusOutlined } from \"@ant-design/icons\";\nimport {\n createCampaignStep,\n createCampaignStepCloned,\n updateCampaignStep,\n updateCampaignStepCloned,\n} from \"action/CampaignAction\";\nimport {\n createTagActionTrigger,\n searchTagActionTrigger,\n} from \"action/TagAction\";\nimport { Divider, Space, Tag, Tooltip, notification } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CXFormItem } from \"component/Form\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { get, post } from \"helper/networkClient\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst TagComponent = ({ form, Selected, parentId, wfId, update, fData }) => {\n const dispatch = useDispatch();\n const [options, setOptions] = useState(null);\n const [uniqueOptions, setuniqueOptions] = useState(null);\n const [tags, setTags] = useState([]);\n const [Loading, setLoading] = useState(false);\n\n const [name, setName] = useState(\"\");\n const handleSearch = async (value) => {\n if (value) {\n setLoading(true);\n setName(value);\n const res = await get(`/tag/search`, { text: value, type: \"contact\" });\n if (res?.data?.data?.length > 0) {\n const options = res?.data?.data?.map((tag) => (\n \n {tag?._id?.name} ({tag?.tc})\n \n ));\n setOptions(options);\n setLoading(false);\n } else {\n setOptions(false);\n setLoading(false);\n }\n }\n };\n const handleInputConfirm = (ActiveVal) => {\n if (!tags.includes(ActiveVal)) {\n setTags([...tags, ActiveVal]);\n }\n };\n const addItem = async (e) => {\n e.preventDefault();\n try {\n await post(\"/tag\", {\n text: {\n q: name,\n },\n type: \"contact\",\n }).then((resp) => {\n if (!tags.includes(name)) {\n setTags([...tags, name]);\n }\n setName(\"\");\n });\n } catch (error) {\n notification.success({\n message: `Already exist one tag with same name. `,\n });\n }\n };\n const onFinish = () => {\n let temp = tags?.map((tag) => tag);\n let obj = {\n type: \"action\",\n wfId,\n actionType: \"tag\",\n parentId,\n tags: temp,\n };\n if (update) {\n const { parentId, ...rest } = obj;\n if (window.location.href.includes(\"openings\")) {\n dispatch(updateCampaignStepCloned(update._id, rest));\n } else {\n dispatch(updateCampaignStep(update._id, rest));\n }\n dispatch({ type: \"CAMPAIGN_UPDATE_SIDEBAR\", data: true });\n dispatch({ type: \"CAMPAIGN_UPDATE_DATA\", data: {} });\n } else {\n if (window.location.href.includes(\"openings\")) {\n dispatch(createCampaignStepCloned(obj));\n } else {\n dispatch(createCampaignStep(obj));\n }\n }\n dispatch({ type: \"WAIT_FOR_CAMPAIGN_RESPONSE\", data: true });\n form.resetFields();\n // fData?.hide();\n };\n console.log(tags, options, name?.length, Loading);\n const tagPlusStyleAct = {\n cursor: \"pointer\",\n color: \"#767676\",\n background: \"#ABABAB38\",\n borderColor: \"#ABABAB38\",\n borderRadius: \"50px\",\n padding: \"2px 8px 2px 8px\",\n display: \"flex\",\n alignItems: \"center\",\n };\n const handleClose = (removedTag) => {\n const newTags = tags.filter((tag) => tag !== removedTag);\n setTags(newTags);\n };\n return (\n
\n \n
\n
Tags
\n \n {tags.map((tag, index) => {\n const isLongTag = tag?.length > 20;\n const tagElem = (\n handleClose(tag)}\n >\n {isLongTag ? `${tag.slice(0, 20)}...` : tag}\n \n );\n return isLongTag ? (\n \n {tagElem}\n \n ) : (\n tagElem\n );\n })}\n \n
\n \n }\n >\n \n ) : (\n \n No tag found\n
\n )\n }\n onChange={(val) => {\n handleInputConfirm(val);\n }}\n dropdownRender={(menu) => (\n <>\n {menu}\n \n \n {name?.length > 0 && !options && !Loading && (\n
\n
\n }\n onClick={addItem}\n >\n {name}\n \n
\n
\n )}\n \n \n )}\n >\n {options}\n \n \n\n {tags?.length > 0 && (\n \n onFinish()}>\n Save\n \n \n )}\n \n );\n};\n\nexport default TagComponent;\n","// This icon file is generated automatically.\nvar MessageFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M924.3 338.4a447.57 447.57 0 00-96.1-143.3 443.09 443.09 0 00-143-96.3A443.91 443.91 0 00512 64h-2c-60.5.3-119 12.3-174.1 35.9a444.08 444.08 0 00-141.7 96.5 445 445 0 00-95 142.8A449.89 449.89 0 0065 514.1c.3 69.4 16.9 138.3 47.9 199.9v152c0 25.4 20.6 46 45.9 46h151.8a447.72 447.72 0 00199.5 48h2.1c59.8 0 117.7-11.6 172.3-34.3A443.2 443.2 0 00827 830.5c41.2-40.9 73.6-88.7 96.3-142 23.5-55.2 35.5-113.9 35.8-174.5.2-60.9-11.6-120-34.8-175.6zM312.4 560c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.4 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48zm199.6 0c-26.4 0-47.9-21.5-47.9-48s21.5-48 47.9-48 47.9 21.5 47.9 48-21.5 48-47.9 48z\" } }] }, \"name\": \"message\", \"theme\": \"filled\" };\nexport default MessageFilled;\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 MessageFilledSvg from \"@ant-design/icons-svg/es/asn/MessageFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar MessageFilled = function MessageFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MessageFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MessageFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MessageFilled';\n}\nexport default RefIcon;","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXInput } from \"component/Input\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport {\n createCampaignStep,\n createCampaignStepCloned,\n updateCampaignStep,\n updateCampaignStepCloned,\n} from \"action/CampaignAction\";\nimport { useParams } from \"react-router-dom\";\nimport {\n CAMPAIGN_UPDATE_DATA,\n CAMPAIGN_UPDATE_SIDEBAR,\n WAIT_FOR_CAMPAIGN_RESPONSE,\n} from \"constant\";\nimport { formatPhoneNumberWithExt } from \"utils\";\nimport ViewTemplate from \"../Helper/ViewTemplate\";\nimport { languageOptions } from \"utils/languageList\";\nimport { getEmailTemplatesTrigger } from \"action/TemplateAction\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport {\n createTagActionTrigger,\n searchTagActionTrigger,\n} from \"action/TagAction\";\nimport TagComponent from \"./TagComponent\";\nimport { MessageFilled, MessageOutlined } from \"@ant-design/icons\";\n\nconst CustomAction = ({ fData, update }) => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n let { edit } = useParams();\n const [data, setdata] = useState(null);\n const [templateId, settemplateId] = useState(null);\n const [templateData, setTemplateData] = useState(null);\n const [Selected, setSelected] = useState(null);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { EmailTemplates, smsTemplates, templates } = useSelector(\n (state) => state.TemplateReducer\n );\n\n useEffect(() => {\n let d = templates?.data?.find((item) => item._id === templateId);\n let emailData = EmailTemplates?.data?.find(\n (item) => item._id === templateId\n );\n setTemplateData(d ?? emailData);\n let obj = {\n category: d?.category,\n actionType: d?.actionType,\n templateName: d?.templateName,\n language: d?.language,\n header: {\n type: d?.header?.type,\n link: d?.header?.link,\n },\n body: d?.body,\n footer: d?.footer,\n\n action: d?.action,\n variable: d?.exampleVariable,\n };\n d && setdata(obj);\n }, [templateId, templates]);\n\n useEffect(() => {\n if (update) {\n setSelected(update?.md);\n form?.setFieldsValue({\n md: update?.md,\n templateId: update?.templateId ?? update.emailTemplateId,\n channelAccountId: update?.channelAccountId,\n });\n settemplateId(update?.templateId ?? update.emailTemplateId);\n }\n }, [update]);\n\n const onTemplateSelection = (templateId) => {\n settemplateId(templateId);\n };\n\n const onFinish = (values) => {\n const { templateId, ...rest } = values;\n let obj = {\n md: Selected,\n type: \"action\",\n wfId: edit,\n actionType: \"message\",\n parentId: fData.source,\n ...rest,\n };\n if (Selected === \"email\") {\n obj.emailTemplateId = templateId;\n }\n if (Selected === \"whatsapp\") {\n obj.templateId = templateId;\n }\n if (Selected === \"sms\") {\n obj.templateId = templateId;\n }\n if (update) {\n const { parentId, ...rest } = obj;\n if (window.location.href.includes(\"openings\")) {\n dispatch(updateCampaignStepCloned(update._id, rest));\n } else {\n dispatch(updateCampaignStep(update._id, rest));\n }\n\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: {} });\n } else {\n // if url imncludes openings\n\n if (window.location.href.includes(\"openings\")) {\n dispatch(createCampaignStepCloned(obj));\n } else {\n dispatch(createCampaignStep(obj));\n }\n }\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: true });\n form.resetFields();\n fData?.hide();\n };\n\n return (\n \n \n {\n if (Selected !== \"whatsapp\") {\n setSelected(\"whatsapp\");\n settemplateId(null);\n form?.setFieldsValue({\n templateId: null,\n channelAccountId: null,\n });\n }\n }}\n >\n \n Send Whatsapp\n \n {\n if (Selected !== \"email\") {\n setSelected(\"email\");\n settemplateId(null);\n form?.setFieldsValue({\n templateId: null,\n channelAccountId: null,\n });\n }\n }}\n >\n \n Send Mail\n \n {\n if (Selected !== \"sms\") {\n setSelected(\"sms\");\n settemplateId(null);\n form?.setFieldsValue({\n templateId: null,\n channelAccountId: null,\n });\n }\n }}\n >\n {/* */}\n
\n {Selected === \"sms\" ? (\n \n ) : (\n \n )}\n
\n Send SMS\n \n {/* {\n if (Selected !== \"Update Contact\") {\n setSelected(\"Update Contact\");\n settemplateId(null);\n form?.setFieldsValue({\n templateId: null,\n channelAccountId: null,\n });\n }\n }}\n >\n \n Update Contact\n */}\n {\n if (Selected !== \"tag\") {\n setSelected(\"tag\");\n settemplateId(null);\n form?.setFieldsValue({\n templateId: null,\n channelAccountId: null,\n });\n }\n }}\n >\n \n Add Connected Tag\n \n \n {Selected === \"email\" && (\n
\n \n
Template
\n {templateId && (\n
\n \n
\n )}\n
\n }\n name=\"templateId\"\n rules={[{ required: true, message: \"Please select a template\" }]}\n >\n onTemplateSelection(val)}\n defaultValue={templateId}\n >\n {EmailTemplates?.data?.map((template) => {\n return (\n {template?.title}\n );\n })}\n \n \n \n )}\n {Selected === \"whatsapp\" && (\n \n
Template
\n {templateId && (\n
\n \n
\n )}\n \n }\n name=\"templateId\"\n rules={[{ required: true, message: \"Please select a template\" }]}\n >\n onTemplateSelection(val)}\n >\n {templates?.data?.map((template) => {\n return (\n \n {template.name} - (\n {languageOptions.find(\n (res) => res?.value === template.language\n )?.label ?? \"N/A\"}\n )\n \n );\n })}\n \n \n )}\n {/* Channel account select */}\n {Selected === \"whatsapp\" && templateData?.caid?._id && (\n \n \n \n {templateData?.caid?.configWp?.name +\n \" \" +\n `(${formatPhoneNumberWithExt(\n templateData?.caid?.configWp?.senderId\n )})`}\n \n \n \n )}\n {Selected === \"sms\" && (\n \n
Template
\n {templateId && (\n
\n c._id === templateId)}\n templateId={templateId}\n md=\"sms\"\n />\n
\n )}\n \n }\n name=\"templateId\"\n rules={[{ required: true, message: \"Please select a template\" }]}\n >\n onTemplateSelection(val)}\n >\n {smsTemplates?.data?.map((template) => {\n return {template.name};\n })}\n \n \n )}\n {Selected === \"sms\" && (\n \n \n {allConfigData?.map((res) => {\n if (res?.md === \"sms\") {\n return (\n \n {formatPhoneNumberWithExt(res?.configSms?.number)}\n \n );\n }\n })}\n \n \n )}\n {Selected === \"email\" && (\n \n \n {\"\"}\n {allConfigData?.map((res) => {\n if (res.md === \"email\") {\n return (\n {res?.configEmail?.email}\n );\n }\n })}\n \n \n )}\n {Selected && templateId && (\n \n \n Save\n \n \n )}\n {Selected === \"tag\" && (\n \n )}\n
\n );\n};\n\nexport default CustomAction;\n","import { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { CXInput } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { operatorType } from \"./utils\";\nimport \"./style.css\";\nimport { InfoBox } from \"component/InfoBox\";\nconst CustomForm = ({ onChange, deleteLastCondition, conditionList }) => {\n const [condition, setCondition] = useState(null);\n const [form] = Form.useForm();\n const { CampaignStepsConditions } = useSelector(\n (state) => state.CampaignReducer\n );\n const { tagList } = useSelector((state) => state.TagReducer);\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const onFinish = (values) => {\n values.unit = values.unit ? values.unit : \"bool\";\n values.operator = values.operator ? values.operator : \"eq\";\n if (values.q === \"contact_tag\") {\n values.key = tagList.find(\n (item) => item._id?.name === values.value\n )._id?.name;\n }\n onChange(values);\n form.resetFields();\n };\n const HelperText = {\n contact_tag: `This condition will select all contacts which have. \n Tag value equal to A\n OR \n Tag Value equal to B \n OR \n Contact’s attribute key1 equal to value1`,\n last_seen: `This is not WhatsApp last seen. This condition will select all contacts who have seen (not seen) previous messages of this campaign`,\n campaign_action_taken:\n \"This condition will select all the contacts who have interacted (not interacted, depending on selection → true / false) with any previous message of this campaign\",\n };\n\n return (\n
\n
\n \n \n \n setCondition(\n CampaignStepsConditions?.data.filter(\n (values) => values.cid === val\n )[0]\n )\n }\n >\n {CampaignStepsConditions?.data?.map((item) => {\n // if item is not in conditionList then only show it as option\n if (\n conditionList?.length > 0 &&\n conditionList?.filter((res) => res.q === item.cid)?.length > 0\n ) {\n return {item.cname};\n } else if (conditionList?.length === 0) {\n return {item.cname};\n }\n return null;\n })}\n \n \n {HelperText[condition?.cid]?.length > 0 && (\n \n )}\n\n {condition?.type && condition?.type === \"freeVal\" && (\n
\n \n \n {operatorType &&\n Object.keys(operatorType).map((item) => {\n if (condition?.allowedComparator?.includes(item)) {\n return (\n {operatorType[item]}\n );\n }\n })}\n \n \n {condition.cid === \"last_seen\" && (\n \n \n \n \n \n \n Days\n Hours\n \n \n \n )}\n
\n )}\n\n {condition?.type && condition?.type === \"boolean\" && (\n \n \n True\n False\n \n \n )}\n {condition?.cid === \"contact_tag\" && (\n \n \n {tagList?.map((res) => {\n return (\n {res?._id?.name}\n );\n })}\n \n \n )}\n {condition?.cid === \"contact_attribute\" && (\n
\n \n \n {contactForm?.formItems?.map((res) => {\n return {res?.key};\n })}\n \n \n \n \n \n
\n )}\n\n
\n {deleteLastCondition && (\n deleteLastCondition()}\n style={{ width: 150 }}\n >\n cancel\n \n )}\n \n Save Condition\n \n
\n
\n
\n
\n );\n};\n\nexport default CustomForm;\n","import React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CXDivider } from \"component/Divider\";\nimport CustomForm from \"./CustomForm\";\nimport { addOperatorType, operatorType } from \"./utils\";\nimport {\n ArrowRightOutlined,\n DeleteFilled,\n PlusCircleOutlined,\n} from \"@ant-design/icons\";\nimport { useParams } from \"react-router-dom\";\nimport {\n createCampaignStep,\n createCampaignStepCloned,\n updateCampaignStep,\n updateCampaignStepCloned,\n} from \"action/CampaignAction\";\nimport {\n CAMPAIGN_UPDATE_DATA,\n CAMPAIGN_UPDATE_SIDEBAR,\n WAIT_FOR_CAMPAIGN_RESPONSE,\n} from \"constant\";\n\nconst CustomCondition = ({ fData, update }) => {\n const dispatch = useDispatch();\n let { edit } = useParams();\n const [conditionList, setConditionList] = useState([]);\n const { CampaignStepsConditions } = useSelector(\n (state) => state.CampaignReducer\n );\n const SetData = (data) => {\n setConditionList([...conditionList, data]);\n };\n const addOperator = (data) => {\n setConditionList([...conditionList, { operator: data }]);\n };\n const SaveCondition = () => {\n if (conditionList?.length > 0) {\n let obj = {\n type: \"condition\",\n wfId: edit,\n parentId: fData.source,\n condition: conditionList,\n };\n if (update) {\n const { parentId, ...rest } = obj;\n if (window.location.href.includes(\"openings\")) {\n dispatch(updateCampaignStepCloned(update._id, rest));\n } else {\n dispatch(updateCampaignStep(update._id, rest));\n }\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: {} });\n } else {\n if (window.location.href.includes(\"openings\")) {\n dispatch(createCampaignStepCloned(obj));\n } else {\n dispatch(createCampaignStep(obj));\n }\n }\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: true });\n fData?.hide();\n }\n };\n const deleteCondition = (index) => {\n // function will delete the condition and operator\n if (conditionList[index + 1]?.operator) {\n let arr = [...conditionList];\n arr.splice(index, 2);\n setConditionList(arr);\n } else {\n let arr = [...conditionList];\n arr.splice(index, 1);\n setConditionList(arr);\n }\n };\n const deleteLastCondition = () => {\n // function will delete the last condition and previous operator\n if (conditionList[conditionList?.length - 1]?.operator) {\n let arr = [...conditionList];\n arr.splice(conditionList?.length - 1, 1);\n setConditionList(arr);\n }\n };\n useEffect(() => {\n if (update?.cIds?.length > 0) {\n setConditionList(update.cIds);\n }\n }, [update]);\n return (\n
\n {conditionList?.length === 0 && (\n SetData(data)}\n conditionList={conditionList}\n />\n )}\n
\n {conditionList?.map((res, index) => {\n if (res.q) {\n return (\n
\n
\n deleteCondition(index)}\n style={{ color: \"#dc3545\", fontSize: 17 }}\n />\n
\n
\n IF\n \n {\n CampaignStepsConditions?.data.find(\n (obj) => obj.cid === res?.q\n )?.cname\n }\n \n {operatorType[res?.operator]}{\" \"}\n {res.q === \"contact_tag\" ? res?.key : res?.value}\n {[\"hours\", \"days\"].includes(res?.unit) && ` ${res?.unit}`}\n
\n
\n );\n } else {\n return (\n \n {res?.operator.toUpperCase()}\n \n );\n }\n })}\n
\n\n {conditionList?.length > 0 &&\n !conditionList[conditionList?.length - 1]?.q && (\n SetData(data)}\n deleteLastCondition={deleteLastCondition}\n conditionList={conditionList}\n />\n )}\n {conditionList?.length > 0 &&\n conditionList[conditionList?.length - 1]?.q &&\n CampaignStepsConditions?.data.find(\n (data) => data?.cid === conditionList[conditionList?.length - 1]?.q\n )?.allowOperator && (\n \n \n {conditionList[conditionList?.length - 2]?.operator\n ? Object.keys(addOperatorType).map((res) => {\n if (\n conditionList[conditionList?.length - 2]?.operator ===\n res\n ) {\n return (\n addOperator(res)}>\n {addOperatorType[res]}\n \n );\n }\n })\n : Object.keys(addOperatorType).map((res) => {\n return (\n addOperator(res)}>\n {addOperatorType[res]}\n \n );\n })}\n \n }\n >\n
\n \n Add more Conditions\n
\n \n
\n )}\n {conditionList?.length > 0 &&\n conditionList[conditionList?.length - 1]?.q && (\n
\n SaveCondition()}\n >\n Save All Conditions\n \n
\n )}\n
\n );\n};\n\nexport default CustomCondition;\n","export const operatorType = {\n eq: \"Equal to\",\n gt: \"Greater than\",\n lt: \"Less than\",\n gte: \"Greater than or equal to\",\n lte: \"Less than or equal to\",\n};\n\nexport const addOperatorType = {\n and: \"AND\",\n or: \"OR\",\n};\n","import { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState } from \"react\";\nimport { Form } from \"antd\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { useDispatch } from \"react-redux\";\nimport {\n createCampaignStep,\n createCampaignStepCloned,\n updateCampaignStep,\n updateCampaignStepCloned,\n} from \"action/CampaignAction\";\nimport { useParams } from \"react-router-dom\";\nimport {\n CAMPAIGN_UPDATE_DATA,\n CAMPAIGN_UPDATE_SIDEBAR,\n WAIT_FOR_CAMPAIGN_RESPONSE,\n} from \"constant\";\nimport { CXHourPicker } from \"component/DatePicker\";\nimport * as moment from \"moment-timezone\";\n\nconst CustomDelay = ({ fData, update }) => {\n const dispatch = useDispatch();\n let { edit } = useParams();\n const [form] = Form.useForm();\n const [selected, setselected] = useState(null);\n const onFinish = (values) => {\n const { rangeStart, ...rest } = values;\n let obj = {\n type: \"delay\",\n wfId: edit,\n parentId: fData?.source,\n timeUnit: \"hours\",\n rangeStart: parseInt(moment(rangeStart).format(\"HH\")),\n ...rest,\n };\n if (update) {\n const { parentId, rangeStart, ...rest } = obj;\n rest.rangeStart = parseInt(moment(rangeStart).format(\"HH\"));\n if (window.location.href.includes(\"openings\")) {\n dispatch(updateCampaignStepCloned(update._id, rest));\n } else {\n dispatch(updateCampaignStep(update._id, rest));\n }\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: {} });\n } else {\n if (window.location.href.includes(\"openings\")) {\n dispatch(createCampaignStepCloned(obj));\n } else {\n dispatch(createCampaignStep(obj));\n }\n }\n dispatch({ type: WAIT_FOR_CAMPAIGN_RESPONSE, data: true });\n form?.resetFields();\n fData?.hide();\n };\n const timeCalculate = (data) => {\n return (parseInt(data) % (60 * 24)) / 60;\n };\n const dayCalculate = (data) => {\n return parseInt(parseInt(data) / (60 * 24));\n };\n useEffect(() => {\n if (update) {\n setselected(update?.delayType);\n form?.setFieldsValue({\n delayType: update?.delayType,\n timeUnit: update?.timeUnit,\n });\n if (update?.delayType === \"simple\") {\n form?.setFieldsValue({\n value: update?.value,\n });\n }\n if (update?.delayType === \"range\") {\n form?.setFieldsValue({\n rangeStart: timeCalculate(update?.rangeStart),\n rangeEnd: timeCalculate(update?.rangeEnd),\n });\n }\n if (update?.delayType === \"fixed\") {\n form?.setFieldsValue({\n rangeStart: moment(`${timeCalculate(update?.value)}`, \"h a\"),\n value: dayCalculate(update?.value),\n });\n }\n }\n }, [update]);\n return (\n \n \n setselected(val)}>\n Simple\n Fixed\n {/* Range */}\n \n \n {selected === \"simple\" && (\n \n \n Hours\n \n \n )}\n {selected === \"simple\" && (\n \n \n \n )}\n {selected === \"fixed\" && (\n <>\n \n \n {[...Array(10).keys()].map((item) => {\n return (\n \n {\" \"}\n {item === 0\n ? \"Today\"\n : item === 1\n ? \"Tomorrow\"\n : `After ${item} days`}\n \n );\n })}\n \n \n \n \n \n \n )}\n {/* un comment range if option unlocked */}\n {/* {selected === \"range\" && (\n
\n \n \n {[...Array(10).keys()].map((item) => {\n return (\n {item + 1 + \" \" + \"day\"}\n );\n })}\n \n \n \n \n {[...Array(24).keys()].map((item) => {\n return {item + 1};\n })}\n \n \n \n \n {[...Array(24).keys()].map((item) => {\n return {item + 1};\n })}\n \n \n
\n )} */}\n \n \n Save\n \n \n
\n );\n};\n\nexport default CustomDelay;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ReactComponent as ActionIcon } from \"../Assets/thunder.svg\";\nimport ViewTemplate from \"../Helper/ViewTemplate\";\nimport NodeContainer from \"./NodeContainer\";\nimport { languageOptions } from \"utils/languageList\";\nimport { truncateSt } from \"utils\";\nconst ActionNode = ({ data, type, id }) => {\n const [dataT, setDataT] = useState(null);\n const [error, setError] = useState(false);\n const [errorDesc, setErrorDesc] = useState(false);\n const { templates } = useSelector((state) => state.TemplateReducer);\n const { EmailTemplates } = useSelector((state) => state.TemplateReducer);\n const [EmailData, setEmailData] = useState(null);\n // let d = templates?.data?.find((item) => item._id === data.templateId);\n let d = data.template[0];\n\n useEffect(() => {\n let obj = {\n category: d?.category,\n actionType: d?.actionType,\n templateName: d?.templateName,\n language: d?.language,\n header: {\n type: d?.header?.type,\n link: d?.header?.link,\n },\n body: d?.body,\n footer: d?.footer,\n\n action: d?.action,\n variable: d?.exampleVariable,\n };\n if (d) {\n setDataT(obj);\n } else {\n setError(true);\n setErrorDesc(\n \"Template not Preset. It may either be deleted or not available.\"\n );\n }\n //d && setDataT(obj);\n }, [d]);\n useEffect(() => {\n if (data.md === \"email\") {\n let emailData = EmailTemplates?.data?.find(\n (item) => item._id === data.emailTemplateId\n );\n if (emailData) {\n setEmailData(emailData);\n } else {\n setError(true);\n setErrorDesc(\n \"Template not Preset. It may either be deleted or not avaialble.\"\n );\n }\n }\n }, [EmailTemplates]);\n return (\n \n \n \n {type.charAt(0).toUpperCase() + type.slice(1)} :{\" \"}\n {data?.md === \"whatsapp\" && \"Send WhatsApp Message\"}\n {data?.md === \"email\" && \"Send Email\"}\n {data?.md === \"sms\" && \"Send SMS\"}\n {data.actionType === \"tag\" && \"Connected tags\"}\n \n
\n {d?.name}{\" \"}\n {d?.language &&\n `(${\n languageOptions.find((res) => res?.value === d.language)?.label\n })`}\n
\n {d?.name && data?.md === \"whatsapp\" && (\n \n )}\n {d?.name && data?.md === \"sms\" && (\n \n )}\n {data.md === \"email\" && EmailData && (\n
\n
{truncateSt(EmailData?.subject)}
\n \n
\n )}\n {data.actionType === \"tag\" && data?.tags?.length > 0 && (\n
\n Connected Tags\n
\n {data?.tags?.map((tag, index) => (\n \n {tag}\n \n ))}\n
\n
\n )}\n
\n );\n};\nexport default ActionNode;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { ArrowRightOutlined } from \"@ant-design/icons\";\nimport { operatorType } from \"../CampEdge/CustomCondtions/utils\";\nimport { CXDivider } from \"component/Divider\";\nimport { ReactComponent as ConditionIcon } from \"../Assets/condition.svg\";\nimport NodeContainer from \"./NodeContainer\";\nconst ConditionNode = ({ data, type, id }) => {\n const { CampaignStepsConditions } = useSelector(\n (state) => state.CampaignReducer\n );\n return (\n \n
\n \n \n {type.charAt(0).toUpperCase() + type.slice(1)}\n \n
\n
\n {data?.cIds?.map((res, index) => {\n if (res.q) {\n return (\n
\n
\n IF\n \n {\n CampaignStepsConditions?.data?.find(\n (obj) => obj.cid === res?.q\n )?.cname\n }\n \n {res.q === \"contact_attribute\" && res.key}{\" \"}\n {operatorType[res?.operator]}{\" \"}\n {res.q === \"contact_tag\" ? res?.key : res?.value}\n {[\"hours\", \"days\"].includes(res?.unit) && ` ${res?.unit}`}\n
\n
\n );\n } else {\n return (\n \n {res?.operator.toUpperCase()}\n \n );\n }\n })}\n
\n
\n );\n};\n\nexport default ConditionNode;\n","import React from \"react\";\nimport { ReactComponent as DelayIcon } from \"../Assets/sandClock.svg\";\nimport * as moment from \"moment-timezone\";\nimport NodeContainer from \"./NodeContainer\";\nconst DelayNode = ({ data, type, id }) => {\n const timeCalculate = (data) => {\n return (parseInt(data) % (60 * 24)) / 60;\n };\n const dayCalculate = (data) => {\n return parseInt(parseInt(data) / (60 * 24));\n };\n return (\n \n
\n \n \n {type?.charAt(0)?.toUpperCase() + type?.slice(1)} :{\" \"}\n {data?.delayType?.charAt(0).toUpperCase() + data?.delayType?.slice(1)}\n \n
\n Delays the next step by \n {data.delayType === \"simple\" && {data.value} hour}\n {data.delayType === \"fixed\" && (\n \n {dayCalculate(data?.value)} day at{\" \"}\n {moment(`${timeCalculate(data?.value)}`, \"h a\").format(\"h a\")}\n \n )}\n
\n );\n};\n\nexport default DelayNode;\n","import React from \"react\";\nimport { Handle } from \"reactflow\";\nconst EndNode = ({ data, type, id }) => {\n return (\n \n \n
\n
End of Automation
\n
\n \n );\n};\n\nexport default EndNode;\n","var _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgDeleteicon(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 17,\n viewBox: \"0 0 16 17\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.7\n }, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.84926 16.8204H11.1508C12.4711 16.8186 13.5629 15.7915 13.6452 14.4737L14.359 3.11784C14.3704 2.94764 14.3106 2.78037 14.1939 2.65593C14.0773 2.53149 13.9142 2.46105 13.7436 2.46143H2.25644C2.08435 2.46547 1.92136 2.53956 1.80516 2.66656C1.69241 2.78905 1.63332 2.95154 1.64105 3.11784L2.38772 14.4737C2.46905 15.779 3.54164 16.8015 4.84926 16.8204ZM3.57746 14.3999L2.94567 3.6922L13.0872 3.73322L12.4226 14.3999C12.3754 15.0682 11.8208 15.587 11.1508 15.5896H4.84926C4.1777 15.591 3.62079 15.0701 3.57746 14.3999Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.3846 3.6922H0.615385C0.275517 3.6922 0 3.41668 0 3.07681C0 2.73694 0.275517 2.46143 0.615385 2.46143H15.3846C15.7245 2.46143 16 2.73694 16 3.07681C16 3.41668 15.7245 3.6922 15.3846 3.6922Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M5.53848 3.69231H10.4616C10.7996 3.68789 11.0725 3.41494 11.0769 3.07692V1.64103C11.0772 0.750495 10.3672 0.0222632 9.47694 0H6.5231C5.64854 0.0216036 4.9447 0.725449 4.9231 1.6V3.07692C4.92751 3.41494 5.20046 3.68789 5.53848 3.69231ZM9.84617 2.46154H6.15386V1.64103C6.15386 1.43711 6.31918 1.27179 6.5231 1.27179H9.47694C9.68086 1.27179 9.84617 1.43711 9.84617 1.64103V2.46154Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.4616 13.5385C10.1236 13.5341 9.85061 13.2612 9.84619 12.9231V6.35904C9.84619 6.01917 10.1217 5.74365 10.4616 5.74365C10.8014 5.74365 11.077 6.01917 11.077 6.35904V12.9231C11.0725 13.2612 10.7996 13.5341 10.4616 13.5385Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.53848 13.5385C5.20046 13.5341 4.92751 13.2612 4.9231 12.9231V6.35904C4.9231 6.01917 5.19861 5.74365 5.53848 5.74365C5.87835 5.74365 6.15386 6.01917 6.15386 6.35904V12.9231C6.14945 13.2612 5.8765 13.5341 5.53848 13.5385Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.99991 13.5385C7.66189 13.5341 7.38894 13.2612 7.38452 12.9231V6.35904C7.38452 6.01917 7.66004 5.74365 7.99991 5.74365C8.33977 5.74365 8.61529 6.01917 8.61529 6.35904V12.9231C8.61087 13.2612 8.33793 13.5341 7.99991 13.5385Z\",\n fill: \"black\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgDeleteicon);\nexport default __webpack_public_path__ + \"static/media/deleteicon.c1cd03cd1dabb34ee6ec241d1dd17d37.svg\";\nexport { ForwardRef as ReactComponent };","import React from \"react\";\nimport { delCampaignStep, delCampaignStepCloned } from \"action/CampaignAction\";\nimport { CAMPAIGN_UPDATE_DATA, CAMPAIGN_UPDATE_SIDEBAR } from \"constant\";\nimport { Handle } from \"reactflow\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { ReactComponent as DEl } from \"../Assets/deleteicon.svg\";\nimport { useParams } from \"react-router-dom\";\nimport { EditOutlined } from \"@ant-design/icons\";\n\nconst NodeContainer = (props) => {\n const { data, id } = props;\n let view = useParams().id;\n const dispatch = useDispatch();\n const { CampaignById } = useSelector((state) => state.CampaignReducer);\n const mfwAllowed = useSelector((state) => state.dittoAdminReducer.mfwAllowed);\n const Checkdata = () => {\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: false });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: data });\n };\n const deleteNode = (e) => {\n e.stopPropagation();\n dispatch(delCampaignStep(id));\n if (window.location.href.includes(\"openings\")) {\n dispatch(delCampaignStepCloned(id));\n } else {\n dispatch(delCampaignStep(id));\n }\n };\n\n return (\n \n \n \n {CampaignById?.data?.wfType === \"cwf\" && (\n
\n {view !== \"planStatus\" && CampaignById.data?.status !== \"enabled\" && (\n
\n Checkdata()} className=\"mr-2\" />\n deleteNode(e)} style={{ height: 14 }} />\n
\n )}\n
\n )}\n
{props.children}
\n \n );\n};\n\nexport default NodeContainer;\n","var _g, _g2, _g3, _g4, _g5, _g6, _g7, _g8, _g9, _g10, _g11, _g12, _g13, _g14, _g15;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgCal(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 128.5 128.5\",\n style: {\n enableBackground: \"new 0 0 128.5 128.5\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"g\", {\n id: \"_x31_4\"\n }, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"circle\", {\n style: {\n fill: \"#EF8D6F\"\n },\n cx: 64.25,\n cy: 64.25,\n r: 64.25\n })), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n style: {\n fill: \"#F2F2F2\"\n },\n d: \"M87.805,28.975h0.618c7.083,0,12.878,5.795,12.878,12.879v48.345 c0,7.083-5.796,12.879-12.878,12.879h-0.618V47.287c2.704,0,4.896-2.192,4.896-4.896c0-2.703-2.191-4.895-4.896-4.895 C87.805,37.496,87.805,28.975,87.805,28.975z M40.696,28.975h47.109v8.521h-0.001c-2.703,0-4.896,2.192-4.896,4.895 c0,2.704,2.193,4.896,4.896,4.896h0.001v55.791H40.696V47.287c2.703,0,4.896-2.192,4.896-4.896c0-2.703-2.192-4.895-4.896-4.895 V28.975z M40.079,28.975h0.617v8.521c-2.704,0-4.896,2.192-4.896,4.895c0,2.704,2.192,4.896,4.896,4.896v55.791h-0.617 c-7.084,0-12.88-5.797-12.88-12.879V41.854C27.199,34.77,32.995,28.975,40.079,28.975z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n style: {\n fill: \"#AFAFAF\"\n },\n d: \"M40.696,25.422L40.696,25.422c1.046,0,1.902,0.856,1.902,1.902v13.165 c0,1.046-0.856,1.902-1.902,1.902h-0.001c-1.047,0-1.902-0.856-1.902-1.902V27.324C38.794,26.278,39.65,25.422,40.696,25.422z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n style: {\n fill: \"#AFAFAF\"\n },\n d: \"M87.805,25.422L87.805,25.422c1.047,0,1.902,0.856,1.902,1.902v13.165 c0,1.046-0.855,1.902-1.902,1.902h-0.001c-1.047,0-1.903-0.856-1.903-1.902V27.324C85.902,26.278,86.758,25.422,87.805,25.422z\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 27.199,\n y: 50.675,\n style: {\n fill: \"#FABB18\"\n },\n width: 74.102,\n height: 3.107\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 53.236,\n y: 59.304,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 38.199,\n y: 58.954,\n style: {\n fill: \"#C9675B\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 68.727,\n y: 59.304,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 83.088,\n y: 59.304,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 53.586,\n y: 72.996,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 69.077,\n y: 72.996,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 83.088,\n y: 73.346,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 53.586,\n y: 87.327,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.439\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 38.373,\n y: 72.996,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.453\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 38.373,\n y: 87.327,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.439\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 68.727,\n y: 87.677,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.439\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 83.088,\n y: 87.677,\n style: {\n fill: \"#EFCB6C\"\n },\n width: 9.584,\n height: 8.439\n }))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", null)), _g2 || (_g2 = /*#__PURE__*/React.createElement(\"g\", null)), _g3 || (_g3 = /*#__PURE__*/React.createElement(\"g\", null)), _g4 || (_g4 = /*#__PURE__*/React.createElement(\"g\", null)), _g5 || (_g5 = /*#__PURE__*/React.createElement(\"g\", null)), _g6 || (_g6 = /*#__PURE__*/React.createElement(\"g\", null)), _g7 || (_g7 = /*#__PURE__*/React.createElement(\"g\", null)), _g8 || (_g8 = /*#__PURE__*/React.createElement(\"g\", null)), _g9 || (_g9 = /*#__PURE__*/React.createElement(\"g\", null)), _g10 || (_g10 = /*#__PURE__*/React.createElement(\"g\", null)), _g11 || (_g11 = /*#__PURE__*/React.createElement(\"g\", null)), _g12 || (_g12 = /*#__PURE__*/React.createElement(\"g\", null)), _g13 || (_g13 = /*#__PURE__*/React.createElement(\"g\", null)), _g14 || (_g14 = /*#__PURE__*/React.createElement(\"g\", null)), _g15 || (_g15 = /*#__PURE__*/React.createElement(\"g\", null)));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgCal);\nexport default __webpack_public_path__ + \"static/media/cal.19ae12d8da1a8dcafa1312745d9eb77d.svg\";\nexport { ForwardRef as ReactComponent };","import React from \"react\";\nimport { Handle } from \"reactflow\";\nimport { ReactComponent as Cal } from \"../Assets/cal.svg\";\nconst StartNode = ({ data, type, id }) => {\n return (\n
\n \n \n
\n
\n {data?.triggerType?.charAt(0)?.toUpperCase() +\n data?.triggerType?.slice(1)}{\" \"}\n Campaign\n
\n
\n
\n );\n};\n\nexport default StartNode;\n","import { CXButton } from \"component/Button\";\nimport { CXDatePicker, CXHourPicker } from \"component/DatePicker\";\nimport { CXInput, CXInputNumber, CXTextArea } from \"component/Input\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXMenu, CXSubMenu } from \"component/Menu\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTitle } from \"component/Typography\";\nimport * as moment from \"moment-timezone\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport history from \"utils/history\";\nimport { CXTag } from \"component/Tag\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Form, message } from \"antd\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n createCampaigns,\n getCampaignByID,\n updateCampaigns,\n} from \"action/CampaignAction\";\nimport { getContGrpTrigger, getContactForm } from \"action/ContactAction\";\nimport { Link, useParams } from \"react-router-dom\";\nimport { CXInputSkeleton } from \"component/Skeleton\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { getStore } from \"action/AdminActions\";\nimport {\n getCandidateStageTrigger,\n getOpenPositionsTrigger,\n} from \"action/OpeningsAction\";\n// import PhoneInput from \"react-phone-number-input/input\";\nimport { PlusCircleOutlined } from \"@ant-design/icons\";\n\nconst CampaignCreate = ({ cancel = true, backTomain, sq = null }) => {\n let { id, edit, openingsId } = useParams();\n\n if (sq) {\n id = sq;\n }\n const dispatch = useDispatch();\n const [ShowAdvance, setShowAdvance] = useState(false);\n const [ondemandCheck, setondemandCheck] = useState(false);\n const [EventType, setEventType] = useState(false);\n const [SubType, setSubType] = useState(null);\n const { CampaignById, loading } = useSelector(\n (state) => state.CampaignReducer\n );\n const { openPositions } = useSelector((state) => state.OpeningReducer);\n const { StoreData } = useSelector((state) => state.AdminReducer);\n const { candidateFilterStage } = useSelector((state) => state.OpeningReducer);\n const [intTime, setintTime] = useState(null);\n const [cst, setcst] = useState(0);\n const [form] = Form.useForm();\n const { contactForm, loading: cload } = useSelector(\n (state) => state.ContactReducer\n );\n const [aVal, setaVal] = useState([]);\n const onFinish = (values) => {\n const {\n triggerTime,\n triggerType,\n officeHourStart,\n officeHourEnd,\n event,\n sVal,\n inT,\n cst,\n // targetGroup,\n ...rest\n } = values;\n let faVal = aVal.filter((res) => res.key !== \"\" && res.value !== \"\");\n rest.trigger = {\n type: triggerType,\n event,\n aVal: faVal,\n sVal,\n triggerTime: moment(triggerTime),\n nVal: inT === \"custom\" ? cst : inT,\n };\n rest.officeHourStart = parseInt(moment(officeHourStart).format(\"HH\"));\n rest.officeHourEnd = parseInt(moment(officeHourEnd).format(\"HH\"));\n // if (targetGroup) {\n // rest.targetGroup = [targetGroup];\n // }\n if (openingsId) {\n rest.openingId = openingsId;\n }\n if (edit) {\n dispatch(updateCampaigns(CampaignById.data._id, rest));\n } else {\n dispatch(createCampaigns(rest));\n }\n form.resetFields();\n if (cancel) {\n history.push(`/admin/campaign/list`);\n } else {\n setTimeout(() => {\n backTomain();\n }, 1000);\n }\n };\n useEffect(() => {\n dispatch(getContGrpTrigger());\n dispatch(getOpenPositionsTrigger());\n dispatch(getStore(true));\n dispatch(getCandidateStageTrigger());\n }, []);\n useEffect(() => {\n if (edit) {\n dispatch(getCampaignByID(edit));\n }\n }, []);\n console.log(intTime, cst);\n useEffect(() => {\n let data = CampaignById.data;\n if (data && id === \"edit\") {\n setShowAdvance(data.respectOfficeHours);\n setEventType(data?.trigger?.type === \"event\" ? true : false);\n setondemandCheck(data?.trigger?.type === \"ondemand\" ? true : false);\n setSubType(data?.trigger?.event);\n setaVal(data?.trigger?.aVal ?? []);\n const optionValues = [0.25, 0.5, 1, 2, 8, 12, 24];\n if (optionValues.includes(data?.trigger?.nVal)) {\n setintTime(data?.trigger?.nVal);\n } else {\n setcst(data?.trigger?.nVal);\n }\n if (data?.trigger?.type)\n form.setFieldsValue({\n name: data.name,\n event: data?.trigger?.event,\n triggerType: data?.trigger?.type,\n nVal: data?.trigger?.nVal,\n sVal: data?.trigger?.sVal,\n triggerTime: moment(data?.trigger?.triggerTime),\n timeZone: data.timeZone,\n inT: data?.trigger?.nVal,\n cst: data?.trigger?.nVal,\n // targetGroup: data.targetGroup[0],\n respectOfficeHours: data.respectOfficeHours,\n officeHourStart: moment(`${data?.officeHourStart}`, \"h a\"),\n officeHourEnd: moment(`${data?.officeHourEnd}`, \"h a\"),\n onOutOfOfficeHour: data.onOutOfOfficeHour,\n store: data.store,\n openingId: data.openingId,\n });\n }\n }, [CampaignById]);\n const getEventString = () => {\n if (SubType === \"no_order\") {\n return `This workflow runs to drive repeat sales for your store when your user hasn’t placed an order in a certain number of days.`;\n }\n if (SubType === \"contact_created\") {\n return `This workflow will run whenever a new contact created in the system.`;\n }\n if (SubType === \"contact_updated\") {\n return `This workflow will run whenever a new contact updated in the system.`;\n }\n if (SubType === \"abandoned_cart\") {\n return (\n
\n Run this workflow when the user has abandoned his cart on my shopify\n store. Please make sure that your Shopify store is connected with your\n Zipnip account. To check this please{\" \"}\n Click Here\n
\n );\n }\n };\n useEffect(() => {\n if (SubType === \"contact_updated\") {\n dispatch(getContactForm());\n }\n }, [SubType]);\n\n const updateaVal = (key, value) => {\n let arr = [...aVal];\n let index = arr.findIndex((res) => res.key === key);\n if (index > -1) {\n arr[index].value = value;\n } else {\n arr.push({ key, value });\n }\n setaVal(arr);\n };\n const updateaKey = (index, value) => {\n let arr = [...aVal];\n arr[index].key = value;\n setaVal(arr);\n };\n\n return (\n
\n \n \n {edit\n ? sq\n ? \"Update Sequence\"\n : \"Update Campaign\"\n : sq\n ? \"Create Sequence\"\n : \"Create Campaign\"}\n \n
\n {cancel && (\n history.goBack()}\n >\n Cancel\n \n )}\n {\n form\n .validateFields()\n .then((values) => {\n onFinish(values);\n })\n .catch((info) => {\n console.log(\"Validate Failed:\");\n });\n }}\n >\n {edit ? \"Update\" : \"Create\"}\n \n
\n
\n {edit && loading && (\n
\n {[...Array(10)].map((res) => {\n return (\n
\n \n
\n );\n })}\n \n
\n )}\n\n {!loading && (\n \n
\n \n \n \n \n {\n setondemandCheck(val === \"ondemand\" ? true : false);\n setEventType(val === \"event\" ? true : false);\n setSubType(null);\n }}\n >\n Date and Time\n On-demand\n Event\n \n \n {EventType && (\n \n \n {\n setSubType(val);\n }}\n >\n Contact Created\n Contact Updated\n \n Interview Reminder\n \n \n Candidate Stage Change\n \n \n Interview Scheduled\n \n Resume Received\n \n \n {SubType && getEventString() && (\n \n )}\n {SubType === \"candidateStageChange\" && (\n \n \n {candidateFilterStage?.data?.map((res) => {\n return {res.name};\n })}\n \n \n )}\n \n )}\n {/* \n \n {openPositions?.data?.map((res) => {\n return {res.positionName};\n })}\n \n */}\n {SubType === \"abandoned_cart\" && EventType && (\n \n \n {StoreData.map((res) => {\n return (\n \n {res.title} - {res.description}\n \n );\n })}\n \n \n )}\n {SubType === \"no_order\" && EventType && (\n \n \n \n )}\n {SubType === \"contact_updated\" && EventType && (\n
\n \n\n \n {/* {contactForm?.formItems?.map(\n ({\n key,\n name,\n lebel,\n placeholder,\n required,\n element,\n type,\n elementOptions,\n ...restField\n }) => {\n if (restField?.isActive) {\n switch (type) {\n case \"text\":\n case \"email\":\n case \"notes\":\n case \"textArea\":\n case \"phone\":\n return (\n
\n {\" \"}\n
\n
\n {lebel}\n
\n
\n res.key === key)\n ?.value\n }\n onChange={(e) => {\n updateaVal(key, e.target.value);\n }}\n // placeholder={placeholder}\n className=\"inputStyle w-100\"\n />\n
\n
\n
\n );\n case \"select\":\n return (\n
\n {\" \"}\n
\n
\n {\" \"}\n \n {lebel}\n
\n
\n res.key === key)\n ?.value\n }\n className=\"SelectType\"\n placeholder={placeholder}\n onChange={(val) => {\n updateaVal(key, val);\n }}\n >\n {elementOptions?.map((res) => {\n return (\n {res}\n );\n })}\n \n
\n
\n
\n );\n default:\n // Handle any other cases here\n }\n }\n }\n )} */}\n
\n {\n setaVal([...aVal, { key: \"\", value: \"\" }]);\n }}\n >\n \n Add Contact fields to watch\n \n
\n {aVal?.map((res, i) => {\n return (\n
\n
\n
\n \"icon\"\n {\n updateaKey(i, val);\n }}\n >\n {contactForm?.formItems?.map((d) => {\n if (!aVal?.find((r) => r.key === d.key)) {\n return (\n {d.key}\n );\n }\n })}\n \n
\n
\n {[\n \"text\",\n \"email\",\n \"notes\",\n \"textArea\",\n \"phone\",\n ].includes(\n contactForm?.formItems.find(\n (k) => k.key === res.key\n )?.type\n ) && (\n r.key === res.key)?.value\n }\n onChange={(e) => {\n updateaVal(res.key, e.target.value);\n }}\n // placeholder={placeholder}\n className=\"inputStyle w-100\"\n />\n )}\n {[\"select\"].includes(\n contactForm?.formItems.find(\n (k) => k.key === res.key\n )?.type\n ) && (\n r.key === res.key)?.value\n }\n className=\"SelectType\"\n onChange={(val) => {\n updateaVal(res.key, val);\n }}\n >\n {contactForm?.formItems\n .find((k) => k.key === res.key)\n ?.elementOptions?.map((res) => {\n return (\n {res}\n );\n })}\n \n )}\n
\n
\n {\n let arr = [...aVal];\n let temp = arr.filter((r) => r.key !== res.key);\n setaVal(temp);\n }}\n />\n
\n
\n
\n );\n })}\n
\n
\n )}\n {!ondemandCheck &&\n !EventType &&\n SubType !== \"interview_reminder\" && (\n \n {\n return current && current < moment().endOf(\"day\");\n }}\n />\n \n )}\n {SubType === \"interview_reminder\" && (\n \n setintTime(v)}\n >\n 15 minutes before\n 30 minutest before\n 1 hour before\n 2 hours before\n 8 hours before\n 12 hours before\n 24 hours before\n Custom\n \n \n )}\n {intTime === \"custom\" && (\n \n setcst(v)}\n className=\"w-100 mt-2 br-4 inputSt\"\n placeholder={\"Add days\"}\n min={0}\n />\n \n )}\n \n \n {moment?.tz?.names()?.map((tz) => {\n return (\n \n {tz}\n \n );\n })}\n \n \n {/* {!EventType && (\n \n \n {grpList?.data?.map((grp) => {\n return (\n \n {grp.name}\n \n );\n })}\n \n \n )} */}\n \n {\n setShowAdvance(val);\n }}\n >\n Yes\n No\n \n \n {ShowAdvance && (\n \n
\n Advanced options Optional\n
\n \n \n \n \n \n \n \n \n Schedule the next day\n Send on the same day\n \n \n
\n )}\n
\n \n )}\n \n );\n};\n\nexport default CampaignCreate;\n","import { getStore } from \"action/AdminActions\";\nimport { createCampaigns } from \"action/CampaignAction\";\nimport useFormInstance from \"antd/lib/form/hooks/useFormInstance\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\n\nconst CampaignCreateEvent = () => {\n let { edit } = useParams();\n const dispatch = useDispatch();\n const SanitizeString = (str) => {\n return str\n .replace(/_/g, \" \")\n .replace(/\\w\\S*/g, (w) => w.replace(/^\\w/, (c) => c.toUpperCase()));\n };\n const initialState = {\n storeId: [],\n name: SanitizeString(edit),\n trigger: {\n type: \"event\",\n event: edit,\n },\n };\n const [Data, setData] = useState(initialState);\n useEffect(() => {\n dispatch(getStore(true));\n }, []);\n const { StoreData } = useSelector((state) => state.AdminReducer);\n const createCampaignTrigger = () => {\n dispatch(createCampaigns(Data));\n setData(initialState);\n history.push(`/admin/campaign/list`);\n };\n return (\n
\n \n \n Create Campaign\n \n
\n {\n history.goBack();\n setData(initialState);\n }}\n >\n Cancel\n \n {Data?.storeId?.length > 0 && (\n {\n createCampaignTrigger();\n }}\n >\n Create\n \n )}\n
\n
\n
\n
Select your Store
\n
\n {StoreData &&\n StoreData.map((item, index) => {\n return (\n \n setData({\n ...Data,\n storeId: [item._id],\n })\n }\n >\n
\n \n
\n
\n {item.title}\n
\n
{item.description}
\n \n );\n })}\n
\n
\n
\n );\n};\n\nexport default CampaignCreateEvent;\n","import { exportWfPlanDetails, getCampaignsPlans } from \"action/CampaignAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTag } from \"component/Tag\";\nimport { CXTitle } from \"component/Typography\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport \"./style.css\";\nimport { useRouteMatch } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { Pie } from \"react-chartjs-2\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CloudDownloadOutlined, EditFilled } from \"@ant-design/icons\";\nimport { Progress, Space } from \"antd\";\nimport { PermissionCheck } from \"utils\";\n\nconst CampaignPlans = ({ sq }) => {\n const dispatch = useDispatch();\n const { CampaignPlans } = useSelector((state) => state.CampaignReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n let { edit, openingsId } = useParams();\n useEffect(() => {\n dispatch(getCampaignsPlans(edit));\n return () => {\n dispatch({ type: \"GET_CAMPAIGNS_PLANS_RESPONSE\", data: [] });\n };\n }, []);\n const tickColor = {\n enabled: \"#e4b417db\",\n published: \"#e4b417db\",\n draft: \"#C8C8C8\",\n disabled: \"#d00e0edb\",\n completed: \"#73c49a\",\n success: \"#73c49a\",\n cancelled: \"#d00e0edb\",\n };\n const tagStyle = {\n width: 120,\n textAlign: \"center\",\n borderRadius: 8,\n fontWeight: 600,\n fontSize: 14,\n padding: 10,\n };\n const getData = (data) => {\n let waSent = data.waSent ?? 0;\n let waReadCount = data.waReadCount ?? 0;\n return (waReadCount / waSent) * 100;\n };\n const menu = (id) => (\n \n {\n dispatch(exportWfPlanDetails(id));\n }}\n >\n \n {/* */}\n Export details\n \n \n );\n return (\n
\n \n \n Plans\n \n
\n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateSequences\"\n ) && (\n {\n sq\n ? history.push(\n `/admin/openings/${openingsId}/Sequences/view/${edit}`\n )\n : history.push(`/admin/campaign/list/view/${edit}`);\n }}\n >\n Configure\n \n )}\n history.goBack()}>\n Back\n \n
\n
\n {CampaignPlans?.data?.data?.length > 0 && (\n
\n {CampaignPlans?.data?.data.map((res) => {\n return (\n \n history.push(`/admin/campaign/list/planStatus/${res._id}`)\n }\n >\n
\n
\n
{res?.wfId?.name}
\n
\n {moment(res?.createdAt).format(\"LLL\")}\n
\n
\n
\n
\n
Contacts
\n
{res?.targets ?? 0}
\n
\n
\n
Sent
\n
{res?.analytics?.waSent ?? 0}
\n
\n
\n
Read
\n
{res?.analytics?.waReadCount ?? 0}
\n
\n
\n
Clicked
\n
{res?.analytics?.waCLickedCount ?? 0}
\n
\n
\n
\n `${e}%`}\n type=\"circle\"\n percent={Math.floor(getData(res?.analytics))}\n size={\"small\"}\n className=\"wfProgress\"\n />\n
\n
\n
\n
\n \n {res?.status}\n \n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateSequences\"\n ) && (\n \n {\n e.stopPropagation();\n }}\n >\n \n
\n \n
\n \n
\n
\n )}\n
\n \n \n );\n })}\n \n )}\n {CampaignPlans?.data?.data?.length === 0 && (\n
\n ` This campaign hasn't run yet or is not yet published `\n
\n )}\n \n );\n};\n\nexport default CampaignPlans;\n","import React, { memo, useRef } from 'react';\nimport cc from 'classcat';\nimport { useStore } from '@reactflow/core';\nimport { shallow } from 'zustand/shallow';\n\nvar BackgroundVariant;\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n\nfunction LinePattern({ color, dimensions, lineWidth }) {\n return (React.createElement(\"path\", { stroke: color, strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}` }));\n}\nfunction DotPattern({ color, radius }) {\n return React.createElement(\"circle\", { cx: radius, cy: radius, r: radius, fill: color });\n}\n\nconst defaultColor = {\n [BackgroundVariant.Dots]: '#91919a',\n [BackgroundVariant.Lines]: '#eee',\n [BackgroundVariant.Cross]: '#e2e2e2',\n};\nconst defaultSize = {\n [BackgroundVariant.Dots]: 1,\n [BackgroundVariant.Lines]: 1,\n [BackgroundVariant.Cross]: 6,\n};\nconst selector = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });\nfunction Background({ id, variant = BackgroundVariant.Dots, \n// only used for dots and cross\ngap = 20, \n// only used for lines and cross\nsize, lineWidth = 1, offset = 2, color, style, className, }) {\n const ref = useRef(null);\n const { transform, patternId } = useStore(selector, shallow);\n const patternColor = color || defaultColor[variant];\n const patternSize = size || defaultSize[variant];\n const isDots = variant === BackgroundVariant.Dots;\n const isCross = variant === BackgroundVariant.Cross;\n const gapXY = Array.isArray(gap) ? gap : [gap, gap];\n const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];\n const scaledSize = patternSize * transform[2];\n const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;\n const patternOffset = isDots\n ? [scaledSize / offset, scaledSize / offset]\n : [patternDimensions[0] / offset, patternDimensions[1] / offset];\n return (React.createElement(\"svg\", { className: cc(['react-flow__background', className]), style: {\n ...style,\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n }, ref: ref, \"data-testid\": \"rf__background\" },\n React.createElement(\"pattern\", { id: patternId + id, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: \"userSpaceOnUse\", patternTransform: `translate(-${patternOffset[0]},-${patternOffset[1]})` }, isDots ? (React.createElement(DotPattern, { color: patternColor, radius: scaledSize / offset })) : (React.createElement(LinePattern, { dimensions: patternDimensions, color: patternColor, lineWidth: lineWidth }))),\n React.createElement(\"rect\", { x: \"0\", y: \"0\", width: \"100%\", height: \"100%\", fill: `url(#${patternId + id})` })));\n}\nBackground.displayName = 'Background';\nvar Background$1 = memo(Background);\n\nexport { Background$1 as Background, BackgroundVariant };\n","import React, { useState, memo } from \"react\";\nimport CustomAction from \"./CustomAction\";\nimport CustomDelay from \"./CustomDelay\";\nimport CustomCondition from \"./CustomCondtions/CustomCondition\";\nimport { ReactComponent as ActionIcon } from \"../Assets/thunder.svg\";\nimport { ReactComponent as DelayIcon } from \"../Assets/sandClock.svg\";\nimport { ReactComponent as ConditionIcon } from \"../Assets/condition.svg\";\n\nconst CustomSelect = ({ hide, target, source }) => {\n const [SelectedStep, setSelectedStep] = useState(null);\n const Selector = [\n { icon: , name: \"Action\" },\n { icon: , name: \"Delay\" },\n { icon: , name: \"Condition\" },\n ];\n const Options = {\n Action: ,\n Delay: ,\n Condition: ,\n };\n return (\n
\n
\n {Selector.map((item, index) => {\n return (\n setSelectedStep(item.name)}\n >\n
{item.icon}
\n
{item.name}
\n \n );\n })}\n
\n {SelectedStep && (\n
{Options[SelectedStep]}
\n )}\n
\n );\n};\n\nexport default memo(CustomSelect);\n","import { AnyObject, Primitive } from './types';\n\n/**\n * Checks if the value is of a specified type.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType(type: string) {\n // eslint-disable-next-line valid-typeof\n return (value: unknown): value is T => typeof value === type;\n}\n\n/**\n * Checks if the value is a JavaScript function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = isOfType('function');\n\n/**\n * Check if the value is null.\n */\nexport const isNull = (value: unknown): value is null => {\n return value === null;\n};\n\n/**\n * Checks if the input is a regular expression.\n */\nexport const isRegex = (value: unknown): value is RegExp => {\n return Object.prototype.toString.call(value).slice(8, -1) === 'RegExp';\n};\n\n/**\n * Checks if the value is an object.\n */\nexport const isObject = (value: unknown): value is AnyObject => {\n return !isUndefined(value) && !isNull(value) && (isFunction(value) || typeof value === 'object');\n};\n\n/**\n * Checks if the value is undefined.\n */\nexport const isUndefined = isOfType('undefined');\n","import { isObject, isRegex } from './helpers';\n\n/**\n * Check if arrays are equal.\n */\nfunction equalArray(left: unknown[], right: unknown[]) {\n const { length } = left;\n\n if (length !== right.length) {\n return false;\n }\n\n for (let index = length; index-- !== 0; ) {\n if (!equal(left[index], right[index])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Check if array buffers are equal.\n */\nfunction equalArrayBuffer(left: ArrayBufferView, right: ArrayBufferView) {\n if (left.byteLength !== right.byteLength) {\n return false;\n }\n\n const view1 = new DataView(left.buffer);\n const view2 = new DataView(right.buffer);\n\n let index = left.byteLength;\n\n while (index--) {\n if (view1.getUint8(index) !== view2.getUint8(index)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Check if maps are equal.\n */\nfunction equalMap(left: Map, right: Map) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n for (const index of left.entries()) {\n if (!equal(index[1], right.get(index[0]))) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Check if sets are equal.\n */\nfunction equalSet(left: Set, right: Set) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Checks if two values are equal.\n */\nexport default function equal(left: unknown, right: unknown) {\n if (left === right) {\n return true;\n }\n\n if (left && isObject(left) && right && isObject(right)) {\n if (left.constructor !== right.constructor) {\n return false;\n }\n\n if (Array.isArray(left) && Array.isArray(right)) {\n return equalArray(left, right);\n }\n\n if (left instanceof Map && right instanceof Map) {\n return equalMap(left, right);\n }\n\n if (left instanceof Set && right instanceof Set) {\n return equalSet(left, right);\n }\n\n if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right)) {\n return equalArrayBuffer(left, right);\n }\n\n if (isRegex(left) && isRegex(right)) {\n return left.source === right.source && left.flags === right.flags;\n }\n\n if (left.valueOf !== Object.prototype.valueOf) {\n return left.valueOf() === right.valueOf();\n }\n\n if (left.toString !== Object.prototype.toString) {\n return left.toString() === right.toString();\n }\n\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index])) {\n return false;\n }\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n const key = leftKeys[index];\n\n if (key === '_owner' && left.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (!equal(left[key], right[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Number.isNaN(left) && Number.isNaN(right)) {\n return true;\n }\n\n return left === right;\n}\n","/* eslint-disable @typescript-eslint/ban-types */\nimport type { ObjectTypes, Primitive, PrimitiveTypes } from './types';\n\nexport const objectTypes = [\n 'Array',\n 'ArrayBuffer',\n 'AsyncFunction',\n 'AsyncGenerator',\n 'AsyncGeneratorFunction',\n 'Date',\n 'Error',\n 'Function',\n 'Generator',\n 'GeneratorFunction',\n 'HTMLElement',\n 'Map',\n 'Object',\n 'Promise',\n 'RegExp',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n] as const;\n\nexport const primitiveTypes = [\n 'bigint',\n 'boolean',\n 'null',\n 'number',\n 'string',\n 'symbol',\n 'undefined',\n] as const;\n\nexport function getObjectType(value: unknown): ObjectTypes | undefined {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n\n if (/HTML\\w+Element/.test(objectTypeName)) {\n return 'HTMLElement';\n }\n\n if (isObjectType(objectTypeName)) {\n return objectTypeName;\n }\n\n return undefined;\n}\n\nexport function isObjectOfType(type: string) {\n return (value: unknown): value is T => getObjectType(value) === type;\n}\n\nexport function isObjectType(name: unknown): name is ObjectTypes {\n return objectTypes.includes(name as ObjectTypes);\n}\n\nexport function isOfType(type: string) {\n // eslint-disable-next-line valid-typeof\n return (value: unknown): value is T => typeof value === type;\n}\n\nexport function isPrimitiveType(name: unknown): name is PrimitiveTypes {\n return primitiveTypes.includes(name as PrimitiveTypes);\n}\n","/* eslint-disable @typescript-eslint/ban-types */\nimport { getObjectType, isObjectOfType, isOfType, isPrimitiveType } from './helpers';\nimport type { Class, PlainObject, Primitive, TypeName } from './types';\n\nconst DOM_PROPERTIES_TO_CHECK: Array = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue',\n];\n\nfunction is(value: unknown): TypeName {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'bigint':\n return 'bigint';\n case 'boolean':\n return 'boolean';\n case 'number':\n return 'number';\n case 'string':\n return 'string';\n case 'symbol':\n return 'symbol';\n case 'undefined':\n return 'undefined';\n default:\n }\n\n if (is.array(value)) {\n return 'Array';\n }\n\n if (is.plainFunction(value)) {\n return 'Function';\n }\n\n const tagType = getObjectType(value);\n\n if (tagType) {\n return tagType;\n }\n /* c8 ignore next 3 */\n\n return 'Object';\n}\n\nis.array = Array.isArray;\n\nis.arrayOf = (target: unknown[], predicate: (v: unknown) => boolean): boolean => {\n if (!is.array(target) && !is.function(predicate)) {\n return false;\n }\n\n return target.every(d => predicate(d));\n};\n\nis.asyncGeneratorFunction = (value: unknown): value is (...arguments_: any[]) => Promise =>\n getObjectType(value) === 'AsyncGeneratorFunction';\n\nis.asyncFunction = isObjectOfType('AsyncFunction');\n\nis.bigint = isOfType('bigint');\n\nis.boolean = (value: unknown): value is boolean => {\n return value === true || value === false;\n};\n\nis.date = isObjectOfType('Date');\n\nis.defined = (value: unknown): boolean => !is.undefined(value);\n\nis.domElement = (value: unknown): value is HTMLElement => {\n return (\n is.object(value) &&\n !is.plainObject(value) &&\n (value as HTMLElement).nodeType === 1 &&\n is.string((value as HTMLElement).nodeName) &&\n DOM_PROPERTIES_TO_CHECK.every(property => property in (value as HTMLElement))\n );\n};\n\nis.empty = (value: unknown): boolean => {\n return (\n (is.string(value) && value.length === 0) ||\n (is.array(value) && value.length === 0) ||\n (is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0) ||\n (is.set(value) && value.size === 0) ||\n (is.map(value) && value.size === 0)\n );\n};\n\nis.error = isObjectOfType('Error');\n\nis.function = isOfType('function');\n\nis.generator = (value: unknown): value is Generator => {\n return (\n is.iterable(value) &&\n is.function((value as IterableIterator).next) &&\n is.function((value as IterableIterator).throw)\n );\n};\n\nis.generatorFunction = isObjectOfType('GeneratorFunction');\n\nis.instanceOf = (instance: unknown, class_: Class): instance is T => {\n if (!instance || !(class_ as Class)) {\n return false;\n }\n\n return Object.getPrototypeOf(instance) === class_.prototype;\n};\n\nis.iterable = (value: unknown): value is IterableIterator => {\n return (\n !is.nullOrUndefined(value) && is.function((value as IterableIterator)[Symbol.iterator])\n );\n};\n\nis.map = isObjectOfType>('Map');\n\nis.nan = (value: unknown): boolean => {\n return Number.isNaN(value as number);\n};\n\nis.null = (value: unknown): value is null => {\n return value === null;\n};\n\nis.nullOrUndefined = (value: unknown): value is null | undefined => {\n return is.null(value) || is.undefined(value);\n};\n\nis.number = (value: unknown): value is number => {\n return isOfType('number')(value) && !is.nan(value);\n};\n\nis.numericString = (value: unknown): value is string => {\n return is.string(value) && (value as string).length > 0 && !Number.isNaN(Number(value));\n};\n\nis.object = (value: unknown): value is object => {\n return !is.nullOrUndefined(value) && (is.function(value) || typeof value === 'object');\n};\n\nis.oneOf = (target: unknown[], value: any): boolean => {\n if (!is.array(target)) {\n return false;\n }\n\n // eslint-disable-next-line unicorn/prefer-includes\n return target.indexOf(value) > -1;\n};\n\nis.plainFunction = isObjectOfType('Function');\n\nis.plainObject = (value: unknown): value is PlainObject => {\n if (getObjectType(value) !== 'Object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === null || prototype === Object.getPrototypeOf({});\n};\n\nis.primitive = (value: unknown): value is Primitive =>\n is.null(value) || isPrimitiveType(typeof value);\n\nis.promise = isObjectOfType>('Promise');\n\nis.propertyOf = (\n target: PlainObject,\n key: string,\n predicate?: (v: unknown) => boolean,\n): boolean => {\n if (!is.object(target) || !key) {\n return false;\n }\n\n const value = target[key];\n\n if (is.function(predicate)) {\n return predicate(value);\n }\n\n return is.defined(value);\n};\n\nis.regexp = isObjectOfType('RegExp');\n\nis.set = isObjectOfType>('Set');\n\nis.string = isOfType('string');\n\nis.symbol = isOfType('symbol');\n\nis.undefined = isOfType('undefined');\n\nis.weakMap = isObjectOfType>('WeakMap');\n\nis.weakSet = isObjectOfType>('WeakSet');\n\nexport default is;\n","/* eslint-disable @typescript-eslint/ban-types */\nimport type { ObjectTypes, Primitive, PrimitiveTypes } from './types';\n\nexport const objectTypes = [\n 'Array',\n 'ArrayBuffer',\n 'AsyncFunction',\n 'AsyncGenerator',\n 'AsyncGeneratorFunction',\n 'Date',\n 'Error',\n 'Function',\n 'Generator',\n 'GeneratorFunction',\n 'HTMLElement',\n 'Map',\n 'Object',\n 'Promise',\n 'RegExp',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n] as const;\n\nexport const primitiveTypes = [\n 'bigint',\n 'boolean',\n 'null',\n 'number',\n 'string',\n 'symbol',\n 'undefined',\n] as const;\n\nexport function getObjectType(value: unknown): ObjectTypes | undefined {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n\n if (/HTML\\w+Element/.test(objectTypeName)) {\n return 'HTMLElement';\n }\n\n if (isObjectType(objectTypeName)) {\n return objectTypeName;\n }\n\n return undefined;\n}\n\nexport function isObjectOfType(type: string) {\n return (value: unknown): value is T => getObjectType(value) === type;\n}\n\nexport function isObjectType(name: unknown): name is ObjectTypes {\n return objectTypes.includes(name as ObjectTypes);\n}\n\nexport function isOfType(type: string) {\n // eslint-disable-next-line valid-typeof\n return (value: unknown): value is T => typeof value === type;\n}\n\nexport function isPrimitiveType(name: unknown): name is PrimitiveTypes {\n return primitiveTypes.includes(name as PrimitiveTypes);\n}\n","/* eslint-disable @typescript-eslint/ban-types */\nimport { getObjectType, isObjectOfType, isOfType, isPrimitiveType } from './helpers';\nimport type { Class, PlainObject, Primitive, TypeName } from './types';\n\nconst DOM_PROPERTIES_TO_CHECK: Array = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue',\n];\n\nfunction is(value: unknown): TypeName {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'bigint':\n return 'bigint';\n case 'boolean':\n return 'boolean';\n case 'number':\n return 'number';\n case 'string':\n return 'string';\n case 'symbol':\n return 'symbol';\n case 'undefined':\n return 'undefined';\n default:\n }\n\n if (is.array(value)) {\n return 'Array';\n }\n\n if (is.plainFunction(value)) {\n return 'Function';\n }\n\n const tagType = getObjectType(value);\n\n if (tagType) {\n return tagType;\n }\n /* c8 ignore next 3 */\n\n return 'Object';\n}\n\nis.array = Array.isArray;\n\nis.arrayOf = (target: unknown[], predicate: (v: unknown) => boolean): boolean => {\n if (!is.array(target) && !is.function(predicate)) {\n return false;\n }\n\n return target.every(d => predicate(d));\n};\n\nis.asyncGeneratorFunction = (value: unknown): value is (...arguments_: any[]) => Promise =>\n getObjectType(value) === 'AsyncGeneratorFunction';\n\nis.asyncFunction = isObjectOfType('AsyncFunction');\n\nis.bigint = isOfType('bigint');\n\nis.boolean = (value: unknown): value is boolean => {\n return value === true || value === false;\n};\n\nis.date = isObjectOfType('Date');\n\nis.defined = (value: unknown): boolean => !is.undefined(value);\n\nis.domElement = (value: unknown): value is HTMLElement => {\n return (\n is.object(value) &&\n !is.plainObject(value) &&\n (value as HTMLElement).nodeType === 1 &&\n is.string((value as HTMLElement).nodeName) &&\n DOM_PROPERTIES_TO_CHECK.every(property => property in (value as HTMLElement))\n );\n};\n\nis.empty = (value: unknown): boolean => {\n return (\n (is.string(value) && value.length === 0) ||\n (is.array(value) && value.length === 0) ||\n (is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0) ||\n (is.set(value) && value.size === 0) ||\n (is.map(value) && value.size === 0)\n );\n};\n\nis.error = isObjectOfType('Error');\n\nis.function = isOfType('function');\n\nis.generator = (value: unknown): value is Generator => {\n return (\n is.iterable(value) &&\n is.function((value as IterableIterator).next) &&\n is.function((value as IterableIterator).throw)\n );\n};\n\nis.generatorFunction = isObjectOfType('GeneratorFunction');\n\nis.instanceOf = (instance: unknown, class_: Class): instance is T => {\n if (!instance || !(class_ as Class)) {\n return false;\n }\n\n return Object.getPrototypeOf(instance) === class_.prototype;\n};\n\nis.iterable = (value: unknown): value is IterableIterator => {\n return (\n !is.nullOrUndefined(value) && is.function((value as IterableIterator)[Symbol.iterator])\n );\n};\n\nis.map = isObjectOfType>('Map');\n\nis.nan = (value: unknown): boolean => {\n return Number.isNaN(value as number);\n};\n\nis.null = (value: unknown): value is null => {\n return value === null;\n};\n\nis.nullOrUndefined = (value: unknown): value is null | undefined => {\n return is.null(value) || is.undefined(value);\n};\n\nis.number = (value: unknown): value is number => {\n return isOfType('number')(value) && !is.nan(value);\n};\n\nis.numericString = (value: unknown): value is string => {\n return is.string(value) && (value as string).length > 0 && !Number.isNaN(Number(value));\n};\n\nis.object = (value: unknown): value is object => {\n return !is.nullOrUndefined(value) && (is.function(value) || typeof value === 'object');\n};\n\nis.oneOf = (target: unknown[], value: any): boolean => {\n if (!is.array(target)) {\n return false;\n }\n\n // eslint-disable-next-line unicorn/prefer-includes\n return target.indexOf(value) > -1;\n};\n\nis.plainFunction = isObjectOfType('Function');\n\nis.plainObject = (value: unknown): value is PlainObject => {\n if (getObjectType(value) !== 'Object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === null || prototype === Object.getPrototypeOf({});\n};\n\nis.primitive = (value: unknown): value is Primitive =>\n is.null(value) || isPrimitiveType(typeof value);\n\nis.promise = isObjectOfType>('Promise');\n\nis.propertyOf = (\n target: PlainObject,\n key: string,\n predicate?: (v: unknown) => boolean,\n): boolean => {\n if (!is.object(target) || !key) {\n return false;\n }\n\n const value = target[key];\n\n if (is.function(predicate)) {\n return predicate(value);\n }\n\n return is.defined(value);\n};\n\nis.regexp = isObjectOfType('RegExp');\n\nis.set = isObjectOfType>('Set');\n\nis.string = isOfType('string');\n\nis.symbol = isOfType('symbol');\n\nis.undefined = isOfType('undefined');\n\nis.weakMap = isObjectOfType>('WeakMap');\n\nis.weakSet = isObjectOfType>('WeakSet');\n\nexport default is;\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { CompareValuesOptions, Data, Key, Options, ValidTypes, Value } from './types';\n\nexport function canHaveLength(...arguments_: any): boolean {\n return arguments_.every((d: unknown) => is.string(d) || is.array(d) || is.plainObject(d));\n}\n\nexport function checkEquality(left: Data, right: Data, value: Value) {\n if (!isSameType(left, right)) {\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !left.some(hasValue(value)) && right.some(hasValue(value));\n }\n\n /* istanbul ignore else */\n if ([left, right].every(is.plainObject)) {\n return (\n !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value))\n );\n }\n\n return right === value;\n}\n\nexport function compareNumbers(\n previousData: Data,\n data: Data,\n options: Options,\n): boolean {\n const { actual, key, previous, type } = options;\n const left = nested(previousData, key);\n const right = nested(data, key);\n\n let changed =\n [left, right].every(is.number) && (type === 'increased' ? left < right : left > right);\n\n if (!is.undefined(actual)) {\n changed = changed && right === actual;\n }\n\n if (!is.undefined(previous)) {\n changed = changed && left === previous;\n }\n\n return changed;\n}\n\nexport function compareValues(\n previousData: Data,\n data: Data,\n options: CompareValuesOptions,\n) {\n const { key, type, value } = options;\n\n const left = nested(previousData, key);\n const right = nested(data, key);\n const primary = type === 'added' ? left : right;\n const secondary = type === 'added' ? right : left;\n\n if (!is.nullOrUndefined(value)) {\n if (is.defined(primary)) {\n // check if nested data matches\n if (is.array(primary) || is.plainObject(primary)) {\n return checkEquality(primary, secondary, value);\n }\n } else {\n return equal(secondary, value);\n }\n\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !secondary.every(isEqualPredicate(primary));\n }\n\n if ([left, right].every(is.plainObject)) {\n return hasExtraKeys(Object.keys(primary), Object.keys(secondary));\n }\n\n return (\n ![left, right].every(d => is.primitive(d) && is.defined(d)) &&\n (type === 'added'\n ? !is.defined(left) && is.defined(right)\n : is.defined(left) && !is.defined(right))\n );\n}\n\nexport function getIterables(previousData: Data, data: Data, { key }: Options = {}) {\n let left = nested(previousData, key);\n let right = nested(data, key);\n\n if (!isSameType(left, right)) {\n throw new TypeError('Inputs have different types');\n }\n\n if (!canHaveLength(left, right)) {\n throw new TypeError(\"Inputs don't have length\");\n }\n\n if ([left, right].every(is.plainObject)) {\n left = Object.keys(left);\n right = Object.keys(right);\n }\n\n return [left, right];\n}\n\nexport function hasEntry(input: Value) {\n return ([key, value]: [string, Value]) => {\n if (is.array(input)) {\n return (\n equal(input, value) ||\n input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)))\n );\n }\n\n /* istanbul ignore else */\n if (is.plainObject(input) && input[key]) {\n return !!input[key] && equal(input[key], value);\n }\n\n return equal(input, value);\n };\n}\n\nexport function hasExtraKeys(left: string[], right: string[]): boolean {\n return right.some(d => !left.includes(d));\n}\n\nexport function hasValue(input: Value) {\n return (value: Value) => {\n if (is.array(input)) {\n return input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)));\n }\n\n return equal(input, value);\n };\n}\n\nexport function includesOrEqualsTo(previousValue: T | T[], value: T): boolean {\n return is.array(previousValue)\n ? previousValue.some(d => equal(d, value))\n : equal(previousValue, value);\n}\n\nexport function isEqualPredicate(data: unknown[]) {\n return (value: unknown) => data.some(d => equal(d, value));\n}\n\nexport function isSameType(...arguments_: ValidTypes[]): boolean {\n return (\n arguments_.every(is.array) ||\n arguments_.every(is.number) ||\n arguments_.every(is.plainObject) ||\n arguments_.every(is.string)\n );\n}\n\nexport function nested(data: T, property?: K) {\n /* istanbul ignore else */\n if (is.plainObject(data) || is.array(data)) {\n /* istanbul ignore else */\n if (is.string(property)) {\n const props: Array = property.split('.');\n\n return props.reduce((acc, d) => acc && acc[d], data);\n }\n\n /* istanbul ignore else */\n if (is.number(property)) {\n return data[property];\n }\n\n return data;\n }\n\n return data;\n}\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { compareNumbers, compareValues, getIterables, includesOrEqualsTo, nested } from './helpers';\nimport { Data, KeyType, TreeChanges, Value } from './types';\n\nexport default function treeChanges

>(\n previousData: P,\n data: D,\n): TreeChanges {\n if ([previousData, data].some(is.nullOrUndefined)) {\n throw new Error('Missing required parameters');\n }\n\n if (![previousData, data].every(d => is.plainObject(d) || is.array(d))) {\n throw new Error('Expected plain objects or array');\n }\n\n const added = (key?: K, value?: Value): boolean => {\n try {\n return compareValues(previousData, data, { key, type: 'added', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changed = (key?: K | string, actual?: Value, previous?: Value): boolean => {\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n const hasPrevious = is.defined(previous);\n\n if (hasActual || hasPrevious) {\n const leftComparator = hasPrevious\n ? includesOrEqualsTo(previous, left)\n : !includesOrEqualsTo(actual, left);\n const rightComparator = includesOrEqualsTo(actual, right);\n\n return leftComparator && rightComparator;\n }\n\n if ([left, right].every(is.array) || [left, right].every(is.plainObject)) {\n return !equal(left, right);\n }\n\n return left !== right;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changedFrom = (key: K | string, previous: Value, actual?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n\n return (\n includesOrEqualsTo(previous, left) &&\n (hasActual ? includesOrEqualsTo(actual, right) : !hasActual)\n );\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const decreased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers(previousData, data, { key, actual, previous, type: 'decreased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const emptied = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !!left.length && !right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const filled = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !left.length && !!right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const increased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers(previousData, data, { key, actual, previous, type: 'increased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const removed = (key?: K, value?: Value): boolean => {\n try {\n return compareValues(previousData, data, { key, type: 'removed', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n return { added, changed, changedFrom, decreased, emptied, filled, increased, removed };\n}\n\nexport type { Data, KeyType, TreeChanges, Value } from './types';\n","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n let called = false\n return () => {\n if (called) {\n return\n }\n called = true\n window.Promise.resolve().then(() => {\n called = false\n fn()\n })\n }\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n ? microtaskDebounce\n : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body\n case '#document':\n return element.body\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order =\n element1.compareDocumentPosition(element2) &\n Node.DOCUMENT_POSITION_FOLLOWING;\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n const { commonAncestorContainer } = range;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat(styles[`border${sideA}Width`]) +\n parseFloat(styles[`border${sideB}Width`])\n );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(\n body[`offset${axis}`],\n body[`scroll${axis}`],\n html[`client${axis}`],\n html[`offset${axis}`],\n html[`scroll${axis}`],\n isIE(10)\n ? (parseInt(html[`offset${axis}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n : 0 \n );\n}\n\nexport default function getWindowSizes(document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle),\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n return {\n ...offsets,\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height,\n };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n let rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n }\n else {\n rect = element.getBoundingClientRect();\n }\n }\n catch(e){}\n\n const result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n const width =\n sizes.width || element.clientWidth || result.width;\n const height =\n sizes.height || element.clientHeight || result.height;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n const isIE10 = runIsIE(10);\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if(fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n let offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height,\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (\n isIE10 && !fixedPosition\n ? parent.contains(scrollParent)\n : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n ) {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n const modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n const parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n let el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement,\n fixedPosition = false\n) {\n // NOTE: 1 DOM access here\n\n let boundaries = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport' ) {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n }\n\n else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(popper.ownerDocument);\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n const isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n return boundaries;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width,\n height,\n };\n\n return getClientRect(offset);\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n placement,\n refRect,\n popper,\n reference,\n boundariesElement,\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement\n );\n\n const rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top,\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height,\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom,\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height,\n },\n };\n\n const sortedAreas = Object.keys(rects)\n .map(key => ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const window = element.ownerDocument.defaultView;\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier['function']) { // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference,\n this.options.positionFixed\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n\n data.offsets.popper.position = this.options.positionFixed\n ? 'fixed'\n : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n const ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n const offsets = getRoundedOffsets(\n data,\n window.devicePixelRatio < 2 || !isFirefox\n );\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement,\n data.positionFixed\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n const flippedVariationByRef =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n // flips variation if popper content overflows boundaries\n const flippedVariationByContent =\n !!options.flipVariationsByContent &&\n ((isVertical && variation === 'start' && overflowsRight) ||\n (isVertical && variation === 'end' && overflowsLeft) ||\n (!isVertical && variation === 'start' && overflowsBottom) ||\n (!isVertical && variation === 'end' && overflowsTop));\n\n const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false,\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n const transformProp = getSupportedPropertyName('transform');\n const popperStyles = data.instance.popper.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = popperStyles;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement,\n data.positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side =\n ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.popper);\n const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n let sideValue =\n center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n };\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n const { popper, reference } = data.offsets;\n const { round, floor } = Math;\n const noRound = v => v;\n \n const referenceWidth = round(reference.width);\n const popperWidth = round(popper.width);\n \n const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n const isVariation = data.placement.indexOf('-') !== -1;\n const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n const horizontalToInteger = !shouldRound\n ? noRound\n : isVertical || isVariation || sameWidthParity\n ? round\n : floor;\n const verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(\n bothOddWidth && !isVariation && shouldRound\n ? popper.left - 1\n : popper.left\n ),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right),\n };\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n constructor(reference, popper, options = {}) {\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = { ...Popper.Defaults, ...options };\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: [],\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys({\n ...Popper.Defaults.modifiers,\n ...options.modifiers,\n }).forEach(name => {\n this.options.modifiers[name] = {\n // If it's a built-in modifier, use it as base\n ...(Popper.Defaults.modifiers[name] || {}),\n // If there are custom options, override and merge with default ones\n ...(options.modifiers ? options.modifiers[name] : {}),\n };\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers)\n .map(name => ({\n name,\n ...this.options.modifiers[name],\n }))\n // sort the modifiers by order\n .sort((a, b) => a.order - b.order);\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(modifierOptions => {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(\n this.reference,\n this.popper,\n this.options,\n modifierOptions,\n this.state\n );\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n const eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n update() {\n return update.call(this);\n }\n destroy() {\n return destroy.call(this);\n }\n enableEventListeners() {\n return enableEventListeners.call(this);\n }\n disableEventListeners() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n scheduleUpdate = () => requestAnimationFrame(this.update);\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n static placements = placements;\n\n static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","import { Class, PlainObject, Primitive } from './types';\n\nconst DOM_PROPERTIES_TO_CHECK: Array = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue',\n];\n\nconst objectTypes = [\n 'Array',\n 'ArrayBuffer',\n 'AsyncFunction',\n 'AsyncGenerator',\n 'AsyncGeneratorFunction',\n 'Date',\n 'Error',\n 'Function',\n 'Generator',\n 'GeneratorFunction',\n 'HTMLElement',\n 'Map',\n 'Object',\n 'Promise',\n 'RegExp',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n] as const;\n\nconst primitiveTypes = [\n 'bigint',\n 'boolean',\n 'null',\n 'number',\n 'string',\n 'symbol',\n 'undefined',\n] as const;\n\nexport type ObjectTypes = typeof objectTypes[number];\n\nexport type PrimitiveTypes = typeof primitiveTypes[number];\n\nexport type TypeName = ObjectTypes | PrimitiveTypes;\n\nexport function getObjectType(value: unknown): ObjectTypes | undefined {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n\n if (/HTML\\w+Element/.test(objectTypeName)) {\n return 'HTMLElement';\n }\n\n if (isObjectType(objectTypeName)) {\n return objectTypeName;\n }\n\n return undefined;\n}\n\nfunction isObjectOfType(type: string) {\n return (value: unknown): value is T => getObjectType(value) === type;\n}\n\nfunction isObjectType(name: unknown): name is ObjectTypes {\n return objectTypes.includes(name as ObjectTypes);\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType(type: string) {\n return (value: unknown): value is T => typeof value === type;\n}\n\nfunction isPrimitiveType(name: unknown): name is PrimitiveTypes {\n return primitiveTypes.includes(name as PrimitiveTypes);\n}\n\nfunction is(value: unknown): TypeName {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'bigint':\n return 'bigint';\n case 'boolean':\n return 'boolean';\n case 'number':\n return 'number';\n case 'string':\n return 'string';\n case 'symbol':\n return 'symbol';\n case 'undefined':\n return 'undefined';\n default:\n }\n\n if (is.array(value)) {\n return 'Array';\n }\n\n if (is.plainFunction(value)) {\n return 'Function';\n }\n\n const tagType = getObjectType(value);\n\n /* istanbul ignore else */\n if (tagType) {\n return tagType;\n }\n\n /* istanbul ignore next */\n return 'Object';\n}\n\nis.array = Array.isArray;\n\nis.arrayOf = (target: unknown[], predicate: (v: unknown) => boolean): boolean => {\n if (!is.array(target) && !is.function(predicate)) {\n return false;\n }\n\n return target.every(d => predicate(d));\n};\n\nis.asyncGeneratorFunction = (value: unknown): value is (...arguments_: any[]) => Promise =>\n getObjectType(value) === 'AsyncGeneratorFunction';\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.asyncFunction = isObjectOfType('AsyncFunction');\n\nis.bigint = isOfType('bigint');\n\nis.boolean = (value: unknown): value is boolean => {\n return value === true || value === false;\n};\n\nis.date = isObjectOfType('Date');\n\nis.defined = (value: unknown): boolean => !is.undefined(value);\n\nis.domElement = (value: unknown): value is HTMLElement => {\n return (\n is.object(value) &&\n !is.plainObject(value) &&\n (value as HTMLElement).nodeType === 1 &&\n is.string((value as HTMLElement).nodeName) &&\n DOM_PROPERTIES_TO_CHECK.every(property => property in (value as HTMLElement))\n );\n};\n\nis.empty = (value: unknown): boolean => {\n return (\n (is.string(value) && value.length === 0) ||\n (is.array(value) && value.length === 0) ||\n (is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0) ||\n (is.set(value) && value.size === 0) ||\n (is.map(value) && value.size === 0)\n );\n};\n\nis.error = isObjectOfType('Error');\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.function = isOfType('function');\n\nis.generator = (value: unknown): value is Generator => {\n return (\n is.iterable(value) &&\n is.function((value as IterableIterator).next) &&\n is.function((value as IterableIterator).throw)\n );\n};\n\nis.generatorFunction = isObjectOfType('GeneratorFunction');\n\nis.instanceOf = (instance: unknown, class_: Class): instance is T => {\n if (!instance || !(class_ as Class)) {\n return false;\n }\n\n return Object.getPrototypeOf(instance) === class_.prototype;\n};\n\nis.iterable = (value: unknown): value is IterableIterator => {\n return (\n !is.nullOrUndefined(value) && is.function((value as IterableIterator)[Symbol.iterator])\n );\n};\n\nis.map = isObjectOfType>('Map');\n\nis.nan = (value: unknown): boolean => {\n return Number.isNaN(value as number);\n};\n\nis.null = (value: unknown): value is null => {\n return value === null;\n};\n\nis.nullOrUndefined = (value: unknown): value is null | undefined => {\n return is.null(value) || is.undefined(value);\n};\n\nis.number = (value: unknown): value is number => {\n return isOfType('number')(value) && !is.nan(value);\n};\n\nis.numericString = (value: unknown): value is string => {\n return is.string(value) && (value as string).length > 0 && !Number.isNaN(Number(value));\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.object = (value: unknown): value is object => {\n return !is.nullOrUndefined(value) && (is.function(value) || typeof value === 'object');\n};\n\nis.oneOf = (target: unknown[], value: any): boolean => {\n if (!is.array(target)) {\n return false;\n }\n\n // eslint-disable-next-line unicorn/prefer-includes\n return target.indexOf(value) > -1;\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.plainFunction = isObjectOfType('Function');\n\nis.plainObject = (value: unknown): value is PlainObject => {\n if (getObjectType(value) !== 'Object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === null || prototype === Object.getPrototypeOf({});\n};\n\nis.primitive = (value: unknown): value is Primitive =>\n is.null(value) || isPrimitiveType(typeof value);\n\nis.promise = isObjectOfType>('Promise');\n\nis.propertyOf = (\n target: PlainObject,\n key: string,\n predicate?: (v: unknown) => boolean,\n): boolean => {\n if (!is.object(target) || !key) {\n return false;\n }\n\n const value = target[key];\n\n if (is.function(predicate)) {\n return predicate(value);\n }\n\n return is.defined(value);\n};\n\nis.regexp = isObjectOfType('RegExp');\n\nis.set = isObjectOfType>('Set');\n\nis.string = isOfType('string');\n\nis.symbol = isOfType('symbol');\n\nis.undefined = isOfType('undefined');\n\nis.weakMap = isObjectOfType>('WeakMap');\n\nis.weakSet = isObjectOfType>('WeakSet');\n\nexport * from './types';\n\nexport default is;\n","import { AnyObject, Primitive } from './types';\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType(type: string) {\n return (value: unknown): value is T => typeof value === type;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = isOfType('function');\n\nexport const isNull = (value: unknown): value is null => {\n return value === null;\n};\n\nexport const isRegex = (value: unknown): value is RegExp => {\n return Object.prototype.toString.call(value).slice(8, -1) === 'RegExp';\n};\n\nexport const isObject = (value: unknown): value is AnyObject => {\n return !isUndefined(value) && !isNull(value) && (isFunction(value) || typeof value === 'object');\n};\n\nexport const isUndefined = isOfType('undefined');\n","import { isObject, isRegex } from './helpers';\n\nfunction equalArray(left: unknown[], right: unknown[]) {\n const { length } = left;\n\n if (length !== right.length) {\n return false;\n }\n\n for (let index = length; index-- !== 0; ) {\n if (!equal(left[index], right[index])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalArrayBuffer(left: ArrayBufferView, right: ArrayBufferView) {\n if (left.byteLength !== right.byteLength) {\n return false;\n }\n\n const view1 = new DataView(left.buffer);\n const view2 = new DataView(right.buffer);\n\n let index = left.byteLength;\n\n while (index--) {\n if (view1.getUint8(index) !== view2.getUint8(index)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalMap(left: Map, right: Map) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n for (const index of left.entries()) {\n if (!equal(index[1], right.get(index[0]))) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalSet(left: Set, right: Set) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n return true;\n}\n\nexport default function equal(left: unknown, right: unknown) {\n if (left === right) {\n return true;\n }\n\n if (left && isObject(left) && right && isObject(right)) {\n if (left.constructor !== right.constructor) {\n return false;\n }\n\n if (Array.isArray(left) && Array.isArray(right)) {\n return equalArray(left, right);\n }\n\n if (left instanceof Map && right instanceof Map) {\n return equalMap(left, right);\n }\n\n if (left instanceof Set && right instanceof Set) {\n return equalSet(left, right);\n }\n\n if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right)) {\n return equalArrayBuffer(left, right);\n }\n\n if (isRegex(left) && isRegex(right)) {\n return left.source === right.source && left.flags === right.flags;\n }\n\n if (left.valueOf !== Object.prototype.valueOf) {\n return left.valueOf() === right.valueOf();\n }\n\n if (left.toString !== Object.prototype.toString) {\n return left.toString() === right.toString();\n }\n\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index])) {\n return false;\n }\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n const key = leftKeys[index];\n\n if (key === '_owner' && left.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (!equal(left[key], right[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Number.isNaN(left) && Number.isNaN(right)) {\n return true;\n }\n\n return left === right;\n}\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { CompareValuesOptions, Data, Key, Options, ValidTypes, Value } from './types';\n\nexport function canHaveLength(...arguments_: any): boolean {\n return arguments_.every((d: unknown) => is.string(d) || is.array(d) || is.plainObject(d));\n}\n\nexport function checkEquality(left: Data, right: Data, value: Value) {\n if (!isSameType(left, right)) {\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !left.some(hasValue(value)) && right.some(hasValue(value));\n }\n\n /* istanbul ignore else */\n if ([left, right].every(is.plainObject)) {\n return (\n !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value))\n );\n }\n\n return right === value;\n}\n\nexport function compareNumbers(\n previousData: Data,\n data: Data,\n options: Options,\n): boolean {\n const { actual, key, previous, type } = options;\n const left = nested(previousData, key);\n const right = nested(data, key);\n\n let changed =\n [left, right].every(is.number) && (type === 'increased' ? left < right : left > right);\n\n if (!is.undefined(actual)) {\n changed = changed && right === actual;\n }\n\n if (!is.undefined(previous)) {\n changed = changed && left === previous;\n }\n\n return changed;\n}\n\nexport function compareValues(\n previousData: Data,\n data: Data,\n options: CompareValuesOptions,\n) {\n const { key, type, value } = options;\n\n const left = nested(previousData, key);\n const right = nested(data, key);\n const primary = type === 'added' ? left : right;\n const secondary = type === 'added' ? right : left;\n\n // console.log({ primary, secondary });\n\n if (!is.nullOrUndefined(value)) {\n if (is.defined(primary)) {\n // check if nested data matches\n if (is.array(primary) || is.plainObject(primary)) {\n return checkEquality(primary, secondary, value);\n }\n } else {\n return equal(secondary, value);\n }\n\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !secondary.every(isEqualPredicate(primary));\n }\n\n if ([left, right].every(is.plainObject)) {\n return hasExtraKeys(Object.keys(primary), Object.keys(secondary));\n }\n\n return (\n ![left, right].every(d => is.primitive(d) && is.defined(d)) &&\n (type === 'added'\n ? !is.defined(left) && is.defined(right)\n : is.defined(left) && !is.defined(right))\n );\n}\n\nexport function getIterables(previousData: Data, data: Data, { key }: Options = {}) {\n let left = nested(previousData, key);\n let right = nested(data, key);\n\n if (!isSameType(left, right)) {\n throw new TypeError('Inputs have different types');\n }\n\n if (!canHaveLength(left, right)) {\n throw new TypeError(\"Inputs don't have length\");\n }\n\n if ([left, right].every(is.plainObject)) {\n left = Object.keys(left);\n right = Object.keys(right);\n }\n\n return [left, right];\n}\n\nexport function hasEntry(input: Value) {\n return ([key, value]: [string, Value]) => {\n if (is.array(input)) {\n return (\n equal(input, value) ||\n input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)))\n );\n }\n\n /* istanbul ignore else */\n if (is.plainObject(input) && input[key]) {\n return !!input[key] && equal(input[key], value);\n }\n\n return equal(input, value);\n };\n}\n\nexport function hasExtraKeys(left: string[], right: string[]): boolean {\n return right.some(d => !left.includes(d));\n}\n\nexport function hasValue(input: Value) {\n return (value: Value) => {\n if (is.array(input)) {\n return input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)));\n }\n\n return equal(input, value);\n };\n}\n\nexport function includesOrEqualsTo(previousValue: T | T[], value: T): boolean {\n return is.array(previousValue)\n ? previousValue.some(d => equal(d, value))\n : equal(previousValue, value);\n}\n\nexport function isEqualPredicate(data: unknown[]) {\n return (value: unknown) => data.some(d => equal(d, value));\n}\n\nexport function isSameType(...arguments_: ValidTypes[]): boolean {\n return (\n arguments_.every(is.array) ||\n arguments_.every(is.number) ||\n arguments_.every(is.plainObject) ||\n arguments_.every(is.string)\n );\n}\n\nexport function nested(data: T, property?: K) {\n /* istanbul ignore else */\n if (is.plainObject(data) || is.array(data)) {\n /* istanbul ignore else */\n if (is.string(property)) {\n const props: Array = property.split('.');\n\n return props.reduce((acc, d) => acc && acc[d], data);\n }\n\n /* istanbul ignore else */\n if (is.number(property)) {\n return data[property];\n }\n\n return data;\n }\n\n return data;\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Popper from 'popper.js';\nimport deepmerge from 'deepmerge';\nimport is from 'is-lite';\nimport treeChanges from 'tree-changes';\nimport ReactDOM from 'react-dom';\n\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _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}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar DEFAULTS = {flip:{padding:20},preventOverflow:{padding:10}};\n\nvar VALIDATOR_ARG_ERROR_MESSAGE='The typeValidator argument must be a function '+'with the signature function(props, propName, componentName).';var MESSAGE_ARG_ERROR_MESSAGE='The error message is optional, but must be a string if provided.';function propIsRequired(condition,props,propName,componentName){if(typeof condition==='boolean'){return condition;}if(typeof condition==='function'){return condition(props,propName,componentName);}if(Boolean(condition)===true){return Boolean(condition);}return false;}function propExists(props,propName){return Object.hasOwnProperty.call(props,propName);}function missingPropError(props,propName,componentName,message){if(message){return new Error(message);}return new Error(\"Required \".concat(props[propName],\" `\").concat(propName,\"` was not specified in `\").concat(componentName,\"`.\"));}function guardAgainstInvalidArgTypes(typeValidator,message){if(typeof typeValidator!=='function'){throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);}if(Boolean(message)&&typeof message!=='string'){throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE);}}function isRequiredIf(typeValidator,condition,message){guardAgainstInvalidArgTypes(typeValidator,message);return function(props,propName,componentName){for(var _len=arguments.length,rest=new Array(_len>3?_len-3:0),_key=3;_key<_len;_key++){rest[_key-3]=arguments[_key];}if(propIsRequired(condition,props,propName,componentName)){if(propExists(props,propName)){return typeValidator.apply(void 0,[props,propName,componentName].concat(rest));}return missingPropError(props,propName,componentName,message);}// Is not required, so just run typeValidator.\nreturn typeValidator.apply(void 0,[props,propName,componentName].concat(rest));};}\n\nvar STATUS = {INIT:'init',IDLE:'idle',OPENING:'opening',OPEN:'open',CLOSING:'closing',ERROR:'error'};\n\nvar isReact16=ReactDOM.createPortal!==undefined;function canUseDOM(){return !!(typeof window!=='undefined'&&window.document&&window.document.createElement);}function isMobile(){return 'ontouchstart'in window&&/Mobi/.test(navigator.userAgent);}/**\n * Log method calls if debug is enabled\n *\n * @private\n * @param {Object} arg\n * @param {string} arg.title - The title the logger was called from\n * @param {Object|Array} [arg.data] - The data to be logged\n * @param {boolean} [arg.warn] - If true, the message will be a warning\n * @param {boolean} [arg.debug] - Nothing will be logged unless debug is true\n */function log(_ref){var title=_ref.title,data=_ref.data,_ref$warn=_ref.warn,warn=_ref$warn===void 0?false:_ref$warn,_ref$debug=_ref.debug,debug=_ref$debug===void 0?false:_ref$debug;/* eslint-disable no-console */var logFn=warn?console.warn||console.error:console.log;if(debug&&title&&data){console.groupCollapsed(\"%creact-floater: \".concat(title),'color: #9b00ff; font-weight: bold; font-size: 12px;');if(Array.isArray(data)){data.forEach(function(d){if(is.plainObject(d)&&d.key){logFn.apply(console,[d.key,d.value]);}else {logFn.apply(console,[d]);}});}else {logFn.apply(console,[data]);}console.groupEnd();}/* eslint-enable */}function on(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;element.addEventListener(event,cb,capture);}function off(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;element.removeEventListener(event,cb,capture);}function once(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var _nextCB;// eslint-disable-next-line prefer-const\n_nextCB=function nextCB(e){cb(e);off(element,event,_nextCB);};on(element,event,_nextCB,capture);}function noop(){}\n\nvar ReactFloaterPortal=/*#__PURE__*/function(_React$Component){_inherits(ReactFloaterPortal,_React$Component);var _super=_createSuper(ReactFloaterPortal);function ReactFloaterPortal(){_classCallCheck(this,ReactFloaterPortal);return _super.apply(this,arguments);}_createClass(ReactFloaterPortal,[{key:\"componentDidMount\",value:function componentDidMount(){if(!canUseDOM())return;if(!this.node){this.appendNode();}if(!isReact16){this.renderPortal();}}},{key:\"componentDidUpdate\",value:function componentDidUpdate(){if(!canUseDOM())return;if(!isReact16){this.renderPortal();}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){if(!canUseDOM()||!this.node)return;if(!isReact16){ReactDOM.unmountComponentAtNode(this.node);}if(this.node&&this.node.parentNode===document.body){document.body.removeChild(this.node);this.node=undefined;}}},{key:\"appendNode\",value:function appendNode(){var _this$props=this.props,id=_this$props.id,zIndex=_this$props.zIndex;if(!this.node){this.node=document.createElement('div');/* istanbul ignore else */if(id){this.node.id=id;}if(zIndex){this.node.style.zIndex=zIndex;}document.body.appendChild(this.node);}}},{key:\"renderPortal\",value:function renderPortal(){if(!canUseDOM())return null;var _this$props2=this.props,children=_this$props2.children,setRef=_this$props2.setRef;if(!this.node){this.appendNode();}/* istanbul ignore else */if(isReact16){return/*#__PURE__*/ReactDOM.createPortal(children,this.node);}var portal=ReactDOM.unstable_renderSubtreeIntoContainer(this,children.length>1?/*#__PURE__*/React.createElement(\"div\",null,children):children[0],this.node);setRef(portal);return null;}},{key:\"renderReact16\",value:function renderReact16(){var _this$props3=this.props,hasChildren=_this$props3.hasChildren,placement=_this$props3.placement,target=_this$props3.target;if(!hasChildren){if(target||placement==='center'){return this.renderPortal();}return null;}return this.renderPortal();}},{key:\"render\",value:function render(){if(!isReact16){return null;}return this.renderReact16();}}]);return ReactFloaterPortal;}(React.Component);_defineProperty(ReactFloaterPortal,\"propTypes\",{children:PropTypes.oneOfType([PropTypes.element,PropTypes.array]),hasChildren:PropTypes.bool,id:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),placement:PropTypes.string,setRef:PropTypes.func.isRequired,target:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),zIndex:PropTypes.number});\n\nvar FloaterArrow=/*#__PURE__*/function(_React$Component){_inherits(FloaterArrow,_React$Component);var _super=_createSuper(FloaterArrow);function FloaterArrow(){_classCallCheck(this,FloaterArrow);return _super.apply(this,arguments);}_createClass(FloaterArrow,[{key:\"parentStyle\",get:function get(){var _this$props=this.props,placement=_this$props.placement,styles=_this$props.styles;var length=styles.arrow.length;var arrow={pointerEvents:'none',position:'absolute',width:'100%'};/* istanbul ignore else */if(placement.startsWith('top')){arrow.bottom=0;arrow.left=0;arrow.right=0;arrow.height=length;}else if(placement.startsWith('bottom')){arrow.left=0;arrow.right=0;arrow.top=0;arrow.height=length;}else if(placement.startsWith('left')){arrow.right=0;arrow.top=0;arrow.bottom=0;}else if(placement.startsWith('right')){arrow.left=0;arrow.top=0;}return arrow;}},{key:\"render\",value:function render(){var _this$props2=this.props,placement=_this$props2.placement,setArrowRef=_this$props2.setArrowRef,styles=_this$props2.styles;var _styles$arrow=styles.arrow,color=_styles$arrow.color,display=_styles$arrow.display,length=_styles$arrow.length,margin=_styles$arrow.margin,position=_styles$arrow.position,spread=_styles$arrow.spread;var arrowStyles={display:display,position:position};var points;var x=spread;var y=length;/* istanbul ignore else */if(placement.startsWith('top')){points=\"0,0 \".concat(x/2,\",\").concat(y,\" \").concat(x,\",0\");arrowStyles.bottom=0;arrowStyles.marginLeft=margin;arrowStyles.marginRight=margin;}else if(placement.startsWith('bottom')){points=\"\".concat(x,\",\").concat(y,\" \").concat(x/2,\",0 0,\").concat(y);arrowStyles.top=0;arrowStyles.marginLeft=margin;arrowStyles.marginRight=margin;}else if(placement.startsWith('left')){y=spread;x=length;points=\"0,0 \".concat(x,\",\").concat(y/2,\" 0,\").concat(y);arrowStyles.right=0;arrowStyles.marginTop=margin;arrowStyles.marginBottom=margin;}else if(placement.startsWith('right')){y=spread;x=length;points=\"\".concat(x,\",\").concat(y,\" \").concat(x,\",0 0,\").concat(y/2);arrowStyles.left=0;arrowStyles.marginTop=margin;arrowStyles.marginBottom=margin;}return/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__arrow\",style:this.parentStyle},/*#__PURE__*/React.createElement(\"span\",{ref:setArrowRef,style:arrowStyles},/*#__PURE__*/React.createElement(\"svg\",{width:x,height:y,version:\"1.1\",xmlns:\"http://www.w3.org/2000/svg\"},/*#__PURE__*/React.createElement(\"polygon\",{points:points,fill:color}))));}}]);return FloaterArrow;}(React.Component);_defineProperty(FloaterArrow,\"propTypes\",{placement:PropTypes.string.isRequired,setArrowRef:PropTypes.func.isRequired,styles:PropTypes.object.isRequired});\n\nvar _excluded$1=[\"color\",\"height\",\"width\"];function FloaterCloseBtn(_ref){var handleClick=_ref.handleClick,styles=_ref.styles;var color=styles.color,height=styles.height,width=styles.width,style=_objectWithoutProperties(styles,_excluded$1);return/*#__PURE__*/React.createElement(\"button\",{\"aria-label\":\"close\",onClick:handleClick,style:style,type:\"button\"},/*#__PURE__*/React.createElement(\"svg\",{width:\"\".concat(width,\"px\"),height:\"\".concat(height,\"px\"),viewBox:\"0 0 18 18\",version:\"1.1\",xmlns:\"http://www.w3.org/2000/svg\",preserveAspectRatio:\"xMidYMid\"},/*#__PURE__*/React.createElement(\"g\",null,/*#__PURE__*/React.createElement(\"path\",{d:\"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z\",fill:color}))));}FloaterCloseBtn.propTypes={handleClick:PropTypes.func.isRequired,styles:PropTypes.object.isRequired};\n\nfunction FloaterContainer(_ref){var content=_ref.content,footer=_ref.footer,handleClick=_ref.handleClick,open=_ref.open,positionWrapper=_ref.positionWrapper,showCloseButton=_ref.showCloseButton,title=_ref.title,styles=_ref.styles;var output={content:/*#__PURE__*/React.isValidElement(content)?content:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__content\",style:styles.content},content)};if(title){output.title=/*#__PURE__*/React.isValidElement(title)?title:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__title\",style:styles.title},title);}if(footer){output.footer=/*#__PURE__*/React.isValidElement(footer)?footer:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__footer\",style:styles.footer},footer);}if((showCloseButton||positionWrapper)&&!is[\"boolean\"](open)){output.close=/*#__PURE__*/React.createElement(FloaterCloseBtn,{styles:styles.close,handleClick:handleClick});}return/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__container\",style:styles.container},output.close,output.title,output.content,output.footer);}FloaterContainer.propTypes={content:PropTypes.node.isRequired,footer:PropTypes.node,handleClick:PropTypes.func.isRequired,open:PropTypes.bool,positionWrapper:PropTypes.bool.isRequired,showCloseButton:PropTypes.bool.isRequired,styles:PropTypes.object.isRequired,title:PropTypes.node};\n\nvar Floater=/*#__PURE__*/function(_React$Component){_inherits(Floater,_React$Component);var _super=_createSuper(Floater);function Floater(){_classCallCheck(this,Floater);return _super.apply(this,arguments);}_createClass(Floater,[{key:\"style\",get:function get(){var _this$props=this.props,disableAnimation=_this$props.disableAnimation,component=_this$props.component,placement=_this$props.placement,hideArrow=_this$props.hideArrow,status=_this$props.status,styles=_this$props.styles;var length=styles.arrow.length,floater=styles.floater,floaterCentered=styles.floaterCentered,floaterClosing=styles.floaterClosing,floaterOpening=styles.floaterOpening,floaterWithAnimation=styles.floaterWithAnimation,floaterWithComponent=styles.floaterWithComponent;var element={};if(!hideArrow){if(placement.startsWith('top')){element.padding=\"0 0 \".concat(length,\"px\");}else if(placement.startsWith('bottom')){element.padding=\"\".concat(length,\"px 0 0\");}else if(placement.startsWith('left')){element.padding=\"0 \".concat(length,\"px 0 0\");}else if(placement.startsWith('right')){element.padding=\"0 0 0 \".concat(length,\"px\");}}if([STATUS.OPENING,STATUS.OPEN].indexOf(status)!==-1){element=_objectSpread2(_objectSpread2({},element),floaterOpening);}if(status===STATUS.CLOSING){element=_objectSpread2(_objectSpread2({},element),floaterClosing);}if(status===STATUS.OPEN&&!disableAnimation){element=_objectSpread2(_objectSpread2({},element),floaterWithAnimation);}if(placement==='center'){element=_objectSpread2(_objectSpread2({},element),floaterCentered);}if(component){element=_objectSpread2(_objectSpread2({},element),floaterWithComponent);}return _objectSpread2(_objectSpread2({},floater),element);}},{key:\"render\",value:function render(){var _this$props2=this.props,component=_this$props2.component,closeFn=_this$props2.handleClick,hideArrow=_this$props2.hideArrow,setFloaterRef=_this$props2.setFloaterRef,status=_this$props2.status;var output={};var classes=['__floater'];if(component){if(/*#__PURE__*/React.isValidElement(component)){output.content=/*#__PURE__*/React.cloneElement(component,{closeFn:closeFn});}else {output.content=component({closeFn:closeFn});}}else {output.content=/*#__PURE__*/React.createElement(FloaterContainer,this.props);}if(status===STATUS.OPEN){classes.push('__floater__open');}if(!hideArrow){output.arrow=/*#__PURE__*/React.createElement(FloaterArrow,this.props);}return/*#__PURE__*/React.createElement(\"div\",{ref:setFloaterRef,className:classes.join(' '),style:this.style},/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__body\"},output.content,output.arrow));}}]);return Floater;}(React.Component);_defineProperty(Floater,\"propTypes\",{component:PropTypes.oneOfType([PropTypes.func,PropTypes.element]),content:PropTypes.node,disableAnimation:PropTypes.bool.isRequired,footer:PropTypes.node,handleClick:PropTypes.func.isRequired,hideArrow:PropTypes.bool.isRequired,open:PropTypes.bool,placement:PropTypes.string.isRequired,positionWrapper:PropTypes.bool.isRequired,setArrowRef:PropTypes.func.isRequired,setFloaterRef:PropTypes.func.isRequired,showCloseButton:PropTypes.bool,status:PropTypes.string.isRequired,styles:PropTypes.object.isRequired,title:PropTypes.node});\n\nvar ReactFloaterWrapper=/*#__PURE__*/function(_React$Component){_inherits(ReactFloaterWrapper,_React$Component);var _super=_createSuper(ReactFloaterWrapper);function ReactFloaterWrapper(){_classCallCheck(this,ReactFloaterWrapper);return _super.apply(this,arguments);}_createClass(ReactFloaterWrapper,[{key:\"render\",value:function render(){var _this$props=this.props,children=_this$props.children,handleClick=_this$props.handleClick,handleMouseEnter=_this$props.handleMouseEnter,handleMouseLeave=_this$props.handleMouseLeave,setChildRef=_this$props.setChildRef,setWrapperRef=_this$props.setWrapperRef,style=_this$props.style,styles=_this$props.styles;var element;/* istanbul ignore else */if(children){if(React.Children.count(children)===1){if(!/*#__PURE__*/React.isValidElement(children)){element=/*#__PURE__*/React.createElement(\"span\",null,children);}else {var refProp=is[\"function\"](children.type)?'innerRef':'ref';element=/*#__PURE__*/React.cloneElement(React.Children.only(children),_defineProperty({},refProp,setChildRef));}}else {element=children;}}if(!element){return null;}return/*#__PURE__*/React.createElement(\"span\",{ref:setWrapperRef,style:_objectSpread2(_objectSpread2({},styles),style),onClick:handleClick,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave},element);}}]);return ReactFloaterWrapper;}(React.Component);_defineProperty(ReactFloaterWrapper,\"propTypes\",{children:PropTypes.node,handleClick:PropTypes.func.isRequired,handleMouseEnter:PropTypes.func.isRequired,handleMouseLeave:PropTypes.func.isRequired,setChildRef:PropTypes.func.isRequired,setWrapperRef:PropTypes.func.isRequired,style:PropTypes.object,styles:PropTypes.object.isRequired});\n\nvar defaultOptions={zIndex:100};function getStyles(styles){var options=deepmerge(defaultOptions,styles.options||{});return {wrapper:{cursor:'help',display:'inline-flex',flexDirection:'column',zIndex:options.zIndex},wrapperPosition:{left:-1000,position:'absolute',top:-1000,visibility:'hidden'},floater:{display:'inline-block',filter:'drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))',maxWidth:300,opacity:0,position:'relative',transition:'opacity 0.3s',visibility:'hidden',zIndex:options.zIndex},floaterOpening:{opacity:1,visibility:'visible'},floaterWithAnimation:{opacity:1,transition:'opacity 0.3s, transform 0.2s',visibility:'visible'},floaterWithComponent:{maxWidth:'100%'},floaterClosing:{opacity:0,visibility:'visible'},floaterCentered:{left:'50%',position:'fixed',top:'50%',transform:'translate(-50%, -50%)'},container:{backgroundColor:'#fff',color:'#666',minHeight:60,minWidth:200,padding:20,position:'relative',zIndex:10},title:{borderBottom:'1px solid #555',color:'#555',fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:'transparent',border:0,borderRadius:0,color:'#555',fontSize:0,height:15,outline:'none',padding:10,position:'absolute',right:0,top:0,width:15,WebkitAppearance:'none'},footer:{borderTop:'1px solid #ccc',fontSize:13,marginTop:10,paddingTop:5},arrow:{color:'#fff',display:'inline-flex',length:16,margin:8,position:'absolute',spread:32},options:options};}\n\nvar _excluded=[\"arrow\",\"flip\",\"offset\"];var POSITIONING_PROPS=['position','top','right','bottom','left'];var ReactFloater=/*#__PURE__*/function(_React$Component){_inherits(ReactFloater,_React$Component);var _super=_createSuper(ReactFloater);function ReactFloater(props){var _this;_classCallCheck(this,ReactFloater);_this=_super.call(this,props);/* istanbul ignore else */_defineProperty(_assertThisInitialized(_this),\"setArrowRef\",function(ref){_this.arrowRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setChildRef\",function(ref){_this.childRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setFloaterRef\",function(ref){_this.floaterRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setWrapperRef\",function(ref){_this.wrapperRef=ref;});_defineProperty(_assertThisInitialized(_this),\"handleTransitionEnd\",function(){var status=_this.state.status;var callback=_this.props.callback;/* istanbul ignore else */if(_this.wrapperPopper){_this.wrapperPopper.instance.update();}_this.setState({status:status===STATUS.OPENING?STATUS.OPEN:STATUS.IDLE},function(){var newStatus=_this.state.status;callback(newStatus===STATUS.OPEN?'open':'close',_this.props);});});_defineProperty(_assertThisInitialized(_this),\"handleClick\",function(){var _this$props=_this.props,event=_this$props.event,open=_this$props.open;if(is[\"boolean\"](open))return;var _this$state=_this.state,positionWrapper=_this$state.positionWrapper,status=_this$state.status;/* istanbul ignore else */if(_this.event==='click'||_this.event==='hover'&&positionWrapper){log({title:'click',data:[{event:event,status:status===STATUS.OPEN?'closing':'opening'}],debug:_this.debug});_this.toggle();}});_defineProperty(_assertThisInitialized(_this),\"handleMouseEnter\",function(){var _this$props2=_this.props,event=_this$props2.event,open=_this$props2.open;if(is[\"boolean\"](open)||isMobile())return;var status=_this.state.status;/* istanbul ignore else */if(_this.event==='hover'&&status===STATUS.IDLE){log({title:'mouseEnter',data:[{key:'originalEvent',value:event}],debug:_this.debug});clearTimeout(_this.eventDelayTimeout);_this.toggle();}});_defineProperty(_assertThisInitialized(_this),\"handleMouseLeave\",function(){var _this$props3=_this.props,event=_this$props3.event,eventDelay=_this$props3.eventDelay,open=_this$props3.open;if(is[\"boolean\"](open)||isMobile())return;var _this$state2=_this.state,status=_this$state2.status,positionWrapper=_this$state2.positionWrapper;/* istanbul ignore else */if(_this.event==='hover'){log({title:'mouseLeave',data:[{key:'originalEvent',value:event}],debug:_this.debug});if(!eventDelay){_this.toggle(STATUS.IDLE);}else if([STATUS.OPENING,STATUS.OPEN].indexOf(status)!==-1&&!positionWrapper&&!_this.eventDelayTimeout){_this.eventDelayTimeout=setTimeout(function(){delete _this.eventDelayTimeout;_this.toggle();},eventDelay*1000);}}});_this.state={currentPlacement:props.placement,needsUpdate:false,positionWrapper:props.wrapperOptions.position&&!!props.target,status:STATUS.INIT,statusWrapper:STATUS.INIT};_this._isMounted=false;_this.hasMounted=false;if(canUseDOM()){window.addEventListener('load',function(){if(_this.popper){_this.popper.instance.update();}if(_this.wrapperPopper){_this.wrapperPopper.instance.update();}});}return _this;}_createClass(ReactFloater,[{key:\"componentDidMount\",value:function componentDidMount(){if(!canUseDOM())return;var positionWrapper=this.state.positionWrapper;var _this$props5=this.props,children=_this$props5.children,open=_this$props5.open,target=_this$props5.target;this._isMounted=true;log({title:'init',data:{hasChildren:!!children,hasTarget:!!target,isControlled:is[\"boolean\"](open),positionWrapper:positionWrapper,target:this.target,floater:this.floaterRef},debug:this.debug});if(!this.hasMounted){this.initPopper();this.hasMounted=true;}if(!children&&target&&!is[\"boolean\"](open));}},{key:\"componentDidUpdate\",value:function componentDidUpdate(prevProps,prevState){if(!canUseDOM())return;var _this$props6=this.props,autoOpen=_this$props6.autoOpen,open=_this$props6.open,target=_this$props6.target,wrapperOptions=_this$props6.wrapperOptions;var _treeChanges=treeChanges(prevState,this.state),changedFrom=_treeChanges.changedFrom,changed=_treeChanges.changed;if(prevProps.open!==open){var forceStatus;// always follow `open` in controlled mode\nif(is[\"boolean\"](open)){forceStatus=open?STATUS.OPENING:STATUS.CLOSING;}this.toggle(forceStatus);}if(prevProps.wrapperOptions.position!==wrapperOptions.position||prevProps.target!==target){this.changeWrapperPosition(this.props);}if(changed('status',STATUS.IDLE)&&open){this.toggle(STATUS.OPEN);}else if(changedFrom('status',STATUS.INIT,STATUS.IDLE)&&autoOpen){this.toggle(STATUS.OPEN);}if(this.popper&&changed('status',STATUS.OPENING)){this.popper.instance.update();}if(this.floaterRef&&(changed('status',STATUS.OPENING)||changed('status',STATUS.CLOSING))){once(this.floaterRef,'transitionend',this.handleTransitionEnd);}if(changed('needsUpdate',true)){this.rebuildPopper();}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){if(!canUseDOM())return;this._isMounted=false;if(this.popper){this.popper.instance.destroy();}if(this.wrapperPopper){this.wrapperPopper.instance.destroy();}}},{key:\"initPopper\",value:function initPopper(){var _this2=this;var target=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.target;var positionWrapper=this.state.positionWrapper;var _this$props7=this.props,disableFlip=_this$props7.disableFlip,getPopper=_this$props7.getPopper,hideArrow=_this$props7.hideArrow,offset=_this$props7.offset,placement=_this$props7.placement,wrapperOptions=_this$props7.wrapperOptions;var flipBehavior=placement==='top'||placement==='bottom'?'flip':['right','bottom-end','top-end','left','top-start','bottom-start'];/* istanbul ignore else */if(placement==='center'){this.setState({status:STATUS.IDLE});}else if(target&&this.floaterRef){var _this$options=this.options,arrow=_this$options.arrow,flip=_this$options.flip,offsetOptions=_this$options.offset,rest=_objectWithoutProperties(_this$options,_excluded);new Popper(target,this.floaterRef,{placement:placement,modifiers:_objectSpread2({arrow:_objectSpread2({enabled:!hideArrow,element:this.arrowRef},arrow),flip:_objectSpread2({enabled:!disableFlip,behavior:flipBehavior},flip),offset:_objectSpread2({offset:\"0, \".concat(offset,\"px\")},offsetOptions)},rest),onCreate:function onCreate(data){var _this2$floaterRef;_this2.popper=data;if(!((_this2$floaterRef=_this2.floaterRef)!==null&&_this2$floaterRef!==void 0&&_this2$floaterRef.isConnected)){_this2.setState({needsUpdate:true});return;}getPopper(data,'floater');if(_this2._isMounted){_this2.setState({currentPlacement:data.placement,status:STATUS.IDLE});}if(placement!==data.placement){setTimeout(function(){data.instance.update();},1);}},onUpdate:function onUpdate(data){_this2.popper=data;var currentPlacement=_this2.state.currentPlacement;if(_this2._isMounted&&data.placement!==currentPlacement){_this2.setState({currentPlacement:data.placement});}}});}if(positionWrapper){var wrapperOffset=!is.undefined(wrapperOptions.offset)?wrapperOptions.offset:0;new Popper(this.target,this.wrapperRef,{placement:wrapperOptions.placement||placement,modifiers:{arrow:{enabled:false},offset:{offset:\"0, \".concat(wrapperOffset,\"px\")},flip:{enabled:false}},onCreate:function onCreate(data){_this2.wrapperPopper=data;if(_this2._isMounted){_this2.setState({statusWrapper:STATUS.IDLE});}getPopper(data,'wrapper');if(placement!==data.placement){setTimeout(function(){data.instance.update();},1);}}});}}},{key:\"rebuildPopper\",value:function rebuildPopper(){var _this3=this;this.floaterRefInterval=setInterval(function(){var _this3$floaterRef;if((_this3$floaterRef=_this3.floaterRef)!==null&&_this3$floaterRef!==void 0&&_this3$floaterRef.isConnected){clearInterval(_this3.floaterRefInterval);_this3.setState({needsUpdate:false});_this3.initPopper();}},50);}},{key:\"changeWrapperPosition\",value:function changeWrapperPosition(_ref){var target=_ref.target,wrapperOptions=_ref.wrapperOptions;this.setState({positionWrapper:wrapperOptions.position&&!!target});}},{key:\"toggle\",value:function toggle(forceStatus){var status=this.state.status;var nextStatus=status===STATUS.OPEN?STATUS.CLOSING:STATUS.OPENING;if(!is.undefined(forceStatus)){nextStatus=forceStatus;}this.setState({status:nextStatus});}},{key:\"debug\",get:function get(){var debug=this.props.debug;return debug||canUseDOM()&&'ReactFloaterDebug'in window&&!!window.ReactFloaterDebug;}},{key:\"event\",get:function get(){var _this$props8=this.props,disableHoverToClick=_this$props8.disableHoverToClick,event=_this$props8.event;if(event==='hover'&&isMobile()&&!disableHoverToClick){return 'click';}return event;}},{key:\"options\",get:function get(){var options=this.props.options;return deepmerge(DEFAULTS,options||{});}},{key:\"styles\",get:function get(){var _this4=this;var _this$state3=this.state,status=_this$state3.status,positionWrapper=_this$state3.positionWrapper,statusWrapper=_this$state3.statusWrapper;var styles=this.props.styles;var nextStyles=deepmerge(getStyles(styles),styles);if(positionWrapper){var wrapperStyles;if(!([STATUS.IDLE].indexOf(status)!==-1)||!([STATUS.IDLE].indexOf(statusWrapper)!==-1)){wrapperStyles=nextStyles.wrapperPosition;}else {wrapperStyles=this.wrapperPopper.styles;}nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),wrapperStyles);}/* istanbul ignore else */if(this.target){var targetStyles=window.getComputedStyle(this.target);/* istanbul ignore else */if(this.wrapperStyles){nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),this.wrapperStyles);}else if(!(['relative','static'].indexOf(targetStyles.position)!==-1)){this.wrapperStyles={};if(!positionWrapper){POSITIONING_PROPS.forEach(function(d){_this4.wrapperStyles[d]=targetStyles[d];});nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),this.wrapperStyles);this.target.style.position='relative';this.target.style.top='auto';this.target.style.right='auto';this.target.style.bottom='auto';this.target.style.left='auto';}}}return nextStyles;}},{key:\"target\",get:function get(){if(!canUseDOM())return null;var target=this.props.target;if(target){if(is.domElement(target)){return target;}return document.querySelector(target);}return this.childRef||this.wrapperRef;}},{key:\"render\",value:function render(){var _this$state4=this.state,currentPlacement=_this$state4.currentPlacement,positionWrapper=_this$state4.positionWrapper,status=_this$state4.status;var _this$props9=this.props,children=_this$props9.children,component=_this$props9.component,content=_this$props9.content,disableAnimation=_this$props9.disableAnimation,footer=_this$props9.footer,hideArrow=_this$props9.hideArrow,id=_this$props9.id,open=_this$props9.open,showCloseButton=_this$props9.showCloseButton,style=_this$props9.style,target=_this$props9.target,title=_this$props9.title;var wrapper=/*#__PURE__*/React.createElement(ReactFloaterWrapper,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:style,styles:this.styles.wrapper},children);var output={};if(positionWrapper){output.wrapperInPortal=wrapper;}else {output.wrapperAsChildren=wrapper;}return/*#__PURE__*/React.createElement(\"span\",null,/*#__PURE__*/React.createElement(ReactFloaterPortal,{hasChildren:!!children,id:id,placement:currentPlacement,setRef:this.setFloaterRef,target:target,zIndex:this.styles.options.zIndex},/*#__PURE__*/React.createElement(Floater,{component:component,content:content,disableAnimation:disableAnimation,footer:footer,handleClick:this.handleClick,hideArrow:hideArrow||currentPlacement==='center',open:open,placement:currentPlacement,positionWrapper:positionWrapper,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:showCloseButton,status:status,styles:this.styles,title:title}),output.wrapperInPortal),output.wrapperAsChildren);}}]);return ReactFloater;}(React.Component);_defineProperty(ReactFloater,\"propTypes\",{autoOpen:PropTypes.bool,callback:PropTypes.func,children:PropTypes.node,component:isRequiredIf(PropTypes.oneOfType([PropTypes.func,PropTypes.element]),function(props){return !props.content;}),content:isRequiredIf(PropTypes.node,function(props){return !props.component;}),debug:PropTypes.bool,disableAnimation:PropTypes.bool,disableFlip:PropTypes.bool,disableHoverToClick:PropTypes.bool,event:PropTypes.oneOf(['hover','click']),eventDelay:PropTypes.number,footer:PropTypes.node,getPopper:PropTypes.func,hideArrow:PropTypes.bool,id:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),offset:PropTypes.number,open:PropTypes.bool,options:PropTypes.object,placement:PropTypes.oneOf(['top','top-start','top-end','bottom','bottom-start','bottom-end','left','left-start','left-end','right','right-start','right-end','auto','center']),showCloseButton:PropTypes.bool,style:PropTypes.object,styles:PropTypes.object,target:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),title:PropTypes.node,wrapperOptions:PropTypes.shape({offset:PropTypes.number,placement:PropTypes.oneOf(['top','top-start','top-end','bottom','bottom-start','bottom-end','left','left-start','left-end','right','right-start','right-end','auto']),position:PropTypes.bool})});_defineProperty(ReactFloater,\"defaultProps\",{autoOpen:false,callback:noop,debug:false,disableAnimation:false,disableFlip:false,disableHoverToClick:false,event:'click',eventDelay:0.4,getPopper:noop,hideArrow:false,offset:15,placement:'bottom',showCloseButton:false,styles:{},target:null,wrapperOptions:{position:false}});\n\nexport { ReactFloater as default };\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { compareNumbers, compareValues, getIterables, includesOrEqualsTo, nested } from './helpers';\nimport { Data, KeyType, TreeChanges, Value } from './types';\n\nexport default function treeChanges

>(\n previousData: P,\n data: D,\n): TreeChanges {\n if ([previousData, data].some(is.nullOrUndefined)) {\n throw new Error('Missing required parameters');\n }\n\n if (![previousData, data].every(d => is.plainObject(d) || is.array(d))) {\n throw new Error('Expected plain objects or array');\n }\n\n const added = (key?: K, value?: Value): boolean => {\n try {\n return compareValues(previousData, data, { key, type: 'added', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changed = (key?: K | string, actual?: Value, previous?: Value): boolean => {\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n const hasPrevious = is.defined(previous);\n\n if (hasActual || hasPrevious) {\n const leftComparator = hasPrevious\n ? includesOrEqualsTo(previous, left)\n : !includesOrEqualsTo(actual, left);\n const rightComparator = includesOrEqualsTo(actual, right);\n\n return leftComparator && rightComparator;\n }\n\n if ([left, right].every(is.array) || [left, right].every(is.plainObject)) {\n return !equal(left, right);\n }\n\n return left !== right;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changedFrom = (key: K | string, previous: Value, actual?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n\n return (\n includesOrEqualsTo(previous, left) &&\n (hasActual ? includesOrEqualsTo(actual, right) : !hasActual)\n );\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n /**\n * @deprecated\n * Use \"changed\" instead\n */\n const changedTo = (key: K | string, actual: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n /* istanbul ignore next */\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('`changedTo` is deprecated! Replace it with `change`');\n }\n\n return changed(key, actual);\n };\n\n const decreased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers(previousData, data, { key, actual, previous, type: 'decreased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const emptied = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !!left.length && !right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const filled = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !left.length && !!right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const increased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers(previousData, data, { key, actual, previous, type: 'increased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const removed = (key?: K, value?: Value): boolean => {\n try {\n return compareValues(previousData, data, { key, type: 'removed', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n return { added, changed, changedFrom, changedTo, decreased, emptied, filled, increased, removed };\n}\n\nexport * from './types';\n","export const ACTIONS = {\n INIT: 'init',\n START: 'start',\n STOP: 'stop',\n RESET: 'reset',\n PREV: 'prev',\n NEXT: 'next',\n GO: 'go',\n CLOSE: 'close',\n SKIP: 'skip',\n UPDATE: 'update',\n} as const;\n\nexport const EVENTS = {\n TOUR_START: 'tour:start',\n STEP_BEFORE: 'step:before',\n BEACON: 'beacon',\n TOOLTIP: 'tooltip',\n STEP_AFTER: 'step:after',\n TOUR_END: 'tour:end',\n TOUR_STATUS: 'tour:status',\n TARGET_NOT_FOUND: 'error:target_not_found',\n ERROR: 'error',\n} as const;\n\nexport const LIFECYCLE = {\n INIT: 'init',\n READY: 'ready',\n BEACON: 'beacon',\n TOOLTIP: 'tooltip',\n COMPLETE: 'complete',\n ERROR: 'error',\n} as const;\n\nexport const ORIGIN = {\n BUTTON_CLOSE: 'button_close',\n BUTTON_PRIMARY: 'button_primary',\n KEYBOARD: 'keyboard',\n OVERLAY: 'overlay',\n} as const;\n\nexport const STATUS = {\n IDLE: 'idle',\n READY: 'ready',\n WAITING: 'waiting',\n RUNNING: 'running',\n PAUSED: 'paused',\n SKIPPED: 'skipped',\n FINISHED: 'finished',\n ERROR: 'error',\n} as const;\n","import scroll from 'scroll';\nimport scrollParent from 'scrollparent';\n\nexport function canUseDOM() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}\n\n/**\n * Find the bounding client rect\n */\nexport function getClientRect(element: HTMLElement | null) {\n if (!element) {\n return null;\n }\n\n return element.getBoundingClientRect();\n}\n\n/**\n * Helper function to get the browser-normalized \"document height\"\n */\nexport function getDocumentHeight(median = true): number {\n const { body, documentElement } = document;\n\n if (!body || !documentElement) {\n return 0;\n }\n\n if (median) {\n const heights = [\n body.scrollHeight,\n body.offsetHeight,\n documentElement.clientHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight,\n ].sort((a, b) => a - b);\n const middle = Math.floor(heights.length / 2);\n\n if (heights.length % 2 === 0) {\n return (heights[middle - 1] + heights[middle]) / 2;\n }\n\n return heights[middle];\n }\n\n return Math.max(\n body.scrollHeight,\n body.offsetHeight,\n documentElement.clientHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight,\n );\n}\n\n/**\n * Find and return the target DOM element based on a step's 'target'.\n */\nexport function getElement(element: string | HTMLElement): HTMLElement | null {\n if (typeof element === 'string') {\n return document.querySelector(element);\n }\n\n return element;\n}\n\n/**\n * Get computed style property\n */\nexport function getStyleComputedProperty(el: HTMLElement): CSSStyleDeclaration | null {\n if (!el || el.nodeType !== 1) {\n return null;\n }\n\n return getComputedStyle(el);\n}\n\n/**\n * Get scroll parent with fix\n */\nexport function getScrollParent(\n element: HTMLElement | null,\n skipFix: boolean,\n forListener?: boolean,\n) {\n if (!element) {\n return scrollDocument();\n }\n\n const parent = scrollParent(element) as HTMLElement;\n\n if (parent) {\n if (parent.isSameNode(scrollDocument())) {\n if (forListener) {\n return document;\n }\n\n return scrollDocument();\n }\n\n const hasScrolling = parent.scrollHeight > parent.offsetHeight;\n\n if (!hasScrolling && !skipFix) {\n parent.style.overflow = 'initial';\n\n return scrollDocument();\n }\n }\n\n return parent;\n}\n\n/**\n * Check if the element has custom scroll parent\n */\nexport function hasCustomScrollParent(element: HTMLElement | null, skipFix: boolean): boolean {\n if (!element) {\n return false;\n }\n\n const parent = getScrollParent(element, skipFix);\n\n return parent ? !parent.isSameNode(scrollDocument()) : false;\n}\n\n/**\n * Check if the element has custom offset parent\n */\nexport function hasCustomOffsetParent(element: HTMLElement): boolean {\n return element.offsetParent !== document.body;\n}\n\n/**\n * Check if an element has fixed/sticky position\n */\nexport function hasPosition(el: HTMLElement | Node | null, type: string = 'fixed'): boolean {\n if (!el || !(el instanceof HTMLElement)) {\n return false;\n }\n\n const { nodeName } = el;\n const styles = getStyleComputedProperty(el);\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n\n if (styles && styles.position === type) {\n return true;\n }\n\n if (!el.parentNode) {\n return false;\n }\n\n return hasPosition(el.parentNode, type);\n}\n\n/**\n * Check if the element is visible\n */\nexport function isElementVisible(element: HTMLElement): element is HTMLElement {\n if (!element) {\n return false;\n }\n\n let parentElement: HTMLElement | null = element;\n\n while (parentElement) {\n if (parentElement === document.body) {\n break;\n }\n\n if (parentElement instanceof HTMLElement) {\n const { display, visibility } = getComputedStyle(parentElement);\n\n if (display === 'none' || visibility === 'hidden') {\n return false;\n }\n }\n\n parentElement = parentElement.parentElement ?? null;\n }\n\n return true;\n}\n\n/**\n * Find and return the target DOM element based on a step's 'target'.\n */\nexport function getElementPosition(\n element: HTMLElement | null,\n offset: number,\n skipFix: boolean,\n): number {\n const elementRect = getClientRect(element);\n const parent = getScrollParent(element, skipFix);\n const hasScrollParent = hasCustomScrollParent(element, skipFix);\n let parentTop = 0;\n let top = elementRect?.top ?? 0;\n\n if (parent instanceof HTMLElement) {\n parentTop = parent.scrollTop;\n\n if (!hasScrollParent && !hasPosition(element)) {\n top += parentTop;\n }\n\n if (!parent.isSameNode(scrollDocument())) {\n top += scrollDocument().scrollTop;\n }\n }\n\n return Math.floor(top - offset);\n}\n\n/**\n * Get the scrollTop position\n */\nexport function getScrollTo(element: HTMLElement | null, offset: number, skipFix: boolean): number {\n if (!element) {\n return 0;\n }\n\n const { offsetTop = 0, scrollTop = 0 } = scrollParent(element) ?? {};\n let top = element.getBoundingClientRect().top + scrollTop;\n\n if (!!offsetTop && (hasCustomScrollParent(element, skipFix) || hasCustomOffsetParent(element))) {\n top -= offsetTop;\n }\n\n const output = Math.floor(top - offset);\n\n return output < 0 ? 0 : output;\n}\n\nexport function scrollDocument(): Element | HTMLElement {\n return document.scrollingElement ?? document.documentElement;\n}\n\n/**\n * Scroll to position\n */\nexport function scrollTo(\n value: number,\n options: { duration?: number; element: Element | HTMLElement },\n): Promise {\n const { duration, element } = options;\n\n return new Promise((resolve, reject) => {\n const { scrollTop } = element;\n\n const limit = value > scrollTop ? value - scrollTop : scrollTop - value;\n\n scroll.top(element as HTMLElement, value, { duration: limit < 100 ? 50 : duration }, error => {\n if (error && error.message !== 'Element already at target scroll position') {\n return reject(error);\n }\n\n return resolve();\n });\n });\n}\n","import { isValidElement, ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport is from 'is-lite';\n\nimport { LIFECYCLE } from '~/literals';\n\nimport { AnyObject, Lifecycle, NarrowPlainObject, Step } from '~/types';\n\nimport { hasPosition } from './dom';\n\ninterface LogOptions {\n /** The data to be logged */\n data: any;\n /** display the log */\n debug?: boolean;\n /** The title the logger was called from */\n title: string;\n /** If true, the message will be a warning */\n warn?: boolean;\n}\n\ninterface ShouldScrollOptions {\n isFirstStep: boolean;\n lifecycle: Lifecycle;\n previousLifecycle: Lifecycle;\n scrollToFirstStep: boolean;\n step: Step;\n target: HTMLElement | null;\n}\n\nexport const isReact16 = createPortal !== undefined;\n\n/**\n * Get the current browser\n */\nexport function getBrowser(userAgent: string = navigator.userAgent): string {\n let browser = userAgent;\n\n if (typeof window === 'undefined') {\n browser = 'node';\n }\n // @ts-expect-error IE support\n else if (document.documentMode) {\n browser = 'ie';\n } else if (/Edge/.test(userAgent)) {\n browser = 'edge';\n }\n // @ts-expect-error Opera 8.0+\n else if (Boolean(window.opera) || userAgent.includes(' OPR/')) {\n browser = 'opera';\n }\n // @ts-expect-error Firefox 1.0+\n else if (typeof window.InstallTrigger !== 'undefined') {\n browser = 'firefox';\n }\n // @ts-expect-error Chrome 1+\n else if (window.chrome) {\n browser = 'chrome';\n }\n // Safari (and Chrome iOS, Firefox iOS)\n else if (/(Version\\/([\\d._]+).*Safari|CriOS|FxiOS| Mobile\\/)/.test(userAgent)) {\n browser = 'safari';\n }\n\n return browser;\n}\n\n/**\n * Get Object type\n */\nexport function getObjectType(value: unknown): string {\n return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();\n}\n\n/**\n * Get text from React components\n */\nexport function getText(root: ReactNode): string {\n const content: Array = [];\n\n const recurse = (child: ReactNode) => {\n if (typeof child === 'string' || typeof child === 'number') {\n content.push(child);\n } else if (Array.isArray(child)) {\n child.forEach(c => recurse(c));\n } else if (isValidElement(child)) {\n const { children } = child.props;\n\n if (Array.isArray(children)) {\n children.forEach(c => recurse(c));\n } else {\n recurse(children);\n }\n }\n };\n\n recurse(root);\n\n return content.join(' ').trim();\n}\n\nexport function hasValidKeys(object: Record, keys?: Array): boolean {\n if (!is.plainObject(object) || !is.array(keys)) {\n return false;\n }\n\n return Object.keys(object).every(d => keys.includes(d));\n}\n\n/**\n * Convert hex to RGB\n */\nexport function hexToRGB(hex: string): Array {\n const shorthandRegex = /^#?([\\da-f])([\\da-f])([\\da-f])$/i;\n const properHex = hex.replace(shorthandRegex, (_m, r, g, b) => r + r + g + g + b + b);\n\n const result = /^#?([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i.exec(properHex);\n\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [];\n}\n\n/**\n * Decide if the step shouldn't skip the beacon\n * @param {Object} step\n *\n * @returns {boolean}\n */\nexport function hideBeacon(step: Step): boolean {\n return step.disableBeacon || step.placement === 'center';\n}\n\n/**\n * Detect legacy browsers\n *\n * @returns {boolean}\n */\nexport function isLegacy(): boolean {\n return !['chrome', 'safari', 'firefox', 'opera'].includes(getBrowser());\n}\n\n/**\n * Log method calls if debug is enabled\n */\nexport function log({ data, debug = false, title, warn = false }: LogOptions) {\n /* eslint-disable no-console */\n const logFn = warn ? console.warn || console.error : console.log;\n\n if (debug) {\n if (title && data) {\n console.groupCollapsed(\n `%creact-joyride: ${title}`,\n 'color: #ff0044; font-weight: bold; font-size: 12px;',\n );\n\n if (Array.isArray(data)) {\n data.forEach(d => {\n if (is.plainObject(d) && d.key) {\n logFn.apply(console, [d.key, d.value]);\n } else {\n logFn.apply(console, [d]);\n }\n });\n } else {\n logFn.apply(console, [data]);\n }\n\n console.groupEnd();\n } else {\n console.error('Missing title or data props');\n }\n }\n /* eslint-enable */\n}\n\n/**\n * A function that does nothing.\n */\nexport function noop() {\n return undefined;\n}\n\n/**\n * Type-safe Object.keys()\n */\nexport function objectKeys(input: T) {\n return Object.keys(input) as Array;\n}\n\n/**\n * Remove properties from an object\n */\nexport function omit, K extends keyof T>(\n input: NarrowPlainObject,\n ...filter: K[]\n) {\n if (!is.plainObject(input)) {\n throw new TypeError('Expected an object');\n }\n\n const output: any = {};\n\n for (const key in input) {\n /* istanbul ignore else */\n if ({}.hasOwnProperty.call(input, key)) {\n if (!filter.includes(key as unknown as K)) {\n output[key] = input[key];\n }\n }\n }\n\n return output as Omit;\n}\n\n/**\n * Select properties from an object\n */\nexport function pick, K extends keyof T>(\n input: NarrowPlainObject,\n ...filter: K[]\n) {\n if (!is.plainObject(input)) {\n throw new TypeError('Expected an object');\n }\n\n if (!filter.length) {\n return input;\n }\n\n const output: any = {};\n\n for (const key in input) {\n /* istanbul ignore else */\n if ({}.hasOwnProperty.call(input, key)) {\n if (filter.includes(key as unknown as K)) {\n output[key] = input[key];\n }\n }\n }\n\n return output as Pick;\n}\n\nexport function shouldScroll(options: ShouldScrollOptions): boolean {\n const { isFirstStep, lifecycle, previousLifecycle, scrollToFirstStep, step, target } = options;\n\n return (\n !step.disableScrolling &&\n (!isFirstStep || scrollToFirstStep || lifecycle === LIFECYCLE.TOOLTIP) &&\n step.placement !== 'center' &&\n (!step.isFixed || !hasPosition(target)) && // fixed steps don't need to scroll\n previousLifecycle !== lifecycle &&\n ([LIFECYCLE.BEACON, LIFECYCLE.TOOLTIP] as Array).includes(lifecycle)\n );\n}\n\n/**\n * Block execution\n */\nexport function sleep(seconds = 1) {\n return new Promise(resolve => {\n setTimeout(resolve, seconds * 1000);\n });\n}\n","import { noop } from '~/modules/helpers';\n\nexport const defaultFloaterProps = {\n options: {\n preventOverflow: {\n boundariesElement: 'scrollParent',\n },\n },\n wrapperOptions: {\n offset: -18,\n position: true,\n },\n};\n\nexport const defaultLocale = {\n back: 'Back',\n close: 'Close',\n last: 'Last',\n next: 'Next',\n open: 'Open the dialog',\n skip: 'Skip',\n};\n\nexport const defaultStep = {\n event: 'click',\n placement: 'bottom',\n offset: 10,\n disableBeacon: false,\n disableCloseOnEsc: false,\n disableOverlay: false,\n disableOverlayClose: false,\n disableScrollParentFix: false,\n disableScrolling: false,\n hideBackButton: false,\n hideCloseButton: false,\n hideFooter: false,\n isFixed: false,\n locale: defaultLocale,\n showProgress: false,\n showSkipButton: false,\n spotlightClicks: false,\n spotlightPadding: 10,\n};\n\nexport const defaultProps = {\n continuous: false,\n debug: false,\n disableCloseOnEsc: false,\n disableOverlay: false,\n disableOverlayClose: false,\n disableScrolling: false,\n disableScrollParentFix: false,\n getHelpers: noop(),\n hideBackButton: false,\n run: true,\n scrollOffset: 20,\n scrollDuration: 300,\n scrollToFirstStep: false,\n showSkipButton: false,\n showProgress: false,\n spotlightClicks: false,\n spotlightPadding: 10,\n steps: [],\n};\n","import deepmerge from 'deepmerge';\n\nimport { hexToRGB } from './modules/helpers';\nimport { Props, StepMerged, StylesOptions, StylesWithFloaterStyles } from './types';\n\nconst defaultOptions = {\n arrowColor: '#fff',\n backgroundColor: '#fff',\n beaconSize: 36,\n overlayColor: 'rgba(0, 0, 0, 0.5)',\n primaryColor: '#f04',\n spotlightShadow: '0 0 15px rgba(0, 0, 0, 0.5)',\n textColor: '#333',\n width: 380,\n zIndex: 100,\n} satisfies StylesOptions;\n\nconst buttonBase = {\n backgroundColor: 'transparent',\n border: 0,\n borderRadius: 0,\n color: '#555',\n cursor: 'pointer',\n fontSize: 16,\n lineHeight: 1,\n padding: 8,\n WebkitAppearance: 'none',\n};\n\nconst spotlight = {\n borderRadius: 4,\n position: 'absolute',\n};\n\nexport default function getStyles(props: Props, step: StepMerged) {\n const { floaterProps, styles } = props;\n const mergedFloaterProps = deepmerge(step.floaterProps ?? {}, floaterProps ?? {});\n const mergedStyles = deepmerge(styles ?? {}, step.styles ?? {});\n const options = deepmerge(defaultOptions, mergedStyles.options || {}) satisfies StylesOptions;\n const hideBeacon = step.placement === 'center' || step.disableBeacon;\n let { width } = options;\n\n if (window.innerWidth > 480) {\n width = 380;\n }\n\n if ('width' in options) {\n width =\n typeof options.width === 'number' && window.innerWidth < options.width\n ? window.innerWidth - 30\n : options.width;\n }\n\n const overlay = {\n bottom: 0,\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n right: 0,\n top: 0,\n zIndex: options.zIndex,\n };\n\n const defaultStyles = {\n beacon: {\n ...buttonBase,\n display: hideBeacon ? 'none' : 'inline-block',\n height: options.beaconSize,\n position: 'relative',\n width: options.beaconSize,\n zIndex: options.zIndex,\n },\n beaconInner: {\n animation: 'joyride-beacon-inner 1.2s infinite ease-in-out',\n backgroundColor: options.primaryColor,\n borderRadius: '50%',\n display: 'block',\n height: '50%',\n left: '50%',\n opacity: 0.7,\n position: 'absolute',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n width: '50%',\n },\n beaconOuter: {\n animation: 'joyride-beacon-outer 1.2s infinite ease-in-out',\n backgroundColor: `rgba(${hexToRGB(options.primaryColor).join(',')}, 0.2)`,\n border: `2px solid ${options.primaryColor}`,\n borderRadius: '50%',\n boxSizing: 'border-box',\n display: 'block',\n height: '100%',\n left: 0,\n opacity: 0.9,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center',\n width: '100%',\n },\n tooltip: {\n backgroundColor: options.backgroundColor,\n borderRadius: 5,\n boxSizing: 'border-box',\n color: options.textColor,\n fontSize: 16,\n maxWidth: '100%',\n padding: 15,\n position: 'relative',\n width,\n },\n tooltipContainer: {\n lineHeight: 1.4,\n textAlign: 'center',\n },\n tooltipTitle: {\n fontSize: 18,\n margin: 0,\n },\n tooltipContent: {\n padding: '20px 10px',\n },\n tooltipFooter: {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'flex-end',\n marginTop: 15,\n },\n tooltipFooterSpacer: {\n flex: 1,\n },\n buttonNext: {\n ...buttonBase,\n backgroundColor: options.primaryColor,\n borderRadius: 4,\n color: '#fff',\n },\n buttonBack: {\n ...buttonBase,\n color: options.primaryColor,\n marginLeft: 'auto',\n marginRight: 5,\n },\n buttonClose: {\n ...buttonBase,\n color: options.textColor,\n height: 14,\n padding: 15,\n position: 'absolute',\n right: 0,\n top: 0,\n width: 14,\n },\n buttonSkip: {\n ...buttonBase,\n color: options.textColor,\n fontSize: 14,\n },\n overlay: {\n ...overlay,\n backgroundColor: options.overlayColor,\n mixBlendMode: 'hard-light',\n },\n overlayLegacy: {\n ...overlay,\n },\n overlayLegacyCenter: {\n ...overlay,\n backgroundColor: options.overlayColor,\n },\n spotlight: {\n ...spotlight,\n backgroundColor: 'gray',\n },\n spotlightLegacy: {\n ...spotlight,\n boxShadow: `0 0 0 9999px ${options.overlayColor}, ${options.spotlightShadow}`,\n },\n floaterStyles: {\n arrow: {\n color: mergedFloaterProps?.styles?.arrow?.color ?? options.arrowColor,\n },\n options: {\n zIndex: options.zIndex + 100,\n },\n },\n options,\n };\n\n return deepmerge(defaultStyles, mergedStyles) as StylesWithFloaterStyles;\n}\n","import { Props as FloaterProps } from 'react-floater';\nimport deepmerge from 'deepmerge';\nimport is from 'is-lite';\nimport { SetRequired } from 'type-fest';\n\nimport { defaultFloaterProps, defaultLocale, defaultStep } from '~/defaults';\nimport getStyles from '~/styles';\nimport { Props, Step, StepMerged } from '~/types';\n\nimport { getElement, hasCustomScrollParent } from './dom';\nimport { log, omit, pick } from './helpers';\n\nfunction getTourProps(props: Props) {\n return pick(\n props,\n 'beaconComponent',\n 'disableCloseOnEsc',\n 'disableOverlay',\n 'disableOverlayClose',\n 'disableScrolling',\n 'disableScrollParentFix',\n 'floaterProps',\n 'hideBackButton',\n 'hideCloseButton',\n 'locale',\n 'showProgress',\n 'showSkipButton',\n 'spotlightClicks',\n 'spotlightPadding',\n 'styles',\n 'tooltipComponent',\n );\n}\n\nexport function getMergedStep(props: Props, currentStep?: Step): StepMerged {\n const step = currentStep ?? {};\n const mergedStep = deepmerge.all([defaultStep, getTourProps(props), step], {\n isMergeableObject: is.plainObject,\n }) as StepMerged;\n\n const mergedStyles = getStyles(props, mergedStep);\n const scrollParent = hasCustomScrollParent(\n getElement(mergedStep.target),\n mergedStep.disableScrollParentFix,\n );\n const floaterProps = deepmerge.all([\n defaultFloaterProps,\n props.floaterProps ?? {},\n mergedStep.floaterProps ?? {},\n ]) as SetRequired;\n\n // Set react-floater props\n floaterProps.offset = mergedStep.offset;\n floaterProps.styles = deepmerge(floaterProps.styles ?? {}, mergedStyles.floaterStyles);\n\n floaterProps.offset += props.spotlightPadding ?? mergedStep.spotlightPadding ?? 0;\n\n if (mergedStep.placementBeacon && floaterProps.wrapperOptions) {\n floaterProps.wrapperOptions.placement = mergedStep.placementBeacon;\n }\n\n if (scrollParent && floaterProps.options.preventOverflow) {\n floaterProps.options.preventOverflow.boundariesElement = 'window';\n }\n\n return {\n ...mergedStep,\n locale: deepmerge.all([defaultLocale, props.locale ?? {}, mergedStep.locale || {}]),\n floaterProps,\n styles: omit(mergedStyles, 'floaterStyles'),\n };\n}\n\n/**\n * Validate if a step is valid\n */\nexport function validateStep(step: Step, debug: boolean = false): boolean {\n if (!is.plainObject(step)) {\n log({\n title: 'validateStep',\n data: 'step must be an object',\n warn: true,\n debug,\n });\n\n return false;\n }\n\n if (!step.target) {\n log({\n title: 'validateStep',\n data: 'target is missing from the step',\n warn: true,\n debug,\n });\n\n return false;\n }\n\n return true;\n}\n\n/**\n * Validate if steps are valid\n */\nexport function validateSteps(steps: Array, debug: boolean = false): boolean {\n if (!is.array(steps)) {\n log({\n title: 'validateSteps',\n data: 'steps must be an array',\n warn: true,\n debug,\n });\n\n return false;\n }\n\n return steps.every(d => validateStep(d, debug));\n}\n","import { Props as FloaterProps } from 'react-floater';\nimport is from 'is-lite';\n\nimport { ACTIONS, LIFECYCLE, STATUS } from '~/literals';\n\nimport { Origin, State, Status, Step, StoreHelpers, StoreOptions } from '~/types';\n\nimport { hasValidKeys, objectKeys, omit } from './helpers';\n\ntype StateWithContinuous = State & { continuous: boolean };\ntype Listener = (state: State) => void;\ntype PopperData = Parameters>[0];\n\nconst defaultState: State = {\n action: 'init',\n controlled: false,\n index: 0,\n lifecycle: LIFECYCLE.INIT,\n origin: null,\n size: 0,\n status: STATUS.IDLE,\n};\nconst validKeys = objectKeys(omit(defaultState, 'controlled', 'size'));\n\nclass Store {\n private beaconPopper: PopperData | null;\n private tooltipPopper: PopperData | null;\n private data: Map = new Map();\n private listener: Listener | null;\n private store: Map = new Map();\n\n constructor(options?: StoreOptions) {\n const { continuous = false, stepIndex, steps = [] } = options ?? {};\n\n this.setState(\n {\n action: ACTIONS.INIT,\n controlled: is.number(stepIndex),\n continuous,\n index: is.number(stepIndex) ? stepIndex : 0,\n lifecycle: LIFECYCLE.INIT,\n origin: null,\n status: steps.length ? STATUS.READY : STATUS.IDLE,\n },\n true,\n );\n\n this.beaconPopper = null;\n this.tooltipPopper = null;\n this.listener = null;\n this.setSteps(steps);\n }\n\n public getState(): State {\n if (!this.store.size) {\n return { ...defaultState };\n }\n\n return {\n action: this.store.get('action') || '',\n controlled: this.store.get('controlled') || false,\n index: parseInt(this.store.get('index'), 10),\n lifecycle: this.store.get('lifecycle') || '',\n origin: this.store.get('origin') || null,\n size: this.store.get('size') || 0,\n status: (this.store.get('status') as Status) || '',\n };\n }\n\n private getNextState(state: Partial, force: boolean = false): State {\n const { action, controlled, index, size, status } = this.getState();\n const newIndex = is.number(state.index) ? state.index : index;\n const nextIndex = controlled && !force ? index : Math.min(Math.max(newIndex, 0), size);\n\n return {\n action: state.action ?? action,\n controlled,\n index: nextIndex,\n lifecycle: state.lifecycle ?? LIFECYCLE.INIT,\n origin: state.origin ?? null,\n size: state.size ?? size,\n status: nextIndex === size ? STATUS.FINISHED : state.status ?? status,\n };\n }\n\n private getSteps(): Array {\n const steps = this.data.get('steps');\n\n return Array.isArray(steps) ? steps : [];\n }\n\n private hasUpdatedState(oldState: State): boolean {\n const before = JSON.stringify(oldState);\n const after = JSON.stringify(this.getState());\n\n return before !== after;\n }\n\n private setState(nextState: Partial, initial: boolean = false) {\n const state = this.getState();\n\n const {\n action,\n index,\n lifecycle,\n origin = null,\n size,\n status,\n } = {\n ...state,\n ...nextState,\n };\n\n this.store.set('action', action);\n this.store.set('index', index);\n this.store.set('lifecycle', lifecycle);\n this.store.set('origin', origin);\n this.store.set('size', size);\n this.store.set('status', status);\n\n if (initial) {\n this.store.set('controlled', nextState.controlled);\n this.store.set('continuous', nextState.continuous);\n }\n\n if (this.listener && this.hasUpdatedState(state)) {\n this.listener(this.getState());\n }\n }\n\n public addListener = (listener: Listener) => {\n this.listener = listener;\n };\n\n public setSteps = (steps: Array) => {\n const { size, status } = this.getState();\n const state = {\n size: steps.length,\n status,\n };\n\n this.data.set('steps', steps);\n\n if (status === STATUS.WAITING && !size && steps.length) {\n state.status = STATUS.RUNNING;\n }\n\n this.setState(state);\n };\n\n public getHelpers(): StoreHelpers {\n return {\n close: this.close,\n go: this.go,\n info: this.info,\n next: this.next,\n open: this.open,\n prev: this.prev,\n reset: this.reset,\n skip: this.skip,\n };\n }\n\n public getPopper = (name: 'beacon' | 'tooltip'): PopperData | null => {\n if (name === 'beacon') {\n return this.beaconPopper;\n }\n\n return this.tooltipPopper;\n };\n\n public setPopper = (name: 'beacon' | 'tooltip', popper: PopperData) => {\n if (name === 'beacon') {\n this.beaconPopper = popper;\n } else {\n this.tooltipPopper = popper;\n }\n };\n\n public cleanupPoppers = () => {\n this.beaconPopper = null;\n this.tooltipPopper = null;\n };\n\n public close = (origin: Origin | null = null) => {\n const { index, status } = this.getState();\n\n if (status !== STATUS.RUNNING) {\n return;\n }\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.CLOSE, index: index + 1, origin }),\n });\n };\n\n public go = (nextIndex: number) => {\n const { controlled, status } = this.getState();\n\n if (controlled || status !== STATUS.RUNNING) {\n return;\n }\n\n const step = this.getSteps()[nextIndex];\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.GO, index: nextIndex }),\n status: step ? status : STATUS.FINISHED,\n });\n };\n\n public info = (): State => this.getState();\n\n public next = () => {\n const { index, status } = this.getState();\n\n if (status !== STATUS.RUNNING) {\n return;\n }\n\n this.setState(this.getNextState({ action: ACTIONS.NEXT, index: index + 1 }));\n };\n\n public open = () => {\n const { status } = this.getState();\n\n if (status !== STATUS.RUNNING) {\n return;\n }\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.UPDATE, lifecycle: LIFECYCLE.TOOLTIP }),\n });\n };\n\n public prev = () => {\n const { index, status } = this.getState();\n\n if (status !== STATUS.RUNNING) {\n return;\n }\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.PREV, index: index - 1 }),\n });\n };\n\n public reset = (restart = false) => {\n const { controlled } = this.getState();\n\n if (controlled) {\n return;\n }\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.RESET, index: 0 }),\n status: restart ? STATUS.RUNNING : STATUS.READY,\n });\n };\n\n public skip = () => {\n const { status } = this.getState();\n\n if (status !== STATUS.RUNNING) {\n return;\n }\n\n this.setState({\n action: ACTIONS.SKIP,\n lifecycle: LIFECYCLE.INIT,\n status: STATUS.SKIPPED,\n });\n };\n\n public start = (nextIndex?: number) => {\n const { index, size } = this.getState();\n\n this.setState({\n ...this.getNextState(\n {\n action: ACTIONS.START,\n index: is.number(nextIndex) ? nextIndex : index,\n },\n true,\n ),\n status: size ? STATUS.RUNNING : STATUS.WAITING,\n });\n };\n\n public stop = (advance = false) => {\n const { index, status } = this.getState();\n\n if (([STATUS.FINISHED, STATUS.SKIPPED] as Array).includes(status)) {\n return;\n }\n\n this.setState({\n ...this.getNextState({ action: ACTIONS.STOP, index: index + (advance ? 1 : 0) }),\n status: STATUS.PAUSED,\n });\n };\n\n public update = (state: Partial) => {\n if (!hasValidKeys(state, validKeys)) {\n throw new Error(`State is not valid. Valid keys: ${validKeys.join(', ')}`);\n }\n\n this.setState({\n ...this.getNextState(\n {\n ...this.getState(),\n ...state,\n action: state.action ?? ACTIONS.UPDATE,\n origin: state.origin ?? null,\n },\n true,\n ),\n });\n };\n}\n\nexport type StoreInstance = ReturnType;\n\nexport default function createStore(options?: StoreOptions) {\n return new Store(options);\n}\n","import * as React from 'react';\n\ninterface Props {\n styles: React.CSSProperties;\n}\n\nfunction JoyrideSpotlight({ styles }: Props) {\n return (\n \n );\n}\n\nexport default JoyrideSpotlight;\n","import * as React from 'react';\nimport treeChanges from 'tree-changes';\n\nimport {\n getClientRect,\n getDocumentHeight,\n getElement,\n getElementPosition,\n getScrollParent,\n hasCustomScrollParent,\n hasPosition,\n} from '~/modules/dom';\nimport { getBrowser, isLegacy, log } from '~/modules/helpers';\n\nimport { LIFECYCLE } from '~/literals';\n\nimport { Lifecycle, OverlayProps } from '~/types';\n\nimport Spotlight from './Spotlight';\n\ninterface State {\n isScrolling: boolean;\n mouseOverSpotlight: boolean;\n showSpotlight: boolean;\n}\n\ninterface SpotlightStyles extends React.CSSProperties {\n height: number;\n left: number;\n top: number;\n width: number;\n}\n\nexport default class JoyrideOverlay extends React.Component {\n isActive = false;\n resizeTimeout?: number;\n scrollTimeout?: number;\n scrollParent?: Document | Element;\n state = {\n isScrolling: false,\n mouseOverSpotlight: false,\n showSpotlight: true,\n };\n\n componentDidMount() {\n const { debug, disableScrolling, disableScrollParentFix = false, target } = this.props;\n const element = getElement(target);\n\n this.scrollParent = getScrollParent(element ?? document.body, disableScrollParentFix, true);\n this.isActive = true;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!disableScrolling && hasCustomScrollParent(element, true)) {\n log({\n title: 'step has a custom scroll parent and can cause trouble with scrolling',\n data: [{ key: 'parent', value: this.scrollParent }],\n debug,\n });\n }\n }\n\n window.addEventListener('resize', this.handleResize);\n }\n\n componentDidUpdate(previousProps: OverlayProps) {\n const { lifecycle, spotlightClicks } = this.props;\n const { changed } = treeChanges(previousProps, this.props);\n\n if (changed('lifecycle', LIFECYCLE.TOOLTIP)) {\n this.scrollParent?.addEventListener('scroll', this.handleScroll, { passive: true });\n\n setTimeout(() => {\n const { isScrolling } = this.state;\n\n if (!isScrolling) {\n this.updateState({ showSpotlight: true });\n }\n }, 100);\n }\n\n if (changed('spotlightClicks') || changed('disableOverlay') || changed('lifecycle')) {\n if (spotlightClicks && lifecycle === LIFECYCLE.TOOLTIP) {\n window.addEventListener('mousemove', this.handleMouseMove, false);\n } else if (lifecycle !== LIFECYCLE.TOOLTIP) {\n window.removeEventListener('mousemove', this.handleMouseMove);\n }\n }\n }\n\n componentWillUnmount() {\n this.isActive = false;\n\n window.removeEventListener('mousemove', this.handleMouseMove);\n window.removeEventListener('resize', this.handleResize);\n\n clearTimeout(this.resizeTimeout);\n clearTimeout(this.scrollTimeout);\n this.scrollParent?.removeEventListener('scroll', this.handleScroll);\n }\n\n hideSpotlight = () => {\n const { continuous, disableOverlay, lifecycle } = this.props;\n const hiddenLifecycles = [LIFECYCLE.BEACON, LIFECYCLE.COMPLETE, LIFECYCLE.ERROR] as Lifecycle[];\n\n return (\n disableOverlay ||\n (continuous ? hiddenLifecycles.includes(lifecycle) : lifecycle !== LIFECYCLE.TOOLTIP)\n );\n };\n\n get overlayStyles() {\n const { mouseOverSpotlight } = this.state;\n const { disableOverlayClose, placement, styles } = this.props;\n\n let baseStyles = styles.overlay;\n\n if (isLegacy()) {\n baseStyles = placement === 'center' ? styles.overlayLegacyCenter : styles.overlayLegacy;\n }\n\n return {\n cursor: disableOverlayClose ? 'default' : 'pointer',\n height: getDocumentHeight(),\n pointerEvents: mouseOverSpotlight ? 'none' : 'auto',\n ...baseStyles,\n } as React.CSSProperties;\n }\n\n get spotlightStyles(): SpotlightStyles {\n const { showSpotlight } = this.state;\n const {\n disableScrollParentFix = false,\n spotlightClicks,\n spotlightPadding = 0,\n styles,\n target,\n } = this.props;\n const element = getElement(target);\n const elementRect = getClientRect(element);\n const isFixedTarget = hasPosition(element);\n const top = getElementPosition(element, spotlightPadding, disableScrollParentFix);\n\n return {\n ...(isLegacy() ? styles.spotlightLegacy : styles.spotlight),\n height: Math.round((elementRect?.height ?? 0) + spotlightPadding * 2),\n left: Math.round((elementRect?.left ?? 0) - spotlightPadding),\n opacity: showSpotlight ? 1 : 0,\n pointerEvents: spotlightClicks ? 'none' : 'auto',\n position: isFixedTarget ? 'fixed' : 'absolute',\n top,\n transition: 'opacity 0.2s',\n width: Math.round((elementRect?.width ?? 0) + spotlightPadding * 2),\n } satisfies React.CSSProperties;\n }\n\n handleMouseMove = (event: MouseEvent) => {\n const { mouseOverSpotlight } = this.state;\n const { height, left, position, top, width } = this.spotlightStyles;\n\n const offsetY = position === 'fixed' ? event.clientY : event.pageY;\n const offsetX = position === 'fixed' ? event.clientX : event.pageX;\n const inSpotlightHeight = offsetY >= top && offsetY <= top + height;\n const inSpotlightWidth = offsetX >= left && offsetX <= left + width;\n const inSpotlight = inSpotlightWidth && inSpotlightHeight;\n\n if (inSpotlight !== mouseOverSpotlight) {\n this.updateState({ mouseOverSpotlight: inSpotlight });\n }\n };\n\n handleScroll = () => {\n const { target } = this.props;\n const element = getElement(target);\n\n if (this.scrollParent !== document) {\n const { isScrolling } = this.state;\n\n if (!isScrolling) {\n this.updateState({ isScrolling: true, showSpotlight: false });\n }\n\n clearTimeout(this.scrollTimeout);\n\n this.scrollTimeout = window.setTimeout(() => {\n this.updateState({ isScrolling: false, showSpotlight: true });\n }, 50);\n } else if (hasPosition(element, 'sticky')) {\n this.updateState({});\n }\n };\n\n handleResize = () => {\n clearTimeout(this.resizeTimeout);\n\n this.resizeTimeout = window.setTimeout(() => {\n if (!this.isActive) {\n return;\n }\n\n this.forceUpdate();\n }, 100);\n };\n\n updateState(state: Partial) {\n if (!this.isActive) {\n return;\n }\n\n this.setState(previousState => ({ ...previousState, ...state }));\n }\n\n render() {\n const { showSpotlight } = this.state;\n const { onClickOverlay, placement } = this.props;\n const { hideSpotlight, overlayStyles, spotlightStyles } = this;\n\n if (hideSpotlight()) {\n return null;\n }\n\n let spotlight = placement !== 'center' && showSpotlight && (\n \n );\n\n // Hack for Safari bug with mix-blend-mode with z-index\n if (getBrowser() === 'safari') {\n const { mixBlendMode, zIndex, ...safariOverlay } = overlayStyles;\n\n spotlight =

{spotlight}
;\n delete overlayStyles.backgroundColor;\n }\n\n return (\n \n {spotlight}\n \n );\n }\n}\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nimport { canUseDOM } from '~/modules/dom';\nimport { isReact16 } from '~/modules/helpers';\n\ninterface Props {\n children: React.ReactElement;\n id: string;\n}\n\nexport default class JoyridePortal extends React.Component {\n node: HTMLElement | null = null;\n\n componentDidMount() {\n const { id } = this.props;\n\n if (!canUseDOM()) {\n return;\n }\n\n this.node = document.createElement('div');\n this.node.id = id;\n\n document.body.appendChild(this.node);\n\n if (!isReact16) {\n this.renderReact15();\n }\n }\n\n componentDidUpdate() {\n if (!canUseDOM()) {\n return;\n }\n\n if (!isReact16) {\n this.renderReact15();\n }\n }\n\n componentWillUnmount() {\n if (!canUseDOM() || !this.node) {\n return;\n }\n\n if (!isReact16) {\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.unmountComponentAtNode(this.node);\n }\n\n if (this.node.parentNode === document.body) {\n document.body.removeChild(this.node);\n this.node = null;\n }\n }\n\n renderReact15() {\n if (!canUseDOM()) {\n return;\n }\n\n const { children } = this.props;\n\n if (this.node) {\n ReactDOM.unstable_renderSubtreeIntoContainer(this, children, this.node);\n }\n }\n\n renderReact16() {\n if (!canUseDOM() || !isReact16) {\n return null;\n }\n\n const { children } = this.props;\n\n if (!this.node) {\n return null;\n }\n\n return ReactDOM.createPortal(children, this.node);\n }\n\n render() {\n if (!isReact16) {\n return null;\n }\n\n return this.renderReact16();\n }\n}\n","interface ScopeOptions {\n code?: string;\n selector: string | null;\n}\n\nexport default class Scope {\n element: HTMLElement;\n options: ScopeOptions;\n\n constructor(element: HTMLElement, options: ScopeOptions) {\n if (!(element instanceof HTMLElement)) {\n throw new TypeError('Invalid parameter: element must be an HTMLElement');\n }\n\n this.element = element;\n this.options = options;\n\n window.addEventListener('keydown', this.handleKeyDown, false);\n\n this.setFocus();\n }\n\n canBeTabbed = (element: HTMLElement): boolean => {\n const { tabIndex } = element;\n\n if (tabIndex === null || tabIndex < 0) {\n return false;\n }\n\n return this.canHaveFocus(element);\n };\n\n canHaveFocus = (element: HTMLElement): boolean => {\n const validTabNodes = /input|select|textarea|button|object/;\n const nodeName = element.nodeName.toLowerCase();\n\n const isValid =\n (validTabNodes.test(nodeName) && !element.getAttribute('disabled')) ||\n (nodeName === 'a' && !!element.getAttribute('href'));\n\n return isValid && this.isVisible(element);\n };\n\n findValidTabElements = (): Array =>\n [].slice.call(this.element.querySelectorAll('*'), 0).filter(this.canBeTabbed);\n\n handleKeyDown = (event: KeyboardEvent) => {\n const { code = 'Tab' } = this.options;\n\n if (event.code === code) {\n this.interceptTab(event);\n }\n };\n\n interceptTab = (event: KeyboardEvent) => {\n event.preventDefault();\n const elements = this.findValidTabElements();\n const { shiftKey } = event;\n\n if (!elements.length) {\n return;\n }\n\n let x = document.activeElement ? elements.indexOf(document.activeElement as HTMLElement) : 0;\n\n if (x === -1 || (!shiftKey && x + 1 === elements.length)) {\n x = 0;\n } else if (shiftKey && x === 0) {\n x = elements.length - 1;\n } else {\n x += shiftKey ? -1 : 1;\n }\n\n elements[x].focus();\n };\n\n // eslint-disable-next-line class-methods-use-this\n isHidden = (element: HTMLElement) => {\n const noSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n const style = window.getComputedStyle(element);\n\n if (noSize && !element.innerHTML) {\n return true;\n }\n\n return (\n (noSize && style.getPropertyValue('overflow') !== 'visible') ||\n style.getPropertyValue('display') === 'none'\n );\n };\n\n isVisible = (element: HTMLElement): boolean => {\n let parentElement: HTMLElement | null = element;\n\n while (parentElement) {\n if (parentElement instanceof HTMLElement) {\n if (parentElement === document.body) {\n break;\n }\n\n if (this.isHidden(parentElement)) {\n return false;\n }\n\n parentElement = parentElement.parentNode as HTMLElement;\n }\n }\n\n return true;\n };\n\n removeScope = () => {\n window.removeEventListener('keydown', this.handleKeyDown);\n };\n\n checkFocus = (target: HTMLElement) => {\n if (document.activeElement !== target) {\n target.focus();\n window.requestAnimationFrame(() => this.checkFocus(target));\n }\n };\n\n setFocus = () => {\n const { selector } = this.options;\n\n if (!selector) {\n return;\n }\n\n const target = this.element.querySelector(selector);\n\n if (target) {\n window.requestAnimationFrame(() => this.checkFocus(target as HTMLElement));\n }\n };\n}\n","import * as React from 'react';\nimport innerText from 'react-innertext';\nimport is from 'is-lite';\n\nimport { BeaconProps } from '~/types';\n\nexport default class JoyrideBeacon extends React.Component {\n private beacon: HTMLElement | null = null;\n\n constructor(props: BeaconProps) {\n super(props);\n\n if (props.beaconComponent) {\n return;\n }\n\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n\n style.id = 'joyride-beacon-animation';\n\n if (props.nonce) {\n style.setAttribute('nonce', props.nonce);\n }\n\n const css = `\n @keyframes joyride-beacon-inner {\n 20% {\n opacity: 0.9;\n }\n \n 90% {\n opacity: 0.7;\n }\n }\n \n @keyframes joyride-beacon-outer {\n 0% {\n transform: scale(1);\n }\n \n 45% {\n opacity: 0.7;\n transform: scale(0.75);\n }\n \n 100% {\n opacity: 0.9;\n transform: scale(1);\n }\n }\n `;\n\n style.appendChild(document.createTextNode(css));\n\n head.appendChild(style);\n }\n\n componentDidMount() {\n const { shouldFocus } = this.props;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!is.domElement(this.beacon)) {\n console.warn('beacon is not a valid DOM element'); // eslint-disable-line no-console\n }\n }\n\n setTimeout(() => {\n if (is.domElement(this.beacon) && shouldFocus) {\n this.beacon.focus();\n }\n }, 0);\n }\n\n componentWillUnmount() {\n const style = document.getElementById('joyride-beacon-animation');\n\n if (style?.parentNode) {\n style.parentNode.removeChild(style);\n }\n }\n\n setBeaconRef = (c: HTMLElement | null) => {\n this.beacon = c;\n };\n\n render() {\n const {\n beaconComponent,\n continuous,\n index,\n isLastStep,\n locale,\n onClickOrHover,\n size,\n step,\n styles,\n } = this.props;\n const title = is.string(locale.open) ? locale.open : innerText(locale.open);\n const sharedProps = {\n 'aria-label': title,\n onClick: onClickOrHover,\n onMouseEnter: onClickOrHover,\n ref: this.setBeaconRef,\n title,\n };\n let component;\n\n if (beaconComponent) {\n const BeaconComponent = beaconComponent;\n\n component = (\n \n );\n } else {\n component = (\n \n \n \n \n );\n }\n\n return component;\n }\n}\n","import React, { CSSProperties } from 'react';\n\ninterface Props {\n styles: CSSProperties;\n}\n\nfunction JoyrideTooltipCloseButton({ styles, ...props }: Props) {\n const { color, height, width, ...style } = styles;\n\n return (\n \n );\n}\n\nexport default JoyrideTooltipCloseButton;\n","import * as React from 'react';\n\nimport { getText } from '~/modules/helpers';\n\nimport { TooltipRenderProps } from '~/types';\n\nimport CloseButton from './CloseButton';\n\nfunction JoyrideTooltipContainer(props: TooltipRenderProps) {\n const {\n backProps,\n closeProps,\n continuous,\n index,\n isLastStep,\n primaryProps,\n size,\n skipProps,\n step,\n tooltipProps,\n } = props;\n const {\n content,\n hideBackButton,\n hideCloseButton,\n hideFooter,\n locale,\n showProgress,\n showSkipButton,\n styles,\n title,\n } = step;\n const { back, close, last, next, skip } = locale;\n const output: Record = {\n primary: close,\n };\n\n if (continuous) {\n output.primary = isLastStep ? last : next;\n\n if (showProgress) {\n output.primary = (\n \n {output.primary} ({index + 1}/{size})\n \n );\n }\n }\n\n if (output.primary) {\n output.primary = (\n \n {output.primary}\n \n );\n }\n\n if (showSkipButton && !isLastStep) {\n output.skip = (\n \n {skip}\n \n );\n }\n\n if (!hideBackButton && index > 0) {\n output.back = (\n \n );\n }\n\n output.close = !hideCloseButton && (\n \n );\n\n return (\n \n
\n {title && (\n

\n {title}\n

\n )}\n
{content}
\n
\n {!hideFooter && (\n
\n
{output.skip}
\n {output.back}\n {output.primary}\n
\n )}\n {output.close}\n \n );\n}\n\nexport default JoyrideTooltipContainer;\n","import * as React from 'react';\n\nimport { getText } from '~/modules/helpers';\n\nimport { TooltipProps } from '~/types';\n\nimport Container from './Container';\n\nexport default class JoyrideTooltip extends React.Component {\n handleClickBack = (event: React.MouseEvent) => {\n event.preventDefault();\n const { helpers } = this.props;\n\n helpers.prev();\n };\n\n handleClickClose = (event: React.MouseEvent) => {\n event.preventDefault();\n const { helpers } = this.props;\n\n helpers.close('button_close');\n };\n\n handleClickPrimary = (event: React.MouseEvent) => {\n event.preventDefault();\n const { continuous, helpers } = this.props;\n\n if (!continuous) {\n helpers.close('button_primary');\n\n return;\n }\n\n helpers.next();\n };\n\n handleClickSkip = (event: React.MouseEvent) => {\n event.preventDefault();\n const { helpers } = this.props;\n\n helpers.skip();\n };\n\n getElementsProps = () => {\n const { continuous, isLastStep, setTooltipRef, step } = this.props;\n\n const back = getText(step.locale.back);\n const close = getText(step.locale.close);\n const last = getText(step.locale.last);\n const next = getText(step.locale.next);\n const skip = getText(step.locale.skip);\n\n let primaryText = continuous ? next : close;\n\n if (isLastStep) {\n primaryText = last;\n }\n\n return {\n backProps: {\n 'aria-label': back,\n 'data-action': 'back',\n onClick: this.handleClickBack,\n role: 'button',\n title: back,\n },\n closeProps: {\n 'aria-label': close,\n 'data-action': 'close',\n onClick: this.handleClickClose,\n role: 'button',\n title: close,\n },\n primaryProps: {\n 'aria-label': primaryText,\n 'data-action': 'primary',\n onClick: this.handleClickPrimary,\n role: 'button',\n title: primaryText,\n },\n skipProps: {\n 'aria-label': skip,\n 'data-action': 'skip',\n onClick: this.handleClickSkip,\n role: 'button',\n title: skip,\n },\n tooltipProps: {\n 'aria-modal': true,\n ref: setTooltipRef,\n role: 'alertdialog',\n },\n };\n };\n\n render() {\n const { continuous, index, isLastStep, setTooltipRef, size, step } = this.props;\n const { beaconComponent, tooltipComponent, ...cleanStep } = step;\n let component;\n\n if (tooltipComponent) {\n const renderProps = {\n ...this.getElementsProps(),\n continuous,\n index,\n isLastStep,\n size,\n step: cleanStep,\n setTooltipRef,\n };\n\n const TooltipComponent = tooltipComponent;\n\n component = ;\n } else {\n component = (\n \n );\n }\n\n return component;\n }\n}\n","import * as React from 'react';\nimport Floater, { Props as FloaterProps, RenderProps } from 'react-floater';\nimport is from 'is-lite';\nimport treeChanges from 'tree-changes';\n\nimport { getElement, isElementVisible } from '~/modules/dom';\nimport { hideBeacon, log } from '~/modules/helpers';\nimport Scope from '~/modules/scope';\nimport { validateStep } from '~/modules/step';\n\nimport { ACTIONS, EVENTS, LIFECYCLE, STATUS } from '~/literals';\n\nimport { StepProps } from '~/types';\n\nimport Beacon from './Beacon';\nimport Tooltip from './Tooltip/index';\n\nexport default class JoyrideStep extends React.Component {\n scope: Scope | null = null;\n tooltip: HTMLElement | null = null;\n\n componentDidMount() {\n const { debug, index } = this.props;\n\n log({\n title: `step:${index}`,\n data: [{ key: 'props', value: this.props }],\n debug,\n });\n }\n\n componentDidUpdate(previousProps: StepProps) {\n const {\n action,\n callback,\n continuous,\n controlled,\n debug,\n helpers,\n index,\n lifecycle,\n status,\n step,\n store,\n } = this.props;\n const { changed, changedFrom } = treeChanges(previousProps, this.props);\n const state = helpers.info();\n\n const skipBeacon =\n continuous && action !== ACTIONS.CLOSE && (index > 0 || action === ACTIONS.PREV);\n const hasStoreChanged =\n changed('action') || changed('index') || changed('lifecycle') || changed('status');\n const isInitial = changedFrom('lifecycle', [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT);\n const isAfterAction = changed('action', [\n ACTIONS.NEXT,\n ACTIONS.PREV,\n ACTIONS.SKIP,\n ACTIONS.CLOSE,\n ]);\n const isControlled = controlled && index === previousProps.index;\n\n if (isAfterAction && (isInitial || isControlled)) {\n callback({\n ...state,\n index: previousProps.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: previousProps.step,\n type: EVENTS.STEP_AFTER,\n });\n }\n\n if (\n step.placement === 'center' &&\n status === STATUS.RUNNING &&\n changed('index') &&\n action !== ACTIONS.START &&\n lifecycle === LIFECYCLE.INIT\n ) {\n store.update({ lifecycle: LIFECYCLE.READY });\n }\n\n if (hasStoreChanged) {\n const element = getElement(step.target);\n const elementExists = !!element;\n const hasRenderedTarget = elementExists && isElementVisible(element);\n\n if (hasRenderedTarget) {\n if (\n changedFrom('status', STATUS.READY, STATUS.RUNNING) ||\n changedFrom('lifecycle', LIFECYCLE.INIT, LIFECYCLE.READY)\n ) {\n callback({\n ...state,\n step,\n type: EVENTS.STEP_BEFORE,\n });\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(elementExists ? 'Target not visible' : 'Target not mounted', step);\n callback({\n ...state,\n type: EVENTS.TARGET_NOT_FOUND,\n step,\n });\n\n if (!controlled) {\n store.update({ index: index + (action === ACTIONS.PREV ? -1 : 1) });\n }\n }\n }\n\n if (changedFrom('lifecycle', LIFECYCLE.INIT, LIFECYCLE.READY)) {\n store.update({\n lifecycle: hideBeacon(step) || skipBeacon ? LIFECYCLE.TOOLTIP : LIFECYCLE.BEACON,\n });\n }\n\n if (changed('index')) {\n log({\n title: `step:${lifecycle}`,\n data: [{ key: 'props', value: this.props }],\n debug,\n });\n }\n\n if (changed('lifecycle', LIFECYCLE.BEACON)) {\n callback({\n ...state,\n step,\n type: EVENTS.BEACON,\n });\n }\n\n if (changed('lifecycle', LIFECYCLE.TOOLTIP)) {\n callback({\n ...state,\n step,\n type: EVENTS.TOOLTIP,\n });\n\n if (this.tooltip) {\n this.scope = new Scope(this.tooltip, { selector: '[data-action=primary]' });\n this.scope.setFocus();\n }\n }\n\n if (changedFrom('lifecycle', [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT)) {\n this.scope?.removeScope();\n store.cleanupPoppers();\n }\n }\n\n componentWillUnmount() {\n this.scope?.removeScope();\n }\n\n /**\n * Beacon click/hover event listener\n */\n handleClickHoverBeacon = (event: React.MouseEvent) => {\n const { step, store } = this.props;\n\n if (event.type === 'mouseenter' && step.event !== 'hover') {\n return;\n }\n\n store.update({ lifecycle: LIFECYCLE.TOOLTIP });\n };\n\n setTooltipRef = (element: HTMLElement) => {\n this.tooltip = element;\n };\n\n setPopper: FloaterProps['getPopper'] = (popper, type) => {\n const { action, lifecycle, step, store } = this.props;\n\n if (type === 'wrapper') {\n store.setPopper('beacon', popper);\n } else {\n store.setPopper('tooltip', popper);\n }\n\n if (store.getPopper('beacon') && store.getPopper('tooltip') && lifecycle === LIFECYCLE.INIT) {\n store.update({\n action,\n lifecycle: LIFECYCLE.READY,\n });\n }\n\n if (step.floaterProps?.getPopper) {\n step.floaterProps.getPopper(popper, type);\n }\n };\n\n get open() {\n const { lifecycle, step } = this.props;\n\n return hideBeacon(step) || lifecycle === LIFECYCLE.TOOLTIP;\n }\n\n renderTooltip = (renderProps: RenderProps) => {\n const { continuous, helpers, index, size, step } = this.props;\n\n return (\n \n );\n };\n\n render() {\n const { continuous, debug, index, nonce, shouldScroll, size, step } = this.props;\n const target = getElement(step.target);\n\n if (!validateStep(step) || !is.domElement(target)) {\n return null;\n }\n\n return (\n
\n \n \n \n
\n );\n }\n}\n","import * as React from 'react';\nimport { ReactNode } from 'react';\nimport isEqual from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\nimport treeChanges from 'tree-changes';\n\nimport {\n canUseDOM,\n getElement,\n getScrollParent,\n getScrollTo,\n hasCustomScrollParent,\n scrollTo,\n} from '~/modules/dom';\nimport { log, shouldScroll } from '~/modules/helpers';\nimport { getMergedStep, validateSteps } from '~/modules/step';\nimport createStore from '~/modules/store';\n\nimport { ACTIONS, EVENTS, LIFECYCLE, STATUS } from '~/literals';\n\nimport Overlay from '~/components/Overlay';\nimport Portal from '~/components/Portal';\n\nimport { defaultProps } from '~/defaults';\nimport { Actions, CallBackProps, Props, State, Status, StoreHelpers } from '~/types';\n\nimport Step from './Step';\n\nclass Joyride extends React.Component {\n private readonly helpers: StoreHelpers;\n private readonly store: ReturnType;\n\n static defaultProps = defaultProps;\n\n constructor(props: Props) {\n super(props);\n\n const { debug, getHelpers, run, stepIndex } = props;\n\n this.store = createStore({\n ...props,\n controlled: run && is.number(stepIndex),\n });\n this.helpers = this.store.getHelpers();\n\n const { addListener } = this.store;\n\n log({\n title: 'init',\n data: [\n { key: 'props', value: this.props },\n { key: 'state', value: this.state },\n ],\n debug,\n });\n\n // Sync the store to this component's state.\n addListener(this.syncState);\n\n if (getHelpers) {\n getHelpers(this.helpers);\n }\n\n this.state = this.store.getState();\n }\n\n componentDidMount() {\n if (!canUseDOM()) {\n return;\n }\n\n const { debug, disableCloseOnEsc, run, steps } = this.props;\n const { start } = this.store;\n\n if (validateSteps(steps, debug) && run) {\n start();\n }\n\n if (!disableCloseOnEsc) {\n document.body.addEventListener('keydown', this.handleKeyboard, { passive: true });\n }\n }\n\n componentDidUpdate(previousProps: Props, previousState: State) {\n if (!canUseDOM()) {\n return;\n }\n\n const { action, controlled, index, lifecycle, status } = this.state;\n const { debug, run, stepIndex, steps } = this.props;\n const { stepIndex: previousStepIndex, steps: previousSteps } = previousProps;\n const { reset, setSteps, start, stop, update } = this.store;\n const { changed: changedProps } = treeChanges(previousProps, this.props);\n const { changed, changedFrom } = treeChanges(previousState, this.state);\n const step = getMergedStep(this.props, steps[index]);\n\n const stepsChanged = !isEqual(previousSteps, steps);\n const stepIndexChanged = is.number(stepIndex) && changedProps('stepIndex');\n const target = getElement(step.target);\n\n if (stepsChanged) {\n if (validateSteps(steps, debug)) {\n setSteps(steps);\n } else {\n // eslint-disable-next-line no-console\n console.warn('Steps are not valid', steps);\n }\n }\n\n if (changedProps('run')) {\n if (run) {\n start(stepIndex);\n } else {\n stop();\n }\n }\n\n if (stepIndexChanged) {\n let nextAction: Actions =\n is.number(previousStepIndex) && previousStepIndex < stepIndex ? ACTIONS.NEXT : ACTIONS.PREV;\n\n if (action === ACTIONS.STOP) {\n nextAction = ACTIONS.START;\n }\n\n if (!([STATUS.FINISHED, STATUS.SKIPPED] as Array).includes(status)) {\n update({\n action: action === ACTIONS.CLOSE ? ACTIONS.CLOSE : nextAction,\n index: stepIndex,\n lifecycle: LIFECYCLE.INIT,\n });\n }\n }\n\n // Update the index if the first step is not found\n if (!controlled && status === STATUS.RUNNING && index === 0 && !target) {\n this.store.update({ index: index + 1 });\n this.callback({\n ...this.state,\n type: EVENTS.TARGET_NOT_FOUND,\n step,\n });\n }\n\n const callbackData = {\n ...this.state,\n index,\n step,\n };\n const isAfterAction = changed('action', [\n ACTIONS.NEXT,\n ACTIONS.PREV,\n ACTIONS.SKIP,\n ACTIONS.CLOSE,\n ]);\n\n if (isAfterAction && changed('status', STATUS.PAUSED)) {\n const previousStep = getMergedStep(this.props, steps[previousState.index]);\n\n this.callback({\n ...callbackData,\n index: previousState.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: previousStep,\n type: EVENTS.STEP_AFTER,\n });\n }\n\n if (changed('status', [STATUS.FINISHED, STATUS.SKIPPED])) {\n const previousStep = getMergedStep(this.props, steps[previousState.index]);\n\n if (!controlled) {\n this.callback({\n ...callbackData,\n index: previousState.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: previousStep,\n type: EVENTS.STEP_AFTER,\n });\n }\n\n this.callback({\n ...callbackData,\n type: EVENTS.TOUR_END,\n // Return the last step when the tour is finished\n step: previousStep,\n index: previousState.index,\n });\n reset();\n } else if (changedFrom('status', [STATUS.IDLE, STATUS.READY], STATUS.RUNNING)) {\n this.callback({\n ...callbackData,\n type: EVENTS.TOUR_START,\n });\n } else if (changed('status') || changed('action', ACTIONS.RESET)) {\n this.callback({\n ...callbackData,\n type: EVENTS.TOUR_STATUS,\n });\n }\n\n this.scrollToStep(previousState);\n\n if (step.placement === 'center' && status === STATUS.RUNNING && lifecycle === LIFECYCLE.INIT) {\n this.store.update({ lifecycle: LIFECYCLE.READY });\n }\n }\n\n componentWillUnmount() {\n const { disableCloseOnEsc } = this.props;\n\n if (!disableCloseOnEsc) {\n document.body.removeEventListener('keydown', this.handleKeyboard);\n }\n }\n\n /**\n * Trigger the callback.\n */\n callback = (data: CallBackProps) => {\n const { callback } = this.props;\n\n if (is.function(callback)) {\n callback(data);\n }\n };\n\n /**\n * Keydown event listener\n */\n handleKeyboard = (event: KeyboardEvent) => {\n const { index, lifecycle } = this.state;\n const { steps } = this.props;\n const step = steps[index];\n\n if (lifecycle === LIFECYCLE.TOOLTIP) {\n if (event.code === 'Escape' && step && !step.disableCloseOnEsc) {\n this.store.close('keyboard');\n }\n }\n };\n\n handleClickOverlay = () => {\n const { index } = this.state;\n const { steps } = this.props;\n\n const step = getMergedStep(this.props, steps[index]);\n\n if (!step.disableOverlayClose) {\n this.helpers.close('overlay');\n }\n };\n\n /**\n * Sync the store with the component's state\n */\n syncState = (state: State) => {\n this.setState(state);\n };\n\n scrollToStep(previousState: State) {\n const { index, lifecycle, status } = this.state;\n const {\n debug,\n disableScrollParentFix = false,\n scrollDuration,\n scrollOffset = 20,\n scrollToFirstStep = false,\n steps,\n } = this.props;\n const step = getMergedStep(this.props, steps[index]);\n\n const target = getElement(step.target);\n const shouldScrollToStep = shouldScroll({\n isFirstStep: index === 0,\n lifecycle,\n previousLifecycle: previousState.lifecycle,\n scrollToFirstStep,\n step,\n target,\n });\n\n if (status === STATUS.RUNNING && shouldScrollToStep) {\n const hasCustomScroll = hasCustomScrollParent(target, disableScrollParentFix);\n const scrollParent = getScrollParent(target, disableScrollParentFix);\n let scrollY = Math.floor(getScrollTo(target, scrollOffset, disableScrollParentFix)) || 0;\n\n log({\n title: 'scrollToStep',\n data: [\n { key: 'index', value: index },\n { key: 'lifecycle', value: lifecycle },\n { key: 'status', value: status },\n ],\n debug,\n });\n\n const beaconPopper = this.store.getPopper('beacon');\n const tooltipPopper = this.store.getPopper('tooltip');\n\n if (lifecycle === LIFECYCLE.BEACON && beaconPopper) {\n const { offsets, placement } = beaconPopper;\n\n if (!['bottom'].includes(placement) && !hasCustomScroll) {\n scrollY = Math.floor(offsets.popper.top - scrollOffset);\n }\n } else if (lifecycle === LIFECYCLE.TOOLTIP && tooltipPopper) {\n const { flipped, offsets, placement } = tooltipPopper;\n\n if (['top', 'right', 'left'].includes(placement) && !flipped && !hasCustomScroll) {\n scrollY = Math.floor(offsets.popper.top - scrollOffset);\n } else {\n scrollY -= step.spotlightPadding;\n }\n }\n\n scrollY = scrollY >= 0 ? scrollY : 0;\n\n if (status === STATUS.RUNNING) {\n scrollTo(scrollY, { element: scrollParent as Element, duration: scrollDuration }).then(\n () => {\n setTimeout(() => {\n this.store.getPopper('tooltip')?.instance.update();\n }, 10);\n },\n );\n }\n }\n }\n\n render() {\n if (!canUseDOM()) {\n return null;\n }\n\n const { index, lifecycle, status } = this.state;\n const {\n continuous = false,\n debug = false,\n nonce,\n scrollToFirstStep = false,\n steps,\n } = this.props;\n const isRunning = status === STATUS.RUNNING;\n const content: Record = {};\n\n if (isRunning && steps[index]) {\n const step = getMergedStep(this.props, steps[index]);\n\n content.step = (\n \n );\n\n content.overlay = (\n \n \n \n );\n }\n\n return (\n
\n {content.step}\n {content.overlay}\n
\n );\n }\n}\n\nexport default Joyride;\n","import React, { useEffect, useState, memo } from \"react\";\nimport { getBezierPath } from \"reactflow\";\nimport { PlusCircleOutlined } from \"@ant-design/icons\";\nimport { CXPopover } from \"component/Popover\";\nimport CustomSelect from \"./CustomSelect\";\nimport { CXButton } from \"component/Button\";\nimport { FormattedMessage } from \"react-intl\";\nimport Joyride, { CallBackProps } from \"react-joyride\";\nimport { useSelector } from \"react-redux\";\nconst foreignObjectSize = 40;\nconst CustomEdge = ({\n id,\n source,\n target,\n sourceX,\n sourceY,\n targetX,\n targetY,\n style = {},\n markerEnd,\n}) => {\n const [edgePath, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n });\n const { CampaignById } = useSelector((state) => state.CampaignReducer);\n const [open, setOpen] = useState(false);\n const handleOpenChange = (newOpen) => {\n setOpen(newOpen);\n };\n const hide = () => {\n setOpen(false);\n };\n const [Run, setRun] = useState(true);\n const TOUR_STEPS = [\n {\n target: \".edgebutton\",\n content: \"You can add Action, Delay or Conditions to your campaign\",\n title: \"Add Steps\",\n disableBeacon: true,\n },\n ];\n const Tooltip = ({\n continuous,\n index,\n step,\n backProps,\n closeProps,\n primaryProps,\n tooltipProps,\n }) => (\n \n {step.title &&
{step.title}
}\n
{step.content}
\n
\n {continuous && (\n setRun(false)}\n >\n \n \n )}\n
\n \n );\n useEffect(() => {\n if (CampaignById?.data?.wfStep?.length === 2) {\n setRun(true);\n } else {\n setRun(false);\n }\n }, []);\n console.log(\"setOpen\", open);\n return (\n <>\n \n \n \n \n }\n open={open}\n onOpenChange={() => handleOpenChange()}\n >\n
\n \n
\n \n \n \n \n \n );\n};\n\nexport default CustomEdge;\n","import { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport ReactFlow, {\n Controls,\n Background,\n ReactFlowProvider,\n MarkerType,\n useReactFlow,\n} from \"reactflow\";\nimport \"reactflow/dist/style.css\";\nimport React, { useEffect, useState, memo, useCallback } from \"react\";\nimport history from \"utils/history\";\nimport StartNode from \"./CampNodes/StartNode\";\nimport EndNode from \"./CampNodes/EndNode\";\nimport ActionNode from \"./CampNodes/ActionNode\";\nimport DelayNode from \"./CampNodes/DelayNode\";\nimport CustomEdge from \"./CampEdge/CustomEdge.js\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n publishCampaigns,\n getCampaignByID,\n getCampaignsStepsConditions,\n} from \"action/CampaignAction\";\nimport { useParams } from \"react-router-dom\";\nimport {\n getEmailTemplatesTrigger,\n getSmsTemplates,\n getTemplatesActionTrigger,\n} from \"action/TemplateAction\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { GET_CAMPAIGN_BY_ID_RESPONSE } from \"constant\";\nimport \"reactflow/dist/style.css\";\nimport { CXSpin } from \"component/Spin\";\nimport { getLayoutedElements } from \"./Helper/getLayoutedElements\";\nimport ConditionNode from \"./CampNodes/ConditionNode\";\nimport { getTag } from \"action/TagAction\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport { useRouteMatch } from \"react-router-dom/cjs/react-router-dom.min\";\nconst CampaignView = ({ sq = null }) => {\n const dispatch = useDispatch();\n let { id, edit } = useParams();\n if (sq) {\n id = sq;\n }\n const { CampaignById, WaitForCampaign } = useSelector(\n (state) => state.CampaignReducer\n );\n const [nodes, setNodes] = useState([]);\n const [edges, setEdges] = useState([]);\n const nodeTypes = {\n start: StartNode,\n end: EndNode,\n action: ActionNode,\n delay: DelayNode,\n condition: ConditionNode,\n };\n const edgeTypes = {\n smoothstep: CustomEdge,\n };\n const publishCampaign = () => {\n let obj = {\n id: edit,\n status: \"enabled\",\n };\n dispatch(publishCampaigns(obj));\n };\n useEffect(() => {\n if (edit && id === \"view\") {\n dispatch(getCampaignByID(edit));\n }\n dispatch(getAgentsActionTrigger());\n dispatch(getTemplatesActionTrigger());\n dispatch(getSmsTemplates());\n dispatch(getCampaignsStepsConditions());\n dispatch(GetAllConfig());\n dispatch(getTag({ type: \"contact\" }));\n dispatch(getContactForm());\n return () => {\n dispatch({ type: GET_CAMPAIGN_BY_ID_RESPONSE, data: [] });\n setNodes([]);\n setEdges([]);\n };\n }, []);\n\n useEffect(() => {\n if (CampaignById.data) {\n let obj = getLayoutedElements(\n CampaignById?.data?.wfStep,\n CampaignById?.data?.edges\n );\n setNodes(obj.nodes);\n if (obj?.edges?.length > 0) {\n let nw = obj?.edges?.map((edge) => {\n return {\n ...edge,\n style: { stroke: \"#cbcbcb\", strokeWidth: \"3px\" },\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#cbcbcb\" },\n type: \"smoothstep\",\n };\n });\n setEdges(nw);\n } else {\n setEdges([]);\n }\n }\n }, [CampaignById]);\n useEffect(() => {\n dispatch(getEmailTemplatesTrigger());\n }, []);\n return (\n
\n \n \n {CampaignById?.data?.name}{\" \"}\n {CampaignById?.data?.wfType === \"mwf\" ? (\n \n (Mirror Campaign cant not be edited here, they are managed from\n the main campaign)\n \n ) : (\n \"\"\n )}\n \n
\n {CampaignById?.data?.wfType === \"cwf\" && (\n publishCampaign()}\n >\n Save & Publish\n \n )}\n history.goBack()}>\n Exit\n \n
\n
\n
\n \n \n \n \n \n \n \n \n
\n \n
\n \n );\n};\n\nexport default memo(CampaignView);\n","import { EyeOutlined } from \"@ant-design/icons\";\nimport { CXPopover } from \"component/Popover\";\nimport React, { Fragment } from \"react\";\nimport PreviewTemplate from \"screen/UserPortal/Knowledge/EmailTemplate/PreviewTemplate\";\nimport Preview from \"screen/UserPortal/Knowledge/Template/CreateTemplate/Preview\";\nimport PreviewTemplateSMS from \"screen/UserPortal/Knowledge/SmsTemplate/PreviewTemplate\";\n\nconst ViewTemplate = ({ data, templateId, md }) => {\n return (\n \n {md === \"whatsapp\" && (\n \n )}\n {md === \"email\" && }\n {md === \"sms\" && (\n \n )}\n \n }\n >\n \n Hover on the icon to preview\n
\n \n \n );\n};\n\nexport default ViewTemplate;\n","import dagre from \"dagre\";\n\nexport const getLayoutedElements = (nodes, edges) => {\n const dagreGraph = new dagre.graphlib.Graph();\n dagreGraph.setDefaultEdgeLabel(() => ({}));\n const nodeWidth = 190;\n const nodeHeight = 200;\n dagreGraph.setGraph({ rankdir: \"TB\" });\n const renderHeight = (node) => {\n if (node?.data?.type === \"condition\") {\n return 200 + (node?.data?.cIds?.length / 2) * 120;\n } else {\n return nodeHeight;\n }\n };\n nodes.forEach((node) => {\n dagreGraph.setNode(node.id, {\n width: nodeWidth,\n height: renderHeight(node),\n });\n });\n edges.forEach((edge) => {\n dagreGraph.setEdge(edge.source, edge.target);\n });\n dagre.layout(dagreGraph);\n console.log(\"dagreGraph\", dagreGraph);\n nodes.forEach((node, index) => {\n let prevNodeY = index > 0 ? nodes[index - 1].position.y : 0;\n node.targetPosition = \"top\";\n node.sourcePosition = \"bottom\";\n node.position = {\n x: 400,\n y: index === 0 ? 0 : prevNodeY + renderHeight(nodes[index - 1]),\n };\n return node;\n });\n return { nodes, edges };\n};\n","import { CAMPAIGN_UPDATE_DATA, CAMPAIGN_UPDATE_SIDEBAR } from \"constant\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport CustomAction from \"./CampEdge/CustomAction\";\nimport CustomDelay from \"./CampEdge/CustomDelay\";\nimport CustomCondition from \"./CampEdge/CustomCondtions/CustomCondition\";\n\nconst CampaignUpdate = () => {\n const dispatch = useDispatch();\n const { UpdateData } = useSelector((state) => state.CampaignReducer);\n useEffect(() => {\n return () => {\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: {} });\n };\n }, []);\n console.log(\"UpdateData==>\", UpdateData);\n return (\n
\n {UpdateData?.data?.type === \"action\" && (\n \n )}\n {UpdateData?.type === \"action\" && (\n \n )}\n {UpdateData?.type === \"delay\" && (\n \n )}\n {UpdateData?.type === \"condition\" && (\n
\n \n
\n )}\n
\n );\n};\n\nexport default CampaignUpdate;\n","import { CloseOutlined } from \"@ant-design/icons\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport React from \"react\";\nimport { CAMPAIGN_UPDATE_DATA, CAMPAIGN_UPDATE_SIDEBAR } from \"constant\";\nimport CampaignUpdate from \"./CampaignUpdate\";\n\nconst SideBarData = () => {\n const dispatch = useDispatch();\n const handleClose = () => {\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n dispatch({ type: CAMPAIGN_UPDATE_DATA, data: {} });\n };\n return (\n
\n \n \n Step\n \n
\n handleClose()}\n />\n
\n
\n \n
\n );\n};\n\nexport default SideBarData;\n","// This icon file is generated automatically.\nvar NotificationOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112c-3.8 0-7.7.7-11.6 2.3L292 345.9H128c-8.8 0-16 7.4-16 16.6v299c0 9.2 7.2 16.6 16 16.6h101.7c-3.7 11.6-5.7 23.9-5.7 36.4 0 65.9 53.8 119.5 120 119.5 55.4 0 102.1-37.6 115.9-88.4l408.6 164.2c3.9 1.5 7.8 2.3 11.6 2.3 16.9 0 32-14.2 32-33.2V145.2C912 126.2 897 112 880 112zM344 762.3c-26.5 0-48-21.4-48-47.8 0-11.2 3.9-21.9 11-30.4l84.9 34.1c-2 24.6-22.7 44.1-47.9 44.1zm496 58.4L318.8 611.3l-12.9-5.2H184V417.9h121.9l12.9-5.2L840 203.3v617.4z\" } }] }, \"name\": \"notification\", \"theme\": \"outlined\" };\nexport default NotificationOutlined;\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 NotificationOutlinedSvg from \"@ant-design/icons-svg/es/asn/NotificationOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar NotificationOutlined = function NotificationOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: NotificationOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(NotificationOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'NotificationOutlined';\n}\nexport default RefIcon;","import { NotificationOutlined } from \"@ant-design/icons\";\nimport { CXHeader, CXSider } from \"component/Layout\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { ACTIVE_CAMPAIGN_SIDEBAR } from \"constant\";\nimport history from \"utils/history\";\nimport React from \"react\";\nimport { useRouteMatch } from \"react-router-dom\";\n\nconst SideBar = () => {\n const dispatch = useDispatch();\n const { url } = useRouteMatch();\n const handleActiveList = (val) => {\n dispatch({ type: ACTIVE_CAMPAIGN_SIDEBAR, data: val });\n history.push(`${url}/${val}`);\n };\n return (\n \n \n \n Campaign\n \n \n \n handleActiveList(`list`)}\n >\n \n Campaigns\n \n \n \n );\n};\n\nexport default SideBar;\n","import {\n CheckCircleFilled,\n CopyOutlined,\n DeleteFilled,\n DoubleRightOutlined,\n EditFilled,\n ExclamationCircleFilled,\n PlayCircleOutlined,\n SettingOutlined,\n SwapOutlined,\n} from \"@ant-design/icons\";\nimport {\n delCampaign,\n executeCampaignOnDemand,\n getCampaigns,\n getClonedCampaigns,\n updateCampaigns,\n updateCloneCampaignWithMaster,\n} from \"action/CampaignAction\";\nimport { getContGrpTrigger } from \"action/ContactAction\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXMenu, CXMenuItem, CXSubMenu } from \"component/Menu\";\nimport { CXbotSkeleton, CXSkeleton } from \"component/Skeleton\";\nimport { CXTitle } from \"component/Typography\";\nimport { CAMPAIGN_UPDATE_SIDEBAR } from \"constant\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport { PermissionCheck, truncateSt } from \"utils\";\nimport history from \"utils/history\";\nimport { Modal } from \"antd\";\nimport TagsSearch from \"component/TagsSearch\";\nimport { CXModal } from \"component/Modal\";\nimport useFormInstance from \"antd/lib/form/hooks/useFormInstance\";\nimport AddWorkflow from \"../Openings/AddWorkflow\";\nimport { CXButton } from \"component/Button\";\nimport { CXTable } from \"component/Table\";\nimport { data2 } from \"../Dashboard/Config\";\nconst { confirm } = Modal;\n\nconst CampaignList = () => {\n const { url } = useRouteMatch();\n const { loading, CampaignsList, ClonedCampaign, ClonedLoading } = useSelector(\n (state) => state.CampaignReducer\n );\n const { grpList } = useSelector((state) => state.ContactReducer);\n const dispatch = useDispatch();\n const [openModal, setopenModal] = useState(false);\n const [Tag, setTag] = useState([]);\n const [ondemandID, setondemandID] = useState(null);\n const [openWorkflowCheck, setopenWorkflowCheck] = useState(false);\n const [Upgrage, setUpgrage] = useState(null);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n\n useEffect(() => {\n dispatch(getCampaigns());\n dispatch({ type: CAMPAIGN_UPDATE_SIDEBAR, data: true });\n }, []);\n\n const tickColor = {\n enabled: \"#e4b417db\",\n published: \"#e4b417db\",\n draft: \"#C8C8C8\",\n disabled: \"#d00e0edb\",\n completed: \"#73c49a\",\n };\n const triggerType = {\n ondemand: \"On-demand\",\n \"date-time\": \"Scheduled\",\n event: \"Event\",\n };\n\n const StatusChange = [\n { Publish: \"published\" },\n { Disable: \"disabled\" },\n { Draft: \"draft\" },\n { Complete: \"completed\" },\n ];\n // const showConfirm = (id) => {\n // confirm({\n // content: (\n //
\n // {}} />\n //
\n // ),\n // title: \"Are you sure you want to run this campaign ?\",\n // icon: ,\n // onOk() {\n // dispatch(executeCampaignOnDemand({ wfId: id }));\n // },\n // onCancel() {},\n // });\n // };\n\n const menu = (id, CaseCheck) => (\n \n {\n history.push(`${url}/edit/${id}`);\n // e.stopPropagation();\n }}\n >\n \n Edit workflow\n \n history.push(`/admin/campaign/list/view/${id}`)}\n >\n \n Configure steps\n \n {/* {\n dispatch(getClonedCampaigns(id));\n setUpgrage(id);\n }}\n >\n \n Update clones\n */}\n }\n title={Change status}\n >\n {StatusChange.map((item, index) => {\n return (\n {\n dispatch(\n updateCampaigns(id, {\n status: Object.values(item)[0],\n })\n );\n // e.stopPropagation();\n }}\n >\n \n {Object.keys(item)[0]}\n \n );\n })}\n \n\n {CaseCheck === \"ondemand\" && (\n {\n setopenModal(true);\n setondemandID(id);\n }}\n >\n \n Run on-demand\n \n )}\n {\n dispatch(delCampaign(id));\n // e.stopPropagation();\n }}\n >\n \n Delete Workflow\n \n \n );\n useEffect(() => {\n dispatch(getContGrpTrigger());\n }, []);\n const addTag = (data) => {\n if (data?.length === 2) {\n setTag([data[1]]);\n } else {\n setTag(data);\n }\n };\n\n useEffect(() => {\n if (Upgrage) {\n dispatch(getClonedCampaigns(Upgrage));\n }\n }, []);\n\n const columns = [\n {\n title: (\n Select Opening's to upgrade clone\n ),\n dataIndex: \"name\",\n key: \"name\",\n render: (data) =>
{data ?? \"N/A\"}
,\n },\n ];\n const [selectedRowKeys, setselectedRowKeys] = useState([]);\n const [checkKey, setcheckKey] = useState([]);\n const [data, setData] = useState([]);\n const rowSelection = {\n onChange: (selectedRowKeys, selectedRows) => {\n setselectedRowKeys(selectedRows.map((res) => res.id));\n setcheckKey(selectedRowKeys);\n },\n };\n\n useEffect(() => {\n if (ClonedCampaign?.data?.length > 0) {\n let temp = ClonedCampaign?.data\n ?.filter((item) => !item?.opening?.isDeleted)\n .map((item, index) => {\n return {\n ...item,\n name: item?.opening.positionName,\n id: item?.opening?._id,\n key: index + 1,\n };\n });\n setData(temp);\n } else {\n setData([]);\n setselectedRowKeys([]);\n setcheckKey([]);\n }\n }, [ClonedCampaign]);\n\n const updateClones = () => {\n dispatch(\n updateCloneCampaignWithMaster({\n wfId: Upgrage,\n openingId: selectedRowKeys,\n })\n );\n setUpgrage(null);\n };\n return (\n
\n \n \n Campaigns\n \n \n\n \n
\n {(!loading || CampaignsList?.data?.length > 0) &&\n PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateSequences\"\n ) && (\n history.push(`${url}/create`)}\n >\n \"addBot\"\n \n New Campaign\n \n \n )}\n {loading && (\n
\n {[...Array(3)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n\n {!loading &&\n CampaignsList &&\n CampaignsList?.data?.length > 0 &&\n CampaignsList?.data?.map((res) => {\n return (\n {\n history.push(`/admin/campaign/list/plans/${res._id}`);\n }}\n >\n
\n
\n
\n \n {res.status.charAt(0).toUpperCase() +\n res.status.slice(1)}\n
\n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateSequences\"\n ) && (\n {\n e.stopPropagation();\n }}\n >\n \n
\n \n
\n \n
\n )}\n
\n
\n {truncateSt(res?.name, 25)}\n
\n
\n {triggerType[res?.trigger?.type] ?? \"N/A\"}\n
\n {res?.trigger?.type === \"date-time\" && (\n
\n {moment(res.triggerTime).format(\"lll\")}\n
\n )}\n {[\"ondemand\", \"date-time\"].includes(res?.trigger?.type) && (\n
\n {grpList?.data?.filter(\n (d) => d._id === res?.targetGroup[0]\n )[0]?.name ?? \"N/A\"}\n
\n )}\n
\n {\n {\n no_order: \"No Order\",\n abandoned_cart: \"Abandoned Cart\",\n }[res?.trigger?.event]\n }\n
\n \n \n );\n })}\n
\n \n\n \n Select a target tag : \n \n
\n {\n setopenModal(false);\n setTag([]);\n setondemandID(null);\n }}\n >\n Cancel\n \n {\n setopenWorkflowCheck(true);\n setopenModal(false);\n }}\n >\n Run\n \n
\n \n \n {}}\n SelectedWFName={\n ondemandID &&\n CampaignsList?.data?.find((res) => res?._id === ondemandID)?.name\n }\n targetType=\"tag\"\n />\n \n \n
\n
\n {\" \"}\n \n Update cloned campaigns\n \n
\n setUpgrage(null)} className=\"CancelBtn\">\n Cancel\n \n {!ClonedLoading &&\n data?.length > 0 &&\n selectedRowKeys?.length > 0 && (\n updateClones()}\n className=\"addCardbtn\"\n >\n Update\n \n )}\n
\n
\n\n {!ClonedLoading && (\n \n )}\n {ClonedLoading && (\n \n )}\n
\n \n
\n );\n};\n\nexport default CampaignList;\n","import { RadiusSettingOutlined, SlidersOutlined } from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React from \"react\";\nimport history from \"utils/history\";\n\nconst CampaignCreateSelector = () => {\n return (\n
\n \n \n Create Campaign\n \n
\n history.goBack()}\n >\n Cancel\n \n
\n
\n
\n history.push(`/admin/campaign/list/createCustom`)}\n >\n
\n \n
\n
Create
\n
Custom Campaign
\n \n
\n
\n );\n};\n\nexport default CampaignCreateSelector;\n","import { getCampaignsPlanStatus } from \"action/CampaignAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\nimport {\n Background,\n Controls,\n ReactFlow,\n ReactFlowProvider,\n MarkerType,\n} from \"reactflow\";\nimport history from \"utils/history\";\nimport { getLayoutedElements } from \"./Helper/getLayoutedElements\";\nimport StartNode from \"./CampNodes/StartNode\";\nimport EndNode from \"./CampNodes/EndNode\";\nimport ActionNode from \"./CampNodes/ActionNode\";\nimport DelayNode from \"./CampNodes/DelayNode\";\nimport ConditionNode from \"./CampNodes/ConditionNode\";\n\nconst CampaignPlansStatus = () => {\n const dispatch = useDispatch();\n let { edit } = useParams();\n const { CampaignPlanStatus } = useSelector((state) => state.CampaignReducer);\n useEffect(() => {\n dispatch(getCampaignsPlanStatus(edit));\n return () => {\n dispatch({ type: \"GET_CAMPAIGNS_PLAN_STATUS_RESPONSE\", data: null });\n };\n }, []);\n const [nodes, setNodes] = useState([]);\n const [edges, setEdges] = useState([]);\n useEffect(() => {\n if (CampaignPlanStatus?.data) {\n let obj = getLayoutedElements(\n CampaignPlanStatus?.data?.wfStep,\n CampaignPlanStatus?.data?.edges\n );\n setNodes(obj.nodes);\n // setEdges(obj.edges);\n if (obj.edges?.length > 0) {\n let nw = obj.edges.map((edge) => {\n return {\n ...edge,\n style: { stroke: \"#cbcbcb\", strokeWidth: \"3px\" },\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#cbcbcb\" },\n type: \"smoothstep\",\n };\n });\n setEdges(nw);\n } else {\n setEdges([]);\n }\n }\n }, [CampaignPlanStatus]);\n const nodeTypes = {\n start: StartNode,\n end: EndNode,\n action: ActionNode,\n delay: DelayNode,\n condition: ConditionNode,\n };\n return (\n
\n \n \n Campaign status\n \n
\n history.goBack()}>\n Back\n \n
\n
\n \n \n \n \n \n \n \n
\n );\n};\n\nexport default CampaignPlansStatus;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXContent, CXSider } from \"component/Layout\";\nimport { CXLayout } from \"component/Layout\";\nimport SideBar from \"./SideBar\";\nimport {\n Switch,\n Route,\n useParams,\n useRouteMatch,\n Redirect,\n} from \"react-router-dom\";\nimport \"./style.css\";\nimport CampaignList from \"./CampaignList\";\nimport CampaignCreate from \"./CampaignCreate\";\nimport CampaignCreateSelector from \"./CampaignCreateSelector\";\nimport CampaignView from \"./CampaignView\";\nimport history from \"utils/history\";\nimport UpdateStep from \"./SideBarData\";\nimport CampaignPlans from \"./CampaignPlans\";\nimport CampaignPlansStatus from \"./CampaignPlansStatus\";\nimport CampaignCreateOrder from \"./CampaignCreateEvent\";\n\nconst Index = () => {\n const { path } = useRouteMatch();\n const DataSider = useSelector((state) => state.CampaignReducer.DataSider);\n const RenderComponent = () => {\n let { topicId, id } = useParams();\n if (topicId) {\n let obj = {\n list: ,\n create: ,\n createCustom: ,\n event: ,\n view: ,\n edit: ,\n plans: ,\n planStatus: ,\n undefined: ,\n };\n return obj[id && id?.length === 36 ? topicId : id ?? topicId ?? \"list\"];\n } else {\n history.push(`${path}/list`);\n return ;\n }\n };\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Index;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport CXUpload from \"component/Upload\";\n\nimport \"./style.css\";\nimport { CXButton } from \"component/Button\";\nimport { fileTypeHandler } from \"utils\";\nimport { CHAT_CONTAINER_COMPONENT } from \"constant/app.constant\";\n\nconst AttachmentContainer = ({ children, ...props }) => {\n const [files, setfiles] = useState([]);\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n\n useEffect(() => {\n let tempFiles = [];\n appConfig?.containerParams?.forEach((file) => {\n tempFiles.push({\n uid: file._id,\n name: file.fileName,\n status: \"done\",\n url: file.url,\n thumbUrl: fileTypeHandler(file.fileName.split(\".\").pop()),\n });\n });\n setfiles(tempFiles);\n }, [appConfig.containerParams]);\n\n const handleFileChange = (files) => {\n let oldFiles = [];\n if (appConfig.containerParams && Array.isArray(appConfig.containerParams)) {\n oldFiles = JSON.parse(JSON.stringify(appConfig.containerParams));\n }\n oldFiles = oldFiles.filter((file) => file._id !== files.file.uid);\n if (oldFiles?.length > 0) {\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: {\n component: \"attachmentContainer\",\n params: oldFiles,\n },\n });\n } else {\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n }\n };\n\n return (\n \n {files?.length > 0 && (\n \n \n {/* Upload */}\n \n \n )}\n \n );\n};\n\nexport default AttachmentContainer;\n","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { Form } from \"antd\";\nimport React, { useEffect, useState } from \"react\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getTemplatesActionTrigger } from \"action/TemplateAction\";\nimport ViewTemplate from \"screen/UserPortal/Campaigns/Helper/ViewTemplate\";\n\nimport { languageOptions } from \"utils/languageList\";\nimport { messageSocketAccountLocked } from \"action/SocketAction\";\nimport { generateUniqueKey } from \"utils\";\n\nconst Index = ({ data, caid, activeConv, from, setOpen, md }) => {\n const dispatch = useDispatch();\n const { templates } = useSelector((state) => state.TemplateReducer);\n const { smsTemplates } = useSelector((state) => state.TemplateReducer);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const { activeOpeningsForCandidate } = useSelector(\n (state) => state.OpeningReducer\n );\n const [templateId, settemplateId] = useState(null);\n const [templateData, setTemplateData] = useState(null);\n const [form] = Form.useForm();\n useEffect(() => {\n let obj = {\n status: \"APPROVED\",\n caid: checkedList[0]?.id,\n };\n dispatch(getTemplatesActionTrigger(obj));\n }, []);\n const onTemplateSelection = (templateId) => {\n settemplateId(templateId);\n };\n useEffect(() => {\n if (md === \"whatsapp\") {\n let d = templates?.data?.find((item) => item._id === templateId);\n let obj = {\n category: d?.category,\n actionType: d?.actionType,\n templateName: d?.templateName,\n language: d?.language,\n header: {\n type: d?.header?.type,\n link: d?.header?.link,\n },\n body: d?.body,\n footer: d?.footer,\n\n action: d?.action,\n variable: d?.exampleVariable,\n };\n d && setTemplateData(obj);\n }\n if (md === \"sms\") {\n let d = smsTemplates?.data?.find((item) => item._id === templateId);\n d && setTemplateData(d);\n }\n }, [templateId, templates]);\n\n const onFinish = (values) => {\n let obj = {\n templateId: values?.templateId,\n md: md,\n convId: activeConv?.conv?._id,\n channelAccountId: caid,\n contactId: activeConv?._id,\n };\n obj.meta = {\n openingId: values?.openingId ?? activeConv?.cd?.[0]?.opening?.openingId,\n };\n dispatch(messageSocketAccountLocked(obj));\n form.resetFields();\n if (from === \"popOver\") {\n setOpen(false);\n }\n };\n return (\n \n {/* {data?.info?.blockedReason && (\n
\n \n
\n )} */}\n \n
\n 1 ? \"50vh\" : \"100vh\"\n }`,\n }}\n >\n \n
Template
\n
\n \n
\n \n }\n name=\"templateId\"\n rules={[{ required: true, message: \"Please select a template\" }]}\n >\n onTemplateSelection(val)}\n >\n {md === \"whatsapp\" &&\n templates?.data?.map((template) => {\n return (\n \n {template.name} - (\n {languageOptions.find(\n (res) => res?.value === template.language\n )?.label ?? \"N/A\"}\n )\n \n );\n })}\n {md === \"sms\" &&\n smsTemplates?.data?.map((template) => {\n return (\n {template.name}\n );\n })}\n \n \n
\n\n {activeOpeningsForCandidate.length > 1 && (\n \n \n \n {activeOpeningsForCandidate?.map((res) => {\n return (\n \n {res?.res?.positionName ?? \"-\"}\n \n );\n })}\n \n \n \n )}\n \n\n \n \n Send\n \n \n \n \n );\n};\n\nexport default Index;\n","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ReloadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ReloadOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar AppstoreAddOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"defs\", \"attrs\": {}, \"children\": [{ \"tag\": \"style\", \"attrs\": {} }] }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"appstore-add\", \"theme\": \"outlined\" };\nexport default AppstoreAddOutlined;\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 AppstoreAddOutlinedSvg from \"@ant-design/icons-svg/es/asn/AppstoreAddOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar AppstoreAddOutlined = function AppstoreAddOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: AppstoreAddOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(AppstoreAddOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'AppstoreAddOutlined';\n}\nexport default RefIcon;","// import dependencies\nimport {\n AppstoreAddOutlined,\n LoadingOutlined,\n ReloadOutlined,\n} from \"@ant-design/icons\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { CXBadge } from \"component/Badge\";\nimport { CXButton } from \"component/Button\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CHECKED_LIST } from \"constant\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { formatPhoneNumberWithExt, exportJsonToPdf } from \"utils\";\n\n// create component\nconst Index = (props) => {\n const dispatch = useDispatch();\n const location = useLocation();\n const channelAccountId = location.state?.channelAccountId;\n const { TabSwitchHandler, activeSkeleton } = props;\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { notifCount, activeConvId } = useSelector((state) => state.AppReducer);\n const [open, setopen] = useState(false);\n const activeConv = props.activeConv;\n const TabcontainerSt = {\n height: 40,\n borderTop: \"1px solid #ECECEC\",\n borderBottom: \"1px solid #ECECEC\",\n background: \"#fff\",\n display: \"flex\",\n overflowY: \"auto\",\n };\n const TabNode = {\n padding: \"8px 16px\",\n cursor: \"pointer\",\n fontSize: \"14px\",\n };\n const TabBG = (tab) => {\n if (activeSkeleton) {\n if (checkedList?.length > 0 && checkedList[0]?.id === tab) {\n return {\n background: \"rgba(1, 143, 255, 0.10)\",\n borderBottom: \"2px solid #018fff\",\n color: \"#018fff\",\n };\n } else {\n return {\n background: \"#0505051a\",\n color: \"#c9c9c9\",\n cursor: \"not-allowed\",\n PointerEvents: \"none\",\n };\n }\n }\n if (\n checkedList?.length > 0 &&\n (checkedList[0]?.id === tab || checkedList[0]?.id === \"all\")\n ) {\n return {\n background: \"rgba(1, 143, 255, 0.10)\",\n borderBottom: \"2px solid #018fff\",\n color: \"#018fff\",\n };\n } else return null;\n };\n // let Tabs = [\n // { name: \"all\", val: \"All\" },\n // { name: \"web\", val: \"Web Chat\" },\n // { name: \"sms\", val: \"SMS\" },\n // { name: \"email\", val: \"Email\" },\n // { name: \"facebook\", val: \"Facebook\" },\n // { name: \"whatsapp\", val: \"Whatsapp\" },\n // ];\n useEffect(() => {\n if (allConfigData?.length === 0) {\n dispatch(GetAllConfig());\n }\n if (\n activeConv?.conv?.channelAccount &&\n activeConv?.conv?.channelAccount?.length > 0\n ) {\n let data = activeConv?.conv?.channelAccount?.sort((a, b) => {\n const order = [\"whatsapp\", \"sms\", \"email\", \"web\"];\n return order.indexOf(a.md) - order.indexOf(b.md);\n });\n dispatch({\n type: CHECKED_LIST,\n data: [data[0]],\n });\n }\n }, []);\n\n const SelectMoreMD = () => {\n const [MD, setMD] = useState(null);\n const ADD_MD = () => {\n let data = allConfigData?.find((item) => item._id === MD);\n let obj = {\n id: MD,\n _idname:\n data.md === \"email\"\n ? data?.configEmail?.email\n : data.md === \"sms\"\n ? data?.configSms?.areaCode + data?.configSms?.number\n : data?.configWp?.senderId,\n md: data.md,\n };\n if (MD) {\n let temp = props.activeConv;\n if (!temp.conv.channelAccount.some((item) => item.id === obj.id)) {\n temp.conv.channelAccount.push(obj);\n // for future use if we want to add md in md array\n if (!temp.conv.md.includes(\"whatsapp\")) {\n temp.conv.md.push(\"whatsapp\");\n }\n props.setActiveConv({ ...temp });\n if (temp?.conv?.channelAccount?.length === 1) {\n dispatch({\n type: CHECKED_LIST,\n data: [temp.conv.channelAccount[0]],\n });\n }\n }\n setMD(null);\n }\n };\n return (\n
\n
Add Channel
\n setMD(val)}\n value={MD}\n >\n {allConfigData?.map((res) => {\n return (\n \n {res.md} - (\n {res?.configWp?.senderId\n ? formatPhoneNumberWithExt(res?.configWp?.senderId)\n : \"\"}\n {res?.configEmail?.email}\n {res?.configSms?.areaCode + res?.configSms?.number})\n \n );\n })}\n \n
\n setopen(false)}>\n Cancel\n \n {\n if (MD) {\n ADD_MD();\n setopen(false);\n }\n }}\n >\n ADD\n \n
\n
\n );\n };\n\n const MDICons = {\n whatsapp: (\n \"whatsapp\"\n ),\n email: (\n \n ),\n sms: (\n \n ),\n web: (\n \n ),\n };\n\n // useEffect(() => {\n // if (channelAccountId) {\n // TabSwitchHandler(\n // activeConv?.conv?.channelAccount.find((d) => d.id === channelAccountId)\n // );\n // }\n // }, [activeConv]);\n\n const { messages } = useSelector((state) => state.MessageReducer);\n // const handleDownloadMessage = (e) => {\n // e.stopPropagation();\n // console.log(messages.data);\n // let jsonData = messages.data.map((res) => {\n // if (res.from) {\n // return {\n // name: activeConv?.data?.name ?? \"Candidate\",\n // message: res.text,\n // time: moment(res.createdAt).format(\"DD MMM hh:mm A\"),\n // };\n // } else {\n // return {\n // name: \"Recruiter\",\n // message: res.text,\n // time: moment(res.createdAt).format(\"DD MMM hh:mm A\"),\n // };\n // }\n // });\n // console.log(jsonData);\n // exportJsonToPdf(jsonData, `${checkedList?.[0]?._idname}-messageHistory`);\n // };\n return (\n
\n {activeConv?.conv?.channelAccount &&\n activeConv.conv?.channelAccount\n ?.sort((a, b) => {\n const order = [\"whatsapp\", \"sms\", \"email\", \"web\"];\n return order.indexOf(a.md) - order.indexOf(b.md);\n })\n .map((item) => {\n return (\n TabSwitchHandler(item)}\n >\n
\n {MDICons[item.md] ?? item.md}\n\n {item?._idname && item?.md === \"whatsapp\" ? (\n
\n {formatPhoneNumberWithExt(item?._idname)}\n
\n ) : (\n \"\"\n )}\n\n {item?.md === \"email\" && item?._idname}\n {item?.md === \"sms\" && item?._idname}\n {item?.md === \"web\" && \"Web\"}\n {checkedList[0]?.id === item.id && (\n \n )}\n {/* { handleDownloadMessage(e)}>DL} */}\n
\n d?._id?.ca === item?.id\n )?.unread ?? 0\n }\n style={{\n backgroundColor:\n item.md === \"email\" ? \"#ffc008\" : \"#28a71b\",\n }}\n overflowCount={1000}\n />\n {activeSkeleton && checkedList[0]?.id !== item.id && (\n \n )}\n
\n );\n })}\n \n
\n setopen(!open)}\n />\n
\n
\n \n );\n};\n\nexport default Index;\n","import React, { useState, useEffect } from \"react\";\nimport { post } from \"helper/networkClient\";\nimport ReactHtmlParser from \"react-html-parser\";\n\nconst Index = ({ activeTemplate, CanID, senderEmail, content }) => {\n const [isLoading, setIsLoading] = useState(true);\n const [LivePreview, setLivePreview] = useState(null);\n useEffect(() => {\n const fetchLiveData = async () => {\n setIsLoading(true);\n try {\n const res = await post(`/template/preview`, {\n email: senderEmail,\n candidateId: CanID,\n text: content,\n });\n setLivePreview(res?.data?.data ?? \"\");\n setIsLoading(false);\n } catch (error) {\n console.log(error);\n setIsLoading(false);\n }\n };\n\n if (activeTemplate && CanID) {\n fetchLiveData();\n }\n }, [activeTemplate, CanID, content, senderEmail]);\n\n return (\n \n
\n Template Preview for : {activeTemplate?.title}\n
\n {isLoading ? (\n
Loading...
\n ) : (\n
\n {\" \"}\n
{ReactHtmlParser(LivePreview)}
\n
\n )}\n \n );\n};\n\nexport default Index;\n","import { CXCol } from \"component/Col\";\nimport { CXInput } from \"component/Input\";\nimport { CXRow } from \"component/Row\";\nimport { CXSelect } from \"component/Select\";\nimport CXDropable from \"component/Dropable\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport React, { useState, useEffect } from \"react\";\nimport AttachmentContainer from \"../../AttachmentContainer\";\nimport ContentContainer from \"../../ContentContainer\";\nimport {\n ACTIVE_LIST_ADMIN,\n EMAIL_RECIPIENT,\n CC_EMAIL_RECIPERNT,\n EMAIL_SUBJECT,\n CHANNEL_ACCOUNT,\n SIDEBAR_ADMIN,\n} from \"constant\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport history from \"utils/history\";\nimport { CXModal } from \"component/Modal\";\nimport { InfoCircleOutlined, UploadOutlined } from \"@ant-design/icons\";\nimport { CXOption } from \"component/Select\";\nimport { CXHTMLEditorEmail } from \"component/MarkdownEditor\";\nimport { debounce } from \"lodash\";\nimport CXUpload from \"component/Upload\";\nimport { CXButton } from \"component/Button\";\nimport { postFormData } from \"helper/networkClient\";\nimport { CHAT_CONTAINER_COMPONENT } from \"constant/app.constant\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport { CXTag } from \"component/Tag\";\nimport {\n getAccountVariables,\n getEmailTemplatesTrigger,\n} from \"action/TemplateAction\";\nimport PreviewTemplate from \"screen/UserPortal/Knowledge/EmailTemplate/PreviewTemplate\";\nimport { generateUniqueKey } from \"utils\";\nimport PreviewLiveComponent from \"component/PreviewLive\";\n\nconst component = {\n none: \"div\",\n contentContainer: ContentContainer,\n attachmentContainer: AttachmentContainer,\n};\n\nconst Compose = (props) => {\n const dispatch = useDispatch();\n const [email, setemail] = useState(\"\");\n const [showModal, setshowModal] = useState(false);\n const CC = useSelector((state) => state.AdminReducer.ccEmailRecipients);\n const BCC = useSelector((state) => state.AdminReducer.bccEmailRecipients);\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const Subject = useSelector((state) => state.AdminReducer.emailSubject);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const { activeConvId } = useSelector((state) => state.AppReducer);\n const { agents } = useSelector((state) => state.AgentReducer);\n const { MailPreviewData } = useSelector((state) => state.AdminReducer);\n const { AccountVariables } = useSelector((state) => state.TemplateReducer);\n const { EmailTemplates } = useSelector((state) => state.TemplateReducer);\n const { activeOpeningsForCandidate } = useSelector(\n (state) => state.OpeningReducer\n );\n const [options, setOptions] = useState(null);\n const debouncedOnModelChange = debounce(props?.onModelChange, 500);\n const [defaultFileList, setDefaultFileList] = useState(\n props?.attachmentResume ? [...props?.attachmentResume] : []\n );\n const [CopyTo, setCopyTo] = useState(\n props?.submitCc?.length > 0 ? [\"Cc\"] : []\n );\n const [SelectedTemplate, setSelectedTemplate] = useState(null);\n // const [TemplateList, setTemplateList] = useState(false);\n const [PreviewLive, setPreviewLive] = useState(false);\n\n const HeaderStyle = {\n background: \"#FFFFFF\",\n boxShadow: \"0px 2px 8px rgba(0, 0, 0, 0.16)\",\n borderRadius: \"8px 8px 0px 0px\",\n height: \"84px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n padding: 35,\n };\n const handleSubject = (val) => {\n dispatch({ type: EMAIL_SUBJECT, data: val });\n };\n const handleChangeS = (value) => {\n let regex = new RegExp(\n \"([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|\\\"([]!#-[^-~ \\t]|(\\\\[\\t -~]))+\\\")@([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|[[\\t -Z^-~]*])\"\n );\n let CCMail = value.filter((res) => {\n if (regex.test(res.value)) {\n return res;\n }\n });\n dispatch({ type: CC_EMAIL_RECIPERNT, data: CCMail });\n };\n const handleChangeB = (value) => {\n let regex = new RegExp(\n \"([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|\\\"([]!#-[^-~ \\t]|(\\\\[\\t -~]))+\\\")@([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|[[\\t -Z^-~]*])\"\n );\n let BCCMail = value.filter((res) => {\n if (regex.test(res.value)) {\n return res;\n }\n });\n dispatch({ type: \"BCC_EMAIL_RECIPERNT\", data: BCCMail });\n };\n useEffect(() => {\n dispatch({\n type: EMAIL_RECIPIENT,\n data: activeConvId?.data?.email,\n });\n if (EmailList?.length === 0) {\n dispatch(GetAllConfig());\n }\n dispatch(getAccountVariables());\n if (email?.length === 0) {\n let def = defaultIdFunc(\"email\");\n setemail(def);\n } else {\n setshowModal(true);\n }\n return () => {\n dispatch({ type: \"REMOVE_MAIL_PREVIEW_DATA\", data: null });\n props.onModelChange(\"\");\n };\n }, []);\n const defaultIdFunc = (checkBy) => {\n if (EmailList?.length > 0) {\n let data = EmailList?.find(\n (element) => element.md === checkBy && element.systemDefault === true\n );\n return data?._id;\n }\n };\n useEffect(() => {\n let Account = \"\";\n if (checkedList.includes(\"email\") && email?.length > 0) {\n Account = email;\n }\n dispatch({ type: CHANNEL_ACCOUNT, data: Account });\n }, [email, checkedList]);\n\n const RouteNow = () => {\n history.push(\"/admin/admin\");\n dispatch({ type: ACTIVE_LIST_ADMIN, data: \"Connected\" });\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n };\n const modalIcon = {\n fontSize: \"19px\",\n marginRight: \"5px\",\n marginTop: \"-7px\",\n color: \"#d92626\",\n };\n const uploadImage = async (options) => {\n const { onSuccess, onError, file, onProgress } = options;\n const fmData = new FormData();\n fmData.append(\"file\", file);\n try {\n const res = await postFormData(\"/file\", fmData);\n onSuccess(res.data.data);\n } catch (err) {\n const error = new Error(\"Some error\");\n onError({ err });\n }\n };\n const handleOnChange = ({ file, fileList, event }) => {\n if (file.status === \"done\") {\n const uploadedData = {\n ...file.response,\n name: file.name,\n uid: file.uid,\n };\n setDefaultFileList((prevList) => [...prevList, uploadedData]);\n } else if (file.status === \"removed\") {\n // Find the index of the file to be removed\n const indexToRemove = defaultFileList.findIndex(\n (item) => item.uid === file.uid\n );\n\n if (indexToRemove !== -1) {\n // Remove the file from the file list\n const updatedFileList = [...defaultFileList];\n updatedFileList.splice(indexToRemove, 1);\n setDefaultFileList(updatedFileList);\n }\n }\n };\n useEffect(() => {\n if (defaultFileList?.length > 0) {\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"attachmentContainer\", params: defaultFileList },\n });\n } else {\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n }\n }, [defaultFileList]);\n useEffect(() => {\n if (MailPreviewData && props.EmailComponent == \"composeViewOnly\") {\n if (MailPreviewData?.cc?.length > 0) {\n setCopyTo((prev) => [...prev, \"Cc\"]);\n }\n if (MailPreviewData?.bcc?.length > 0) {\n setCopyTo((prev) => [...prev, \"Bcc\"]);\n }\n }\n }, [MailPreviewData]);\n useEffect(() => {\n dispatch(getEmailTemplatesTrigger());\n }, []);\n\n const handleToggleCopyTo = (value) => {\n if (CopyTo.includes(value)) {\n setCopyTo((prev) => prev.filter((item) => item !== value));\n } else {\n setCopyTo((prev) => [...prev, value]);\n }\n };\n\n const handleChangeTemplate = (val) => {\n setSelectedTemplate(\n EmailTemplates?.data.find((res) => res?._id === val?.key)\n );\n };\n\n // useEffect(() => {\n // if (!TemplateList) {\n // setSelectedTemplate(null);\n // dispatch({ type: EMAIL_SUBJECT, data: \"\" });\n // props?.onModelChange(\"\");\n // }\n // }, [TemplateList]);\n\n useEffect(() => {\n if (props?.submissionTable?.length > 0) {\n if (SelectedTemplate?.subject) {\n dispatch({ type: EMAIL_SUBJECT, data: SelectedTemplate?.subject });\n let template = SelectedTemplate?.text;\n if (SelectedTemplate?.text.includes(\"{{SubmissionTable}}\")) {\n template = template.replace(\n \"{{SubmissionTable}}\",\n props?.submissionTable\n );\n props?.onModelChange(template);\n } else {\n props?.onModelChange(template);\n }\n }\n } else {\n if (SelectedTemplate?.subject) {\n dispatch({ type: EMAIL_SUBJECT, data: SelectedTemplate?.subject });\n props?.onModelChange(SelectedTemplate?.text);\n }\n }\n }, [SelectedTemplate]);\n console.log(\"attachmentResume\", props.attachmentResume);\n\n return (\n
\n {!props?.headerHide && (\n setshowModal(false)}\n style={{ top: 0 }}\n closable={false}\n width={\"100vw\"}\n >\n \n Connected Account for\n SMS/EMAIL is not available Please go to{\" \"}\n Admin Section {\"> \"}\n Connected Account {\"> \"}\n Add {\"> \"}\n SMS/Email\n \n RouteNow()}\n className=\"cursor-pointer font-600\"\n style={{ color: \"#018fff\", marginLeft: 5 }}\n >\n ADD NOW\n \n \n )}\n {!props?.headerHide && (\n
\n
\n
\n {\n props?.setEmailComponent(\"plainView\");\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n }}\n />\n
\n {props?.EmailComponent !== \"composeViewOnly\" ? (\n
Compose email
\n ) : (\n
Preview
\n )}\n
\n\n {/* {props?.EmailComponent === \"composeViewOnly\" && (\n
\n console.log(\"sendmail\")}\n >\n Reply\n \n
\n )} */}\n\n {props?.EmailComponent !== \"composeViewOnly\" && (\n
\n
\n props?.handleSubmit(\"send\")}\n >\n Send\n \n
\n
\n sending from : {checkedList[0]?._idname}\n
\n
\n )}\n
\n )}\n {props?.EmailComponent === \"composeViewOnly\" && (\n
\n \n
\n )}\n {props?.EmailComponent !== \"composeViewOnly\" && (\n
\n
\n \n
\n {\n if (props?.EmailComponent === \"SubmissionReport\") {\n props?.setemailRecipient(e.target.value);\n }\n }}\n addonBefore={\n \n To :\n
\n }\n />\n\n
\n
\n {\n props.EmailComponent !== \"composeViewOnly\" &&\n handleToggleCopyTo(\"Cc\");\n }}\n >\n Cc\n \n
\n
\n {\n props.EmailComponent !== \"composeViewOnly\" &&\n handleToggleCopyTo(\"Bcc\");\n }}\n >\n Bcc\n \n
\n
\n
\n \n {CopyTo.includes(\"Cc\") && (\n \n Cc :\n \n \n {options}\n \n \n \n )}\n {CopyTo.includes(\"Bcc\") && (\n \n Bcc :\n \n \n {options}\n \n \n \n )}\n
\n {\" \"}\n \n \n Template :\n \n \n \n {EmailTemplates?.data?.map((res) => {\n return {res?.title};\n })}\n \n \n {SelectedTemplate && props?.senderEmail && (\n setPreviewLive(true)}\n >\n Preview\n \n )}\n \n {activeOpeningsForCandidate?.length > 1 && (\n \n \n Opening :\n \n \n props?.setopeningId(v)}\n notFoundContent={null}\n labelInValue={true}\n >\n {activeOpeningsForCandidate?.map((res) => {\n if (!res.isDeleted) {\n return (\n \n {res?.res?.positionName}\n \n );\n }\n })}\n \n \n \n )}\n
\n
\n \n
\n Subject :
\n }\n defaultValue={MailPreviewData?.subject ?? Subject}\n onBlur={(e) => handleSubject(e.target.value)}\n />\n {/*
\n {\n props.EmailComponent !== \"composeViewOnly\" &&\n setTemplateList(!TemplateList);\n }}\n >\n Templates\n \n
*/}\n
\n \n
\n\n {/*
Template
\n
\n {\n setSelectedTemplate(\n EmailTemplates?.data.find((res) => res?._id === templateID)\n );\n }}\n >\n {EmailTemplates?.data?.map((res) => {\n return {res?.title};\n })}\n \n
*/}\n
\n \n
\n {agents?.data?.length > 0 &&\n AccountVariables?.data?.length > 0 && (\n {\n return {\n id: `@${res?.fname + \" \" + res?.lname}`,\n uid: res?._id,\n };\n })\n }\n variableData={\n props.EmailComponent === \"SubmissionReport\"\n ? [\n {\n id: `{{SubmissionTable}}`,\n uid: \"SubmissionTable\",\n },\n {\n id: `{{Role.recruiterSignature}}`,\n uid: \"recruiterSignature\",\n },\n {\n id: `{{Role.recruiterName}}`,\n uid: \"recruiterName\",\n },\n ]\n : AccountVariables &&\n AccountVariables?.data?.map((res) => {\n return {\n id: `{{${res?.name}}}`,\n uid: res?._id,\n };\n })\n }\n data={MailPreviewData?.text ?? props?.model}\n onModelChange={(data) => {\n debouncedOnModelChange(data);\n }}\n onBlur={(event, editor) => {}}\n />\n )}\n\n {!props.AttachmentHide && (\n \n 0\n ? MailPreviewData?.attachments.map((res) => {\n return {\n uid: res?._id,\n name: res?.fileName,\n status: \"done\",\n url: res?.url,\n };\n })\n : defaultFileList\n }\n onChange={handleOnChange}\n // listType=\"picture\"\n className=\"upload-list-inline emailCnt\"\n >\n {props.EmailComponent !== \"composeViewOnly\" && (\n \n \n Click here to select attachment\n \n )}\n \n
\n )}\n \n
\n \n )}\n setPreviewLive(false)}\n width={\"60vw\"}\n >\n res?.opening?.openingId === props?.openingId.value\n )?._id\n }\n senderEmail={props?.senderEmail}\n />\n \n \n );\n};\n\nexport default Compose;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar TimelineItem = function TimelineItem(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n _a$color = _a.color,\n color = _a$color === void 0 ? 'blue' : _a$color,\n dot = _a.dot,\n _a$pending = _a.pending,\n pending = _a$pending === void 0 ? false : _a$pending,\n position = _a.position,\n label = _a.label,\n children = _a.children,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"color\", \"dot\", \"pending\", \"position\", \"label\", \"children\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('timeline', customizePrefixCls);\n var itemClassName = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item\"), true), \"\".concat(prefixCls, \"-item-pending\"), pending), className);\n var dotClassName = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item-head\"), true), \"\".concat(prefixCls, \"-item-head-custom\"), !!dot), \"\".concat(prefixCls, \"-item-head-\").concat(color), true));\n var customColor = /blue|red|green|gray/.test(color || '') ? undefined : color;\n return /*#__PURE__*/React.createElement(\"li\", _extends({}, restProps, {\n className: itemClassName\n }), label && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-label\")\n }, label), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-tail\")\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: dotClassName,\n style: {\n borderColor: customColor,\n color: customColor\n }\n }, dot), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-content\")\n }, children));\n};\nexport default TimelineItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nimport TimelineItem from './TimelineItem';\nvar Timeline = function Timeline(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$pending = props.pending,\n pending = _props$pending === void 0 ? null : _props$pending,\n pendingDot = props.pendingDot,\n children = props.children,\n className = props.className,\n _props$reverse = props.reverse,\n reverse = _props$reverse === void 0 ? false : _props$reverse,\n _props$mode = props.mode,\n mode = _props$mode === void 0 ? '' : _props$mode,\n restProps = __rest(props, [\"prefixCls\", \"pending\", \"pendingDot\", \"children\", \"className\", \"reverse\", \"mode\"]);\n var prefixCls = getPrefixCls('timeline', customizePrefixCls);\n var pendingNode = typeof pending === 'boolean' ? null : pending;\n var pendingItem = pending ? ( /*#__PURE__*/React.createElement(TimelineItem, {\n pending: !!pending,\n dot: pendingDot || /*#__PURE__*/React.createElement(LoadingOutlined, null)\n }, pendingNode)) : null;\n var timeLineItems = React.Children.toArray(children);\n timeLineItems.push(pendingItem);\n if (reverse) {\n timeLineItems.reverse();\n }\n var getPositionCls = function getPositionCls(ele, idx) {\n if (mode === 'alternate') {\n if (ele.props.position === 'right') return \"\".concat(prefixCls, \"-item-right\");\n if (ele.props.position === 'left') return \"\".concat(prefixCls, \"-item-left\");\n return idx % 2 === 0 ? \"\".concat(prefixCls, \"-item-left\") : \"\".concat(prefixCls, \"-item-right\");\n }\n if (mode === 'left') return \"\".concat(prefixCls, \"-item-left\");\n if (mode === 'right') return \"\".concat(prefixCls, \"-item-right\");\n if (ele.props.position === 'right') return \"\".concat(prefixCls, \"-item-right\");\n return '';\n };\n // Remove falsy items\n var truthyItems = timeLineItems.filter(function (item) {\n return !!item;\n });\n var itemsCount = React.Children.count(truthyItems);\n var lastCls = \"\".concat(prefixCls, \"-item-last\");\n var items = React.Children.map(truthyItems, function (ele, idx) {\n var pendingClass = idx === itemsCount - 2 ? lastCls : '';\n var readyClass = idx === itemsCount - 1 ? lastCls : '';\n return cloneElement(ele, {\n className: classNames([ele.props.className, !reverse && !!pending ? pendingClass : readyClass, getPositionCls(ele, idx)])\n });\n });\n var hasLabelItem = timeLineItems.some(function (item) {\n var _a;\n return !!((_a = item === null || item === void 0 ? void 0 : item.props) === null || _a === void 0 ? void 0 : _a.label);\n });\n var classString = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-pending\"), !!pending), \"\".concat(prefixCls, \"-reverse\"), !!reverse), \"\".concat(prefixCls, \"-\").concat(mode), !!mode && !hasLabelItem), \"\".concat(prefixCls, \"-label\"), hasLabelItem), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"ul\", _extends({}, restProps, {\n className: classString\n }), items);\n};\nTimeline.Item = TimelineItem;\nexport default Timeline;","import Timeline from './Timeline';\nexport default Timeline;","import { getThreadMessages } from \"action/MessageAction\";\nimport { CXCol } from \"component/Col\";\nimport { CXCollapse, CXCollapsePanel } from \"component/Collapse\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXText } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport Compose from \"./Compose\";\nimport { CXButton } from \"component/Button\";\nimport { ArrowLeftOutlined, PaperClipOutlined } from \"@ant-design/icons\";\nimport { messageSocket } from \"action/SocketAction\";\nimport { Timeline } from \"antd\";\nimport TimelineItem from \"antd/lib/timeline/TimelineItem\";\nimport ReactHtmlParser from \"react-html-parser\";\n\nconst ReplyThread = (props) => {\n const [EmailData, setEmailData] = useState(\"\");\n const Subject = useSelector((state) => state.AdminReducer.emailSubject);\n const CC = useSelector((state) => state.AdminReducer.ccEmailRecipients);\n const BCC = useSelector((state) => state.AdminReducer.bccEmailRecipients);\n const { activeConvId } = useSelector((state) => state.AppReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const { chatContainerComponent, containerParams } = useSelector(\n (state) => state.AppReducer\n );\n const { MailPreviewDataThread, checkedList } = useSelector(\n (state) => state.AdminReducer\n );\n const { threadLoading, EmailThreadMessages } = useSelector(\n (state) => state.MessageReducer\n );\n const [ReplyNow, setReplyNow] = useState(false);\n const dispatch = useDispatch();\n const HeaderStyle = {\n background: \"#FFFFFF\",\n boxShadow: \"0px 2px 8px rgba(0, 0, 0, 0.16)\",\n borderRadius: \"8px 8px 0px 0px\",\n height: \"84px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n padding: 35,\n };\n useEffect(() => {\n MailPreviewDataThread?._id &&\n dispatch(getThreadMessages(MailPreviewDataThread?._id));\n return () => {\n dispatch({ type: \"CC_EMAIL_RECIPERNT\", data: [] });\n dispatch({ type: \"EMAIL_SUBJECT\", data: \"\" });\n dispatch({ type: \"REMOVE_MAIL_PREVIEW_DATA\", data: null });\n };\n }, []);\n const callback = (key) => {\n let data = EmailThreadMessages?.data?.find((item) => item._id === key);\n dispatch({\n type: \"SET_MAIL_PREVIEW_DATA\",\n data: data,\n });\n };\n const handleModelChange = (model) => {\n setEmailData(model);\n model === \"\" &&\n dispatch({\n type: \"DROP_CONTENT\",\n data: {},\n });\n };\n const SendReplyMail = () => {\n let message = {\n msg: {\n ne: false,\n isParent: true,\n attachments:\n chatContainerComponent === \"attachmentContainer\"\n ? containerParams\n : [],\n content: {\n attachments: [],\n },\n md: \"email\",\n to: [\n {\n _id: activeConvId._id,\n name: activeConvId?.data?.name,\n },\n ],\n text: EmailData,\n parentId: MailPreviewDataThread?._id,\n type: \"message\",\n convId: activeConvId.conv._id,\n channelAccountId: checkedList[0][\"id\"],\n cc: CC,\n subject: Subject,\n bcc: BCC,\n },\n ts: new Date(),\n type: \"message\",\n };\n dispatch(messageSocket(message, user.userProfile));\n dispatch({\n type: \"CHAT_CONTAINER_COMPONENT\",\n data: { component: \"none\", params: null },\n });\n setEmailData(\"\");\n props.setEmailComponent(\"plainView\");\n dispatch({ type: \"CC_EMAIL_RECIPERNT\", data: [] });\n dispatch({ type: \"EMAIL_SUBJECT\", data: \"\" });\n dispatch({\n type: \"DROP_CONTENT\",\n data: {},\n });\n };\n\n return (\n
\n
\n
\n
\n {\n props?.setEmailComponent(\"plainView\");\n dispatch({\n type: \"CHAT_CONTAINER_COMPONENT\",\n data: { component: \"none\", params: null },\n });\n }}\n />\n
\n
Re: {activeConvId?.data?.name}
\n
\n
\n SendReplyMail()}>\n Send\n \n
\n
\n {threadLoading && }\n
\n {MailPreviewDataThread.subject}\n
\n
\n \n {EmailThreadMessages?.data?.length > 0 &&\n !ReplyNow &&\n EmailThreadMessages?.data?.map((item, index) => {\n return (\n }\n >\n \n \n \n {\n \n }\n {item.ingress ? \"From\" : \"Reply\"}:{\" \"}\n \n {item.ingress\n ? item?.from?.name\n : item?.to[0]?.name}\n \n \n
\n }\n className=\"bg-white\"\n >\n {ReactHtmlParser(item?.text)}\n {item.attachments?.length > 0 && (\n
\n {item.attachments.map((res) => {\n return (\n \n );\n })}\n
\n )}\n \n \n \n );\n })}\n \n
\n \n
\n
\n \n );\n};\n\nexport default ReplyThread;\n","import { CXCol } from \"component/Col\";\nimport { CXMarkdownFacebookChatEditor } from \"component/MarkdownEditor\";\nimport { CXRow } from \"component/Row\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CHANNEL_ACCOUNT } from \"constant\";\nimport React, { useState, useEffect, Fragment } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { generateUniqueKey } from \"utils\";\n\nconst Index = ({\n handleSubmit,\n data,\n handleModelChange,\n ActiveComponent,\n handleOnFocus,\n handleOnBlur,\n handleUploadFile,\n}) => {\n const dispatch = useDispatch();\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const FBcheck = useSelector((state) => state);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const [facebook, setfacebook] = useState(\"\");\n const defaultIdFunc = (checkBy) => {\n if (EmailList?.length > 0) {\n let data = EmailList?.find(\n (element) => element.md === checkBy && element.systemDefault === true\n );\n return data?._id;\n }\n };\n useEffect(() => {\n let Account = \"\";\n if (checkedList.includes(\"facebook\") && facebook?.length > 0) {\n Account = facebook;\n }\n dispatch({ type: CHANNEL_ACCOUNT, data: Account });\n }, [checkedList, facebook]);\n return (\n \n {!FBcheck?.AppReducer?.activeConvId?.md?.includes(\"facebook\") && (\n
\n User did not initiated a facebook chat yet\n
\n )}\n {FBcheck?.AppReducer?.activeConvId?.contact?.meta?.fbSenderId && (\n \n {}}\n onFileUpload={handleUploadFile}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n />\n {ActiveComponent !== \"team\" && !checkedList.includes(\"web\") && (\n \n \n setfacebook(val)}\n value={facebook ? facebook : defaultIdFunc(\"facebook\")}\n >\n {EmailList.map(\n (res) =>\n res.md === \"facebook\" && (\n \n {res?.configFb?.email}\n \n )\n )}\n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default Index;\n","import { GetAllConfig } from \"action/AdminActions\";\nimport { CC_EMAIL_RECIPERNT, CHANNEL_ACCOUNT, EMAIL_SUBJECT } from \"constant\";\nimport React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport SendButton from \"../../../../../../component/MarkdownEditor/SendButton\";\nimport { CXMarkdownWhatsappChatEditor } from \"component/MarkdownEditor\";\nimport { CXPopover } from \"component/Popover\";\nimport ChatAccountLocked from \"../ChatAccountLocked\";\nimport {\n getSmsTemplates,\n getTemplatesActionTrigger,\n} from \"action/TemplateAction\";\n\nconst Index = ({\n setshowModal,\n handleSubmit,\n data,\n handleModelChange,\n ActiveComponent,\n handleOnFocus,\n handleOnBlur,\n}) => {\n const dispatch = useDispatch();\n const EmailList = useSelector((state) => state.AdminReducer.allConfigData);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const messages = useSelector((state) => state.MessageReducer.messages);\n const appConfig = useSelector((state) => state.AppReducer);\n const [sms, setsms] = useState(\"\");\n const defaultIdFunc = (checkBy) => {\n if (EmailList?.length > 0) {\n let data = EmailList?.find(\n (element) => element.md === checkBy && element.systemDefault === true\n );\n return data?._id;\n }\n };\n const [open, setOpen] = useState(false);\n useEffect(() => {\n if (EmailList?.length === 0) {\n dispatch(GetAllConfig());\n }\n if (checkedList.includes(\"sms\")) {\n if (sms?.length !== undefined) {\n let def = defaultIdFunc(\"sms\");\n dispatch({ type: CC_EMAIL_RECIPERNT, data: [] });\n dispatch({ type: EMAIL_SUBJECT, data: \"\" });\n setsms(def);\n } else {\n setshowModal(true);\n }\n }\n let Account = \"\";\n if (checkedList.includes(\"sms\") && sms?.length > 0) {\n Account = sms;\n }\n dispatch({ type: CHANNEL_ACCOUNT, data: Account });\n }, [checkedList, sms]);\n const handleOpenChange = (newOpen) => {\n dispatch(getSmsTemplates());\n setOpen(newOpen);\n };\n return (\n
\n console.log(data)}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n />\n
\n \n
\n \n \n
\n }\n >\n \n \n
\n \n
\n \n \n );\n};\n\nexport default Index;\n","import { CXMarkdownWhatsappChatEditor } from \"component/MarkdownEditor\";\nimport React from \"react\";\n\nconst index = ({\n handleSubmit,\n data,\n handleOnFocus,\n handleOnBlur,\n handleUploadFile,\n}) => {\n return (\n
\n {}}\n onFileUpload={handleUploadFile}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n />\n
\n );\n};\n\nexport default index;\n","import React, { useState, useEffect, Fragment } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CHANNEL_ACCOUNT } from \"constant\";\nimport { CXMarkdownWhatsappChatEditor } from \"component/MarkdownEditor\";\nimport SendButton from \"../../../../../../component/MarkdownEditor/SendButton\";\nimport { CXPopover } from \"component/Popover\";\nimport ChatAccountLocked from \"../ChatAccountLocked\";\nimport { getTemplatesActionTrigger } from \"action/TemplateAction\";\n\nconst ChatViaWhatsapp = ({\n handleSubmit,\n data,\n handleModelChange,\n ActiveComponent,\n handleOnFocus,\n handleOnBlur,\n handleUploadFile,\n activeConv,\n}) => {\n const dispatch = useDispatch();\n const { agents } = useSelector((state) => state.AgentReducer);\n const messages = useSelector((state) => state.MessageReducer.messages);\n const WPcheck = useSelector((state) => state);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const appConfig = useSelector((state) => state.AppReducer);\n const [whatsapp, setWhatsapp] = useState(\"\");\n const [open, setOpen] = useState(false);\n // const defaultIdFunc = (checkBy) => {\n // if (EmailList.length > 0) {\n // let data = EmailList?.find(\n // (element) => element.md === checkBy && element.systemDefault === true\n // );\n // return data?._id;\n // }\n // };\n useEffect(() => {\n let Account = \"\";\n if (checkedList.includes(\"whatsapp\") && whatsapp?.length > 0) {\n Account = whatsapp;\n }\n dispatch({ type: CHANNEL_ACCOUNT, data: Account });\n }, [checkedList, whatsapp]);\n const hide = () => {\n setOpen(false);\n };\n const handleOpenChange = (newOpen) => {\n let obj = {\n status: \"APPROVED\",\n caid: checkedList[0]?.id,\n };\n dispatch(getTemplatesActionTrigger(obj));\n setOpen(newOpen);\n };\n return (\n \n {!activeConv?.conv.channelAccount?.find((v) => v.md === \"whatsapp\") && (\n
\n User hasn't initiated a WhatsApp conversation yet.\n
\n )}\n {activeConv?.conv.channelAccount?.find((v) => v.md === \"whatsapp\") && (\n
\n {\n return {\n id: `@${res?.fname + \" \" + res?.lname}`,\n uid: res?._id,\n };\n })}\n // onModelChange={handleModelChange} // TODO: Removed for performance improvement\n onModelChange={(data) => console.log(data)}\n onFileUpload={handleUploadFile}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n />\n {ActiveComponent !== \"team\" && !checkedList.includes(\"web\") && (\n
\n \n
\n \n \n
\n }\n >\n \n \n
\n {/*
\n \n {formatPhoneNumberWithExt(checkedList[0][\"_idname\"])}\n \n
*/}\n \n \n \n )}\n
\n )}\n \n );\n};\n\nexport default ChatViaWhatsapp;\n","import { CloudDownloadOutlined, InfoCircleOutlined } from \"@ant-design/icons\";\nimport { CXModal } from \"component/Modal\";\nimport { ACTIVE_LIST_ADMIN, SIDEBAR_ADMIN } from \"constant\";\nimport React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n// import AddCard from \"screen/UserPortal/Tasks/AddCard\";\nimport history from \"utils/history\";\n\nconst modalIcon = {\n fontSize: \"19px\",\n marginRight: \"5px\",\n marginTop: \"-7px\",\n color: \"#d92626\",\n};\n\nconst Index = ({\n showModal,\n setshowModal,\n isModalVisible,\n handleCancel,\n errorModalVisible,\n handleErrorCancel,\n errorString,\n ImagePopView,\n imgPopClose,\n ImagePopURL,\n ctask,\n}) => {\n const dispatch = useDispatch();\n const CardView = useSelector((state) => state.TaskBoardReducer);\n const AgentData = useSelector((state) => state.AgentReducer.agents);\n const RouteNow = () => {\n history.push(\"/admin/admin\");\n dispatch({ type: ACTIVE_LIST_ADMIN, data: \"Connected\" });\n dispatch({ type: SIDEBAR_ADMIN, data: true });\n };\n const viewAssign = (id) => {\n let val = AgentData?.data?.filter((val) => val._id === id);\n if (val !== undefined) {\n return val[0].fname.slice(0, 1);\n }\n };\n return (\n
\n setshowModal(false)}\n style={{ top: 0 }}\n closable={false}\n width={\"100vw\"}\n >\n \n Connected Account for\n SMS/EMAIL is not available Please go to{\" \"}\n Admin Section {\"> \"}\n Connected Account {\"> \"}\n Add {\"> \"}\n SMS/Email\n \n RouteNow()}\n className=\"cursor-pointer font-600\"\n style={{ color: \"#018fff\", marginLeft: 5 }}\n >\n ADD NOW\n \n \n {/* \n \n */}\n handleErrorCancel()}\n >\n {errorString}\n \n {/* Modal for validation End */}\n imgPopClose()}\n >\n
\n
\n
Preview
\n \n \n \n
\n
\n \"PopImage\"\n
\n
\n \n
\n );\n};\n\nexport default Index;\n","import React, {\n useState,\n useEffect,\n useRef,\n useCallback,\n useLayoutEffect,\n} from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport moment from \"moment\";\nimport { CXLayout } from \"component/Layout\";\nimport { CXContent } from \"component/Layout\";\nimport ToolBar from \"../ToolBar\";\nimport CXDropable from \"component/Dropable\";\nimport AttachmentContainer from \"../AttachmentContainer\";\nimport ContentContainer from \"../ContentContainer\";\nimport InboxSidebar from \"../LeftSideBar/InboxSidebar\";\nimport ChatTopBar from \"../TopBar\";\nimport { CXDivider } from \"component/Divider\";\nimport { messageSocket } from \"action/SocketAction\";\nimport { historicalMessageActionTrigger } from \"action/MessageAction\";\nimport { store } from \"../../../../../store\";\nimport ChatTabs from \"./ChatTabs\";\nimport \"./style.css\";\nimport { CXEmpty } from \"component/Empty\";\nimport {\n LoadingOutlined,\n MailOutlined,\n PlusOutlined,\n WarningOutlined,\n} from \"@ant-design/icons\";\nimport Compose from \"./ChatViaEmail/Compose\";\nimport { RenderMessage, ChatSkeleton } from \"../RenderMessage\";\nimport Modals from \"./Modals\";\nimport {\n HISTORICAL_MESSAGE_ACTION_RESPONSE,\n REPLY_THREAD_ACTIVE,\n REPLY_ID,\n THREAD_LOAD,\n CHECKED_LIST,\n EMAIL_RECIPIENT,\n NEW_MESSAGE_ACTION_TRIGGER,\n SEND_MESSAGE_ACTION_TRIGGER,\n CLEAR_MESSAGE,\n EMIT_TYPING,\n UPLOAD_MESSAGE_FILE_ACTION_RESPONSE,\n} from \"constant\";\nimport { CHAT_CONTAINER_COMPONENT, DROP_CONTENT } from \"constant/app.constant\";\nimport ChatViaWeb from \"./ChatViaWeb\";\nimport ChatViaSms from \"./ChatViaSms\";\nimport ChatViaMeta from \"./ChatViaMeta\";\nimport ChatViaWhatsapp from \"./ChatViaWhatsapp\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXChatProcessing, CXChatTyping } from \"component/Chat\";\nimport { uploadMessageFileActionTrigger } from \"action/FileAction\";\nimport { getCampaigns } from \"action/CampaignAction\";\nimport { cxmessage, setDateCloud } from \"utils\";\nimport ChatAccountLocked from \"./ChatAccountLocked\";\nimport { getTemplatesActionTrigger } from \"action/TemplateAction\";\nimport ReplyThread from \"./ChatViaEmail/ReplyThread\";\nimport { getChannelAccountStatus } from \"action/AdminActions\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXPopover } from \"component/Popover\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { getSidebarNotifications } from \"action/NotificationActions\";\nconst component = {\n none: \"div\",\n contentContainer: ContentContainer,\n attachmentContainer: AttachmentContainer,\n};\n\nlet flag = false;\n\nconst ChatOnly = ({\n leftBar = true,\n rightBar = true,\n mailClass = \"ck-email\",\n}) => {\n const dispatch = useDispatch();\n const messageRef = useRef();\n const [loading, setLoading] = useState(true);\n const [data, setdata] = useState(\"\");\n const [ImagePopView, setImagePopView] = useState(false);\n const [ImagePopURL, setImagePopURL] = useState(null);\n const [activeSkeleton, setactiveSkeleton] = useState(true);\n const [isModalVisible, setIsModalVisible] = useState(false);\n const [errorModalVisible, seterrorModalVisible] = useState(false);\n const [errorString, seterrorString] = useState(\"\");\n const [showEmpty, setshowEmpty] = useState(false);\n const [replyData, setreplyData] = useState(\"\");\n const messages = useSelector((state) => state.MessageReducer.messages);\n const appConfig = useSelector((state) => state.AppReducer);\n const messageAction = useSelector((state) => state.MessageReducer.action);\n const messageReducer = useSelector((state) => state.MessageReducer);\n const dittoAdminReducer = useSelector((state) => state.dittoAdminReducer);\n const WindowWidth = useSelector((state) => state.AppReducer.windowWidth);\n const emailSubject = useSelector((state) => state.AdminReducer.emailSubject);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n const { activeOpeningsForCandidate } = useSelector(\n (state) => state.OpeningReducer\n );\n const { ChannelAccountStatus, ChannelAccountStatusLoading } = useSelector(\n (state) => state.AdminReducer\n );\n const Recipients = useSelector((state) => state.ContactReducer.contacts);\n const { agents } = useSelector((state) => state.AgentReducer);\n const { notifCount } = useSelector((state) => state.AppReducer);\n const [EmailComponent, setEmailComponent] = useState(\"plainView\");\n const [showModal, setshowModal] = useState(false);\n const [ChatContainerWidth, setChatContainerWidth] = useState(144);\n const [contactData, setContactData] = useState(null);\n const [activeConv, setActiveConv] = useState(null);\n const ActiveComponent = \"inbox\";\n const FileReducer = useSelector((state) => state.FileReducer);\n const [ctask, setctask] = useState(\"\");\n const [newMail, setnewMail] = useState(true);\n const [openingId, setopeningId] = useState(null);\n const [open, setOpen] = useState(false);\n\n const ColRStyle = {\n overflow: \"auto\",\n display: \"flex\",\n flexDirection: \"column-reverse\",\n paddingLeft: !rightBar ? 20 : 0,\n };\n const FlexEnd = {\n display: \"flex\",\n justifyContent: \"flex-end\",\n flexDirection: \"column\",\n };\n const ComposeBtnStyle = {\n boxShadow: \"0px 0px 4px rgba(0, 0, 0, 0.08)\",\n border: \"1px solid #000000\",\n borderRadius: \"8px\",\n width: 128,\n height: 40,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n cursor: \"pointer\",\n };\n const showModalChat = (v) => {\n setctask(v);\n setIsModalVisible(true);\n };\n const ShowThread = () => {\n dispatch({ type: REPLY_THREAD_ACTIVE, data: true });\n dispatch({ type: REPLY_ID, data: replyData });\n dispatch({ type: THREAD_LOAD, data: true });\n };\n const handleCancel = () => {\n setIsModalVisible(false);\n };\n const handleErrorCancel = () => {\n seterrorModalVisible(false);\n };\n\n const current = !appConfig.chatContainerComponent\n ? \"none\"\n : appConfig.chatContainerComponent;\n\n useEffect(() => {\n dispatch({ type: CHAT_CONTAINER_COMPONENT, data: { component: \"none\" } });\n dispatch(getCampaigns());\n }, []);\n\n useEffect(() => {\n if (appConfig?.activeConvId?.conv?._id) {\n setshowEmpty(false);\n setLoading(true);\n setActiveConv(appConfig.activeConvId);\n if (checkedList?.length > 0 && !appConfig.candidateUpdate) {\n setactiveSkeleton(true);\n dispatch(\n historicalMessageActionTrigger({\n convId: appConfig?.activeConvId?.conv?._id,\n channel: checkedList && checkedList[0]?.id,\n })\n );\n }\n if (!appConfig.candidateUpdate) {\n dispatch({ type: CLEAR_MESSAGE });\n let cd = { ...appConfig.activeConvId };\n delete cd.conv;\n setContactData(cd);\n }\n } else {\n setactiveSkeleton(false);\n setshowEmpty(true);\n }\n }, [appConfig.activeConvId, checkedList]);\n\n useLayoutEffect(() => {\n setChatContainerWidth(messageRef?.current?.clientWidth);\n }, [messageRef.current]);\n\n // Message Action based handlers\n // Handles Loading old messages via REST API, send new Mesage via socket.\n useEffect(() => {\n switch (messageAction) {\n case HISTORICAL_MESSAGE_ACTION_RESPONSE:\n setactiveSkeleton(false);\n setLoading(false);\n if (\n notifCount[appConfig?.activeConvId?.conv?._id]?.caid?.find(\n (d) => d?._id?.ca === checkedList[0]?.id\n )?.unread > 0\n ) {\n dispatch({ type: \"MARK_READ_TRIGGER\", data: true });\n let temp = notifCount;\n temp[appConfig.activeConvId.conv._id].caid.find(\n (d) => d._id.ca === checkedList[0].id\n ).unread = 0;\n dispatch({ type: \"NOTIF_COUNT\", data: temp });\n dispatch(getSidebarNotifications());\n }\n break;\n case NEW_MESSAGE_ACTION_TRIGGER:\n if (messageRef?.current?.scrollTop) messageRef.current.scrollTop = 0;\n break;\n case SEND_MESSAGE_ACTION_TRIGGER:\n if (messageRef?.current?.scrollTop) messageRef.current.scrollTop = 0;\n break;\n default:\n break;\n }\n }, [messageAction]);\n\n //Content insertion from sidebar (MOstly)\n useEffect(() => {\n switch (appConfig.action) {\n case DROP_CONTENT:\n if (appConfig?.content?.text?.q.length > 0) {\n setdata(appConfig?.content?.text?.q);\n dispatch({\n type: DROP_CONTENT,\n data: {},\n });\n }\n break;\n\n default:\n break;\n }\n }, [appConfig.content]);\n\n useEffect(() => {\n if (Recipients?.data?.length > 0) {\n let email = Recipients?.data?.filter(\n (vals) => vals.category === \"contact\"\n );\n dispatch({\n type: EMAIL_RECIPIENT,\n data: email[0]?.value ? email[0]?.value : \"\",\n });\n }\n }, [Recipients]);\n\n useEffect(() => {\n switch (FileReducer.action) {\n case UPLOAD_MESSAGE_FILE_ACTION_RESPONSE:\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: {\n component: \"attachmentContainer\",\n params: [FileReducer.singleFile],\n },\n });\n break;\n default:\n break;\n }\n }, [FileReducer.action]);\n\n const emitTyping = (val = false) => {\n if (flag != val) {\n dispatch({ type: EMIT_TYPING, data: val });\n flag = val;\n }\n };\n const handleSubmit = (editorData, d) => {\n emitTyping(false);\n let Store = store.getState();\n if (\n Store?.AdminReducer?.emailRecipients?.length > 0 ||\n Store?.AdminReducer?.checkedList[0][\"md\"]?.includes(\"web\") ||\n Store?.AdminReducer?.checkedList[0][\"md\"]?.includes(\"facebook\") ||\n Store?.AdminReducer?.checkedList[0][\"md\"]?.includes(\"whatsapp\") ||\n Store?.AdminReducer?.checkedList[0][\"md\"]?.includes(\"email\") ||\n Store?.AdminReducer?.checkedList[0][\"md\"]?.includes(\"sms\")\n ) {\n let tempMsg = \"\";\n if (editorData === \"send\") {\n tempMsg = data;\n } else {\n tempMsg = editorData;\n }\n let attachment = [];\n if (Store.AppReducer.chatContainerComponent === \"attachmentContainer\") {\n attachment = Store.AppReducer.containerParams;\n }\n if (tempMsg !== \"\" || attachment?.length > 0) {\n let md = \"\";\n if (Store?.AdminReducer?.checkedList?.length > 0) {\n md = Store?.AdminReducer?.checkedList[0][\"md\"];\n }\n let ccEmail = Store?.AdminReducer?.ccEmailRecipients?.map((res) => {\n return res.value;\n });\n let bcc = Store?.AdminReducer?.bccEmailRecipients?.map((res) => {\n return res.value;\n });\n let message = {\n msg: {\n ne: newMail,\n isParent: true,\n attachments: attachment,\n content: {\n attachments: [],\n },\n md: md,\n to: [\n {\n _id: Store.AppReducer.activeConvId._id,\n name: Store.AppReducer.activeConvId?.data?.name,\n },\n ],\n text: tempMsg,\n parentId: \"\",\n type: \"message\",\n convId: Store.AppReducer.activeConvId.conv._id,\n channelAccountId: Store.AdminReducer.checkedList[0][\"id\"],\n cc: ccEmail,\n subject: emailSubject,\n bcc: bcc,\n },\n ts: new Date(),\n type: \"message\",\n };\n message.meta = {\n openingId:\n openingId?.value ??\n activeOpeningsForCandidate[0]?.opening?.openingId,\n };\n let outgoing = Store?.AdminReducer?.allConfigData?.filter(\n (val) => val._id === Store.AdminReducer.channelAct[0]\n );\n if (\n (Store.AdminReducer.checkedList.includes(\"sms\") ||\n Store.AdminReducer.checkedList.includes(\"email\") ||\n Store.AdminReducer.checkedList.includes(\"facebook\")) &&\n !outgoing &&\n !outgoing[0]?.outgoingEnabled\n ) {\n seterrorString(\n \"The selected account does not have any Outgoing services enabled \"\n );\n seterrorModalVisible(true);\n } else {\n dispatch(messageSocket(message, dittoAdminReducer.user.userProfile));\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n setdata(\"\");\n setEmailComponent(\"plainView\");\n dispatch({\n type: DROP_CONTENT,\n data: {},\n });\n }\n }\n } else {\n seterrorString(\n \"Please add email address for recipient before initiating Chat\"\n );\n seterrorModalVisible(true);\n }\n };\n const handleModelChange = (model) => {\n emitTyping(true);\n setdata(model);\n model === \"\" &&\n dispatch({\n type: DROP_CONTENT,\n data: {},\n });\n };\n const handleOnFocus = (event) => {\n emitTyping(true);\n };\n const handleOnBlur = (event) => {\n emitTyping(false);\n };\n const handleUploadFile = (files) => {\n files.forEach((file) => {\n let fileExt = file.name.substr(file.name.lastIndexOf(\".\") + 1);\n let fileExtArry = [\n \"jpeg\",\n \"jpg\",\n \"png\",\n \"svg\",\n \"docx\",\n \"txt\",\n \"pages\",\n \"rtf\",\n \"pdf\",\n \"csv\",\n \"xls\",\n \"xlsx\",\n \"pptx\",\n \"webm\",\n \"mkv\",\n \"flv\",\n \"wmv\",\n \"mp4\",\n \"m4v\",\n \"m4p\",\n ];\n if (fileExtArry.includes(fileExt)) {\n if (file.size < 20971520) {\n dispatch(uploadMessageFileActionTrigger(file));\n } else {\n cxmessage.error(\"File size need to be less than 20mb\");\n }\n return false;\n } else {\n cxmessage.error(\"File type not supported \");\n }\n });\n };\n const RenderDateCloud = (date) => {\n let dtst = {\n background: \"#F2F4F3\",\n border: \"1px solid #E5E7EA\",\n boxSizing: \"border-box\",\n boxShadow: \"0px 0px 4px rgb(0 0 0 / 12%)\",\n borderRadius: \"4px\",\n padding: \"5px 20px\",\n fontWeight: \"400\",\n fontSize: 10,\n };\n return (\n \n
{setDateCloud(date)}
\n
\n );\n };\n const TabSwitchHandler = (val) => {\n if (!activeSkeleton) {\n setdata(\"\");\n dispatch({ type: CHECKED_LIST, data: [val] });\n setactiveSkeleton(true);\n }\n };\n const imgPopClose = () => {\n setImagePopView(false);\n setImagePopURL(null);\n };\n useEffect(() => {\n let img = document.getElementsByClassName(\"imgClick\");\n console.log(\"IMG\", img);\n for (const val of img) {\n val?.addEventListener(\"click\", function (event) {\n if (event.target.tagName.toLowerCase() === \"img\") {\n setImagePopURL(val.currentSrc);\n setImagePopView(true);\n }\n });\n }\n }, [window, messages?.data?.length]);\n const renderMessage = (ch, type, contactData) => {\n return RenderMessage(\n ch,\n ActiveComponent,\n setreplyData,\n ChatContainerWidth,\n dittoAdminReducer,\n ShowThread,\n showModalChat,\n type,\n agents,\n contactData,\n setEmailComponent\n );\n };\n const CurrentComponent = component[current];\n const observer = useRef();\n const lastBookElementRef = useCallback(\n (node) => {\n if (loading) return;\n if (observer.current) observer.current.disconnect();\n observer.current = new IntersectionObserver((entries) => {\n if (entries[0]?.isIntersecting && messages?.paging.after) {\n setLoading(true);\n dispatch(\n historicalMessageActionTrigger({\n after: messages.paging.after,\n convId: appConfig?.activeConvId?.conv?._id,\n channel: checkedList[0] && checkedList[0][\"id\"],\n })\n );\n } else {\n setLoading(false);\n }\n });\n if (node) observer.current.observe(node);\n },\n [loading]\n );\n let EditorProps = {\n handleSubmit,\n data,\n handleModelChange,\n ActiveComponent,\n handleOnFocus,\n handleOnBlur,\n handleUploadFile,\n };\n useEffect(() => {\n if (\n appConfig.activeConvId &&\n appConfig?.activeConvId?.conv?.channelAccount?.length > 0 &&\n !appConfig.candidateUpdate\n ) {\n let data = appConfig?.activeConvId?.conv?.channelAccount?.sort((a, b) => {\n const order = [\"whatsapp\", \"sms\", \"email\", \"web\"];\n return order.indexOf(a.md) - order.indexOf(b.md);\n });\n dispatch({\n type: CHECKED_LIST,\n data: [data[0]],\n });\n }\n setEmailComponent(\"plainView\");\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n }, [appConfig.activeConvId]);\n useEffect(() => {\n if (checkedList?.length > 0 && !appConfig?.candidateUpdate) {\n dispatch(\n getChannelAccountStatus({\n caids: [checkedList[0][\"id\"]],\n cid: appConfig.activeConvId?.conv?.contactId,\n })\n );\n }\n }, [checkedList]);\n useEffect(() => {\n dispatch({ type: \"CANDIDATE_UPDATE_RESET\" });\n }, [checkedList]);\n const handleOpenChange = (newOpen) => {\n let obj = {\n status: \"APPROVED\",\n caid: checkedList[0]?.id,\n };\n dispatch(getTemplatesActionTrigger(obj));\n setOpen(newOpen);\n };\n\n return (\n \n {leftBar && }\n {showEmpty ? (\n \n \n \n ) : (\n \n {(EmailComponent === \"plainView\" || ActiveComponent === \"team\") && (\n <>\n \n \n
\n {checkedList?.length === 0 && }\n {activeSkeleton && checkedList?.length > 0 ? (\n ChatSkeleton()\n ) : (\n \n
\n {messages?.data?.map((ch, i) => {\n if (ch?.convId === appConfig?.activeConvId?.conv?._id)\n return (\n \n {i > 0 &&\n (moment(ch.createdAt).format(\"DDMMYYYY\") !==\n moment(\n messages?.data[i - 1]?.createdAt\n ).format(\"DDMMYYYY\") ||\n i + 1 === messages?.data?.length) &&\n RenderDateCloud(ch?.createdAt)}\n {renderMessage(ch, checkedList[0], contactData)}\n\n {i === 0 && messageReducer?.botProcessing && (\n \n )}\n
\n );\n })}\n
\n {loading && messages.end < messages.total && (\n \n )}\n
\n
\n \n )}\n {messageReducer?.typing && (\n \n )}\n \n {/* ChatScreen Tabs Start */}\n {\n
\n
\n {ActiveComponent === \"inbox\" && (\n \n )}\n \n \n {checkedList[0]?.md && (\n <>\n {checkedList[0][\"md\"] === \"web\" && (\n \n )}\n {checkedList[0][\"md\"] === \"sms\" && (\n \n )}\n {checkedList[0][\"md\"] === \"facebook\" && (\n \n )}\n {checkedList[0][\"md\"] === \"whatsapp\" &&\n (messages?.info?.accountLocked ? (\n // \n \n {messages?.info?.blockedReason && (\n
\n \n
\n )}\n \n \n
\n }\n >\n \n \n
\n ) : (\n \n ))}\n \n )}\n\n {/* Expand ChatTabs and its editor here */}\n {checkedList?.length > 0 &&\n !ChannelAccountStatusLoading &&\n appConfig?.activeConvId?.optOutMd?.includes(\n checkedList[0][\"md\"]\n ) && (\n
\n {\" \"}\n {checkedList[0][\"md\"]} has opted out as a\n channel account.\n
\n )}\n {checkedList?.length > 0 &&\n checkedList[0][\"md\"] === \"email\" &&\n ChannelAccountStatusLoading && (\n \n Please wait, Email account status check...{\" \"}\n \n \n )}\n {checkedList?.length > 0 &&\n !appConfig?.activeConvId?.optOutMd?.includes(\n checkedList[0][\"md\"]\n ) &&\n checkedList[0][\"md\"] === \"email\" &&\n !ChannelAccountStatusLoading &&\n ChannelAccountStatus?.data[0]?.status ===\n \"active\" ? (\n
\n \n setEmailComponent(\"composeView\")\n }\n >\n \n Compose\n
\n \n ) : (\n checkedList?.length > 0 &&\n checkedList[0][\"md\"] === \"email\" &&\n !ChannelAccountStatusLoading && (\n
\n Email not linked anymore,{\" \"}\n \n history.push(\n \"/admin/admin/Connected/Email\"\n )\n }\n >\n Add now \n \n
\n )\n )}\n \n \n \n \n }\n {/* ChatScreen Tabs End */}\n \n \n \n )}\n {(EmailComponent === \"composeView\" ||\n EmailComponent === \"composeViewOnly\") && (\n \n )}\n {EmailComponent === \"replyView\" && (\n \n )}\n \n
\n )}\n {rightBar && }\n
\n );\n};\n\nexport default ChatOnly;\n","import React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CHAT_CONTAINER_COMPONENT } from \"constant/app.constant\";\n\nimport { CXTitle } from \"component/Typography\";\n\nimport \"./style.css\";\nimport ReactMarkdown from \"react-markdown\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { CloseOutlined } from \"@ant-design/icons\";\n\nconst ContentContainer = ({ children, ...props }) => {\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n const handleClose = () => {\n dispatch({ type: CHAT_CONTAINER_COMPONENT, data: { component: \"none\" } });\n };\n return (\n \n handleClose()}\n />\n {appConfig.containerParams.data.question.q}\n {appConfig.containerParams.data.type === \"md\" ? (\n {appConfig.containerParams.data.text.q}\n ) : (\n ReactHtmlParser(appConfig.containerParams.data.text.q)\n )}\n \n );\n};\n\nexport default ContentContainer;\n","import React, { useState, useEffect, useCallback } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport moment from \"moment\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXRangePicker } from \"component/DatePicker\";\nimport { CXFormItem } from \"component/Form\";\nimport { CXForm } from \"component/Form\";\nimport { CXButton } from \"component/Button\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport \"./style.css\";\nimport { truncateSt } from \"utils\";\nimport { SET_ACTIVE_CONVID } from \"constant/app.constant\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { Form, Spin } from \"antd\";\nimport { getConvSearchTrigger } from \"action/ConvAction\";\nimport { CXMenu } from \"component/Menu\";\nimport { OpeningSearch } from \"action/OpeningsAction\";\nimport { debounce } from \"lodash\";\n\nconst FilterCard = (props) => {\n const dispatch = useDispatch();\n // const [archive, setarchive] = useState(false);\n // const [fromDate, setfromDate] = useState(\"1970-01-01\", \"YYYY-MM-DD\");\n // const [toDate, settoDate] = useState(moment().format(\"YYYY-MM-DD\"));\n const [selectedAgents, setselectedAgents] = useState([]);\n const AgentReducer = useSelector((state) => state.AgentReducer);\n const [Search, setSearch] = useState(\"\");\n const [data, setdata] = useState(AgentReducer?.agents?.data);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { candidateFilterStage, openPositions, openingLoading } = useSelector(\n (state) => state.OpeningReducer\n );\n const [form] = Form.useForm();\n useEffect(() => {\n if (props.filterActive) {\n setSearch(\"\");\n setselectedAgents([]);\n }\n }, [props.filterActive]);\n\n useEffect(() => {\n if (Search?.length === 0) {\n setdata(AgentReducer?.agents?.data);\n } else {\n const temp = AgentReducer?.agents?.data.filter((agent) => {\n let tempName =\n (agent?.fname ? agent?.fname : \"\") +\n \" \" +\n (agent?.lname ? agent?.lname : \"\");\n tempName = tempName.toLowerCase();\n return tempName.includes(Search.toLowerCase());\n });\n setdata(temp);\n }\n }, [Search]);\n useEffect(() => {\n if (allConfigData?.length === 0) {\n dispatch(GetAllConfig());\n }\n }, []);\n\n const iconRender = (icon) => {\n switch (icon) {\n case \"facebook\":\n return \"email\";\n case \"whatsapp\":\n return \"email\";\n case \"sms\":\n return \"email\";\n case \"email\":\n return \"email\";\n default:\n return \"email\";\n }\n };\n const onFinish = (values) => {\n let archive = values?.archive ? values.archive : false;\n let fromDate = values?.date ? values.date[0].format(\"YYYY-MM-DD\") : null;\n let toDate = values?.date ? values.date[1].format(\"YYYY-MM-DD\") : null;\n let selectedAgents = values?.selectedAgents ? values.selectedAgents : [];\n let tag = props.selectedTags[0];\n let channel = values.channel;\n let openingId = values.openingId;\n let stageId = values.stageId;\n props.setFilterVals({\n // archive,\n fromDate,\n toDate,\n selectedAgents,\n channel,\n openingId,\n stageId,\n tag,\n });\n if (\n openingId ||\n stageId ||\n channel ||\n fromDate ||\n toDate ||\n selectedAgents\n ) {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: null,\n });\n dispatch({\n type: \"RESET_PAGING\",\n });\n props.setActiveKey([\"0\"]);\n props.setloading(true);\n props.setconv([]);\n setTimeout(() => {\n dispatch(\n getConvSearchTrigger({\n // archive,\n fromDate,\n toDate,\n selectedAgents,\n channel,\n openingId,\n stageId,\n tag,\n })\n );\n }, 1000);\n }\n setopenPosition([]);\n };\n const ClearFilter = () => {\n form.resetFields();\n props.setFilterVals({});\n props.setselectedTags([\"All\"]);\n props.setfilterHide(false);\n props.ClearSearch();\n dispatch(getConvSearchTrigger());\n props.setloading(true);\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: null,\n });\n setopenPosition([]);\n props.setconv([]);\n };\n useEffect(() => {\n form.setFieldsValue({\n archive: false,\n });\n if (props.channel) {\n form.setFieldsValue({\n channel: [props.channel],\n });\n }\n }, []);\n\n useEffect(() => {\n form.setFieldsValue({\n openingId: props.FilterVals?.openingId,\n stageId: props.FilterVals?.stageId,\n });\n }, [props.FilterVals]);\n\n const [openingList, setopenPosition] = useState([]);\n\n useEffect(() => {\n if (openPositions?.data) {\n setopenPosition(openPositions?.data);\n }\n }, [openPositions]);\n const handleOpeningSearch = useCallback(\n debounce((value) => {\n if (value.length > 1) {\n setopenPosition([]);\n setSearch(value);\n let obj = {\n value: value,\n isDeleted: false,\n };\n dispatch(OpeningSearch(obj));\n } else {\n setopenPosition([]);\n }\n }, 300),\n []\n );\n return (\n
\n \n
\n \n {\n return (option?.name ?? \"\")\n .toLowerCase()\n .includes(input.toLowerCase());\n }}\n // onPopupScroll={handleScroll}\n onSearch={(value) => handleOpeningSearch(value)}\n notFoundContent={openingLoading ? : null}\n >\n {openingList?.map((res) => {\n return (\n \n {res.positionName}\n \n );\n })}\n \n \n \n \n {candidateFilterStage?.data?.map((res) => {\n return {res?.name};\n })}\n \n \n
\n \n \n \n
\n ClearFilter()}>\n Clear\n \n \n Apply\n \n
\n \n
\n );\n};\n\nexport default FilterCard;\n","import { CXCheckableTag } from \"component/Tag\";\nimport React from \"react\";\nimport { truncateSt } from \"utils\";\n\nconst FilterTags = (props) => {\n const HtagsData = [\n {\n key: \"All\",\n value: \"All Messages\",\n },\n // {\n // key: \"Unread\",\n // value: \"Unread\",\n // },\n {\n key: \"pending\",\n value: \"Pending\",\n },\n {\n key: \"unread\",\n value: \"Unread\",\n },\n ];\n return (\n \n {HtagsData.map((tag) => (\n -1}\n onChange={(checked) => props.handleChange(tag.key, checked)}\n style={{\n border: \"1px solid rgba(151, 151, 151, 0.2)\",\n boxSizing: \"border-box\",\n // borderRadius: \"14px\",\n fontSize: \"10px\",\n }}\n >\n {tag?.value}\n \n ))}\n \n );\n};\n\nexport default FilterTags;\n","import React, { useRef, useState } from \"react\";\nimport { CXAvatar, CXAvatarGroup } from \"component/Avatar\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CXTooltip } from \"component/Tooltip\";\nimport InfiniteScroll from \"react-infinite-scroller\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport {\n ColorSet,\n checkTimeConList,\n generateUniqueKey,\n truncateSt,\n} from \"utils\";\nimport { CXInboxUserSkeleton } from \"component/Skeleton\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getConvActionTrigger } from \"action/ConvAction\";\nimport {\n markReadConversation,\n markReadNotification,\n} from \"action/NotificationActions\";\nimport history from \"utils/history\";\nimport { post } from \"helper/networkClient\";\n\nconst ConvList = ({\n loading,\n searchFlag,\n tagValue,\n channel,\n FilterVals,\n selectedTags,\n searchString,\n conv,\n setloading,\n ConvReadCache,\n setConvReadCache,\n}) => {\n const dispatch = useDispatch();\n const { paging } = useSelector((state) => state.ConvReducer);\n const appConfig = useSelector((state) => state.AppReducer);\n const { convUnreadNotif } = useSelector((state) => state.NotificationReducer);\n const TenantReducer = useSelector((state) => state.TenantReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n // const [ConvReadCache, setConvReadCache] = useState([]);\n const getTenant = (tenantId) => {\n let temp = TenantReducer.tenants.filter(\n (tenant) => tenant._id === tenantId\n );\n if (temp?.length > 0) {\n return temp[0];\n } else {\n return {};\n }\n };\n const CheckNotifCaount = (convId, md) => {\n if (convId && md) {\n let count =\n convUnreadNotif?.find((d) => d?.convId === convId)?.md?.[md] ?? 0;\n return count;\n }\n };\n const CheckRead = (conv) => {\n const hasUnreadMessages = conv?.conv?.channelAccount?.some(\n (account) => account?.unread === true\n );\n if (hasUnreadMessages && !ConvReadCache?.includes(conv?.conv?._id)) {\n return true;\n } else {\n return false;\n }\n };\n const handleInfiniteOnLoad = (searchString) => {\n if (\n paging?.after?.length > 0 &&\n !loading &&\n searchString?.length === 0 &&\n !searchFlag\n ) {\n setloading(true);\n if (tagValue || channel) {\n dispatch(\n getConvActionTrigger({\n after: paging?.after,\n tag: tagValue,\n channel: channel,\n openingId: FilterVals?.openingId,\n stageId: FilterVals?.stageId,\n search: searchString?.length > 0 ? searchString : null,\n fromDate: FilterVals?.fromDate,\n toDate: FilterVals?.toDate,\n })\n );\n } else {\n if (searchString?.length === 0 && !searchFlag) {\n dispatch(\n getConvActionTrigger({\n after: paging?.after,\n tag: selectedTags[0],\n channel: channel,\n openingId: FilterVals?.openingId,\n stageId: FilterVals?.stageId,\n search: searchString?.length > 0 ? searchString : null,\n fromDate: FilterVals?.fromDate,\n toDate: FilterVals?.toDate,\n })\n );\n }\n }\n }\n };\n const handleConvClick = async (conv) => {\n dispatch({ type: \"CANDIDATE_VIEW_TRIGGER\" });\n dispatch({\n type: \"CANDIDATE_VIEWED\",\n data: {\n candidateId: conv?.conv?._id,\n contactId: conv?._id,\n candidateName: conv?.data?.name,\n src: \"inboxConvList\",\n userId: user.userProfile?._id,\n },\n });\n if (conv?.conv?.channelAccount?.length > 0) {\n const hasUnreadMessages = conv?.conv?.channelAccount?.some(\n (account) => account?.unread === true\n );\n if (hasUnreadMessages) {\n setConvReadCache([...ConvReadCache, conv?.conv?._id]);\n dispatch(\n markReadNotification({\n type: \"message\",\n conv_id: conv?.conv?._id,\n })\n );\n dispatch(\n markReadConversation({\n convId: conv?.conv?._id,\n })\n );\n }\n }\n\n dispatch({ type: \"CHECKED_LIST\", data: [] });\n if (conv?.conv) {\n dispatch({\n type: \"SET_ACTIVE_CONVID\",\n data: conv,\n });\n history.push(`/admin/communication/inbox/${conv?.conv?._id}`);\n } else {\n try {\n post(`/conversation`, {\n contactId: conv._id,\n }).then((resp) => {\n if (resp?.status === 200) {\n let temp = resp?.data?.data;\n conv.conv = temp;\n dispatch({\n type: \"SET_ACTIVE_CONVID\",\n data: {\n conv: resp?.data?.data?.conv,\n data: conv,\n },\n });\n history.push(`/admin/communication/inbox/${conv?.conv?._id}`);\n }\n });\n } catch (error) {\n console.log(error);\n }\n dispatch({ type: \"REPLY_THREAD_ACTIVE\", data: false });\n dispatch({ type: \"REPLY_ID\", data: \"\" });\n }\n };\n const scrollParentRef = useRef(null);\n return (\n \n handleInfiniteOnLoad(searchString)}\n hasMore={paging?.after?.length > 0}\n useWindow={false}\n getScrollParent={() => scrollParentRef.current}\n >\n \n {conv?.length === 0 && !loading ? (\n \n ) : (\n conv?.map((con, index) => {\n let msgDesc = truncateSt(con?.profile?.msgDesc, 22);\n return (\n handleConvClick(con)}\n key={con?.conv?._id}\n >\n
\n
\n
\n \n
\n {!con?.profile?.data?.name\n ? \"AnonymousUser\"\n : truncateSt(con?.profile?.data?.name, 15)}{\" \"}\n
\n
\n \n \n
\n {ReactHtmlParser(msgDesc) ?? `....`}\n
\n
\n
\n \n {CheckNotifCaount(con?.conv?._id, \"email\") >\n 0 && (\n \n \n \n )}\n {CheckNotifCaount(con?.conv?._id, \"whatsapp\") >\n 0 && (\n \n \n \n )}\n \n
\n
\n
\n \n \n {checkTimeConList(\n con?.profile?.lm,\n con?.profile?.createdAt\n )}\n \n
\n
\n
\n {con?.conv?.botConv &&\n !con?.conv?.isFailedBot && (\n \n )}\n {con?.conv?.botConv && con?.conv?.isFailedBot && (\n \n )}\n
\n\n {con?.conv?.unassigned ? (\n
\n ) : (\n \n \n {con?.conv?.pIds?.map((agent) =>\n con?._id !== agent ? (\n \n {!getTenant(agent)?.profileUrl ? (\n \n {getTenant(agent)?.fname\n ? getTenant(\n agent\n )?.fname[0].toUpperCase()\n : \"-\"}\n \n ) : (\n \n )}\n \n ) : null\n )}\n \n
\n )}\n \n \n \n \n \n \n );\n })\n )}\n \n {loading && }\n \n \n );\n};\n\nexport default ConvList;\n","import React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { cxmessage, truncateSt } from \"utils\";\nimport { CXSider } from \"component/Layout\";\nimport { CXCollapse, CXCollapsePanel } from \"component/Collapse\";\nimport \"./style.css\";\nimport { CXInput } from \"component/Input\";\nimport {\n getConvActionTrigger,\n getSingleConvActionTrigger,\n getConvSearchTrigger,\n} from \"action/ConvAction\";\nimport {\n GET_CONV_ACTION_RESPONSE,\n GET_CONV_SEARCH_RESPONSE,\n ASSIGN_AGENT_ACTION_RESPONSE,\n GET_SINGLE_CONV_ACTION_RESPONSE,\n UPDATE_CONV_ACTION_RESPONSE,\n CLEAR_MESSAGE,\n SET_WIDGET_REQUEST,\n SET_INCOMMING_MSG,\n} from \"constant\";\nimport { TOGGLE_CHAT_SIDE_BAR, SET_ACTIVE_CONVID } from \"constant/app.constant\";\nimport FilterCard from \"./Filter\";\nimport { debounce } from \"lodash\";\nimport FilterTags from \"./FilterTags\";\nimport { get } from \"helper/networkClient\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { useLocation } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXTag } from \"component/Tag\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Form } from \"antd\";\nimport {\n getConvUnreadNotifications,\n markReadConversation,\n markReadNotification,\n} from \"action/NotificationActions\";\nimport ConvList from \"./ConvList\";\n\nconst InboxSidebar = (props) => {\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n const [loading, setloading] = useState(true);\n const location = useLocation();\n const [searchString, setsearchString] = useState(\"\");\n const [conv, setconv] = useState([]);\n const [selectedTags, setselectedTags] = useState([]);\n const [currentFilter, setcurrentFilter] = useState({});\n const [filterHide, setfilterHide] = useState(false);\n const appConfig = useSelector((state) => state.AppReducer);\n const ConvReducer = useSelector((state) => state.ConvReducer);\n const MessageReducer = useSelector((state) => state.MessageReducer);\n const { notifCount } = useSelector((state) => state.AppReducer);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const queryParams = new URLSearchParams(location.search);\n const [activeKey, setActiveKey] = useState([]);\n const tagValue = queryParams.get(\"tag\");\n const channel = queryParams.get(\"channel\");\n const { convId } = useParams();\n const [FilterVals, setFilterVals] = useState({});\n const [searchFlag, setsearchFlag] = useState(false);\n const { candidateFilterStage, openPositions } = useSelector(\n (state) => state.OpeningReducer\n );\n const [ConvReadCache, setConvReadCache] = useState([]);\n useEffect(() => {\n if (appConfig?.activeConvId?._id) {\n if (allConfigData?.length === 0) {\n dispatch(GetAllConfig());\n }\n let index = conv?.findIndex(\n (val) => val?._id === appConfig?.activeConvId?._id\n );\n if (conv[index]?.unreadMessage) {\n setTimeout(() => {\n conv[index].unreadMessage = 0;\n }, 500);\n }\n }\n }, [appConfig?.activeConvId]);\n\n useEffect(() => {\n dispatch({ type: CLEAR_MESSAGE });\n dispatch({ type: SET_ACTIVE_CONVID, data: null });\n if (ConvReducer?.convList.length === 0) {\n dispatch(getConvActionTrigger());\n }\n dispatch(getConvUnreadNotifications());\n if (ConvReducer?.convList[0]?.conv?._id) {\n const hasUnreadMessages =\n ConvReducer?.convList[0]?.conv?.channelAccount?.some(\n (account) => account?.unread === true\n );\n if (hasUnreadMessages) {\n setConvReadCache([\n ...ConvReadCache,\n ConvReducer?.convList[0]?.conv?._id,\n ]);\n dispatch(\n markReadNotification({\n type: \"message\",\n conv_id: ConvReducer?.convList[0]?.conv?._id,\n })\n );\n dispatch(\n markReadConversation({\n convId: ConvReducer?.convList[0]?.conv?._id,\n })\n );\n }\n\n history.push(\n `/admin/communication/inbox/${ConvReducer?.convList[0]?.conv?._id}`\n );\n }\n }, []);\n\n useEffect(() => {\n if (!convId && ConvReducer?.convList?.length > 0) {\n history.push(\n `/admin/communication/inbox/${ConvReducer?.convList[0]?.conv?._id}`\n );\n }\n if (ConvReducer?.convList?.find((val) => val?.conv?._id === convId)) {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: ConvReducer?.convList?.find((val) => val?.conv?._id === convId),\n });\n }\n }, [convId]);\n useEffect(() => {\n switch (ConvReducer.action) {\n case GET_CONV_SEARCH_RESPONSE:\n setconv(ConvReducer.convList);\n if (ConvReducer?.convList?.length > 0) {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: ConvReducer.convList[0],\n });\n history.push(\n `/admin/communication/inbox/${ConvReducer?.convList[0]?.conv?._id}`\n );\n } else {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: undefined,\n });\n }\n setloading(false);\n break;\n case GET_CONV_ACTION_RESPONSE:\n if (!appConfig.activeConvId || convId) {\n if (ConvReducer?.convList?.length > 0) {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: convId\n ? ConvReducer.convList.find((val) => val?.conv?._id === convId)\n ? ConvReducer.convList.find(\n (val) => val?.conv?._id === convId\n )\n : ConvReducer.convList[0]\n : ConvReducer.convList[0],\n });\n if (\n !ConvReducer.convList.find((val) => val?.conv?._id === convId)\n ) {\n history.push(\n `/admin/communication/inbox/${ConvReducer?.convList[0]?.conv?._id}`\n );\n }\n } else {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: undefined,\n });\n }\n }\n setconv(ConvReducer.convList);\n setloading(false);\n break;\n case ASSIGN_AGENT_ACTION_RESPONSE:\n dispatch(\n getSingleConvActionTrigger(appConfig?.activeConvId?.conv?._id)\n );\n break;\n case GET_SINGLE_CONV_ACTION_RESPONSE:\n if (\n ConvReducer?.singleConv?.data?._id &&\n ConvReducer?.singleConv?.data?.mode !== \"agent\" &&\n ConvReducer?.singleConv?.data?.mode !== \"group\"\n ) {\n let temp1 = conv;\n let targetIndex = conv.findIndex(\n (con) => con._id === ConvReducer?.singleConv?.data?._id\n );\n if (targetIndex < 0) {\n temp1.push(ConvReducer.singleConv.data);\n } else {\n temp1[targetIndex] = ConvReducer?.singleConv?.data;\n }\n if (\n ConvReducer?.singleConv?.data?._id === appConfig?.activeConvId?._id\n ) {\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: ConvReducer?.singleConv?.data,\n });\n }\n setconv(temp1);\n }\n break;\n case UPDATE_CONV_ACTION_RESPONSE:\n setloading(true);\n dispatch({\n type: SET_ACTIVE_CONVID,\n data: undefined,\n });\n dispatch(\n getConvActionTrigger(\n JSON.stringify({\n ...currentFilter,\n })\n )\n );\n break;\n case SET_WIDGET_REQUEST:\n if (!conv.some((data) => data?._id === ConvReducer?.widgetNew?._id)) {\n conv?.unshift(ConvReducer?.widgetNew);\n }\n break;\n default:\n break;\n }\n }, [ConvReducer.action]);\n\n useEffect(() => {\n triggerFilter();\n }, [searchString, selectedTags]);\n\n const triggerFilter = (triigerOnCall = false) => {\n let fireApi = false;\n let tempObj = {};\n if (searchString?.length > 0 || triigerOnCall) {\n fireApi = true;\n tempObj.search = searchString ?? null;\n tempObj.tag = selectedTags[0];\n tempObj.channel = channel;\n tempObj.openingId = FilterVals?.openingId;\n tempObj.stageId = FilterVals?.stageId;\n tempObj.fromDate = FilterVals?.fromDate;\n tempObj.toDate = FilterVals?.toDate;\n }\n if (fireApi) {\n setcurrentFilter(tempObj);\n setloading(true);\n dispatch(getConvSearchTrigger(tempObj));\n }\n };\n\n const triggerCloseFiltertags = (data) => {\n let tempObj = {};\n tempObj.search = searchString?.length > 0 ? searchString : null;\n tempObj.tag = selectedTags[0];\n tempObj.channel = channel ?? null;\n tempObj.openingId = data?.openingId;\n tempObj.stageId = data?.stageId;\n tempObj.fromDate = data?.fromDate;\n tempObj.toDate = data?.toDate;\n setloading(true);\n dispatch(getConvSearchTrigger(tempObj));\n };\n\n const handleConvSearchChange = (value) => {\n setconv([]);\n setloading(true);\n setsearchString(value);\n if (value === \"\") {\n setloading(true);\n dispatch(\n getConvSearchTrigger({\n tag: selectedTags[0],\n openingId: FilterVals?.openingId,\n stageId: FilterVals?.stageId,\n channel: channel,\n })\n );\n }\n };\n const handleDebouncedChange = useCallback(\n debounce((value) => {\n handleConvSearchChange(value);\n }, 1000),\n []\n );\n\n const onCollapse = (collapsed) => {\n dispatch({ type: TOGGLE_CHAT_SIDE_BAR });\n };\n\n const handleChange = (tag, checked) => {\n const nextSelectedTags = checked\n ? [tag]\n : selectedTags.filter((t) => t !== tag);\n setselectedTags(nextSelectedTags);\n let obj = {\n tag: nextSelectedTags[0],\n openingId: FilterVals?.openingId,\n stageId: FilterVals?.stageId,\n channel: channel,\n search: searchString?.length > 0 ? searchString : null,\n fromDate: FilterVals?.fromDate,\n toDate: FilterVals?.toDate,\n };\n setconv([]);\n setloading(true);\n dispatch(getConvSearchTrigger(obj));\n };\n useEffect(() => {\n // if user send message, this function will move that conversation to top it work for locked and unlocked conversation WIP\n if (\n [\n \"SEND_MESSAGE_ACTION_TRIGGER\",\n \"SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER\",\n ].includes(MessageReducer.action)\n ) {\n let temp = [...conv];\n let index = temp.findIndex(\n (val) => val._id === MessageReducer?.activeConvId?._id\n );\n if (index !== -1 && index > 0) {\n temp.splice(index, 1);\n temp.unshift(MessageReducer?.activeConvId);\n setconv(temp);\n }\n }\n if (MessageReducer.action === \"NEW_MESSAGE_ACTION_TRIGGER\") {\n if (MessageReducer?.incomingMessage?.convId) {\n let temp = notifCount ?? [];\n const convId = MessageReducer?.incomingMessage?.convId;\n const channelAccountId =\n MessageReducer?.incomingMessage?.channelAccountId;\n const index = temp[convId]?.caid?.findIndex(\n (caid) => caid._id.ca === channelAccountId\n );\n if (index !== undefined && index !== -1) {\n temp[convId].caid[index].unread += 1;\n } else {\n temp[convId]?.caid?.push({\n unread: 1,\n _id: {\n ca: channelAccountId,\n md: MessageReducer?.incomingMessage?.md,\n },\n });\n }\n dispatch({ type: \"SET_NOTIF_COUNT\", data: temp });\n dispatch({ type: SET_INCOMMING_MSG });\n let t = [...conv];\n let v = t?.find(\n (val) => val?.conv?._id === MessageReducer?.incomingMessage?.convId\n );\n let i = t?.findIndex(\n (val) => val?.conv?._id === MessageReducer?.incomingMessage?.convId\n );\n if (i !== -1) {\n t?.splice(i, 1);\n t?.unshift(v);\n setconv(t);\n } else {\n // if user receive message and contactID not available in reducer Call Get api and unshift data into reducer\n let ut = [...conv];\n try {\n get(\n `/conversation?contactId=${MessageReducer?.incomingMessage?.from?._id}`\n ).then((resp) => {\n if (resp?.status === 200) {\n let temp = resp?.data?.data[0];\n ut?.unshift(temp);\n setconv(ut);\n }\n });\n } catch (error) {\n console.log(error);\n }\n }\n }\n }\n }, [MessageReducer]);\n\n useEffect(() => {\n if (appConfig?.action === \"SET_CHAT_BOT_SWITCH\") {\n let temp = conv.map((val) => {\n if (val?.conv?._id === appConfig?.activeConvId.conv._id) {\n val.conv.botConv = appConfig?.activeConvId.conv.botConv\n ? false\n : true;\n }\n return val;\n });\n setconv(temp);\n }\n }, [appConfig]);\n\n useEffect(() => {\n if (tagValue) {\n setfilterHide(true);\n setActiveKey([\"1\"]);\n handleChange(tagValue, true);\n }\n }, [tagValue, channel]);\n const handlePanelClick = (key) => {\n if (activeKey[0] === \"1\") {\n setActiveKey([\"0\"]);\n } else {\n setActiveKey([\"1\"]);\n }\n };\n\n const ClearSearch = () => {\n form.resetFields();\n setsearchString(\"\");\n };\n return (\n \n
\n \n isActive ? (\n \n ) : (\n \n )\n }\n >\n \n \n \n e.stopPropagation()}\n // allowClear\n placeholder=\"Search candidate\"\n className=\"align-items-center br-6 mr-2\"\n onChange={(event) => {\n handleDebouncedChange(event.target.value);\n event.target.value.length === 0\n ? setsearchFlag(false)\n : setsearchFlag(true);\n }}\n />\n \n e.stopPropagation()}\n >\n \n
\n \n\n {activeKey[0] === \"0\" && (\n \n {FilterVals?.openingId && (\n {\n setFilterVals({ ...FilterVals, openingId: null });\n triggerCloseFiltertags({\n ...FilterVals,\n openingId: null,\n });\n }}\n color=\"#fff\"\n style={{\n border: \"1px solid rgba(151, 151, 151, 0.2)\",\n boxSizing: \"border-box\",\n fontSize: \"10px\",\n backgroundColor: \"#018fff\",\n }}\n >\n {truncateSt(\n openPositions?.data?.find(\n (val) => val?._id === FilterVals?.openingId\n )?.positionName,\n 35\n )}\n \n )}\n {FilterVals?.stageId && (\n {\n setFilterVals({ ...FilterVals, stageId: null });\n triggerCloseFiltertags({\n ...FilterVals,\n stageId: null,\n });\n }}\n color=\"#fff\"\n style={{\n border: \"1px solid rgba(151, 151, 151, 0.2)\",\n boxSizing: \"border-box\",\n fontSize: \"10px\",\n backgroundColor: \"#018fff\",\n }}\n >\n {\n candidateFilterStage?.data.find(\n (val) => val._id === FilterVals?.stageId\n )?.name\n }\n \n )}\n \n )}\n \n }\n className=\"bg-white filterbox \"\n >\n
\n \n
\n \n \n {(FilterVals?.openingId?.length > 0 ||\n FilterVals?.toDate?.length > 0 ||\n searchString?.length > 0 ||\n selectedTags[0] !== \"All\") &&\n selectedTags[0] !== undefined && (\n
\n
\n \n {searchString?.length > 0\n ? `Search results for \"${searchString}\"`\n : selectedTags[0] !== \"All\"\n ? `Search results for \"${selectedTags[0]}\"`\n : !FilterVals?.stageId?.length > 0 &&\n !FilterVals?.fromDate?.length > 0\n ? \"Filtered results\"\n : \"\"}\n
\n
\n \n )}\n {(FilterVals?.stageId?.length > 0 ||\n FilterVals?.fromDate?.length > 0) && (\n
\n
\n \n Filtered results for Date\n
\n
\n \n )}\n \n \n \n );\n};\n\nexport default InboxSidebar;\n","import { CXChatInfo } from \"component/Chat\";\nimport { CXChatTextReceive, CXChatTextSend } from \"component/Chat\";\nimport ReactMarkdown from \"react-markdown\";\nimport React from \"react\";\nimport { CXChatTextSendSkeleton } from \"component/Chat\";\nimport { CXChatTextReceiveSkeleton } from \"component/Chat\";\nimport { CXMenuItem } from \"component/Menu\";\nimport { CXMenu } from \"component/Menu\";\nimport { replaceWithMarkdownBold } from \"utils\";\nimport rehypeRaw from \"https://esm.sh/rehype-raw@7\";\n\nconst ChatCloudMenu = (ShowThread, showModalChat, ch, ActiveComponent) => (\n \n ShowThread()}>\n Reply\n \n {/* deliberately locked for Teams, in future can be unlocked */}\n {ActiveComponent !== \"team\" && (\n showModalChat(ch)}>\n Create Task\n \n )}\n Flag\n Suggest\n Translate\n \n);\n\nexport const RenderMessage = (\n ch,\n ActiveComponent,\n setreplyData,\n ChatContainerWidth,\n dittoAdminReducer,\n ShowThread,\n showModalChat,\n type,\n agents,\n contactData,\n setEmailComponent\n) => {\n let commonProps = {\n attachments: ch.attachments,\n user: ch.from,\n dropdownMenu: ChatCloudMenu(ShowThread, showModalChat, ch, ActiveComponent),\n md: ch?.md ? ch?.md : [],\n data: ch,\n setReply: setreplyData,\n ChatContainerWidth,\n type,\n ActiveComponent,\n tenantAgents: agents.data,\n loggedInUser: dittoAdminReducer.user.userProfile,\n contactData,\n meta: ch?.meta ? ch?.meta : {},\n qType: ch?.qType ? ch?.qType : \"\",\n content: ch?.content ? ch?.content : \"\",\n setEmailComponent,\n time: ch.createdAt,\n };\n let globalProps = {\n avatar: agents?.data?.find((d) => d?._id === ch?.from?._id),\n time: ch.createdAt,\n ...commonProps,\n };\n switch (ch.type) {\n case \"message\":\n if (ActiveComponent === \"team\")\n return ch?.from?._id !== dittoAdminReducer?.user?.userProfile?._id ? (\n \n (\n \n ),\n }}\n />\n \n ) : (\n \n (\n \n ),\n }}\n />\n \n );\n else\n return ch?.ingress ? (\n \n (\n \n ),\n }}\n />\n \n ) : (\n \n (\n \n ),\n }}\n />\n \n );\n\n case \"event\":\n return ;\n\n default:\n return ch?.from?.type === \"bot\" ? (\n \n (\n \n ),\n }}\n />\n \n ) : (\n \n (\n \n ),\n }}\n />\n \n );\n }\n};\n\nexport const ChatSkeleton = () => {\n return (\n
\n \n \n \n \n \n \n \n
\n );\n};\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXAvatar } from \"component/Avatar\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { CXText } from \"component/Typography\";\nimport { CXProgress } from \"component/Progress\";\nimport { getContactActionTrigger } from \"action/ContactAction\";\nimport { getSingleConvActionTrigger } from \"action/ConvAction\";\nimport {\n GET_CONTACT_ACTION_RESPONSE,\n UPDATE_CONTACT_ACTION_RESPONSE,\n} from \"constant\";\nimport \"../style.css\";\nimport { cxmessage, truncateSt } from \"utils\";\nimport { CopyOutlined } from \"@ant-design/icons\";\nimport moment from \"moment\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport {\n PatchStageIdFromInbox,\n getCandidateStageTrigger,\n getOpeningByCandidateId,\n updateCandidateDetailsViaInbox,\n} from \"action/OpeningsAction\";\nimport { CXTextArea } from \"component/Input\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Drawer, Form } from \"antd\";\nimport CandidatesView from \"screen/UserPortal/Openings/SideBarView/CandidatesView\";\nimport { CXModal } from \"component/Modal\";\nimport StageChangeConfirm from \"component/StageChangeConfirm\";\nimport TagsSearch from \"component/TagsSearch\";\nimport { CXSkeleton, CXSkeletonAVT } from \"component/Skeleton\";\nimport \"react-phone-number-input/style.css\";\nimport { get } from \"helper/networkClient\";\nconst Index = () => {\n const [form] = Form.useForm();\n const [category, setcategory] = useState([]);\n const [name, setname] = useState(\"\");\n const [contactId, setContactId] = useState(null);\n const [contactData, setContactData] = useState({});\n const dispatch = useDispatch();\n const AppReducer = useSelector((state) => state.AppReducer);\n const ContactReducer = useSelector((state) => state.ContactReducer);\n const { candidateFilterStage, activeOpeningsForCandidate } = useSelector(\n (state) => state.OpeningReducer\n );\n const siderViewClosed = useSelector(\n (state) => state.OpeningReducer.siderViewClosed\n );\n const [confirmModal, setconfirmModal] = useState(false);\n const [TempValue, setTempValue] = useState(null);\n const [ActiveConvIdLoading, setActiveConvIdLoading] = useState(false);\n const [ActivePhoneNumber, setActivePhoneNumber] = useState(null);\n\n useEffect(() => {\n setContactId(AppReducer.activeConvId?._id);\n if (contactId) {\n return;\n } else {\n dispatch({ type: GET_CONTACT_ACTION_RESPONSE, data: [] });\n }\n }, [AppReducer.activeConvId]);\n\n useEffect(() => {\n if (contactId) {\n let contactData = { ...AppReducer.activeConvId };\n delete contactData.conv;\n setContactData(contactData);\n dispatch(getOpeningByCandidateId(contactId));\n }\n }, [contactId]);\n\n useEffect(() => {\n switch (ContactReducer.action) {\n case UPDATE_CONTACT_ACTION_RESPONSE:\n if (AppReducer.activeConvId?.from?._id) {\n dispatch(getContactActionTrigger(AppReducer.activeConvId?.from?._id));\n dispatch(getSingleConvActionTrigger(AppReducer.activeConvId?._id));\n }\n break;\n\n default:\n break;\n }\n }, [ContactReducer.action]);\n\n useEffect(() => {\n const unique = [\n ...new Set(ContactReducer.contacts?.data?.map((item) => item.category)),\n ];\n setcategory(unique);\n const temp = ContactReducer.contacts?.data?.filter(\n (field) => field.key === \"name\"\n );\n if (temp?.length > 0) {\n setname(!temp[0][\"value\"] ? \"\" : temp[0][\"value\"]);\n } else {\n setname(\"\");\n }\n }, [ContactReducer.contacts]);\n\n useEffect(() => {\n dispatch(getCandidateStageTrigger());\n }, []);\n const updateStageID = (data, formdata) => {\n if (data) {\n dispatch(\n PatchStageIdFromInbox(AppReducer?.activeConvId?._id, data, formdata)\n );\n }\n };\n const updateCandidateData = (data, openingId) => {\n if (data) {\n dispatch(\n updateCandidateDetailsViaInbox(\n AppReducer?.activeConvId?._id,\n data,\n openingId\n )\n );\n }\n };\n\n useEffect(() => {\n setActiveConvIdLoading(true);\n setTimeout(() => {\n setActiveConvIdLoading(false);\n }, 1000);\n }, [AppReducer?.activeConvId]);\n\n const triggerApiForProfile = async (openingsId, cid) => {\n try {\n dispatch({\n type: \"SET_ACTIVE_CONTACT_OPENING_LOADING\",\n data: true,\n });\n const res = await get(`/candidate/${openingsId}/profile/${cid}`);\n let temp = res?.data?.data;\n dispatch({\n type: \"SET_ACTIVE_CONTACT_OPENING\",\n data: temp,\n });\n } catch (error) {}\n };\n\n const openCandidateView = (openingsId, cid) => {\n try {\n triggerApiForProfile(openingsId, cid);\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: false });\n dispatch({\n type: \"SET_OPENING_SIDEBAR_DATA\",\n data: null,\n });\n dispatch({ type: \"SET_ACTIVE_STAGE\", data: null });\n dispatch({ type: \"SET_OPENING_TAB\", data: \"Candidates\" });\n } catch (error) {\n console.error(\"Failed to open candidate view:\", error);\n }\n };\n\n return (\n
\n {ActiveConvIdLoading && (\n
\n
\n \n \n
\n \n
\n )}\n {!ActiveConvIdLoading && (\n
\n \n \n {AppReducer?.activeConvId?.fullData?.data?.profileUrl ||\n AppReducer?.activeConvId?.profile?.data?.profileUrl ? (\n \n ) : (\n \n {AppReducer?.activeConvId?.fullData\n ? AppReducer?.activeConvId?.fullData?.data?.name?.length > 0\n ? AppReducer?.activeConvId?.fullData?.data?.name\n .split(\" \")[0][0]\n ?.toUpperCase()\n : \"Anonymous User\"\n : AppReducer?.activeConvId?.profile?.data?.name?.length > 0\n ? AppReducer?.activeConvId?.profile?.data?.name\n .split(\" \")[0][0]\n ?.toUpperCase()\n : \"Anonymous User\"}\n \n )}\n \n \n \n \n
\n \n {AppReducer?.activeConvId?.fullData\n ? AppReducer?.activeConvId?.fullData.data?.name\n ?.length > 0\n ? AppReducer?.activeConvId?.fullData.data?.name?.split(\n \" \"\n )[0]\n : \"Anonymous User\"\n : AppReducer?.activeConvId?.profile?.data?.name\n ?.length > 0\n ? AppReducer?.activeConvId?.profile?.data?.name?.split(\n \" \"\n )[0]\n : \"Anonymous User\"}\n \n
\n
\n
\n\n \n {moment(\n contactData?.fullData?.createdAt ??\n contactData?.profile?.createdAt\n ).format(\"DD MMM YYYY\")}\n \n \n \n {contactData?._id?.substring(0, 12)}...\n {\n navigator.clipboard.writeText(contactData?._id).then(\n () => {\n cxmessage.success(\"Copied!\");\n },\n () => {\n cxmessage.error(\"Failed to copy!\");\n }\n );\n }}\n />\n \n
\n
\n \n
\n
\n \n
\n \n {truncateSt(\n AppReducer?.activeConvId?.fullData?.data?.email ??\n AppReducer?.activeConvId?.profile?.data?.email,\n 30\n )}\n \n
\n
\n
\n
\n
\n \n
\n {ActivePhoneNumber === null && (\n
\n
\n {AppReducer?.activeConvId?.fullData?.data?.phone\n ?.length > 0 ||\n AppReducer?.activeConvId?.profile?.data?.phone?.length >\n 0\n ? AppReducer?.activeConvId?.fullData?.data?.phone ??\n AppReducer?.activeConvId?.profile?.data?.phone\n : \"NA\"}{\" \"}\n
\n
\n )}\n
\n
\n
\n
\n
Designation :
\n
\n {AppReducer?.activeConvId?.fullData\n ? AppReducer?.activeConvId?.fullData?.cd?.[0]?.employment\n ? AppReducer?.activeConvId?.fullData?.cd?.[0]?.employment[0]\n ?.designation\n : \"NA\"\n : AppReducer?.activeConvId?.cd?.[0]?.employment\n ? AppReducer?.activeConvId?.cd?.[0]?.employment[0]\n ?.designation\n : \"NA\"}\n
\n
\n
\n
Company :
\n
\n {AppReducer?.activeConvId?.fullData\n ? AppReducer?.activeConvId?.fullData?.cd?.[0]?.employment\n ? AppReducer?.activeConvId?.fullData?.cd?.[0]?.employment[0]\n ?.orgName\n : \"NA\"\n : AppReducer?.activeConvId?.cd?.[0]?.employment\n ? AppReducer?.activeConvId?.cd?.[0]?.employment[0]?.orgName\n : \"NA\"}\n
\n
\n\n {activeOpeningsForCandidate?.map((res, i) => {\n return (\n res?.opening?.openingId && (\n \n {res?.isDeleted && (\n
Archived Opening
\n )}\n\n \n
Opening :
\n \n openCandidateView(\n res?.opening?.openingId,\n res.contactId\n )\n }\n >\n view\n
\n \n }\n >\n \n {res?.res?.positionName ?? \"-\"}\n \n \n Stage :}\n >\n
\n {\n setconfirmModal(true);\n setTempValue({\n openingId: res?.opening?.openingId,\n stageId: val,\n });\n }}\n defaultValue={res?.opening?.stageId}\n >\n {candidateFilterStage?.data?.map((res) => {\n return (\n {res.name}\n );\n })}\n \n
\n \n Notes :}\n >\n
\n \n updateCandidateData(\n {\n data: {},\n candidate: {\n opening: {\n openingId: res?.opening?.openingId,\n },\n notes: e.target.value,\n },\n },\n res?.opening?.openingId\n )\n }\n />\n
\n \n Tags :\n }\n >\n
\n \n updateCandidateData(\n {\n data: {},\n candidate: {\n opening: {\n openingId: contactData?.opening?.openingId,\n },\n tags: val,\n },\n },\n contactData?.opening?.openingId\n )\n }\n />\n
\n \n
\n )\n );\n })}\n \n \n 0\n ? AppReducer?.activeConvId?.fullData.data?.name\n : \"Anonymous User\"\n : AppReducer?.activeConvId?.data?.name?.length > 0\n ? AppReducer?.activeConvId?.profile?.data?.name\n : \"Anonymous User\"\n }\n stage={\n candidateFilterStage?.data?.find(\n (d) => d._id === TempValue?.stageId\n )?.name\n }\n updateStageID={updateStageID}\n setconfirmModal={setconfirmModal}\n setTempValue={setTempValue}\n TempValue={TempValue}\n openingId={TempValue?.openingId}\n sVal={TempValue?.stageId}\n />\n \n \n )}\n \n \n \n \n );\n};\n\nexport default Index;\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { REPLY_THREAD_ACTIVE, REPLY_ID, THREAD_LOAD } from \"constant\";\nimport { Avatar } from \"antd\";\nimport moment from \"moment\";\nimport { messageSocket } from \"action/SocketAction\";\nimport sanitizeHtml from \"sanitize-html\";\nimport striptags from \"striptags\";\nimport { CHAT_CONTAINER_COMPONENT, DROP_CONTENT } from \"constant/app.constant\";\nimport { CXDivider } from \"component/Divider\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport ReactMarkdown from \"react-markdown\";\nimport { CXMarkdownWhatsappChatEditor } from \"component/MarkdownEditor\";\n\nconst Thread = () => {\n const thref = useRef();\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n const messages = useSelector((state) => state.ContentReducer.replyParentId);\n const threadLoading = useSelector(\n (state) => state.ContentReducer.threadLoading\n );\n const allmessages = useSelector((state) => state.MessageReducer.messages);\n const [threadMsg, setthreadMsg] = useState([]);\n const handleClose = () => {\n dispatch({ type: REPLY_THREAD_ACTIVE, data: false });\n dispatch({ type: REPLY_ID, data: \"\" });\n };\n const [channel, setchannel] = useState([]);\n const [data, setdata] = useState(\"\");\n const handleModelChange = (model) => {\n setdata(model);\n };\n const removeCharacter = (target, trigger, text) => {\n return text.replaceAll(target, trigger);\n };\n const current = !appConfig.chatContainerComponent\n ? \"none\"\n : appConfig.chatContainerComponent;\n const emailCC = useSelector((state) => state.AdminReducer.ccEmailRecipients);\n const channelAct = useSelector((state) => state.AdminReducer.channelAct);\n const emailSubject = useSelector((state) => state.AdminReducer.emailSubject);\n const dittoAdminReducer = useSelector((state) => state.dittoAdminReducer);\n const handleSubmit = (editorData) => {\n let tempMsg = \"\";\n if (editorData === \"send\") {\n tempMsg = data;\n } else {\n let gS = editorData.slice(-11);\n if (gS === \"


\") {\n tempMsg = editorData.slice(0, -11);\n } else {\n tempMsg = editorData;\n }\n }\n let text = removeCharacter(\n /<\\/p>/gi,\n \"\",\n sanitizeHtml(tempMsg)\n );\n if (text !== \"\") {\n let attachment = [];\n if (current === \"attachmentContainer\") {\n attachment = appConfig.containerParams;\n }\n let md = [];\n if (channel.length > 0) {\n md = channel;\n }\n if (channel.includes(\"sms\")) {\n text = striptags(text);\n }\n // if (channel.includes(\"email\") && channel.length === 1) {\n // text = striptags(text);\n // }\n // processHere\n let ccEmail = emailCC.map((res) => {\n return res.value;\n });\n let message = {\n msg: {\n isParent: false,\n attachments: attachment,\n content: {\n attachments: [],\n },\n md: md,\n to: {\n id: \"775347e4-0be5-43d7-b1b3-6508b00aed09\",\n },\n text: text,\n parentId: messages._id,\n type: \"message\",\n convId: appConfig.activeConvId._id,\n channelAccountId: messages.channelAccountId,\n cc: ccEmail,\n subject: emailSubject,\n },\n ts: new Date(),\n type: \"message\",\n };\n dispatch(messageSocket(message, dittoAdminReducer.user.userProfile));\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: { component: \"none\", params: null },\n });\n setdata(\"\");\n dispatch({\n type: DROP_CONTENT,\n data: {},\n });\n }\n };\n\n useEffect(() => {\n let threadData =\n allmessages?.length > 0 &&\n allmessages?.filter((data) => data?.parentId === messages?._id);\n setthreadMsg(threadData?.length > 0 ? threadData : []);\n dispatch({ type: THREAD_LOAD, data: false });\n }, [allmessages, messages, threadLoading]);\n\n useEffect(() => {\n if (thref.current) {\n if (thref?.current?.scrollTop)\n thref.current.scrollTop = thref?.current?.scrollHeight;\n }\n });\n const msgTemplate = (data) => {\n return data?.from?._id !== dittoAdminReducer?.user?.userProfile?._id ? (\n
\n {!data?.from?.avatar ? (\n \n {data?.from?.fname ? data?.from?.fname[0].toUpperCase() : null}\n \n ) : (\n \n )}\n
\n \n
\n
\n {data.text}\n
\n
\n
\n
\n
\n \n {moment(data.createdAt).format(\"DD MMM hh:mm A\")}\n \n
\n
\n
\n \n ) : (\n \n
\n \n
\n
\n {data.text}\n
\n
\n
\n
\n
\n \n {moment(data.createdAt).format(\"DD MMM hh:mm A\")}\n \n
\n
\n \n {!data.from.avatar ? (\n \n {data?.from?.fname ? data?.from?.fname[0].toUpperCase() : null}\n \n ) : (\n \n )}\n \n );\n };\n\n return (\n
\n \n \n Thread\n \n
\n handleClose()}\n />\n
\n
\n {threadLoading && (\n
\n \n
\n )}\n {!threadLoading && (\n \n
{msgTemplate(messages)}
\n {threadMsg?.length > 0 && (\n \n {threadMsg?.length} Replies\n \n )}\n
\n {threadMsg.map((res) => {\n return
{msgTemplate(res)}
;\n })}\n
\n
\n )}\n\n {!threadLoading && (\n \n {/* console.log(data)}\n onBlur={handleModelChange}\n /> */}\n \n )}\n \n );\n};\n\nexport default Thread;\n","import React, { useState, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport Info from \"./Info\";\nimport { CXSider } from \"component/Layout\";\nimport { CXTabs, CXTabPane } from \"component/Tabs\";\nimport Thread from \"./Thread\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CHAT_CONTAINER_COMPONENT, DROP_CONTENT } from \"constant/app.constant\";\nimport {\n GET_CONTENT_ACTION_RESPONSE,\n REPLY_THREAD_ACTIVE,\n REPLY_ID,\n} from \"constant\";\nimport { getContentActionTrigger } from \"action/ContentAction\";\nimport \"./style.css\";\nimport { MenuFoldOutlined, MenuUnfoldOutlined } from \"@ant-design/icons\";\n\nconst ToolBar = (props) => {\n const [contectStart, setcontectStart] = useState(0);\n const [content, setcontent] = useState([]);\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n const ContentReducer = useSelector((state) => state.ContentReducer);\n useEffect(() => {\n dispatch(getContentActionTrigger(0, 10));\n dispatch({\n type: DROP_CONTENT,\n data: {},\n });\n return () => {\n dispatch({ type: REPLY_THREAD_ACTIVE, data: false });\n dispatch({ type: REPLY_ID, data: \"\" });\n // dispatch({ type: \"TOGGLE_CHAT_TOOL_BAR\", data: true });\n dispatch({ type: \"TOGGLE_MAIN_MENU_CHECK\", data: false });\n };\n }, []);\n\n useEffect(() => {\n // eslint-disable-next-line default-case\n switch (ContentReducer.action) {\n case GET_CONTENT_ACTION_RESPONSE:\n setcontent(content.concat(ContentReducer?.fullContentList));\n setcontectStart(contectStart + 10);\n // TODO: if end >= max sethasMore(false)\n break;\n }\n }, [ContentReducer.action]);\n\n const dropHandler = (data) => {\n switch (data.type) {\n case \"content\":\n dispatch({\n type: DROP_CONTENT,\n data: data.data,\n });\n break;\n\n case \"file\":\n let files = [];\n if (\n appConfig.containerParams &&\n Array.isArray(appConfig.containerParams)\n ) {\n files = JSON.parse(JSON.stringify(appConfig.containerParams));\n }\n if (!files.some((index) => index._id === data.data._id)) {\n dispatch({\n type: CHAT_CONTAINER_COMPONENT,\n data: {\n component: \"attachmentContainer\",\n params: [...files, data.data],\n },\n });\n }\n\n break;\n\n default:\n break;\n }\n };\n\n useEffect(() => {\n if (!appConfig.chatToolbarCollapsed) {\n dispatch({ type: \"TOGGLE_MAIN_MENU_CHECK\", data: true });\n } else {\n dispatch({ type: \"TOGGLE_MAIN_MENU_CHECK\", data: false });\n }\n }, [appConfig.chatToolbarCollapsed]);\n\n return (\n
\n \n
\n {!appConfig.chatToolbarCollapsed && (\n {\n dispatch({ type: \"TOGGLE_CHAT_TOOL_BAR\", data: true });\n }}\n />\n )}\n {appConfig.chatToolbarCollapsed && (\n {\n dispatch({ type: \"TOGGLE_CHAT_TOOL_BAR\", data: false });\n }}\n />\n )}\n
\n {!appConfig.chatToolbarCollapsed && (\n
\n {appConfig?.activeConvId?._id ? (\n
\n {!ContentReducer.replyThread &&\n props.ActiveComponent === \"inbox\" && (\n \n \n \n \n \n )}\n {ContentReducer.replyThread && }\n
\n ) : (\n \n )}\n
\n )}\n \n
\n );\n};\n\nexport default ToolBar;\n","import React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { CXSwitchMaterial } from \"component/Switch\";\nimport { CXModalConfirm } from \"component/Modal\";\nimport { CHAT_SCREEN_COMPONENT } from \"constant/app.constant\";\nimport { updateChatBot, updateConvActionTrigger } from \"action/ConvAction\";\nimport \"./style.css\";\nimport { LoadingOutlined } from \"@ant-design/icons\";\nimport moment from \"moment\";\nimport { exportJsonToPdf } from \"utils\";\n\nconst ChatTopBar = (props) => {\n const [botSwitch, setbotSwitch] = useState(false);\n const dispatch = useDispatch();\n const AppReducer = useSelector((state) => state.AppReducer);\n const activeConv = props.activeConv;\n const [botConvCheck, setbotConvCheck] = useState(false);\n const checkedList = useSelector((state) => state.AdminReducer.checkedList);\n\n useEffect(() => {\n setbotConvCheck(activeConv?.conv?.botConv);\n }, [activeConv?.conv?.botConv]);\n\n const handleArchive = () => {\n CXModalConfirm({\n title: `Are you sure ${\n activeConv.conv?.status === \"active\" ? \"archive\" : \"un-archive\"\n } this conversation?`,\n icon: \"mdWarning\",\n content: `You can always ${\n activeConv.conv?.status === \"active\" ? \"un-archive\" : \"archive\"\n } this conversation.`,\n okText: \"Yes\",\n okType: \"danger\",\n cancelText: \"No\",\n onOk() {\n dispatch(\n updateConvActionTrigger(activeConv.conv._id, {\n status: activeConv?.conv.status === \"active\" ? \"archive\" : \"active\",\n })\n );\n },\n onCancel() {},\n });\n };\n const handleBot = (event) => {\n setbotSwitch(true);\n dispatch(\n updateChatBot(activeConv.conv._id, {\n botConv: event.target.checked,\n })\n );\n };\n useEffect(() => {\n if (AppReducer?.action === \"SET_CHAT_BOT_SWITCH\") {\n // setbotConvCheck(!botConvCheck);\n setbotConvCheck(activeConv?.conv?.botConv);\n setbotSwitch(false);\n }\n }, [AppReducer]);\n\n const { messages } = useSelector((state) => state.MessageReducer);\n const handleDownloadMessage = (e) => {\n console.log(messages.data);\n let jsonData = messages.data.map((res) => {\n if (res.from) {\n return {\n name: activeConv?.data?.name ?? \"Candidate\",\n message: res.text,\n time: moment(res.createdAt).format(\"DD MMM hh:mm A\"),\n };\n } else {\n return {\n name: \"Recruiter\",\n message: res.text,\n time: moment(res.createdAt).format(\"DD MMM hh:mm A\"),\n };\n }\n });\n exportJsonToPdf(jsonData, `${checkedList?.[0]?._idname}-messageHistory`);\n };\n\n return (\n \n {props?.activeConv && (\n
\n
\n
\n
ChatBot
{\" \"}\n {botSwitch &&
{}
}\n {!botSwitch && (\n
\n {\n handleBot(e)}\n />\n }\n
\n )}\n
\n \n {activeConv.conv?.status === \"active\" ? (\n handleArchive()}\n icon={\n \n }\n >\n Archive\n \n ) : (\n handleArchive()}\n icon={\n \n }\n >\n UnArchive\n \n )}\n \n }\n onClick={() => handleDownloadMessage()}\n >\n Download Chat History\n \n \n }\n >\n {/* */}\n \n \n
\n
\n )}\n
\n );\n};\n\nexport default ChatTopBar;\n","import React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\n\nimport ChatOnly from \"../Common/ChatOnlyInbox\";\nimport { CXContent } from \"component/Layout\";\nimport {\n CHAT_SCREEN_COMPONENT,\n SET_ACTIVE_CONVID,\n} from \"constant/app.constant\";\nimport { CLEAR_MESSAGE } from \"constant\";\n\nconst component = {\n chatOnly: ChatOnly,\n};\n\nconst ChatInbox = (props) => {\n const dispatch = useDispatch();\n const appConfig = useSelector((state) => state.AppReducer);\n useEffect(() => {\n dispatch({ type: CHAT_SCREEN_COMPONENT, data: \"chatOnly\" });\n return () => {\n dispatch({ type: CLEAR_MESSAGE });\n dispatch({ type: SET_ACTIVE_CONVID, data: null });\n };\n }, []);\n\n const CurrentComponent = component[appConfig.chatScreenComponent];\n return (\n \n \n \n );\n};\n\nexport default ChatInbox;\n","import { Button, Form, notification } from \"antd\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState, memo } from \"react\";\nimport history from \"utils/history\";\nimport \"./style.css\";\nimport { CXInput, CXTextArea } from \"component/Input\";\nimport {\n createCompanyTrigger,\n createCompanyTriggerLink,\n getAllCompaniesTrigger,\n getLinkPreview,\n updateCompanyTrigger,\n} from \"action/OpeningsAction\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport CXUpload from \"component/Upload\";\nimport {\n CheckCircleOutlined,\n CloudUploadOutlined,\n ExpandOutlined,\n LoadingOutlined,\n} from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { postFormData } from \"helper/networkClient\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXMarkdownDescriptionEditorHTML } from \"component/MarkdownEditor\";\nimport * as moment from \"moment-timezone\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport \"./style.css\";\nimport Data from \"utils/industry.json\";\nimport { CXModal } from \"component/Modal\";\nimport { CXRadioButton, CXRadioGroup } from \"component/Radio\";\nimport LocationSearch from \"component/LocationSearch\";\n\nconst AddCompany = memo(({ from = null, setaddCompany = () => {} }) => {\n const { companyId } = useParams();\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n const [fullView, setfullView] = useState(false);\n const [CmLogo, setCmLogo] = useState(null);\n const [UploadActiveLogo, setUploadActiveLogo] = useState(true);\n const [UploadActiveCover, setUploadActiveCover] = useState(true);\n const [CmCover, setCmCover] = useState(null);\n const [logoLoader, setlogoLoader] = useState(false);\n const [coverLoader, setcoverLoader] = useState(false);\n const [timezone, settimezone] = useState(null);\n const [Questions, setQuestions] = useState([]);\n const [activeUrl, setactiveUrl] = useState(null);\n const [CreateType, setCreateType] = useState(\"m\");\n const {\n linkPreview,\n linkPreviewLoading,\n allCompanies,\n loadingIndex,\n creatingCompany,\n } = useSelector((state) => state.OpeningReducer);\n const [editComponentLoad, seteditComponentLoad] = useState(true);\n const Createhandler = (value) => {\n if (linkPreviewLoading) {\n notification.error({\n message: \"Please wait for link preview to load\",\n });\n return;\n }\n value.news = value?.news?.filter((item) => item?.url);\n value.news = value?.news?.filter((item) => item?.url);\n let { useAlias, ...rest } = value;\n if (useAlias) {\n rest.displayConfig = {\n useAlias: true,\n };\n } else {\n rest.displayConfig = {\n useAlias: false,\n };\n }\n if (companyId) {\n dispatch(updateCompanyTrigger(companyId, rest));\n } else {\n dispatch(createCompanyTrigger(rest, from));\n }\n form.resetFields();\n setQuestions([]);\n setactiveUrl(null);\n if (from !== \"opening\") {\n history.push(\"/admin/company\");\n } else {\n setaddCompany(false);\n }\n };\n const handleUploadFileLogo = async (file) => {\n setlogoLoader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setCmLogo(null);\n setCmLogo(resp?.data?.data?.url);\n form.setFieldsValue({ logo: resp?.data?.data?.url });\n setlogoLoader(false);\n setUploadActiveLogo(false);\n setUploadActiveCover(false);\n } else {\n setlogoLoader(false);\n setUploadActiveLogo(true);\n setUploadActiveCover(true);\n }\n });\n } catch (error) {\n setlogoLoader(false);\n }\n };\n const handleUploadFileCover = async (file) => {\n setcoverLoader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setCmCover(null);\n setCmCover(resp?.data?.data?.url);\n form.setFieldsValue({ coverImage: resp?.data?.data?.url });\n setcoverLoader(false);\n setUploadActiveCover(false);\n } else {\n setcoverLoader(false);\n setUploadActiveCover(true);\n }\n });\n } catch (error) {\n setcoverLoader(false);\n }\n };\n const handleDiscription = (value) => {\n form.setFieldsValue({ about: value });\n };\n\n useEffect(() => {\n form.setFieldsValue({ timeZone: timezone ?? \"\" });\n }, [timezone]);\n\n const TitleTrimFromUrl = (url) => {\n const title = url?.split(\"/\")[2];\n return title;\n };\n\n useEffect(() => {\n if (linkPreview) {\n const temp = [...Questions];\n if (linkPreview?.data?.url) {\n temp[linkPreview?.index] = linkPreview?.data;\n } else {\n temp[linkPreview?.index] = {\n url: linkPreview?.data.length > 0 ? linkPreview?.data : activeUrl,\n title:\n linkPreview?.data.length > 0\n ? TitleTrimFromUrl(linkPreview?.data)\n : TitleTrimFromUrl(activeUrl),\n };\n }\n setQuestions(temp);\n form.setFieldsValue({ news: temp });\n }\n }, [linkPreview]);\n const addQuestion = () => {\n setQuestions([...Questions, {}]);\n };\n const removeQuestion = (index) => {\n const temp = [...Questions];\n temp.splice(index, 1);\n form.setFieldsValue({ news: temp });\n setQuestions(temp);\n };\n useEffect(() => {\n dispatch(getAllCompaniesTrigger());\n }, []);\n\n useEffect(() => {\n if (companyId && allCompanies?.data) {\n setCreateType(\"m\");\n const company = allCompanies?.data?.find((data) => {\n return data._id === companyId;\n });\n if (company) {\n form.setFieldsValue({\n name: company?.name,\n alias: company?.alias ?? \"\",\n industry: company?.industry,\n type: company?.type ?? \"\",\n numPeople: company?.numPeople ?? \"\",\n location: company?.location ?? \"\",\n about: company?.about ?? \"\",\n website: company?.website ?? \"\",\n linkedinUrl: company?.linkedinUrl ?? \"\",\n logo: company?.logo ?? \"\",\n coverImage: company?.coverImage ?? \"\",\n news: company?.news ?? \"\",\n useAlias: company?.displayConfig?.useAlias ?? \"\",\n });\n setCmLogo(company?.logo ?? \"\");\n setUploadActiveLogo(company?.logo ? false : true);\n setUploadActiveCover(company?.coverImage ? false : true);\n setCmCover(company?.coverImage ?? \"\");\n settimezone(company?.timeZone ?? \"\");\n setQuestions(company?.news ?? []);\n }\n }\n setTimeout(() => {\n seteditComponentLoad(false);\n }, 1000);\n }, [companyId, allCompanies]);\n const CreateUsingLink = (value) => {\n dispatch(createCompanyTriggerLink({ linkedinUrl: value?.linkedinUrl }));\n };\n return (\n \n \n
\n \n \n {from !== \"opening\" && (\n {\n history.push(\"/admin/company\");\n }}\n src=\"/images/openings/backIcon.svg\"\n className=\"mr-2 cursor-pointer\"\n alt=\"back\"\n />\n )}{\" \"}\n {companyId ? \"Update Company\" : \"Create Company\"}\n \n \n
\n {!companyId && !editComponentLoad && (\n
\n {\n setCreateType(e.target.value);\n }}\n >\n Add Manually\n Using Linkedin URL\n \n
\n )}\n {editComponentLoad && companyId && (\n \n )}\n {!editComponentLoad && CreateType === \"l\" && (\n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n
\n
\n {\n if (from === \"opening\") {\n setaddCompany(false);\n } else {\n history.push(\"/admin/company\");\n }\n }}\n className=\"CancelBtn\"\n style={{\n margin: \"0px 8px\",\n }}\n >\n Cancel\n \n \n {`Create`}\n \n
\n
\n {creatingCompany && (\n
\n
\n \n

\n Processing your request, please hold on...\n

\n
\n
\n )}\n
\n
\n )}\n {!editComponentLoad && CreateType === \"m\" && (\n
\n \n
\n
\n
\n \n
\n
Name
\n
\n \n
\n
\n \n \n
\n
Industry
\n
\n {/* */}\n {\n form.setFieldsValue({ industry: value });\n }}\n defaultValue={form.getFieldValue(\"industry\") ?? \"\"}\n >\n {Data?.map((item) => {\n return (\n \n {item.label}\n \n );\n })}\n \n
\n
\n \n
\n
\n \n
\n
Alias
\n
\n \n
\n
\n
\n \n
\n
Use Alias
\n
\n {\n form.setFieldsValue({ useAlias: value });\n }}\n defaultValue={form.getFieldValue(\"useAlias\") ?? \"\"}\n >\n Yes\n No\n \n
\n
\n
\n
\n
\n \n
\n
Type
\n
\n \n
\n
\n \n\n \n
\n
Employees
\n
\n {\n form.setFieldsValue({ numPeople: value });\n }}\n defaultValue={form.getFieldValue(\"numPeople\") ?? \"\"}\n >\n 1-10\n 11-50\n 51-200\n 201-500\n 501-1000\n 1001 -5000\n 5001-10000\n 10000+\n \n
\n
\n \n
\n
\n \n
\n
Location
\n
\n \n form.setFieldsValue({\n location: {\n name: e.target.value,\n },\n })\n }\n defaultValue={\n form.getFieldValue(\"location\")?.name ?? \"\"\n }\n />\n {/* {\n form.setFieldsValue({\n location: {\n name: value?.name ?? \"\",\n city:\n value?.address_components.find((d) =>\n d.types.includes(\"locality\")\n )?.long_name ?? \"\",\n region:\n value?.address_components.find((d) =>\n d.types.includes(\n \"administrative_area_level_1\"\n )\n ).long_name ?? \"\",\n country:\n value?.address_components.find((d) =>\n d.types.includes(\"country\")\n ).long_name ?? \"\",\n fullAddress: value?.formatted_address ?? \"\",\n placeId: key,\n },\n });\n }}\n defaultValue={\n form.getFieldValue(\"location\")?.name ?? \"\"\n }\n /> */}\n
\n
\n \n\n \n
\n
Timezone
\n
\n {\n settimezone(value);\n }}\n value={timezone}\n defaultValue={form.getFieldValue(\"timeZone\") ?? \"\"}\n >\n {moment?.tz?.names()?.map((tz) => {\n return (\n \n {tz}\n \n );\n })}\n \n
\n
\n \n
\n
\n \n
\n
\n
About Company
\n
\n {\n setfullView(true);\n }}\n />\n
\n
\n
\n console.log(data)}\n onModelChange={(data) => handleDiscription(data)}\n data={\n form.getFieldValue(\"about\")\n ? form.getFieldValue(\"about\")\n : \"\"\n }\n />\n
\n
\n \n
\n
\n \n
\n
Website URL
\n
\n \n
\n
\n \n \n
\n
Linkedin URL
\n
\n \n
\n
\n \n
\n
\n \n
\n
Company Logo
\n
\n {!logoLoader && (\n \n {CmLogo && !UploadActiveLogo ? (\n {\n setUploadActiveLogo(true);\n }}\n />\n ) : (\n
\n setUploadActiveLogo(false)}\n >\n x\n \n \n \n \n
\n )}\n
\n )}\n {logoLoader && }\n
\n
\n
\n \n
\n
\n Company Cover Picture\n
\n
\n {!coverLoader && (\n \n {CmCover && !UploadActiveCover ? (\n {\n setUploadActiveCover(true);\n }}\n />\n ) : (\n
\n setUploadActiveCover(false)}\n >\n x\n \n \n \n \n
\n )}\n
\n )}\n {coverLoader && }\n
\n
\n
\n
\n
\n \n
\n
In the News
\n
\n
\n {Questions.map((item, index) => {\n return (\n
\n
\n \n
\n
\n {\n const value = e.target.value;\n const regex = /^https:\\/\\/.*/; // Regex pattern for https:// URLs\n const isValid = regex.test(value);\n if (isValid) {\n setactiveUrl(value);\n dispatch(\n getLinkPreview(value, index)\n );\n form.setFields([\n {\n name: \"news\",\n errors: [],\n },\n ]);\n } else {\n // show an error message\n console.log(\"Invalid input\");\n form.setFields([\n {\n name: \"news\",\n errors: [\n \"Please enter a valid URL\",\n ],\n },\n ]);\n }\n }}\n defaultValue={item?.url ?? \"\"}\n />\n
\n
\n {linkPreviewLoading &&\n loadingIndex === index ? (\n \n ) : (\n \n )}\n
\n\n removeQuestion(index)}\n >\n \n
\n
\n );\n })}\n
\n \n
\n \n
\n addQuestion()}\n >\n Add Url\n \n
\n \n \n \n
\n \n \n
\n {\n if (from === \"opening\") {\n setaddCompany(false);\n } else {\n history.push(\"/admin/company\");\n }\n }}\n className=\"CancelBtn\"\n style={{\n margin: \"0px 8px\",\n }}\n >\n Cancel\n \n \n {companyId ? `Update` : `Create`}\n \n
\n \n \n )}\n
\n \n
\n
\n
\n About Company *\n
\n {\n setfullView(false);\n }}\n >\n Close\n \n
\n console.log(data)}\n onModelChange={(data) => handleDiscription(data)}\n data={\n form.getFieldValue(\"about\") ? form.getFieldValue(\"about\") : \"\"\n }\n placeholder=\"Enter company details\"\n />\n
\n \n
\n );\n});\n\nexport default AddCompany;\n","import { DeleteFilled, EditFilled, EyeOutlined } from \"@ant-design/icons\";\nimport { deleteCompanyTrigger } from \"action/OpeningsAction\";\nimport { CXAvatar } from \"component/Avatar\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getCookie } from \"utils\";\nimport history from \"utils/history\";\n\nconst CompanyCard = ({ data }) => {\n const dispatch = useDispatch();\n const tenantId = getCookie(\"tenant\");\n const userTenants = useSelector(\n (state) => state.dittoAdminReducer?.user?.userTenants\n );\n const menu = (id) => (\n \n {\n window.open(\n `https://careerpage.hirebound.io/${\n userTenants?.[0]?.tenantId?.slug ?? tenantId\n }/${data?.slug ?? data._id}`,\n \"_blank\"\n );\n }}\n >\n \n Preview\n \n {\n dispatch(deleteCompanyTrigger(id));\n }}\n >\n \n Delete\n \n \n );\n return (\n
\n
\n {\n e.stopPropagation();\n history.push(`/admin/company/${data._id}/edit`);\n return false;\n }}\n >\n
\n {data?.logo ? (\n \n ) : (\n \n {data?.name[0].toUpperCase()}\n \n )}\n
\n
\n
{data?.name}
\n
{data?.hqLocation}
\n
\n
\n\n \n \n \n \n
\n \n \n );\n};\n\nexport default CompanyCard;\n","import { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useCallback, useEffect } from \"react\";\nimport \"./style.css\";\nimport history from \"utils/history\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n getAllCompaniesTrigger,\n getCompanyByName,\n} from \"action/OpeningsAction\";\nimport CompanyCard from \"./CompanyCard\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { CXRow } from \"component/Row\";\nimport { debounce } from \"lodash\";\n\nconst Index = () => {\n const dispatch = useDispatch();\n const { allCompanies, loading } = useSelector(\n (state) => state.OpeningReducer\n );\n useEffect(() => {\n dispatch(getAllCompaniesTrigger());\n }, []);\n const debouncedOnChange = useCallback(\n debounce((event) => {\n if (event?.target?.value.length > 0) {\n dispatch(getCompanyByName(event.target.value));\n } else {\n dispatch(getAllCompaniesTrigger());\n }\n }, 300), // Adjust the debounce delay as needed\n [dispatch]\n );\n return (\n \n \n \n \n Company\n \n
\n {\n history.push(\"/admin/company/add\");\n }}\n >\n Add Company\n \n
\n
\n
\n \n }\n // suffix={\n //
\n // \"filter\"{\" \"}\n // Filter\n //
\n // }\n />\n
\n
\n {loading && (\n \n {[...Array(6)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {!loading && (\n \n \n
\n {allCompanies?.data?.map((item, index) => {\n return ;\n })}\n
\n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default Index;\n","export const data2 = {\n labels: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n datasets: [\n {\n label: \"Contacts\",\n data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n borderColor: \"#4CB580\",\n backgroundColor: \"#4CB580\",\n barThickness: 14,\n borderWidth: 0,\n borderRadius: 2,\n borderSkipped: false,\n },\n ],\n};\nexport const data3 = {\n labels: [\n \"20\",\n \"21\",\n \"22\",\n \"23\",\n \"24\",\n \"25\",\n \"26\",\n \"27\",\n \"28\",\n \"29\",\n \"30\",\n \"31\",\n \"01\",\n \"02\",\n ],\n datasets: [\n {\n label: \"Web Chat\",\n data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n fill: true,\n borderColor: \"#4CB580\",\n backgroundColor: \"rgba(206, 249, 191, 0.286)\",\n tension: 0.4,\n },\n {\n label: \"Email\",\n data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n fill: true,\n borderColor: \"#7459D9\",\n backgroundColor: \"#ddf7d44a\",\n tension: 0.4,\n },\n {\n label: \"SMS\",\n data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n fill: true,\n borderColor: \"#E0B1EF\",\n backgroundColor: \"#f6eafb\",\n tension: 0.4,\n },\n ],\n};\n\n// TODO : convert into css\n\nexport const iconSt = {\n marginRight: 24,\n};\nexport const CountSt = {\n fontWeight: \"600\",\n fontSize: \"24px\",\n};\nexport const divDisSt = {\n fontWeight: \"400\",\n fontSize: \"14px\",\n lineHeight: \"17px\",\n color: \" #979797\",\n};\nexport const containerSt = {\n margin: \"59px 30px 30px 30px\",\n};\nexport const Ch1st = {\n padding: \"32px\",\n // minWidth: \"490px\",\n height: \"400px\",\n background: \"#FFFFFF\",\n boxShadow: \"0px 10px 13px rgba(17, 38, 146, 0.05)\",\n borderRadius: \"8px\",\n flexGrow: 1,\n};\nexport const Ch2 = {\n width: \"55%\",\n height: \"401px\",\n background: \"#FFFFFF\",\n boxShadow: \"0px 10px 13px rgba(17, 38, 146, 0.05)\",\n borderRadius: \"8px\",\n padding: \"32px\",\n flexGrow: 1,\n};\nexport const mr24 = {\n marginRight: 24,\n};\nexport const divCir = {\n width: \"16.59px\",\n height: \"16px\",\n borderRadius: \"100px\",\n};\n","import {\n DASHBOARD_CARDS,\n DASHBOARD_VISITORS,\n DASHBOARD_CONTACT,\n DASHBOARD_CARDS_TRIGGER,\n} from \"constant\";\nimport { get } from \"helper/networkClient\";\n\nexport const GetDashCards = (param) => async (dispatch) => {\n if (param) {\n dispatch({ type: DASHBOARD_CARDS_TRIGGER });\n try {\n await get(`/dashboard/card`, param).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: DASHBOARD_CARDS, data: resp.data });\n }\n });\n } catch (error) {}\n }\n};\n\nexport const GetDashVists = (param) => async (dispatch) => {\n if (param)\n try {\n await get(`/dashboard/visitor`, param).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: DASHBOARD_VISITORS, data: resp.data });\n }\n });\n } catch (error) {}\n};\n\nexport const GetDashContact = (param) => async (dispatch) => {\n try {\n await get(`/dashboard/contact`, param).then((resp) => {\n if (resp.status === 200) {\n dispatch({ type: DASHBOARD_CONTACT, data: resp.data });\n }\n });\n } catch (error) {}\n};\n","import {\n CREATE_PAYMENTS_ACTION_TRIGGER,\n CREATE_PAYMENTS_ACTION_RESPONSE,\n CREATE_PAYMENTS_ACTION_ERROR,\n GET_PAYMENTS_ACTION_TRIGGER,\n GET_PAYMENTS_ACTION_RESPONSE,\n GET_PAYMENTS_ACTION_ERROR,\n GET_PAYMENTS_CARD_ACTION_TRIGGER,\n GET_PAYMENTS_CARD_ACTION_RESPONSE,\n GET_PAYMENTS_CARD_ACTION_ERROR,\n} from \"constant\";\n\nimport { get, post } from \"helper/networkClient\";\n\nexport const createPaymentsActionTrigger = (data) => async (dispatch) => {\n dispatch({ type: CREATE_PAYMENTS_ACTION_TRIGGER, data });\n try {\n await post(\"/payment-links\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(createPaymentsActionResponse(resp.data));\n } else {\n dispatch(createPaymentsActionError(resp));\n }\n });\n } catch (error) {\n dispatch(createPaymentsActionError(error));\n }\n};\n\nconst createPaymentsActionResponse = (data) => ({\n type: CREATE_PAYMENTS_ACTION_RESPONSE,\n data,\n});\n\nconst createPaymentsActionError = (data) => ({\n type: CREATE_PAYMENTS_ACTION_ERROR,\n data,\n});\n\nexport const getPaymentsActionTrigger = (query) => async (dispatch) => {\n dispatch({ type: GET_PAYMENTS_ACTION_TRIGGER, data: query });\n await get(\"/payment-links\", query).then((resp) => {\n if (resp.status === 200) {\n dispatch(getPaymentsActionResponse(resp.data));\n } else {\n dispatch(getPaymentsActionError(resp));\n }\n });\n};\n\nconst getPaymentsActionResponse = (data) => ({\n type: GET_PAYMENTS_ACTION_RESPONSE,\n data,\n});\n\nconst getPaymentsActionError = (data) => ({\n type: GET_PAYMENTS_ACTION_ERROR,\n data,\n});\n\nexport const getPaymentsCardActionTrigger = (query) => async (dispatch) => {\n dispatch({ type: GET_PAYMENTS_CARD_ACTION_TRIGGER, data: query });\n await get(\"/payment-links/card\", query).then((resp) => {\n if (resp.status === 200) {\n dispatch(getPaymentsCardActionResponse(resp.data));\n } else {\n dispatch(getPaymentsCardActionError(resp));\n }\n });\n};\n\nconst getPaymentsCardActionResponse = (data) => ({\n type: GET_PAYMENTS_CARD_ACTION_RESPONSE,\n data,\n});\n\nconst getPaymentsCardActionError = (data) => ({\n type: GET_PAYMENTS_CARD_ACTION_ERROR,\n data,\n});\n","import React, { useState, useEffect, Fragment } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXContent } from \"component/Layout\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { Chart as ChartJS } from \"chart.js/auto\";\nimport { Pie } from \"react-chartjs-2\";\nimport { Bar } from \"react-chartjs-2\";\nimport { Line } from \"react-chartjs-2\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXText } from \"component/Typography\";\nimport {\n GetDashCards,\n GetDashVists,\n GetDashContact,\n} from \"action/DashboardActions\";\nimport DatePickerComp from \"../../Common/DatePickerComp\";\nimport { DashInfoSkeleton } from \"component/Skeleton\";\nimport { getPaymentsCardActionTrigger } from \"action/PaymentAction\";\nimport {\n data2,\n data3,\n DivSt,\n iconSt,\n CountSt,\n divDisSt,\n containerSt,\n Ch1st,\n Ch2,\n mr24,\n divCir,\n} from \"./Config\";\nimport { DASHBOARD_UNMOUNT } from \"constant\";\nimport \"./style.css\";\nimport history from \"utils/history\";\nimport { getOpenPositionsTrigger } from \"action/OpeningsAction\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { CXModal } from \"component/Modal\";\nimport { getCookie, setCookie } from \"utils\";\n// import { FindTenant } from \"./retoolLinks\";\n\nconst Dashboard = () => {\n const tenantId = getCookie(\"tenant\");\n const dispatch = useDispatch();\n const [startDate, setStartDate] = useState(null);\n const [endDate, setEndDate] = useState(null);\n const [startDateC, setStartDateC] = useState(null);\n const [endDateC, setEndDateC] = useState(null);\n const [activeFilter, setActiveFilter] = useState([\"month\"]);\n const Loading = useSelector((state) => state.DashboardReducer.loading);\n const Cards = useSelector((state) => state.DashboardReducer.cards);\n const Visitors = useSelector((state) => state.DashboardReducer.visitors);\n const Contact = useSelector((state) => state.DashboardReducer.contact);\n const Payments = useSelector((state) => state.DashboardReducer.payments);\n const Agents = useSelector((state) => state.AgentReducer.agents);\n const [FilterPos, setFilterPos] = useState(null);\n const [FilterRec, setFilterRec] = useState(null);\n const [Outreach, setOutreach] = useState(\"out\");\n const { openPositions } = useSelector((state) => state.OpeningReducer);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const [notifTrriger, setnotifTrriger] = useState(false);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n\n useEffect(() => {\n let uEmail = user?.userProfile?.email;\n let signature =\n allConfigData?.find(\n (d) => d?.configEmail?.email?.toLowerCase() === uEmail?.toLowerCase()\n )?.configEmail?.emailSignature ?? null;\n if (allConfigData?.length === 0 || signature?.length === 0) {\n setCookie(\"ch-alert\", \"true\", \"1d\");\n let check = getCookie(\"ch-Skip\");\n if (check !== \"true\") {\n setnotifTrriger(true);\n }\n }\n }, [allConfigData, user]);\n const selectViaCalC = (dates) => {\n const [start, end] = dates;\n setStartDateC(start);\n setEndDateC(end);\n if ((start, end)) {\n setActiveFilter([\"custom\"]);\n } else {\n setActiveFilter([\"month\"]);\n }\n };\n const changeValC = (val) => {\n setActiveFilter(val);\n setEndDateC(null);\n };\n\n // effectsBlock-------->\n useEffect(() => {\n if (activeFilter.includes(\"custom\")) {\n if (startDateC && setEndDate) {\n dispatch(\n GetDashCards({\n filter: activeFilter[0],\n startDate: startDateC,\n endDate: endDateC,\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n })\n );\n dispatch(\n GetDashContact({\n filter: activeFilter[0],\n startDate: startDateC,\n endDate: endDateC,\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n })\n );\n }\n } else {\n dispatch(\n GetDashCards({\n filter: activeFilter[0],\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n })\n );\n dispatch(\n GetDashContact({\n filter: activeFilter[0],\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n })\n );\n }\n\n dispatch(getPaymentsCardActionTrigger({ dateFilter: \"\" }));\n dispatch(getOpenPositionsTrigger());\n }, [activeFilter, FilterPos, FilterRec, Outreach]);\n\n useEffect(() => {\n if (activeFilter.includes(\"custom\")) {\n dispatch(\n GetDashVists({\n filter: activeFilter[0],\n startDate: startDateC,\n endDate: endDateC,\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n ingress: Outreach === \"in\" ? true : false,\n })\n );\n } else {\n dispatch(\n GetDashVists({\n filter: activeFilter[0],\n // openingId: FilterPos === \"All\" ? null : FilterPos,\n recruiterId: FilterRec === \"All\" ? null : FilterRec,\n ingress: Outreach === \"in\" ? true : false,\n })\n );\n }\n }, [activeFilter, FilterPos, FilterRec, Outreach]);\n\n useEffect(() => {\n return () => dispatch({ type: DASHBOARD_UNMOUNT });\n }, []);\n\n // dynamicRenderBlock------->\n const CountRender = [\n {\n name: \"New Messages\",\n icon: \"/images/Dashboard/bot.svg\",\n data: Cards?.data?.newMessages ? Cards?.data?.newMessages : 0,\n tag: \"bot\",\n },\n // {\n // name: \"Active Agent Conversations\",\n // icon: \"/images/Dashboard/support.svg\",\n // data: Cards?.data?.activeAgentConv ? Cards?.data?.activeAgentConv : 0,\n // tag: \"Active\",\n // },\n // {\n // name: \"Failed Bot Conversations\",\n // icon: \"/images/Dashboard/bot.svg\",\n // data: Cards?.data?.failedBot ? Cards?.data?.failedBot : 0,\n // tag: \"failedBot\",\n // },\n {\n name: \"Pending Messages\",\n icon: \"/images/Dashboard/chat.svg\",\n data: Cards?.data?.pendingReply ? Cards?.data?.pendingReply : 0,\n tag: \"pending\",\n },\n ];\n const CountNodes = (d) => {\n return (\n history.push(`communication/inbox?tag=${d.tag}`)}\n >\n {!Loading && (\n \n
\n \"icon\"\n
\n
\n
{d.data}
\n
{d.name}
\n
\n
\n )}\n\n {Loading && }\n \n );\n };\n const paymentLegend = [\n {\n name: \"Pending\",\n icon: \"/images/Dashboard/pending.svg\",\n data: Payments?.datasets[0]?.data[0] ? Payments?.datasets[0]?.data[0] : 0,\n },\n {\n name: \"Success\",\n icon: \"/images/Dashboard/success.svg\",\n data: Payments?.datasets[1]?.data[0] ? Payments?.datasets[1]?.data[0] : 0,\n },\n {\n name: \"Failed\",\n icon: \"/images/Dashboard/failed.svg\",\n data: Payments?.datasets[2]?.data[0] ? Payments?.datasets[2]?.data[0] : 0,\n },\n ];\n const legendPayRender = (d) => {\n return (\n
\n
\n \"icon\"\n
\n
\n
{d.name}
\n
{d.data}
\n
\n
\n );\n };\n const legendVisRender = (name, count, color) => {\n return (\n
\n
\n
\n
\n
\n
{name}
\n
{count}
\n
\n
\n );\n };\n const PaymentComponent = () => {\n return (\n
\n
\n
Payments
\n
\n \n \n This Week\n \n \n
\n
\n
\n
\n \n
\n
\n {paymentLegend.map((d) => legendPayRender(d))}\n
\n
\n
\n );\n };\n const VisitorComponent = (val) => {\n return (\n \n \n
Candidate Message
\n
\n setOutreach(v)}\n >\n \n Incoming\n \n \n Outgoing\n \n \n
\n \n
\n \n
\n
\n {Visitors?.data?.datasets?.map((res) => {\n return (\n
\n {legendVisRender(\n res.label,\n res?.data?.length > 0\n ? res?.data?.reduce(function (a, b) {\n return a + b;\n })\n : 0,\n res.borderColor\n )}\n
\n );\n })}\n
\n \n );\n };\n const CandidateSourced = (val) => {\n return (\n \n \n
Candidates Sourced
\n \n
\n \n
\n \n );\n };\n\n return (\n \n
\n \n
\n Dashboard{\" \"}\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.retoolEnabled &&\n Array.isArray(\n user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.retoolLink\n ) &&\n user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.retoolLink &&\n user?.userTenants\n ?.find((item) => item?.userId === user?.userProfile?._id)\n ?.retoolLink?.map((res, i) => {\n return (\n {\n window.open(res?.link, \"_blank\");\n }}\n >\n Click here to view dashboard {i + 1}\n
\n );\n })}\n
\n
\n \n
Recruiter
\n setFilterRec(v)}\n defaultValue={\"All\"}\n >\n All\n {Agents?.data?.map((res) => {\n return (\n \n {res.fname} {res.lname}\n \n );\n })}\n \n
\n
\n
Dates
\n
\n \n
\n
\n \n \n {CountRender.map((d) => CountNodes(d))}\n \n \n {VisitorComponent(\"h\")}\n \n \n \n \n {CandidateSourced(\"h\")}\n \n \n \n \n
\n
\n
\n To start using our\n services, please connect your{\" \"}\n Email and{\" \"}\n Signature to your account. You\n can choose to do this now or later.\n
\n
\n Admin > Connected Accounts > Email\n
\n
\n
\n
\n {\n setCookie(\"ch-Skip\", \"true\", \"1d\");\n setnotifTrriger(false);\n }}\n >\n Skip for now\n \n {\n history.push(\"/admin/admin/Connected/Email\");\n setnotifTrriger(false);\n }}\n >\n Set Now\n \n
\n
\n
\n
\n
\n );\n};\n\nexport default Dashboard;\n","import React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXSider, CXHeader } from \"component/Layout\";\nimport { TOGGLE_SETTINGS_SIDE_BAR } from \"constant/app.constant\";\nimport { CXTitle } from \"component/Typography\";\nimport history from \"utils/history\";\nimport \"./style.css\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport { useLocation } from \"react-router-dom\";\n\nconst LeftSideBar = () => {\n const dispatch = useDispatch();\n const [activeMenu, setactiveMenu] = useState(\"\");\n const appConfig = useSelector((state) => state.AppReducer);\n\n const onCollapse = (collapsed) => {\n dispatch({ type: TOGGLE_SETTINGS_SIDE_BAR });\n };\n const handleRoute = (path = \"/\") => {\n history.push(path);\n };\n let location = useLocation();\n\n useEffect(() => {\n if (location) {\n let str = location.pathname;\n let arr = str.split(\"/knowledge-base\");\n let key = !arr[1] || arr[1] === \"/\" ? \"template\" : arr[1].split(\"/\")[1];\n setactiveMenu(key);\n }\n }, []);\n return (\n \n \n \n Templates\n \n \n {/*
*/}\n \n \n }\n onClick={() => handleRoute(\"/admin/knowledge-base/template\")}\n >\n Whatsapp Template\n \n \n }\n onClick={() => handleRoute(\"/admin/knowledge-base/email-template\")}\n >\n Email Template\n \n \n }\n onClick={() => handleRoute(\"/admin/knowledge-base/sms-template\")}\n >\n SMS Template\n \n \n \n );\n};\n\nexport default LeftSideBar;\n","import { CXButton } from \"component/Button\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport history from \"utils/history\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport Compose from \"screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/Compose\";\nimport { createEmailTemplate } from \"action/TemplateAction\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXInput } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst EmailTemplateCreate = () => {\n const [EmailData, setEmailData] = useState(\"\");\n const Subject = useSelector((state) => state.AdminReducer.emailSubject);\n const CC = useSelector((state) => state.AdminReducer.ccEmailRecipients);\n const BCC = useSelector((state) => state.AdminReducer.bccEmailRecipients);\n const [TemplateName, setTemplateName] = useState(null);\n const [composeLoading, setComposeLoading] = useState(true);\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n const [expectedIntents, setexpectedIntents] = useState([]);\n const [expectYesNo, setexpectYesNo] = useState(false);\n const dispatch = useDispatch();\n const handleModelChange = (model) => {\n setEmailData(model);\n model === \"\" &&\n dispatch({\n type: \"DROP_CONTENT\",\n data: {},\n });\n };\n const SaveEmailTemplete = () => {\n let ccEmail = CC.map((res) => {\n return res.value;\n });\n let bccEmail = BCC.map((res) => {\n return res.value;\n });\n let obj = {\n title: TemplateName,\n subject: Subject,\n text: EmailData,\n cc: ccEmail,\n bcc: bccEmail,\n expectedIntents: expectedIntents,\n expectYesNo: expectYesNo,\n };\n dispatch(createEmailTemplate(obj));\n };\n useEffect(() => {\n dispatch(getAgentsActionTrigger());\n setTimeout(() => {\n setComposeLoading(false);\n }, 500);\n }, []);\n useEffect(() => {\n dispatch(getAccountintents());\n }, []);\n return (\n \n \n \n Create Email Template\n \n
\n \n history.push(\"/admin/knowledge-base/email-template/\")\n }\n >\n Cancel\n \n SaveEmailTemplete()}\n >\n Save\n \n
\n
\n \n
\n {composeLoading && (\n \n )}\n {!composeLoading && (\n
\n
\n setTemplateName(e.target.value)}\n addonBefore={\n \n *\n Email Template Name :\n
\n }\n />\n \n \n \n *\n Intent\n \n \n {\n setexpectedIntents([val]);\n }}\n >\n {AccountIntents?.map((res) => {\n return {res.name};\n })}\n \n \n \n \n \n *\n Expect Yes / No response to this template\n \n \n {\n setexpectYesNo(val);\n }}\n />\n \n \n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default EmailTemplateCreate;\n","import { CXButton } from \"component/Button\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n getEmailTemplateVariables,\n getTemplateDetailsById,\n UpdateEmailTemplate,\n} from \"action/TemplateAction\";\nimport {\n EMAIL_TEMPLATES_ACTION_CLEAR,\n TEMPLATE_DETAILS_BY_ID_RESPONSE,\n} from \"constant\";\nimport { Templates } from \"./Templates/TemplateListData\";\nimport Compose from \"screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/Compose\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport { CXInput } from \"component/Input\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst EmailTemplateEdit = () => {\n const [EmailData, setEmailData] = useState(\"\");\n const { EmailTemplateVariables, EmailTemplateActive } = useSelector(\n (state) => state.TemplateReducer\n );\n const Subject = useSelector((state) => state.AdminReducer.emailSubject);\n const CC = useSelector((state) => state.AdminReducer.ccEmailRecipients);\n const BCC = useSelector((state) => state.AdminReducer.bccEmailRecipients);\n const [composeLoading, setComposeLoading] = useState(true);\n const [TemplateName, setTemplateName] = useState(null);\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n const [expectedIntents, setexpectedIntents] = useState([]);\n const [expectYesNo, setexpectYesNo] = useState(false);\n const dispatch = useDispatch();\n const handleModelChange = (model) => {\n setEmailData(model);\n model === \"\" &&\n dispatch({\n type: \"DROP_CONTENT\",\n data: {},\n });\n };\n const UpdateTemplate = () => {\n let ccEmail = CC?.map((res) => {\n return res.value;\n });\n let bccEmail = BCC?.map((res) => {\n return res.value;\n });\n let obj = {\n title: TemplateName,\n subject: Subject,\n text: EmailData,\n cc: ccEmail ?? [],\n bcc: bccEmail ?? [],\n expectedIntents: expectedIntents,\n expectYesNo: expectYesNo,\n };\n console.log(obj);\n dispatch(UpdateEmailTemplate(id, obj));\n };\n const { id } = useParams();\n useEffect(() => {\n dispatch(getTemplateDetailsById(id));\n dispatch(getAccountintents());\n }, [id]);\n\n useEffect(() => {\n return () => {\n dispatch({ type: TEMPLATE_DETAILS_BY_ID_RESPONSE, data: null });\n };\n }, []);\n useEffect(() => {\n dispatch(getAgentsActionTrigger());\n setTimeout(() => {\n setComposeLoading(false);\n }, 1000);\n }, []);\n\n useEffect(() => {\n if (EmailTemplateActive?.data?.text) {\n setEmailData(EmailTemplateActive?.data?.text);\n setTemplateName(EmailTemplateActive?.data?.title);\n setexpectedIntents(EmailTemplateActive?.data?.expectedIntents);\n setexpectYesNo(EmailTemplateActive?.data?.expectYesNo);\n dispatch({\n type: \"EMAIL_SUBJECT\",\n data: EmailTemplateActive?.data?.subject,\n });\n }\n }, [EmailTemplateActive?.data]);\n\n console.log(\"EmailData\", EmailData);\n\n return (\n \n \n \n Update template\n \n\n
\n UpdateTemplate()}\n >\n Update\n \n history.push(\"/admin/knowledge-base/email-template\")}\n >\n Cancel\n \n
\n
\n {/* {loading && } */}\n \n {composeLoading && (\n \n )}\n {!composeLoading && (\n
\n
\n setTemplateName(e.target.value)}\n addonBefore={\n
\n Email Template Name :\n
\n }\n />\n
\n \n \n *\n Intent\n \n \n {\n setexpectedIntents([val]);\n }}\n >\n {AccountIntents?.map((res) => {\n return {res.name};\n })}\n \n \n \n \n \n *\n Expect Yes / No response to this template\n \n \n {\n setexpectYesNo(val);\n }}\n />\n \n \n \n
\n )}\n
\n
\n );\n};\n\nexport default EmailTemplateEdit;\n","import { PaperClipOutlined } from \"@ant-design/icons\";\nimport { CXCol } from \"component/Col\";\nimport { CXInput } from \"component/Input\";\nimport { CXRow } from \"component/Row\";\nimport { CXSelect } from \"component/Select\";\nimport { CXTag } from \"component/Tag\";\nimport React, { useState } from \"react\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { generateUniqueKey } from \"utils\";\n\nconst PreviewTemplate = ({ data }) => {\n const [options, setOptions] = useState(null);\n return (\n \n
\n \n
\n \n To :\n
\n }\n />\n
\n
\n 0 ? \"blue\" : \"default\"}>\n Cc\n \n
\n
\n 0 ? \"blue\" : \"default\"}>\n Bcc\n \n
\n
\n
\n \n {data?.cc?.length > 0 && (\n \n Cc :\n \n \n {options}\n \n \n \n )}\n {data?.bcc?.length > 0 && (\n \n Bcc :\n \n \n {options}\n \n \n \n )}\n \n Subject :}\n defaultValue={data?.subject}\n />\n \n
\n {ReactHtmlParser(data?.text)}\n
\n {data?.attachments?.length > 0 && (\n
\n {data?.attachments?.map((res) => {\n return (\n \n );\n })}\n
\n )}\n \n \n );\n};\n\nexport default PreviewTemplate;\n","import { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport SettingsSideBar from \"../Common/LeftSideBar\";\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { CXTitle } from \"component/Typography\";\nimport \"./style.css\";\nimport { CXButton } from \"component/Button\";\nimport history from \"utils/history\";\nimport { CXEmpty } from \"component/Empty\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n deleteEmailTemplate,\n getEmailTemplatesTrigger,\n} from \"action/TemplateAction\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { EyeOutlined, MailOutlined } from \"@ant-design/icons\";\nimport { CXLottie } from \"component/Lottie\";\nimport { PermissionCheck, truncateSt } from \"utils\";\nimport { CXTable } from \"component/Table\";\nimport { CXInput } from \"component/Input\";\nimport { CXPopover } from \"component/Popover\";\nimport ViewTemplate from \"screen/UserPortal/Campaigns/Helper/ViewTemplate\";\nimport PreviewTemplate from \"./PreviewTemplate\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nconst Index = () => {\n const dispatch = useDispatch();\n const { EmailTemplates, loading } = useSelector(\n (state) => state.TemplateReducer\n );\n const { user } = useSelector((state) => state.dittoAdminReducer);\n useEffect(() => {\n dispatch(getEmailTemplatesTrigger());\n dispatch(getAgentsActionTrigger());\n }, []);\n const DeleteEmailTemplate = (e, id) => {\n dispatch(deleteEmailTemplate(id));\n e.stopPropagation();\n };\n const columns = [\n {\n title: \"Title\",\n dataIndex: \"title\",\n key: \"title\",\n render: (text) => {truncateSt(text, 50)},\n },\n {\n title: \"Subject\",\n dataIndex: \"subject\",\n key: \"subject\",\n render: (text) => {truncateSt(text, 50)},\n },\n {\n title: \"Action\",\n dataIndex: \"action\",\n key: \"action\",\n render: (text, record) => (\n
\n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n \n history.push(\n `/admin/knowledge-base/email-template/update/${record.key}`\n )\n }\n alt=\"edit\"\n />\n )}\n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n DeleteEmailTemplate(e, record.key)}\n alt=\"delete\"\n />\n )}\n \n \n
\n }\n >\n \n \n \n ),\n },\n ];\n const [datatable, setddatatable] = useState([]);\n useEffect(() => {\n if (EmailTemplates?.data?.length > 0) {\n let data = [];\n EmailTemplates?.data?.map((res) => {\n data.push({\n key: res._id,\n subject: res.subject,\n text: res.text,\n data: res,\n title: res.title,\n });\n });\n setddatatable(data);\n }\n }, [EmailTemplates]);\n const handleSearch = (value) => {};\n return (\n \n \n \n \n \n \n \n Email Templates\n \n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n {\n history.push(\"/admin/knowledge-base/email-template/create\");\n dispatch({ type: \"EMAIL_SUBJECT\", data: \"\" });\n }}\n >\n Create\n \n )}\n \n\n \n handleSearch(e.target.value)}\n />\n {EmailTemplates?.data?.length === 0 && !loading && }\n {loading && }\n
\n {!loading && (\n \n )}\n
\n
\n
\n
\n
\n
\n );\n};\n\nexport default Index;\n","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgOpen(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n fill: \"#000000\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 72 72\",\n width: \"64px\",\n height: \"64px\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M 43 12 C 40.791 12 39 13.791 39 16 C 39 18.209 40.791 20 43 20 L 46.34375 20 L 35.171875 31.171875 C 33.609875 32.733875 33.609875 35.266125 35.171875 36.828125 C 35.951875 37.608125 36.977 38 38 38 C 39.023 38 40.048125 37.608125 40.828125 36.828125 L 52 25.65625 L 52 29 C 52 31.209 53.791 33 56 33 C 58.209 33 60 31.209 60 29 L 60 16 C 60 13.791 58.209 12 56 12 L 43 12 z M 23 14 C 18.037 14 14 18.038 14 23 L 14 49 C 14 53.962 18.037 58 23 58 L 49 58 C 53.963 58 58 53.962 58 49 L 58 41 C 58 38.791 56.209 37 54 37 C 51.791 37 50 38.791 50 41 L 50 49 C 50 49.551 49.552 50 49 50 L 23 50 C 22.448 50 22 49.551 22 49 L 22 23 C 22 22.449 22.448 22 23 22 L 31 22 C 33.209 22 35 20.209 35 18 C 35 15.791 33.209 14 31 14 L 23 14 z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgOpen);\nexport default __webpack_public_path__ + \"static/media/open.a4f970f597c559a3fcae1bdc6fb93dea.svg\";\nexport { ForwardRef as ReactComponent };","import React from \"react\";\nimport { ReactComponent as Open } from \"./open.svg\";\nimport ReactHtmlParser from \"react-html-parser\";\n\nconst PreviewTemplate = ({ className, QuickBtn, content }) => {\n return (\n
\n
Preview
\n \n
\n
{ReactHtmlParser(content?.body)}
\n
\n
\n {QuickBtn?.map((item, index) => {\n return (\n
\n {\" \"}\n {item?.text?.length > 0 ? item?.text : `Button text`}\n
\n );\n })}\n
\n
\n \n );\n};\n\nexport default PreviewTemplate;\n","import { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport React, { useEffect, useState } from \"react\";\nimport SettingsSideBar from \"../Common/LeftSideBar\";\nimport { CXInput } from \"component/Input\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport {\n CXMarkdownTemplateEditor,\n CXMarkdownTemplateEditorMention,\n} from \"component/MarkdownEditor\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n createSmsTemplate,\n getSmsTemplateById,\n getTemplateVariables,\n updateSmsTemplate,\n} from \"action/TemplateAction\";\nimport { CXTag } from \"component/Tag\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\nimport { extractVariables } from \"utils\";\nimport PreviewTemplate from \"./PreviewTemplate\";\nimport history from \"utils/history\";\nimport { notification } from \"antd\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXLottie } from \"component/Lottie\";\nimport { debounce } from \"lodash\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst SmsTemplateCreate = () => {\n const dispatch = useDispatch();\n const { id } = useParams();\n const {\n templateVariables,\n smsTemplateLoading,\n smsTemplates,\n fetchingTemplates,\n } = useSelector((state) => state.TemplateReducer);\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n const [TemplateName, setTemplateName] = useState(\"\");\n const [ButtonsType, setButtonsType] = useState(\"none\");\n const [QuickBtn, setQuickBtn] = useState([]);\n const [expectedIntents, setexpectedIntents] = useState([]);\n const [expectYesNo, setexpectYesNo] = useState(false);\n function stripHtml(html) {\n let doc = new DOMParser().parseFromString(html, \"text/html\");\n return doc.body.textContent || \"\";\n }\n const createActiionBtn = () => {\n ButtonsType === \"QUICK_REPLY\" &&\n QuickBtn?.length < 3 &&\n setQuickBtn([\n ...QuickBtn,\n { type: \"QUICK_REPLY\", text: \"\", value: \"\", intent: \"\" },\n ]);\n };\n useEffect(() => {\n dispatch(getTemplateVariables());\n dispatch(getAccountintents());\n }, []);\n const [data, setdata] = useState({\n body: \"\",\n variable: [],\n });\n\n const creatTemplate = () => {\n if (!TemplateName || !data.body) {\n return notification.error({\n message: \"Please fill all the required fields\",\n });\n }\n let temp = {};\n temp.name = TemplateName;\n temp.text = stripHtml(data.body);\n temp.html = data.body;\n temp.variables = data.variable.flatMap(Object.keys);\n temp.buttons = QuickBtn;\n temp.expectedIntents = expectedIntents;\n temp.expectYesNo = expectYesNo;\n\n if (id) {\n dispatch(updateSmsTemplate(id, temp));\n } else {\n dispatch(createSmsTemplate(temp));\n }\n };\n\n useEffect(() => {\n if (id) {\n dispatch(getSmsTemplateById(id));\n }\n }, [id]);\n\n useEffect(() => {\n if (smsTemplates?.data?.name) {\n setQuickBtn(smsTemplates?.data?.buttons);\n setTemplateName(smsTemplates?.data?.name);\n setdata({\n body: smsTemplates?.data?.html,\n variable: smsTemplates?.data.variables?.map((res) => {\n return {\n [res]: \"\",\n };\n }),\n });\n setexpectedIntents(smsTemplates?.data?.expectedIntents);\n setexpectYesNo(smsTemplates?.data?.expectYesNo);\n if (smsTemplates?.data?.buttons?.length > 0) {\n setButtonsType(\"QUICK_REPLY\");\n }\n }\n }, [smsTemplates]);\n\n const modalChangeDebounce = (d) => {\n let v = extractVariables(d);\n let uV = v.map((res) => {\n return {\n [res]: (() => {\n let l = data.variable.find((obj) => Object.keys(obj)[0] === res);\n if (l) {\n return Object.values(l)[0];\n } else {\n return \"\";\n }\n })(),\n };\n });\n let temp = { ...data };\n temp.variable = uV;\n temp.body = d;\n setdata(temp);\n };\n const debouncedModalChange = debounce(modalChangeDebounce, 500);\n return (\n \n \n \n \n \n \n {id ? `Update` : `Create`} Template\n \n
\n \n history.push(\"/admin/knowledge-base/sms-template\")\n }\n >\n Cancel\n \n creatTemplate()}>\n {id ? `Update` : `Submit`}\n \n
\n
\n {smsTemplateLoading && (\n \n )}\n {!smsTemplateLoading && (\n
\n {\" \"}\n
\n {\" \"}\n
\n
\n Template Name{\" \"}\n \n *\n \n
\n
\n The message template name can only have lowercase letters\n and underscores.\n
\n {\n setTemplateName(\n e.target.value.replace(/\\s/g, \"_\").toLowerCase()\n );\n }}\n />\n
\n Intent *\n
\n
\n Select the intent of the message template.\n
\n {\n setexpectedIntents([val]);\n }}\n >\n {AccountIntents?.map((res) => {\n return {res.name};\n })}\n \n
\n
\n Expect Yes / No response to this template\n
\n
\n {\n setexpectYesNo(val);\n }}\n />\n
\n
\n
\n \n
\n Body{\" \"}\n \n *\n \n
\n
\n Enter the text for your message in the language that you've\n selected.\n
\n \n {/*
\n
Add Variable
\n
\n {templateVariables?.data?.map((item, index) => {\n return (\n {\n let temp = { ...data };\n temp.variable.push({ [item.name]: \"\" });\n temp.body =\n data.body +\n `{{${item.name}}}`;\n setdata(temp);\n }}\n >\n {item.name}\n \n );\n })}\n
\n
*/}\n {!fetchingTemplates && (\n {\n debouncedModalChange(d);\n // let v = extractVariables(d);\n // let uV = v.map((res) => {\n // return {\n // [res]: (() => {\n // let l = data.variable.find(\n // (obj) => Object.keys(obj)[0] === res\n // );\n // if (l) {\n // return Object.values(l)[0];\n // } else {\n // return \"\";\n // }\n // })(),\n // };\n // });\n // let temp = { ...data };\n // temp.variable = uV;\n // temp.body = d;\n // setdata(temp);\n }}\n onBlur={(d) => {\n // let v = extractVariables(d);\n // let uV = v.map((res) => {\n // return {\n // [res]: (() => {\n // let l = data.variable.find(\n // (obj) => Object.keys(obj)[0] === res\n // );\n // if (l) {\n // return Object.values(l)[0];\n // } else {\n // return \"\";\n // }\n // })(),\n // };\n // });\n // let temp = { ...data };\n // temp.variable = uV;\n // temp.body = d;\n // setdata(temp);\n }}\n data={data.body ?? \"\"}\n variableData={\n templateVariables?.data?.map((res) => {\n return {\n id: `{{${res.name}}}`,\n };\n }) ?? []\n }\n />\n )}\n {fetchingTemplates && (\n \n )}\n
\n \n
\n Buttons Optional\n
\n
\n {`Create up to ${\n ButtonsType === \"CTA\" ? 2 : 3\n } buttons that let customers respond to your\n message or take action.`}\n
\n {\n setButtonsType(val);\n setQuickBtn([]);\n }}\n >\n None\n Quick reply\n \n {ButtonsType !== \"none\" && (\n
\n {ButtonsType === \"QUICK_REPLY\" && (\n
\n {QuickBtn?.map((item, index) => {\n return (\n
\n
\n
Text
\n {\n QuickBtn[index].text = e.target.value;\n QuickBtn[index].value = e.target.value;\n setQuickBtn([...QuickBtn]);\n }}\n />\n
\n
\n
Intent
\n {\n QuickBtn[index].intent = val;\n setQuickBtn([...QuickBtn]);\n }}\n value={item.intent}\n >\n {AccountIntents?.map((res) => {\n return (\n \n {res.name}\n \n );\n })}\n \n
\n\n
\n {\n QuickBtn.splice(index, 1);\n setQuickBtn([...QuickBtn]);\n }}\n alt=\"delete\"\n />\n
\n
\n );\n })}\n
\n )}\n createActiionBtn()}\n >\n Add button\n \n
\n )}\n \n \n
\n \n
\n
\n )}\n
\n
\n
\n );\n};\n\nexport default SmsTemplateCreate;\n","import { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport React, { useEffect, useState } from \"react\";\nimport SettingsSideBar from \"../Common/LeftSideBar\";\nimport { CXTitle } from \"component/Typography\";\nimport { PermissionCheck } from \"utils\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nimport history from \"utils/history\";\nimport { deleteSmsTemplate, getSmsTemplates } from \"action/TemplateAction\";\nimport { CXTable } from \"component/Table\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXInput } from \"component/Input\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { CXEmpty } from \"component/Empty\";\n\nconst Index = () => {\n const dispatch = useDispatch();\n const { smsTemplates, smsTemplateLoading } = useSelector(\n (state) => state.TemplateReducer\n );\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const [datatable, setddatatable] = useState([]);\n useEffect(() => {\n dispatch(getSmsTemplates());\n }, []);\n\n useEffect(() => {\n if (smsTemplates?.data?.length > 0) {\n let data = smsTemplates?.data?.map((info, index) => {\n return {\n key: index + 1,\n id: info._id,\n name: info.name,\n html: info.html,\n };\n });\n setddatatable(data);\n }\n }, [smsTemplates]);\n\n const columns = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n key: \"name\",\n },\n {\n title: \"message\",\n dataIndex: \"html\",\n key: \"html\",\n render: (text, record) =>
{ReactHtmlParser(record.html)}
,\n },\n {\n title: \"Action\",\n dataIndex: \"action\",\n key: \"action\",\n render: (text, record) => (\n
\n {!PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"EditTemplate\"\n ) && (\n \n history.push(\n `/admin/knowledge-base/sms-template/edit/${record.id}`\n )\n }\n alt=\"edit\"\n />\n )}\n dispatch(deleteSmsTemplate(record.id))}\n alt=\"delete\"\n />\n
\n ),\n },\n ];\n return (\n \n \n \n \n \n \n \n Sms Templates\n \n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n {\n history.push(\"/admin/knowledge-base/sms-template/create\");\n }}\n >\n Create\n \n )}\n \n \n handleSearch(e.target.value)}\n />\n {smsTemplates?.data?.length > 0 && !smsTemplateLoading && (\n
\n \n
\n )}\n {smsTemplateLoading && (\n \n )}\n {datatable?.length === 0 && !smsTemplateLoading && (\n
{}
\n )}\n
\n
\n
\n
\n
\n );\n};\n\nexport default Index;\n","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgOpen(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n fill: \"#000000\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 72 72\",\n width: \"64px\",\n height: \"64px\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M 43 12 C 40.791 12 39 13.791 39 16 C 39 18.209 40.791 20 43 20 L 46.34375 20 L 35.171875 31.171875 C 33.609875 32.733875 33.609875 35.266125 35.171875 36.828125 C 35.951875 37.608125 36.977 38 38 38 C 39.023 38 40.048125 37.608125 40.828125 36.828125 L 52 25.65625 L 52 29 C 52 31.209 53.791 33 56 33 C 58.209 33 60 31.209 60 29 L 60 16 C 60 13.791 58.209 12 56 12 L 43 12 z M 23 14 C 18.037 14 14 18.038 14 23 L 14 49 C 14 53.962 18.037 58 23 58 L 49 58 C 53.963 58 58 53.962 58 49 L 58 41 C 58 38.791 56.209 37 54 37 C 51.791 37 50 38.791 50 41 L 50 49 C 50 49.551 49.552 50 49 50 L 23 50 C 22.448 50 22 49.551 22 49 L 22 23 C 22 22.449 22.448 22 23 22 L 31 22 C 33.209 22 35 20.209 35 18 C 35 15.791 33.209 14 31 14 L 23 14 z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgOpen);\nexport default __webpack_public_path__ + \"static/media/open.a4f970f597c559a3fcae1bdc6fb93dea.svg\";\nexport { ForwardRef as ReactComponent };","import {\n FileImageOutlined,\n PlaySquareOutlined,\n ProfileOutlined,\n} from \"@ant-design/icons\";\nimport { ReactComponent as Open } from \"./open.svg\";\nimport React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { CXInput } from \"component/Input\";\n\nconst Preview = ({\n className,\n footer,\n ButtonsType,\n ActionBtn,\n QuickBtn,\n body,\n file,\n LanguageSet,\n importHeader,\n urlHandler,\n}) => {\n let renderHead = {\n image: (\n \n ),\n video: (\n \n ),\n document: (\n \n ),\n };\n const variableRender = () => {\n let bodyString = body;\n let variableArray = LanguageSet?.variable;\n if (variableArray?.length > 0) {\n variableArray?.forEach((item) => {\n let variable = Object.keys(item)[0];\n let value = Object.values(item)[0];\n bodyString = bodyString.replace(\n new RegExp(`{{${variable}}}`, \"g\"),\n `**${value}**`\n );\n });\n }\n return bodyString;\n };\n const checkfile = () => {\n if (LanguageSet?.header?.link?.length > 0) {\n let ext = LanguageSet?.header?.link.split(\".\").pop();\n if ([\"jpeg\", \"png\", \"mp4\", \"jpg\"].includes(ext)) {\n return true;\n } else {\n return false;\n }\n }\n if (importHeader) {\n let ext = importHeader.split(\".\").pop();\n if ([\"jpeg\", \"png\", \"mp4\", \"jpg\"].includes(ext)) {\n return true;\n } else {\n return false;\n }\n }\n };\n\n return (\n <>\n
Preview
\n \n
\n {importHeader && checkfile(importHeader) && (\n
\n \n
\n )}\n {(LanguageSet?.header?.link?.length === 0 ||\n !checkfile(LanguageSet?.header?.link)) && (\n
\n {renderHead[LanguageSet?.header?.type]}\n
\n )}\n {LanguageSet?.header?.link?.length > 0 &&\n checkfile(LanguageSet?.header?.link) &&\n LanguageSet?.header?.type === \"image\" && (\n
\n \n
\n )}\n {LanguageSet?.header?.link?.length > 0 &&\n LanguageSet?.header?.type === \"video\" && (\n \n )}\n {LanguageSet?.header?.link?.length > 0 &&\n LanguageSet?.header?.type === \"document\" && (\n
\n {renderHead[LanguageSet?.header?.type]}\n
\n )}\n
\n \n
\n
{footer}
\n
\n
\n {ButtonsType !== \"none\" && (\n
\n {ButtonsType === \"CTA\" && (\n
\n {ActionBtn?.map((item, index) => {\n return (\n
\n \n {item?.text?.length > 0 ? item?.text : `Button text`}\n
\n );\n })}\n
\n )}\n {ButtonsType === \"QUICK_REPLY\" && (\n
\n {QuickBtn?.map((item, index) => {\n return (\n
\n {\" \"}\n {item?.text?.length > 0 ? item?.text : `Button text`}\n
\n );\n })}\n
\n )}\n
\n )}\n
\n \n \n );\n};\n\nexport default Preview;\n","// This icon file is generated automatically.\nvar BellOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z\" } }] }, \"name\": \"bell\", \"theme\": \"outlined\" };\nexport default BellOutlined;\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 BellOutlinedSvg from \"@ant-design/icons-svg/es/asn/BellOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar BellOutlined = function BellOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: BellOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(BellOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'BellOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar LockOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z\" } }] }, \"name\": \"lock\", \"theme\": \"outlined\" };\nexport default LockOutlined;\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 LockOutlinedSvg from \"@ant-design/icons-svg/es/asn/LockOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LockOutlined = function LockOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LockOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(LockOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LockOutlined';\n}\nexport default RefIcon;","import { BellOutlined, GlobalOutlined, LockOutlined } from \"@ant-design/icons\";\nimport { CXInput } from \"component/Input\";\nimport { CXRadio, CXRadioGroup, CXSpace } from \"component/Radio\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTagRender } from \"component/Tag\";\nimport React, { Fragment, memo, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { languageOptions } from \"../../../../../utils/languageList\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst NewTemplate = ({ stepOne, setstepOne }) => {\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n useEffect(() => {\n dispatch(getAccountintents());\n }, []);\n return (\n \n
\n
Account *
\n
Choose a whatsapp account
\n {\n stepOne.caid = val;\n setstepOne({ ...stepOne });\n }}\n className=\"SelectType\"\n showArrow\n style={{ width: \"100%\" }}\n >\n {allConfigData?.map((item) => {\n if (item.md === \"whatsapp\") {\n return (\n \n {item?.configWp?.name}\n \n );\n }\n })}\n \n
\n
\n
Category *
\n
Choose a messsage template
\n {\n stepOne.category = e.target.value;\n setstepOne({ ...stepOne });\n }}\n >\n \n \n
\n
\n \n
\n
\n
Marketing
\n
\n Send promotions or information about your products, services\n or business.\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
Utility
\n
\n Send messages about an existing order or account.\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
Authentication
\n
\n Send codes to verify a transaction or login.\n
\n
\n
\n
\n
\n \n
\n
\n
Template Name *
\n
\n The message template name can only have lowercase letters and\n underscores.\n
\n {\n stepOne.name = e.target.value.replace(/\\s/g, \"_\").toLowerCase();\n setstepOne({ ...stepOne });\n }}\n />\n
Intent *
\n
\n Select the intent of the message template.\n
\n {\n stepOne.expectedIntents = [val];\n setstepOne({ ...stepOne });\n }}\n >\n {AccountIntents?.map((res) => {\n return {res.name};\n })}\n \n
\n
\n Expect Yes / No response to this template\n
\n
\n {\n stepOne.expectYesNo = val;\n setstepOne({ ...stepOne });\n }}\n />\n
\n
\n
\n
\n
Language *
\n
\n Choose language for your message template. you can delete or add more\n later{\" \"}\n
\n {\n stepOne.language = val;\n setstepOne({ ...stepOne });\n }}\n className=\"SelectType\"\n mode=\"multiple\"\n showArrow\n style={{ width: \"100%\" }}\n tagRender={CXTagRender}\n options={languageOptions}\n />\n
\n
\n \n );\n};\n\nexport default memo(NewTemplate);\n","import { CXInput } from \"component/Input\";\nimport { postFormData } from \"helper/networkClient\";\nimport React, { Fragment, useState } from \"react\";\nimport { extractVariables, getBase64 } from \"utils\";\nimport Preview from \"./Preview\";\nimport { CXLottie } from \"component/Lottie\";\nimport CXUpload from \"component/Upload\";\nimport { CXButton } from \"component/Button\";\nimport { UploadOutlined } from \"@ant-design/icons\";\n\nconst SampleModal = ({\n stepOne,\n ButtonsType,\n ActionBtn,\n QuickBtn,\n footer,\n body,\n file,\n setFile,\n LanguageSet,\n setLanguageSet,\n VariableBtn,\n headerCh,\n ActiveLanguage,\n view,\n variablesUsed,\n}) => {\n const [FileValid, setFileValid] = useState(true);\n const [Uploading, setUploading] = useState(false);\n const urlHandler = async (file) => {\n if (\n file?.type !== \"image/jpeg\" &&\n file?.type !== \"image/png\" &&\n file?.type !== \"image/jpg\" &&\n file?.type !== \"video/mp4\" &&\n file?.type !== \"application/pdf\"\n ) {\n return setFileValid(false);\n }\n setFileValid(true);\n file.preview = await getBase64(file);\n if (!file?.url && !file?.preview) {\n file.preview = await getBase64(file);\n }\n const formData = new FormData();\n formData?.append(\"file\", file);\n formData?.append(\"caid\", stepOne?.caid);\n setUploading(true);\n await postFormData(\"/file/template\", formData)\n .then((resp) => {\n if (resp.status === 200) {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage].data.header.link =\n resp?.data?.data?.url;\n newLanguageSet[ActiveLanguage].data.header.sampleLink =\n resp?.data?.data?.fileHandle;\n setLanguageSet([...newLanguageSet]);\n setUploading(false);\n } else {\n setUploading(false);\n }\n })\n .catch((err) => {\n setUploading(false);\n });\n };\n // Function to check if a variable is in the body\n // const checkVariableInBody = (Variable) => {\n // return variablesUsed.includes(`${Variable.name}`);\n // // if (body?.includes(`{{${Variable.name}}}`)) {\n // // return true;\n // // } else {\n // // return false;\n // // }\n // };\n // Function to check if any varibale from array is present in body or not\n const checkVariableInBodyArray = (VariableBtn) => {\n let flag = false;\n VariableBtn?.forEach((item) => {\n if (body?.includes(`{{${item.name}}}`)) {\n flag = true;\n }\n });\n return flag;\n };\n return (\n \n \n
\n
Add sample content
\n
\n
\n To help us understand what kind of message that you want to send,\n you have the option to provide specific content examples for your\n template. You can add a sample template for one or all languages\n that you are submitting. Make sure that you don't include any\n actual user or customer information, and only provide sample\n content in your examples.\n
\n {headerCh === \"media\" && (\n
\n
\n Header{\" \"}\n ( jpeg / png / mp4 / pdf )*\n
\n {/* urlHandler(e.target.files[0])}\n /> */}\n
\n \n \n \n Click here to select file\n \n \n
\n\n {!FileValid && (\n \n Only jpeg/png/mp4/pdf file type are Supported.\n \n )}\n {Uploading && (\n
\n \n
\n \n file uploading please wait ...\n \n
\n
\n )}\n
\n )}\n
\n {checkVariableInBodyArray(VariableBtn) && (\n
\n Add sample values for variables\n
\n )}\n
\n {extractVariables(body)?.map((item, index) => {\n let vl =\n LanguageSet[ActiveLanguage]?.data?.variable?.find(\n (obj) => Object?.keys(obj)[0] === item\n )?.[item] ?? \"\";\n return (\n {\n // Find the index of the variable in the array\n const index = LanguageSet[\n ActiveLanguage\n ].data?.variable?.findIndex(\n (obj) => Object?.keys(obj)[0] === item\n );\n // If the variable isn't already in the array, add it\n if (index === -1) {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage].data.variable = [\n ...LanguageSet[ActiveLanguage]?.data?.variable,\n {\n [item]: e.target.value,\n },\n ];\n setLanguageSet([...newLanguageSet]);\n }\n // If the variable is already in the array, update it\n if (index !== -1) {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage].data.variable = [\n ...LanguageSet[\n ActiveLanguage\n ]?.data?.variable?.slice(0, index),\n {\n [item]: e.target.value,\n },\n ...LanguageSet[\n ActiveLanguage\n ]?.data?.variable?.slice(index + 1),\n ];\n setLanguageSet([...newLanguageSet]);\n }\n }}\n />\n );\n // }\n })}\n
\n
\n {footer?.length > 0 && (\n
\n
Footer
\n {footer}\n
\n )}\n
\n {ButtonsType !== \"none\" && (\n
\n {LanguageSet[ActiveLanguage]?.data?.action?.length > 0 && (\n
Buttons
\n )}\n {ButtonsType === \"CTA\" && (\n
\n {ActionBtn?.map((item, index) => {\n return (\n
\n {item?.text.length > 0 ? item?.text : `Button text`}\n
\n );\n })}\n
\n )}\n {ButtonsType === \"QUICK_REPLY\" && (\n
\n {QuickBtn?.map((item, index) => {\n return (\n
\n {item?.text.length > 0 ? item?.text : `Button text`}\n
\n );\n })}\n
\n )}\n
\n )}\n
\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default SampleModal;\n","import {\n FileImageOutlined,\n PlaySquareOutlined,\n ProfileOutlined,\n} from \"@ant-design/icons\";\nimport {\n createTemplateActionTrigger,\n getTemplateVariables,\n updateWhatsAppTemplate,\n updateWaIntentAction,\n} from \"action/TemplateAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXContent, CXHeader } from \"component/Layout\";\nimport { CXMarkdownTemplateEditor } from \"component/MarkdownEditor\";\nimport { CXModal } from \"component/Modal\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTag } from \"component/Tag\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport Preview from \"./Preview\";\nimport SampleModal from \"./SampleModal\";\nimport { notification } from \"antd\";\nimport Input from \"react-phone-number-input/input\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { extractVariables } from \"utils\";\nimport {\n PUT_WHATSAPP_TEMPLATE_ERROR,\n PUT_WHATSAPP_TEMPLATE_RESPONSE,\n} from \"constant\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Form } from \"antd\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\n\nconst EditTemplate = ({\n ActiveLanguage,\n LanguageSet,\n setLanguageSet,\n stepOne = null,\n view = false,\n}) => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const { action, createTemplateRep, templateVariables } = useSelector(\n (state) => state.TemplateReducer\n );\n const [form] = Form.useForm();\n const [headerCh, setheaderCh] = useState(\"none\");\n const [ButtonsType, setButtonsType] = useState(\"none\");\n const [ActionBtn, setActionBtn] = useState([]);\n const [QuickBtn, setQuickBtn] = useState([]);\n const [showModal, setshowModal] = useState(false);\n const [file, setFile] = useState(null);\n const [submitTemplate, setSubmitTemplate] = useState(false);\n const [bodyVariables, setBodyVariables] = useState([]);\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n const [showIntentModal, setshowIntentModal] = useState(false);\n\n const createActiionBtn = () => {\n ButtonsType === \"CTA\" &&\n ActionBtn?.length < 2 &&\n setActionBtn([\n ...ActionBtn,\n { type: \"URL\", text: \"\", payload: \"\", btnType: \"static\" },\n ]);\n ButtonsType === \"QUICK_REPLY\" &&\n QuickBtn?.length < 3 &&\n setQuickBtn([...QuickBtn, { type: \"QUICK_REPLY\", text: \"\", intent: \"\" }]);\n };\n useEffect(() => {\n dispatch(getTemplateVariables());\n dispatch(getAccountintents());\n }, []);\n\n useEffect(() => {\n if (QuickBtn?.length > 0 && !view) {\n if (LanguageSet[ActiveLanguage]?.data) {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage].data.action = QuickBtn;\n setLanguageSet(newLanguageSet);\n }\n } else {\n if (!view && LanguageSet[ActiveLanguage]?.data && ActionBtn?.length > 0) {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage].data.action = ActionBtn;\n setLanguageSet(newLanguageSet);\n }\n }\n }, [QuickBtn, ActionBtn]);\n\n useEffect(() => {\n switch (action) {\n case \"CREATE_TEMPLATES_ACTION_RESPONSE\":\n // find the language and update the data\n const {\n caid,\n category,\n createdAt,\n createdBy,\n exampleVariable,\n md,\n metaStatus,\n name,\n status,\n tenantId,\n updatedAt,\n language,\n __v,\n ...rest\n } = createTemplateRep.data;\n rest.variable = exampleVariable;\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage].data,\n ...rest,\n },\n };\n setLanguageSet(newLanguageSet);\n setSubmitTemplate(false);\n break;\n case \"CREATE_TEMPLATES_ACTION_ERROR\":\n setSubmitTemplate(false);\n break;\n case PUT_WHATSAPP_TEMPLATE_RESPONSE:\n case PUT_WHATSAPP_TEMPLATE_ERROR:\n setSubmitTemplate(false);\n break;\n default:\n break;\n }\n }, [action, createTemplateRep]);\n\n const onSubmit = () => {\n if (stepOne?.expectedIntents?.length === 0) {\n notification.error({\n message: \"Intent need to be selected for this template\",\n });\n }\n let obj = { ...stepOne, ...LanguageSet[ActiveLanguage]?.data };\n obj.language = LanguageSet[ActiveLanguage].language;\n obj.md = \"whatsapp\";\n obj.exampleVariable = obj.variable;\n obj.variable = obj?.variable?.map((item) => {\n let key = Object.keys(item)[0];\n return { name: key };\n });\n //obj.name = obj.name;\n headerCh === \"none\" && delete obj.header;\n if (obj?.body?.length > 0) {\n const uniqueVariables = extractVariables(obj.body);\n setBodyVariables(uniqueVariables);\n const hasNoEmptyValues = obj.exampleVariable.every((item) =>\n Object.values(item).every((value) => value.length > 0)\n );\n if (\n obj?.variable?.length !== uniqueVariables?.length ||\n !hasNoEmptyValues\n ) {\n notification.error({\n message:\n \"Variable length mismatch. Please check if you have added samples to all variables.\",\n });\n } else if (\n obj?.header?.type?.length > 0 &&\n obj.header?.link?.length === 0\n ) {\n notification.error({\n message: \"Please add Sample\",\n });\n } else {\n if (obj._id) {\n dispatch(updateWhatsAppTemplate(obj));\n } else {\n dispatch(createTemplateActionTrigger(obj));\n }\n setSubmitTemplate(true);\n }\n } else {\n notification.error({\n message: \"Please add body\",\n });\n }\n };\n // can add more variable will reflect globally\n useEffect(() => {\n setheaderCh(\n LanguageSet[ActiveLanguage]?.data?.header?.type?.length > 0\n ? \"media\"\n : \"none\"\n );\n setButtonsType(LanguageSet[ActiveLanguage]?.data?.actionType);\n if (LanguageSet[ActiveLanguage]?.data?.actionType === \"CTA\") {\n setActionBtn(LanguageSet[ActiveLanguage]?.data?.action);\n }\n if (LanguageSet[ActiveLanguage]?.data?.actionType === \"QUICK_REPLY\")\n setQuickBtn(LanguageSet[ActiveLanguage]?.data?.action);\n const uniqueVariables = extractVariables(\n LanguageSet[ActiveLanguage]?.data?.body\n );\n setBodyVariables(uniqueVariables ?? []);\n }, [ActiveLanguage]);\n\n const changeMediaLink = (obj) => {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage].data,\n header: {\n ...newLanguageSet[ActiveLanguage].data.header,\n ...obj,\n },\n },\n };\n setLanguageSet(newLanguageSet);\n };\n\n const updateWaIntent = (val) => {\n let obj = {\n _id: id,\n expectYesNo: val.expectYesNo ?? stepOne?.expectYesNo ?? false,\n expectedIntents: [val.expectedIntents] ?? stepOne?.expectedIntents ?? [],\n };\n dispatch(updateWaIntentAction({ obj }));\n setshowIntentModal(false);\n };\n return (\n \n
\n
\n \n \n
\n {\n setshowIntentModal(true);\n }}\n >\n Update Intent\n \n {\n setshowModal(true);\n }}\n >\n {view ? `View Sample` : `Add Sample`}\n \n {!view && (\n onSubmit()}\n loading={submitTemplate}\n >\n Submit\n \n )}\n
\n
\n \n {/*
Intent *
\n
\n Select the intent of the message template.\n
\n {\n stepOne.expectedIntents = [val];\n setstepOne({ ...stepOne });\n }}\n >\n {AccountIntents?.map((res) => {\n return {res?.name};\n })}\n \n
\n
\n Expect Yes / No response to this template\n
\n
\n {\n stepOne.expectYesNo = val;\n setstepOne({ ...stepOne });\n }}\n />\n
\n
*/}\n
\n Header {headerCh === \"none\" && Optional}\n
\n
\n Add a title or choose which type of media you'll use for this\n header.\n
\n 0 &&\n LanguageSet[ActiveLanguage]?.data?.header?.type?.length > 0\n ? \"media\"\n : \"none\"\n }\n onChange={(val) => {\n if (val === \"media\") {\n changeMediaLink({ type: \"image\" });\n } else {\n changeMediaLink({ type: \"\", link: \"\" });\n }\n setheaderCh(val);\n }}\n >\n None\n Media\n \n {headerCh === \"media\" && (\n
\n changeMediaLink({ type: \"image\" })}\n >\n \n
Image
\n
\n {\n changeMediaLink({ type: \"video\" });\n }}\n >\n \n
Video
\n \n {\n changeMediaLink({ type: \"document\" });\n }}\n >\n \n
Document
\n \n \n )}\n \n \n
Body
\n
\n Enter the text for your message in the language that you've\n selected.\n
\n \n
\n
Add Variable
\n
\n {templateVariables?.data?.map((item, index) => {\n return (\n {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage].data,\n body:\n newLanguageSet[ActiveLanguage].data.body +\n ` {{${item?.name}}} `,\n },\n };\n setLanguageSet(newLanguageSet);\n }}\n >\n {item.name}\n \n );\n })}\n
\n
\n {}}\n onBlur={(data) => {\n let v = extractVariables(data);\n setBodyVariables(v);\n let newLanguageSet = [...LanguageSet];\n let uV = v.map((res) => {\n return {\n [res]: (() => {\n let l = newLanguageSet[\n ActiveLanguage\n ]?.data.variable.find(\n (obj) => Object.keys(obj)[0] === res\n );\n if (l) {\n return Object.values(l)[0];\n } else {\n return \"\";\n }\n })(),\n };\n });\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage]?.data,\n body: data,\n variable: uV,\n },\n };\n setLanguageSet(newLanguageSet);\n }}\n />\n \n \n
\n Footer Optional\n
\n
\n Add a short line of text to the bottom of your message template.\n If you add the marketing opt-out button, the associated footer\n will be shown here by default.\n
\n {\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage].data,\n footer: e.target.value,\n },\n };\n setLanguageSet(newLanguageSet);\n }}\n />\n \n \n
\n Buttons Optional\n
\n
\n {`Create up to ${\n ButtonsType === \"CTA\" ? 2 : 3\n } buttons that let customers respond to your\n message or take action.`}\n
\n {\n setButtonsType(val);\n setActionBtn([]);\n setQuickBtn([]);\n let newLanguageSet = [...LanguageSet];\n newLanguageSet[ActiveLanguage] = {\n ...newLanguageSet[ActiveLanguage],\n data: {\n ...newLanguageSet[ActiveLanguage].data,\n actionType: val,\n },\n };\n setLanguageSet(newLanguageSet);\n }}\n >\n None\n Call to action\n Quick reply\n \n {ButtonsType === \"QUICK_REPLY\" && (\n \n )}\n {ButtonsType !== \"none\" && (\n
\n {ButtonsType === \"CTA\" && (\n
\n {ActionBtn?.map((item, index) => {\n return (\n
\n
\n {\n ActionBtn[index].type = val;\n setActionBtn([...ActionBtn]);\n }}\n >\n Visit Website\n \n Call Phone\n \n \n
\n
\n {\n ActionBtn[index].text = e.target.value;\n setActionBtn([...ActionBtn]);\n }}\n />\n
\n\n {item?.type === \"URL\" && (\n
\n {\n ActionBtn[index].btnType = val;\n setActionBtn([...ActionBtn]);\n }}\n >\n Static Url\n \n Zipnip Dynamic Url\n \n \n
\n )}\n\n {item?.type === \"URL\" && (\n
\n {\n ActionBtn[index].payload = e.target.value;\n if (e.target.value.includes(\"{{\")) {\n ActionBtn[index].btnType = \"znpds\";\n }\n setActionBtn([...ActionBtn]);\n }}\n />\n
\n )}\n\n {item?.type === \"PHONE_NUMBER\" && (\n
\n {\n ActionBtn[index].payload = e;\n }}\n />\n
\n Please prefix your country code. India is 91\n
\n
\n )}\n\n
\n {\n ActionBtn.splice(index, 1);\n setActionBtn([...ActionBtn]);\n }}\n alt=\"delete\"\n />\n
\n
\n );\n })}\n
\n )}\n {ButtonsType === \"QUICK_REPLY\" && (\n
\n {QuickBtn?.map((item, index) => {\n return (\n
\n {\" \"}\n
\n
\n
Text
\n {\n QuickBtn[index].text = e.target.value;\n // QuickBtn[index].payload = e.target.value;\n setQuickBtn([...QuickBtn]);\n }}\n />\n
\n\n
\n
Intent
\n {\n QuickBtn[index].intent = val;\n setQuickBtn([...QuickBtn]);\n }}\n value={item.intent}\n >\n {AccountIntents?.map((res) => {\n return (\n \n {res.name}\n \n );\n })}\n \n
\n\n
\n {\n QuickBtn.splice(index, 1);\n setActionBtn([...ActionBtn]);\n }}\n alt=\"delete\"\n />\n
\n
\n
\n );\n })}\n
\n )}\n createActiionBtn()}\n >\n Add button\n \n
\n )}\n \n \n \n
\n \n
\n
\n setshowModal(false)}\n >\n OK\n ,\n ]}\n >\n \n \n \n \n {\" \"}\n \n
Intent *
\n
\n Select the intent of the message template.\n
\n \n \n {AccountIntents?.map((res) => {\n return {res?.name};\n })}\n \n \n\n
\n
\n Expect Yes / No response to this template\n
\n \n \n \n
\n
\n setshowIntentModal(false)}\n >\n Cancel\n \n \n Save\n \n
\n \n \n \n
\n );\n};\n\nexport default EditTemplate;\n","import { CheckCircleOutlined } from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader, CXSider } from \"component/Layout\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXSelect } from \"component/Select\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { languageOptions } from \"../../../../../utils/languageList\";\n\nconst LanguageSettings = ({\n stepOne,\n setstepOne,\n ActiveLanguage,\n setActiveLanguage,\n TemplateData,\n LanguageSet,\n setLanguageSet,\n editTemplate,\n}) => {\n useEffect(() => {\n if (\n (!ActiveLanguage ||\n !stepOne?.language?.find((obj) => obj === ActiveLanguage)) &&\n stepOne?.caid?.length > 0\n ) {\n setActiveLanguage(stepOne?.language?.[0]);\n }\n }, [stepOne, editTemplate]);\n\n const languageOption = () => {\n return languageOptions?.filter(\n (obj) => !stepOne?.language?.find((obj2) => obj2 === obj.value)\n );\n };\n\n const addMoreLanguage = (val) => {\n setLanguageSet([...LanguageSet, { language: val[0], data: TemplateData }]);\n stepOne.language = [...stepOne.language, ...val];\n setstepOne({ ...stepOne });\n };\n\n const deleteLanguageSet = (e, val) => {\n const newLanguageSet = LanguageSet?.filter((obj) => obj.language !== val);\n setLanguageSet(newLanguageSet);\n stepOne.language = stepOne.language?.filter((obj) => obj !== val);\n setstepOne({ ...stepOne });\n e.stopPropagation();\n };\n const [openDeleteConfirm, setOpenDeleteConfirm] = useState(null);\n const DeleteContent = ({ language }) => {\n return (\n
\n
\n Do you really want to delete this template. This only deletes the\n template from Zipnip and not from your Facebook business account.\n
\n
\n {\n setOpenDeleteConfirm(null);\n }}\n >\n Cancel\n \n {\n deleteLanguageSet(e, language);\n setOpenDeleteConfirm(null);\n }}\n >\n Confirm\n \n
\n
\n );\n };\n return (\n \n \n \n Languages\n \n \n {stepOne?.language?.map((language, index) => {\n const languageLabel = languageOptions?.find(\n (obj) => obj?.value === language\n )?.label;\n return (\n {\n setActiveLanguage(language);\n }}\n className={`d-flex justify-content-between align-items-center px-3 py-2 ${\n language === ActiveLanguage\n ? `LanguageContainerActive`\n : `LanguageContainer`\n }`}\n >\n
{languageLabel}
\n
\n
\n obj.language === language)\n ?.data?._id\n ? \"#4cb580\"\n : \"#afafaf\",\n }}\n />\n
\n\n }\n trigger=\"click\"\n open={openDeleteConfirm === language}\n onOpenChange={(e) => {\n setOpenDeleteConfirm(language);\n // e.stopPropagation();\n }}\n >\n
\n \n
\n \n
\n \n );\n })}\n
\n
\n Add more language\n
\n addMoreLanguage(val)}\n mode=\"multiple\"\n showArrow\n style={{ width: \"100%\" }}\n options={languageOption()}\n />\n
\n
\n );\n};\n\nexport default LanguageSettings;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { CXContent, CXHeader } from \"component/Layout\";\nimport { CXLayout } from \"component/Layout\";\nimport SettingsSideBar from \"../../Common/LeftSideBar\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport NewTemplate from \"./NewTemplate\";\nimport \"./style.css\";\nimport EditTemplate from \"./EditTemplate\";\nimport { notification } from \"antd\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport LanguageSettings from \"./LanguageSettings\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom\";\nimport { getWhatsAppTemplateByID } from \"action/TemplateAction\";\nconst CreateTemplate = () => {\n const { id } = useParams();\n const { WhatsAppTemplateById } = useSelector(\n (state) => state.TemplateReducer\n );\n const dispatch = useDispatch();\n const [edit, setedit] = useState(false);\n const [stepOne, setstepOne] = useState({\n category: \"MARKETING\",\n language: [\"en_US\"],\n caid: \"\",\n name: \"\",\n expectedIntents: [],\n expectYesNo: false,\n });\n\n const TemplateData = {\n header: { type: \"\", link: \"\" },\n body: \"\",\n footer: \"\",\n actionType: \"none\",\n action: [],\n variable: [],\n };\n const [LanguageSet, setLanguageSet] = useState([]);\n const [ActiveLanguage, setActiveLanguage] = useState(null);\n\n const checkStepOne = () => {\n let keys = Object.keys(stepOne);\n let flag = true;\n keys.forEach((key) => {\n if (key !== \"expectedIntents\" && key !== \"expectYesNo\") {\n if (stepOne[key] === \"\" || stepOne[key]?.length === 0) {\n flag = false;\n }\n }\n });\n flag\n ? setedit(true)\n : notification.error({\n message: `*Mandatory fields required`,\n });\n };\n\n useEffect(() => {\n if (id) {\n dispatch(getWhatsAppTemplateByID({ id, r: true }));\n setedit(true);\n }\n dispatch(GetAllConfig());\n }, []);\n useEffect(() => {\n if (id) {\n if (WhatsAppTemplateById?.data?.length > 0) {\n let temp = WhatsAppTemplateById?.data?.map((res) => {\n const {\n caid,\n category,\n createdAt,\n createdBy,\n exampleVariable,\n md,\n metaStatus,\n name,\n status,\n tenantId,\n updatedAt,\n language,\n variable,\n __v,\n ...rest\n } = res;\n let tempV = variable?.map((item) => {\n return { [item.name]: \"\" };\n });\n rest.variable = exampleVariable ?? tempV;\n return { language, data: rest };\n });\n setLanguageSet(temp);\n let obj = {\n category: WhatsAppTemplateById?.data[0]?.category,\n language: WhatsAppTemplateById?.data.map((res) => res.language),\n caid: WhatsAppTemplateById?.data[0]?.caid,\n expectedIntents: WhatsAppTemplateById?.data[0]?.expectedIntents,\n expectYesNo: WhatsAppTemplateById?.data[0]?.expectYesNo,\n };\n setstepOne(obj);\n }\n } else {\n let temp = [];\n stepOne.language.forEach((item) => {\n temp.push({ language: item, data: TemplateData });\n });\n setLanguageSet(temp);\n }\n }, [edit, WhatsAppTemplateById]);\n return (\n \n {!edit && }\n {(edit || id) && (\n \n )}\n \n \n \n \n {edit ? \"Update\" : \"Create\"} Template\n \n
\n history.push(\"/admin/knowledge-base/template\")}\n >\n Cancel\n \n {!edit && (\n checkStepOne()}\n >\n Continue\n \n )}\n
\n
\n {!edit && }\n {edit && LanguageSet?.length > 0 && ActiveLanguage?.length > 0 && (\n obj?.language === ActiveLanguage\n )}\n stepOne={stepOne}\n setstepOne={setstepOne}\n />\n )}\n
\n
\n
\n );\n};\n\nexport default CreateTemplate;\n","export const checkTagColor = {\n APPROVED: \"green\",\n PENDING: \"orange\",\n REJECTED: \"red\",\n DRAFT: \"blue\",\n PUBLISHED: \"green\",\n UNPUBLISHED: \"red\",\n FAILED: \"red\",\n};\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport {\n getImportedTemplates,\n importApprovedTemplatesByData,\n} from \"action/TemplateAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTable } from \"component/Table\";\nimport { CXTag } from \"component/Tag\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { languageOptions } from \"../../../../../utils/languageList\";\nimport { checkTagColor } from \"../Helper/TagColor\";\nimport Preview from \"../CreateTemplate/Preview\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { getBase64, extractVariables } from \"utils\";\nimport { patch, postFormData } from \"helper/networkClient\";\nimport { notification } from \"antd\";\nimport { CXInput } from \"component/Input\";\nimport { getTemplateVariables } from \"../../../../../action/TemplateAction\";\n\nconst ImportTemplates = ({ setimportModal }) => {\n const dispatch = useDispatch();\n const [selectedRow, setSelectedRow] = useState(null);\n const [dynamicButtons, setDynamicButtons] = useState([]);\n const [datatable, setddatatable] = useState([]);\n const [ActiveId, setActiveId] = useState(null);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { loading, WhatsAppTemplate, TemplateResponse, templateVariables } =\n useSelector((state) => state.TemplateReducer);\n const [HeaderLink, setHeaderLink] = useState(null);\n const [vars, setVars] = useState({});\n const [Uploading, setUploading] = useState(false);\n const columns = [\n {\n title: \"Template Name\",\n dataIndex: \"name\",\n key: \"name\",\n render: (data) =>
{data ?? \"N/A\"}
,\n },\n {\n title: \"Language\",\n dataIndex: \"language\",\n key: \"language\",\n render: (data) => {\n return (\n
\n {languageOptions.find((res) => res?.value === data)?.label ?? \"N/A\"}\n
\n );\n },\n },\n {\n title: \"Status\",\n dataIndex: \"metaStatus\",\n key: \"metaStatus\",\n render: (data) => (\n {data ?? \"N/A\"}\n ),\n },\n {\n title: \"Category\",\n dataIndex: \"category\",\n key: \"category\",\n render: (data) =>
{data ?? \"N/A\"}
,\n },\n {\n title: \"Import\",\n dataIndex: \"action\",\n key: \"action\",\n render: (data, record) => {\n return (\n record.metaStatus === \"APPROVED\" && (\n {\n handleTemplateSelection(record);\n }}\n >\n Import\n \n )\n );\n },\n },\n ];\n useEffect(() => {\n dispatch(getTemplateVariables());\n }, []);\n useEffect(() => {\n if (WhatsAppTemplate?.data?.length > 0) {\n setddatatable(\n WhatsAppTemplate?.data?.map((res, index) => {\n return {\n id: res?.id,\n key: index + 1,\n name: res.name,\n language: res.language,\n metaStatus: res.status,\n category: res.category,\n components: res.components,\n };\n })\n );\n }\n }, [WhatsAppTemplate]);\n\n const resetStates = () => {\n setSelectedRow(null);\n setDynamicButtons([]);\n setHeaderLink(null);\n };\n const handleTemplateSelection = (record) => {\n setSelectedRow(record);\n const btnObj = record.components.find((item) => item.type === \"BUTTONS\");\n if (btnObj?.buttons && btnObj?.buttons?.length > 0) {\n btnObj.buttons.map((item) => {\n if (item?.url?.includes(\"{{\")) {\n setDynamicButtons([...dynamicButtons, { ...item, btnType: \"znpds\" }]);\n }\n });\n }\n };\n\n const handleDynamicValueInput = (value, metaBtn) => {\n let var1 = [];\n dynamicButtons.map((item) => {\n if (item.url === metaBtn.url) {\n var1.push({\n ...item,\n url: value,\n });\n } else {\n var1.push(item);\n }\n });\n setDynamicButtons(var1);\n };\n\n const setVariables = (data, key) => {\n vars[key] = data;\n };\n const ImportNow = () => {\n let variable = Object.keys(vars).map((res) => {\n return { name: vars[res] };\n });\n let o = {\n variable,\n ...selectedRow,\n };\n if (dynamicButtons?.length > 0) {\n let var1 = [];\n o.components.map((item) => {\n if (item.type === \"BUTTONS\") {\n var1.push({\n type: \"BUTTONS\",\n buttons: dynamicButtons,\n });\n } else {\n var1.push(item);\n }\n });\n o.components = var1;\n }\n dispatch(importApprovedTemplatesByData(ActiveId, [o]));\n };\n const closeModal = () => {\n setimportModal(false);\n setddatatable([]);\n // setSelectedRow(null);\n // setDynamicButtons([]);\n // setHeaderLink(null);\n resetStates();\n dispatch({ type: \"RESET_TEMPLATE_RESPONSE\" });\n };\n const urlHandler = async (file, templateId) => {\n if (\n file?.type !== \"image/jpeg\" &&\n file?.type !== \"image/png\" &&\n file?.type !== \"image/jpg\" &&\n file?.type !== \"video/mp4\" &&\n file?.type !== \"application/pdf\"\n ) {\n return notification.error({\n message: \"File not supported\",\n });\n }\n file.preview = await getBase64(file);\n if (!file?.url && !file?.preview) {\n file.preview = await getBase64(file);\n }\n const formData = new FormData();\n formData?.append(\"file\", file);\n formData?.append(\"caid\", ActiveId);\n setUploading(true);\n await postFormData(\"/file/template\", formData)\n .then((resp) => {\n if (resp.status === 200) {\n patch(`/template/import/${templateId}`, {\n url: resp?.data?.data.url,\n fileHandle: resp?.data?.data.fileHandle,\n })\n .then((res) => {\n if (res.status === 200) {\n notification.success({\n message: \"File uploaded successfully\",\n });\n setHeaderLink(resp?.data?.data?.url);\n }\n setUploading(false);\n })\n .catch((err) => {\n notification.error({\n message: \"Something went wrong please try again\",\n });\n setUploading(false);\n });\n } else {\n resetStates();\n setUploading(false);\n }\n })\n .catch((err) => {\n resetStates();\n setUploading(false);\n });\n };\n return (\n
\n {!selectedRow && (\n
\n
\n
\n Select the WhatsApp account you want to import from\n
\n closeModal()}>\n Cancel\n \n
\n {\n setActiveId(val);\n setddatatable([]);\n dispatch(getImportedTemplates({ id: val }));\n }}\n className=\"SelectType\"\n showArrow\n style={{ width: \"100%\" }}\n >\n {allConfigData?.map((item) => {\n if (item?.md === \"whatsapp\") {\n return (\n \n {item?.configWp?.name}\n \n );\n }\n })}\n \n
\n )}\n\n \n {loading && }\n {!loading && (\n \n {!selectedRow && (\n
\n \n
\n )}\n {!TemplateResponse && selectedRow && (\n
\n
\n Please input variables same as in the approved template\n settings\n
\n {/*
\n \n
*/}\n\n \n
\n {\n selectedRow?.components?.find((d) => d?.type === \"BODY\")\n ?.text\n }\n
\n \n\n
\n {extractVariables(\n selectedRow?.components?.find((d) => d.type === \"BODY\")\n ?.text\n )?.map((res, index) => {\n return (\n
\n
Variable : {res}
\n
\n setVariables(val, index + 1)}\n >\n {templateVariables?.data?.map((variable) => {\n return (\n \n {variable?.name}\n \n );\n })}\n \n
\n
\n );\n })}\n
\n {dynamicButtons && dynamicButtons?.length > 0 && (\n
\n
\n It seems that you have dynamic URLs configured. Please\n enter the URLs again.\n
\n {dynamicButtons?.map((item, index) => {\n return (\n
\n
\n Button {index} : {item.url}\n
\n \n handleDynamicValueInput(e.target.value, item)\n }\n />\n
\n );\n })}\n
\n )}\n\n
\n resetStates()}\n >\n Back\n \n closeModal()}\n >\n Cancel\n \n ImportNow()}>\n Submit to import\n \n
\n
\n )}\n {selectedRow && TemplateResponse && (\n
\n
\n \n 0 &&\n TemplateResponse.data.unsynced[0].components\n ?.length > 0\n ? TemplateResponse.data.unsynced[0].components[0].text\n : undefined\n }\n importHeader={\n HeaderLink ??\n TemplateResponse?.data?.synced[0]?.header?.link ??\n null\n }\n // urlHandler={urlHandler}\n className=\"ImportPreview\"\n />\n
\n
\n
\n
\n In case you don't see the header image in the template,\n please upload your file using the option below:-{\" \"}\n \n ( jpeg / png / mp4 / pdf )*\n \n
\n \n urlHandler(\n e.target.files[0],\n TemplateResponse?.data?.synced[0]?._id\n )\n }\n />\n
\n {Uploading && (\n
\n \n
\n \n file uploading please wait ...\n \n
\n
\n )}\n
\n \n\n \n closeModal()}\n >\n Finish\n \n \n
\n )}\n
\n )}\n
\n \n );\n};\n\nexport default ImportTemplates;\n","// This icon file is generated automatically.\nvar SyncOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z\" } }] }, \"name\": \"sync\", \"theme\": \"outlined\" };\nexport default SyncOutlined;\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 SyncOutlinedSvg from \"@ant-design/icons-svg/es/asn/SyncOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SyncOutlined = function SyncOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SyncOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SyncOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SyncOutlined';\n}\nexport default RefIcon;","import React, { useEffect } from \"react\";\nimport { languageOptions } from \"utils/languageList\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { Form } from \"antd\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getTemplatesActionTrigger } from \"action/TemplateAction\";\nimport { GetAllConfig } from \"action/AdminActions\";\n\nconst TemplateFilter = ({ setddatatable, setloading }) => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const onFinish = (values) => {\n values = Object.keys(values)\n .filter((key) => values[key])\n .reduce((obj, key) => {\n return {\n ...obj,\n [key]: values[key],\n };\n }, {});\n dispatch(getTemplatesActionTrigger(values));\n setloading(true);\n setddatatable([]);\n };\n const ClearFilter = () => {\n form.resetFields();\n dispatch(getTemplatesActionTrigger());\n };\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n return (\n \n
\n \n
\n \n \n {/* >\"> */}\n {languageOptions.map((res) => {\n return (\n \n {res.label}\n \n );\n })}\n \n \n \n \n {/* */}\n APPROVED\n FAILED\n \n \n \n \n {/* */}\n MARKETING\n UTILITY\n AUTHENTICATION\n \n \n \n \n {/* */}\n {allConfigData?.map((item) => {\n if (item.md === \"whatsapp\") {\n return (\n \n {item?.configWp?.name}\n \n );\n }\n })}\n \n \n
\n\n
\n ClearFilter()}>\n Clear filter\n \n \n Apply filter\n \n
\n
\n
\n
\n );\n};\n\nexport default TemplateFilter;\n","import React, { useState, useEffect, Fragment } from \"react\";\nimport ImportTemplates from \"./ImportTemplates\";\nimport moment from \"moment\";\nimport history from \"utils/history\";\nimport SettingsSideBar from \"../../Common/LeftSideBar/index\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { debounce } from \"lodash\";\nimport { notification } from \"antd\";\nimport { CXContent } from \"component/Layout\";\nimport { CXLayout } from \"component/Layout\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport {\n deleteWhatsAppTemplate,\n getTemplatesActionTrigger,\n syncTemplatesFromMeta,\n searchTemplatesActionTrigger,\n} from \"action/TemplateAction\";\nimport { CXTable } from \"component/Table\";\nimport {\n DeleteFilled,\n EditOutlined,\n EyeOutlined,\n FilterOutlined,\n SyncOutlined,\n} from \"@ant-design/icons\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXModal } from \"component/Modal\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { languageOptions } from \"../../../../../utils/languageList\";\nimport { CXTag } from \"component/Tag\";\nimport { checkTagColor } from \"../Helper/TagColor\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXInput } from \"component/Input\";\nimport TemplateFilter from \"./TemplateFilter\";\nimport \"./index.css\";\nimport { PermissionCheck } from \"utils\";\nimport Preview from \"../CreateTemplate/Preview\";\n\nconst ListTemplate = () => {\n const [datatable, setddatatable] = useState([]);\n const [loading, setloading] = useState(true);\n const [importModal, setimportModal] = useState(false);\n const [open, setOpen] = useState(false);\n const [filterToggle, setfilterToggle] = useState(false);\n const dispatch = useDispatch();\n const state = useSelector((state) => state.TemplateReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n\n useEffect(() => {\n dispatch(getTemplatesActionTrigger());\n }, []);\n\n const handleSearch = debounce((searchString) => {\n if (searchString) {\n dispatch(searchTemplatesActionTrigger({ q: searchString }));\n } else {\n dispatch(getTemplatesActionTrigger());\n }\n }, 500);\n\n const handleRoute = (path = \"/\", from, key) => {\n history.push(path, {\n from,\n key,\n });\n };\n\n const openDeleteNotification = (id) => {\n let temp = state?.templates?.data?.filter((res) => res._id === id);\n const key = id;\n const btn = (\n {\n notification.close(key);\n dispatch(deleteWhatsAppTemplate(id));\n }}\n >\n Confirm\n \n );\n notification.open({\n message: (\n \n Do you want to delete {temp[0][\"name\"]} ?\n \n ),\n description: (\n \n This only deletes the template from Zipnip and not from your Facebook\n business account.\n \n ),\n btn,\n key,\n });\n };\n\n const columns = [\n {\n title: \"Template Name\",\n dataIndex: \"templateName\",\n key: \"templateName\",\n render: (data) =>
{data ?? \"N/A\"}
,\n },\n {\n title: \"Language\",\n dataIndex: \"language\",\n key: \"language\",\n render: (data) => (\n
\n {\" \"}\n {languageOptions.find((res) => res?.value === data)?.label ?? \"N/A\"}\n
\n ),\n },\n {\n title: \"Account\",\n dataIndex: \"account\",\n key: \"account\",\n render: (data) =>
{data}
,\n },\n {\n title: \"Status\",\n dataIndex: \"metaStatus\",\n key: \"metaStatus\",\n render: (data) => (\n {data ?? \"N/A\"}\n ),\n },\n {\n title: \"Last Updated\",\n dataIndex: \"updatedAt\",\n key: \"updatedAt\",\n render: (data) =>
{data ?? \"N/A\"}
,\n },\n {\n title: \"Action\",\n dataIndex: \"action\",\n key: \"action\",\n render: (data, info) => {\n return (\n
\n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n
\n \n history.push(\n `/admin/knowledge-base/view-template/${info?.id}`,\n {\n Edit: \"Edit\",\n key: \"2\",\n }\n )\n }\n alt=\"edit\"\n />\n {/* \n history.push(\n `/admin/knowledge-base/view-template/${info?.id}`,\n {\n Edit: \"Edit\",\n key: \"2\",\n }\n )\n }\n /> */}\n openDeleteNotification(info?.id)}\n alt=\"delete\"\n />\n {/* openDeleteNotification(info?.id)}\n /> */}\n handleOpenChange(info?.id)}\n content={\n
\n
\n Do you want to import latest data from Meta Business\n Manager ?\n
\n
\n hide()}\n >\n No\n \n {\n dispatch(syncTemplatesFromMeta(info?.id));\n hide();\n }}\n >\n Yes\n \n
\n
\n }\n >\n \n \n
\n )}\n {!PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n \n \n \n }\n >\n \n \n )}\n
\n );\n },\n },\n ];\n useEffect(() => {\n if (state?.templates?.data?.length > 0) {\n setddatatable(\n state?.templates?.data?.map((res, index) => {\n return {\n id: res?._id,\n key: index + 1,\n templateName: res.name,\n language: res.language,\n account: `${res.caid?.configWp?.name}`,\n metaStatus: res.metaStatus,\n updatedAt: moment(res.updatedAt).format(\"DD MMM YYYY\"),\n data: res,\n };\n })\n );\n }\n setTimeout(() => {\n setloading(false);\n }, 1500);\n }, [state?.templates]);\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n const hide = () => {\n setOpen(false);\n };\n const handleOpenChange = (id) => {\n setOpen(id);\n };\n\n console.log(\n \"datatable\",\n user?.userTenants?.find((data) => data?.userId === user?.userProfile?._id)\n );\n\n return (\n \n \n \n \n \n \n \n Whatsapp Templates\n \n {PermissionCheck(\n user?.userTenants?.find(\n (data) => data?.userId === user?.userProfile?._id\n )?.role?.permissions,\n \"CreateTemplate\"\n ) && (\n
\n setimportModal(true)}\n >\n Import templates\n \n \n handleRoute(\"/admin/knowledge-base/create-template\")\n }\n >\n Create\n \n
\n )}\n
\n \n handleSearch(e.target.value)}\n addonAfter={\n setfilterToggle(!filterToggle)}\n >\n \n Filter\n \n }\n />\n {filterToggle && (\n
\n \n
\n )}\n {!loading && (\n \n \n \n )}\n {loading && }\n {!loading && (\n
\n {state?.templates?.paging?.before && (\n {\n dispatch(\n getTemplatesActionTrigger({\n before: state?.templates?.paging?.before,\n })\n );\n setloading(true);\n setddatatable([]);\n }}\n >\n Prev\n \n )}\n {state?.templates?.paging?.after && (\n {\n dispatch(\n getTemplatesActionTrigger({\n after: state?.templates?.paging?.after,\n })\n );\n setloading(true);\n setddatatable([]);\n }}\n >\n Next\n \n )}\n
\n )}\n
\n
\n
\n
\n \n \n \n
\n );\n};\n\nexport default ListTemplate;\n","import { CXButton } from \"component/Button\";\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n addCandidateAction,\n getCandidateStageTrigger,\n getOpeningByIdTrigger,\n} from \"action/OpeningsAction\";\nimport { CXForm, CXFormItem, CXFormList } from \"component/Form\";\nimport { Form, Space } from \"antd\";\nimport { CXInput, CXTextArea } from \"component/Input\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport {\n CloudUploadOutlined,\n EyeInvisibleOutlined,\n EyeOutlined,\n} from \"@ant-design/icons\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport \"./style.css\";\nimport { CXDatePicker } from \"component/DatePicker\";\nimport CXUpload from \"component/Upload\";\nimport { post, postFormData } from \"helper/networkClient\";\nimport { LoadingOutlined } from \"@ant-design/icons\";\nimport { CXRadioButton, CXRadioGroup } from \"component/Radio\";\nimport { dfCountry } from \"utils\";\nimport PhoneInput, { parsePhoneNumber } from \"react-phone-number-input\";\nimport \"react-phone-number-input/style.css\";\nimport { CXModal } from \"component/Modal\";\nimport DuplicateCandidateAlert from \"../DuplicateCandidateAlert\";\nimport { publicAuthUrl } from \"config/config\";\nimport { CXLottie } from \"component/Lottie\";\nimport LocationSearch from \"component/LocationSearch\";\n\nconst Index = () => {\n const [ShowCustomFeilds, setShowCustomFeilds] = useState(false);\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const { agents } = useSelector((state) => state.AgentReducer);\n const { candidateFilterStage, openPositions } = useSelector(\n (state) => state.OpeningReducer\n );\n const [form] = Form.useForm();\n const { openingsId } = useParams();\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch(getContactForm());\n dispatch(getCandidateStageTrigger());\n }, []);\n const [Loader, setLoader] = useState(false);\n const [resumeLoader, setresumeLoader] = useState(false);\n const [JuneAiParsing, setJuneAiParsing] = useState(false);\n const [Resume, setResume] = useState(null);\n const [processData, setprocessData] = useState(null);\n const [StatusErr, setStatusErr] = useState(false);\n const [RawData, setRawData] = useState(null);\n const [formData, setformData] = useState(null);\n const [duplicateData, setduplicateData] = useState(null);\n const [duplicateChecking, setduplicateChecking] = useState(false);\n const [openingListChecking, setopeningListChecking] = useState(false);\n const [openingsList, setOpeningsList] = useState([]);\n const addCandidateHandler = (values) => {\n let data = {};\n data.custom = values.undefined;\n data.data = {\n name: values.name,\n email: values.email,\n phone: values.phone,\n };\n data.candidate = {\n experience: values.experience ?? \"NA\",\n noticePeriod: values.noticePeriod ?? \"NA\",\n ctc: values.ctc ?? \"NA\",\n expCtc: values.expCtc ?? RawData?.cd?.expCtc ?? \"NA\",\n employment:\n values.employment ?? RawData?.cd?.employment\n ? [\n {\n designation: RawData?.cd?.employment?.[0]?.designation,\n orgName: RawData?.cd?.employment?.[0]?.orgName,\n },\n ]\n : [],\n educationDetails:\n values.educationDetails ?? RawData?.cd?.educationDetails ?? [],\n currLoc: { name: values.currLoc },\n rId: Resume?.url ?? null,\n source: values.source\n ? values.source\n : CreateType === \"m\"\n ? \"CandidateForm\"\n : \"ParseCV\",\n notes: values.notes,\n opening: {\n openingId: openingsId,\n stageId: values.stageId,\n stageName: candidateFilterStage?.data?.find(\n (d) => d._id === values.stageId\n ).name,\n },\n };\n dispatch(addCandidateAction(data, openingsId, values.stageId));\n form.resetFields();\n setResume(null);\n setRawData(null);\n setprocessData(null);\n setOpeningsList([]);\n setduplicateChecking(false);\n setformData(null);\n setopeningListChecking(false);\n setduplicateData(null);\n };\n\n const checkDuplicateContactHandler = async (values) => {\n setduplicateChecking(true);\n try {\n const resp = await post(\"/candidate/checkDuplicate\", {\n email: values.email,\n phone: values.phone,\n });\n\n if (resp.status === 200) {\n if (resp?.data?.data?.length > 0) {\n setduplicateData(resp?.data?.data);\n }\n }\n } catch (error) {\n console.error(\"Error checking duplicate contact:\", error);\n } finally {\n setduplicateChecking(false);\n }\n };\n\n const handleUploadFile = async (file) => {\n setLoader(true);\n const acceptedFileTypes = [\n \"application/pdf\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n ];\n if (!acceptedFileTypes.includes(file.type)) {\n alert(\"Only PDF and DOCX files are accepted\");\n setLoader(false);\n return;\n }\n\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setResume(null);\n setResume(resp?.data?.data);\n setLoader(false);\n } else {\n setLoader(false);\n }\n });\n } catch (error) {\n setLoader(false);\n }\n };\n const [CreateType, setCreateType] = useState(\"j\");\n\n const ParseResume = async () => {\n setresumeLoader(true);\n let obj = {\n fileUrl: Resume?.url,\n };\n try {\n await fetch(`https://june.hirebound.io/api/resume/parse`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(obj),\n }).then(async (resp) => {\n if (resp.status === 200) {\n form.resetFields();\n const data = await resp.json();\n if (data?.data) {\n form.setFieldsValue({\n name: data?.data?.name,\n email: data?.data?.email,\n phone: data?.data?.phone,\n employment: [\n {\n designation: data?.cd?.employment?.[0]?.designation,\n orgName: data?.cd?.employment?.[0]?.orgName,\n },\n ],\n experience: data?.cd?.experience,\n });\n }\n checkDuplicateContactHandler(data?.data);\n setresumeLoader(false);\n } else {\n setresumeLoader(false);\n }\n });\n } catch (error) {\n setresumeLoader(false);\n }\n };\n useEffect(() => {\n if (Resume && CreateType === \"p\") {\n ParseResume();\n }\n }, [Resume]);\n useEffect(() => {\n dispatch(getOpeningByIdTrigger(openingsId));\n }, []);\n\n const ParseWithJuneAi = async () => {\n setJuneAiParsing(true);\n let obj = {\n text: processData,\n };\n try {\n await fetch(`https://june.hirebound.io/api/text/parse`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(obj),\n }).then(async (resp) => {\n if (resp.status === 200) {\n form.resetFields();\n const data = await resp.json();\n setRawData(data);\n let loc = dfCountry(\n openPositions?.data?.find((d) => d._id === openingsId)?.timeZone\n );\n if (data?.data?.phone?.length > 10) {\n data.phone = data.data.phone;\n } else {\n if (loc === \"US\") {\n data.data.phone = `+1${data.data.phone}`;\n } else if (loc === \"IN\") {\n data.data.phone = `+91${data.data.phone}`;\n } else {\n data.data.phone = `${data.data.phone ?? \"NA\"}`;\n }\n }\n if (data?.data) {\n form.setFieldsValue({\n name: data?.data?.name,\n email: data?.data?.email,\n phone: data?.data?.phone,\n employment: [\n {\n designation: data?.cd?.employment?.[0]?.designation,\n orgName: data?.cd?.employment?.[0]?.orgName,\n },\n ],\n experience: data?.cd?.experience,\n ctc: data?.cd?.ctc,\n noticePeriod: data?.cd?.noticePeriod,\n currLoc: data?.cd?.currLoc?.name,\n });\n await checkDuplicateContactHandler(data?.data);\n }\n setJuneAiParsing(false);\n } else {\n setJuneAiParsing(false);\n }\n });\n } catch (error) {\n setJuneAiParsing(false);\n }\n };\n\n const validateEmailOrPhone = (_, value) => {\n const email = form.getFieldValue(\"email\");\n const phone = form.getFieldValue(\"phone\");\n if (!email && !phone) {\n return Promise.reject(\n new Error(\"Either email or phone number is required\")\n );\n }\n return Promise.resolve();\n };\n\n return (\n \n \n \n \n {\" \"}\n Add Candidate for{\" \"}\n {openPositions?.data?.find((d) => d._id === openingsId)\n ?.positionName ?? \"-\"}\n \n
\n {\n history.push(`/admin/openings/${openingsId}/Candidates`);\n form.resetFields();\n }}\n >\n Back\n \n {\n form\n .validateFields()\n .then((values) => {\n addCandidateHandler(values);\n // checkDuplicateContactHandler(values);\n setformData(values);\n })\n .catch((info) => {\n console.log(\"Validate Failed:\");\n });\n }}\n >\n {duplicateChecking ? \"Processing..\" : \"Add\"}\n \n
\n
\n
\n {\n setCreateType(e.target.value);\n }}\n >\n June AI\n Parse CV\n Add Manually\n \n
\n \n {CreateType === \"p\" && (\n \n
\n \n \n \n Upload CV to parse data\n \n \n {Loader && (\n \n ...Uploading \n \n )}\n {resumeLoader && (\n \n ...Please wait parsing data \n \n )}\n
\n
\n {Resume?.url && (\n
\n {Resume?.url.split(\".\")?.pop() === \"pdf\" ? (\n \n

Unable to display PDF

\n \n ) : (\n {\n e.target.src = \"\";\n e.target.parentNode.innerHTML =\n \"Failed to load document.\";\n }}\n >\n )}\n
\n )}\n
\n \n )}\n {CreateType === \"j\" && (\n \n
\n
\n setprocessData(e.target.value)}\n value={processData}\n />\n
\n {\n if (processData?.length > 0) {\n setStatusErr(false);\n ParseWithJuneAi();\n } else {\n setStatusErr(true);\n }\n }}\n >\n {JuneAiParsing ? (\n \n Please wait processing data.... \n \n ) : (\n `Process details`\n )}\n \n
\n
\n
\n \n )}\n
\n {JuneAiParsing && (\n
\n
\n \n
\n Please wait while we are processing data...\n
\n
\n
\n )}\n {!JuneAiParsing && (\n
\n \n
\n {\" \"}\n \n \n \n \n \n \n
\n
\n \n
\n data._id === openingsId\n )?.timeZone\n )}\n style={{ width: \"100%\" }}\n onChange={(val) => {}}\n />\n
\n \n \n \n \n
\n
\n \n \n \n \n \n \n
\n {CreateType === \"m\" && (\n
\n \n \n {(subFields, subOpt) => (\n \n {subFields.map((subField) => (\n \n
\n
\n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n Yes\n No\n \n \n
\n
\n {\n subOpt.remove(subField.name);\n }}\n />\n \n ))}\n subOpt.add()}\n block\n >\n Add Employment\n \n \n )}\n
\n
\n
\n )}\n {CreateType === \"m\" && (\n
\n \n \n {(subFields, subOpt) => (\n \n {subFields.map((subField) => (\n \n
\n
\n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Yes\n No\n \n \n
\n
\n {\n subOpt.remove(subField.name);\n }}\n />\n \n ))}\n subOpt.add()}\n block\n >\n Add Education\n \n \n )}\n
\n
\n
\n )}\n
\n \n \n {candidateFilterStage?.data?.map((res) => {\n return (\n {res.name}\n );\n })}\n \n \n\n \n \n \n
\n \n {/* \n \n {\n form.setFieldsValue({\n currLoc: {\n name: value?.name ?? \"\",\n city:\n value?.address_components.find((d) =>\n d.types.includes(\"locality\")\n )?.long_name ?? \"\",\n region:\n value?.address_components.find((d) =>\n d.types.includes(\n \"administrative_area_level_1\"\n )\n ).long_name ?? \"\",\n country:\n value?.address_components.find((d) =>\n d.types.includes(\"country\")\n ).long_name ?? \"\",\n fullAddress: value?.formatted_address ?? \"\",\n placeId: key,\n },\n });\n }}\n />\n \n */}\n \n \n \n
\n
\n \n \n \n
\n {CreateType === \"m\" && (\n \n \n \n \n Upload CV\n \n \n {Loader && (\n \n ...Uploading \n \n )}\n {Resume?.fileName && (\n \n {Resume?.fileName}\n \n setResume(null)}\n src=\"/images/Candidate/close.svg\"\n height={18}\n className=\"cursor-pointer\"\n alt=\"close\"\n />\n \n \n )}\n \n )}\n\n
\n
\n Custom felids{\" \"}\n {ShowCustomFeilds ? (\n setShowCustomFeilds(false)}\n />\n ) : (\n setShowCustomFeilds(true)}\n />\n )}\n
\n {ShowCustomFeilds && (\n
\n {\" \"}\n {contactForm?.formItems?.map(\n ({\n key,\n name,\n lebel,\n placeholder,\n required,\n element,\n type,\n elementOptions,\n ...restField\n }) => {\n if (restField?.isActive && restField?.isCustom) {\n switch (type) {\n case \"text\":\n case \"email\":\n return (\n \n \n \n );\n break;\n case \"phone\":\n return (\n \n \n \n );\n break;\n case \"select\":\n return (\n \n \n {elementOptions?.map((res) => {\n return (\n \n {res}\n \n );\n })}\n \n \n );\n break;\n case \"notes\":\n case \"textArea\":\n return (\n \n \n \n );\n break;\n default:\n // Handle any other cases here\n break;\n }\n }\n }\n )}\n
\n )}\n
\n \n
\n )}\n
\n \n \n
\n 0}\n closable={false}\n footer={null}\n >\n \n \n
\n );\n};\n\nexport default Index;\n","import { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { getQuestionsConfig } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\n\nconst QualifierQuestions = ({\n GlobalState,\n setGlobalState,\n MandatoryError,\n header = true,\n hideDefault = false,\n}) => {\n const { openingsId } = useParams();\n const [fetchininQ, setfetching] = useState(false);\n const dispatch = useDispatch();\n const QuestionnaireConfiguration = useSelector(\n (state) => state.AdminReducer.QuestionnaireConfiguration\n );\n const [Questions, setQuestions] = useState([]);\n const [DefaultQuestions, setDefaultQuestions] = useState();\n const addQuestion = () => {\n setQuestions([\n ...Questions,\n {\n q: \"\",\n type: \"freeText\",\n mandatory: true,\n botEnabled: true,\n },\n ]);\n };\n const removeQuestion = (index) => {\n const temp = [...Questions];\n temp.splice(index, 1);\n setQuestions(temp);\n };\n\n const updateQuestion = (index, value) => {\n const temp = [...Questions];\n temp[index].q = value;\n setQuestions(temp);\n };\n const updateType = (index, value) => {\n const temp = [...Questions];\n temp[index].type = value;\n setQuestions(temp);\n };\n const updateEnabled = (index, value) => {\n const temp = [...Questions];\n temp[index].mandatory = value;\n setQuestions(temp);\n };\n const updatebotEnabled = (index, value) => {\n const temp = [...Questions];\n temp[index].botEnabled = value;\n setQuestions(temp);\n };\n\n const dragItem = useRef();\n const dragOverItem = useRef();\n const dragStart = (e, position) => {\n dragItem.current = position;\n };\n const dragEnter = (e, position) => {\n dragOverItem.current = position;\n };\n const drop = (e) => {\n const copyListItems = [...Questions];\n const dragItemContent = copyListItems[dragItem.current];\n copyListItems.splice(dragItem.current, 1);\n copyListItems.splice(dragOverItem.current, 0, dragItemContent);\n dragItem.current = null;\n dragOverItem.current = null;\n setQuestions(copyListItems);\n };\n\n useEffect(() => {\n setGlobalState({ ...GlobalState, qualifiers: Questions });\n }, [Questions]);\n\n useEffect(() => {\n if (!hideDefault) {\n GlobalState.qualifiers && setQuestions(GlobalState.qualifiers);\n }\n }, []);\n\n useEffect(() => {\n setDefaultQuestions(QuestionnaireConfiguration);\n setfetching(false);\n }, [QuestionnaireConfiguration]);\n\n useEffect(() => {\n setfetching(true);\n dispatch(getQuestionsConfig());\n }, []);\n\n useEffect(() => {\n if (hideDefault) {\n setQuestions(QuestionnaireConfiguration);\n }\n }, [QuestionnaireConfiguration]);\n\n return (\n
\n {header && (\n
Qualifier Questions
\n )}\n
\n
\n {!fetchininQ && !hideDefault && DefaultQuestions?.length > 0 && (\n \n
\n
\n Default Questions\n \n These are prebuilt questions that June AI will ask all\n candidates.\n \n }\n >\n \n \n
\n
\n {DefaultQuestions?.map((item, index) => {\n return (\n
\n \n updateQuestion(index, e.target.value)}\n defaultValue={item.q}\n />\n
\n
\n );\n })}\n
\n )}\n\n {!fetchininQ &&\n Questions.map((item, index) => {\n return (\n dragStart(e, index)}\n onDragEnter={(e) => dragEnter(e, index)}\n onDragEnd={drop}\n onDragOver={(e) => e.preventDefault()}\n >\n
\n \"arrow\"\n
\n \n updateQuestion(index, e.target.value)}\n defaultValue={item.q}\n />\n \n
\n updateType(index, e)}\n >\n Yes / NO\n Numbered Response\n Free Text\n \n
\n
\n
\n
Mandatory
\n
\n updateEnabled(index, e)}\n defaultChecked={item.mandatory}\n // checkedChildren=\"MANDATORY\"\n // unCheckedChildren=\"NON-MANDATORY\"\n >\n
\n
\n
\n
Bot Enabled
\n
\n updatebotEnabled(index, e)}\n defaultChecked={item.botEnabled}\n // checkedChildren=\"MANDATORY\"\n // unCheckedChildren=\"NON-MANDATORY\"\n >\n
\n
\n
\n removeQuestion(index)}\n >\n \n \n \n );\n })}\n \n {!fetchininQ && (\n
\n
\n \"arrow\"\n
\n addQuestion()}>\n Add Question\n \n
\n )}\n {fetchininQ && (\n
\n
\n \n
\n
\n )}\n \n \n );\n};\n\nexport default QualifierQuestions;\n","import { EditOutlined, MailOutlined, WarningOutlined } from \"@ant-design/icons\";\nimport {\n getAgentsActionTrigger,\n getTeamAgentsActionTrigger,\n} from \"action/AgentAction\";\nimport { CXAvatar } from \"component/Avatar\";\nimport { CXCard } from \"component/Card\";\nimport { CXCol } from \"component/Col\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXRow } from \"component/Row\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { transformString, truncateSt } from \"utils\";\nimport ReactHtmlParser from \"react-html-parser\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXInput } from \"component/Input\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport {\n removePrincipalAction,\n updateOpenPositionTrigger,\n updatePrincipalAction,\n} from \"action/OpeningsAction\";\nimport { CXModal } from \"component/Modal\";\nimport SettingsSequences from \"../SettingsSequences\";\nimport { getAllbots } from \"action/WorkbenchAction\";\nimport { useLocation } from \"react-router-dom\";\nimport { CXButton } from \"component/Button\";\n// import { getCampaignsMaster } from \"action/CampaignAction\";\n\nconst ShareJob = ({\n GlobalState,\n setGlobalState,\n duplicate = false,\n setSelectedWF = () => {},\n}) => {\n const dispatch = useDispatch();\n const url = window.location.href;\n const location = useLocation();\n const [vca, setvca] = useState(false);\n const { openingsId } = useParams();\n const { user, tenantSettings } = useSelector(\n (state) => state.dittoAdminReducer\n );\n const { agents, loading, teams } = useSelector((state) => state.AgentReducer);\n const BotList = useSelector((state) => state.WrokbenchReducer.Bots);\n const { CampaignsList } = useSelector((state) => state.CampaignReducer);\n const Loader = useSelector((state) => state.WrokbenchReducer.botSkeleton);\n const [dittoId, setditto] = useState(null);\n const [selectedAgents, setselectedAgents] = useState([]);\n const [Prime, setPrime] = useState(null);\n const [autoShare, setAutoShare] = useState([]);\n const [consentModal, setconsentModal] = useState(null);\n console.log(\"GlobalStateShareWith\", GlobalState, autoShare, selectedAgents);\n\n useEffect(() => {\n if (GlobalState?.dittoId || GlobalState?.dittoId === null) {\n setditto(GlobalState?.dittoId);\n }\n dispatch(getAllbots());\n dispatch(getTeamAgentsActionTrigger());\n if (agents?.data?.length === 0) {\n dispatch(getAgentsActionTrigger());\n }\n }, []);\n useEffect(() => {\n if (dittoId) {\n setGlobalState({\n ...GlobalState,\n dittoId: dittoId,\n });\n }\n }, [dittoId]);\n useEffect(() => {\n if (\n BotList &&\n BotList?.length > 0 &&\n !dittoId &&\n !location.pathname.includes(\"/edit\")\n ) {\n setditto(BotList[0]?.id);\n }\n }, [BotList]);\n useEffect(() => {\n if (selectedAgents?.length > 0) {\n setPrime(GlobalState?.prime ?? Prime ?? \"\");\n let p = {\n permission: \"Edit\",\n entityId: selectedAgents[0]?.id,\n entityType: \"User\",\n };\n let { permissions, ...rest } = GlobalState;\n if (!url.includes(\"Settings\") && !url.includes(\"edit\")) {\n let obj = {\n ...rest,\n principal: selectedAgents,\n prime: \"\",\n autoCandidateSharedWith: autoShare.length > 0 ? autoShare : [p],\n };\n setGlobalState(obj);\n }\n } else {\n setPrime(selectedAgents[0]);\n }\n }, [selectedAgents]);\n useEffect(() => {\n if (Prime?.length >= 0) {\n setGlobalState({\n ...GlobalState,\n prime: Prime,\n });\n }\n }, [Prime]);\n useEffect(() => {\n if (GlobalState?.principal?.length > 0) {\n setselectedAgents(\n GlobalState?.principal ?? [\n agents?.data.find((x) => x._id === user?.userProfile?._id),\n ]\n );\n }\n if (GlobalState?.autoCandidateSharedWith?.length > 0) {\n setAutoShare(GlobalState?.autoCandidateSharedWith);\n }\n if (\n (url.includes(\"Settings\") || url.includes(\"edit\") || duplicate) &&\n (openingsId || duplicate) &&\n GlobalState?.permissions?.length > 0 &&\n selectedAgents?.length === 0\n ) {\n // HACK TO FIX THE ISSUE OF SHARING WITH USER PRINCIPAL IN SETTINGS\n let principal = GlobalState?.permissions?.map((res) => {\n let extracted = transformString(res.principal);\n let { id, type } = extracted;\n return { name: res?.name, id, type };\n });\n setselectedAgents(principal);\n }\n }, [GlobalState]);\n useEffect(() => {\n if (url.includes(\"/add\")) {\n if (\n agents?.data?.length > 0 &&\n (GlobalState?.principal?.length === 0 || !GlobalState?.principal)\n ) {\n let p = agents?.data.find((x) => x._id === user?.userProfile?._id);\n setselectedAgents([\n GlobalState?.principal ?? {\n name: \"Owner\",\n id: p._id,\n type: \"user\",\n },\n ]);\n }\n }\n }, [agents]);\n useEffect(() => {\n if (CampaignsList?.data?.length > 0) {\n setSelectedWF(\n CampaignsList?.data?.map((res) => {\n return { wfId: res._id, type: \"mwf\" };\n })\n );\n }\n }, [CampaignsList]);\n const options = useMemo(() => {\n return agents?.data?.map((tag) => {\n const optionText = `${tag.fname} ${tag.lname} - ${tag.email}`;\n\n return (\n \n {optionText}\n \n );\n });\n }, [agents]);\n const handleChange = (id, from = \"selector\", consent) => {\n if (from === \"modal\") {\n let tsd = tenantSettings?.data?.shareSetting;\n let obj = {\n principal: {\n name: tsd?.opening?.individual ?? \"Read\",\n id: id,\n type: \"user\",\n },\n autoCandidateSharedWith: {\n entityId: id,\n permission: tsd?.candidate?.individual ?? \"Read\",\n entityType: \"User\",\n },\n prime: Prime ?? GlobalState?.prime ?? \"\",\n shareHistorical: consent === \"yes\" ? true : false,\n };\n setconsentModal(null);\n dispatch(updatePrincipalAction(openingsId, obj, \"trigger\"));\n } else {\n if ((url.includes(\"Settings\") || url.includes(\"edit\")) && openingsId) {\n setconsentModal(id);\n }\n let index = selectedAgents.findIndex((x) => x.id === id);\n let p = agents?.data.find((x) => x._id === id);\n if (index === -1) {\n let tsd = tenantSettings?.data?.shareSetting;\n let value = {\n name: tsd?.opening?.individual ?? \"Read\",\n id: p._id,\n type: \"user\",\n };\n setselectedAgents([...selectedAgents, value]);\n if (tsd?.candidate?.autoShareEnable) {\n setTimeout(() => {\n setAutoShare([\n ...autoShare,\n {\n permission: tsd?.candidate?.individual ?? \"Read\",\n entityId: id,\n entityType: \"User\",\n },\n ]);\n }, 100);\n }\n }\n }\n };\n\n const updatePrime = (id, data) => {\n if (url.includes(\"Settings\") && openingsId) {\n let sA = selectedAgents;\n let aCSW = data ?? autoShare ?? GlobalState?.autoCandidateSharedWith;\n aCSW = Array.from(new Set(aCSW.map((item) => item.entityId))).map(\n (entityId) => aCSW.find((item) => item.entityId === entityId)\n );\n const TempGs = {\n ...GlobalState,\n principal: sA,\n prime: id ?? Prime ?? GlobalState?.prime,\n autoCandidateSharedWith: aCSW,\n };\n let { _id, createdAt, createdBy, tenantId, location, __v, ...rest } =\n TempGs;\n if (rest?.cId?._id) {\n rest.cId = rest.cId?._id;\n }\n let updatedLoc = {\n name: location?.name,\n _id: location?._id,\n };\n if (location?.name && location?._id) {\n rest.location = updatedLoc;\n }\n dispatch(updateOpenPositionTrigger(openingsId, rest, \"Settings\"));\n }\n };\n const updateAutoShare = (id, val) => {\n if ((url.includes(\"Settings\") || url.includes(\"edit\")) && openingsId) {\n permissionHandler(\"toggle\", id, val);\n }\n let obj = {\n permission: \"Read\",\n entityId: id,\n entityType: \"User\",\n };\n const index = autoShare.findIndex((item) => item.entityId === id);\n let temp = [];\n if (index !== -1) {\n temp = autoShare.filter((item) => item.entityId !== id);\n } else {\n temp = [...autoShare, obj];\n }\n const uniqueTemp = Array.from(\n new Set(temp.map((item) => item.entityId))\n ).map((entityId) => temp.find((item) => item.entityId === entityId));\n setAutoShare(uniqueTemp);\n };\n const updateAutoShareAccess = (id, type) => {\n if ((url.includes(\"Settings\") || url.includes(\"edit\")) && openingsId) {\n permissionHandler(\"candidateShare\", id, type);\n }\n let index = autoShare.findIndex((x) => x.entityId === id);\n let temp = [...autoShare];\n temp[index].permission = type;\n const uniqueTemp = Array.from(\n new Set(temp.map((item) => item.entityId))\n ).map((entityId) => temp.find((item) => item.entityId === entityId));\n setAutoShare(uniqueTemp);\n };\n\n const permissionHandler = (key, RecId, value) => {\n const tsd = tenantSettings?.data?.shareSetting;\n const pr = selectedAgents.find((x) => x.id === RecId);\n const acsw = GlobalState?.autoCandidateSharedWith.find(\n (x) => x.entityId === RecId\n );\n\n let obj = {\n autoCandidateSharedWith: acsw ?? null,\n principal: pr,\n prime: GlobalState?.prime,\n shareHistorical: true,\n };\n\n switch (key) {\n case \"prime\":\n obj.prime = value;\n break;\n case \"toggle\":\n if (value === false) {\n obj.autoCandidateSharedWith = null;\n } else if (value === true) {\n obj.autoCandidateSharedWith = {\n permission: tsd?.candidate?.individual ?? \"Read\",\n entityId: RecId,\n entityType: \"User\",\n };\n }\n break;\n case \"openingPermission\":\n if (pr) {\n pr.name = value;\n obj.principal = pr;\n }\n break;\n case \"candidateShare\":\n if (acsw) {\n acsw.permission = value;\n obj.autoCandidateSharedWith = acsw;\n }\n break;\n default:\n break;\n }\n\n dispatch(updatePrincipalAction(openingsId, obj));\n };\n\n useEffect(() => {\n if (autoShare?.length > 0) {\n setGlobalState({\n ...GlobalState,\n autoCandidateSharedWith: autoShare,\n });\n }\n }, [autoShare]);\n\n return (\n \n {duplicate && (\n
\n
Position name
\n \n setGlobalState({ ...GlobalState, positionName: e.target.value })\n }\n />\n
\n )}\n
\n
Share with
\n
\n \n option.children.toLowerCase().includes(input.toLowerCase())\n }\n >\n {options}\n \n
\n
\n
\n {!loading && !Loader && (\n
\n {agents?.data?.length > 0 &&\n selectedAgents?.map((v, index) => {\n let res = agents?.data?.find((x) => x._id === v.id);\n if (!res) {\n const team = teams?.data?.find((x) => x._id === v.id);\n if (team) {\n res = { ...team, fname: team.name };\n }\n }\n return (\n \n \n \n \n {res?.fname?.length > 0\n ? res?.fname[0]?.toUpperCase()\n : \"UR\"}\n \n \n \n
\n {res?.fname\n ? truncateSt(\n res?.fname +\n \" \" +\n (res?.lname ? res?.lname : \"\"),\n 14\n )\n : \"User\"}\n
\n
\n {selectedAgents?.length > 1 &&\n user?.userProfile?._id !== v.id && (\n
\n {\n let index = selectedAgents?.findIndex(\n (x) => x.id === v.id\n );\n if (index !== -1) {\n let asTemp = [...autoShare];\n let acIndex = autoShare.findIndex(\n (x) => x.entityId === v.id\n );\n if (acIndex !== -1) {\n asTemp.splice(acIndex, 1);\n }\n setTimeout(() => {\n setAutoShare(asTemp);\n }, 1000);\n let temp = [...selectedAgents];\n temp?.splice(index, 1);\n setselectedAgents(temp);\n if (\n (url.includes(\"Settings\") ||\n url.includes(\"edit\")) &&\n openingsId\n ) {\n let acsw =\n GlobalState?.autoCandidateSharedWith.find(\n (x) => x.entityId === v.id\n );\n let obj = {\n autoCandidateSharedWith: acsw ?? null,\n principal: selectedAgents.find(\n (x) => x.id === v.id\n ),\n prime: \"\",\n shareHistorical: true,\n };\n dispatch(\n removePrincipalAction(openingsId, obj)\n );\n }\n }\n }}\n />\n
\n )}\n
\n \n \n {truncateSt(res?.email, 18)}\n \n \n \n \n {\" \"}\n {ReactHtmlParser(res?.info?.emailSignature?.o)}\n
\n }\n >\n {res?.info?.emailSignature?.o ? (\n \n View Signature\n \n ) : (\n \"NA\"\n )}\n \n \n \n Primary User\n {\n setPrime(Prime !== v.id ? v.id : \"\");\n if (\n ((url.includes(\"Settings\") ||\n url.includes(\"edit\")) &&\n openingsId &&\n Prime !== v.id) ||\n val === false\n ) {\n permissionHandler(\n \"prime\",\n v.id,\n val === false ? \"\" : v.id\n );\n }\n }}\n >\n \n \n
Opening Access
\n {\n let index = selectedAgents?.findIndex(\n (x) => x.id === v.id\n );\n let temp = [...selectedAgents];\n temp[index].name = val;\n setselectedAgents(temp);\n if (val === \"Read\") {\n let index = autoShare?.findIndex(\n (x) => x.entityId === v.id\n );\n let tp = [...autoShare];\n if (index > 0) {\n tp[index].permission = val;\n }\n }\n if (\n (url.includes(\"Settings\") ||\n url.includes(\"edit\")) &&\n openingsId\n ) {\n permissionHandler(\"openingPermission\", v.id, val);\n }\n }}\n >\n Owner\n Edit\n Read\n \n
\n \n Auto Share Candidates\n x.entityId === v.id)\n ? true\n : false\n }\n onChange={(val) => {\n updateAutoShare(v.id, val);\n }}\n >\n x.entityId === v.id)\n ? \"w-100\"\n : \"overLoayGm w-100 p-1\"\n }\n >\n {\" \"}\n
Candidate Share Access
\n x.entityId === v.id)\n ?.permission\n }\n onChange={(val) => {\n updateAutoShareAccess(v.id, val);\n }}\n >\n {(selectedAgents?.find((x) => x.id === v.id)?.name ===\n \"Edit\" ||\n selectedAgents?.find((x) => x.id === v.id)?.name ===\n \"Owner\") && (\n Edit\n )}\n Read\n \n
\n \n \n );\n })}\n \n )}\n {selectedAgents?.length > 0 && loading && (\n
\n \n
\n )}\n \n \n \n \n \n
\n {\" \"}\n Alert\n
\n
\n Do you want to grant this recruiter edit rights to the position and\n its candidates?\n
\n
\n handleChange(consentModal, \"modal\", \"no\")}\n >\n No\n \n handleChange(consentModal, \"modal\", \"yes\")}\n >\n Yes\n \n
\n
\n \n );\n};\n\nexport default ShareJob;\n","import { CXInput } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport * as moment from \"moment-timezone\";\nimport OptionSelect from \"component/OptionSelect\";\nimport history from \"utils/history\";\nimport { CXModal } from \"component/Modal\";\nimport AddCompany from \"screen/UserPortal/Company/AddCompany\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\nimport LocationSearch from \"component/LocationSearch\";\n\nconst Position = ({\n GlobalState,\n setGlobalState,\n MandatoryError,\n setOpeningVariables,\n OpeningVariables,\n}) => {\n console.log(OpeningVariables, \"OpeningVariables==\");\n const { allCompanies } = useSelector((state) => state.OpeningReducer);\n const { accountVariablesDefinition, loading } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n const [addCompany, setaddCompany] = useState(false);\n const handleChange = (value, key) => {\n setGlobalState({ ...GlobalState, [key]: value });\n };\n useEffect(() => {\n if (!GlobalState?.timeZone) {\n handleChange(\"Asia/Kolkata\", \"timeZone\");\n }\n }, []);\n return (\n
\n
\n 0\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n
\n Company Name *\n
\n
\n {\n if (e === \"addCompany\") {\n // history.push(\"/admin/company/add\");\n setaddCompany(true);\n return;\n }\n handleChange(e, \"cId\");\n }}\n defaultValue={GlobalState?.cId?._id}\n filterOption={(input, option) =>\n option.children.toLowerCase().includes(input.toLowerCase())\n }\n >\n \n Add Company\n \n {allCompanies?.data?.map((res) => {\n return {res.name};\n })}\n \n
\n
\n
\n 0\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n
\n Role Name *\n
\n
\n handleChange(e.target.value, \"positionName\")}\n defaultValue={GlobalState?.positionName}\n />\n
\n
\n \n
\n
\n
Type of Work
\n
\n {/* handleChange(e.target.value, \"description\")}\n defaultValue={GlobalState?.description}\n /> */}\n {\n handleChange(value, \"description\");\n }}\n defaultValue={GlobalState?.description}\n >\n Onsite\n Remote\n Hybrid\n \n
\n
\n
\n {\" \"}\n {/*
\n
\n
\n
Skills Needed
\n
\n {\n const tagsArray = value.map((tag) => {\n return { name: tag };\n });\n handleChange(tagsArray, \"desiredSkills\");\n }}\n defaultValue={GlobalState?.desiredSkills?.map(\n (res) => res.name\n )}\n >\n
\n
\n
\n
*/}\n
\n {/*
\n
\n
Department
\n
\n {\n handleChange(value, \"dept\");\n }}\n defaultValue={GlobalState?.dept}\n />\n
\n
\n
*/}\n
\n
\n 0\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n
\n Location *\n
\n
\n {/* {\n setGlobalState({\n ...GlobalState,\n location: {\n name: value?.name ?? \"\",\n city:\n value?.address_components.find((d) =>\n d.types.includes(\"locality\")\n )?.long_name ?? \"\",\n region:\n value?.address_components.find((d) =>\n d.types.includes(\"administrative_area_level_1\")\n ).long_name ?? \"\",\n country:\n value?.address_components.find((d) =>\n d.types.includes(\"country\")\n ).long_name ?? \"\",\n fullAddress: value?.formatted_address ?? \"\",\n placeId: key,\n },\n });\n }}\n defaultValue={\n GlobalState?.location?.name ??\n GlobalState?.location?.fullAddress\n }\n /> */}\n \n setGlobalState({\n ...GlobalState,\n location: {\n name: e.target.value ?? \"\",\n city: e.target.value ?? \"\",\n region: \"\",\n country: \"\",\n fullAddress: \"\",\n },\n })\n }\n defaultValue={\n GlobalState?.location?.fullAddress?.length > 0\n ? GlobalState?.location?.fullAddress\n : GlobalState?.location?.name\n }\n />\n
\n
\n \n 0\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n
\n TimeZone *\n
\n
\n handleChange(value, \"timeZone\")}\n >\n {moment?.tz?.names()?.map((tz) => {\n return (\n \n {tz}\n \n );\n })}\n \n
\n
\n \n
\n
Opening variables
\n {loading && OpeningVariables?.length === 0 && (\n
\n \n
\n )}\n {!loading && OpeningVariables?.length > 0 && (\n
\n {accountVariablesDefinition?.data?.map((res) => {\n let opID = OpeningVariables?.find((d) => d?.name === res?.name)?.res\n ?._id;\n return (\n d?.name === res?.name && d?.value?.length > 0\n )\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n {res.name}{\" \"}\n {res?.required && *}\n
\n {res.type !== \"dropdown\" && (\n d?.name === res?.name)\n ?.value\n }\n onChange={(e) => {\n setOpeningVariables((prevVariables) => {\n const filteredVariables = prevVariables?.filter(\n (variable) => variable?.name !== res?.name\n );\n return [\n ...filteredVariables,\n {\n name: res?.name,\n value: e?.target?.value,\n },\n ];\n });\n }}\n />\n )}\n {res.type === \"dropdown\" && (\n d?.name === res?.name)\n ?.value\n }\n onChange={(value) => {\n setOpeningVariables((prevVariables) => {\n const filteredVariables = prevVariables?.filter(\n (variable) => variable?.name !== res?.name\n );\n return [\n ...filteredVariables,\n {\n name: res?.name,\n value: value,\n },\n ];\n });\n }}\n >\n {res.variableOptions.map((option) => {\n return {option};\n })}\n \n )}\n \n );\n })}\n
\n )}\n \n \n \n \n );\n};\n\nexport default Position;\n","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput } from \"component/Input\";\nimport React, { useState } from \"react\";\nimport { Form } from \"antd\";\nimport { post } from \"helper/networkClient\";\n\nconst AiPrompt = ({ url, Value, label, setDataLoading }) => {\n const [loading, setloading] = useState(false);\n const [form] = Form.useForm();\n const onFinish = async (values) => {\n setloading(true);\n setDataLoading(true);\n try {\n const response = await post(url, values);\n Value(response.data.data);\n setloading(false);\n setDataLoading(false);\n } catch (error) {\n setloading(false);\n setDataLoading(false);\n }\n };\n return (\n \n \n \n \n \n \n
\n \n
\n {label}\n \n
\n
\n );\n};\n\nexport default AiPrompt;\n","import { LoadingOutlined } from \"@ant-design/icons\";\nimport { notification } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { post } from \"helper/networkClient\";\nimport React, { useRef, useState } from \"react\";\n\nconst TextExtract = ({ url, Value, label, style, setDataLoading }) => {\n const [loading, setloading] = useState(false);\n const fileInputRef = useRef();\n\n const onFileChange = async (event) => {\n const file = event.target.files[0];\n if (!file) {\n console.log(\"No file chosen\");\n }\n if (\n ![\n \"application/pdf\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n ].includes(file.type)\n ) {\n return notification.error({\n message: \"Error\",\n description: \"Only PDF & docx file is allowed\",\n });\n }\n setloading(true);\n setDataLoading(true);\n const reader = new FileReader();\n reader.onload = async (event) => {\n const arrayBuffer = event.target.result;\n const dataBuffer = new Uint8Array(arrayBuffer);\n const body = Array.from(dataBuffer);\n try {\n const response = await post(url, {\n dataBuffer: body,\n fileType: file.type === \"application/pdf\" ? \"pdf\" : \"docx\",\n });\n Value(response.data.data);\n setloading(false);\n setDataLoading(false);\n return;\n } catch (error) {\n setloading(false);\n setDataLoading(false);\n }\n };\n reader.readAsArrayBuffer(file);\n event.target.value = null;\n };\n\n const onButtonClick = () => {\n fileInputRef.current.click();\n };\n\n return (\n
\n \n
\n \n
\n \n
\n {label}\n \n
\n
\n );\n};\n\nexport default TextExtract;\n","import { ExpandOutlined } from \"@ant-design/icons\";\nimport AiPrompt from \"component/AiPrompt\";\nimport { CXButton } from \"component/Button\";\nimport { CXTextArea } from \"component/Input\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXMarkdownDescriptionEditorHTML } from \"component/MarkdownEditor\";\nimport { CXModal } from \"component/Modal\";\nimport { CXRadioButton, CXRadioGroup } from \"component/Radio\";\nimport TextExtract from \"component/TextExtract\";\nimport React, { useState } from \"react\";\n\nconst JobDescription = ({ GlobalState, setGlobalState, MandatoryError }) => {\n const [fullView, setfullView] = useState(false);\n const handleChange = (value, key) => {\n setGlobalState({ ...GlobalState, [key]: value });\n };\n const [jdType, jdTypeType] = useState(\"m\");\n const [DataLoading, setDataLoading] = useState(false);\n return (\n
\n
\n {\n jdTypeType(e.target.value);\n }}\n >\n Add Manually\n Add Using PDF / DOC\n Generate Using AI\n \n
\n {jdType === \"a\" && (\n
\n handleChange(data, \"jd\")}\n label=\"Generate using AI\"\n setDataLoading={(data) => setDataLoading(data)}\n />\n
\n )}\n {jdType === \"p\" && (\n
\n handleChange(data, \"jd\")}\n label=\"Select PDF / DOC\"\n style={{ width: 477, justifyContent: \"center\" }}\n setDataLoading={(data) => setDataLoading(data)}\n />\n
\n )}\n {jdType !== \"m\" && DataLoading && (\n
\n
\n \n

\n Processing your request, please hold on...\n

\n
\n
\n )}\n {(jdType === \"m\" || GlobalState?.jd?.length > 0) && !DataLoading && (\n
\n 0\n ? \"1px solid red\"\n : \"\",\n }}\n >\n
\n
\n
\n {\" \"}\n Job Description *\n
\n
\n {\n setfullView(true);\n }}\n />\n
\n
\n
\n console.log(data)}\n onModelChange={(data) => handleChange(data, \"jd\")}\n placeholder=\"Enter the job description\"\n />\n
\n
\n
\n \n )}\n \n
\n
\n
\n Job Description *\n
\n {\n setfullView(false);\n }}\n >\n Close\n \n
\n console.log(data)}\n onModelChange={(data) => handleChange(data, \"jd\")}\n placeholder=\"Enter the job description\"\n />\n
\n \n \n );\n};\n\nexport default JobDescription;\n","import { getAllbots } from \"action/WorkbenchAction\";\nimport { CXCol } from \"component/Col\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXRow } from \"component/Row\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { truncateSt } from \"utils\";\nimport { useLocation } from \"react-router-dom\";\n\nconst BotSelection = ({ GlobalState, setGlobalState, MandatoryError }) => {\n const location = useLocation();\n const dispatch = useDispatch();\n const BotList = useSelector((state) => state.WrokbenchReducer.Bots);\n const Loader = useSelector((state) => state.WrokbenchReducer.botSkeleton);\n const [dittoId, setditto] = useState(null);\n useEffect(() => {\n dispatch(getAllbots());\n }, []);\n useEffect(() => {\n if (dittoId || location.pathname.includes(\"/edit\")) {\n setGlobalState({\n ...GlobalState,\n dittoId: dittoId,\n });\n }\n }, [dittoId]);\n useEffect(() => {\n if (GlobalState?.dittoId || GlobalState?.dittoId === null) {\n setditto(GlobalState?.dittoId);\n }\n }, []);\n\n useEffect(() => {\n if (\n BotList &&\n BotList?.length > 0 &&\n !dittoId &&\n !location.pathname.includes(\"/edit\")\n ) {\n setditto(BotList[0]?.id);\n }\n }, [BotList]);\n return (\n
\n {\" \"}\n \n \n Bot List{\" \"}\n {MandatoryError && !dittoId && (\n \n * At least one bot selection is required.\n \n )}\n \n \n {Loader && (\n \n {[...Array(6)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {!Loader && (\n \n \n {BotList &&\n BotList?.map((res) => {\n return (\n \n
\n
\n
\n
{truncateSt(res.name, 22)}
\n
\n
\n
\n
\n
Activate
\n {\n if (e) {\n setditto(res?.id);\n } else {\n if (location.pathname.includes(\"/edit\")) {\n setditto(null);\n }\n }\n }}\n >\n
\n
\n
\n
\n );\n })}\n
\n
\n )}\n \n );\n};\n\nexport default BotSelection;\n","import { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { CXStep, CXSteps } from \"component/Steps\";\nimport history from \"utils/history\";\nimport \"./style.css\";\nimport { Button } from \"antd\";\nimport Position from \"./Position\";\nimport JobDescription from \"./JobDescription\";\nimport QualifierQuestions from \"./QualifierQuestions\";\nimport ShareJob from \"./ShareJob\";\nimport {\n createOpenPositionTrigger,\n getAllCompaniesTrigger,\n getWorkflowCAbyOpening,\n updateOpenPositionTrigger,\n getWfType,\n getCandidateStageTrigger,\n getOpeningByIdTrigger,\n} from \"action/OpeningsAction\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXModal } from \"component/Modal\";\nimport SettingsSequences from \"../SettingsSequences\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport BotSelection from \"./BotSelection\";\nimport { getCampaigns } from \"action/CampaignAction\";\nimport { useLocation } from \"react-router-dom\";\nimport { getCookie, transformString } from \"utils\";\nimport {\n getAccountVariablesDefinition,\n getAccountVariablesForOpening,\n updateAccountVariablesForOpening,\n} from \"action/AccountVariables\";\n\nconst AddPosition = ({\n duplicate = false,\n duplicateId = null,\n close = () => {},\n setOpeningList = () => {},\n}) => {\n const { openingsId } = useParams();\n const dispatch = useDispatch();\n const [GlobalState, setGlobalState] = useState({});\n console.log(\"GlobalState===>\", GlobalState);\n const [current, setCurrent] = useState(0);\n const [MandatoryError, setMendetory] = useState(false);\n const { openPositions, openPositionData, action } = useSelector(\n (state) => state.OpeningReducer\n );\n const { agents } = useSelector((state) => state.AgentReducer);\n const { CampaignsList } = useSelector((state) => state.CampaignReducer);\n const [editComponentLoad, seteditComponentLoad] = useState(true);\n const [SelectedWF, setSelectedWF] = useState([]);\n const [openModal, setOpenModal] = useState(false);\n const [FinalLoading, setFinalLoading] = useState(false);\n const [SequenceSetting, setSequenceSetting] = useState(false);\n const [StepsCheck, setStepsCheck] = useState([]);\n const location = useLocation();\n const [OpeningVariables, setOpeningVariables] = useState([]);\n\n const { openingAccountVariables, accountVariablesDefinition } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n useEffect(() => {\n dispatch(getAccountVariablesDefinition());\n if (!duplicate)\n if (openingsId) {\n setStepsCheck(stepsUpdate);\n } else {\n setStepsCheck(steps);\n dispatch({ type: \"GET_WF_TYPE_TRIGGER\", data: [] });\n }\n if (duplicate) {\n setStepsCheck(duplicateSteps);\n }\n }, []);\n const stepItems = [\n {\n title: \"Position Details\",\n },\n {\n title: \"Job Description\",\n },\n {\n title: \"Qualifier Questions\",\n },\n {\n title: \"Share With Team\",\n },\n {\n title: \"Select a Bot\",\n },\n // {\n // title: \"Use Workflow\",\n // },\n ];\n useEffect(() => {\n dispatch(getAllCompaniesTrigger());\n return () => {\n setGlobalState({});\n };\n }, []);\n useEffect(() => {\n if (openingsId) {\n dispatch(getOpeningByIdTrigger(openingsId));\n dispatch(getWorkflowCAbyOpening({ openingId: openingsId }));\n dispatch(getWfType(openingsId));\n dispatch(getAccountVariablesForOpening(openingsId));\n }\n dispatch(GetAllConfig());\n }, [openingsId]);\n useEffect(() => {\n if (duplicateId) {\n dispatch(getWorkflowCAbyOpening({ openingId: duplicateId }));\n dispatch(GetAllConfig());\n dispatch(getCampaigns({ openingId: duplicateId }));\n dispatch(getWfType(duplicateId));\n dispatch(getOpeningByIdTrigger(duplicateId));\n }\n }, [duplicateId]);\n\n useEffect(() => {\n dispatch(getAllCompaniesTrigger());\n dispatch(getCandidateStageTrigger());\n setTimeout(() => {\n seteditComponentLoad(false);\n }, 1000);\n }, []);\n\n useEffect(() => {\n if ((openingsId || duplicateId) && openPositions?.data?.length > 0) {\n let opId = duplicateId ? duplicateId : openingsId;\n let data = openPositions?.data?.filter((item) => item._id === opId)[0];\n let principal = data?.permissions?.map((res) => {\n let extracted = transformString(res.principal);\n let { id, type } = extracted;\n return { name: res?.name, id, type };\n });\n if (data?.permissions) {\n let { permissions, ...rest } = data;\n rest.principal = principal;\n setGlobalState(rest);\n } else {\n setGlobalState(data);\n }\n if (!openingsId) {\n setCurrent(0);\n }\n }\n }, [openingsId, openPositions, duplicateId]);\n useEffect(() => {\n if (openingsId && openingAccountVariables?.data?.length > 0) {\n setOpeningVariables(\n openingAccountVariables?.data?.map((res) => {\n return {\n name: res.name,\n value: res.value,\n };\n })\n );\n } else if (!openingsId) {\n let g = accountVariablesDefinition?.data?.map((res) => {\n return {\n name: res.name,\n value: \"\",\n };\n });\n\n setOpeningVariables(g);\n }\n }, [openingAccountVariables, accountVariablesDefinition]);\n\n useEffect(() => {\n if (openPositionData) {\n if (openPositionData?._id) {\n dispatch(getWorkflowCAbyOpening({ openingId: openPositionData?._id }));\n dispatch(\n updateAccountVariablesForOpening({\n openingsId: openPositionData?._id,\n accountData: OpeningVariables,\n })\n );\n }\n setTimeout(() => {\n setFinalLoading(false);\n }, 2000);\n setTimeout(() => {\n setSequenceSetting(true);\n }, 3000);\n }\n }, [openPositionData]);\n\n useEffect(() => {\n if (action === \"POSITION_DATA_ERROR\") {\n dispatch({\n type: \"RESPONSE_CLONE_ERROR\",\n data: null,\n });\n setOpenModal(false);\n setFinalLoading(false);\n }\n }, [action]);\n\n useEffect(() => {\n if (duplicateId) {\n let wf = CampaignsList.data?.map((item) => item._id);\n setSelectedWF(wf);\n }\n }, [CampaignsList]);\n const CancelModal = () => {\n dispatch({\n type: \"POSITION_DATA_RESPONSE\",\n data: null,\n });\n history.push(\"/admin/openings\");\n close(null);\n setOpenModal(false);\n };\n const steps = [\n ,\n ,\n ,\n ,\n ,\n // ,\n ];\n const stepsUpdate = [\n ,\n ,\n ,\n ,\n ,\n ];\n const stepduplicate = [\n {\n title: \"Share With Team\",\n },\n {\n title: \"Select a Bot\",\n },\n ];\n const duplicateSteps = [\n ,\n ,\n ];\n const next = () => {\n if (!duplicate) {\n if (current === 0) {\n if (\n GlobalState?.positionName?.length > 0 &&\n (GlobalState?.cId?.length > 0 || GlobalState?.cId?._id.length > 0) &&\n GlobalState?.timeZone?.length > 0 &&\n GlobalState?.location?.name?.length > 0 &&\n OpeningVariables?.length ===\n accountVariablesDefinition?.data?.length &&\n OpeningVariables?.every((d) => {\n const accountVariable = accountVariablesDefinition?.data?.find(\n (a) => a?.name === d?.name\n );\n\n if (accountVariable?.required) {\n return d?.value?.length > 0;\n }\n\n return true;\n })\n ) {\n setCurrent(current + 1);\n setMendetory(false);\n } else {\n setMendetory(true);\n }\n } else if (current === 1) {\n if (GlobalState?.jd?.length > 0) {\n setCurrent(current + 1);\n setMendetory(false);\n } else {\n setMendetory(true);\n }\n } else if (current === 2) {\n if (GlobalState?.qualifiers?.length === 0) {\n setCurrent(current + 1);\n setMendetory(false);\n } else if (\n GlobalState?.qualifiers?.length > 0 &&\n GlobalState?.qualifiers?.every(\n (obj) => obj.q !== undefined && obj.q !== null && obj.q !== \"\"\n )\n ) {\n setCurrent(current + 1);\n setMendetory(false);\n } else {\n setMendetory(true);\n }\n } else if (current === 4) {\n if (GlobalState?.dittoId?.length > 0) {\n setCurrent(current + 1);\n setMendetory(false);\n } else {\n setMendetory(true);\n }\n } else {\n setCurrent(current + 1);\n }\n }\n if (duplicate) {\n if (current === 0) {\n setCurrent(current + 1);\n setMendetory(false);\n } else if (current === 1) {\n if (GlobalState?.dittoId?.length > 0) {\n setCurrent(current + 1);\n setMendetory(false);\n } else {\n setMendetory(true);\n }\n } else {\n setCurrent(current + 1);\n }\n }\n };\n const prev = () => {\n setCurrent(current - 1);\n };\n const finshSteps = () => {\n setFinalLoading(true);\n if (openingsId && !duplicate) {\n let { _id, createdAt, createdBy, tenantId, location, __v, ...rest } =\n GlobalState;\n if (rest?.cId?._id) {\n rest.cId = rest.cId?._id;\n }\n let updatedLoc = {\n name: location?.name,\n _id: location?._id,\n };\n rest.location = updatedLoc;\n\n dispatch(updateOpenPositionTrigger(openingsId, rest));\n dispatch(\n updateAccountVariablesForOpening({\n openingsId,\n accountData: OpeningVariables,\n })\n );\n } else {\n if (!duplicate) {\n let { ...rest } = GlobalState;\n dispatch(createOpenPositionTrigger(rest));\n }\n }\n if (duplicate) {\n let {\n _id,\n createdAt,\n createdBy,\n tenantId,\n location,\n __v,\n permissions,\n ...rest\n } = GlobalState;\n if (rest?.cId?._id) {\n rest.cId = rest.cId?._id;\n }\n let updatedLoc = {\n name: location?.name,\n _id: location?._id,\n };\n // let principal = permissions?.map((item) => {\n // let extracted = transformString(item.principal);\n // return {\n // name: item?.name,\n // id: extracted.id,\n // type: extracted.type,\n // };\n // });\n // rest.principal = principal;\n rest.location = updatedLoc;\n dispatch(createOpenPositionTrigger(rest, _id));\n dispatch(\n updateAccountVariablesForOpening({\n openingsId: _id,\n accountData: OpeningVariables,\n })\n );\n setOpeningList();\n }\n // history.push(\"/admin/openings\");\n setGlobalState({});\n };\n useEffect(() => {\n return () => {\n setOpeningVariables([]);\n dispatch({ type: \"ACCOUNT_VARIABLES_OPENING_RESPONSE\", data: [] });\n };\n }, []);\n\n return (\n \n \n \n \n {!duplicate && (\n {\n history.push(\"/admin/openings\");\n }}\n src=\"/images/openings/backIcon.svg\"\n className=\"mr-2 cursor-pointer\"\n alt=\"back\"\n />\n )}{\" \"}\n {!duplicate && openingsId\n ? \"Update Position\"\n : !duplicate && \"Add Position\"}\n {duplicate && \"Duplicate Position\"}\n \n
\n
\n {current > 0 && (\n prev()}\n >\n Previous\n \n )}\n {current < StepsCheck?.length - 1 && (\n next()}\n >\n Next step\n \n )}\n {current === StepsCheck?.length - 1 && (\n {\n finshSteps();\n setOpenModal(true);\n }}\n >\n {openingsId ? \"Update\" : \"Create\"}\n \n )}\n
\n
\n
\n {editComponentLoad && (\n \n )}\n {!editComponentLoad && (\n \n
\n
\n \n {!duplicate &&\n stepItems?.map((item, i) => {\n if (openingsId) {\n if (i < 5) {\n return (\n \n );\n }\n } else {\n return (\n \n );\n }\n })}\n {duplicate &&\n stepduplicate.map((item, i) => {\n return (\n \n );\n })}\n \n
\n
\n \n {openingsId && !duplicate\n ? stepsUpdate[current]\n : !duplicate && steps[current]}\n {duplicate && duplicateSteps[current]}\n
\n
\n
\n )}\n
\n \n
\n {FinalLoading && !SequenceSetting && (\n
\n \n

\n Please wait while we are creating position\n

\n
\n )}\n
\n
\n {!FinalLoading && !SequenceSetting && (\n
\n \n

successfully added

\n
\n )}\n
\n {SequenceSetting && (\n
\n \n
\n )}\n \n
\n );\n};\n\nexport default AddPosition;\n","import {\n addCandidatetoFlow,\n addCandidatetoFlowCheck,\n} from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport \"./style.css\";\n\nconst Index = ({\n setopenWorkflowCheck,\n wfId,\n target,\n setSelectedWF,\n setSelectedRowKeys,\n setcheckKey,\n SelectedWFName,\n from,\n targetType,\n}) => {\n const dispatch = useDispatch();\n const { action, workFlowCheck, allCandidatesByPosition } = useSelector(\n (state) => state.OpeningReducer\n );\n const [CheckingWorkflow, setCheckingWorkflow] = useState(true);\n const [WorkFlowMatched, setWorkFlowMatched] = useState(false);\n const [AddedSucess, setAddedSucess] = useState(false);\n const [AddingCandidates, setAddingCandidates] = useState(false);\n const [triggerCampaign, settriggerCampaign] = useState(false);\n useEffect(() => {\n dispatch(\n addCandidatetoFlowCheck({\n wfId,\n target,\n targetType,\n })\n );\n }, [wfId, target]);\n\n useEffect(() => {\n if (\n !CheckingWorkflow &&\n action === \"ADD_CANDIDATE_TO_FLOW_CHECK\" &&\n workFlowCheck?.data?.length > 0\n ) {\n setWorkFlowMatched(true);\n } else {\n if (workFlowCheck?.data?.length === 0 && !CheckingWorkflow) {\n setAddingCandidates(true);\n dispatch(\n addCandidatetoFlow({\n wfId,\n target,\n targetType,\n })\n );\n }\n }\n }, [CheckingWorkflow]);\n\n useEffect(() => {\n if (action === \"ADD_CANDIDATE_TO_FLOW_CHECK\") {\n setCheckingWorkflow(false);\n }\n if (action === \"CANDIDATE_ADDED_TO_FLOW\") {\n setWorkFlowMatched(false);\n setAddedSucess(true);\n settriggerCampaign(false);\n }\n }, [action]);\n const triggerAdd = () => {\n setAddingCandidates(true);\n settriggerCampaign(true);\n dispatch(\n addCandidatetoFlow({\n wfId,\n target,\n targetType,\n })\n );\n };\n\n const removeCandidate = (id) => {\n setSelectedRowKeys(target.filter((res) => res !== id));\n };\n\n return (\n \n {AddingCandidates &&\n !AddedSucess &&\n !WorkFlowMatched &&\n !CheckingWorkflow && (\n
\n
\n \n
\n

Adding candidates to workflow..

\n
\n )}\n {CheckingWorkflow && (\n
\n
\n \n
\n

checking workflow..

\n
\n )}\n {!WorkFlowMatched && AddedSucess && !CheckingWorkflow && (\n
\n \n

successfully added

\n
\n )}\n {!CheckingWorkflow && WorkFlowMatched && (\n
\n
\n Following candidates are already under sequence{\" \"}\n {SelectedWFName}. Do you wish to\n proceed adding the candidates to the sequence ?\n
\n\n
\n {workFlowCheck?.data?.map((res) => {\n if (target.includes(res?._id))\n return (\n
\n
\n \n {\n allCandidatesByPosition?.data?.find(\n (vals) => vals?._id === res?._id\n )?.data?.name\n }\n \n added to workflow on{\" \"}\n {moment(res?.createdAt).format(\"DD/MM/YY\")}\n
\n
\n |\n removeCandidate(res?._id)}\n />\n
\n
\n );\n })}\n
\n
\n )}\n {!CheckingWorkflow && (WorkFlowMatched || AddedSucess) && (\n
\n {\n setopenWorkflowCheck(false);\n setSelectedWF(null);\n setSelectedRowKeys([]);\n setcheckKey([]);\n dispatch({\n type: \"CANDIDATE_ADDED_TO_FLOW_CLOSED\",\n });\n setCheckingWorkflow(true);\n setWorkFlowMatched(false);\n setAddedSucess(false);\n }}\n >\n Close\n \n {!AddedSucess && (\n {\n triggerAdd();\n }}\n >\n Add to Campaign\n \n )}\n
\n )}\n \n );\n};\n\nexport default Index;\n","import { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport moment from \"moment\";\nimport React from \"react\";\n\nconst DuplicateCandidateAlert = ({\n duplicateData,\n agents,\n setduplicateData,\n openingListChecking,\n closeModal = () => {},\n footer = true,\n}) => {\n return (\n \n
Duplicate Alert
\n {!openingListChecking && (\n
\n {duplicateData?.map((res) => {\n return (\n
\n
Name: {res?.data?.name}
\n
Email: {res?.data?.email}
\n
Phone: {res?.data?.phone}
\n\n
\n
In following
\n {res?.candidates?.map((r) => {\n let ag = agents?.data?.find((d) => d._id === r?.owner);\n return (\n
\n
\n
\n {r?.opening?.name}{\" \"}\n at{\" \"}\n \n {r?.opening?.company?.name ?? \"unshared\"}\n \n
\n
\n Stage :{\" \"}\n \n {r?.stageName ?? \"-\"}\n {\" \"}\n
\n
\n Created at{\" \"}\n \n {r?.createdAt\n ? moment(r?.createdAt).format(\"DD-MM-YYYY\")\n : \"NA\"}\n \n
\n
\n Created by{\" \"}\n \n {ag?.fname} {ag?.lname}\n \n
\n {r?.userHasAccess && (\n {\n let url = `/admin/openings/${r?.opening?.id}/candidate/${r?.contactId}`;\n window.open(url, \"_blank\");\n }}\n >\n Preview\n \n
\n )}\n {!r?.userHasAccess && (\n
\n {\" \"}\n Access to view opening is not granted{\" \"}\n
\n )}\n
\n
\n \n );\n })}\n \n \n );\n })}\n \n )}\n {openingListChecking && (\n \n )}\n
\n {footer && (\n \n Are you sure you want to add this candidate?\n
\n )}\n
\n {\n footer ? setduplicateData(null) : closeModal(false);\n }}\n >\n Cancel\n \n {footer && (\n {\n setduplicateData(null);\n }}\n >\n Yes Proceed\n \n )}\n
\n \n \n );\n};\n\nexport default DuplicateCandidateAlert;\n","import { PlusCircleOutlined } from \"@ant-design/icons\";\nimport { Form, Input, notification, Popconfirm } from \"antd\";\nimport { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTable } from \"component/Table\";\nimport React, { useContext, useEffect, useRef, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { CXSwitch } from \"component/Switch\";\nimport TagsSearch from \"component/TagsSearch\";\nimport { getCandidateStageTrigger } from \"action/OpeningsAction\";\nimport { generateUniqueKey } from \"utils\";\nconst EditableContext = React.createContext(null);\nconst EditableRow = ({ index, ...props }) => {\n const [form] = Form.useForm();\n return (\n \n \n
\n \n \n );\n};\n\nconst StepTwo = ({\n dataSource,\n setDataSource,\n headersList,\n setUpdateExisting,\n UpdateExisting,\n addTag,\n Tag,\n setStageId,\n}) => {\n const dispatch = useDispatch();\n const EditableCell = ({\n title,\n editable,\n children,\n dataIndex,\n record,\n handleSave,\n ...restProps\n }) => {\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const [editing, setEditing] = useState(false);\n const inputRef = useRef(null);\n const form = useContext(EditableContext);\n\n useEffect(() => {\n if (editing) {\n inputRef?.current?.focus();\n }\n }, [editing]);\n const toggleEdit = () => {\n setEditing(!editing);\n form.setFieldsValue({\n [dataIndex]: record[dataIndex],\n });\n };\n const save = async () => {\n try {\n const values = await form.validateFields();\n toggleEdit();\n handleSave({\n ...record,\n ...values,\n });\n } catch (errInfo) {\n console.log(\"Save failed:\", errInfo);\n }\n };\n let childNode = children;\n if (editable) {\n childNode = editing ? (\n dataIndex === \"uf\" ? (\n \n \n \n ) : (\n \n \n Select;\n {contactForm?.formItems?.map((item) => {\n if (!dataSource?.find((e) => e?.zf === item?.key))\n if (item?.key !== \"company\" && item?.isActive) {\n return (\n \n {item?.key}\n \n );\n }\n })}\n \n \n )\n ) : (\n \n {children}\n \n );\n }\n return ;\n };\n const { contactForm } = useSelector((state) => state.ContactReducer);\n useEffect(() => {\n let temp = [];\n headersList?.map((item) => {\n temp.push({\n key: temp?.length + 1,\n uf: item.header,\n zf: \"select\",\n error: item.error,\n reason: item.reason,\n });\n });\n setCount(temp?.length);\n setDataSource(temp);\n }, [contactForm]);\n const [count, setCount] = useState(0);\n const handleDelete = (key) => {\n const newData = dataSource.filter((item) => item.key !== key);\n setDataSource(newData);\n };\n const defaultColumns = [\n {\n title: \"Your CSV Field Name\",\n dataIndex: \"uf\",\n width: \"40%\",\n editable: true,\n render: (text, record) => {\n let FormData = dataSource;\n return (\n <>\n {\" \"}\n \n {text}\n \n {record.error && (\n
Error: {record?.reason}
\n )}\n \n );\n },\n },\n {\n title: \"Hirebound's Form Field Name\",\n dataIndex: \"zf\",\n width: \"40%\",\n editable: true,\n render: (text, record) => {\n return (\n \n {text}\n \n );\n },\n },\n {\n title: \"Action\",\n width: \"20%\",\n dataIndex: \"operation\",\n render: (_, record) =>\n dataSource?.length >= 1 ? (\n handleDelete(record.key)}\n />\n ) : null,\n },\n ];\n const handleAdd = () => {\n if (contactForm?.formItems?.length === dataSource?.length)\n return notification.error({\n message: \"You have mapped all the fields\",\n });\n const newData = {\n key: count + 1,\n uf: \"Your CSV field name\",\n zf: \"Select Hirebound's field name\",\n };\n setDataSource([...dataSource, newData]);\n setCount(count + 1);\n };\n const handleSave = (row) => {\n const newData = [...dataSource];\n const index = newData.findIndex((item) => row.key === item.key);\n const item = newData[index];\n newData.splice(index, 1, {\n ...item,\n ...row,\n });\n setDataSource(newData);\n };\n const components = {\n body: {\n row: EditableRow,\n cell: EditableCell,\n },\n };\n const columns = defaultColumns.map((col) => {\n if (!col.editable) {\n return col;\n }\n return {\n ...col,\n onCell: (record) => ({\n record,\n editable: col.editable,\n dataIndex: col.dataIndex,\n title: col.title,\n handleSave,\n }),\n };\n });\n\n useEffect(() => {\n dispatch(getCandidateStageTrigger());\n }, []);\n const { candidateFilterStage } = useSelector((state) => state.OpeningReducer);\n\n useEffect(() => {\n let source = candidateFilterStage?.data.find(\n (item) => item?.name === \"Sourced\"\n );\n setStageId(source._id);\n }, [candidateFilterStage]);\n\n console.log(\"dataSource\", dataSource);\n\n return (\n
\n
\n \n
\n
\n \n \n Map new field\n \n
\n Update Existing\n \n {\n setUpdateExisting((prev) => !prev);\n }}\n />\n \n
\n
\n
\n Add a tag: \n addTag(data)} TagData={Tag} />\n
\n
\n {/* \n Add to stage:{\" \"}\n */}\n {/* setStageId(e)}\n >\n {candidateFilterStage?.data?.map((item) => {\n return (\n \n {item.name}\n \n );\n })}\n */}\n
\n\n \"editable-row\"}\n bordered\n dataSource={dataSource}\n columns={columns}\n pagination={false}\n scroll={{ y: 270 }}\n />\n
\n );\n};\nexport default StepTwo;\n","import { UploadOutlined } from \"@ant-design/icons\";\nimport CXUpload from \"component/Upload\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { post, postFormData } from \"helper/networkClient\";\nimport { CXButton } from \"component/Button\";\nimport { useDispatch } from \"react-redux\";\n\nimport { ContactImportAction, getContactForm } from \"action/ContactAction\";\nimport StepTwo from \"./StepTwo\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CandidateImportAction } from \"action/OpeningsAction\";\nimport \"./style.css\";\nimport { notification } from \"antd\";\n\nconst ImportCandidate = ({ handleCancel, openingsId }) => {\n const dispatch = useDispatch();\n const [fileTypeError, setfileTypeError] = useState(false);\n const [loading, setLoading] = useState(false);\n const [file, setfile] = useState(null);\n const [Step, setStep] = useState(1);\n const [dataSource, setDataSource] = useState([]);\n const [headersList, setheadersList] = useState([]);\n const [UpdateExisting, setUpdateExisting] = useState(false);\n const [Tag, setTag] = useState([]);\n const [StageId, setStageId] = useState(null);\n useEffect(() => {\n dispatch(getContactForm());\n }, []);\n const handleUploadFile = async (options) => {\n const { file } = options;\n let fileExt = file.name.substr(file.name.lastIndexOf(\".\") + 1);\n if (fileExt === \"csv\") {\n const fmData = new FormData();\n fmData.append(\"file\", file);\n try {\n setLoading(true);\n const res = await postFormData(\"/file/upload\", fmData);\n getCvHeaders(res.data.data._id);\n setfile(res.data.data);\n } catch (err) {\n const error = new Error(\"Some error\");\n setLoading(false);\n }\n setfileTypeError(false);\n } else {\n setfileTypeError(\"Please upload csv file\");\n }\n };\n\n const getCvHeaders = async (fileId) => {\n const res = await post(`/contact/csvheaders`, {\n fileId,\n });\n setheadersList(res.data.data);\n setLoading(false);\n };\n const addTag = (data) => {\n if (data?.length === 2) {\n setTag([data[1]]);\n } else {\n setTag(data);\n }\n };\n const SubmitImport = () => {\n if (dataSource.some((item) => item.zf === \"select\")) {\n notification.error({\n message: \"Please select all the fields\",\n });\n } else {\n let obj = {\n openingId: openingsId,\n stageId: StageId,\n fileType: \"csv\",\n fileId: file._id,\n updateExisting: UpdateExisting,\n tag: Tag[0],\n mappings: dataSource.map((item) => {\n return {\n uf: item.uf,\n zf: item.zf,\n };\n }),\n };\n dispatch(CandidateImportAction(obj));\n Cancel();\n }\n };\n const Cancel = () => {\n setfile(null);\n setStep(1);\n setDataSource([]);\n handleCancel();\n setTag([]);\n };\n return (\n
\n {Step === 1 && (\n
\n
\n {!file?.fileName && !loading && (\n \n \n {!loading && (\n \n
\n \n
\n
\n Upload csv file\n
\n
\n )}\n
\n \n )}\n {loading && }\n {fileTypeError && (\n
\n {fileTypeError}\n
\n )}\n \n
\n {file?.fileName && !loading && (\n \n \n \n CSV uploaded, Please press next to complete the process\n \n \n )}\n
\n \n )}\n {Step === 2 && (\n \n )}\n \n Cancel()}>\n Cancel\n \n {file && Step === 1 && (\n setStep(2)}>\n Next\n \n )}\n {Step === 2 && (\n SubmitImport()}>\n Submit\n \n )}\n
\n \n );\n};\n\nexport default ImportCandidate;\n","import React, { useEffect, useState } from \"react\";\nimport CandidatesView from \"./SideBarView/CandidatesView\";\nimport { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { get, post } from \"helper/networkClient\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXEmpty } from \"component/Empty\";\nimport { getCandidateStageTrigger } from \"action/OpeningsAction\";\n\nconst OpeningsCandidateDetails = () => {\n const [Loading, setLoading] = useState(false);\n const [Data, setData] = useState(false);\n const dispatch = useDispatch();\n const { openPositions } = useSelector((state) => state.OpeningReducer);\n const [opdetails, setopdetails] = useState(null);\n const { cid, openingsId } = useParams();\n const getProfile = async () => {\n dispatch({\n type: \"SET_ACTIVE_CONTACT_OPENING_LOADING\",\n data: true,\n });\n const res = await get(`/candidate/${openingsId}/profile/${cid}`);\n let temp = res?.data?.data;\n if (temp?._id) {\n dispatch({\n type: \"SET_ACTIVE_CONTACT_OPENING\",\n data: temp,\n });\n setData(true);\n } else {\n setData(false);\n }\n setLoading(false);\n };\n useEffect(() => {\n dispatch(getCandidateStageTrigger());\n setLoading(true);\n if (cid) {\n getProfile();\n }\n }, []);\n useEffect(() => {\n openPositions?.data?.length > 0 &&\n setopdetails(\n openPositions?.data?.find((op) => op._id === openingsId)?.positionName\n );\n }, [openPositions]);\n return (\n \n \n \n \n Candidate Details {opdetails && `for ${opdetails}`}\n \n {\n history.push(\"/admin/openings\");\n }}\n >\n Cancel\n \n \n \n {!Loading && Data && (\n \n )}\n \n\n {Loading && }\n {!Loading && !Data && }\n \n \n );\n};\n\nexport default OpeningsCandidateDetails;\n","import Tabs from \"./OpeningsDetailsTabs\";\nimport { CXButton } from \"component/Button\";\nimport { CXContent, CXHeader, CXLayout, CXSider } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { Switch, Route, useRouteMatch } from \"react-router-dom\";\nimport SideBardata from \"./SideBardata\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { getAllCompaniesTrigger } from \"action/OpeningsAction\";\nimport { Drawer } from \"antd\";\nimport { ExportOutlined, UploadOutlined } from \"@ant-design/icons\";\nimport { CXModal } from \"component/Modal\";\nimport ImportContact from \"./ImportContact/ImportCandidate\";\nimport AddCandidate from \"./AddCandidate\";\nimport { getAgencySettings } from \"action/Subscription\";\nimport { getCookie } from \"utils\";\n\nconst OpeningsDetails = () => {\n const { path } = useRouteMatch();\n const dispatch = useDispatch();\n const { openingsId, tab } = useParams();\n console.log(\"tab\", tab);\n const [visible, setVisible] = useState(false);\n const [visibleContact, setVisibleContact] = useState(false);\n const { openPositions, allCompanies } = useSelector(\n (state) => state.OpeningReducer\n );\n const siderViewClosed = useSelector(\n (state) => state.OpeningReducer.siderViewClosed\n );\n const { useAgency, useAgencyLoading } = useSelector(\n (state) => state.SubscriptionReducer\n );\n const candidateImporting = useSelector(\n (state) => state.OpeningReducer.candidateImporting\n );\n useEffect(() => {\n dispatch(getAgencySettings());\n dispatch(getAllCompaniesTrigger());\n }, []);\n const handleCancel = () => {\n setVisible(false);\n };\n const handleCancelCt = () => {\n setVisibleContact(false);\n };\n const userTenants = useSelector(\n (state) => state.dittoAdminReducer?.user?.userTenants\n );\n const tenantId = getCookie(\"tenant\");\n return (\n \n \n \n \n
\n {openPositions?.data?.find((d) => d?._id === openingsId)\n ?.positionName ?? \"-\"}\n {!useAgencyLoading &&\n openPositions?.data?.find((d) => d?._id === openingsId)\n ?.positionName && (\n {\n if (useAgency?.useAgency) {\n window.open(\n `https://careerpage.hirebound.io/org/${useAgency?.slug}/position/${openingsId}`,\n \"_blank\"\n );\n } else {\n window.open(\n `https://careerpage.hirebound.io/${\n userTenants?.[0]?.tenantId?.slug ?? tenantId\n }/${\n openPositions?.data?.find(\n (d) => d?._id === openingsId\n )?.cId?._id\n }/position/${openingsId}`,\n \"_blank\"\n );\n }\n }}\n />\n )}\n
\n
\n {openPositions?.data?.find((d) => d?._id === openingsId)?.cId\n ?.name ?? \"-\"}\n
\n
\n {candidateImporting && (\n \n Loading imports...\n \n )}\n {!candidateImporting && (\n
\n history.push(\"/admin/openings\")}\n >\n Back\n \n {tab === \"Candidates\" && (\n setVisible(true)}\n >\n \n Import Contacts\n \n )}\n {tab === \"Candidates\" && (\n {\n history.push(`/admin/openings/${openingsId}/add-candidate`);\n }}\n >\n Add Candidate\n \n )}\n
\n )}\n
\n
\n \n \n \n \n \n
\n
\n {/* \n \n */}\n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default OpeningsDetails;\n","import { SettingOutlined } from \"@ant-design/icons\";\nimport { CXSider } from \"component/Layout\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport React from \"react\";\nimport { useSelector } from \"react-redux\";\n\nconst SideBar = ({ active, setActive }) => {\n const handleActiveList = (val) => {\n setActive(val);\n };\n return (\n \n \n handleActiveList(`general`)}\n >\n \n General\n \n handleActiveList(`sequences`)}\n >\n \n Channel Account\n \n handleActiveList(`openingvariable`)}\n >\n \n Opening Variables\n \n handleActiveList(`recruitersignature`)}\n >\n \n Share With Recruiters\n \n \n \n );\n};\n\nexport default SideBar;\n","import { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\nimport React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport history from \"utils/history\";\nimport ReactHtmlParser from \"react-html-parser\";\n\nconst SettingsGeneal = () => {\n const { openPositions, loading } = useSelector(\n (state) => state.OpeningReducer\n );\n const { openingsId } = useParams();\n\n const getPositionDetail = (field) =>\n openPositions?.data?.find((d) => d?._id === openingsId)?.[field] ?? \"-\";\n\n return (\n
\n \n \n General details\n \n {\n history.push(`/admin/openings/${openingsId}/edit`);\n }}\n >\n Edit details\n \n \n \n {loading ? (\n
\n \n
\n ) : (\n
\n
\n
Position Name
\n
{getPositionDetail(\"positionName\")}
\n
\n\n
\n
Organisation Name
\n
{getPositionDetail(\"cId\")?.name}
\n
\n
\n
Description
\n
{getPositionDetail(\"description\")}
\n
\n
\n
Job Description
\n
{ReactHtmlParser(getPositionDetail(\"jd\"))}
\n
\n
\n
Location
\n
{getPositionDetail(\"location\")?.name}
\n
\n
\n )}\n
\n \n );\n};\n\nexport default SettingsGeneal;\n","import {\n getAccountVariablesForOpening,\n updateAccountVariablesForOpening,\n} from \"action/AccountVariables\";\nimport { CXButton } from \"component/Button\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CXInput } from \"component/Input\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\n\nconst OpeningVariables = () => {\n const dispatch = useDispatch();\n const { openingsId } = useParams();\n const { openingAccountVariables, loading } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n const [data, setdata] = useState([]);\n\n useEffect(() => {\n if (openingAccountVariables?.data?.length > 0) {\n setdata(openingAccountVariables?.data);\n }\n }, [openingAccountVariables]);\n\n const UpdateValue = (value, id) => {\n const index = data.findIndex((res) => res._id === id);\n data[index] = { ...data[index], value: value };\n };\n\n const UpdateVariables = () => {\n let temp = [];\n data.map((res) => {\n temp.push({\n name: res.name,\n value: res.value,\n });\n });\n updateAccountVariablesForOpening({ openingsId, accountData: temp });\n };\n return (\n
\n \n \n Opening Variables\n \n {!loading && data?.length > 0 && (\n {\n UpdateVariables();\n }}\n >\n Update variables\n \n )}\n \n {loading && (\n
\n \n
\n )}\n {!loading && data?.length > 0 && (\n
\n
{childNode}
\n \n \n \n \n \n \n \n \n {data?.map((res) => {\n return (\n \n \n \n \n \n );\n })}\n \n
Variable NameDefault ValueCustom Value
{res?.name}{res?.defaultValue}\n {\n UpdateValue(e.target.value, res._id);\n }}\n />\n
\n \n )}\n {!loading && data?.length === 0 && (\n
\n \n
\n )}\n \n );\n};\n\nexport default OpeningVariables;\n","import React, { useEffect, useState } from \"react\";\nimport ShareJob from \"./AddPosition/ShareJob\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXButton } from \"component/Button\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXLottie } from \"component/Lottie\";\n\nconst RecruiterSignature = () => {\n const [GlobalState, setGlobalState] = useState({});\n const { openPositions, loading } = useSelector(\n (state) => state.OpeningReducer\n );\n const { openingsId } = useParams();\n useEffect(() => {\n if (openingsId && openPositions?.data?.length > 0) {\n let data = openPositions?.data?.filter((item) => item._id === openingsId);\n setGlobalState(data[0]);\n }\n }, [openingsId, openPositions]);\n return (\n
\n \n \n Share With Recruiters\n \n \n {loading && (\n
\n
\n \n

\n Updating your request, please hold on...\n

\n
\n
\n )}\n {!loading && (\n
\n \n
\n )}\n
\n );\n};\n\nexport default RecruiterSignature;\n","import { CXContent, CXLayout, CXSider } from \"component/Layout\";\nimport React, { useEffect, useState } from \"react\";\nimport SideBar from \"./SettingsSideBar\";\nimport {\n Switch,\n Route,\n useParams,\n useRouteMatch,\n Redirect,\n} from \"react-router-dom\";\nimport history from \"utils/history\";\nimport SettingsGeneal from \"./SettingsGeneal\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport SettingsSequences from \"./SettingsSequences\";\nimport { getWfType, getWorkflowCAbyOpening } from \"action/OpeningsAction\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport OpeningVariables from \"./OpeningVariables\";\nimport RecruiterSignature from \"./RecruiterSignature\";\nimport { useLocation } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { getAccountVariablesForOpening } from \"action/AccountVariables\";\n\nconst Settings = () => {\n const dispatch = useDispatch();\n const { openingsId } = useParams();\n const location = useLocation();\n const urlState = location.state;\n console.log(\"additionalData\", urlState);\n useEffect(() => {\n dispatch(getWorkflowCAbyOpening({ openingId: openingsId }));\n dispatch(GetAllConfig());\n dispatch(getWfType(openingsId));\n dispatch(getAccountVariablesForOpening(openingsId));\n }, [openingsId]);\n const [active, setActive] = useState(\"general\");\n useEffect(() => {\n if (urlState) {\n setActive(urlState.tab);\n }\n }, [urlState]);\n const RenderComponent = () => {\n if (active) {\n let obj = {\n general: ,\n sequences: ,\n openingvariable: ,\n recruitersignature: ,\n undefined: ,\n };\n return obj[active ?? \"general\"];\n } else {\n return ;\n }\n };\n return (\n \n \n \n \n \n \n );\n};\n\nexport default Settings;\n","import { RightCircleOutlined } from \"@ant-design/icons\";\nimport { checkNextStageSequence } from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport AdditionalContent from \"./additionalContent\";\nimport { Form } from \"antd\";\n\nconst Index = ({\n stage,\n updateStageID,\n setconfirmModal,\n openingId,\n sVal,\n setStageChange,\n}) => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const { stageNextSqLoading, stageNextSq } = useSelector(\n (state) => state.OpeningReducer\n );\n useEffect(() => {\n dispatch(checkNextStageSequence({ openingId, sVal }));\n }, [stage, sVal]);\n return (\n
\n
\n Do you want to move selected candidates to\n {stage}.\n {stageNextSqLoading && (\n
\n \n
Please wait...
\n
\n )}\n {stageNextSq?.length > 0 && !stageNextSqLoading && (\n
\n This will trigger the following sequence:\n
\n {stageNextSq?.map((res) => {\n return (\n
\n \n {res.name}\n
\n );\n })}\n
\n
\n )}\n
\n {!stageNextSqLoading && }\n {!stageNextSqLoading && (\n
\n {\n let formdata = form.getFieldsValue();\n updateStageID(formdata, sVal);\n form.resetFields();\n setconfirmModal(false);\n setStageChange(null);\n }}\n >\n Yes\n \n {\n setconfirmModal(false);\n setStageChange(null);\n }}\n >\n No\n \n
\n )}\n
\n );\n};\n\nexport default Index;\n","import { CXButton } from \"component/Button\";\nimport React, { useEffect, useState } from \"react\";\nimport { SortableContainer, SortableElement } from \"react-sortable-hoc\";\nimport { arrayMoveImmutable } from \"array-move\";\nimport { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { CXPopover } from \"component/Popover\";\nimport ReactDOMServer from \"react-dom/server\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst SubmissionTemplate = ({\n initialFields,\n SelectedRows,\n setTableHTml,\n activeFields,\n setActiveFields,\n selectedCandidatesData,\n setAddCl,\n addCl,\n}) => {\n const SortableItem = SortableElement(({ field }) => {\n return (\n \n
{field}
\n \n );\n });\n\n const SortableList = SortableContainer(\n ({ items }) => {\n return (\n
\n {items.map((field, index) => (\n \n ))}\n
\n );\n },\n { helperClass: \"sortable-helper\" }\n );\n\n const onSortEnd = ({ oldIndex, newIndex }) => {\n if (typeof oldIndex === \"number\" && typeof newIndex === \"number\") {\n const orderedKeys = arrayMoveImmutable(\n Object.keys(activeFields),\n oldIndex,\n newIndex\n );\n const orderedActiveFields = orderedKeys.reduce((acc, key) => {\n return { ...acc, [key]: activeFields[key] };\n }, {});\n setActiveFields(orderedActiveFields);\n }\n };\n useEffect(() => {\n const tableHtml = ReactDOMServer.renderToStaticMarkup(\n \n \n \n {Object?.keys(activeFields)?.map((field, index) => {\n return (\n \n {field}\n \n );\n })}\n \n \n \n {selectedCandidatesData?.map((row, index) => {\n return (\n \n {Object?.keys(activeFields)?.map((field, index) => {\n let gg = initialFields?.find((v) => v.name === field)?.value;\n if (gg === \"resume\") {\n return (\n \n \n {row?.attachments[0]?.fileName?.length > 0\n ? row?.attachments[0]?.fileName\n : row?.attachments[0]?.url\n ? \"Resume\"\n : \"NA\"}\n \n \n );\n } else if (gg === \"qualifyQuestions\") {\n return (\n \n {row[gg] &&\n row[gg]?.map((v, i) => {\n return (\n \n
\n Q: {v?.q ?? \"NA\"}\n
\n
A: {v?.a?.length > 0 ? v?.a : \"NA\"}
\n \n );\n })}\n \n );\n } else {\n return (\n \n {row[gg]}\n \n );\n }\n })}\n
\n );\n })}\n \n
\n );\n setTableHTml(tableHtml);\n }, [activeFields]);\n return (\n
\n
\n
\n Available Data{\" \"}\n \n Click to add or remove columns from the submission table\n \n }\n >\n \n \n
\n
\n {initialFields.map((field, index) => {\n return (\n
\n {\n if (activeFields[field.name]) {\n const { [field.name]: _, ...rest } = activeFields;\n setActiveFields(rest);\n } else {\n setActiveFields({ ...activeFields, [field.name]: true });\n }\n }}\n className={\n activeFields[field.name]\n ? \"sbmTablekeysActive\"\n : \"CancelBtn\"\n }\n >\n {field.name}\n \n
\n );\n })}\n
\n
\n
\n
\n
\n
\n
\n Arrange Sequence{\" \"}\n \n You can reorder the columns by dragging and dropping them\n \n }\n >\n \n \n
\n \n
\n
\n
\n
\n
\n
\n Add Cover Letter\n
\n
\n setAddCl(e)} />\n
\n
\n
\n
\n
\n
\n
Preview selected data
\n
\n \n \n \n {Object?.keys(activeFields)?.map((field, index) => {\n return (\n \n {field}\n \n );\n })}\n \n \n \n {selectedCandidatesData?.map((row, index) => {\n return (\n \n {Object?.keys(activeFields)?.map((field, index) => {\n let gg = initialFields?.find(\n (v) => v.name === field\n )?.value;\n if (\n gg === \"resume\" &&\n (row?.rid?.length > 5 || row?.resume?.length > 5)\n ) {\n return (\n \n \n {row?.name}.resume\n \n \n );\n } else if (gg === \"qualifyQuestions\") {\n return (\n \n {row[gg] &&\n row[gg]?.map((v, i) => {\n return (\n \n
\n Q: {v?.q ?? \"NA\"}\n
\n
A: {v?.a ?? \"NA\"}
\n \n );\n })}\n \n );\n } else {\n return (\n \n {row[gg]}\n \n );\n }\n })}\n
\n );\n })}\n \n
\n
\n
\n
\n );\n};\n\nexport default SubmissionTemplate;\n","import { LoadingOutlined } from \"@ant-design/icons\";\nimport { post } from \"helper/networkClient\";\nimport React, { useEffect, useState, useCallback } from \"react\";\n\nconst ProcessCV = ({\n clProcessing,\n setclProcessing,\n attachmentResume,\n setattachmentResume,\n SelectedRows,\n openingsId,\n}) => {\n const [processedData, setProcessedData] = useState([]);\n const [failed, setFailed] = useState([]);\n\n const ProcessCoverLetters = useCallback(async () => {\n setclProcessing(true);\n setattachmentResume([]);\n\n const promises = SelectedRows.map(async (res) => {\n try {\n const response = await post(\n `/contact/merge-cover-letter-and-resume/${res?._id}/${openingsId}`\n );\n const code = response?.status;\n if (code === 200) {\n setProcessedData((prev) => [...prev, res?._id]);\n let t = response.data.data;\n t[\"name\"] = t?.fileName;\n t[\"fileName\"] = t?.fileName;\n t[\"uid\"] = res?.url;\n t[\"url\"] = response.data.data.url;\n setattachmentResume((prev) => [...prev, t]);\n } else if (code === \"ERROR\") {\n setFailed((prev) => [...prev, res?._id]);\n }\n console.log(\"API Response:\", response.data, code);\n } catch (error) {\n setFailed((prev) => [...prev, res?._id]);\n }\n });\n\n await Promise.all(promises);\n setclProcessing(false);\n }, [SelectedRows, setclProcessing, setattachmentResume]);\n\n useEffect(() => {\n ProcessCoverLetters();\n }, [ProcessCoverLetters]);\n\n return (\n
\n
\n {clProcessing ? (\n \n Please wait while we are processing cover letters and resumes...\n \n \n ) : (\n \n Processing completed, you can now submit the report.\n \n )}\n
\n\n
\n {SelectedRows?.map((res) => (\n \n
{res?.name}
\n
\n {processedData?.some((i) => i === res?._id) ? (\n
Completed
\n ) : failed?.some((i) => i === res?._id) ? (\n
Failed
\n ) : (\n
\n Processing.. \n
\n )}\n
\n
\n ))}\n
\n \n );\n};\n\nexport default ProcessCV;\n","import { CXButton } from \"component/Button\";\nimport React, { useEffect, useState } from \"react\";\nimport SubmissionTemplate from \"./SubmissionTemplate\";\nimport \"./index.css\";\nimport Compose from \"screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/Compose\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { notification } from \"antd\";\nimport { post } from \"helper/networkClient\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { updateSubmissionSequence } from \"action/OpeningsAction\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CSVLink } from \"react-csv\";\nimport { submissionInitialFields } from \"./utils\";\nimport ProcessCV from \"./ProcessCV\";\nimport { getAccountVariablesDefinition } from \"action/AccountVariables\";\n\nconst Index = ({\n setreportModal,\n SelectedRows,\n submissionSequence,\n submitTo,\n submitCc,\n next,\n header,\n openPositions,\n allCompanies,\n candidateFilterStage,\n selectedRowKeys,\n CSVtableData,\n filter,\n setreportModalDn,\n exportSequence,\n type,\n}) => {\n const { openingsId } = useParams();\n const { contactForm, loading } = useSelector((state) => state.ContactReducer);\n const [initialFields, setinitialFields] = useState(submissionInitialFields);\n const [activeFields, setActiveFields] = useState(\n initialFields.reduce((acc, field) => ({ ...acc, [field.name]: true }), {})\n );\n const { accountVariablesDefinition } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n const dispatch = useDispatch();\n const [Steps, setSteps] = useState(1);\n const [TableHtml, setTableHTml] = useState(null);\n const [SenderEmail, setSenderEmail] = useState();\n const [emailRecipient, setemailRecipient] = useState(submitTo ?? null);\n const [EmailData, setEmailData] = useState(\"\");\n const [TrackerSelect, setTrackerSelect] = useState(null);\n const AppReducer = useSelector((state) => state.AppReducer);\n const AdminReducer = useSelector((state) => state.AdminReducer);\n const emailSubject = useSelector((state) => state.AdminReducer.emailSubject);\n const { allConfigData, TrackerConfiguration } = useSelector(\n (state) => state.AdminReducer\n );\n const [sendingMail, setsendingMail] = useState(false);\n const [attachmentResume, setattachmentResume] = useState([]);\n\n useEffect(() => {\n if (Steps === 1) {\n let d = SelectedRows.map((res) => {\n if (res?.attachments[0]) {\n let temp = res?.attachments[0];\n temp[\"name\"] = res?.name?.replace(/\\s/g, \"_\");\n temp[\"fileName\"] = res?.name?.replace(/\\s/g, \"_\");\n return temp;\n } else if (res?.rId) {\n let temp = {\n name: res?.name?.replace(/\\s/g, \"_\"),\n fileName: res?.name?.replace(/\\s/g, \"_\"),\n url: res?.rId,\n mimeType: \"application/pdf\",\n };\n return temp;\n }\n return null;\n }).filter((item) => item !== null);\n setattachmentResume(d);\n }\n }, [Steps, SelectedRows]);\n const { CandidateRecordUpdating } = useSelector(\n (state) => state.OpeningReducer\n );\n const [headersCSV, setheadersCSV] = useState([]);\n const [addCl, setAddCl] = useState(false);\n const [clProcessing, setclProcessing] = useState(false);\n const handleNext = () => {\n setSteps(Steps + 1);\n };\n const handlePrev = () => {\n setSteps(Steps - 1);\n };\n const handleCancel = () => {\n setreportModal(false);\n setSteps(1);\n };\n const handleModelChange = (model) => {\n setEmailData(model);\n };\n const handleChangeS = (value) => {\n setSenderEmail(value);\n };\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch(getContactForm());\n dispatch(getAccountVariablesDefinition());\n }, []);\n\n function updateEmailData(emailData) {\n let updatedEmailData = emailData?.replace(\n //g,\n ''\n );\n updatedEmailData = updatedEmailData?.replace(\n //g,\n ''\n );\n return updatedEmailData;\n }\n const handleSubmit = () => {\n setsendingMail(true);\n try {\n if (!emailRecipient) {\n notification.error({\n message: \"Please select recipient email address\",\n });\n setsendingMail(false);\n return;\n }\n if (!SenderEmail) {\n notification.error({\n message: \"Please select sender email address\",\n });\n setsendingMail(false);\n return;\n }\n if (!emailSubject) {\n notification.error({\n message: \"Please enter email subject\",\n });\n setsendingMail(false);\n return;\n }\n\n let attachment = [];\n if (AppReducer.chatContainerComponent === \"attachmentContainer\") {\n attachment = AppReducer.containerParams;\n }\n let ccEmail = AdminReducer?.ccEmailRecipients?.map((res) => {\n return res.value;\n });\n let bcc = AdminReducer?.bccEmailRecipients?.map((res) => {\n return res.value;\n });\n let message = {\n attachments: attachment,\n to: emailRecipient,\n text: updateEmailData(EmailData),\n cc: ccEmail,\n bcc: bcc,\n channelAccountId: SenderEmail,\n subject: emailSubject,\n tableData: TableHtml,\n sequence: activeFields,\n openingId: openingsId,\n candidates: SelectedRows,\n };\n dispatch(\n updateSubmissionSequence(openingsId, {\n data: {\n submissionSequence: activeFields,\n submitTo: emailRecipient,\n submitCc: ccEmail,\n },\n })\n );\n post(\"/openings/submission/mail\", message)\n .then((res) => {\n notification.success({\n message: \"Email sent successfully\",\n });\n setsendingMail(false);\n setreportModal(false);\n })\n .catch((error) => {\n notification.error({\n message: \"Error in sending email\",\n });\n setsendingMail(false);\n setreportModal(false);\n });\n } catch (error) {\n notification.error({\n message: \"Error in sending email\",\n });\n setsendingMail(false);\n setreportModal(false);\n }\n };\n useEffect(() => {\n dispatch({ type: \"CC_EMAIL_RECIPERNT\", data: submitCc });\n }, []);\n useEffect(() => {\n if (contactForm?.formItems) {\n // Directly filter and map custom fields, ensuring uniqueness in one step\n const customFields = contactForm.formItems.reduce((acc, item) => {\n if (\n item.category === \"custom\" &&\n !acc.some(\n (accItem) =>\n accItem.name === item.placeholder && accItem.value === item.key\n )\n ) {\n acc.push({ name: item.placeholder, value: item.key });\n }\n return acc;\n }, []);\n let AccountVariables = accountVariablesDefinition?.data?.map((res) => {\n return { name: res?.name, value: res?.name };\n });\n\n let uniqueAccountVariables = AccountVariables?.filter(\n (accountVariable) =>\n !initialFields.some(\n (initialField) =>\n initialField?.name === accountVariable?.name &&\n initialField?.value === accountVariable?.value\n )\n );\n\n // Filter out customFields that already exist in initialFields\n const uniqueCustomFields = customFields.filter(\n (customField) =>\n !initialFields.some(\n (initialField) =>\n initialField.name === customField.name &&\n initialField.value === customField.value\n )\n );\n\n setinitialFields([\n ...initialFields,\n ...uniqueCustomFields,\n ...(uniqueAccountVariables ?? []),\n ]);\n if (exportSequence) {\n setActiveFields(exportSequence);\n }\n if (submissionSequence) {\n setActiveFields(submissionSequence);\n }\n }\n }, [contactForm, accountVariablesDefinition]);\n\n function sanitizeString(str) {\n return str?.replace(/,/g, \" \")?.replace(/\\n/g, \"; \");\n }\n let selectedCandidatesData = SelectedRows?.map((row) => {\n let mergedData = { ...row, ...row?.fullData?.custom };\n let transformedData = Object.entries(mergedData).reduce(\n (acc, [key, value]) => {\n acc[key] = value;\n return acc;\n },\n {}\n );\n return transformedData;\n });\n\n useEffect(() => {\n let data = Object.entries(activeFields)\n .map(([key, value]) => {\n let v = initialFields.find((field) => field.name === key);\n return {\n label: v?.name,\n key: v?.value,\n };\n })\n .filter((item) => item.label && item.key);\n\n setheadersCSV(data);\n }, [activeFields]);\n\n console.log(\"selectedCandidatesData\", selectedCandidatesData);\n\n return (\n
\n \n {header}\n
\n {\n return {\n ...row,\n notes: sanitizeString(row.notes),\n };\n }) ?? []\n }\n headers={headersCSV}\n filename={`${\n openPositions?.data?.find((d) => d?._id === openingsId)\n ?.positionName\n } at ${\n allCompanies?.data?.find((data) => {\n return (\n data._id ===\n openPositions?.data?.find((d) => d?._id === openingsId)?.cId\n );\n })?.name ?? \"-\"\n } ${\n candidateFilterStage?.data?.find((res) => res._id === filter)\n ?.name\n }.csv`}\n target=\"_blank\"\n >\n {\n setreportModalDn && setreportModalDn(false);\n }}\n >\n Download Report ({selectedRowKeys?.length})\n \n \n {\n handleCancel();\n setTableHTml(null);\n setSteps(1);\n }}\n >\n Cancel\n \n {next && Steps > 1 && (\n {\n handlePrev();\n }}\n >\n Prev\n \n )}\n {next && Steps < `${addCl ? 3 : 2}` && (\n {\n handleNext();\n }}\n >\n Next\n \n )}\n {next && Steps == `${addCl ? 3 : 2}` && (\n {\n handleSubmit();\n }}\n >\n Send Mail\n \n )}\n
\n \n
\n
Select Tracker
\n {\n setTrackerSelect(value);\n setActiveFields(\n TrackerConfiguration?.find((res) => res._id === value)?.data\n );\n }}\n >\n {TrackerConfiguration?.map((res) => {\n if (res.trackerType === type)\n return {res.trackerName};\n })}\n \n
\n {!loading && !CandidateRecordUpdating && (\n
\n {\" \"}\n
\n {Steps === 1 && (\n
\n \n
\n )}\n {addCl && Steps === 2 && (\n \n )}\n {((addCl && Steps === 3) || (!addCl && Steps === 2)) && (\n
\n \n \n \n Send from\n \n \n \n {allConfigData?.map((res) => {\n if (res.md === \"email\") {\n return (\n \n {res?.configEmail?.email}\n \n );\n }\n })}\n \n \n \n
\n \n \n )}\n \n \n )}\n
\n {(loading || CandidateRecordUpdating) && (\n
\n \n
Processing report...
\n
\n )}\n
\n \n );\n};\n\nexport default Index;\n","export const HCSV = [\n { label: \"Name\", key: \"name\" },\n { label: \"Experience\", key: \"experience\" },\n { label: \"Location\", key: \"location\" },\n { label: \"Company\", key: \"company\" },\n { label: \"Designation\", key: \"designation\" },\n { label: \"Ctc\", key: \"ctc\" },\n { label: \"Expected CTC\", key: \"expCtc\" },\n { label: \"Email\", key: \"email\" },\n { label: \"Phone\", key: \"phone\" },\n {\n label: \"Notice Period\",\n key: \"notice\",\n },\n {\n label: \"Company (Applied)\",\n key: \"companyNameApply\",\n },\n {\n label: \"Position (Applied)\",\n key: \"positionName\",\n },\n {\n label: \"Stage name\",\n key: \"stageName\",\n },\n {\n label: \"Notes\",\n key: \"notes\",\n },\n {\n label: \"Resume\",\n key: \"resume\",\n },\n {\n label: \"Attachments\",\n key: \"attachments\",\n },\n {\n label: \"LinkedIn\",\n key: \"linkedIn\",\n },\n {\n name: \"Reason for Change\",\n value: \"reasonChange\",\n },\n];\n","import { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXTable } from \"component/Table\";\nimport { CXTag } from \"component/Tag\";\nimport React, {\n Fragment,\n useEffect,\n useState,\n useRef,\n useCallback,\n} from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport AddWorkflow from \"../AddWorkflow\";\n\nimport {\n PatchStageIdInBulk,\n SearchCandidatesByOpenings,\n getAllCandidatesByPositionTrigger,\n getCandidateStageTrigger,\n markFavorite,\n removeCandidatesFromOpening,\n shareCandidatesWith,\n transferOwnerShip,\n} from \"action/OpeningsAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { getCampaigns } from \"action/CampaignAction\";\nimport {\n CheckCircleFilled,\n CheckCircleOutlined,\n FilterOutlined,\n MailOutlined,\n SwapOutlined,\n} from \"@ant-design/icons\";\nimport { CXAvatar } from \"component/Avatar\";\nimport moment from \"moment\";\nimport {\n checkViewDate,\n customRequires,\n getColorByPercentage,\n getCookie,\n truncateSt,\n} from \"utils\";\nimport { CXModal } from \"component/Modal\";\nimport history from \"utils/history\";\nimport { Avatar, notification, Progress, Rate, Tooltip } from \"antd\";\nimport StageChangeBulkConfirm from \"component/StageChangeConfirm/bulkUpdate\";\nimport SubmissionsReport from \"../SubmissionsReport\";\nimport { CXBadge } from \"component/Badge\";\nimport {\n getContactMessagesCount,\n getStageMetricsNotifications,\n markReadConversation,\n markReadNotification,\n} from \"action/NotificationActions\";\nimport { HCSV } from \"./utils\";\nimport { getTenantTracker } from \"action/AdminActions\";\nimport { debounce } from \"lodash\";\nimport { getAccountVariablesForOpening } from \"action/AccountVariables\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { StageChangeRequiredConfig } from \"../StageChangeRequiredConfig\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Form } from \"antd\";\n\nconst Candidates = () => {\n const [form] = Form.useForm();\n const tenantId = getCookie(\"tenant\");\n const dispatch = useDispatch();\n const { openingsId, stage } = useParams();\n const {\n allCandidatesByPosition,\n candidateFilterStage,\n candidateLoading,\n siderData,\n allCompanies,\n openPositions,\n } = useSelector((state) => state.OpeningReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const { CampaignsList } = useSelector((state) => state.CampaignReducer);\n const [filter, setfilter] = useState(null);\n const [selectedRowKeys, setSelectedRowKeys] = useState([]);\n const [checkKey, setcheckKey] = useState([]);\n const [TableData, setTableData] = useState(null);\n const [CSVtableData, setCSVtableData] = useState([]);\n const [visible, setVisible] = useState(false);\n const [SelectedWF, setSelectedWF] = useState(null);\n const [SearchActive, setSearchActive] = useState(\"\");\n const [openWorkflowCheck, setopenWorkflowCheck] = useState(false);\n const [StageChange, setStageChange] = useState(null);\n const [confirmModal, setconfirmModal] = useState(false);\n const { stageMetricNotif, CandidateCardCount } = useSelector(\n (state) => state.NotificationReducer\n );\n const { agents } = useSelector((state) => state.AgentReducer);\n const [headersCSV, setheadersCSV] = useState(HCSV);\n const [reportModal, setreportModal] = useState(false);\n const [OwnerChangeModal, setOwnerChangeModal] = useState(false);\n const [SelectedRows, setSelectedRows] = useState([]);\n const [reportModalDn, setreportModalDn] = useState(false);\n const { TrackerConfiguration } = useSelector((state) => state.AdminReducer);\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const [ActiveLoading, setActiveLoading] = useState(false);\n const [AccessWith, setAccessWith] = useState(false);\n const [CandidateShareWith, setCandidateShareWith] = useState(null);\n const [shareType, setShareType] = useState(\"share\");\n const [FilterTags, setFilterTags] = useState([]);\n const { openingAccountVariables } = useSelector(\n (state) => state.AccountVariablesDefinitionReducer\n );\n useEffect(() => {\n dispatch(getContactForm());\n dispatch(getStageMetricsNotifications());\n dispatch(getTenantTracker());\n dispatch(getCandidateStageTrigger());\n dispatch(getAccountVariablesForOpening(openingsId));\n return () => {\n dispatch({ type: \"GET_ALL_CANDIDATES_BY_POSITION_RESPONSE\", data: [] });\n setTableData([]);\n };\n }, []);\n const openCandidateView = (record) => {\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: false });\n dispatch({\n type: \"SET_OPENING_SIDEBAR_DATA\",\n data: { record, TableData },\n });\n dispatch({ type: \"SET_ACTIVE_STAGE\", data: filter });\n dispatch({ type: \"SET_OPENING_TAB\", data: \"Candidates\" });\n };\n useEffect(() => {\n setActiveLoading(true);\n if (filter && openingsId) {\n setTableData([]);\n dispatch(\n getAllCandidatesByPositionTrigger({\n id: openingsId,\n stage: filter,\n })\n );\n }\n }, [filter, openingsId]);\n\n const getIcon = (key) => {\n switch (key[0]) {\n case \"e\":\n return (\n \n );\n case \"w\":\n return (\n \n );\n case \"c\":\n return (\n \n );\n default:\n break;\n }\n };\n\n const columns = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n render: (data, record) => {\n return (\n
\n
\n
\n
\n \n ) : (\n \n )\n }\n count={1}\n value={record?.favorite ? 1 : 0}\n onChange={(value) => {\n value === 1 &&\n dispatch(\n markFavorite(\n record?.fullData?._id,\n {\n favorite: true,\n },\n \"TABLE\",\n openingsId,\n stage\n )\n );\n value === 0 &&\n dispatch(\n markFavorite(\n record?.fullData?._id,\n {\n favorite: false,\n },\n \"TABLE\",\n openingsId,\n stage\n )\n );\n }}\n />\n
\n
\n\n
\n {record?.profileUrl?.length > 0 ? (\n openCandidateView(record)}\n />\n ) : (\n openCandidateView(record)}\n >\n {data ? data[0]?.toUpperCase() : \"NA\"}\n \n )}\n
\n
\n openCandidateView(record)}\n className=\"hiperLink font-16 font-600\"\n >\n
\n {truncateSt(data?.length > 0 ? data : \"NA\", 80)}{\" \"}\n
\n {record?.fullData?.candidateViewed &&\n record?.fullData?.candidateViewed[\n user?.userProfile?._id\n ] && (\n \n
Last viewed at :
\n {checkViewDate(\n record?.fullData?.candidateViewed[\n user?.userProfile?._id\n ]\n )}\n
\n }\n >\n \n \n )}\n
\n
\n \n
\n
\n {truncateSt(record?.designation, 80)}\n
\n
\n {record?.company?.length > 4 && \"at\"}{\" \"}\n {truncateSt(record?.company, 80)}\n
\n
\n \n \n \n );\n },\n width: \"30%\",\n },\n {\n title: \"Experience\",\n dataIndex: \"experience\",\n key: \"experience\",\n },\n {\n title: \"Location\",\n dataIndex: \"location\",\n render: (data, record) => {\n return
{truncateSt(data, 12)}
;\n },\n },\n {\n title: \"CTC\",\n dataIndex: \"ctc\",\n key: \"ctc\",\n },\n {\n title: \"Notice Period\",\n dataIndex: \"notice\",\n key: \"notice\",\n },\n {\n title: \"Last activity\",\n dataIndex: \"lmo\",\n render: (data, record) => {\n const sortedData = Object.entries(data)\n .sort(([, a], [, b]) => b - a)\n .reduce((r, [k, v]) => ({ ...r, [k]: v }), {});\n return (\n
\n {sortedData\n ? Object.entries(sortedData).map(([key, value]) => (\n \n {getIcon(key)} {moment(value).format(\"MMM Do YY, HH:mm\")}\n
\n ))\n : \" - \"}\n \n );\n },\n },\n ];\n const isRowLocked = (record) => {\n if ([\"Edit\", \"Owner\"].includes(record?.highestPermission)) {\n return false;\n } else {\n return true;\n }\n // Example condition: lock rows where the candidate's name is 'John Doe'\n };\n const rowSelection = {\n onChange: (selectedRowKeys, selectedRows) => {\n setSelectedRowKeys(selectedRows?.map((res) => res._id));\n setcheckKey(selectedRowKeys);\n setSelectedRows(selectedRows);\n },\n getCheckboxProps: (record) => ({\n disabled: isRowLocked(record), // Disable checkbox if the row is locked\n }),\n };\n useEffect(() => {\n if (allCandidatesByPosition?.data?.length > 0) {\n let temp = [];\n let location = openPositions?.data?.find((d) => d?._id === openingsId)\n ?.location?.name;\n let company = openPositions?.data?.find((d) => d?._id === openingsId)?.cId\n ?.name;\n let positionName = openPositions?.data?.find(\n (d) => d?._id === openingsId\n )?.positionName;\n let opVar = openingAccountVariables?.data?.reduce((acc, res) => {\n acc[res?.name] = res?.value;\n return acc;\n }, {});\n allCandidatesByPosition?.data?.map((res, i) => {\n let recTemp = res?.permissions?.find(\n (x) => x?.name === \"Owner\"\n )?.principal;\n let agentData =\n agents?.data?.find((d) => d._id === recTemp?.substring(2)) ?? \"NA\";\n let agentName = agentData?.fname + \" \" + agentData?.lname;\n let validResume = res?.attachment?.filter(\n (d) =>\n d.mimeType === \"application/pdf\" ||\n d.mimeType === \"application/msword\" ||\n d.mimeType ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n );\n temp.push({\n _id: res.contactId,\n highestPermission: res?.highestPermission,\n key: i + 1,\n name: res?.profile?.data?.name ?? \"NA\",\n experience: res?.experience ?? \"NA\",\n location: res?.currLoc?.name ?? \"NA\",\n company: res?.employment ? res?.employment[0]?.orgName : \"NA\",\n designation: res?.employment ? res?.employment[0]?.designation : \"NA\",\n ctc: res?.ctc ?? \"NA\",\n expCtc: res?.expCtc ?? \"NA\",\n notice: res?.noticePeriod ?? \"NA\",\n description: res?.description ?? {},\n profileUrl: res?.profile?.data?.profileUrl ?? \"\",\n fullData: res,\n email: res?.profile?.data?.email ?? \"\",\n phone: res?.profile?.data?.phone ?? \"\",\n lmo: res?.profile?.lmo ?? \"\",\n positionName: positionName ?? \"\",\n companyNameApply: company ?? \"\",\n stageName: res?.opening?.stageName ?? \"\",\n notes: res.notes,\n qualifyQuestions: res?.qualifierQ ?? [],\n favorite: res?.favorite ?? false,\n resume: res?.rId ?? validResume?.[0]?.url ?? \"NA\",\n attachments: res?.attachment ?? [],\n recruiterName: agentName ?? \"NA\",\n reasonChange: res?.reasonChange ?? \"\",\n date: new Date().toLocaleDateString(),\n roleLocation: location ?? \"NA\",\n rId: res?.rId ?? null,\n tags: res?.profile?.tags ?? [],\n linkedIn: res?.profile?.data?.linkedIn ?? \"\",\n ...opVar,\n });\n });\n\n setTableData(temp);\n if (siderData) {\n dispatch({\n type: \"SET_OPENING_SIDEBAR_DATA\",\n data: { record: siderData?.record, TableData: temp },\n });\n }\n } else if (allCandidatesByPosition?.data?.length === 0) {\n setTableData([]);\n setActiveLoading(false);\n }\n }, [\n allCandidatesByPosition,\n allCompanies,\n candidateFilterStage,\n openingAccountVariables,\n agents,\n ]);\n useEffect(() => {\n if (stage) {\n dispatch(getContactMessagesCount());\n setfilter(stage);\n if (\n stageMetricNotif\n ?.find((data) => data?.openingId === openingsId)\n ?.stages?.find((data) => data?.stageId === stage)\n ) {\n dispatch(\n markReadNotification({\n type: \"stage\",\n stage_id: stage,\n opening_id: openingsId,\n })\n );\n }\n } else if (candidateFilterStage?.data?.length > 0) {\n // whose isDefault: true\n let temp = candidateFilterStage?.data?.find(\n (res) => res.isDefault === true\n );\n setfilter(temp?._id);\n }\n }, [candidateFilterStage, stage]);\n const handleVisibleChange = (newVisible) => {\n setVisible(newVisible);\n };\n const AddCandidatetoFlow = () => {\n setopenWorkflowCheck(true);\n setVisible(false);\n };\n const removeCandidateHandler = () => {\n let tempData = allCandidatesByPosition.data?.filter(\n (res) => !selectedRowKeys.includes(res.contactId)\n );\n let UpdatedData = {\n ...allCandidatesByPosition,\n data: tempData,\n };\n dispatch({\n type: \"GET_ALL_CANDIDATES_BY_POSITION_RESPONSE\",\n data: UpdatedData,\n });\n dispatch(\n removeCandidatesFromOpening(\n { ids: selectedRowKeys },\n { id: openingsId, stage: filter }\n )\n );\n setSelectedWF(null);\n setVisible(false);\n setSelectedRowKeys([]);\n setcheckKey([]);\n };\n const searchCandidate = useCallback(\n debounce((value) => {\n setSelectedRowKeys([]);\n setcheckKey([]);\n if (value?.length > 2) {\n const payload = {\n openingId: openingsId,\n q: value,\n };\n if (FilterTags.length > 0) {\n payload.filter = JSON.stringify(FilterTags);\n }\n dispatch(SearchCandidatesByOpenings(payload));\n } else if (value?.length === 0 && FilterTags.length === 0) {\n const payload = {\n id: openingsId,\n stage: filter,\n };\n dispatch(getAllCandidatesByPositionTrigger(payload));\n }\n }, 600),\n [FilterTags, openingsId, filter, dispatch]\n );\n useEffect(() => {\n if (TableData?.length === 0) {\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: true });\n } else {\n setActiveLoading(false);\n }\n setSelectedRowKeys([]);\n setcheckKey([]);\n }, [TableData]);\n useEffect(() => {\n let temp = [];\n selectedRowKeys?.map((res) => {\n let data = TableData?.find((d) => d._id === res);\n let qualifyQuestions = data?.qualifyQuestions?.map((res) => {\n return { [res?.q]: res?.a };\n });\n let custom = data?.fullData?.custom;\n let opVar = openingAccountVariables?.data?.reduce((acc, res) => {\n acc[res?.name] = res?.value;\n return acc;\n }, {});\n temp.push({\n name: data?.name ?? \"\",\n experience: data?.experience ?? \"\",\n location: data?.location ?? \"\",\n company: data?.company ?? \"\",\n designation: data?.designation ?? \"\",\n ctc: data?.ctc ?? \"\",\n expCtc: data?.expCtc ?? \"\",\n email: data?.email ?? \"\",\n phone: data?.phone?.replace(/^\\+91/, \"\") ?? \"\",\n notice: data?.notice ?? \"\",\n companyNameApply: data?.companyNameApply ?? \"\",\n positionName: data?.positionName ?? \"\",\n stageName: data?.stageName ?? \"\",\n notes: data?.notes ?? \"\",\n resume: data?.resume ?? \"\",\n attachments: data?.attachments?.map((obj) => obj.url).join(\"\\n\") ?? \"\",\n linkedIn: data?.fullData?.profile?.data?.linkedIn ?? \"\",\n recruiterName: data?.recruiterName ?? \"\",\n roleLocation: data?.roleLocation ?? \"\",\n date: data?.date ?? \"\",\n tags: data?.tags?.map((res) => JSON.stringify(res)).join(\" \") ?? \"\",\n reasonChange: data?.fullData?.reasonChange ?? \"\",\n qualifyQuestions:\n qualifyQuestions?.map((res) => JSON.stringify(res)).join(\" \") ?? \"\",\n ...custom,\n ...opVar,\n });\n });\n\n setCSVtableData(temp);\n }, [selectedRowKeys, TableData]);\n useEffect(() => {\n if (TableData) {\n let Q = [];\n TableData &&\n TableData.forEach((data) => {\n data?.qualifyQuestions?.forEach((res) => {\n Q.push({ label: res?.q, key: res?.q });\n });\n if (data?.fullData?.custom) {\n Object.entries(data?.fullData?.custom || {}).forEach(\n ([key, value]) => {\n Q.push({ label: key, key: key });\n }\n );\n }\n });\n let data = [...headersCSV, ...Q];\n let map = new Map(data.map((item) => [item.key, item]));\n let unique = Array.from(map.values());\n setheadersCSV(unique);\n }\n }, [TableData]);\n useEffect(() => {\n if (openingsId) {\n dispatch(getCampaigns({ openingId: openingsId }));\n }\n }, [openingsId]);\n const updateStageID = (formdata, st) => {\n let cfr = customRequires(contactForm);\n let contactIds = selectedRowKeys?.map((res) => {\n return allCandidatesByPosition?.data?.find((d) => d?.contactId === res)\n ?.contactId;\n });\n let cfCustomMap = selectedRowKeys?.map((res) => {\n let temp = allCandidatesByPosition?.data?.find(\n (d) => d?.contactId === res\n );\n return { [temp?.contactId]: temp?.custom ?? {} };\n });\n if (\n StageChangeRequiredConfig[tenantId] &&\n StageChangeRequiredConfig[tenantId]?.includes(st) &&\n cfr?.length > 0\n ) {\n let satisfied = [];\n let notSatisfied = [];\n contactIds?.forEach((id) => {\n const allKeysMatch = cfr.every(\n (key) =>\n cfCustomMap?.find((map) => map[id])?.[id]?.hasOwnProperty(key) &&\n cfCustomMap?.find((map) => map[id])?.[id][key] != null &&\n cfCustomMap?.find((map) => map[id])?.[id][key] !== \"\"\n );\n\n if (allKeysMatch) {\n satisfied.push(id);\n } else {\n notSatisfied.push(id);\n }\n });\n if (satisfied?.length !== contactIds?.length) {\n contactIds = satisfied;\n let CandidateAlert = notSatisfied?.map((canId) => {\n return allCandidatesByPosition?.data?.find(\n (d) => d?.contactId === canId\n )?.profile?.data?.name;\n });\n notification.error({\n message: (\n
\n
\n The following candidates have not completed the required fields.\n Please review the mandatory fields in the profile widget.\n
\n
    \n {CandidateAlert.map((er, index) => (\n
  • \n {er}\n
  • \n ))}\n
\n
\n ),\n });\n }\n }\n if (contactIds.length > 0) {\n let tempData = allCandidatesByPosition.data?.filter(\n (res) => !contactIds.includes(res.contactId)\n );\n let UpdatedData = {\n ...allCandidatesByPosition,\n data: tempData,\n };\n dispatch({\n type: \"GET_ALL_CANDIDATES_BY_POSITION_RESPONSE\",\n data: UpdatedData,\n });\n dispatch(\n PatchStageIdInBulk(\n {\n contactIds: contactIds,\n openingId: openingsId,\n stageId: StageChange,\n ...formdata,\n },\n openingsId,\n stage ?? candidateFilterStage?.data[0]?._id\n )\n );\n }\n };\n useEffect(() => {\n if (StageChange) {\n setconfirmModal(true);\n }\n }, [StageChange]);\n\n function sanitizeString(str) {\n return str.replace(/,/g, \" \").replace(/\\n/g, \"; \");\n }\n\n const ShareCandidatesWithRecruiter = () => {\n let ids = SelectedRows?.map((res) => res?.fullData?._id);\n let data = {\n candidates: ids,\n shareWith: CandidateShareWith,\n type: shareType,\n };\n dispatch(shareCandidatesWith(data));\n cancelShareWithCandidate();\n };\n\n const scrollContainerRef = useRef(null);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(false);\n\n // Function to update scroll availability\n const updateScrollAvailability = () => {\n const { current } = scrollContainerRef;\n if (current) {\n const maxScrollLeft = current.scrollWidth - current.clientWidth;\n setCanScrollLeft(current.scrollLeft > 0);\n setCanScrollRight(current.scrollLeft < maxScrollLeft);\n }\n };\n // Scroll the container by a certain amount\n const scroll = (amount) => {\n if (scrollContainerRef.current) {\n scrollContainerRef.current.scrollBy({\n left: amount,\n behavior: \"smooth\",\n });\n }\n };\n // Scroll left function\n const scrollLeft = () => {\n scroll(-200); // Adjust the scroll amount as needed\n };\n // Scroll right function\n const scrollRight = () => {\n scroll(200); // Adjust the scroll amount as needed\n };\n // UseEffect to check scroll availability on mount and resize\n useEffect(() => {\n updateScrollAvailability();\n window?.addEventListener(\"resize\", updateScrollAvailability);\n scrollContainerRef?.current?.addEventListener(\n \"scroll\",\n updateScrollAvailability\n );\n return () => {\n window?.removeEventListener(\"resize\", updateScrollAvailability);\n scrollContainerRef?.current?.removeEventListener(\n \"scroll\",\n updateScrollAvailability\n );\n };\n }, []);\n useEffect(() => {\n const updateScroll = () => {\n updateScrollAvailability();\n };\n // Create a ResizeObserver to observe the container\n const resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n updateScroll();\n }\n });\n if (scrollContainerRef?.current) {\n resizeObserver?.observe(scrollContainerRef?.current);\n }\n // Call updateScroll initially in case the content is already loaded\n updateScroll();\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n const cancelShareWithCandidate = () => {\n setAccessWith(false);\n setCandidateShareWith(null);\n setShareType(\"share\");\n };\n\n // TODO FilterTag logic later move to independent component\n\n const [keyType, setKeyType] = useState(null);\n const [FilterComp, setFilterComp] = useState(false);\n const handleOpenChange = (FilterComp) => {\n setFilterComp(FilterComp);\n };\n const onFinish = (value) => {\n const existingTagIndex = FilterTags.findIndex(\n (tag) => tag.key === value.key\n );\n\n if (existingTagIndex !== -1) {\n const updatedTags = [...FilterTags];\n updatedTags[existingTagIndex] = value;\n setFilterTags(updatedTags);\n } else {\n setFilterTags([...FilterTags, value]);\n }\n\n setFilterComp(false);\n form.resetFields();\n };\n const removeFilter = (tag) => {\n let temp = FilterTags.filter((vl) => vl.key !== tag);\n setFilterTags(temp);\n };\n\n const triggerFilterTags = () => {\n const payload = {\n openingId: openingsId,\n };\n if (SearchActive.length > 0 || FilterTags.length > 0) {\n if (SearchActive.length > 0) {\n payload[\"q\"] = SearchActive;\n }\n if (FilterTags.length > 0) {\n payload[\"filter\"] = JSON.stringify(FilterTags);\n }\n dispatch(SearchCandidatesByOpenings(payload));\n }\n if (FilterTags.length === 0 && SearchActive.length === 0 && filter) {\n let obj = {\n id: openingsId,\n stage: filter,\n };\n dispatch(getAllCandidatesByPositionTrigger(obj));\n }\n };\n\n useEffect(() => {\n triggerFilterTags();\n }, [FilterTags]);\n\n const [SelectedOwner, setSelectedOwner] = useState(null);\n\n const TransferOwner = () => {\n let keys = selectedRowKeys?.map(\n (res) =>\n allCandidatesByPosition?.data?.find((d) => d?.contactId === res)?._id\n );\n let payload = {\n ownerId: SelectedOwner,\n candidateIds: keys,\n openingId: openingsId,\n };\n dispatch(transferOwnerShip(payload));\n setOwnerChangeModal(false);\n setSelectedOwner(null);\n };\n\n return (\n
\n
\n {selectedRowKeys?.length === 0 && (\n
\n
\n {\n let val = event.target.value.replace(/[+\\-()\\s]/g, \" \");\n setSearchActive(event.target.value);\n searchCandidate(val);\n }}\n prefix={\n \n }\n />\n handleOpenChange()}\n content={\n \n
\n Select filter items\n
\n \n \n {\n let kData = contactForm?.formItems?.find(\n (r) => r.key === val\n );\n setKeyType(kData);\n form.setFieldValue(\"value\", \"\");\n }}\n >\n {contactForm?.formItems?.map((res) => {\n if (\n [\"cd\", \"custom\"].includes(res?.category) &&\n res.isActive\n ) {\n return (\n \n {res.lebel}\n \n );\n }\n })}\n \n \n {keyType && (\n \n {keyType?.type === \"text\" && (\n \n form.setFieldValue(\n \"value\",\n e.target.value.trim()\n )\n }\n />\n )}\n {keyType?.type === \"select\" && (\n form.setFieldValue(\"value\", v)}\n >\n {keyType?.elementOptions?.map((res) => (\n \n {res}\n \n ))}\n \n )}\n \n )}\n \n {\n setFilterTags([]);\n }}\n className=\"CancelBtn mr-2\"\n >\n Clear All\n \n \n Apply\n \n \n \n
\n }\n >\n \n \n \n
\n {FilterTags?.map((res) => {\n return (\n {\n removeFilter(res?.key);\n }}\n >\n {res?.key}: {res?.value}\n \n );\n })}\n
\n
\n )}\n
\n {selectedRowKeys?.length > 0 && (\n \n removeCandidateHandler()}\n >\n Remove ({selectedRowKeys?.length})\n \n \n
\n setSelectedWF(value)}\n >\n {CampaignsList?.data?.map((res) => {\n return (\n {res?.name}\n );\n })}\n \n
\n
\n AddCandidatetoFlow()}\n >\n ADD\n \n
\n
\n }\n trigger=\"click\"\n placement=\"bottom\"\n >\n Add to Campaign\n \n {/* {\n setSelectedRowKeys([]);\n setcheckKey([]);\n }}\n >\n Clear Selection\n */}\n setAccessWith(true)}\n >\n Share Access ({selectedRowKeys?.length})\n \n setreportModal(true)}\n className=\"d-flex gap10 can-exp-btn cursor-pointer\"\n style={{\n width: 180,\n alignItems: \"center\",\n }}\n >\n \n Send Report ({selectedRowKeys?.length})\n \n setOwnerChangeModal(true)}\n className=\"d-flex gap10 can-exp-btn cursor-pointer\"\n style={{\n width: 190,\n alignItems: \"center\",\n }}\n >\n \n Change Owner ({selectedRowKeys?.length})\n \n
\n {\n setStageChange(v);\n }}\n value={StageChange}\n >\n {candidateFilterStage?.data?.map((res) => {\n return {res?.name};\n })}\n \n
\n \n )}\n \n \n {SearchActive?.length === 0 && FilterTags.length === 0 && (\n
\n {canScrollLeft && (\n \n \"left\"\n // Left scroll button\n )}\n \n {candidateFilterStage?.data?.map((res) => {\n const isDisabled = candidateLoading && res?._id !== filter;\n let stage = stageMetricNotif\n ?.find((data) => data.openingId === openingsId)\n ?.stages?.find((data) => data.stageId === res._id);\n return (\n {\n if (!candidateLoading) {\n setfilter(res._id);\n history.push(\n `/admin/openings/${openingsId}/Candidates/${res._id}`\n );\n }\n }}\n >\n 0 ? true : false}\n offset={[5, 0]}\n className=\"notif-config\"\n >\n {res?.name}\n \n {openPositions?.data?.find((d) => d?._id === openingsId)\n ?.candidateStages[res._id] ?? 0}\n {\" \"}\n \n \n );\n })}\n
\n {canScrollRight && (\n \n \"right\"\n // Right scroll button\n )}\n \n )}\n {!candidateLoading && !ActiveLoading && (\n
\n res?.key),\n expandedRowRender: (record) => {\n console.log(\"record===>\", record);\n let agentData = agents?.data?.find(\n (d) => d._id === record?.fullData?.owner\n );\n let agentName = agentData?.fname + \" \" + agentData?.lname;\n return (\n
\n {\" \"}\n
\n \n
\n
\n {\n let key = CandidateCardCount?.find(\n (res) =>\n res?.contactId ===\n record?.fullData?.contactId\n )?.convId;\n if (key) {\n dispatch(\n markReadNotification({\n type: \"message\",\n conv_id: key,\n })\n );\n }\n dispatch({\n type: \"MESSAGE_WIDGET\",\n data: true,\n });\n openCandidateView(record);\n }}\n size=\"small\"\n count={\n CandidateCardCount?.find(\n (res) =>\n res?.contactId ===\n record?.fullData?.contactId\n )?.counts?.email\n }\n offset={[5, 0]}\n className=\"notif-config\"\n >\n \n \n
\n {/*
Email
*/}\n
\n
\n
\n {\n let key = CandidateCardCount?.find(\n (res) =>\n res?.contactId ===\n record?.fullData?.contactId\n )?.convId;\n if (key) {\n dispatch(\n markReadNotification({\n type: \"message\",\n conv_id: key,\n })\n );\n dispatch(\n markReadConversation({\n convId: key,\n })\n );\n }\n dispatch({\n type: \"MESSAGE_WIDGET\",\n data: true,\n });\n openCandidateView(record);\n }}\n size=\"small\"\n count={\n CandidateCardCount?.find(\n (res) =>\n res?.contactId ===\n record?.fullData?.contactId\n )?.counts?.whatsapp\n }\n offset={[5, 0]}\n className=\"notif-config\"\n >\n {\" \"}\n \n \n
\n {/*
WhatsApp
*/}\n
\n {\n let validResume = record?.attachments?.filter(\n (d) =>\n d.mimeType === \"application/pdf\" ||\n d.mimeType === \"application/msword\" ||\n d.mimeType ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n );\n if (validResume?.length > 0 && !record?.rId) {\n window.open(validResume[0]?.url, \"_blank\");\n }\n if (record?.rId) {\n window.open(record?.rId, \"_blank\");\n }\n }}\n >\n
\n 5 ||\n record?.resume?.length > 5\n ? `cn-resume.svg`\n : `cn-resume-def.svg`\n }`}\n alt=\"mail\"\n />\n
\n
\n
\n
\n \n \n \n {agentName[0]}\n \n \n \n
\n
\n \n
\n
\n );\n },\n }}\n pagination={{\n pageSize: 50,\n position: [\"none\", \"none\"],\n }}\n rowSelection={{\n selectedRowKeys: checkKey,\n type: \"checkbox\",\n ...rowSelection,\n }}\n dataSource={TableData}\n scroll={{\n y: 480,\n }}\n />\n
\n {allCandidatesByPosition?.paging?.before?.length > 0 && (\n {\n dispatch(\n getAllCandidatesByPositionTrigger({\n id: openingsId,\n stage: filter,\n before: allCandidatesByPosition?.paging?.before,\n })\n );\n }}\n >\n Prev Page\n \n )}\n {allCandidatesByPosition?.paging?.after?.length > 0 && (\n {\n dispatch(\n getAllCandidatesByPositionTrigger({\n id: openingsId,\n stage: filter,\n after: allCandidatesByPosition?.paging?.after,\n })\n );\n }}\n >\n Next Page\n \n )}\n
\n \n )}\n {(candidateLoading || ActiveLoading) && (\n \n )}\n \n res?._id === SelectedWF)?.name\n }\n targetType=\"c\"\n />\n \n \n d._id === StageChange)?.name\n }\n updateStageID={updateStageID}\n setconfirmModal={setconfirmModal}\n openingId={openingsId}\n sVal={StageChange}\n setStageChange={setStageChange}\n />\n \n \n d?._id === openingsId)?.submitTo ??\n null\n }\n submitCc={\n openPositions?.data?.find((d) => d?._id === openingsId)?.submitCc ??\n []\n }\n submissionSequence={\n openPositions?.data?.find((d) => d?._id === openingsId)\n ?.submissionSequence &&\n Object.keys(\n openPositions?.data?.find((d) => d?._id === openingsId)\n ?.submissionSequence || {}\n ).length > 0\n ? openPositions?.data?.find((d) => d?._id === openingsId)\n ?.submissionSequence\n : Array.isArray(TrackerConfiguration)\n ? TrackerConfiguration?.find(\n (res) => res.trackerType === \"submissionTracker\"\n )?.data ?? null\n : null\n }\n exportSequence={null}\n next={true}\n header=\"Submission Report\"\n openPositions={openPositions}\n allCompanies={allCompanies}\n candidateFilterStage={candidateFilterStage}\n selectedRowKeys={selectedRowKeys}\n CSVtableData={CSVtableData}\n filter={filter}\n type=\"submissionTracker\"\n />\n \n \n
\n Share candidates access with\n
\n \n setCandidateShareWith({\n entityId: value,\n permission: \"Edit\",\n entityType: \"User\",\n })\n }\n >\n {agents?.data?.map((res) => {\n if (\n openPositions?.data\n ?.find((d) => d?._id === openingsId)\n ?.permissions?.find(\n (d) => d?.principal?.substring(2) === res?._id\n )\n ) {\n return (\n \n {res.fname} {res.lname}\n \n );\n }\n })}\n \n\n {CandidateShareWith?.permission && (\n
\n
Access Type
\n {\n setCandidateShareWith({\n ...CandidateShareWith,\n permission: val,\n });\n }}\n >\n Edit\n Read\n \n
\n )}\n {CandidateShareWith?.permission && (\n
\n
Submit as
\n {\n setShareType(val);\n }}\n >\n Share\n Unshare\n \n
\n )}\n
\n ShareCandidatesWithRecruiter()}\n >\n Submit\n \n {\n cancelShareWithCandidate();\n }}\n >\n Cancel\n \n
\n \n \n
\n
\n
\n Set Owner for {selectedRowKeys?.length} candidate\n {selectedRowKeys?.length > 1 ? \"s\" : \"\"}\n
\n {\n setOwnerChangeModal(false);\n setSelectedOwner(null);\n }}\n >\n Cancel\n \n
\n
\n Select Recruiter\n setSelectedOwner(v)}\n value={SelectedOwner}\n >\n {agents?.data?.map((res) => {\n return (\n \n {res?.fname} {res?.lname}\n \n );\n })}\n \n
\n
\n
\n {\n TransferOwner();\n }}\n >\n Submit\n \n
\n \n \n );\n};\n\nexport default Candidates;\n","// This icon file is generated automatically.\nvar HistoryOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z\" } }] }, \"name\": \"history\", \"theme\": \"outlined\" };\nexport default HistoryOutlined;\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 HistoryOutlinedSvg from \"@ant-design/icons-svg/es/asn/HistoryOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar HistoryOutlined = function HistoryOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: HistoryOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(HistoryOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'HistoryOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ArrowLeftOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"arrow-left\", \"theme\": \"outlined\" };\nexport default ArrowLeftOutlined;\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 ArrowLeftOutlinedSvg from \"@ant-design/icons-svg/es/asn/ArrowLeftOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ArrowLeftOutlined = function ArrowLeftOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ArrowLeftOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ArrowLeftOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ArrowLeftOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar RadiusSettingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M396 140h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-44 684h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm524-204h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 344h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 160h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 160h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 160h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm320 0h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm160 0h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm140-284c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V370c0-127-103-230-230-230H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h170c87.3 0 158 70.7 158 158v170zM236 96H92c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8h144c4.4 0 8-3.6 8-8V104c0-4.4-3.6-8-8-8zm-48 101.6c0 1.3-1.1 2.4-2.4 2.4h-43.2c-1.3 0-2.4-1.1-2.4-2.4v-43.2c0-1.3 1.1-2.4 2.4-2.4h43.2c1.3 0 2.4 1.1 2.4 2.4v43.2zM920 780H776c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8h144c4.4 0 8-3.6 8-8V788c0-4.4-3.6-8-8-8zm-48 101.6c0 1.3-1.1 2.4-2.4 2.4h-43.2c-1.3 0-2.4-1.1-2.4-2.4v-43.2c0-1.3 1.1-2.4 2.4-2.4h43.2c1.3 0 2.4 1.1 2.4 2.4v43.2z\" } }] }, \"name\": \"radius-setting\", \"theme\": \"outlined\" };\nexport default RadiusSettingOutlined;\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 RadiusSettingOutlinedSvg from \"@ant-design/icons-svg/es/asn/RadiusSettingOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RadiusSettingOutlined = function RadiusSettingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RadiusSettingOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RadiusSettingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RadiusSettingOutlined';\n}\nexport default RefIcon;","import { CheckCircleFilled } from \"@ant-design/icons\";\nimport { CXSwitch } from \"component/Switch\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { truncateSt } from \"utils\";\n\nconst CloneWorkflow = ({ SelectedWF, setSelectedWF }) => {\n const { CampaignsList } = useSelector((state) => state.CampaignReducer);\n\n const triggerType = {\n ondemand: \"On-demand\",\n \"date-time\": \"Scheduled\",\n event: \"Event\",\n };\n const addRemoveHandler = (id) => {\n const index = SelectedWF.findIndex((item) => item.wfId === id);\n if (index === -1) {\n setSelectedWF([...SelectedWF, { wfId: id, type: \"mwf\", isCopy: false }]);\n } else {\n setSelectedWF(SelectedWF.filter((item) => item.wfId !== id));\n }\n };\n const addRemoveHandlerType = (id) => {\n const index = SelectedWF.findIndex((item) => item.wfId === id);\n if (index === -1) {\n setSelectedWF([...SelectedWF, { wfId: id, type: \"cwf\", isCopy: true }]);\n } else {\n setSelectedWF(\n SelectedWF.map((item) => {\n if (item.wfId === id) {\n return {\n ...item,\n type: item?.type === \"mwf\" ? \"cwf\" : \"mwf\",\n isCopy: item?.type === \"mwf\" ? true : false,\n };\n }\n return item;\n })\n );\n }\n\n // if (index === -1) {\n // setSelectedWF([...SelectedWF, { wfId: id, type: \"cwf\" }]);\n // } else {\n // setSelectedWF(SelectedWF.filter((item) => item.wfId !== id));\n // }\n };\n console.log(\"SelectedWF====>\", SelectedWF);\n const SelectAllWB = (val) => {\n if (val) {\n setSelectedWF(\n CampaignsList?.data?.map((res) => ({ wfId: res._id, type: \"mwf\" }))\n );\n } else {\n setSelectedWF([]);\n }\n };\n useEffect(() => {\n if (CampaignsList?.data?.length > 0) {\n setSelectedWF(\n CampaignsList?.data?.map((res) => {\n return { wfId: res._id, type: \"mwf\" };\n })\n );\n }\n }, [CampaignsList]);\n return (\n
\n
\n
Select workflow to mirror
\n
\n SelectAllWB(val)}\n checked={SelectedWF?.length === CampaignsList?.data?.length}\n />\n
\n
\n
\n {CampaignsList?.data?.map((res) => {\n return (\n
\n
\n
\n {\n addRemoveHandler(res._id);\n }}\n >\n item.wfId === res._id)\n ? \"#018fff\"\n : \"#C8C8C8\",\n fontSize: 16,\n marginRight: 5,\n }}\n />\n {res.status.charAt(0).toUpperCase() + res.status.slice(1)}\n
\n {\n addRemoveHandlerType(res._id);\n }}\n >\n item.wfId === res._id)\n ?.type === \"cwf\"\n }\n />\n Copy\n
\n
\n
\n {truncateSt(res?.name, 25)}\n
\n
{triggerType[res?.trigger?.type] ?? \"N/A\"}
\n {res?.trigger?.type === \"date-time\" && (\n
\n {moment(res.triggerTime).format(\"lll\")}\n
\n )}\n
\n {\n {\n no_order: \"No Order\",\n abandoned_cart: \"Abandoned Cart\",\n }[res?.trigger?.event]\n }\n
\n
\n \n );\n })}\n \n \n );\n};\n\nexport default CloneWorkflow;\n","import {\n ArrowLeftOutlined,\n CheckCircleFilled,\n DeleteFilled,\n DoubleRightOutlined,\n EditFilled,\n PlayCircleOutlined,\n RadiusSettingOutlined,\n SettingOutlined,\n SlidersOutlined,\n SwapOutlined,\n HistoryOutlined,\n} from \"@ant-design/icons\";\nimport {\n delCampaign,\n getCampaigns,\n getCampaignsMaster,\n updateCampaigns,\n} from \"action/CampaignAction\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenuItem, CXSubMenu, CXMenu } from \"component/Menu\";\nimport { CXSkeleton } from \"component/Skeleton\";\nimport moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { truncateSt } from \"utils\";\nimport history from \"utils/history\";\nimport { useRouteMatch, Switch, Route } from \"react-router-dom\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXCard } from \"component/Card\";\nimport CampaignCreateEvent from \"../Campaigns/CampaignCreateEvent\";\nimport CampaignCreate from \"../Campaigns/CampaignCreate\";\nimport CloneWorkflow from \"./AddPosition/CloneWorkflow\";\nimport { Button } from \"antd\";\nimport { cloneWorkflow } from \"action/OpeningsAction\";\nimport CampaignPlans from \"../Campaigns/CampaignPlans\";\nimport CampaignView from \"../Campaigns/CampaignView\";\nimport { CXContent, CXLayout, CXSider } from \"component/Layout\";\nimport Campaigns from \"../Campaigns/SideBarData\";\nimport { CXModal } from \"component/Modal\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { CXOption, CXSelect } from \"component/Select\";\n\nconst Sequences = () => {\n const { url, path } = useRouteMatch();\n const [Steps, setSteps] = useState(null);\n const [SelectedWF, setSelectedWF] = useState([]);\n const [CopyComponentLoading, setCopyComponentLoading] = useState(false);\n const { openingsId } = useParams();\n const [channelAccount, setchannelAccount] = useState(null);\n const [caSelector, setcaSelector] = useState(false);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { loading, CampaignsList } = useSelector(\n (state) => state.CampaignReducer\n );\n const { grpList } = useSelector((state) => state.ContactReducer);\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch(getCampaigns({ openingId: openingsId }));\n }, [url]);\n\n const triggerType = {\n ondemand: \"On-demand\",\n \"date-time\": \"Scheduled\",\n event: \"Event\",\n };\n const StatusChange = [\n { Publish: \"published\" },\n { Disable: \"disabled\" },\n { Draft: \"draft\" },\n { Complete: \"completed\" },\n ];\n const openInNewTab = (id) => {\n history.push(`${url}/view/${id}`);\n };\n const menu = (id, CaseCheck) => (\n \n {\n history.push(`${url}/edit/${id}`);\n }}\n >\n \n Edit workflow\n \n openInNewTab(id)}>\n \n Configure steps\n \n }\n title={Change status}\n >\n {StatusChange.map((item, index) => {\n return (\n {\n dispatch(\n updateCampaigns(id, {\n status: Object.values(item)[0],\n })\n );\n // e.stopPropagation();\n }}\n >\n \n {Object.keys(item)[0]}\n \n );\n })}\n \n {CaseCheck === \"ondemand\" && (\n \n \n Run on-demand\n \n )}\n {\n history.push(`${url}/history/${id}`);\n }}\n >\n \n History\n \n {\n dispatch(delCampaign(id));\n // e.stopPropagation();\n }}\n >\n \n Delete Workflow\n \n \n );\n const backTomain = () => {\n setSteps(null);\n dispatch(getCampaigns({ openingId: openingsId }));\n };\n const DataSider = useSelector((state) => state.CampaignReducer.DataSider);\n const CopySequence = () => {\n dispatch(\n cloneWorkflow({\n workflows: SelectedWF.map((res) => {\n return {\n wfId: res?.wfId ?? res,\n isCopy: res.isCopy ?? false,\n };\n }),\n openingId: openingsId,\n channelAccount: channelAccount,\n })\n );\n setTimeout(() => {\n backTomain();\n }, 2000);\n };\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {\" \"}\n {!Steps && (\n
\n {(!loading || CampaignsList?.data?.length > 0) && (\n history.push(`/admin/campaign/list/createCustom`)}\n onClick={() => setSteps(\"selectOption\")}\n >\n \n \n Create Sequence\n
\n \n )}\n {loading && (\n
\n {[...Array(3)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n {!loading &&\n CampaignsList &&\n CampaignsList?.data?.length > 0 &&\n CampaignsList?.data?.map((res) => {\n return (\n {\n history.push(`${url}/view/${res._id}`);\n }}\n >\n
\n
\n
\n \n {res.status.charAt(0).toUpperCase() +\n res.status.slice(1)}\n
\n {\n e.stopPropagation();\n }}\n >\n \n
\n \n
\n \n
\n
\n
\n {truncateSt(res?.name, 25)}\n
\n
\n {triggerType[res?.trigger?.type] ?? \"N/A\"}\n
\n {res?.trigger?.type === \"date-time\" && (\n
\n {moment(res.triggerTime).format(\"lll\")}\n
\n )}\n {[\"ondemand\", \"date-time\"]?.includes(\n res?.trigger?.type\n ) && (\n
\n {grpList?.data?.filter(\n (d) => d._id === res?.targetGroup[0]\n )[0]?.name ?? \"N/A\"}\n
\n )}\n
\n {\n {\n no_order: \"No Order\",\n abandoned_cart: \"Abandoned Cart\",\n }[res?.trigger?.event]\n }\n
\n \n \n );\n })}\n \n )}\n {Steps === \"selectOption\" && (\n
\n backTomain()}\n >\n Cancel\n \n
\n setSteps(\"CustomSequence\")}\n >\n
\n \n
\n
Create
\n
Custom Sequence
\n \n {\n setCopyComponentLoading(true);\n dispatch(getCampaignsMaster());\n setSteps(\"ExistingSequence\");\n setTimeout(() => {\n setCopyComponentLoading(false);\n }, 1000);\n }}\n >\n
\n \n
\n
Copy
\n
\n Existing Sequence{\" \"}\n
\n \n
\n
\n )}\n {Steps === \"CustomSequence\" && (\n
\n setSteps(\"selectOption\")}\n >\n Back\n \n
\n \n
\n
\n )}\n {Steps === \"ExistingSequence\" && (\n
\n
\n setSteps(\"selectOption\")}\n >\n Back\n
\n {SelectedWF?.length > 0 && (\n
\n {\n if (SelectedWF.find((res) => res.type === \"cwf\")) {\n setcaSelector(true);\n } else {\n CopySequence();\n }\n }}\n >\n Copy Sequences\n \n
\n )}\n \n\n {!CopyComponentLoading && (\n
\n \n
\n )}\n {CopyComponentLoading && (\n
\n {[...Array(3)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n
\n )}\n \n
\n
\n
\n \n \n \n setcaSelector(false)}\n onOk={() => {\n if (channelAccount) {\n setcaSelector(false);\n CopySequence();\n setchannelAccount(null);\n }\n }}\n okText=\"Proceed to Copy\"\n cancelText=\"Cancel\"\n centered\n closable={false}\n >\n
\n {\n setchannelAccount(val);\n }}\n >\n {\"\"}\n {allConfigData?.map((res) => {\n if (res.md === \"email\") {\n return (\n {res?.configEmail?.email}\n );\n }\n })}\n \n
\n \n \n );\n};\n\nexport default Sequences;\n","import { updateOpenPositionTrigger } from \"action/OpeningsAction\";\nimport {\n CXMarkdownDescriptionEditor,\n CXMarkdownEditor,\n} from \"component/MarkdownEditor\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { getApiUrl, getCookie, transformString } from \"utils\";\n\nconst OpeningsNote = () => {\n const [text, settext] = useState(\"\");\n const dispatch = useDispatch();\n const { openingsId } = useParams();\n const { openPositions } = useSelector((state) => state.OpeningReducer);\n console.log(text);\n\n useEffect(() => {\n if (openingsId && openPositions?.data?.length > 0) {\n let data = openPositions?.data?.filter((item) => item._id === openingsId);\n settext(data[0]?.notes ?? \"\");\n }\n }, [openingsId, openPositions]);\n\n return (\n
\n {\n const data = editor.getData();\n settext(data);\n let GlobalState = openPositions?.data?.filter(\n (item) => item._id === openingsId\n )[0];\n let {\n _id,\n createdAt,\n createdBy,\n tenantId,\n location,\n __v,\n permissions,\n ...rest\n } = GlobalState;\n let principal = permissions?.map((res) => {\n let extracted = transformString(res?.principal);\n let { id, type } = extracted;\n return { name: res?.name, id, type };\n });\n if (rest?.cId?._id) {\n rest.cId = rest.cId?._id;\n }\n let updatedLoc = {\n name: location?.name,\n _id: location?._id,\n };\n rest.location = updatedLoc;\n rest.notes = data;\n rest.principal = principal;\n dispatch(updateOpenPositionTrigger(openingsId, rest));\n }}\n uploadUrl={getApiUrl() + \"/file/article\"}\n authorizationToken={getCookie(\"ob_a\")}\n />\n
\n );\n};\n\nexport default OpeningsNote;\n","import { CXTabs } from \"component/Tabs\";\nimport React, { useEffect, useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport Settings from \"./Settings\";\nimport Dasboard from \"./Dasboard\";\nimport Candidates from \"./CandidateListing/Candidates\";\nimport Sequences from \"./Sequences\";\nimport { CXSider } from \"component/Layout\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport OpeningsNote from \"./OpeningsNote\";\nimport { getOpeningByIdTrigger } from \"action/OpeningsAction\";\n\nconst OpeningsDetailsTabs = () => {\n const dispatch = useDispatch();\n const { tab, openingsId } = useParams();\n const [Active, setActive] = useState(tab);\n const handleActive = (val) => {\n history.push(`/admin/openings/${openingsId}/${val}`);\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: true });\n dispatch({ type: \"SET_OPENING_SIDEBAR_DATA\", data: null });\n dispatch({ type: \"SET_OPENING_TAB\", data: null });\n };\n useEffect(() => {\n dispatch(getOpeningByIdTrigger(openingsId));\n }, [openingsId]);\n return (\n
\n handleActive(ac)}\n items={[\n {\n key: \"Candidates\",\n label: \"Candidates\",\n children: ,\n },\n {\n key: \"Sequences\",\n label: \"Sequences\",\n children: ,\n },\n {\n key: \"Settings\",\n label: \"Settings\",\n children: ,\n },\n {\n key: \"Notes\",\n label: \"Notes\",\n children: ,\n },\n ]}\n />\n
\n );\n};\n\nexport default OpeningsDetailsTabs;\n","import { RightOutlined } from \"@ant-design/icons\";\nimport { patchWorkflowCAbyOpening } from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXEmpty } from \"component/Empty\";\nimport { InfoBox } from \"component/InfoBox\";\nimport { CXSelect, CXOption } from \"component/Select\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport history from \"utils/history\";\nimport { getCookie } from \"utils\";\n\nconst SettingsSequences = ({\n CancelModal = () => {},\n CancelParentModal = () => {},\n updatePrime = () => {},\n openPositionData,\n}) => {\n const dispatch = useDispatch();\n const { openingsId } = useParams();\n const userTenants = useSelector(\n (state) => state.dittoAdminReducer?.user?.userTenants\n );\n const mfwAllowed = useSelector((state) => state.dittoAdminReducer.mfwAllowed);\n const wfTypes = useSelector((state) => state.dittoAdminReducer.wfTypes);\n const { WFCA, tempOpeningData, openPositions } = useSelector(\n (state) => state.OpeningReducer\n );\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { agents } = useSelector((state) => state.AgentReducer);\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const [caMap, setcaMap] = useState([]);\n const [Default, setDefault] = useState(null);\n\n const cp = openPositions?.data?.find((val) => val._id === openingsId);\n\n const finish = () => {\n if (WFCA?.length > 0 && caMap?.length > 0) {\n dispatch(\n patchWorkflowCAbyOpening({\n openingId: tempOpeningData?._id ?? openingsId,\n caMap: caMap,\n })\n );\n setTimeout(() => {\n CancelModal();\n CancelParentModal(false);\n }, 1500);\n } else {\n CancelModal();\n CancelParentModal(false);\n }\n };\n\n useEffect(() => {\n const defaultEmail = allConfigData?.find(\n (e) => e?.configEmail?.email === user?.userProfile?.email\n );\n const data = WFCA?.filter((data) => data?.res?.md === \"email\");\n const temp = defaultEmail\n ? [{ newCa: defaultEmail?._id, oldCa: data?.[0]?.res?._id }]\n : data?.map((z) => ({ newCa: z?.res?._id, oldCa: z?.res?._id }));\n\n if (Array.isArray(temp)) {\n setcaMap([...temp]);\n }\n setDefault(\n defaultEmail ? defaultEmail.configEmail.email : data?.[0]?.res?._id\n );\n }, [WFCA, allConfigData, user]);\n\n const ChangePrime = () => {\n const id = tempOpeningData?._id ?? openingsId;\n history.push({\n pathname: `/admin/openings/${id}/Settings`,\n state: { tab: \"recruitersignature\" },\n });\n };\n const tenantId = getCookie(\"tenant\");\n const primeAgentId = tempOpeningData ? tempOpeningData?.prime : cp?.prime;\n const primeAgent = agents?.data?.find((agent) => agent._id === primeAgentId);\n const agentName = primeAgent?.fname;\n const primeAgentEmail = primeAgent?.email;\n console.log(\"WFCA\", wfTypes, WFCA, mfwAllowed);\n return (\n
\n \n \n Opening Preview\n \n {(!mfwAllowed || (mfwAllowed && wfTypes?.includes(\"cwf\"))) && (\n
\n {WFCA?.length > 0 &&\n caMap?.length > 0 &&\n window.location.href.includes(\"Settings\") && (\n {\n dispatch(\n patchWorkflowCAbyOpening({\n openingId: tempOpeningData?._id ?? openingsId,\n caMap: caMap,\n })\n );\n updatePrime();\n }}\n >\n Update\n \n )}\n {(Default || WFCA?.length === 0) && CancelModal && (\n {\n finish();\n }}\n >\n Done\n \n )}\n
\n )}\n {mfwAllowed && !wfTypes?.includes(\"cwf\") && (\n
\n {/* {\n ChangePrime();\n }}\n >\n Change Primary Recruiter\n */}\n {\n finish();\n }}\n >\n Done\n \n
\n )}\n
\n {(!mfwAllowed || (mfwAllowed && wfTypes?.includes(\"cwf\"))) && (\n
\n
\n {WFCA?.length === 0 && (\n \n )}\n {WFCA?.length > 0 &&\n WFCA?.map((d) => {\n if (d.res.md === \"email\") {\n const defaultEmail = allConfigData?.find(\n (e) => e?.configEmail?.email === user?.userProfile?.email\n );\n return (\n
\n
\n \n Please select Sender email id\n {window.location.href.includes(\"Settings\") && (\n
\n Default Email : {d.res?.configEmail?.email}\n
\n )}\n \n \n {\n const data = WFCA?.filter(\n (data) => data?.res?.md === \"email\"\n );\n const temp = data?.map((z) => ({\n newCa: val,\n oldCa: d?.res?._id,\n }));\n setcaMap([...temp]);\n setDefault(val);\n }}\n >\n {allConfigData?.map((data) => {\n if (data?.md === \"email\") {\n return (\n \n {data?.configEmail?.email}\n \n );\n }\n })}\n \n
\n
\n );\n }\n })}\n {WFCA?.length === 0 && (\n
\n \n
\n )}\n
\n
\n )}\n {mfwAllowed && !wfTypes?.includes(\"cwf\") && (\n
\n
\n You can preview this opening here :\n \n \n window.open(\n `https://careerpage.hirebound.io/${\n userTenants?.[0]?.tenantId?.slug ?? tenantId\n }/${openPositionData?.cId}/position/${\n openPositionData?._id\n }`,\n \"_blank\"\n )\n }\n >\n {openPositionData?.positionName}\n \n \n
\n
\n )}\n
\n );\n};\n\nexport default SettingsSequences;\n","import { CloudUploadOutlined } from \"@ant-design/icons\";\nimport { getCandidateAttachments } from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXLottie } from \"component/Lottie\";\nimport CXUpload from \"component/Upload\";\nimport { postFormData } from \"helper/networkClient\";\nimport React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst CandidateAttachmentTab = ({\n navigateKey,\n DataP,\n ContactID,\n highestPermission,\n}) => {\n const dispatch = useDispatch();\n const FileIcons = (mimeType, url) => {\n if (\n [\"application/pdf\", \"application/csv\", \"application/xlsx\"].includes(\n mimeType\n )\n ) {\n let obj = {\n \"application/pdf\": (\n \n ),\n \"application/csv\": (\n \n ),\n \"application/xlsx\": (\n \n ),\n };\n return obj[mimeType];\n } else if (\n [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/webp\",\n \"image/gif\",\n ].includes(mimeType)\n ) {\n return ;\n } else if (\n [\n \"video/mp4\",\n \"video/ogg\",\n \"video/3gp\",\n \"video/3gpp\",\n \"video/3gpp2\",\n \"video/mpeg\",\n \"video/quicktime\",\n \"video/x-msvideo\",\n \"video/x-ms-wmv\",\n ].includes(mimeType)\n ) {\n return ;\n } else {\n return ;\n }\n };\n const { AttachmentLoading, Attachments } = useSelector(\n (state) => state.OpeningReducer\n );\n const [Loader, setLoader] = useState(false);\n const handleUploadFile = async (file) => {\n let id = ContactID;\n setLoader(true);\n const formData = new FormData();\n formData.append(`file`, file);\n try {\n await postFormData(`/file?c=${id}`, formData).then((resp) => {\n if (resp.status === 200) {\n dispatch(getCandidateAttachments(ContactID));\n setLoader(false);\n } else {\n setLoader(false);\n }\n });\n } catch (error) {\n setLoader(false);\n }\n };\n return (\n // className=\"hb-activity-log-cont-scroll\"\n
\n {highestPermission !== \"Read\" && (\n
\n {\" \"}\n \n \n \n Upload Attachment\n \n \n
\n )}\n {AttachmentLoading && Attachments?.length === 0 && (\n \n )}\n
\n {Attachments?.map((res) => {\n return (\n {\n window.open(res?.url);\n }}\n >\n
\n
\n {FileIcons(res.mimeType)}\n
\n
\n
\n {res?.fileName}\n
\n
\n
\n
\n );\n })}\n \n
\n );\n};\n\nexport default CandidateAttachmentTab;\n","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nfunction _callSuper(t, o, e) {\n return o = getPrototypeOf(o), possibleConstructorReturn(t, isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf(t).constructor) : o.apply(t, e));\n}\nexport { _callSuper as default };","import invariant from 'invariant';\n\nvar noop = function noop() {};\n\nfunction readOnlyPropType(handler, name) {\n return function (props, propName) {\n if (props[propName] !== undefined) {\n if (!props[handler]) {\n return new Error(\"You have provided a `\" + propName + \"` prop to `\" + name + \"` \" + (\"without an `\" + handler + \"` handler prop. This will render a read-only field. \") + (\"If the field should be mutable use `\" + defaultKey(propName) + \"`. \") + (\"Otherwise, set `\" + handler + \"`.\"));\n }\n }\n };\n}\n\nexport function uncontrolledPropTypes(controlledValues, displayName) {\n var propTypes = {};\n Object.keys(controlledValues).forEach(function (prop) {\n // add default propTypes for folks that use runtime checks\n propTypes[defaultKey(prop)] = noop;\n\n if (process.env.NODE_ENV !== 'production') {\n var handler = controlledValues[prop];\n !(typeof handler === 'string' && handler.trim().length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : invariant(false) : void 0;\n propTypes[prop] = readOnlyPropType(handler, displayName);\n }\n });\n return propTypes;\n}\nexport function isProp(props, prop) {\n return props[prop] !== undefined;\n}\nexport function defaultKey(key) {\n return 'default' + key.charAt(0).toUpperCase() + key.substr(1);\n}\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nexport function canAcceptRef(component) {\n return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t 28 or date > 29 (leap year)\n nextDate.setDate(1)\n\n nextDate.setMonth(nextMonth)\n nextDate.setDate(nextDay)\n\n return nextDate\n}\n\nfunction solveDST(currentDate, nextDate) {\n var currentOffset = currentDate.getTimezoneOffset()\n , nextOffset = nextDate.getTimezoneOffset()\n\n // if is DST, add the difference in minutes\n // else the difference is zero\n var diffMinutes = (nextOffset - currentOffset)\n\n return new Date(+(nextDate) + diffMinutes * multiplierMilli['minutes'])\n}\n\nexport function subtract(d, num, unit) {\n return add(d, -num, unit)\n}\n\nexport function startOf(d, unit, firstOfWeek) {\n d = new Date(d)\n\n switch (unit) {\n case CENTURY:\n case DECADE:\n case YEAR:\n d = month(d, 0);\n case MONTH:\n d = date(d, 1);\n case WEEK:\n case DAY:\n d = hours(d, 0);\n case HOURS:\n d = minutes(d, 0);\n case MINUTES:\n d = seconds(d, 0);\n case SECONDS:\n d = milliseconds(d, 0);\n }\n\n if (unit === DECADE)\n d = subtract(d, year(d) % 10, 'year')\n\n if (unit === CENTURY)\n d = subtract(d, year(d) % 100, 'year')\n\n if (unit === WEEK)\n d = weekday(d, 0, firstOfWeek);\n\n return d\n}\n\nexport function endOf(d, unit, firstOfWeek){\n d = new Date(d)\n d = startOf(d, unit, firstOfWeek)\n switch (unit) {\n case CENTURY:\n case DECADE:\n case YEAR:\n case MONTH:\n case WEEK:\n d = add(d, 1, unit)\n d = subtract(d, 1, DAY)\n d.setHours(23, 59, 59, 999)\n break;\n case DAY:\n d.setHours(23, 59, 59, 999)\n break;\n case HOURS:\n case MINUTES:\n case SECONDS:\n d = add(d, 1, unit)\n d = subtract(d, 1, MILI)\n }\n return d\n}\n\nexport var eq = createComparer(function(a, b){ return a === b })\nexport var neq = createComparer(function(a, b){ return a !== b })\nexport var gt = createComparer(function(a, b){ return a > b })\nexport var gte = createComparer(function(a, b){ return a >= b })\nexport var lt = createComparer(function(a, b){ return a < b })\nexport var lte = createComparer(function(a, b){ return a <= b })\n\nexport function min(){\n return new Date(Math.min.apply(Math, arguments))\n}\n\nexport function max(){\n return new Date(Math.max.apply(Math, arguments))\n}\n\nexport function inRange(day, min, max, unit){\n unit = unit || 'day'\n\n return (!min || gte(day, min, unit))\n && (!max || lte(day, max, unit))\n}\n\nexport var milliseconds = createAccessor('Milliseconds')\nexport var seconds = createAccessor('Seconds')\nexport var minutes = createAccessor('Minutes')\nexport var hours = createAccessor('Hours')\nexport var day = createAccessor('Day')\nexport var date = createAccessor('Date')\nexport var month = createAccessor('Month')\nexport var year = createAccessor('FullYear')\n\nexport function decade(d, val) {\n return val === undefined\n ? year(startOf(d, DECADE))\n : add(d, val + 10, YEAR);\n}\n\nexport function century(d, val) {\n return val === undefined\n ? year(startOf(d, CENTURY))\n : add(d, val + 100, YEAR);\n}\n\nexport function weekday(d, val, firstDay) {\n var w = (day(d) + 7 - (firstDay || 0) ) % 7;\n\n return val === undefined\n ? w\n : add(d, val - w, DAY);\n}\n\nexport function diff(date1, date2, unit, asFloat) {\n var dividend, divisor, result;\n\n switch (unit) {\n case MILI:\n case SECONDS:\n case MINUTES:\n case HOURS:\n case DAY:\n case WEEK:\n dividend = date2.getTime() - date1.getTime(); break;\n case MONTH:\n case YEAR:\n case DECADE:\n case CENTURY:\n dividend = (year(date2) - year(date1)) * 12 + month(date2) - month(date1); break;\n default:\n throw new TypeError('Invalid units: \"' + unit + '\"');\n }\n\n switch (unit) {\n case MILI:\n divisor = 1; break;\n case SECONDS:\n divisor = 1000; break;\n case MINUTES:\n divisor = 1000 * 60; break;\n case HOURS:\n divisor = 1000 * 60 * 60; break;\n case DAY:\n divisor = 1000 * 60 * 60 * 24; break;\n case WEEK:\n divisor = 1000 * 60 * 60 * 24 * 7; break;\n case MONTH:\n divisor = 1; break;\n case YEAR:\n divisor = 12; break;\n case DECADE:\n divisor = 120; break;\n case CENTURY:\n divisor = 1200; break;\n default:\n throw new TypeError('Invalid units: \"' + unit + '\"');\n }\n\n result = dividend / divisor;\n\n return asFloat ? result : Math.round(result);\n}\n\nfunction createAccessor(method){\n var hourLength = (function(method) { \n switch(method) {\n case 'Milliseconds':\n return 3600000;\n case 'Seconds':\n return 3600;\n case 'Minutes':\n return 60;\n case 'Hours':\n return 1;\n default:\n return null;\n }\n })(method);\n \n return function(d, val){\n if (val === undefined)\n return d['get' + method]()\n\n var dateOut = new Date(d)\n dateOut['set' + method](val)\n \n if(hourLength && dateOut['get'+method]() != val && (method === 'Hours' || val >=hourLength && (dateOut.getHours()-d.getHours()()\n *\n * useEffect(() => {\n * if (!element) return\n *\n * const calendar = new FullCalendar.Calendar(element)\n *\n * return () => {\n * calendar.destroy()\n * }\n * }, [element])\n *\n * return
\n * ```\n *\n * @category refs\n */\nexport default function useCallbackRef() {\n return useState(null);\n}","import { useMemo } from 'react';\nconst toFnRef = ref => !ref || typeof ref === 'function' ? ref : value => {\n ref.current = value;\n};\nexport function mergeRefs(refA, refB) {\n const a = toFnRef(refA);\n const b = toFnRef(refB);\n return value => {\n if (a) a(value);\n if (b) b(value);\n };\n}\n\n/**\n * Create and returns a single callback ref composed from two other Refs.\n *\n * ```tsx\n * const Button = React.forwardRef((props, ref) => {\n * const [element, attachRef] = useCallbackRef();\n * const mergedRef = useMergedRefs(ref, attachRef);\n *\n * return
\n \n );\n })}\n \n \n {\n setOpenModal(true);\n setdfDt(moment().format(\"DD/MM/YYYY\"));\n form.setFieldsValue({\n date: new Date(),\n timeZone: moment.tz.guess(),\n start: moment().format(\"hh:mm a\"),\n end: moment().add(1, \"hour\").format(\"hh:mm a\"),\n });\n }}\n >\n \"add\"\n
Add more
\n \n \n
\n \n )}\n {!interviewSlotLoading && interViewSlots?.length === 0 && (\n
\n \n
\n )}\n {\n console.log(\"onHide\");\n }}\n >\n \n
\n Interview Scheduling\n
\n
\n \n \n {\n setintType(e);\n form.setFieldsValue({\n calendarId: \"\",\n });\n }}\n >\n Custom Link\n Google Calendar\n None\n \n \n {(intType === \"google\" || intType === \"custom\") && (\n {\n const channelAccount =\n form.getFieldValue(\"channelAccount\");\n if (value || channelAccount) {\n callback();\n } else {\n callback(\n \"Please select either a channel account or a calendar\"\n );\n }\n },\n },\n ]}\n >\n \n option?.props?.children\n .toLowerCase()\n .includes(input.toLowerCase())\n }\n >\n {CalendarAccounts?.map((res) => {\n if (res?.dtls?.accessRole === \"owner\") {\n return (\n \n {res.dtls.name}\n \n );\n }\n })}\n \n \n )}\n {intType === \"custom\" && (\n
\n {\n const calendarValue = form.getFieldValue(\"calendarId\");\n if (value || calendarValue) {\n callback();\n } else {\n callback(\n \"Please select either a channel account or a calendar\"\n );\n }\n },\n },\n ]}\n >\n \n option?.props?.children\n .toLowerCase()\n .includes(input.toLowerCase())\n }\n >\n {allConfigData?.map((res) => {\n if (\n res.md === \"email\" &&\n res?.configEmail?.provider === \"smtp\"\n ) {\n return (\n \n {res?.configEmail?.email}\n \n );\n }\n })}\n \n \n \n \n \n
\n )}\n \n \n \n \n \n \n \n
\n {\n form.setFieldsValue({\n date: e,\n });\n }}\n format=\"DD/MM/YYYY\"\n disabledDate={(current) => {\n return current && current < moment().startOf(\"day\");\n }}\n defaultValue={moment(dfDt, \"DD/MM/YYYY\") ?? new Date()}\n />\n
\n \n
\n \n {\n setStartv(e);\n }}\n >\n {times.map((res) => {\n return {res};\n })}\n \n \n \n \n {endTimeOptions?.map((res) => {\n return {res};\n })}\n \n \n
\n \n \n {moment?.tz?.names()?.map((tz) => {\n return (\n \n {tz}\n \n );\n })}\n \n \n \n \n option?.props?.children\n .toLowerCase()\n .includes(input.toLowerCase())\n }\n >\n {agents?.data?.map((res) => {\n return (\n \n {res.email}\n \n );\n })}\n \n \n
\n {\n setOpenModal(false);\n form.resetFields();\n setUpdateSlot(null);\n setintType(\"none\");\n }}\n >\n Cancel\n \n {highestPermission !== \"Read\" && (\n \n {UpdateSlot ? Update : Save}\n \n )}\n
\n \n
\n \n \n );\n};\n\nexport default MyCalendar;\n","import React, { useEffect, useState } from \"react\";\nimport { Pie } from \"react-chartjs-2\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getOpeningByIdTrigger } from \"action/OpeningsAction\";\n\nconst Assessment = ({ activeContactTableData, openingsId }) => {\n const dispatch = useDispatch();\n const [Data, setData] = useState([1, 0]);\n const [Questions, setQuestions] = useState([]);\n const { openPositions } = useSelector((state) => state.OpeningReducer);\n\n useEffect(() => {\n dispatch(getOpeningByIdTrigger(openingsId));\n }, [dispatch, openingsId]);\n\n useEffect(() => {\n if (openPositions?.data?.length > 0) {\n setQuestions([]);\n let q = openPositions?.data?.find(\n (res) => res?._id === openingsId\n )?.qualifiers;\n let u = activeContactTableData?.qualifierQ;\n q = q?.map((res) => {\n return {\n q: res?.q,\n a: u?.find((d) => d?.q === res?.q)?.a ?? \"\",\n };\n });\n setQuestions(q);\n let count = 0;\n q?.forEach((res) => {\n if (res?.a) {\n count++;\n }\n });\n setData([q?.length - count, count]);\n }\n }, [openPositions, activeContactTableData, openingsId]);\n\n const data = {\n labels: [\"Answered\", \"Not Answered\"],\n datasets: [\n {\n data: Data,\n backgroundColor: [\"#A44EBC\", \"#4CB580\"],\n borderColor: [\"#A44EBC\", \"#4CB580\"],\n borderWidth: 1,\n },\n ],\n };\n const options = {\n plugins: {\n legend: {\n display: false,\n },\n },\n };\n\n return (\n
\n
\n
Assessment
\n
\n \n {Questions?.length\n ? `${(\n (Questions?.filter((res) => res?.a).length /\n Questions?.length) *\n 100\n ).toFixed(0)}%`\n : \"0%\"}\n
\n \n \n
\n
\n \n
\n
\n
\n
\n \n
Answered
\n
\n
{Data[1]}
\n
\n
\n
\n \n
Not Answered
\n
\n
{Data[0]}
\n
\n
\n
\n \n );\n};\n\nexport default React.memo(Assessment);\n","import { LoadingOutlined } from \"@ant-design/icons\";\nimport { getCandidateEngagement } from \"action/OpeningsAction\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst Engagement = ({ id, ContactID, navigateKey }) => {\n const { CandidateEngagementLoading, CandidateEngagement } = useSelector(\n (state) => state.OpeningReducer\n );\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch(getCandidateEngagement(id));\n }, [navigateKey, ContactID]);\n return (\n
\n {\" \"}\n
\n
Engagement
\n
\n \n {CandidateEngagementLoading ? (\n \n ) : (\n CandidateEngagement?.avg + \"%\"\n )}\n
\n {/* \n More active on {CandidateEngagement}\n */}\n \n \n
\n
\n \n \n Whatsapp\n \n
\n {CandidateEngagementLoading ? (\n \n ) : CandidateEngagement ? (\n CandidateEngagement?.whatsappEng + \"%\"\n ) : (\n 0 + \"%\"\n )}\n
\n
\n
\n \n \n Calls\n \n
\n {\" \"}\n {CandidateEngagementLoading ? (\n \n ) : CandidateEngagement ? (\n CandidateEngagement?.call\n ) : (\n 0\n )}\n
\n
\n
\n \n \n Emails\n \n
\n {CandidateEngagementLoading ? (\n \n ) : CandidateEngagement ? (\n CandidateEngagement?.emailEng + \"%\"\n ) : (\n 0 + \"%\"\n )}\n
\n
\n
\n \n );\n};\n\nexport default Engagement;\n","import { CloseCircleOutlined, PlusCircleOutlined } from \"@ant-design/icons\";\nimport { CXButton } from \"component/Button\";\nimport { CXModal } from \"component/Modal\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState, memo } from \"react\";\nimport AddWorkflow from \"../../AddWorkflow\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getCampaigns } from \"action/CampaignAction\";\nimport { cancelSequence, getSequenceHistory } from \"action/OpeningsAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXEmpty } from \"component/Empty\";\n\nconst SequenceHistory = ({ id, openingsId, highestPermission }) => {\n console.log(\"SequenceHistory\", openingsId, id);\n const dispatch = useDispatch();\n const [checkKey, setcheckKey] = useState([]);\n const { CampaignsList, loading } = useSelector(\n (state) => state.CampaignReducer\n );\n const { sqHistoryLoading, sqHistory, action } = useSelector(\n (state) => state.OpeningReducer\n );\n const [visible, setVisible] = useState(false);\n const [openWorkflowCheck, setopenWorkflowCheck] = useState(false);\n const [selectedRowKeys, setSelectedRowKeys] = useState([]);\n const handleVisibleChange = (newVisible) => {\n setVisible(newVisible);\n };\n const [SelectedWF, setSelectedWF] = useState(null);\n const AddCandidatetoFlow = () => {\n setopenWorkflowCheck(true);\n setVisible(false);\n };\n useEffect(() => {\n if (visible && openingsId) {\n dispatch(getCampaigns({ openingId: openingsId }));\n setSelectedRowKeys([id]);\n }\n }, [visible, openingsId]);\n useEffect(() => {\n setSelectedRowKeys([id], openingsId);\n if (id) {\n dispatch(getSequenceHistory(id, openingsId));\n }\n }, [id]);\n useEffect(() => {\n if (action === \"CANDIDATE_ADDED_TO_FLOW\") {\n setTimeout(() => {\n dispatch(getSequenceHistory(id, openingsId));\n }, 1500);\n }\n }, [action]);\n console.log(\"setSelectedRowKeys\", selectedRowKeys);\n return (\n
\n
\n Sequence History\n {highestPermission !== \"Read\" && (\n \n
\n setSelectedWF(value)}\n >\n {CampaignsList?.data?.map((res) => {\n if (res?.status === \"published\") {\n return (\n {res?.name}\n );\n }\n })}\n \n
\n
\n AddCandidatetoFlow()}\n >\n ADD\n \n
\n
\n }\n trigger=\"click\"\n placement=\"bottom\"\n >\n \n \n )}\n \n
\n {sqHistoryLoading && (\n \n )}\n {!sqHistoryLoading && sqHistory?.length === 0 && (\n
\n \n
\n )}\n {!sqHistoryLoading && sqHistory?.length > 0 && (\n \n {sqHistory?.map((res) => {\n return (\n \n
{res?.name}
\n
{res?.status}
\n
\n {\n if (\n [\"queued\", \"processing\", \"scheduled\"].includes(\n res?.status\n )\n ) {\n dispatch(\n cancelSequence(\n {\n target: id,\n wfPlanId: res?.id,\n },\n openingsId\n )\n );\n }\n }}\n />\n
\n \n );\n })}\n
\n )}\n \n \n res?._id === SelectedWF)?.name\n }\n from=\"candidate\"\n targetType=\"c\"\n />\n \n \n );\n};\n\nexport default SequenceHistory;\n","import {\n RecordActivityAction,\n addCandidateActivityCustom,\n getCandidateActivity,\n getCandidateActivityCustom,\n getCandidateStageTrigger,\n} from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput } from \"component/Input\";\nimport { CXPopover } from \"component/Popover\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { LoadingOutlined } from \"@ant-design/icons\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXRadio, CXRadioGroup } from \"component/Radio\";\nimport DatePicker from \"react-datepicker\";\nimport \"react-datepicker/dist/react-datepicker.css\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport moment from \"moment\";\nimport InfiniteScroll from \"react-infinite-scroller\";\n\nconst CandidateViewActivityLogTab = ({\n navigateKey,\n DataP,\n ActiveStage,\n ContactID,\n}) => {\n const dispatch = useDispatch();\n const {\n CandidateActivity,\n CandidateActivityCustom,\n CandidateActivityCustomLoading,\n CandidateActivityLoading,\n candidateFilterStage,\n } = useSelector((state) => state.OpeningReducer);\n const { agents } = useSelector((state) => state.AgentReducer);\n const [open, setOpen] = useState(false);\n const [openRecord, setOpenRecord] = useState(false);\n const [ActivityData, setActivityData] = useState([]);\n useEffect(() => {\n dispatch(getCandidateStageTrigger());\n }, []);\n useEffect(() => {\n const activityMap = new Map(ActivityData.map((item) => [item._id, item]));\n CandidateActivity?.data.forEach((item) => {\n activityMap.set(item._id, item);\n });\n setActivityData(Array.from(activityMap.values()));\n }, [CandidateActivity]);\n useEffect(() => {\n setActivityData([]);\n dispatch(getCandidateActivity(ContactID));\n dispatch(getCandidateActivityCustom());\n dispatch(getAgentsActionTrigger());\n }, [ContactID, DataP]);\n const AddCustomActivityBtn = () => {\n const [form] = Form.useForm();\n const onFinish = (values) => {\n dispatch(addCandidateActivityCustom(values));\n setOpen(false);\n };\n useEffect(() => {\n if (open) {\n form.resetFields();\n form.setFieldsValue({\n captureUser: true,\n });\n }\n }, []);\n return (\n
\n \n \n \n \n \n
\n
Capture who triggered this activity
{\" \"}\n \n
\n
\n
\n \n Add\n \n setOpen(false)}>\n Cancel\n \n
\n
\n
\n );\n };\n const RecordActivity = ({ data }) => {\n const [radioSelect, setradioSelect] = useState(null);\n const [startDate, setStartDate] = useState(new Date());\n const Recordhandler = () => {\n console.log(radioSelect, startDate);\n dispatch(\n RecordActivityAction({\n name: data?.name,\n contactId: ContactID,\n createdAt: radioSelect === \"now\" ? new Date() : startDate,\n })\n );\n setOpenRecord(false);\n };\n return (\n
\n
\n Recording CUSTOM_EVENT. Please select time (if applicable)\n
\n
\n setradioSelect(e.target.value)}\n >\n Record activity now\n Select Time\n \n
\n {radioSelect === \"time\" && (\n
\n setStartDate(date)}\n timeCaption=\"Time\"\n timeFormat=\"HH:mm\"\n timeIntervals={5}\n dateFormat=\"MMMM d, yyyy h:mm aa\"\n />\n
\n )}\n
\n
\n
\n Recordhandler()}>\n Add\n \n setOpenRecord(false)}>\n Cancel\n \n
\n
\n );\n };\n\n const ActivityRendrer = (data) => {\n if (!data?.info?.isCustom) {\n // add switch case data.name\n switch (data?.meta?.event) {\n case \"MESSAGE_RECEIVED\":\n return (\n
\n
\n {\" \"}\n \n New{\" \"}\n \n {data?.info?.data?.md?.split(\".\").pop().toUpperCase()}\n {\" \"}\n message received from{\" \"}\n \n {DataP?.profile?.data?.name}\n \n
\n
\n {moment(data?.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"MESSAGE_SENT\":\n return (\n
\n
\n \n
\n Sent{\" \"}\n \n {\" \"}\n {data?.info?.data?.md?.split(\".\").pop().toUpperCase()}\n {\" \"}\n to\n \n {DataP?.profile?.data?.name}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"SEQ_MSG_SENT\":\n return (\n
\n
\n {\" \"}\n \n
\n \n {data?.info?.data?.md}\n \n message sent to\n \n {DataP?.profile?.data?.name}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"SEQUENCE_ADDED\":\n return (\n
\n
\n \n
\n \n {DataP?.profile?.data?.name}\n \n added to sequences{\" \"}\n \n {data?.info?.data?.sequenceName}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"CANDIDATE_STAGE_CHANGED\":\n return (\n
\n
\n {\" \"}\n \n
\n \n {data?.info?.actorId === \"bot\" && \"June AI\"}\n {data?.info?.actorId !== \"bot\" &&\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.fname +\n \" \" +\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.lname}\n {\" \"}\n moved\n \n {DataP?.profile?.data?.name}\n \n to stage{\" \"}\n \n {data?.info?.data?.stageName ??\n candidateFilterStage?.data?.find(\n (d) => d._id === data?.data?.stageId\n )?.name}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"CANDIDATE_SUBMITTED\":\n return (\n
\n
\n \n
\n \n {data?.info?.actorId === \"bot\" && \"June AI\"}\n {data?.info?.actorId !== \"bot\" &&\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.fname +\n \" \" +\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.lname}\n {\" \"}\n Submitted\n \n {DataP?.profile?.data?.name}\n \n to\n \n {\" \"}\n {data?.data?.sendTo}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"CANDIDATE_UPDATED\":\n return (\n
\n
\n {\" \"}\n \n
\n \n {data?.info?.actorId === \"bot\" && \"June AI\"}\n {data?.info?.actorId !== \"bot\" &&\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.fname +\n \" \" +\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.lname}\n {\" \"}\n Updated\n \n {DataP?.profile?.data?.name}\n `s\n \n Record\n \n {data?.info?.data?.uVal[0]?.field?.split(\".\").pop()}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n case \"CANDIDATE_VIEWED\":\n return (\n
\n
\n {\" \"}\n \n
\n \n {data?.info?.actorId === \"bot\" && \"June AI\"}\n {data?.info?.actorId !== \"bot\" &&\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.fname +\n \" \" +\n agents?.data?.find((d) => d._id === data?.info?.actorId)\n ?.lname}\n {\" \"}\n Viewed\n \n {DataP?.profile?.data?.name}\n `s\n \n Profile\n \n {data?.info?.data?.uVal?.[0]?.field?.split(\".\").pop()}\n \n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n default:\n break;\n }\n } else if (data?.info?.isCustom) {\n return (\n
\n
\n {\" \"}\n \n
\n CUSTOM ACTIVITY{\" \"}\n {data?.event} occurred\n at\n {\"time\"}\n
\n
\n
\n {moment(data.createdAt).format(\"DD MMM YYYY HH:mm\")}\n
\n
\n );\n }\n };\n\n const observer = useRef();\n const lastElementRef = useCallback(\n (node) => {\n if (CandidateActivityLoading) return;\n if (observer.current) observer.current.disconnect();\n observer.current = new IntersectionObserver((entries) => {\n if (\n entries[0].isIntersecting &&\n CandidateActivity?.paging?.after?.length > 0\n ) {\n handleInfiniteOnLoad();\n }\n });\n if (node) observer.current.observe(node);\n },\n [CandidateActivityLoading, CandidateActivity]\n );\n const handleInfiniteOnLoad = () => {\n if (\n !CandidateActivityLoading &&\n CandidateActivity.paging?.after?.length > 0\n ) {\n dispatch(\n getCandidateActivity(ContactID, CandidateActivity?.paging?.after)\n );\n }\n };\n\n console.log(CandidateActivityLoading, \"CandidateActivityLoading\");\n\n return (\n
\n
\n
Activity Log
\n
\n
{CandidateActivityCustomLoading && }
\n {!CandidateActivityCustomLoading &&\n CandidateActivityCustom?.map((res) => {\n return (\n }\n onOpenChange={(e) => {\n setOpenRecord(res._id);\n setOpen(false);\n }}\n >\n {res?.name}\n \n );\n })}\n {!CandidateActivityCustomLoading &&\n CandidateActivityCustom?.length < 3 && (\n }\n onOpenChange={(e) => {\n setOpen(true);\n setOpenRecord(false);\n }}\n >\n \n Create custom activity\n \n \n )}\n
\n
\n
\n handleInfiniteOnLoad()}\n hasMore={\n !CandidateActivityLoading &&\n CandidateActivity?.paging?.after?.length > 0\n }\n useWindow={false}\n >\n {ActivityData?.map((res) => {\n return (\n \n {ActivityRendrer(res)}\n
\n );\n })}\n \n {CandidateActivityLoading && (\n \n )}\n \n \n );\n};\n\nexport default CandidateViewActivityLogTab;\n","import { getOpeningByCandidateId } from \"action/OpeningsAction\";\nimport { CXLottie } from \"component/Lottie\";\nimport { get, post } from \"helper/networkClient\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport ChatOnly from \"screen/UserPortal/Communication/Common/ChatOnlyInbox\";\n\nconst CandidateViewMessageTab = ({ navigateKey }) => {\n const dispatch = useDispatch();\n const { siderData } = useSelector((state) => state.OpeningReducer);\n const appConfig = useSelector((state) => state.AppReducer);\n const [Loading, setLoading] = useState(true);\n const data = siderData?.record;\n const { cid } = useParams();\n\n const AddConversation = (id) => {\n let candidateID = data?._id ?? cid;\n try {\n post(`/conversation`, {\n contactId: id,\n }).then((resp) => {\n if (resp?.status === 200) {\n try {\n get(`/conversation?contactId=${candidateID}`).then((resp) => {\n if (resp?.status === 200) {\n if (resp?.data?.data?.length > 0) {\n let temp = resp?.data?.data[0];\n dispatch({\n type: \"SET_ACTIVE_CONVID\",\n data: temp,\n });\n } else {\n AddConversation(candidateID);\n }\n }\n });\n } catch (error) {\n console.log(error);\n }\n dispatch({ type: \"REPLY_THREAD_ACTIVE\", data: false });\n dispatch({ type: \"REPLY_ID\", data: \"\" });\n }\n });\n } catch (error) {\n console.log(error);\n }\n };\n useEffect(() => {\n let candidateID = data?._id ?? cid;\n dispatch(getOpeningByCandidateId(candidateID));\n setLoading(true);\n dispatch({ type: \"CHECKED_LIST\", data: [] });\n if (data?.conv) {\n dispatch({\n type: \"SET_ACTIVE_CONVID\",\n data: data,\n });\n } else {\n if (candidateID) {\n try {\n get(`/conversation?contactId=${candidateID}`).then((resp) => {\n if (resp?.status === 200) {\n if (resp?.data?.data?.length > 0) {\n let temp = resp?.data?.data[0];\n dispatch({\n type: \"SET_ACTIVE_CONVID\",\n data: temp,\n });\n } else {\n AddConversation(candidateID);\n }\n }\n });\n } catch (error) {\n console.log(error);\n }\n dispatch({ type: \"REPLY_THREAD_ACTIVE\", data: false });\n dispatch({ type: \"REPLY_ID\", data: \"\" });\n }\n }\n }, [data, navigateKey]);\n\n useEffect(() => {\n if (appConfig?.activeConvId?.conv) {\n setTimeout(() => {\n setLoading(false);\n }, 500);\n }\n }, [appConfig.activeConvId]);\n return (\n
\n {!Loading && (\n \n )}\n {Loading && }\n
\n );\n};\n\nexport default CandidateViewMessageTab;\n","import { CXForm, CXFormItem } from \"component/Form\";\nimport { CXInput, CXTextArea } from \"component/Input\";\nimport { ACTIVE_LIST_CONTACT } from \"constant\";\nimport React, {\n Fragment,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { useParams } from \"react-router-dom\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { ContactSkeleton } from \"component/Skeleton\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport PhoneInput from \"react-phone-number-input/input\";\nimport \"react-phone-number-input/style.css\";\nimport { CXModal } from \"component/Modal\";\nimport CreateCustomFields from \"../../Admin/CandidateForm/CreateCustomFields\";\nimport {\n updateCandidateDetails,\n updateCandidateDetailsViaInbox,\n} from \"action/OpeningsAction\";\nimport { debounce } from \"lodash\";\nimport { LoadingOutlined } from \"@ant-design/icons\";\n\nconst CreateContact = ({\n navigateKey,\n dataP,\n from,\n ActiveOPID,\n ContactID,\n ActiveStage,\n highestPermission,\n}) => {\n console.log(\"ContactID===>\", ContactID, dataP);\n const lastValues = useRef({});\n const { contactForm, loading } = useSelector((state) => state.ContactReducer);\n const { CandidateRecordUpdating } = useSelector(\n (state) => state.OpeningReducer\n );\n const [visible, setVisible] = useState(false);\n const [form] = Form.useForm();\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch({ type: ACTIVE_LIST_CONTACT, data: \"list\" });\n if (!contactForm?._id) {\n dispatch(getContactForm());\n }\n }, [dispatch, contactForm]);\n const removeEmptyObjectKeys = (obj) => {\n for (let key in obj) {\n if (typeof obj[key] === \"object\" && obj[key] !== null) {\n if (Object.keys(obj[key])?.length === 0) {\n delete obj[key];\n } else {\n removeEmptyObjectKeys(obj[key]);\n }\n }\n }\n };\n const onFinish = (values) => {\n let obj = {\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n },\n data: {},\n };\n\n if (values?.phone) {\n obj.data.phone = values?.phone;\n }\n\n for (const key in values.undefined) {\n let temp = contactForm?.formItems?.find((res) => res.key === key);\n switch (temp?.category) {\n case \"cd\":\n if (\n key !== \"currentLocation\" &&\n key !== \"company\" &&\n key !== \"orgName\" &&\n key !== \"designation\"\n ) {\n obj.candidate[key] = values?.undefined[key];\n } else {\n if (values?.undefined[\"currentLocation\"]) {\n obj.candidate[\"currLoc\"] = {\n name: values?.undefined[\"currentLocation\"],\n };\n }\n if (\n values?.undefined[\"designation\"] ||\n values?.undefined[\"orgName\"]\n )\n obj.candidate[\"employment\"] = [\n {\n designation: values?.undefined[\"designation\"],\n orgName: values?.undefined[\"orgName\"],\n },\n ];\n }\n break;\n case \"custom\":\n if (!obj.candidate.custom) {\n obj.candidate.custom = {};\n }\n obj.candidate.custom[key] = values?.undefined[key];\n break;\n default:\n if (\n key !== \"currentLocation\" &&\n key !== \"company\" &&\n key !== \"orgName\"\n )\n obj.data[key] = values?.undefined[key];\n }\n }\n\n removeEmptyObjectKeys(obj);\n\n if (!obj.data) {\n obj.data = {};\n }\n\n if (from !== \"inbox\") {\n if (ContactID && obj) {\n dispatch(updateCandidateDetails(ContactID, obj, \"disable\"));\n }\n } else {\n if (ContactID && obj) {\n dispatch(\n updateCandidateDetailsViaInbox(ContactID, obj, ActiveOPID, \"disable\")\n );\n }\n }\n };\n\n useEffect(() => {\n form.resetFields();\n if (dataP) {\n let data = dataP;\n form.setFieldsValue({\n ...data,\n ...data?.profile?.data,\n ...data?.custom,\n currentLocation: data?.currLoc?.name,\n orgName:\n data?.employment?.length > 0 ? data?.employment[0].orgName : \"\",\n designation:\n data?.employment?.length > 0 ? data?.employment[0]?.designation : \"\",\n phone: data?.profile?.data?.phone,\n undefined: {\n ...data,\n ...data?.profile?.data,\n ...data?.custom,\n currentLocation: data?.currLoc?.name,\n orgName:\n data?.employment?.length > 0 ? data?.employment[0].orgName : \"\",\n designation:\n data?.employment?.length > 0\n ? data?.employment[0]?.designation\n : \"\",\n },\n });\n }\n }, [navigateKey, dataP, form]);\n\n const UpdateTrigger = (value, key) => {\n if (value?.length >= 1 && key?.length >= 1) {\n let values = {\n undefined: {\n [key]: value,\n },\n };\n onFinish(values);\n }\n };\n\n // const debouncedUpdateTrigger = useCallback(\n // debounce((value, key) => {\n // if (lastValues.current[key] !== value) {\n // UpdateTrigger(value, key);\n // lastValues.current[key] = value;\n // }\n // }, 1000),\n // []\n // );\n\n const renderFormItem = ({\n key,\n lebel,\n placeholder,\n required,\n type,\n elementOptions,\n multiselect,\n ...restField\n }) => {\n if (\n ![\"name\", \"email\", \"phone\", \"company\", \"rId\"].includes(key) &&\n restField?.isActive\n ) {\n const commonProps = {\n style: { marginBottom: 0 },\n ...restField,\n label: lebel,\n name: [key],\n rules: [{ required: required, message: \"Required\" }],\n };\n\n const commonInputProps = {\n disabled: CandidateRecordUpdating || highestPermission === \"Read\",\n placeholder: placeholder,\n className: \"inputStyle-Q\",\n style: { border: \"none\" },\n // onChange: (e) => debouncedUpdateTrigger(e.target.value, key),\n onBlur: (e) => UpdateTrigger(e.target.value, key),\n };\n\n switch (type) {\n case \"text\":\n case \"email\":\n return (\n \n \n \n \n \n );\n case \"phone\":\n return (\n \n \n \n \n \n );\n case \"select\":\n return (\n \n \n UpdateTrigger(value, key)}\n >\n {elementOptions?.map((res) => (\n \n {res}\n \n ))}\n \n \n \n );\n case \"notes\":\n case \"textArea\":\n return (\n \n \n \n \n \n );\n case \"date\":\n return (\n \n \n \n \n \n );\n default:\n return null;\n }\n }\n return null;\n };\n\n return (\n \n
\n
\n
\n Candidate detail:\n {CandidateRecordUpdating && (\n \n updating record please wait... \n \n )}\n
\n
\n {loading && }\n {!loading && contactForm?.formItems?.length > 0 && (\n
\n
\n \n {contactForm?.formItems?.map(renderFormItem)}\n \n
\n
\n )}\n
\n Add custom field}\n visible={visible}\n closable={false}\n footer={null}\n >\n \n \n
\n );\n};\n\nexport default CreateContact;\n","import {\n updateCandidateDetails,\n getOpeningByIdTrigger,\n} from \"action/OpeningsAction\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CXInput } from \"component/Input\";\nimport React, { useState, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\n\nconst CandidateViewAssessTab = ({\n DataP,\n from,\n activeOPID,\n ContactID,\n ActiveStage,\n highestPermission,\n}) => {\n const dispatch = useDispatch();\n const [Questions, setQuestions] = useState([]);\n const { openingsId } = useParams();\n const { openPositions, openingLoading } = useSelector(\n (state) => state.OpeningReducer\n );\n const updateAnswer = (index, value) => {\n const temp = [...Questions];\n temp[index].a = value;\n setQuestions(temp);\n updateCandidateData({\n data: {},\n candidate: {\n opening: {\n openingId: activeOPID,\n },\n qualifierQ: temp,\n },\n });\n };\n\n useEffect(() => {\n if (\n openPositions?.data?.length > 0 &&\n openPositions?.data?.find((res) => res._id === activeOPID)\n ) {\n setQuestions([]);\n let q = openPositions?.data?.find(\n (res) => res._id === activeOPID\n )?.qualifiers;\n let u = DataP?.qualifierQ;\n q = q?.map((res) => {\n return {\n _id: res?._id,\n q: res?.q,\n a: u?.find((d) => d?.q === res?.q)?.a ?? \"\",\n };\n });\n setQuestions(q);\n }\n }, [DataP, openPositions]);\n\n useEffect(() => {\n dispatch(getOpeningByIdTrigger(openingsId ?? activeOPID));\n }, []);\n\n const updateCandidateData = (data) => {\n if (data) {\n dispatch(updateCandidateDetails(ContactID, data, \"disable\"));\n }\n };\n return (\n
\n
\n
Assessment Questions :
\n
\n
\n {openingLoading &&
Loading...
}\n {!openingLoading && (\n
\n {(!Questions || Questions?.length === 0) && }\n {Questions?.map((item, index) => {\n return (\n e.preventDefault()}\n >\n \n
\n
{item.q}
\n
\n
\n updateAnswer(index, e.target.value)}\n defaultValue={item.a}\n />\n
\n
\n
\n );\n })}\n \n )}\n \n \n );\n};\n\nexport default CandidateViewAssessTab;\n","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport React, { Children, forwardRef, useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { Col } from '../grid';\nimport { cloneElement } from '../_util/reactNode';\nimport { ListContext } from './index';\nexport var Meta = function Meta(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n avatar = _a.avatar,\n title = _a.title,\n description = _a.description,\n others = __rest(_a, [\"prefixCls\", \"className\", \"avatar\", \"title\", \"description\"]);\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls;\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var classString = classNames(\"\".concat(prefixCls, \"-item-meta\"), className);\n var content = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-content\")\n }, title && /*#__PURE__*/React.createElement(\"h4\", {\n className: \"\".concat(prefixCls, \"-item-meta-title\")\n }, title), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-description\")\n }, description));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classString\n }), avatar && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-avatar\")\n }, avatar), (title || description) && content);\n};\nvar InternalItem = function InternalItem(_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n children = _a.children,\n actions = _a.actions,\n extra = _a.extra,\n className = _a.className,\n colStyle = _a.colStyle,\n others = __rest(_a, [\"prefixCls\", \"children\", \"actions\", \"extra\", \"className\", \"colStyle\"]);\n var _useContext2 = useContext(ListContext),\n grid = _useContext2.grid,\n itemLayout = _useContext2.itemLayout;\n var _useContext3 = useContext(ConfigContext),\n getPrefixCls = _useContext3.getPrefixCls;\n var isItemContainsTextNodeAndNotSingular = function isItemContainsTextNodeAndNotSingular() {\n var result;\n Children.forEach(children, function (element) {\n if (typeof element === 'string') {\n result = true;\n }\n });\n return result && Children.count(children) > 1;\n };\n var isFlexMode = function isFlexMode() {\n if (itemLayout === 'vertical') {\n return !!extra;\n }\n return !isItemContainsTextNodeAndNotSingular();\n };\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var actionsContent = actions && actions.length > 0 && ( /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-item-action\"),\n key: \"actions\"\n }, actions.map(function (action, i) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n key: \"\".concat(prefixCls, \"-item-action-\").concat(i)\n }, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement(\"em\", {\n className: \"\".concat(prefixCls, \"-item-action-split\")\n }))\n );\n })));\n var Element = grid ? 'div' : 'li';\n var itemChildren = /*#__PURE__*/React.createElement(Element, _extends({}, others, !grid ? {\n ref: ref\n } : {}, {\n className: classNames(\"\".concat(prefixCls, \"-item\"), _defineProperty({}, \"\".concat(prefixCls, \"-item-no-flex\"), !isFlexMode()), className)\n }), itemLayout === 'vertical' && extra ? [/*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-main\"),\n key: \"content\"\n }, children, actionsContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-extra\"),\n key: \"extra\"\n }, extra)] : [children, actionsContent, cloneElement(extra, {\n key: 'extra'\n })]);\n return grid ? ( /*#__PURE__*/React.createElement(Col, {\n ref: ref,\n flex: 1,\n style: colStyle\n }, itemChildren)) : itemChildren;\n};\nvar Item = /*#__PURE__*/forwardRef(InternalItem);\nItem.Meta = Meta;\nexport default Item;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport defaultRenderEmpty from '../config-provider/defaultRenderEmpty';\nimport { Row } from '../grid';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport Pagination from '../pagination';\nimport Spin from '../spin';\nimport { responsiveArray } from '../_util/responsiveObserve';\nimport Item from './Item';\nexport var ListContext = /*#__PURE__*/React.createContext({});\nexport var ListConsumer = ListContext.Consumer;\nfunction List(_a) {\n var _a$pagination = _a.pagination,\n pagination = _a$pagination === void 0 ? false : _a$pagination,\n customizePrefixCls = _a.prefixCls,\n _a$bordered = _a.bordered,\n bordered = _a$bordered === void 0 ? false : _a$bordered,\n _a$split = _a.split,\n split = _a$split === void 0 ? true : _a$split,\n className = _a.className,\n children = _a.children,\n itemLayout = _a.itemLayout,\n loadMore = _a.loadMore,\n grid = _a.grid,\n _a$dataSource = _a.dataSource,\n dataSource = _a$dataSource === void 0 ? [] : _a$dataSource,\n size = _a.size,\n header = _a.header,\n footer = _a.footer,\n _a$loading = _a.loading,\n loading = _a$loading === void 0 ? false : _a$loading,\n rowKey = _a.rowKey,\n renderItem = _a.renderItem,\n locale = _a.locale,\n rest = __rest(_a, [\"pagination\", \"prefixCls\", \"bordered\", \"split\", \"className\", \"children\", \"itemLayout\", \"loadMore\", \"grid\", \"dataSource\", \"size\", \"header\", \"footer\", \"loading\", \"rowKey\", \"renderItem\", \"locale\"]);\n var paginationObj = pagination && _typeof(pagination) === 'object' ? pagination : {};\n var _React$useState = React.useState(paginationObj.defaultCurrent || 1),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n paginationCurrent = _React$useState2[0],\n setPaginationCurrent = _React$useState2[1];\n var _React$useState3 = React.useState(paginationObj.defaultPageSize || 10),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n paginationSize = _React$useState4[0],\n setPaginationSize = _React$useState4[1];\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction;\n var defaultPaginationProps = {\n current: 1,\n total: 0\n };\n var triggerPaginationEvent = function triggerPaginationEvent(eventName) {\n return function (page, pageSize) {\n setPaginationCurrent(page);\n setPaginationSize(pageSize);\n if (pagination && pagination[eventName]) {\n pagination[eventName](page, pageSize);\n }\n };\n };\n var onPaginationChange = triggerPaginationEvent('onChange');\n var onPaginationShowSizeChange = triggerPaginationEvent('onShowSizeChange');\n var renderInnerItem = function renderInnerItem(item, index) {\n if (!renderItem) return null;\n var key;\n if (typeof rowKey === 'function') {\n key = rowKey(item);\n } else if (rowKey) {\n key = item[rowKey];\n } else {\n key = item.key;\n }\n if (!key) {\n key = \"list-item-\".concat(index);\n }\n return /*#__PURE__*/React.createElement(React.Fragment, {\n key: key\n }, renderItem(item, index));\n };\n var isSomethingAfterLastItem = function isSomethingAfterLastItem() {\n return !!(loadMore || pagination || footer);\n };\n var renderEmptyFunc = function renderEmptyFunc(prefixCls, renderEmptyHandler) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-empty-text\")\n }, locale && locale.emptyText || renderEmptyHandler('List'));\n };\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var loadingProp = loading;\n if (typeof loadingProp === 'boolean') {\n loadingProp = {\n spinning: loadingProp\n };\n }\n var isLoading = loadingProp && loadingProp.spinning;\n // large => lg\n // small => sm\n var sizeCls = '';\n switch (size) {\n case 'large':\n sizeCls = 'lg';\n break;\n case 'small':\n sizeCls = 'sm';\n break;\n default:\n break;\n }\n var classString = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-vertical\"), itemLayout === 'vertical'), \"\".concat(prefixCls, \"-\").concat(sizeCls), sizeCls), \"\".concat(prefixCls, \"-split\"), split), \"\".concat(prefixCls, \"-bordered\"), bordered), \"\".concat(prefixCls, \"-loading\"), isLoading), \"\".concat(prefixCls, \"-grid\"), !!grid), \"\".concat(prefixCls, \"-something-after-last-item\"), isSomethingAfterLastItem()), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n var paginationProps = _extends(_extends(_extends({}, defaultPaginationProps), {\n total: dataSource.length,\n current: paginationCurrent,\n pageSize: paginationSize\n }), pagination || {});\n var largestPage = Math.ceil(paginationProps.total / paginationProps.pageSize);\n if (paginationProps.current > largestPage) {\n paginationProps.current = largestPage;\n }\n var paginationContent = pagination ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-pagination\")\n }, /*#__PURE__*/React.createElement(Pagination, _extends({}, paginationProps, {\n onChange: onPaginationChange,\n onShowSizeChange: onPaginationShowSizeChange\n })))) : null;\n var splitDataSource = _toConsumableArray(dataSource);\n if (pagination) {\n if (dataSource.length > (paginationProps.current - 1) * paginationProps.pageSize) {\n splitDataSource = _toConsumableArray(dataSource).splice((paginationProps.current - 1) * paginationProps.pageSize, paginationProps.pageSize);\n }\n }\n var needResponsive = Object.keys(grid || {}).some(function (key) {\n return ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key);\n });\n var screens = useBreakpoint(needResponsive);\n var currentBreakpoint = React.useMemo(function () {\n for (var i = 0; i < responsiveArray.length; i += 1) {\n var breakpoint = responsiveArray[i];\n if (screens[breakpoint]) {\n return breakpoint;\n }\n }\n return undefined;\n }, [screens]);\n var colStyle = React.useMemo(function () {\n if (!grid) {\n return undefined;\n }\n var columnCount = currentBreakpoint && grid[currentBreakpoint] ? grid[currentBreakpoint] : grid.column;\n if (columnCount) {\n return {\n width: \"\".concat(100 / columnCount, \"%\"),\n maxWidth: \"\".concat(100 / columnCount, \"%\")\n };\n }\n }, [grid === null || grid === void 0 ? void 0 : grid.column, currentBreakpoint]);\n var childrenContent = isLoading && /*#__PURE__*/React.createElement(\"div\", {\n style: {\n minHeight: 53\n }\n });\n if (splitDataSource.length > 0) {\n var items = splitDataSource.map(function (item, index) {\n return renderInnerItem(item, index);\n });\n childrenContent = grid ? ( /*#__PURE__*/React.createElement(Row, {\n gutter: grid.gutter\n }, React.Children.map(items, function (child) {\n return /*#__PURE__*/React.createElement(\"div\", {\n key: child === null || child === void 0 ? void 0 : child.key,\n style: colStyle\n }, child);\n }))) : ( /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-items\")\n }, items));\n } else if (!children && !isLoading) {\n childrenContent = renderEmptyFunc(prefixCls, renderEmpty || defaultRenderEmpty);\n }\n var paginationPosition = paginationProps.position || 'bottom';\n var contextValue = React.useMemo(function () {\n return {\n grid: grid,\n itemLayout: itemLayout\n };\n }, [JSON.stringify(grid), itemLayout]);\n return /*#__PURE__*/React.createElement(ListContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString\n }, rest), (paginationPosition === 'top' || paginationPosition === 'both') && paginationContent, header && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-header\")\n }, header), /*#__PURE__*/React.createElement(Spin, _extends({}, loadingProp), childrenContent, children), footer && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, footer), loadMore || (paginationPosition === 'bottom' || paginationPosition === 'both') && paginationContent));\n}\nList.Item = Item;\nexport default List;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar Comment = function Comment(_a) {\n var actions = _a.actions,\n author = _a.author,\n avatar = _a.avatar,\n children = _a.children,\n className = _a.className,\n content = _a.content,\n customizePrefixCls = _a.prefixCls,\n datetime = _a.datetime,\n otherProps = __rest(_a, [\"actions\", \"author\", \"avatar\", \"children\", \"className\", \"content\", \"prefixCls\", \"datetime\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var renderNested = function renderNested(prefixCls, nestedChildren) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-nested\"))\n }, nestedChildren);\n };\n var prefixCls = getPrefixCls('comment', customizePrefixCls);\n var avatarDom = avatar ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-avatar\")\n }, typeof avatar === 'string' ? /*#__PURE__*/React.createElement(\"img\", {\n src: avatar,\n alt: \"comment-avatar\"\n }) : avatar)) : null;\n var actionDom = actions && actions.length ? ( /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, actions.map(function (action, index) {\n return /*#__PURE__*/React.createElement(\"li\", {\n key: \"action-\".concat(index)\n }, action) // eslint-disable-line react/no-array-index-key\n ;\n }))) : null;\n var authorContent = (author || datetime) && ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-author\")\n }, author && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-name\")\n }, author), datetime && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-author-time\")\n }, datetime)));\n var contentDom = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, authorContent, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-detail\")\n }, content), actionDom);\n var cls = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, otherProps, {\n className: cls\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }, avatarDom, contentDom), children ? renderNested(prefixCls, children) : null);\n};\nexport default Comment;","import { LoadingOutlined } from \"@ant-design/icons\";\nimport { Comment, List } from \"antd\";\nimport { CXAvatar } from \"component/Avatar\";\nimport { CXMarkdownCommentEditor } from \"component/MarkdownEditor\";\nimport SendButton from \"component/MarkdownEditor/SendButton\";\nimport moment from \"moment\";\nimport React, { useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport { useSelector } from \"react-redux\";\n\nconst CommentList = ({ comments = [] }) => (\n {\n return (\n Reply]}\n author={\n \n {comment.author}\n \n }\n content={\n \n {comment.content}\n \n }\n children={\n comment.children ? (\n \n ) : null\n }\n datetime={\n \n {moment(comment?.datetime).fromNow()}\n \n }\n avatar={\n comment?.avatar ? (\n \n ) : (\n \n {comment?.author.slice(0, 1)}\n \n )\n }\n />\n );\n }}\n />\n);\n\nconst Index = ({\n comments,\n submit,\n CommentLoading,\n CommentAdding,\n highestPermission,\n}) => {\n const [submitting, setSubmitting] = useState(false);\n const { agents } = useSelector((state) => state.AgentReducer);\n\n const handleSubmit = (value) => {\n if (!value) return;\n setSubmitting(true);\n submit(value);\n setTimeout(() => {\n setSubmitting(false);\n }, 1000);\n };\n return (\n
\n <>\n {comments?.length > 0 && !CommentLoading && (\n \n )}\n {CommentAdding && (\n
\n Adding Comment... \n
\n )}\n {agents?.data?.length > 0 &&\n !CommentLoading &&\n highestPermission !== \"Read\" && (\n \n {\n return {\n id: `@${res?.fname + \" \" + res?.lname}`,\n uid: res?._id,\n };\n })}\n onSubmit={handleSubmit}\n onModelChange={(data) => console.log(data)}\n placeholder=\"comment here\"\n onBlur={(event, editor) => {}}\n />\n
\n \n \n
\n
\n \n }\n />\n )}\n \n \n );\n};\n\nexport default Index;\n","import { CXCol } from \"component/Col\";\nimport { CXTextArea } from \"component/Input\";\nimport { CXRow } from \"component/Row\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport CreateContact from \"./CreateContact\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport {\n createCommentAction,\n getCommentsAction,\n updateCandidateDetails,\n updateCandidateDetailsViaInbox,\n} from \"action/OpeningsAction\";\nimport CandidateViewAssessTab from \"./CandidateViewAssessTab\";\nimport Comments from \"component/Comments\";\nimport { extractMentionUid } from \"utils\";\nimport { CXInputSkeleton } from \"component/Skeleton\";\nimport { CXCollapse, CXCollapsePanel } from \"component/Collapse\";\nimport { CXButton } from \"component/Button\";\nimport { notification } from \"antd\";\nimport axios from \"axios\";\nimport { publicAuthUrl } from \"config/config\";\nimport { CXLottie } from \"component/Lottie\";\n\nconst CandidateViewProcessTab = ({\n opActiveTab,\n navigateKey,\n DataP,\n from,\n ActiveOPID,\n ActiveStage,\n ContactID,\n highestPermission,\n}) => {\n const dispatch = useDispatch();\n const [SynopsisLoading, setSynopsisLoading] = useState(false);\n const [Notes, setNotes] = useState();\n const prevNotesRef = useRef();\n const [commentsList, setcommentsList] = useState([]);\n const {\n CommentData,\n CommentLoading,\n CommentAdding,\n CandidateRecordUpdating,\n } = useSelector((state) => state.OpeningReducer);\n const { agents } = useSelector((state) => state.AgentReducer);\n\n const updateCandidateData = (data) => {\n if (data) {\n if (from === \"inbox\") {\n dispatch(\n updateCandidateDetailsViaInbox(ContactID, data, ActiveOPID, \"disable\")\n );\n } else {\n dispatch(updateCandidateDetails(ContactID, data, \"disable\"));\n }\n }\n };\n useEffect(() => {\n prevNotesRef.current = Notes;\n }, [Notes]);\n useEffect(() => {\n if (navigateKey || from === \"inbox\") {\n let notes = DataP?.notes ?? \" \";\n setNotes(notes);\n }\n }, [navigateKey, DataP]);\n\n useEffect(() => {\n setcommentsList([]);\n if (ContactID && ActiveOPID) {\n if (from !== \"inbox\") {\n dispatch(\n getCommentsAction({\n contactId: ContactID,\n openingId: ActiveOPID,\n })\n );\n } else {\n dispatch(\n getCommentsAction({\n contactId: ContactID,\n openingId: ActiveOPID,\n })\n );\n }\n }\n }, [opActiveTab, ContactID]);\n const addComment = (data) => {\n let mentions = extractMentionUid(data);\n if (from !== \"inbox\") {\n // TODO\" as per discussion with SRIKANT candidateId should be contactId\n let obj = {\n candidateId: ContactID,\n body: data,\n openingId: ActiveOPID,\n mentions: mentions,\n threadId: null,\n };\n dispatch(createCommentAction(obj));\n }\n if (from === \"inbox\") {\n let obj = {\n candidateId: ContactID,\n body: data,\n openingId: ActiveOPID,\n mentions: mentions,\n threadId: null,\n };\n dispatch(createCommentAction(obj));\n }\n };\n useEffect(() => {\n if (CommentData?.data?.length > 0) {\n let modifiedData = CommentData?.data.map((d) => {\n let ag = agents?.data?.find((a) => a._id === d?.createdBy);\n let name = ag?.fname + \" \" + ag?.lname;\n return {\n author: name ?? \"Agent\",\n avatar: ag?.avatar ?? null,\n content: d?.body,\n datetime: d?.createdAt,\n };\n });\n setcommentsList(modifiedData);\n } else {\n setcommentsList([]);\n }\n }, [CommentData]);\n\n const generateSynopsis = async () => {\n setSynopsisLoading(true);\n let uid = ContactID;\n let resp = await axios.post(`${publicAuthUrl}/june/api/extract_synopsis`, {\n candidate_id: uid,\n });\n if (resp?.data?.message === \"success\") {\n setSynopsisLoading(false);\n notification.success({\n message: \"Synopsis generated successfully\",\n });\n updateCandidateData({\n cd: {\n synopsis: resp?.data?.data,\n },\n });\n } else {\n notification.error({\n message: \"Failed to generate synopsis\",\n });\n setSynopsisLoading(false);\n }\n };\n\n return (\n
\n
\n {CommentLoading && (\n
\n \n \n \n
\n )}\n addComment(data)}\n comments={commentsList}\n CommentLoading={CommentLoading}\n CommentAdding={CommentAdding}\n />\n
\n\n \n Synopsis}\n extra={(() => {\n let synopsis = DataP?.synopsis;\n let rid = DataP?.rId;\n let attachment = DataP?.attachment;\n return (!synopsis || synopsis?.length === 0) &&\n highestPermission !== \"Read\" &&\n (rid?.length > 0 || attachment?.length > 0) ? (\n {\n e.stopPropagation();\n generateSynopsis();\n }}\n >\n Generate\n \n ) : (\n
\n );\n })()}\n >\n {!SynopsisLoading && (\n
\n {(() => {\n return DataP?.synopsis?.length > 0 ? (\n
{DataP?.synopsis}
\n ) : (\n
No synopsis found
\n );\n })()}\n
\n )}\n {SynopsisLoading && (\n
\n {\" \"}\n
\n \n
Please wait...
\n
\n
\n )}\n \n
\n
\n \n \n \n \n \n
\n
\n
Notes:
\n setNotes(e.target.value)}\n onBlur={() => {\n if (prevNotesRef !== Notes) {\n updateCandidateData({\n data: {},\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n notes: Notes,\n },\n });\n }\n }}\n />\n
\n
\n \n
\n
\n
\n
\n
\n
\n );\n};\n\nexport default CandidateViewProcessTab;\n","import { CloudDownloadOutlined, CloudUploadOutlined } from \"@ant-design/icons\";\nimport { updateCandidateDetails } from \"action/OpeningsAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CXLottie } from \"component/Lottie\";\nimport CXUpload from \"component/Upload\";\nimport { postFormData } from \"helper/networkClient\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\n\nconst CandidateViewResumeTab = ({\n navigateKey = 0,\n DataP,\n ContactID,\n ActiveStage,\n ActiveOPID,\n highestPermission,\n}) => {\n const [Resume, setResume] = useState(null);\n const dispatch = useDispatch();\n const [Loader, setLoader] = useState(false);\n const handleUploadFile = async (file) => {\n setLoader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setResume(null);\n updateCandidateData(resp?.data?.data?.url);\n setResume(resp?.data?.data?.url);\n setLoader(false);\n } else {\n setLoader(false);\n }\n });\n } catch (error) {\n setLoader(false);\n }\n };\n const updateCandidateData = (rId) => {\n if (rId) {\n dispatch(\n updateCandidateDetails(ContactID, {\n data: {},\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n rId,\n },\n })\n );\n }\n };\n useEffect(() => {\n if (DataP?.rId) {\n setResume(DataP?.rId);\n } else if (DataP?.cd?.rId) {\n setResume(DataP?.cd?.rId);\n } else {\n setResume(null);\n }\n }, [navigateKey, DataP]);\n\n const downloadCV = () => {\n if (Resume) {\n window.open(Resume, \"_blank\");\n }\n };\n return (\n
\n {highestPermission !== \"Read\" && (\n
\n \n \n \n Upload CV\n \n \n\n downloadCV()}>\n \n Download CV\n \n
\n )}\n
\n {!Loader && Resume && (\n
\n {Resume?.split(\".\")?.pop() === \"pdf\" ? (\n \n

Unable to display PDF

\n \n ) : (\n {\n e.target.src = \"\";\n e.target.parentNode.innerHTML = \"Failed to load document.\";\n }}\n >\n )}\n
\n )}\n {!Loader && !Resume && (\n \n \n
\n )}\n {Loader && (\n
\n \n

\n Uploading your CV, please wait for a moment\n

\n
\n )}\n \n \n );\n};\n\nexport default CandidateViewResumeTab;\n","import { CXAvatar } from \"component/Avatar\";\nimport { CXButton } from \"component/Button\";\nimport { CXCard } from \"component/Card\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTabs } from \"component/Tabs\";\nimport { CXText, CXTitle } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState, useRef } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport CandidateViewProfileTab from \"./CandidateViewProfileTab\";\nimport CandidateViewMessageTab from \"./CandidateViewMessageTab\";\nimport {\n CheckOutlined,\n CopyOutlined,\n EyeOutlined,\n InfoCircleOutlined,\n LeftOutlined,\n LinkedinOutlined,\n LoadingOutlined,\n MailOutlined,\n MessageOutlined,\n RightOutlined,\n} from \"@ant-design/icons\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport CandidateViewResumeTab from \"./CandidateViewResumeTab\";\nimport {\n PatchStageIdInBulk,\n RecordActivityAction,\n getCandidateAttachments,\n markFavorite,\n updateCandidateDetails,\n updateCandidateDetailsViaInbox,\n} from \"action/OpeningsAction\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { getAgentsActionTrigger } from \"action/AgentAction\";\nimport CandidateViewActivityLogTab from \"./CandidateViewActivityLogTab\";\nimport { CXSkeletonAVT, CXSkeletonInp } from \"component/Skeleton\";\n// import Stability from \"./CandidateStats/Stability\";\nimport Engagement from \"./CandidateStats/Engagement\";\nimport Assessment from \"./CandidateStats/Assessment\";\nimport { CXBadge } from \"component/Badge\";\nimport { notification, Rate } from \"antd\";\nimport SequenceHistory from \"./CandidateStats/SequenceHistory\";\nimport { CXModal } from \"component/Modal\";\nimport StageChangeConfirm from \"component/StageChangeConfirm\";\nimport CandidateAttachmentTab from \"./CandidateAttachmentTab\";\nimport TagsSearch from \"component/TagsSearch\";\nimport CandidateInterviewScheduling from \"./CandidateInterviewScheduling\";\nimport PhoneInput, {\n parsePhoneNumber,\n getCountryCallingCode,\n} from \"react-phone-number-input\";\nimport \"react-phone-number-input/style.css\";\nimport { checkViewDate, customRequires, dfCountry, getCookie } from \"utils\";\nimport { CXLottie } from \"component/Lottie\";\nimport DuplicateCandidateAlert from \"../DuplicateCandidateAlert\";\nimport { post } from \"helper/networkClient\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXTag } from \"component/Tag\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport Compose from \"screen/UserPortal/Communication/Common/ChatOnlyInbox/ChatViaEmail/Compose\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport { StageChangeRequiredConfig } from \"../StageChangeRequiredConfig\";\nimport moment from \"moment\";\n\nconst CandidatesView = ({ from, topBar = true, as = null }) => {\n const tenantId = getCookie(\"tenant\");\n const { openingsId, cid, stage } = useParams();\n const phoneInputRef = useRef(null);\n const dispatch = useDispatch();\n const {\n openPositions,\n siderData,\n candidateFilterStage,\n updateLoading,\n Attachments,\n AttachmentLoading,\n CandidateEngagementLoading,\n MessageWidget,\n activeContactOpening,\n acoLoading,\n allCandidatesByPosition,\n } = useSelector((state) => state.OpeningReducer);\n const [StageEdit, setStageEdit] = useState(false);\n const [Active, setActive] = useState(\"Profile\");\n const [opActiveTab, setopActiveTab] = useState(1);\n const [navigateKey, setnavigateKey] = useState(null);\n const [MessageWindowActive, setMessageWindowActive] = useState(false);\n const [confirmModal, setconfirmModal] = useState(false);\n const [TempValue, setTempValue] = useState(null);\n const [ActivePhoneNumber, setActivePhoneNumber] = useState(null);\n const [ActiveOPID, setActiveOPID] = useState(\n activeContactOpening?.opening?.openingId ?? openingsId\n );\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const [activeContactTableData, setActiveContactTableData] = useState(null);\n const [ContactID, setContactID] = useState(null);\n const [duplicateData, setduplicateData] = useState(null);\n const [duplicateChecking, setduplicateChecking] = useState(false);\n const [openingListChecking, setopeningListChecking] = useState(false);\n const [openDuplicateModal, setopenDuplicateModal] = useState(false);\n const { agents } = useSelector((state) => state.AgentReducer);\n const [cr, setcr] = useState([]);\n const [canData, setcanData] = useState(null);\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const [StageVal, setStageVal] = useState();\n const { allConfigData, TrackerConfiguration } = useSelector(\n (state) => state.AdminReducer\n );\n useEffect(() => {\n dispatch(GetAllConfig());\n }, []);\n useEffect(() => {\n if (contactForm?.formItems?.length > 0) {\n let data = customRequires(contactForm);\n setcr(data);\n }\n }, [contactForm?.formItems]);\n useEffect(() => {\n let d = siderData?.TableData?.find((item) => item.key === navigateKey);\n setcanData(d?.fullData?.custom);\n }, [navigateKey, siderData]);\n useEffect(() => {\n if (siderData && siderData.TableData && navigateKey) {\n const data =\n siderData.TableData.find((d) => d.key === navigateKey) || null;\n setActiveContactTableData(data?.fullData);\n setContactID(data?._id);\n checkDuplicateContactHandler({\n email: data?.fullData?.profile?.data?.email,\n phone: data?.fullData?.profile?.data?.phone,\n });\n setStageVal(data?.fullData?.opening?.stageId);\n } else {\n if (activeContactOpening) {\n setActiveOPID(activeContactOpening?.opening?.openingId);\n setStageVal(activeContactOpening?.opening?.stageId);\n setActiveContactTableData(activeContactOpening);\n setContactID(activeContactOpening?.contactId);\n }\n }\n }, [siderData, navigateKey, activeContactOpening]);\n\n const closeSidebar = (val) => {\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: true });\n dispatch({ type: \"SET_OPENING_SIDEBAR_DATA\", data: null });\n dispatch({ type: \"SET_OPENING_TAB\", data: null });\n };\n const handleActive = (val) => {\n setActive(val);\n };\n useEffect(() => {\n if (siderData && navigateKey === null) {\n setnavigateKey(siderData?.record?.key ?? 0);\n }\n }, [siderData]);\n useEffect(() => {\n if (siderData?.record?.key !== navigateKey && from !== \"inbox\")\n dispatch({ type: \"SET_OPENING_SIDEBAR_VIEW\", data: false });\n dispatch({\n type: \"SET_OPENING_SIDEBAR_DATA\",\n data: {\n record: siderData?.TableData?.find((d) => d.key === navigateKey),\n TableData: siderData?.TableData,\n },\n });\n dispatch({ type: \"SET_OPENING_TAB\", data: \"Candidates\" });\n if (\n siderData?.TableData?.find((d) => d.key === navigateKey)?._id ||\n activeContactOpening\n ) {\n dispatch({ type: \"CANDIDATE_VIEW_TRIGGER\" });\n dispatch({\n type: \"CANDIDATE_VIEWED\",\n data: {\n candidateId:\n siderData?.TableData?.find((d) => d.key === navigateKey)?.fullData\n ?._id || activeContactOpening?._id,\n contactId:\n siderData?.TableData?.find((d) => d.key === navigateKey)?._id ||\n activeContactOpening?.contactId,\n candidateName:\n siderData?.TableData?.find((d) => d.key === navigateKey)?.name ||\n activeContactOpening?.profile?.data?.name,\n src: \"candidateWidget\",\n userId: user.userProfile?._id,\n },\n });\n }\n }, [navigateKey, activeContactOpening]);\n\n const updateCandidateData = (data) => {\n if (data) {\n if (from !== \"inbox\") {\n dispatch(updateCandidateDetails(ContactID, data));\n }\n if (from === \"inbox\") {\n dispatch(updateCandidateDetailsViaInbox(ContactID, data, ActiveOPID));\n }\n }\n };\n const markFav = (favorite) => {\n if (from !== \"inbox\") {\n dispatch(\n markFavorite(\n ContactID,\n { favorite },\n \"TABLE\",\n ActiveOPID,\n activeContactTableData?.opening?.stageId\n )\n );\n }\n if (from === \"inbox\") {\n dispatch(markFavorite(ContactID, { favorite }, \"inbox\", ActiveOPID));\n }\n };\n const updateStageID = (data, formdata) => {\n if (data) {\n dispatch(\n PatchStageIdInBulk(\n {\n contactIds: [ContactID],\n openingId: ActiveOPID,\n stageId: data.stageId,\n ...formdata,\n },\n ActiveOPID,\n activeContactTableData?.opening?.stageId\n )\n );\n let temp = allCandidatesByPosition.data.filter(\n (item) => item.contactId !== ContactID\n );\n let UpdatedData = {\n ...allCandidatesByPosition,\n data: temp,\n };\n dispatch({\n type: \"GET_ALL_CANDIDATES_BY_POSITION_RESPONSE\",\n data: UpdatedData,\n });\n }\n };\n useEffect(() => {\n dispatch(getAgentsActionTrigger());\n }, []);\n\n useEffect(() => {\n if (siderData?.TableData?.length < navigateKey && from !== \"inbox\") {\n setnavigateKey(navigateKey - 1);\n }\n }, [siderData?.TableData]);\n useEffect(() => {\n if (ContactID) {\n dispatch(getCandidateAttachments(ContactID));\n }\n }, [ContactID]);\n\n const checkDuplicateContactHandler = async (values) => {\n setduplicateChecking(true);\n setduplicateData(null);\n try {\n const resp = await post(\"/candidate/checkDuplicate\", {\n email: values.email,\n phone: values.phone,\n });\n if (resp?.status === 200) {\n if (resp?.data?.data?.length > 0) {\n setduplicateData(resp?.data?.data);\n }\n }\n } catch (error) {\n console.error(\"Error checking duplicate contact:\", error);\n } finally {\n setduplicateChecking(false);\n }\n };\n\n const renderTab = () => {\n let tabs = [\n {\n key: \"Profile\",\n label: \"Profile\",\n children: (\n \n ),\n },\n {\n key: \"Resume\",\n label: \"Resume\",\n children: (\n \n ),\n },\n {\n key: \"Activity Log\",\n label: \"Activity Log\",\n children: (\n \n ),\n },\n {\n key: \"Attachments\",\n label: AttachmentLoading ? (\n \n Attachments \n \n ) : (\n `Attachments (${Attachments?.length || 0})`\n ),\n children: (\n \n ),\n },\n {\n key: \"Calendar\",\n label: `Interview Scheduling`,\n children: (\n \n ),\n },\n ];\n return tabs;\n };\n useEffect(() => {\n function handleClickOutside(event) {\n if (\n phoneInputRef?.current &&\n !phoneInputRef?.current.contains(event.target)\n ) {\n triggerPhoeUpdate();\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [ActivePhoneNumber, siderData, ContactID, navigateKey]);\n\n const triggerPhoeUpdate = () => {\n try {\n const activePhoneParsed = ActivePhoneNumber\n ? parsePhoneNumber(String(ActivePhoneNumber))\n : null;\n const tablePhoneParsed = parsePhoneNumber(\n String(activeContactTableData?.profile?.data?.phone ?? \"\")\n );\n\n if (\n activePhoneParsed &&\n activePhoneParsed.number !== tablePhoneParsed?.number\n ) {\n updateCandidateData({\n data: { phone: ActivePhoneNumber },\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n },\n });\n setActivePhoneNumber(null);\n } else {\n setActivePhoneNumber(null);\n }\n } catch (error) {\n console.error(\"Error parsing phone number:\", error);\n }\n };\n\n useEffect(() => {\n if (MessageWidget) {\n setMessageWindowActive(true);\n }\n }, [MessageWidget]);\n\n const [SenderEmail, setSenderEmail] = useState();\n const [EmailData, setEmailData] = useState(\"\");\n const [emailRecipient, setemailRecipient] = useState(null);\n const AppReducer = useSelector((state) => state.AppReducer);\n const AdminReducer = useSelector((state) => state.AdminReducer);\n const emailSubject = useSelector((state) => state.AdminReducer.emailSubject);\n const [sendingMail, setsendingMail] = useState(false);\n const [shareCandidate, setshareCandidate] = useState(false);\n const handleChangeS = (value) => {\n setSenderEmail(value);\n };\n const handleModelChange = (model) => {\n setEmailData(model);\n };\n const handleSubmit = () => {\n setsendingMail(true);\n try {\n if (!emailRecipient) {\n notification.error({\n message: \"Please select recipient email address\",\n });\n setsendingMail(false);\n return;\n }\n if (!SenderEmail) {\n notification.error({\n message: \"Please select sender email address\",\n });\n setsendingMail(false);\n return;\n }\n if (!emailSubject) {\n notification.error({\n message: \"Please enter email subject\",\n });\n setsendingMail(false);\n return;\n }\n\n let attachment = [];\n if (AppReducer.chatContainerComponent === \"attachmentContainer\") {\n attachment = AppReducer.containerParams;\n }\n let ccEmail = AdminReducer?.ccEmailRecipients?.map((res) => {\n return res.value;\n });\n let bcc = AdminReducer?.bccEmailRecipients?.map((res) => {\n return res.value;\n });\n let message = {\n attachments: attachment,\n to: emailRecipient,\n text: EmailData,\n cc: ccEmail,\n bcc: bcc,\n channelAccountId: SenderEmail,\n subject: emailSubject,\n openingId: openingsId,\n candidates: [siderData?.record],\n shared: true,\n };\n post(\"/openings/submission/mail\", message)\n .then((res) => {\n notification.success({\n message: \"Email sent successfully\",\n });\n setsendingMail(false);\n setshareCandidate(false);\n })\n .catch((error) => {\n notification.error({\n message: \"Error in sending email\",\n });\n setsendingMail(false);\n setshareCandidate(false);\n });\n } catch (error) {\n notification.error({\n message: \"Error in sending email\",\n });\n setsendingMail(false);\n setshareCandidate(false);\n }\n };\n\n useEffect(() => {\n if (!activeContactTableData) return;\n const userId = user?.userProfile?._id;\n const candidateViewed = activeContactTableData?.candidateViewed;\n if (!candidateViewed) {\n activeContactTableData.candidateViewed = {\n [userId]: moment().valueOf(),\n };\n } else {\n candidateViewed[userId] = moment().valueOf();\n }\n }, [activeContactTableData, user]);\n return (\n \n {acoLoading && (\n \n \n

\n Please wait while we are loading the candidate details...\n

\n \n )}\n {!MessageWindowActive && !acoLoading && (\n
\n {topBar && (\n \n \n closeSidebar()}\n alt=\"close\"\n />\n
\n Candidate Details\n {\n try {\n const url = new URL(\n `/admin/openings/${ActiveOPID}/candidate/${ContactID}`,\n window.location.origin\n );\n window.open(url.href);\n } catch (e) {\n console.error(\"Invalid URL\", e);\n }\n }}\n />\n
\n
\n setshareCandidate(true)}\n className=\"d-flex items-align-center gap5\"\n >\n Share candidate \n \n
\n \n
\n {from !== \"inbox\" && (\n \n {\n setnavigateKey(navigateKey - 1);\n }}\n >\n Previous Candidate\n \n {\n setnavigateKey(navigateKey + 1);\n }}\n >\n Next Candidate\n \n \n
\n )}\n
\n \n )}\n
\n \n {activeContactTableData?.candidateViewed &&\n activeContactTableData?.candidateViewed[\n user?.userProfile?._id\n ] && (\n
\n \n
Last viewed at :-
\n {checkViewDate(\n activeContactTableData?.candidateViewed[\n user?.userProfile?._id\n ]\n )}\n
\n }\n >\n \n \n
\n )}\n \n {updateLoading && (\n
\n
\n \n
\n \n \n \n
\n
\n
\n )}\n {!updateLoading && (\n
\n
\n
\n
\n {activeContactTableData?.profile?.data?.profileUrl\n ?.length > 0 ? (\n \n \n \n ) : (\n \n \n {activeContactTableData?.profile?.data?.name?.[0]?.toUpperCase()}\n \n \n )}\n
\n
\n {duplicateChecking && (\n
\n Checking duplicate..\n \n
\n )}\n {duplicateData?.[0]?.candidates?.length > 1 && (\n setopenDuplicateModal(true)}\n >\n Duplicate{\" \"}\n \n \n )}\n
\n Sourced from :{\" \"}\n {\n const currentSource =\n activeContactTableData?.source ?? \"NA\";\n\n if (val !== currentSource) {\n updateCandidateData({\n data: {},\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n },\n source: val,\n });\n }\n },\n }\n }\n >\n {activeContactTableData?.source ?? \"NA\"}\n \n
\n\n \n Skills: \n {activeContactTableData?.skills\n ?.slice(0, 5)\n .map((res, i) => (\n \n {res.name}\n {i !== 4 && \",\"}\n {i === 4 && \"...\"}\n \n ))}\n \n
\n
\n
\n \n \n
\n
\n
\n
\n \n
\n\n
\n {\n const currentEmail =\n activeContactTableData?.profile\n ?.data?.email ?? \"NA\";\n\n if (val !== currentEmail) {\n updateCandidateData({\n data: { email: val },\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n },\n });\n }\n },\n }\n }\n >\n {activeContactTableData?.profile?.data\n ?.email?.length > 0\n ? activeContactTableData?.profile?.data\n ?.email\n : \"NA\"}\n \n
\n
\n
\n \n {\n if (\n activeContactTableData?.profile?.data\n ?.phone\n ) {\n dispatch(\n RecordActivityAction({\n name: \"Call\",\n contactId: ContactID,\n createdAt: new Date(),\n })\n );\n }\n }}\n />\n
\n\n {ActivePhoneNumber === null && (\n
\n {\" \"}\n {\n activeContactTableData?.highestPermission !==\n \"Read\" &&\n setActivePhoneNumber(\n activeContactTableData?.profile\n ?.data?.phone ?? \"\"\n );\n }}\n >\n {activeContactTableData?.profile?.data\n ?.phone?.length > 0\n ? activeContactTableData?.profile?.data\n ?.phone\n : \"NA\"}\n
\n
\n {\n window.navigator.clipboard.writeText(\n activeContactTableData?.profile\n ?.data?.phone ?? \"NA\"\n );\n notification.success({\n message: \"Phone number copied\",\n });\n }}\n />\n
\n \n )}\n {ActivePhoneNumber !== null && (\n
\n {\" \"}\n data._id === ActiveOPID\n )?.timeZone\n )}\n className=\"br-6 inputStyle signUp\"\n style={{ width: \"100%\" }}\n onChange={(val) => {\n if (val) {\n setActivePhoneNumber(val);\n }\n }}\n onCountryChange={(val) => {\n if (val && ActivePhoneNumber) {\n let cnt = getCountryCallingCode(val);\n let phn =\n parsePhoneNumber(ActivePhoneNumber);\n setActivePhoneNumber(\n `+${cnt}${phn?.nationalNumber}`\n );\n }\n }}\n />\n
\n )}\n \n \n
\n
\n {(from !== \"inbox\" || as === \"page\") && (\n
\n {\n setMessageWindowActive(true);\n }}\n >\n \n Message\n \n
\n )}\n {(from !== \"inbox\" || as === \"page\") && (\n
\n setStageEdit(!StageEdit)}\n style={{ width: 242 }}\n onChange={(val) => {\n if (\n StageChangeRequiredConfig[tenantId] &&\n StageChangeRequiredConfig[\n tenantId\n ]?.includes(val) &&\n cr?.length > 0\n ) {\n const allKeysMatchWithValues =\n cr?.every(\n (key) =>\n canData?.hasOwnProperty(key) &&\n canData[key] != null &&\n canData[key] !== \"\"\n );\n if (\n allKeysMatchWithValues &&\n canData &&\n Object.keys(canData)?.length > 0\n ) {\n setconfirmModal(true);\n setTempValue({\n openingId: ActiveOPID,\n stageId: val,\n });\n } else {\n notification.error({\n message:\n \"Please fill all mandatory fields\",\n placement: \"topLeft\",\n });\n setStageVal(StageVal);\n }\n } else {\n setconfirmModal(true);\n setTempValue({\n openingId: ActiveOPID,\n stageId: val,\n });\n }\n }}\n // defaultValue={\n // activeContactTableData?.opening?.stageId\n // }\n value={StageVal}\n >\n {candidateFilterStage?.data?.map(\n (res) => {\n return (\n \n
\n {res.name}\n
\n
\n );\n }\n )}\n \n
\n )}\n
\n
\n \n
\n \n {\n if (\n activeContactTableData?.profile?.data\n ?.linkedIn\n ) {\n window.open(\n activeContactTableData?.profile?.data\n ?.linkedIn,\n \"_blank\"\n );\n }\n }}\n />\n \n {\n const currentLinkedIn =\n activeContactTableData?.profile?.data\n ?.linkedIn ?? \"NA\";\n\n if (val !== currentLinkedIn) {\n updateCandidateData({\n data: { linkedIn: val },\n candidate: {\n opening: {\n openingId: ActiveOPID,\n },\n },\n });\n }\n },\n }\n }\n >\n {activeContactTableData?.profile?.data\n ?.linkedIn ?? \"NA\"}\n \n
\n\n \n Tags:\n \n updateCandidateData({\n data: {},\n candidate: {\n tags: val,\n opening: {\n openingId: ActiveOPID,\n },\n },\n })\n }\n />\n \n \n \n \n \n \n \n \n \n \n )}\n \n \n \n handleActive(ac)}\n items={renderTab()}\n />\n \n \n \n )}\n {MessageWindowActive && (\n
\n \n \n Message\n \n
\n {\n if (MessageWidget) {\n closeSidebar();\n }\n dispatch({\n type: \"MESSAGE_WIDGET\",\n data: false,\n });\n setMessageWindowActive(false);\n if (!cid) {\n dispatch({ type: \"CLEAR_MESSAGE\", data: [] });\n dispatch({ type: \"SET_ACTIVE_CONVID\", data: null });\n }\n }}\n >\n Back\n \n
\n
\n \n
\n )}\n \n d._id === TempValue?.stageId\n )?.name\n }\n updateStageID={updateStageID}\n setconfirmModal={setconfirmModal}\n setTempValue={setTempValue}\n TempValue={TempValue}\n openingId={TempValue?.openingId}\n sVal={TempValue?.stageId}\n />\n \n \n setopenDuplicateModal(false)}\n footer={false}\n />\n \n \n
\n {\n handleSubmit();\n }}\n >\n Send Mail\n \n {\n setshareCandidate(false);\n setEmailData(false);\n setemailRecipient(null);\n setSenderEmail(null);\n dispatch({ type: \"CC_EMAIL_RECIPERNT\", data: [] });\n dispatch({ type: \"EMAIL_SUBJECT\", data: \"\" });\n handleModelChange(\"\");\n }}\n >\n Cancel\n \n
\n
\n \n \n \n Send from\n \n \n \n {allConfigData?.map((res) => {\n if (res.md === \"email\") {\n return (\n \n {res?.configEmail?.email}\n \n );\n }\n })}\n \n \n \n \n res.url === siderData?.record?.rId\n )\n : siderData?.record?.attachments[0] ?? []\n }\n CandidateId={activeContactTableData?._id}\n />\n
\n \n
\n );\n};\n\nexport default CandidatesView;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport CandidatesView from \"./SideBarView/CandidatesView\";\n\nconst SideBardata = () => {\n const siderTab = useSelector((state) => state.OpeningReducer.siderTab);\n const renderComponent = () => {\n let obj = {\n Candidates: ,\n };\n return obj[siderTab];\n };\n return
{renderComponent()}
;\n};\n\nexport default SideBardata;\n","export const StageChangeRequiredConfig = {\n // tdNewton\n \"d8e9cea1-c238-41f5-b5c5-afcdd96af208\": [\n \"abbfa8dd-25ae-4a45-acd6-a8a080894f0f\",\n ],\n};\n","export const submissionInitialFields = [\n { name: \"Name\", value: \"name\" },\n { name: \"Designation\", value: \"designation\" },\n { name: \"Currently Working\", value: \"company\" },\n { name: \"Experience\", value: \"experience\" },\n { name: \"Location\", value: \"location\" },\n { name: \"Current CTC\", value: \"ctc\" },\n { name: \"Expected CTC\", value: \"expCtc\" },\n { name: \"Email\", value: \"email\" },\n { name: \"Phone\", value: \"phone\" },\n { name: \"Remarks\", value: \"notes\" },\n { name: \"Notice\", value: \"notice\" },\n { name: \"Resume\", value: \"resume\" },\n {\n name: \"Qualify Questions\",\n value: \"qualifyQuestions\",\n },\n {\n name: \"Stage\",\n value: \"stageName\",\n },\n {\n name: \"LinkedIn\",\n value: \"linkedIn\",\n },\n {\n name: \"Notes\",\n value: \"notes\",\n },\n {\n name: \"Date\",\n value: \"date\",\n },\n {\n name: \"Role Recruiter Name\",\n value: \"recruiterName\",\n },\n {\n name: \"Role Name\",\n value: \"positionName\",\n },\n {\n name: \"Role Company Name\",\n value: \"companyNameApply\",\n },\n {\n name: \"Role Location\",\n value: \"roleLocation\",\n },\n {\n name: \"Tags\",\n value: \"tags\",\n },\n {\n name: \"Reason for Change\",\n value: \"reasonChange\",\n },\n];\n","// This icon file is generated automatically.\nvar RetweetOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M136 552h63.6c4.4 0 8-3.6 8-8V288.7h528.6v72.6c0 1.9.6 3.7 1.8 5.2a8.3 8.3 0 0011.7 1.4L893 255.4c4.3-5 3.6-10.3 0-13.2L749.7 129.8a8.22 8.22 0 00-5.2-1.8c-4.6 0-8.4 3.8-8.4 8.4V209H199.7c-39.5 0-71.7 32.2-71.7 71.8V544c0 4.4 3.6 8 8 8zm752-80h-63.6c-4.4 0-8 3.6-8 8v255.3H287.8v-72.6c0-1.9-.6-3.7-1.8-5.2a8.3 8.3 0 00-11.7-1.4L131 768.6c-4.3 5-3.6 10.3 0 13.2l143.3 112.4c1.5 1.2 3.3 1.8 5.2 1.8 4.6 0 8.4-3.8 8.4-8.4V815h536.6c39.5 0 71.7-32.2 71.7-71.8V480c-.2-4.4-3.8-8-8.2-8z\" } }] }, \"name\": \"retweet\", \"theme\": \"outlined\" };\nexport default RetweetOutlined;\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 RetweetOutlinedSvg from \"@ant-design/icons-svg/es/asn/RetweetOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RetweetOutlined = function RetweetOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RetweetOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RetweetOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RetweetOutlined';\n}\nexport default RefIcon;","import { CXButton } from \"component/Button\";\nimport React from \"react\";\nimport AddPosition from \"./AddPosition\";\n\nconst OpeningDuplicate = ({ id = null, close, setOpeningList }) => {\n return (\n
\n
\n close(null)}>\n Close\n \n
\n \n
\n );\n};\n\nexport default OpeningDuplicate;\n","import moment from \"moment\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useRouteMatch } from \"react-router-dom/cjs/react-router-dom.min\";\nimport history from \"utils/history\";\nimport { CXEmpty } from \"component/Empty\";\nimport { CXSkeletonAVT } from \"component/Skeleton\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport {\n CloudDownloadOutlined,\n CopyOutlined,\n DeleteFilled,\n EditFilled,\n RetweetOutlined,\n} from \"@ant-design/icons\";\nimport { CXLottie } from \"component/Lottie\";\nimport {\n getOpenPositionsTrigger,\n markArchive,\n pinJobOpening,\n} from \"action/OpeningsAction\";\nimport { CXModal } from \"component/Modal\";\nimport OpeningDuplicate from \"./OpeningDuplicate\";\nimport { exportContactByPosition } from \"action/ContactAction\";\nimport { CXBadge } from \"component/Badge\";\nimport { CXPopover } from \"component/Popover\";\nimport InfiniteScroll from \"react-infinite-scroller\";\nimport { Avatar, Divider, Tooltip } from \"antd\";\n\nconst OpeningsList = ({ archive, searchVal, Active, AgentSelect, isPrime }) => {\n const dispatch = useDispatch();\n const { url } = useRouteMatch();\n const [duplicate, setduplicate] = useState(null);\n const { agents } = useSelector((state) => state.AgentReducer);\n const { stageMetricNotif } = useSelector(\n (state) => state.NotificationReducer\n );\n const scrollParentRef = useRef(null);\n const [OpeningList, setOpeningList] = useState([]);\n const {\n candidateFilterStage,\n openingLoading,\n ArchivedType,\n BulkOpeningsCA,\n BulkOpeningsCaLoading,\n openPositions,\n ActiveAgentFilter,\n } = useSelector((state) => state.OpeningReducer);\n const stageHandller = (e, openingId, stageID) => {\n history.push(`/admin/openings/${openingId}/Candidates/${stageID}`);\n e.stopPropagation();\n };\n const menu = (id, positionName) => (\n \n {!archive && (\n {\n history.push(`/admin/openings/${id}/edit`);\n }}\n >\n \n Edit\n \n )}\n {\n dispatch(markArchive(id, archive ? false : true));\n setOpeningList(OpeningList.filter((data) => data._id !== id));\n }}\n >\n {archive ? (\n \n ) : (\n \n )}\n {archive ? \"Unarchive\" : \"Archive\"}\n \n {\n dispatch(exportContactByPosition(id, positionName));\n }}\n >\n Export\n \n {!archive && (\n {\n setduplicate(id);\n }}\n >\n \n Duplicate\n \n )}\n \n );\n\n const agentNaming = (res) => {\n return (\n \n {res.permissions.map((res) => {\n if (res?.principal?.startsWith(\"u\")) {\n const parts = res?.principal?.split(\"_\");\n let agent = agents?.data?.find((d) => d._id === parts[1]);\n return (\n \n \n \n {agent?.fname ? agent?.fname[0] : \"\"}{\" \"}\n {agent?.lname ? agent?.lname[0] : \"\"}\n \n \n \n );\n }\n })}\n \n );\n // let agent = agents?.data?.find((d) => d._id === res?.prime);\n // let result = agent ? `${agent.fname} ${agent.lname}` : \"N/A\";\n // return result;\n };\n useEffect(() => {\n setOpeningList([]);\n }, [Active, AgentSelect, isPrime]);\n\n useEffect(() => {\n if (openPositions?.data?.length > 0) {\n const uniquePositions = [];\n const ids = new Set();\n\n openPositions.data.forEach((da) => {\n if (!ids.has(da._id)) {\n ids.add(da._id);\n uniquePositions.push(da);\n }\n });\n\n if (searchVal?.length === 0) {\n setOpeningList((prevList) => {\n const combinedList = [...(prevList || []), ...uniquePositions];\n const uniqueCombinedList = [];\n const combinedIds = new Set();\n\n combinedList.forEach((da) => {\n if (!combinedIds.has(da._id)) {\n combinedIds.add(da._id);\n uniqueCombinedList.push(da);\n }\n });\n\n return uniqueCombinedList;\n });\n } else {\n setOpeningList(uniquePositions);\n }\n }\n }, [openPositions]);\n useEffect(() => {\n setOpeningList([]);\n }, [searchVal, ActiveAgentFilter]);\n\n const pinUpdate = (id, value) => {\n setOpeningList((prevList) =>\n prevList.map((data) => {\n if (data._id === id) {\n return { ...data, isPinned: value };\n }\n return data;\n })\n );\n };\n return (\n \n {\n if (openPositions?.paging?.after?.length > 0) {\n dispatch(\n getOpenPositionsTrigger(archive, openPositions?.paging?.after)\n );\n }\n }}\n hasMore={openPositions?.paging?.after?.length > 0 ? true : false}\n getScrollParent={() => scrollParentRef.current}\n >\n {OpeningList?.map((res, i) => {\n let stNotif = stageMetricNotif?.find(\n (data) => data?.openingId === res?._id\n );\n let CA = BulkOpeningsCA?.find(\n (data) => data?.openingId === res._id\n )?.channelAccounts;\n let emails = CA?.filter((data) => data?.md === \"email\")\n ?.map((data) => data?.configEmail)\n .map((data) => data?.email);\n return (\n history.push(`${url}/${res._id}/Candidates`)}\n >\n
\n \n {res?.positionName}\n
\n
\n {BulkOpeningsCaLoading && }\n {!BulkOpeningsCaLoading && (\n
\n {emails?.length > 0 && (\n \n {emails?.map((email) => {\n return (\n
\n
{email}
\n
\n );\n })}\n
\n }\n >\n 1\n ? \"EMAIL-alert.svg\"\n : \"EMAIL.svg\"\n }`}\n alt=\"\"\n height={24}\n />\n \n )}\n \n )}\n
\n
\n \n Sequences Active\n
\n
\n
\n {\n dispatch(\n pinJobOpening(\n res._id,\n res?.isPinned ? false : true,\n ArchivedType === \"Active\" ? false : true\n )\n );\n pinUpdate(res._id, res?.isPinned ? false : true);\n e.stopPropagation(); // Stop event propagation\n }}\n />\n
\n {\n e.stopPropagation(); // Stop event propagation\n }}\n >\n \n \n \n \n
\n \n\n
\n
\n
\n \n {\" \"}\n {res?.cId?.name}\n \n at\n
\n
\n
{res?.location?.name ?? \"N/A\"}
\n
\n
\n\n
|
\n
\n
{moment(res.createdAt).format(\"DD MMM YYYY\")}
\n
\n
|
\n
\n
{agentNaming(res)}
\n
\n
\n
\n {candidateFilterStage?.data?.map((resD) => {\n let stage = stNotif?.stages?.find(\n (data) => data.stageId === resD._id\n );\n return (\n 0 ? true : false}\n offset={[5, 0]}\n className=\"notif-config\"\n >\n 0 ? `#068EFF` : `#000`,\n }}\n className=\"click-stage\"\n onClick={(e) => stageHandller(e, res._id, resD._id)}\n >\n 0 ? `#068EFF` : \"#7D7D7D\",\n marginBottom: 10,\n }}\n >\n {resD?.name}\n \n
{res.candidateStages[resD._id] ?? 0}
\n \n \n );\n })}\n
\n \n );\n })}\n {openingLoading && (\n \n )}\n {!openingLoading && openPositions?.data?.length === 0 && }\n \n 0}\n onCancel={() => {}}\n >\n \n \n \n );\n};\n\nexport default OpeningsList;\n","import { CXContent, CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport \"./style.css\";\nimport { CXInput } from \"component/Input\";\nimport history from \"utils/history\";\nimport {\n getOpenPositionsTrigger,\n getAllCompaniesTrigger,\n getCandidateStageTrigger,\n OpeningSearch,\n} from \"action/OpeningsAction\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nimport OpeningsListCard from \"./OpeningsListCard\";\nimport { CXTabs } from \"component/Tabs\";\nimport { debounce } from \"lodash\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CloseCircleOutlined, LoadingOutlined } from \"@ant-design/icons\";\nimport { getStageMetricsNotifications } from \"action/NotificationActions\";\nimport { useLocation } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { CXLottie } from \"component/Lottie\";\nimport { CXSwitch } from \"component/Switch\";\n\nconst Index = () => {\n const dispatch = useDispatch();\n const [Active, setActive] = useState(\"Active\");\n const { ActiveAgentFilter, ArchivedType, openingLoading } = useSelector(\n (state) => state?.OpeningReducer\n );\n const { agents } = useSelector((state) => state?.AgentReducer);\n const [AgentSelect, setAgentSelect] = useState();\n const [searchVal, setsearchVal] = useState(\"\");\n const location = useLocation();\n const queryParams = new URLSearchParams(location.search);\n const agentId = queryParams.get(\"agent\");\n const [isPrime, setisPrime] = useState(false);\n useEffect(() => {\n if (!ActiveAgentFilter && !agentId) {\n dispatch(getOpenPositionsTrigger());\n }\n dispatch(getStageMetricsNotifications());\n dispatch(getAllCompaniesTrigger());\n dispatch(getCandidateStageTrigger());\n }, []);\n\n useEffect(() => {\n if (ActiveAgentFilter && (!AgentSelect || isPrime === false || isPrime)) {\n setAgentSelect(ActiveAgentFilter);\n setActive(ArchivedType === \"Archived\" ? \"Archived\" : \"Active\");\n let obj = {\n value: searchVal,\n isDeleted: ArchivedType === \"Archived\" ? true : false,\n recruiter: ActiveAgentFilter,\n isPrime,\n };\n dispatch(OpeningSearch(obj));\n }\n }, [ActiveAgentFilter, isPrime]);\n const handleActive = (ac) => {\n setActive(ac);\n setsearchVal(\"\");\n setAgentSelect();\n setisPrime();\n if (ac === \"Archived\") {\n dispatch(getOpenPositionsTrigger(true));\n dispatch({ type: \"SET_ARCHIVED_TYPE\", data: \"Archived\" });\n } else {\n dispatch(getOpenPositionsTrigger());\n dispatch({ type: \"SET_ARCHIVED_TYPE\", data: \"Active\" });\n }\n };\n useEffect(() => {\n if (agentId && !AgentSelect) {\n dispatch({ type: \"ACTIVE_AGENT_FILTER\", data: agentId });\n setActive(ArchivedType === \"Archived\" ? \"Archived\" : \"Active\");\n } else if (!agentId && AgentSelect) {\n const queryParams = new URLSearchParams({\n agent: AgentSelect,\n })?.toString();\n\n history.push(`/admin/openings?${queryParams}`);\n }\n }, [agentId, AgentSelect]);\n\n const handleSearch = useCallback(\n debounce((e, ac, AgentSelect, isPrime) => {\n let obj = {\n value: e?.target?.value,\n isDeleted: ac === \"Archived\" ? true : false,\n isPrime,\n };\n if (AgentSelect) {\n obj = { ...obj, recruiter: AgentSelect };\n }\n dispatch(OpeningSearch(obj));\n }, 2500),\n []\n );\n const { exportingData } = useSelector((state) => state.ContactReducer);\n return (\n \n \n
\n \n \n Open Positions\n \n
\n {exportingData && (\n
\n Please wait data export in progress..\n \n
\n )}\n
\n history.push(\"/admin/openings/add\")}\n >\n Add New Position\n \n
\n
\n
\n
\n
\n
\n
\n {\n handleSearch(e, Active, AgentSelect);\n setsearchVal(e.target.value);\n }}\n prefix={\n \n }\n />\n \n {openingLoading && }\n {!openingLoading && agents?.data?.length > 0 && (\n {\n return option?.name\n ?.toLowerCase()\n ?.includes(input?.toLowerCase());\n }}\n onChange={(e) => {\n setAgentSelect(e);\n dispatch({ type: \"ACTIVE_AGENT_FILTER\", data: e });\n const queryParams = new URLSearchParams({\n agent: e,\n })?.toString();\n\n history.push(`/admin/openings?${queryParams}`);\n handleSearch({ target: { value: searchVal } }, Active, e);\n }}\n >\n {agents?.data\n ?.sort((a, b) => {\n const nameA = a.fname?.toLowerCase() ?? \"\";\n const nameB = b.fname?.toLowerCase() ?? \"\";\n if (nameA < nameB) return -1;\n if (nameA > nameB) return 1;\n return 0;\n })\n .map((agent) => {\n return (\n \n \n {agent?.fname ?? \" \"} {agent?.lname ?? \"\"}\n \n \n );\n })}\n \n )}\n {AgentSelect && !openingLoading && agents?.data?.length > 0 && (\n {\n setisPrime(false);\n setAgentSelect();\n dispatch({ type: \"ACTIVE_AGENT_FILTER\", data: null });\n handleSearch(\n { target: { value: \"\" } },\n Active,\n null,\n false\n );\n setsearchVal(\"\");\n\n history.push(`/admin/openings`);\n }}\n >\n \n
\n )}\n {!openingLoading && agents?.data?.length > 0 && AgentSelect && (\n
\n setisPrime(!isPrime)}\n checked={isPrime}\n />\n
\n )}\n \n
\n \n \n handleActive(ac)}\n items={[\n {\n key: \"Active\",\n label: \"Active Jobs\",\n children: (\n \n ),\n },\n {\n key: \"Archived\",\n label: \"Archived Jobs\",\n children: (\n \n ),\n },\n ]}\n />\n \n \n
\n
\n );\n};\n\nexport default Index;\n","import React from \"react\";\nimport { CXSider, CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\nimport history from \"utils/history\";\nimport { useRouteMatch } from \"react-router-dom\";\nconst SideBar = ({ activeMenu, setactiveMenu }) => {\n const { url } = useRouteMatch();\n const setRoute = (key) => {\n setactiveMenu(key);\n history.push(`${url}/${key}`);\n };\n return (\n \n \n \n Bot Configuration\n \n \n setRoute(e.key)}\n >\n \n \n Bot List\n \n \n \n Webhooks\n \n \n \n );\n};\n\nexport default SideBar;\n","import React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXHeader } from \"component/Layout\";\nimport { CloseOutlined } from \"@ant-design/icons\";\nimport { TOGGLE_ADD_BOT_SIDE_BAR } from \"constant/app.constant\";\nimport { BOT_SKELETON } from \"constant\";\nimport { CXInput } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { createBotAction } from \"action/WorkbenchAction\";\nimport { CXSelect, CXOption } from \"component/Select\";\nconst AddNewBot = () => {\n const initialData = {\n name: \"\",\n authLevel: \"\",\n };\n const [botData, setbotData] = useState(initialData);\n const dispatch = useDispatch();\n const CloseBot = () => {\n dispatch({ type: TOGGLE_ADD_BOT_SIDE_BAR, data: true });\n setbotData(initialData);\n };\n const handleChange = (val, key) => {\n setbotData({ ...botData, [key]: val });\n };\n const handleSubmit = () => {\n dispatch({ type: BOT_SKELETON, data: true });\n dispatch({ type: TOGGLE_ADD_BOT_SIDE_BAR, data: true });\n setbotData(initialData);\n dispatch(createBotAction(botData));\n };\n return (\n
\n \n \n Add New Bot\n \n CloseBot()}\n />\n \n
\n
Name
\n handleChange(e.target.value, \"name\")}\n value={botData.name}\n />\n
\n {/*
\n
Authorization Level
\n handleChange(value, \"authLevel\")}\n >\n Open\n Open Email\n Closed Saml\n Closed OAuth\n Closed Ditto\n Closed AD\n \n
*/}\n
\n handleSubmit()}>\n Create New Bot\n \n
\n
\n );\n};\n\nexport default AddNewBot;\n","import React, { useEffect } from \"react\";\nimport { CXHeader } from \"component/Layout\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXTitle } from \"component/Typography\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { TOGGLE_ADD_BOT_SIDE_BAR } from \"constant/app.constant\";\nimport {\n ACTIVE_WORKBENCH,\n ACTIVE_BOT,\n GET_ALL_CONVERSATION_BY_IDS,\n DATA_LOAD,\n} from \"constant\";\nimport { deleteBotAction, GetLanguageSettings } from \"action/WorkbenchAction\";\nimport history from \"utils/history\";\nimport { CXbotSkeleton, CXSkeleton } from \"component/Skeleton\";\nimport { truncateSt } from \"utils\";\n\nconst BotList = ({ setactiveMenu }) => {\n const dispatch = useDispatch();\n const addBot = () => {\n dispatch({ type: TOGGLE_ADD_BOT_SIDE_BAR, data: false });\n };\n const { user } = useSelector((state) => state.dittoAdminReducer);\n const ActiveWorkbench = (id) => {\n localStorage.setItem(\"botId\", id);\n dispatch(GetLanguageSettings(id));\n dispatch({ type: ACTIVE_BOT, data: id });\n dispatch({ type: ACTIVE_WORKBENCH, data: true });\n history.push(`/admin/bot-workbench/botList/${id}/Configure`);\n };\n const DeleteBot = (id) => {\n dispatch(deleteBotAction(id));\n };\n const BotList = useSelector((state) => state.WrokbenchReducer.Bots);\n const Loader = useSelector((state) => state.WrokbenchReducer.botSkeleton);\n useEffect(() => {\n dispatch({ type: GET_ALL_CONVERSATION_BY_IDS, data: [] });\n dispatch({ type: DATA_LOAD, data: true });\n setactiveMenu(\"botList\");\n }, []);\n return (\n
\n \n \n Bot List\n \n \n\n {Loader && (\n \n {[...Array(6)].map((res) => {\n return (\n
\n \n
\n );\n })}\n
\n )}\n\n {!Loader && (\n \n \n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n \n addBot()}\n >\n \"addBot\"\n \n Add New Bot\n
\n \n \n )}\n {BotList &&\n BotList?.map((res) => {\n return (\n \n
\n
\n
\n
{truncateSt(res.name, 22)}
\n
\n {user?.userTenants?.find(\n (item) => item?.userId === user?.userProfile?._id\n )?.role?.name === \"OWNER\" && (\n
\n ActiveWorkbench(res.id)}\n />\n DeleteBot(res.id)}\n />\n
\n )}\n
\n
\n \"bot\"\n
\n
\n
\n );\n })}\n \n \n )}\n \n );\n};\n\nexport default BotList;\n","// This icon file is generated automatically.\nvar EyeFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M396 512a112 112 0 10224 0 112 112 0 10-224 0zm546.2-25.8C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z\" } }] }, \"name\": \"eye\", \"theme\": \"filled\" };\nexport default EyeFilled;\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 EyeFilledSvg from \"@ant-design/icons-svg/es/asn/EyeFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar EyeFilled = function EyeFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EyeFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EyeFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EyeFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar SaveFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M893.3 293.3L730.7 130.7c-12-12-28.3-18.7-45.3-18.7H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 176h256v112H384V176zm128 554c-79.5 0-144-64.5-144-144s64.5-144 144-144 144 64.5 144 144-64.5 144-144 144zm0-224c-44.2 0-80 35.8-80 80s35.8 80 80 80 80-35.8 80-80-35.8-80-80-80z\" } }] }, \"name\": \"save\", \"theme\": \"filled\" };\nexport default SaveFilled;\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 SaveFilledSvg from \"@ant-design/icons-svg/es/asn/SaveFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar SaveFilled = function SaveFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SaveFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SaveFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SaveFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloseSquareFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112c17.7 0 32 14.3 32 32v736c0 17.7-14.3 32-32 32H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32zM639.98 338.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z\" } }] }, \"name\": \"close-square\", \"theme\": \"filled\" };\nexport default CloseSquareFilled;\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 CloseSquareFilledSvg from \"@ant-design/icons-svg/es/asn/CloseSquareFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloseSquareFilled = function CloseSquareFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloseSquareFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseSquareFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseSquareFilled';\n}\nexport default RefIcon;","import { CXCol } from \"component/Col\";\nimport { CXRow } from \"component/Row\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXText } from \"component/Typography\";\nimport { Chart as ChartJS } from \"chart.js/auto\";\nimport React, { useState } from \"react\";\nimport { Bar, Pie } from \"react-chartjs-2\";\nimport DatePickerComp from \"screen/Common/DatePickerComp\";\n\nconst WebhookChart = () => {\n const [startDateC, setStartDateC] = useState(null);\n const [endDateC, setEndDateC] = useState(null);\n const [activeVisorFilterC, setactiveVisorFilterC] = useState([\"day\"]);\n const selectViaCalC = (dates) => {\n const [start, end] = dates;\n setStartDateC(start);\n setEndDateC(end);\n setactiveVisorFilterC([\"custom\"]);\n };\n const changeValC = (val) => {\n setactiveVisorFilterC(val);\n setEndDateC(null);\n };\n return (\n
\n \n \n
Webhook call Summary
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n \n
\n Success / Failure (Aggregated)\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n );\n};\n\nexport default WebhookChart;\n","import { CloseSquareFilled, EyeFilled, SaveFilled } from \"@ant-design/icons\";\nimport {\n WBBaseUrl,\n WBCreateBaseURl,\n WBdeleteBaseURl,\n WBdeleteWebHook,\n WBgetWebHook,\n WBgetWebHookbyID,\n WBupdateBaseURl,\n} from \"action/WorkbenchAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXModal } from \"component/Modal\";\nimport { CXTitle } from \"component/Typography\";\nimport moment from \"moment\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { imageMapper } from \"../../ImageMapper\";\nimport WebhookChart from \"./WebhookChart\";\nimport history from \"utils/history\";\n\nconst WebhookList = ({ setrender }) => {\n const { BaseUrls, wbHookApis } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const dispatch = useDispatch();\n const [showModal, setshowModal] = useState(false);\n const [url, setUrl] = useState(\"\");\n const [activeId, setactiveId] = useState(null);\n const [updateVal, setupdateVal] = useState(null);\n useEffect(() => {\n dispatch(WBBaseUrl());\n dispatch(WBgetWebHook());\n }, []);\n\n const createBase = () => {\n dispatch(WBCreateBaseURl({ url }));\n setUrl(\"\");\n };\n const delbaseUrl = (id) => {\n dispatch(WBdeleteBaseURl(id));\n };\n\n const updateBaseUrl = () => {\n let obj = {\n _id: activeId,\n url: updateVal,\n };\n dispatch(WBupdateBaseURl(obj));\n setupdateVal(null);\n setactiveId(null);\n };\n\n const vuEnable = (id, val) => {\n dispatch(WBgetWebHookbyID(id));\n history.push(`/admin/bot-workbench/Webhooks/${val}/${id}`);\n // setrender(val);\n };\n return (\n \n \n \n Webhooks\n \n
\n setshowModal(true)}\n >\n Base URL\n \n history.push(\"/admin/bot-workbench/Webhooks/create\")}\n >\n Create webhook\n \n
\n
\n
\n \n
\n
Name
\n
URL/Handle
\n
HTTP Method
\n
Bot used
\n
In Use
\n
Actions
\n
\n
\n {wbHookApis.map((res) => {\n return (\n
\n
{res?.name ?? \"N/A\"}
\n
\n {BaseUrls.filter((d) => d?._id === res.baseUrlId)[0]?.url ??\n \"N/A\"}\n
\n
{res?.apiMethod ?? \"N/A\"}
\n
N/A
\n
N/A
\n
\n vuEnable(res._id, \"view\")}\n />\n vuEnable(res._id, \"update\")}\n />\n dispatch(WBdeleteWebHook(res._id))}\n />\n
\n
\n );\n })}\n
\n
\n {/* create Seprate component for baseUrl */}\n setshowModal(false)}\n closable={true}\n >\n \n Base URL\n \n
\n
\n
Create Base URL
\n
\n setUrl(e.target.value)}\n />\n createBase()}>\n Create\n \n
\n
\n
URL/Handle
\n
Created On
\n
Actions
\n
\n {BaseUrls.map((d) => {\n return (\n
\n
\n {activeId !== d._id && d.url}\n {activeId === d._id && (\n
\n setupdateVal(e.target.value)}\n addonAfter={\n
\n
\n \n
\n
\n setactiveId(null)}\n />\n
\n
\n }\n />\n
\n )}\n
\n
\n {moment(d.createdAt).format(\"DD MMM YYYY\")}\n
\n
\n setactiveId(d._id)}\n />\n delbaseUrl(d._id)}\n />\n
\n
\n );\n })}\n
\n \n \n );\n};\n\nexport default WebhookList;\n","import React, { Fragment, useEffect } from \"react\";\nimport { CXButton } from \"component/Button\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { WB_WEBHOOK_BY_ID } from \"constant\";\nimport WebhookChart from \"./WebhookChart\";\nimport { WBgetWebHookbyID } from \"action/WorkbenchAction\";\nimport history from \"utils/history\";\n\nconst WebhookView = ({ render, setrender }) => {\n const dispatch = useDispatch();\n const { BaseUrls, wbHookbyID } = useSelector(\n (state) => state.WrokbenchReducer\n );\n useEffect(() => {\n return () => {\n wbHookbyID &&\n render === \"WebhookView\" &&\n dispatch({ type: WB_WEBHOOK_BY_ID, data: {} });\n };\n }, []);\n return (\n \n \n \n Webhooks\n \n
\n history.push(\"/admin/bot-workbench/Webhooks\")}\n >\n Cancel\n \n {\n history.push(\n `/admin/bot-workbench/Webhooks/update/${wbHookbyID._id}`\n );\n dispatch(WBgetWebHookbyID(wbHookbyID._id));\n }}\n >\n Edit webhook\n \n
\n
\n
\n \n
\n
\n Webhook name\n
\n
{wbHookbyID?.name ?? \"\"}
\n
\n
\n
\n Webhook URL\n
\n
\n {BaseUrls?.filter((d) => d._id === wbHookbyID?.baseUrlId)[0]?.url ??\n \"\"}\n {wbHookbyID?.endpoint ?? \"\"}\n
\n
\n
\n
Method
\n
{wbHookbyID?.apiMethod ?? \"\"}
\n
\n
\n
\n Content Type\n
\n
{wbHookbyID?.contentType ?? \"\"}
\n
\n
\n
\n Keys for the Data\n
\n
\n {/* {wbHookbyID?.bodyParams?.length > 0\n ? wbHookbyID?.bodyParams\n : null ?? \"N/A\"} */}\n
\n
\n
\n
\n );\n};\n\nexport default WebhookView;\n","import React, { useEffect, useState } from \"react\";\nimport \"./style.css\";\nimport WebhookList from \"./WebhookList\";\nimport WebhookCreate from \"./WebhookCreate\";\nimport WebhookView from \"./WebhookView\";\nimport { Switch, Route, useParams, useRouteMatch } from \"react-router-dom\";\n\nconst Index = ({ setactiveMenu }) => {\n const { topicId } = useParams();\n const { path } = useRouteMatch();\n useEffect(() => {\n setactiveMenu(\"Webhooks\");\n }, []);\n const RenderComponent = () => {\n let { CRUD, webhookID } = useParams();\n const renderComponent = {\n create: ,\n update: ,\n view: ,\n };\n return renderComponent[CRUD];\n };\n\n return (\n
\n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default Index;\n","import React, { useEffect, useState } from \"react\";\nimport SideBar from \"./SideBar.jsx\";\nimport { CXContent } from \"component/Layout\";\nimport { CXLayout } from \"component/Layout\";\nimport { CXSider } from \"component/Layout\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport \"./style.css\";\nimport { TOGGLE_ADD_BOT_SIDE_BAR } from \"constant/app.constant\";\nimport AddNewBot from \"./botConfig/AddNewBot.jsx\";\nimport { getAllbots } from \"action/WorkbenchAction.js\";\nimport BotList from \"./botConfig/BotList.jsx\";\nimport Webhook from \"./webhookConfig\";\nimport { Switch, Route, useParams, useRouteMatch } from \"react-router-dom\";\nconst Index = () => {\n const { path } = useRouteMatch();\n const [activeMenu, setactiveMenu] = useState(\"botList\");\n const dispatch = useDispatch();\n const addBotSider = useSelector(\n (state) => state.WrokbenchReducer.addBotSider\n );\n const OpenCardDrawer = (collapsed) => {\n dispatch({ type: TOGGLE_ADD_BOT_SIDE_BAR, data: true });\n };\n useEffect(() => {\n OpenCardDrawer();\n return () => {\n OpenCardDrawer();\n };\n }, []);\n\n useEffect(() => {\n dispatch(getAllbots());\n }, []);\n\n const RenderComponent = () => {\n let { topicId } = useParams();\n let obj = {\n botList: ,\n Webhooks: ,\n };\n return obj[topicId === path ? \"User\" : topicId];\n };\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Index;\n","const dark_vscode_tribute = {\n default: '#D4D4D4',\n background: '#1E1E1E',\n background_warning: '#1E1E1E',\n string: '#CE8453',\n number: '#B5CE9F',\n colon: '#49B8F7',\n keys: '#9CDCFE',\n keys_whiteSpace: '#AF74A5',\n primitive: '#6392C6'\n};\nconst light_mitsuketa_tribute = {\n default: '#D4D4D4',\n background: '#FCFDFD',\n background_warning: '#FEECEB',\n string: '#FA7921',\n number: '#70CE35',\n colon: '#49B8F7',\n keys: '#59A5D8',\n keys_whiteSpace: '#835FB6',\n primitive: '#386FA4'\n};\nconst themes = {\n dark_vscode_tribute: dark_vscode_tribute,\n light_mitsuketa_tribute: light_mitsuketa_tribute\n};\nexport default themes;","import { getType, locate } from './mitsuketa';\nconst err = {\n getCaller: (skip = 1) => {\n // A somewhat hacky solution that will yield different results in different JS engines. \n // Since we only call this function when an error will actually be thrown we typically don't \n // rally mind the performance impact this might have if called too often.\n // Lucky for us we use nodeJS and thus only V8.\n const stackTrace = new Error().stack;\n var callerName = stackTrace.replace(/^Error\\s+/, '');\n callerName = callerName.split(\"\\n\")[skip];\n callerName = callerName.replace(/^\\s+at Object./, '').replace(/^\\s+at /, '').replace(/ \\(.+\\)$/, '');\n return callerName;\n },\n throwError: (fxName = 'unknown function', paramName = 'unknown parameter', expectation = 'to be defined') => {\n throw ['@', fxName, '(): Expected parameter \\'', paramName, '\\' ', expectation].join('');\n },\n isUndefined: (paramName = '', param) => {\n if ([null, undefined].indexOf(param) > -1) err.throwError(err.getCaller(2), paramName);\n },\n isFalsy: (paramName = '', param) => {\n if (!param) err.throwError(err.getCaller(2), paramName);\n },\n isNoneOf: (paramName = '', param, contains = []) => {\n if (contains.indexOf(param) === -1) err.throwError(err.getCaller(2), paramName, 'to be any of' + JSON.stringify(contains));\n },\n isAnyOf: (paramName = '', param, contains = []) => {\n if (contains.indexOf(param) > -1) err.throwError(err.getCaller(2), paramName, 'not to be any of' + JSON.stringify(contains));\n },\n isNotType: (paramName = '', param, type = '') => {\n if (getType(param) !== type.toLowerCase()) err.throwError(err.getCaller(2), paramName, 'to be type ' + type.toLowerCase());\n },\n isAnyTypeOf: (paramName = '', param, types = []) => {\n types.forEach(type => {\n if (getType(param) === type) err.throwError(err.getCaller(2), paramName, 'not to be type of ' + type.toLowerCase());\n });\n },\n missingKey: (paramName = '', param, keyName = '') => {\n err.isUndefined(paramName, param);\n if (Object.keys(param).indexOf(keyName) === -1) err.throwError(err.getCaller(2), paramName, 'to contain \\'' + keyName + '\\' key');\n },\n missingAnyKeys: (paramName = '', param, keyNames = ['']) => {\n err.isUndefined(paramName, param);\n const keyList = Object.keys(param);\n keyNames.forEach(keyName => {\n if (keyList.indexOf(keyName) === -1) err.throwError(err.getCaller(2), paramName, 'to contain \\'' + keyName + '\\' key');\n });\n },\n containsUndefined: (paramName = '', param) => {\n [undefined, null].forEach(value => {\n const location = locate(param, value);\n if (location) err.throwError(err.getCaller(2), paramName, 'not to contain \\'' + JSON.stringify(value) + '\\' at ' + location);\n });\n },\n isInvalidPath: (paramName = '', param) => {\n err.isUndefined(paramName, param);\n err.isNotType(paramName, param, 'string');\n err.isAnyOf(paramName, param, ['', '/']);\n '.$[]#'.split().forEach(invalidChar => {\n if (param.indexOf(invalidChar) > -1) err.throwError(err.getCaller(2), paramName, 'not to contain invalid character \\'' + invalidChar + '\\'');\n });\n if (param.match(/\\/{2,}/g)) err.throwError(err.getCaller(2), paramName, 'not to contain consecutive forward slash characters');\n },\n isInvalidWriteData: (paramName = '', param) => {\n err.isUndefined(paramName, param);\n err.containsUndefined(paramName, param);\n }\n};\nexport default err;","// Allows us to pass arrays and numbers instead of just strings to the format function.\nconst stringify = arg => Array.isArray(arg) ? arg.join(\", \") : typeof arg === \"string\" ? arg : \"\" + arg; // Replaces a string with the values of an object. Google \"format unicorn\" on an explanation of how to use.\n\n\nconst format = (str, args) => args ? Object.keys(args).reduce((str, arg) => str.replace(new RegExp(`\\\\{${arg}\\\\}`, 'gi'), stringify(args[arg])), str) : str;\n\nexport { format };","export default {\n format: \"{reason} at line {line}\",\n symbols: {\n colon: \"colon\",\n // :\n comma: \"comma\",\n // , ، 、\n semicolon: \"semicolon\",\n // ;\n slash: \"slash\",\n // / relevant for comment syntax support\n backslash: \"backslash\",\n // \\ relevant for escaping character\n brackets: {\n round: \"round brackets\",\n // ( )\n square: \"square brackets\",\n // [ ]\n curly: \"curly brackets\",\n // { }\n angle: \"angle brackets\" // < >\n\n },\n period: \"period\",\n // . Also known as full point, full stop, or dot\n quotes: {\n single: \"single quote\",\n // '\n double: \"double quote\",\n // \"\n grave: \"grave accent\" // ` used on Javascript ES6 Syntax for String Templates\n\n },\n space: \"space\",\n //    \n ampersand: \"ampersand\",\n //\t&\n asterisk: \"asterisk\",\n //\t* relevant for some comment sytanx\n at: \"at sign\",\n //\t@ multiple uses in other coding languages including certain data types\n equals: \"equals sign\",\n //\t=\n hash: \"hash\",\n //\t#\n percent: \"percent\",\n //\t%\n plus: \"plus\",\n //\t+\n minus: \"minus\",\n //\t−\n dash: \"dash\",\n //\t−\n hyphen: \"hyphen\",\n //\t−\n tilde: \"tilde\",\n //\t~\n underscore: \"underscore\",\n //\t_\n bar: \"vertical bar\" //\t|\n\n },\n types: {\n key: \"key\",\n value: \"value\",\n number: \"number\",\n string: \"string\",\n primitive: \"primitive\",\n boolean: \"boolean\",\n character: \"character\",\n integer: \"integer\",\n array: \"array\",\n float: \"float\" //... Reference: https://en.wikipedia.org/wiki/List_of_data_structures\n\n },\n invalidToken: {\n tokenSequence: {\n prohibited: \"'{firstToken}' token cannot be followed by '{secondToken}' token(s)\",\n permitted: \"'{firstToken}' token can only be followed by '{secondToken}' token(s)\"\n },\n termSequence: {\n prohibited: \"A {firstTerm} cannot be followed by a {secondTerm}\",\n permitted: \"A {firstTerm} can only be followed by a {secondTerm}\"\n },\n double: \"'{token}' token cannot be followed by another '{token}' token\",\n useInstead: \"'{badToken}' token is not accepted. Use '{goodToken}' instead\",\n unexpected: \"Unexpected '{token}' token found\"\n },\n brace: {\n curly: {\n missingOpen: \"Missing '{' open curly brace\",\n missingClose: \"Open '{' curly brace is missing closing '}' curly brace\",\n cannotWrap: \"'{token}' token cannot be wrapped in '{}' curly braces\"\n },\n square: {\n missingOpen: \"Missing '[' open square brace\",\n missingClose: \"Open '[' square brace is missing closing ']' square brace\",\n cannotWrap: \"'{token}' token cannot be wrapped in '[]' square braces\"\n }\n },\n string: {\n missingOpen: \"Missing/invalid opening string '{quote}' token\",\n missingClose: \"Missing/invalid closing string '{quote}' token\",\n mustBeWrappedByQuotes: \"Strings must be wrapped by quotes\",\n nonAlphanumeric: \"Non-alphanumeric token '{token}' is not allowed outside string notation\",\n unexpectedKey: \"Unexpected key found at string position\"\n },\n key: {\n numberAndLetterMissingQuotes: \"Key beginning with number and containing letters must be wrapped by quotes\",\n spaceMissingQuotes: \"Key containing space must be wrapped by quotes\",\n unexpectedString: \"Unexpected string found at key position\"\n },\n noTrailingOrLeadingComma: \"Trailing or leading commas in arrays and objects are not permitted\"\n};","/** @license react-json-editor-ajrm v2.5.14\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 */\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport React, { Component } from 'react';\nimport themes from './themes';\nimport { identical, getType } from './mitsuketa';\nimport err from './err';\nimport { format } from './locale';\nimport defaultLocale from './locale/en';\n\nclass JSONInput extends Component {\n constructor(props) {\n super(props);\n this.updateInternalProps = this.updateInternalProps.bind(this);\n this.createMarkup = this.createMarkup.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.update = this.update.bind(this);\n this.getCursorPosition = this.getCursorPosition.bind(this);\n this.setCursorPosition = this.setCursorPosition.bind(this);\n this.scheduledUpdate = this.scheduledUpdate.bind(this);\n this.setUpdateTime = this.setUpdateTime.bind(this);\n this.renderLabels = this.renderLabels.bind(this);\n this.newSpan = this.newSpan.bind(this);\n this.renderErrorMessage = this.renderErrorMessage.bind(this);\n this.onScroll = this.onScroll.bind(this);\n this.showPlaceholder = this.showPlaceholder.bind(this);\n this.tokenize = this.tokenize.bind(this);\n this.onKeyPress = this.onKeyPress.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onPaste = this.onPaste.bind(this);\n this.stopEvent = this.stopEvent.bind(this);\n this.refContent = null;\n this.refLabels = null;\n this.updateInternalProps();\n this.renderCount = 1;\n this.state = {\n prevPlaceholder: '',\n markupText: '',\n plainText: '',\n json: '',\n jsObject: undefined,\n lines: false,\n error: false\n };\n\n if (!this.props.locale) {\n console.warn(\"[react-json-editor-ajrm - Deprecation Warning] You did not provide a 'locale' prop for your JSON input - This will be required in a future version. English has been set as a default.\");\n }\n }\n\n updateInternalProps() {\n let colors = {},\n style = {},\n theme = themes.dark_vscode_tribute;\n if ('theme' in this.props) if (typeof this.props.theme === 'string') if (this.props.theme in themes) theme = themes[this.props.theme];\n colors = theme;\n if ('colors' in this.props) colors = {\n default: 'default' in this.props.colors ? this.props.colors.default : colors.default,\n string: 'string' in this.props.colors ? this.props.colors.string : colors.string,\n number: 'number' in this.props.colors ? this.props.colors.number : colors.number,\n colon: 'colon' in this.props.colors ? this.props.colors.colon : colors.colon,\n keys: 'keys' in this.props.colors ? this.props.colors.keys : colors.keys,\n keys_whiteSpace: 'keys_whiteSpace' in this.props.colors ? this.props.colors.keys_whiteSpace : colors.keys_whiteSpace,\n primitive: 'primitive' in this.props.colors ? this.props.colors.primitive : colors.primitive,\n error: 'error' in this.props.colors ? this.props.colors.error : colors.error,\n background: 'background' in this.props.colors ? this.props.colors.background : colors.background,\n background_warning: 'background_warning' in this.props.colors ? this.props.colors.background_warning : colors.background_warning\n };\n this.colors = colors;\n if ('style' in this.props) style = {\n outerBox: 'outerBox' in this.props.style ? this.props.style.outerBox : {},\n container: 'container' in this.props.style ? this.props.style.container : {},\n warningBox: 'warningBox' in this.props.style ? this.props.style.warningBox : {},\n errorMessage: 'errorMessage' in this.props.style ? this.props.style.errorMessage : {},\n body: 'body' in this.props.style ? this.props.style.body : {},\n labelColumn: 'labelColumn' in this.props.style ? this.props.style.labelColumn : {},\n labels: 'labels' in this.props.style ? this.props.style.labels : {},\n contentBox: 'contentBox' in this.props.style ? this.props.style.contentBox : {}\n };else style = {\n outerBox: {},\n container: {},\n warningBox: {},\n errorMessage: {},\n body: {},\n labelColumn: {},\n labels: {},\n contentBox: {}\n };\n this.style = style;\n this.confirmGood = 'confirmGood' in this.props ? this.props.confirmGood : true;\n const totalHeight = this.props.height || '610px',\n totalWidth = this.props.width || '479px';\n this.totalHeight = totalHeight;\n this.totalWidth = totalWidth;\n\n if (!('onKeyPressUpdate' in this.props) || this.props.onKeyPressUpdate) {\n if (!this.timer) this.timer = setInterval(this.scheduledUpdate, 100);\n } else if (this.timer) {\n clearInterval(this.timer);\n this.timer = false;\n }\n\n this.updateTime = false;\n this.waitAfterKeyPress = 'waitAfterKeyPress' in this.props ? this.props.waitAfterKeyPress : 1000;\n this.resetConfiguration = 'reset' in this.props ? this.props.reset : false;\n }\n\n render() {\n const id = this.props.id,\n markupText = this.state.markupText,\n error = this.props.error || this.state.error,\n colors = this.colors,\n style = this.style,\n confirmGood = this.confirmGood,\n totalHeight = this.totalHeight,\n totalWidth = this.totalWidth,\n hasError = !!this.props.error || (error ? 'token' in error : false);\n this.renderCount++;\n return React.createElement(\"div\", {\n name: \"outer-box\",\n id: id && id + '-outer-box',\n style: _objectSpread({\n display: 'block',\n overflow: 'none',\n height: totalHeight,\n width: totalWidth,\n margin: 0,\n boxSizing: 'border-box',\n position: 'relative'\n }, style.outerBox)\n }, confirmGood ? React.createElement(\"div\", {\n style: {\n opacity: hasError ? 0 : 1,\n height: '30px',\n width: '30px',\n position: 'absolute',\n top: 0,\n right: 0,\n transform: 'translate(-25%,25%)',\n pointerEvents: 'none',\n transitionDuration: '0.2s',\n transitionTimingFunction: 'cubic-bezier(0, 1, 0.5, 1)'\n }\n }, React.createElement(\"svg\", {\n height: \"30px\",\n width: \"30px\",\n viewBox: \"0 0 100 100\"\n }, React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n fill: \"green\",\n opacity: \"0.85\",\n d: \"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z\"\n }))) : void 0, React.createElement(\"div\", {\n name: \"container\",\n id: id && id + '-container',\n style: _objectSpread({\n display: 'block',\n height: totalHeight,\n width: totalWidth,\n margin: 0,\n boxSizing: 'border-box',\n overflow: 'hidden',\n fontFamily: 'Roboto, sans-serif'\n }, style.container),\n onClick: this.onClick\n }, React.createElement(\"div\", {\n name: \"warning-box\",\n id: id && id + '-warning-box',\n style: _objectSpread({\n display: 'block',\n overflow: 'hidden',\n height: hasError ? '60px' : '0px',\n width: '100%',\n margin: 0,\n backgroundColor: colors.background_warning,\n transitionDuration: '0.2s',\n transitionTimingFunction: 'cubic-bezier(0, 1, 0.5, 1)'\n }, style.warningBox),\n onClick: this.onClick\n }, React.createElement(\"span\", {\n style: {\n display: 'inline-block',\n height: '60px',\n width: '60px',\n margin: 0,\n boxSizing: 'border-box',\n overflow: 'hidden',\n verticalAlign: 'top',\n pointerEvents: 'none'\n },\n onClick: this.onClick\n }, React.createElement(\"div\", {\n style: {\n position: 'relative',\n top: 0,\n left: 0,\n height: '60px',\n width: '60px',\n margin: 0,\n pointerEvents: 'none'\n },\n onClick: this.onClick\n }, React.createElement(\"div\", {\n style: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n pointerEvents: 'none'\n },\n onClick: this.onClick\n }, React.createElement(\"svg\", {\n height: \"25px\",\n width: \"25px\",\n viewBox: \"0 0 100 100\"\n }, React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n fill: \"red\",\n d: \"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z\"\n }))))), React.createElement(\"span\", {\n style: {\n display: 'inline-block',\n height: '60px',\n width: 'calc(100% - 60px)',\n margin: 0,\n overflow: 'hidden',\n verticalAlign: 'top',\n position: 'absolute',\n pointerEvents: 'none'\n },\n onClick: this.onClick\n }, this.renderErrorMessage())), React.createElement(\"div\", {\n name: \"body\",\n id: id && id + '-body',\n style: _objectSpread({\n display: 'flex',\n overflow: 'none',\n height: hasError ? 'calc(100% - 60px)' : '100%',\n width: '',\n margin: 0,\n resize: 'none',\n fontFamily: 'Roboto Mono, Monaco, monospace',\n fontSize: '11px',\n backgroundColor: colors.background,\n transitionDuration: '0.2s',\n transitionTimingFunction: 'cubic-bezier(0, 1, 0.5, 1)'\n }, style.body),\n onClick: this.onClick\n }, React.createElement(\"span\", {\n name: \"labels\",\n id: id && id + '-labels',\n ref: ref => this.refLabels = ref,\n style: _objectSpread({\n display: 'inline-block',\n boxSizing: 'border-box',\n verticalAlign: 'top',\n height: '100%',\n width: '44px',\n margin: 0,\n padding: '5px 0px 5px 10px',\n overflow: 'hidden',\n color: '#D4D4D4'\n }, style.labelColumn),\n onClick: this.onClick\n }, this.renderLabels()), React.createElement(\"span\", {\n id: id,\n ref: ref => this.refContent = ref,\n contentEditable: true,\n style: _objectSpread({\n display: 'inline-block',\n boxSizing: 'border-box',\n verticalAlign: 'top',\n height: '100%',\n width: '',\n flex: 1,\n margin: 0,\n padding: '5px',\n overflowX: 'hidden',\n overflowY: 'auto',\n wordWrap: 'break-word',\n whiteSpace: 'pre-line',\n color: '#D4D4D4',\n outline: 'none'\n }, style.contentBox),\n dangerouslySetInnerHTML: this.createMarkup(markupText),\n onKeyPress: this.onKeyPress,\n onKeyDown: this.onKeyDown,\n onClick: this.onClick,\n onBlur: this.onBlur,\n onScroll: this.onScroll,\n onPaste: this.onPaste,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n autoCapitalize: \"off\",\n spellCheck: false\n }))));\n }\n\n renderErrorMessage() {\n const locale = this.props.locale || defaultLocale,\n error = this.props.error || this.state.error,\n style = this.style;\n if (!error) return void 0;\n return React.createElement(\"p\", {\n style: _objectSpread({\n color: 'red',\n fontSize: '12px',\n position: 'absolute',\n width: 'calc(100% - 60px)',\n height: '60px',\n boxSizing: 'border-box',\n margin: 0,\n padding: 0,\n paddingRight: '10px',\n overflowWrap: 'break-word',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center'\n }, style.errorMessage)\n }, format(locale.format, error));\n }\n\n renderLabels() {\n const colors = this.colors,\n style = this.style,\n error = this.props.error || this.state.error,\n errorLine = error ? error.line : -1,\n lines = this.state.lines ? this.state.lines : 1;\n let labels = new Array(lines);\n\n for (var i = 0; i < lines - 1; i++) labels[i] = i + 1;\n\n return labels.map(number => {\n const color = number !== errorLine ? colors.default : 'red';\n return React.createElement(\"div\", {\n key: number,\n style: _objectSpread({}, style.labels, {\n color: color\n })\n }, number);\n });\n }\n\n createMarkup(markupText) {\n if (markupText === undefined) return {\n __html: ''\n };\n return {\n __html: '' + markupText\n };\n }\n\n newSpan(i, token, depth) {\n let colors = this.colors,\n type = token.type,\n string = token.string;\n let color = '';\n\n switch (type) {\n case 'string':\n case 'number':\n case 'primitive':\n case 'error':\n color = colors[token.type];\n break;\n\n case 'key':\n if (string === ' ') color = colors.keys_whiteSpace;else color = colors.keys;\n break;\n\n case 'symbol':\n if (string === ':') color = colors.colon;else color = colors.default;\n break;\n\n default:\n color = colors.default;\n break;\n }\n\n if (string.length !== string.replace(//g, '').length) string = '' + string + '';\n return '' + string + '';\n }\n\n getCursorPosition(countBR) {\n /**\r\n * Need to deprecate countBR\r\n * It is used to differenciate between good markup render, and aux render when error found\r\n * Adjustments based on coundBR account for usage of
instead of for linebreaks to determine acurate cursor position\r\n * Find a way to consolidate render styles\r\n */\n const isChildOf = node => {\n while (node !== null) {\n if (node === this.refContent) return true;\n node = node.parentNode;\n }\n\n return false;\n };\n\n let selection = window.getSelection(),\n charCount = -1,\n linebreakCount = 0,\n node;\n\n if (selection.focusNode && isChildOf(selection.focusNode)) {\n node = selection.focusNode;\n charCount = selection.focusOffset;\n\n while (node) {\n if (node === this.refContent) break;\n\n if (node.previousSibling) {\n node = node.previousSibling;\n if (countBR) if (node.nodeName === 'BR') linebreakCount++;\n charCount += node.textContent.length;\n } else {\n node = node.parentNode;\n if (node === null) break;\n }\n }\n }\n\n return charCount + linebreakCount;\n }\n\n setCursorPosition(nextPosition) {\n if ([false, null, undefined].indexOf(nextPosition) > -1) return;\n\n const createRange = (node, chars, range) => {\n if (!range) {\n range = document.createRange();\n range.selectNode(node);\n range.setStart(node, 0);\n }\n\n if (chars.count === 0) {\n range.setEnd(node, chars.count);\n } else if (node && chars.count > 0) {\n if (node.nodeType === Node.TEXT_NODE) {\n if (node.textContent.length < chars.count) chars.count -= node.textContent.length;else {\n range.setEnd(node, chars.count);\n chars.count = 0;\n }\n } else for (var lp = 0; lp < node.childNodes.length; lp++) {\n range = createRange(node.childNodes[lp], chars, range);\n if (chars.count === 0) break;\n }\n }\n\n return range;\n };\n\n const setPosition = chars => {\n if (chars < 0) return;\n let selection = window.getSelection(),\n range = createRange(this.refContent, {\n count: chars\n });\n if (!range) return;\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n };\n\n if (nextPosition > 0) setPosition(nextPosition);else this.refContent.focus();\n }\n\n update(cursorOffset = 0, updateCursorPosition = true) {\n const container = this.refContent,\n data = this.tokenize(container);\n if ('onChange' in this.props) this.props.onChange({\n plainText: data.indented,\n markupText: data.markup,\n json: data.json,\n jsObject: data.jsObject,\n lines: data.lines,\n error: data.error\n });\n let cursorPosition = this.getCursorPosition(data.error) + cursorOffset;\n this.setState({\n plainText: data.indented,\n markupText: data.markup,\n json: data.json,\n jsObject: data.jsObject,\n lines: data.lines,\n error: data.error\n });\n this.updateTime = false;\n if (updateCursorPosition) this.setCursorPosition(cursorPosition);\n }\n\n scheduledUpdate() {\n if ('onKeyPressUpdate' in this.props) if (this.props.onKeyPressUpdate === false) return;\n const {\n updateTime\n } = this;\n if (updateTime === false) return;\n if (updateTime > new Date().getTime()) return;\n this.update();\n }\n\n setUpdateTime() {\n if ('onKeyPressUpdate' in this.props) if (this.props.onKeyPressUpdate === false) return;\n this.updateTime = new Date().getTime() + this.waitAfterKeyPress;\n }\n\n stopEvent(event) {\n if (!event) return;\n event.preventDefault();\n event.stopPropagation();\n }\n\n onKeyPress(event) {\n const ctrlOrMetaIsPressed = event.ctrlKey || event.metaKey;\n if (this.props.viewOnly && !ctrlOrMetaIsPressed) this.stopEvent(event);\n if (!ctrlOrMetaIsPressed) this.setUpdateTime();\n }\n\n onKeyDown(event) {\n const viewOnly = !!this.props.viewOnly;\n const ctrlOrMetaIsPressed = event.ctrlKey || event.metaKey;\n\n switch (event.key) {\n case 'Tab':\n this.stopEvent(event);\n if (viewOnly) break;\n document.execCommand(\"insertText\", false, \" \");\n this.setUpdateTime();\n break;\n\n case 'Backspace':\n case 'Delete':\n if (viewOnly) this.stopEvent(event);\n this.setUpdateTime();\n break;\n\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'ArrowUp':\n case 'ArrowDown':\n this.setUpdateTime();\n break;\n\n case 'a':\n case 'c':\n if (viewOnly && !ctrlOrMetaIsPressed) this.stopEvent(event);\n break;\n\n default:\n if (viewOnly) this.stopEvent(event);\n break;\n }\n }\n\n onPaste(event) {\n if (this.props.viewOnly) {\n this.stopEvent(event);\n } else {\n event.preventDefault();\n var text = event.clipboardData.getData('text/plain');\n document.execCommand('insertText', false, text);\n }\n\n this.update();\n }\n\n onClick() {\n if ('viewOnly' in this.props) if (this.props.viewOnly) return;\n }\n\n onBlur() {\n if ('viewOnly' in this.props) if (this.props.viewOnly) return;\n const container = this.refContent,\n data = this.tokenize(container);\n if ('onBlur' in this.props) this.props.onBlur({\n plainText: data.indented,\n markupText: data.markup,\n json: data.json,\n jsObject: data.jsObject,\n lines: data.lines,\n error: data.error\n });\n }\n\n onScroll(event) {\n this.refLabels.scrollTop = event.target.scrollTop;\n }\n\n componentDidUpdate() {\n this.updateInternalProps();\n this.showPlaceholder();\n }\n\n componentDidMount() {\n this.showPlaceholder();\n }\n\n componentWillUnmount() {\n if (this.timer) clearInterval(this.timer);\n }\n\n showPlaceholder() {\n const placeholderDoesNotExist = !('placeholder' in this.props);\n if (placeholderDoesNotExist) return;\n const {\n placeholder\n } = this.props;\n const placeholderHasEmptyValues = [undefined, null].indexOf(placeholder) > -1;\n if (placeholderHasEmptyValues) return;\n const {\n prevPlaceholder,\n jsObject\n } = this.state;\n const {\n resetConfiguration\n } = this;\n const placeholderDataType = getType(placeholder);\n const unexpectedDataType = ['object', 'array'].indexOf(placeholderDataType) === -1;\n if (unexpectedDataType) err.throwError('showPlaceholder', 'placeholder', 'either an object or an array');\n const samePlaceholderValues = identical(placeholder, prevPlaceholder); // Component will always re-render when new placeholder value is any different from previous placeholder value.\n\n let componentShouldUpdate = !samePlaceholderValues;\n\n if (!componentShouldUpdate) {\n if (resetConfiguration) {\n /**\r\n * If 'reset' property is set true or is truthy,\r\n * any difference between placeholder and current value\r\n * should trigger component re-render\r\n */\n if (jsObject !== undefined) componentShouldUpdate = !identical(placeholder, jsObject);\n }\n }\n\n if (!componentShouldUpdate) return;\n const data = this.tokenize(placeholder);\n this.setState({\n prevPlaceholder: placeholder,\n plainText: data.indentation,\n markupText: data.markup,\n lines: data.lines,\n error: data.error\n });\n }\n\n tokenize(something) {\n if (typeof something !== 'object') return console.error('tokenize() expects object type properties only. Got \\'' + typeof something + '\\' type instead.');\n const locale = this.props.locale || defaultLocale;\n const newSpan = this.newSpan;\n /**\r\n * DOM NODE || ONBLUR OR UPDATE\r\n */\n\n if ('nodeType' in something) {\n const containerNode = something.cloneNode(true),\n hasChildren = containerNode.hasChildNodes();\n if (!hasChildren) return '';\n const children = containerNode.childNodes;\n let buffer = {\n tokens_unknown: [],\n tokens_proto: [],\n tokens_split: [],\n tokens_fallback: [],\n tokens_normalize: [],\n tokens_merge: [],\n tokens_plainText: '',\n indented: '',\n json: '',\n jsObject: undefined,\n markup: ''\n };\n\n for (var i = 0; i < children.length; i++) {\n let child = children[i];\n let info = {};\n\n switch (child.nodeName) {\n case 'SPAN':\n info = {\n string: child.textContent,\n type: child.attributes.type.textContent\n };\n buffer.tokens_unknown.push(info);\n break;\n\n case 'DIV':\n buffer.tokens_unknown.push({\n string: child.textContent,\n type: 'unknown'\n });\n break;\n\n case 'BR':\n if (child.textContent === '') buffer.tokens_unknown.push({\n string: '\\n',\n type: 'unknown'\n });\n break;\n\n case '#text':\n buffer.tokens_unknown.push({\n string: child.wholeText,\n type: 'unknown'\n });\n break;\n\n case 'FONT':\n buffer.tokens_unknown.push({\n string: child.textContent,\n type: 'unknown'\n });\n break;\n\n default:\n console.error('Unrecognized node:', {\n child\n });\n break;\n }\n }\n\n function quarkize(text, prefix = '') {\n let buffer = {\n active: false,\n string: '',\n number: '',\n symbol: '',\n space: '',\n delimiter: '',\n quarks: []\n };\n\n function pushAndStore(char, type) {\n switch (type) {\n case 'symbol':\n case 'delimiter':\n if (buffer.active) buffer.quarks.push({\n string: buffer[buffer.active],\n type: prefix + '-' + buffer.active\n });\n buffer[buffer.active] = '';\n buffer.active = type;\n buffer[buffer.active] = char;\n break;\n\n default:\n if (type !== buffer.active || [buffer.string, char].indexOf('\\n') > -1) {\n if (buffer.active) buffer.quarks.push({\n string: buffer[buffer.active],\n type: prefix + '-' + buffer.active\n });\n buffer[buffer.active] = '';\n buffer.active = type;\n buffer[buffer.active] = char;\n } else buffer[type] += char;\n\n break;\n }\n }\n\n function finalPush() {\n if (buffer.active) {\n buffer.quarks.push({\n string: buffer[buffer.active],\n type: prefix + '-' + buffer.active\n });\n buffer[buffer.active] = '';\n buffer.active = false;\n }\n }\n\n for (var i = 0; i < text.length; i++) {\n const char = text.charAt(i);\n\n switch (char) {\n case '\"':\n case \"'\":\n pushAndStore(char, 'delimiter');\n break;\n\n case ' ':\n case '\\u00A0':\n pushAndStore(char, 'space');\n break;\n\n case '{':\n case '}':\n case '[':\n case ']':\n case ':':\n case ',':\n pushAndStore(char, 'symbol');\n break;\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n if (buffer.active === 'string') pushAndStore(char, 'string');else pushAndStore(char, 'number');\n break;\n\n case '-':\n if (i < text.length - 1) if ('0123456789'.indexOf(text.charAt(i + 1)) > -1) {\n pushAndStore(char, 'number');\n break;\n }\n\n case '.':\n if (i < text.length - 1 && i > 0) if ('0123456789'.indexOf(text.charAt(i + 1)) > -1 && '0123456789'.indexOf(text.charAt(i - 1)) > -1) {\n pushAndStore(char, 'number');\n break;\n }\n\n default:\n pushAndStore(char, 'string');\n break;\n }\n }\n\n finalPush();\n return buffer.quarks;\n }\n\n for (var i = 0; i < buffer.tokens_unknown.length; i++) {\n let token = buffer.tokens_unknown[i];\n buffer.tokens_proto = buffer.tokens_proto.concat(quarkize(token.string, 'proto'));\n }\n\n function validToken(string, type) {\n const quotes = '\\'\"';\n let firstChar = '',\n lastChar = '',\n quoteType = false;\n\n switch (type) {\n case 'primitive':\n if (['true', 'false', 'null', 'undefined'].indexOf(string) === -1) return false;\n break;\n\n case 'string':\n if (string.length < 2) return false;\n firstChar = string.charAt(0), lastChar = string.charAt(string.length - 1), quoteType = quotes.indexOf(firstChar);\n if (quoteType === -1) return false;\n if (firstChar !== lastChar) return false;\n\n for (var i = 0; i < string.length; i++) {\n if (i > 0 && i < string.length - 1) if (string.charAt(i) === quotes[quoteType]) if (string.charAt(i - 1) !== '\\\\') return false;\n }\n\n break;\n\n case 'key':\n if (string.length === 0) return false;\n firstChar = string.charAt(0), lastChar = string.charAt(string.length - 1), quoteType = quotes.indexOf(firstChar);\n\n if (quoteType > -1) {\n if (string.length === 1) return false;\n if (firstChar !== lastChar) return false;\n\n for (var i = 0; i < string.length; i++) {\n if (i > 0 && i < string.length - 1) if (string.charAt(i) === quotes[quoteType]) if (string.charAt(i - 1) !== '\\\\') return false;\n }\n } else {\n const nonAlphanumeric = '\\'\"`.,:;{}[]&<>=~*%\\\\|/-+!?@^ \\xa0';\n\n for (var i = 0; i < nonAlphanumeric.length; i++) {\n const nonAlpha = nonAlphanumeric.charAt(i);\n if (string.indexOf(nonAlpha) > -1) return false;\n }\n }\n\n break;\n\n case 'number':\n for (var i = 0; i < string.length; i++) {\n if ('0123456789'.indexOf(string.charAt(i)) === -1) if (i === 0) {\n if ('-' !== string.charAt(0)) return false;\n } else if ('.' !== string.charAt(i)) return false;\n }\n\n break;\n\n case 'symbol':\n if (string.length > 1) return false;\n if ('{[:]},'.indexOf(string) === -1) return false;\n break;\n\n case 'colon':\n if (string.length > 1) return false;\n if (':' !== string) return false;\n break;\n\n default:\n return true;\n break;\n }\n\n return true;\n }\n\n for (var i = 0; i < buffer.tokens_proto.length; i++) {\n let token = buffer.tokens_proto[i];\n\n if (token.type.indexOf('proto') === -1) {\n if (!validToken(token.string, token.type)) {\n buffer.tokens_split = buffer.tokens_split.concat(quarkize(token.string, 'split'));\n } else buffer.tokens_split.push(token);\n } else buffer.tokens_split.push(token);\n }\n\n for (var i = 0; i < buffer.tokens_split.length; i++) {\n let token = buffer.tokens_split[i];\n let type = token.type,\n string = token.string,\n length = string.length,\n fallback = [];\n\n if (type.indexOf('-') > -1) {\n type = type.slice(type.indexOf('-') + 1);\n if (type !== 'string') fallback.push('string');\n fallback.push('key');\n fallback.push('error');\n }\n\n let tokul = {\n string: string,\n length: length,\n type: type,\n fallback: fallback\n };\n buffer.tokens_fallback.push(tokul);\n }\n\n function tokenFollowed() {\n const last = buffer.tokens_normalize.length - 1;\n if (last < 1) return false;\n\n for (var i = last; i >= 0; i--) {\n const previousToken = buffer.tokens_normalize[i];\n\n switch (previousToken.type) {\n case 'space':\n case 'linebreak':\n break;\n\n default:\n return previousToken;\n break;\n }\n }\n\n return false;\n }\n\n let buffer2 = {\n brackets: [],\n stringOpen: false,\n isValue: false\n };\n\n for (var i = 0; i < buffer.tokens_fallback.length; i++) {\n let token = buffer.tokens_fallback[i];\n const type = token.type,\n string = token.string;\n let normalToken = {\n type: type,\n string: string\n };\n\n switch (type) {\n case 'symbol':\n case 'colon':\n if (buffer2.stringOpen) {\n if (buffer2.isValue) normalToken.type = 'string';else normalToken.type = 'key';\n break;\n }\n\n switch (string) {\n case '[':\n case '{':\n buffer2.brackets.push(string);\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case ']':\n case '}':\n buffer2.brackets.pop();\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case ',':\n if (tokenFollowed().type === 'colon') break;\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case ':':\n normalToken.type = 'colon';\n buffer2.isValue = true;\n break;\n }\n\n break;\n\n case 'delimiter':\n if (buffer2.isValue) normalToken.type = 'string';else normalToken.type = 'key';\n\n if (!buffer2.stringOpen) {\n buffer2.stringOpen = string;\n break;\n }\n\n if (i > 0) {\n const previousToken = buffer.tokens_fallback[i - 1],\n _string = previousToken.string,\n _type = previousToken.type,\n _char = _string.charAt(_string.length - 1);\n\n if (_type === 'string' && _char === '\\\\') break;\n }\n\n if (buffer2.stringOpen === string) {\n buffer2.stringOpen = false;\n break;\n }\n\n break;\n\n case 'primitive':\n case 'string':\n if (['false', 'true', 'null', 'undefined'].indexOf(string) > -1) {\n const lastIndex = buffer.tokens_normalize.length - 1;\n\n if (lastIndex >= 0) {\n if (buffer.tokens_normalize[lastIndex].type !== 'string') {\n normalToken.type = 'primitive';\n break;\n }\n\n normalToken.type = 'string';\n break;\n }\n\n normalToken.type = 'primitive';\n break;\n }\n\n if (string === '\\n') if (!buffer2.stringOpen) {\n normalToken.type = 'linebreak';\n break;\n }\n if (buffer2.isValue) normalToken.type = 'string';else normalToken.type = 'key';\n break;\n\n case 'space':\n if (buffer2.stringOpen) if (buffer2.isValue) normalToken.type = 'string';else normalToken.type = 'key';\n break;\n\n case 'number':\n if (buffer2.stringOpen) if (buffer2.isValue) normalToken.type = 'string';else normalToken.type = 'key';\n break;\n\n default:\n break;\n }\n\n buffer.tokens_normalize.push(normalToken);\n }\n\n for (var i = 0; i < buffer.tokens_normalize.length; i++) {\n const token = buffer.tokens_normalize[i];\n let mergedToken = {\n string: token.string,\n type: token.type,\n tokens: [i]\n };\n if (['symbol', 'colon'].indexOf(token.type) === -1) if (i + 1 < buffer.tokens_normalize.length) {\n let count = 0;\n\n for (var u = i + 1; u < buffer.tokens_normalize.length; u++) {\n const nextToken = buffer.tokens_normalize[u];\n if (token.type !== nextToken.type) break;\n mergedToken.string += nextToken.string;\n mergedToken.tokens.push(u);\n count++;\n }\n\n i += count;\n }\n buffer.tokens_merge.push(mergedToken);\n }\n\n const quotes = '\\'\"',\n alphanumeric = 'abcdefghijklmnopqrstuvwxyz' + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + '0123456789' + '_$';\n var error = false,\n line = buffer.tokens_merge.length > 0 ? 1 : 0;\n buffer2 = {\n brackets: [],\n stringOpen: false,\n isValue: false\n };\n\n function setError(tokenID, reason, offset = 0) {\n error = {\n token: tokenID,\n line: line,\n reason: reason\n };\n buffer.tokens_merge[tokenID + offset].type = 'error';\n }\n\n function followedBySymbol(tokenID, options) {\n if (tokenID === undefined) console.error('tokenID argument must be an integer.');\n if (options === undefined) console.error('options argument must be an array.');\n if (tokenID === buffer.tokens_merge.length - 1) return false;\n\n for (var i = tokenID + 1; i < buffer.tokens_merge.length; i++) {\n const nextToken = buffer.tokens_merge[i];\n\n switch (nextToken.type) {\n case 'space':\n case 'linebreak':\n break;\n\n case 'symbol':\n case 'colon':\n if (options.indexOf(nextToken.string) > -1) return i;else return false;\n break;\n\n default:\n return false;\n break;\n }\n }\n\n return false;\n }\n\n function followsSymbol(tokenID, options) {\n if (tokenID === undefined) console.error('tokenID argument must be an integer.');\n if (options === undefined) console.error('options argument must be an array.');\n if (tokenID === 0) return false;\n\n for (var i = tokenID - 1; i >= 0; i--) {\n const previousToken = buffer.tokens_merge[i];\n\n switch (previousToken.type) {\n case 'space':\n case 'linebreak':\n break;\n\n case 'symbol':\n case 'colon':\n if (options.indexOf(previousToken.string) > -1) return true;\n return false;\n break;\n\n default:\n return false;\n break;\n }\n }\n\n return false;\n }\n\n function typeFollowed(tokenID) {\n if (tokenID === undefined) console.error('tokenID argument must be an integer.');\n if (tokenID === 0) return false;\n\n for (var i = tokenID - 1; i >= 0; i--) {\n const previousToken = buffer.tokens_merge[i];\n\n switch (previousToken.type) {\n case 'space':\n case 'linebreak':\n break;\n\n default:\n return previousToken.type;\n break;\n }\n }\n\n return false;\n }\n\n let bracketList = [];\n\n for (var i = 0; i < buffer.tokens_merge.length; i++) {\n if (error) break;\n let token = buffer.tokens_merge[i],\n string = token.string,\n type = token.type,\n found = false;\n\n switch (type) {\n case 'space':\n break;\n\n case 'linebreak':\n line++;\n break;\n\n case 'symbol':\n switch (string) {\n case '{':\n case '[':\n found = followsSymbol(i, ['}', ']']);\n\n if (found) {\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: buffer.tokens_merge[found].string,\n secondToken: string\n }));\n break;\n }\n\n if (string === '[' && i > 0) if (!followsSymbol(i, [':', '[', ','])) {\n setError(i, format(locale.invalidToken.tokenSequence.permitted, {\n firstToken: \"[\",\n secondToken: [\":\", \"[\", \",\"]\n }));\n break;\n }\n if (string === '{') if (followsSymbol(i, ['{'])) {\n setError(i, format(locale.invalidToken.double, {\n token: \"{\"\n }));\n break;\n }\n buffer2.brackets.push(string);\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n bracketList.push({\n i: i,\n line: line,\n string: string\n });\n break;\n\n case '}':\n case ']':\n if (string === '}') if (buffer2.brackets[buffer2.brackets.length - 1] !== '{') {\n setError(i, format(locale.brace.curly.missingOpen));\n break;\n }\n if (string === '}') if (followsSymbol(i, [','])) {\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: \",\",\n secondToken: \"}\"\n }));\n break;\n }\n if (string === ']') if (buffer2.brackets[buffer2.brackets.length - 1] !== '[') {\n setError(i, format(locale.brace.square.missingOpen));\n break;\n }\n if (string === ']') if (followsSymbol(i, [':'])) {\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: \":\",\n secondToken: \"]\"\n }));\n break;\n }\n buffer2.brackets.pop();\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n bracketList.push({\n i: i,\n line: line,\n string: string\n });\n break;\n\n case ',':\n found = followsSymbol(i, ['{']);\n\n if (found) {\n if (followedBySymbol(i, ['}'])) {\n setError(i, format(locale.brace.curly.cannotWrap, {\n token: \",\"\n }));\n break;\n }\n\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: \"{\",\n secondToken: \",\"\n }));\n break;\n }\n\n if (followedBySymbol(i, ['}', ',', ']'])) {\n setError(i, format(locale.noTrailingOrLeadingComma));\n break;\n }\n\n found = typeFollowed(i);\n\n switch (found) {\n case 'key':\n case 'colon':\n setError(i, format(locale.invalidToken.termSequence.prohibited, {\n firstTerm: found === 'key' ? locale.types.key : locale.symbols.colon,\n secondTerm: locale.symbols.comma\n }));\n break;\n\n case 'symbol':\n if (followsSymbol(i, ['{'])) {\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: \"{\",\n secondToken: \",\"\n }));\n break;\n }\n\n break;\n\n default:\n break;\n }\n\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n default:\n break;\n }\n\n buffer.json += string;\n break;\n\n case 'colon':\n found = followsSymbol(i, ['[']);\n\n if (found && followedBySymbol(i, [']'])) {\n setError(i, format(locale.brace.square.cannotWrap, {\n token: \":\"\n }));\n break;\n }\n\n if (found) {\n setError(i, format(locale.invalidToken.tokenSequence.prohibited, {\n firstToken: \"[\",\n secondToken: \":\"\n }));\n break;\n }\n\n if (typeFollowed(i) !== 'key') {\n setError(i, format(locale.invalidToken.termSequence.permitted, {\n firstTerm: locale.symbols.colon,\n secondTerm: locale.types.key\n }));\n break;\n }\n\n if (followedBySymbol(i, ['}', ']'])) {\n setError(i, format(locale.invalidToken.termSequence.permitted, {\n firstTerm: locale.symbols.colon,\n secondTerm: locale.types.value\n }));\n break;\n }\n\n buffer2.isValue = true;\n buffer.json += string;\n break;\n\n case 'key':\n case 'string':\n let firstChar = string.charAt(0),\n lastChar = string.charAt(string.length - 1),\n quote_primary = quotes.indexOf(firstChar);\n if (quotes.indexOf(firstChar) === -1) if (quotes.indexOf(lastChar) !== -1) {\n setError(i, format(locale.string.missingOpen, {\n quote: firstChar\n }));\n break;\n }\n if (quotes.indexOf(lastChar) === -1) if (quotes.indexOf(firstChar) !== -1) {\n setError(i, format(locale.string.missingClose, {\n quote: firstChar\n }));\n break;\n }\n if (quotes.indexOf(firstChar) > -1) if (firstChar !== lastChar) {\n setError(i, format(locale.string.missingClose, {\n quote: firstChar\n }));\n break;\n }\n if ('string' === type) if (quotes.indexOf(firstChar) === -1 && quotes.indexOf(lastChar) === -1) {\n setError(i, format(locale.string.mustBeWrappedByQuotes));\n break;\n }\n if ('key' === type) if (followedBySymbol(i, ['}', ']'])) {\n setError(i, format(locale.invalidToken.termSequence.permitted, {\n firstTerm: locale.types.key,\n secondTerm: locale.symbols.colon\n }));\n }\n if (quotes.indexOf(firstChar) === -1 && quotes.indexOf(lastChar) === -1) for (var h = 0; h < string.length; h++) {\n if (error) break;\n const c = string.charAt(h);\n\n if (alphanumeric.indexOf(c) === -1) {\n setError(i, format(locale.string.nonAlphanumeric, {\n token: c\n }));\n break;\n }\n }\n if (firstChar === \"'\") string = '\"' + string.slice(1, -1) + '\"';else if (firstChar !== '\"') string = '\"' + string + '\"';\n if ('key' === type) if ('key' === typeFollowed(i)) {\n if (i > 0) if (!isNaN(buffer.tokens_merge[i - 1])) {\n buffer.tokens_merge[i - 1] += buffer.tokens_merge[i];\n setError(i, format(locale.key.numberAndLetterMissingQuotes));\n break;\n }\n setError(i, format(locale.key.spaceMissingQuotes));\n break;\n }\n if ('key' === type) if (!followsSymbol(i, ['{', ','])) {\n setError(i, format(locale.invalidToken.tokenSequence.permitted, {\n firstToken: type,\n secondToken: [\"{\", \",\"]\n }));\n break;\n }\n if ('string' === type) if (!followsSymbol(i, ['[', ':', ','])) {\n setError(i, format(locale.invalidToken.tokenSequence.permitted, {\n firstToken: type,\n secondToken: [\"[\", \":\", \",\"]\n }));\n break;\n }\n if ('key' === type) if (buffer2.isValue) {\n setError(i, format(locale.string.unexpectedKey));\n break;\n }\n if ('string' === type) if (!buffer2.isValue) {\n setError(i, format(locale.key.unexpectedString));\n break;\n }\n buffer.json += string;\n break;\n\n case 'number':\n case 'primitive':\n if (followsSymbol(i, ['{'])) {\n buffer.tokens_merge[i].type = 'key';\n type = buffer.tokens_merge[i].type;\n string = '\"' + string + '\"';\n } else if (typeFollowed(i) === 'key') {\n buffer.tokens_merge[i].type = 'key';\n type = buffer.tokens_merge[i].type;\n } else if (!followsSymbol(i, ['[', ':', ','])) {\n setError(i, format(locale.invalidToken.tokenSequence.permitted, {\n firstToken: type,\n secondToken: [\"[\", \":\", \",\"]\n }));\n break;\n }\n\n if (type !== 'key') if (!buffer2.isValue) {\n buffer.tokens_merge[i].type = 'key';\n type = buffer.tokens_merge[i].type;\n string = '\"' + string + '\"';\n }\n if (type === 'primitive') if (string === 'undefined') setError(i, format(locale.invalidToken.useInstead, {\n badToken: \"undefined\",\n goodToken: \"null\"\n }));\n buffer.json += string;\n break;\n }\n }\n\n let noEscapedSingleQuote = '';\n\n for (var i = 0; i < buffer.json.length; i++) {\n let current = buffer.json.charAt(i),\n next = '';\n\n if (i + 1 < buffer.json.length) {\n next = buffer.json.charAt(i + 1);\n\n if (current === '\\\\' && next === \"'\") {\n noEscapedSingleQuote += next;\n i++;\n continue;\n }\n }\n\n noEscapedSingleQuote += current;\n }\n\n buffer.json = noEscapedSingleQuote;\n\n if (!error) {\n const maxIterations = Math.ceil(bracketList.length / 2);\n let round = 0,\n delta = false;\n\n function removePair(index) {\n bracketList.splice(index + 1, 1);\n bracketList.splice(index, 1);\n if (!delta) delta = true;\n }\n\n while (bracketList.length > 0) {\n delta = false;\n\n for (var tokenCount = 0; tokenCount < bracketList.length - 1; tokenCount++) {\n const pair = bracketList[tokenCount].string + bracketList[tokenCount + 1].string;\n if (['[]', '{}'].indexOf(pair) > -1) removePair(tokenCount);\n }\n\n round++;\n if (!delta) break;\n if (round >= maxIterations) break;\n }\n\n if (bracketList.length > 0) {\n const _tokenString = bracketList[0].string,\n _tokenPosition = bracketList[0].i,\n _closingBracketType = _tokenString === '[' ? ']' : '}';\n\n line = bracketList[0].line;\n setError(_tokenPosition, format(locale.brace[_closingBracketType === ']' ? 'square' : 'curly'].missingClose));\n }\n }\n\n if (!error) if ([undefined, ''].indexOf(buffer.json) === -1) try {\n buffer.jsObject = JSON.parse(buffer.json);\n } catch (err) {\n const errorMessage = err.message,\n subsMark = errorMessage.indexOf('position');\n if (subsMark === -1) throw new Error('Error parsing failed');\n const errPositionStr = errorMessage.substring(subsMark + 9, errorMessage.length),\n errPosition = parseInt(errPositionStr);\n let charTotal = 0,\n tokenIndex = 0,\n token = false,\n _line = 1,\n exitWhile = false;\n\n while (charTotal < errPosition && !exitWhile) {\n token = buffer.tokens_merge[tokenIndex];\n if ('linebreak' === token.type) _line++;\n if (['space', 'linebreak'].indexOf(token.type) === -1) charTotal += token.string.length;\n if (charTotal >= errPosition) break;\n tokenIndex++;\n if (!buffer.tokens_merge[tokenIndex + 1]) exitWhile = true;\n }\n\n line = _line;\n let backslashCount = 0;\n\n for (let i = 0; i < token.string.length; i++) {\n const char = token.string.charAt(i);\n if (char === '\\\\') backslashCount = backslashCount > 0 ? backslashCount + 1 : 1;else {\n if (backslashCount % 2 !== 0 || backslashCount === 0) if ('\\'\"bfnrt'.indexOf(char) === -1) {\n setError(tokenIndex, format(locale.invalidToken.unexpected, {\n token: '\\\\'\n }));\n }\n backslashCount = 0;\n }\n }\n\n if (!error) setError(tokenIndex, format(locale.invalidToken.unexpected, {\n token: token.string\n }));\n }\n let _line = 1,\n _depth = 0;\n\n function newIndent() {\n var space = [];\n\n for (var i = 0; i < _depth * 2; i++) space.push(' ');\n\n return space.join('');\n }\n\n function newLineBreak(byPass = false) {\n _line++;\n\n if (_depth > 0 || byPass) {\n return '
';\n }\n\n return '';\n }\n\n function newLineBreakAndIndent(byPass = false) {\n return newLineBreak(byPass) + newIndent();\n }\n\n ;\n if (!error) for (var i = 0; i < buffer.tokens_merge.length; i++) {\n const token = buffer.tokens_merge[i],\n string = token.string,\n type = token.type;\n\n switch (type) {\n case 'space':\n case 'linebreak':\n break;\n\n case 'string':\n case 'number':\n case 'primitive':\n case 'error':\n buffer.markup += (followsSymbol(i, [',', '[']) ? newLineBreakAndIndent() : '') + newSpan(i, token, _depth);\n break;\n\n case 'key':\n buffer.markup += newLineBreakAndIndent() + newSpan(i, token, _depth);\n break;\n\n case 'colon':\n buffer.markup += newSpan(i, token, _depth) + ' ';\n break;\n\n case 'symbol':\n switch (string) {\n case '[':\n case '{':\n buffer.markup += (!followsSymbol(i, [':']) ? newLineBreakAndIndent() : '') + newSpan(i, token, _depth);\n _depth++;\n break;\n\n case ']':\n case '}':\n _depth--;\n\n const islastToken = i === buffer.tokens_merge.length - 1,\n _adjustment = i > 0 ? ['[', '{'].indexOf(buffer.tokens_merge[i - 1].string) > -1 ? '' : newLineBreakAndIndent(islastToken) : '';\n\n buffer.markup += _adjustment + newSpan(i, token, _depth);\n break;\n\n case ',':\n buffer.markup += newSpan(i, token, _depth);\n break;\n }\n\n break;\n }\n }\n\n if (error) {\n let _line_fallback = 1;\n\n function countCarrigeReturn(string) {\n let count = 0;\n\n for (var i = 0; i < string.length; i++) {\n if (['\\n', '\\r'].indexOf(string[i]) > -1) count++;\n }\n\n return count;\n }\n\n _line = 1;\n\n for (var i = 0; i < buffer.tokens_merge.length; i++) {\n const token = buffer.tokens_merge[i],\n type = token.type,\n string = token.string;\n if (type === 'linebreak') _line++;\n buffer.markup += newSpan(i, token, _depth);\n _line_fallback += countCarrigeReturn(string);\n }\n\n _line++;\n _line_fallback++;\n if (_line < _line_fallback) _line = _line_fallback;\n }\n\n for (var i = 0; i < buffer.tokens_merge.length; i++) {\n let token = buffer.tokens_merge[i];\n buffer.indented += token.string;\n if (['space', 'linebreak'].indexOf(token.type) === -1) buffer.tokens_plainText += token.string;\n }\n\n if (error) {\n function isFunction(functionToCheck) {\n return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';\n }\n\n if ('modifyErrorText' in this.props) if (isFunction(this.props.modifyErrorText)) error.reason = this.props.modifyErrorText(error.reason);\n }\n\n return {\n tokens: buffer.tokens_merge,\n noSpaces: buffer.tokens_plainText,\n indented: buffer.indented,\n json: buffer.json,\n jsObject: buffer.jsObject,\n markup: buffer.markup,\n lines: _line,\n error: error\n };\n }\n\n ;\n /**\r\n * JS OBJECTS || PLACEHOLDER\r\n */\n\n if (!('nodeType' in something)) {\n let buffer = {\n inputText: JSON.stringify(something),\n position: 0,\n currentChar: '',\n tokenPrimary: '',\n tokenSecondary: '',\n brackets: [],\n isValue: false,\n stringOpen: false,\n stringStart: 0,\n tokens: []\n };\n\n function escape_character() {\n if (buffer.currentChar !== '\\\\') return false;\n return true;\n }\n\n function extract(string, position) {\n return string.slice(0, position) + string.slice(position + 1);\n }\n\n function determine_string() {\n if ('\\'\"'.indexOf(buffer.currentChar) === -1) return false;\n\n if (!buffer.stringOpen) {\n add_tokenSecondary();\n buffer.stringStart = buffer.position;\n buffer.stringOpen = buffer.currentChar;\n return true;\n }\n\n if (buffer.stringOpen === buffer.currentChar) {\n add_tokenSecondary();\n const stringToken = buffer.inputText.substring(buffer.stringStart, buffer.position + 1);\n add_tokenPrimary(stringToken);\n buffer.stringOpen = false;\n return true;\n }\n\n return false;\n }\n\n function determine_value() {\n if (':,{}[]'.indexOf(buffer.currentChar) === -1) return false;\n if (buffer.stringOpen) return false;\n add_tokenSecondary();\n add_tokenPrimary(buffer.currentChar);\n\n switch (buffer.currentChar) {\n case ':':\n buffer.isValue = true;\n return true;\n break;\n\n case '{':\n case '[':\n buffer.brackets.push(buffer.currentChar);\n break;\n\n case '}':\n case ']':\n buffer.brackets.pop();\n break;\n }\n\n if (buffer.currentChar !== ':') buffer.isValue = buffer.brackets[buffer.brackets.length - 1] === '[';\n return true;\n }\n\n function add_tokenSecondary() {\n if (buffer.tokenSecondary.length === 0) return false;\n buffer.tokens.push(buffer.tokenSecondary);\n buffer.tokenSecondary = '';\n return true;\n }\n\n function add_tokenPrimary(value) {\n if (value.length === 0) return false;\n buffer.tokens.push(value);\n return true;\n }\n\n for (var i = 0; i < buffer.inputText.length; i++) {\n buffer.position = i;\n buffer.currentChar = buffer.inputText.charAt(buffer.position);\n const a = determine_value(),\n b = determine_string(),\n c = escape_character();\n if (!a && !b && !c) if (!buffer.stringOpen) buffer.tokenSecondary += buffer.currentChar;\n }\n\n let buffer2 = {\n brackets: [],\n isValue: false,\n tokens: []\n };\n buffer2.tokens = buffer.tokens.map(token => {\n let type = '',\n string = '',\n value = '';\n\n switch (token) {\n case ',':\n type = 'symbol';\n string = token;\n value = token;\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case ':':\n type = 'symbol';\n string = token;\n value = token;\n buffer2.isValue = true;\n break;\n\n case '{':\n case '[':\n type = 'symbol';\n string = token;\n value = token;\n buffer2.brackets.push(token);\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case '}':\n case ']':\n type = 'symbol';\n string = token;\n value = token;\n buffer2.brackets.pop();\n buffer2.isValue = buffer2.brackets[buffer2.brackets.length - 1] === '[';\n break;\n\n case 'undefined':\n type = 'primitive';\n string = token;\n value = undefined;\n break;\n\n case 'null':\n type = 'primitive';\n string = token;\n value = null;\n break;\n\n case 'false':\n type = 'primitive';\n string = token;\n value = false;\n break;\n\n case 'true':\n type = 'primitive';\n string = token;\n value = true;\n break;\n\n default:\n const C = token.charAt(0);\n\n function stripQuotesFromKey(text) {\n if (text.length === 0) return text;\n if (['\"\"', \"''\"].indexOf(text) > -1) return \"''\";\n let wrappedInQuotes = false;\n\n for (var i = 0; i < 2; i++) {\n if ([text.charAt(0), text.charAt(text.length - 1)].indexOf(['\"', \"'\"][i]) > -1) {\n wrappedInQuotes = true;\n break;\n }\n }\n\n if (wrappedInQuotes && text.length >= 2) text = text.slice(1, -1);\n\n const nonAlphaNumeric = text.replace(/\\w/g, ''),\n alphaNumeric = text.replace(/\\W+/g, ''),\n mayRemoveQuotes = ((nonAlphaNumeric, text) => {\n let numberAndLetter = false;\n\n for (var i = 0; i < text.length; i++) {\n if (i === 0) if (isNaN(text.charAt(i))) break;\n\n if (isNaN(text.charAt(i))) {\n numberAndLetter = true;\n break;\n }\n }\n\n return !(nonAlphaNumeric.length > 0 || numberAndLetter);\n })(nonAlphaNumeric, text),\n hasQuotes = (string => {\n for (var i = 0; i < string.length; i++) {\n if ([\"'\", '\"'].indexOf(string.charAt(i)) > -1) return true;\n }\n\n return false;\n })(nonAlphaNumeric);\n\n if (hasQuotes) {\n let newText = '';\n const charList = text.split('');\n\n for (var ii = 0; ii < charList.length; ii++) {\n let char = charList[ii];\n if ([\"'\", '\"'].indexOf(char) > -1) char = '\\\\' + char;\n newText += char;\n }\n\n text = newText;\n }\n\n if (!mayRemoveQuotes) return \"'\" + text + \"'\";else return text;\n }\n\n if ('\\'\"'.indexOf(C) > -1) {\n if (buffer2.isValue) type = 'string';else type = 'key';\n if (type === 'key') string = stripQuotesFromKey(token);\n\n if (type === 'string') {\n string = '';\n const charList2 = token.slice(1, -1).split('');\n\n for (var ii = 0; ii < charList2.length; ii++) {\n let char = charList2[ii];\n if ('\\'\\\"'.indexOf(char) > -1) char = '\\\\' + char;\n string += char;\n }\n\n string = \"'\" + string + \"'\";\n }\n\n value = string;\n break;\n }\n\n if (!isNaN(token)) {\n type = 'number';\n string = token;\n value = Number(token);\n break;\n }\n\n if (token.length > 0) if (!buffer2.isValue) {\n type = 'key';\n string = token;\n if (string.indexOf(' ') > -1) string = \"'\" + string + \"'\";\n value = string;\n break;\n }\n }\n\n return {\n type: type,\n string: string,\n value: value,\n depth: buffer2.brackets.length\n };\n });\n let clean = '';\n\n for (var i = 0; i < buffer2.tokens.length; i++) {\n let token = buffer2.tokens[i];\n clean += token.string;\n }\n\n function indent(number) {\n var space = [];\n\n for (var i = 0; i < number * 2; i++) space.push(' ');\n\n return (number > 0 ? '\\n' : '') + space.join('');\n }\n\n ;\n let indentation = '';\n\n for (var i = 0; i < buffer2.tokens.length; i++) {\n let token = buffer2.tokens[i];\n\n switch (token.string) {\n case '[':\n case '{':\n const nextToken = i < buffer2.tokens.length - 1 - 1 ? buffer2.tokens[i + 1] : '';\n if ('}]'.indexOf(nextToken.string) === -1) indentation += token.string + indent(token.depth);else indentation += token.string;\n break;\n\n case ']':\n case '}':\n const prevToken = i > 0 ? buffer2.tokens[i - 1] : '';\n if ('[{'.indexOf(prevToken.string) === -1) indentation += indent(token.depth) + token.string;else indentation += token.string;\n break;\n\n case ':':\n indentation += token.string + ' ';\n break;\n\n case ',':\n indentation += token.string + indent(token.depth);\n break;\n\n default:\n indentation += token.string;\n break;\n }\n }\n\n let lines = 1;\n\n function indentII(number) {\n var space = [];\n if (number > 0) lines++;\n\n for (var i = 0; i < number * 2; i++) space.push(' ');\n\n return (number > 0 ? '
' : '') + space.join('');\n }\n\n ;\n let markup = '';\n const lastIndex = buffer2.tokens.length - 1;\n\n for (var i = 0; i < buffer2.tokens.length; i++) {\n let token = buffer2.tokens[i];\n let span = newSpan(i, token, token.depth);\n\n switch (token.string) {\n case '{':\n case '[':\n const nextToken = i < buffer2.tokens.length - 1 - 1 ? buffer2.tokens[i + 1] : '';\n if ('}]'.indexOf(nextToken.string) === -1) markup += span + indentII(token.depth);else markup += span;\n break;\n\n case '}':\n case ']':\n const prevToken = i > 0 ? buffer2.tokens[i - 1] : '';\n if ('[{'.indexOf(prevToken.string) === -1) markup += indentII(token.depth) + (lastIndex === i ? '
' : '') + span;else markup += span;\n break;\n\n case ':':\n markup += span + ' ';\n break;\n\n case ',':\n markup += span + indentII(token.depth);\n break;\n\n default:\n markup += span;\n break;\n }\n }\n\n lines += 2;\n return {\n tokens: buffer2.tokens,\n noSpaces: clean,\n indented: indentation,\n json: JSON.stringify(something),\n jsObject: something,\n markup: markup,\n lines: lines\n };\n }\n }\n\n}\n\nexport default JSONInput;","import { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXHeader } from \"component/Layout\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTitle } from \"component/Typography\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport JSONInput from \"react-json-editor-ajrm\";\nimport locale from \"react-json-editor-ajrm/locale/en\";\nimport {\n WBCreateWebHook,\n WBgetWebHookbyID,\n WBupdateWebHook,\n} from \"action/WorkbenchAction\";\nimport { WB_WEBHOOK_BY_ID } from \"constant\";\nimport { imageMapper } from \"../../ImageMapper\";\nimport history from \"utils/history\";\nimport { CXSwitch } from \"component/Switch\";\nimport { generateUniqueKey } from \"utils\";\nconst WebhookCreate = ({\n render,\n setrender,\n webhookID,\n headerHide = false,\n}) => {\n const dispatch = useDispatch();\n const { BaseUrls, wbHookbyID } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const [ShowHeadres, setShowHeadres] = useState(false);\n const [ShowParm, setShowParm] = useState(false);\n const [ShowFormData, setShowFormData] = useState(false);\n const [WebhookData, setWebhookData] = useState({\n expectedStatusCode: 200,\n queryParams: [],\n headers: [],\n bodyParams: {},\n requestBody: [],\n });\n const onChangeHandler = (key, val) => {\n let data = { ...WebhookData, [key]: val };\n setWebhookData(data);\n if (key === \"apiMethod\" && val === \"GET\") {\n setWebhookData({ ...data, contentType: \"urlEncoded\" });\n }\n };\n const CreateWebhook = () => {\n dispatch(WBCreateWebHook(WebhookData));\n // setrender(\"WebhookList\");\n };\n const UpdateWebhook = () => {\n let { _id, updatedAt, createdAt, ...restdata } = WebhookData;\n dispatch(WBupdateWebHook(_id, restdata));\n // setrender(\"WebhookList\");\n };\n\n console.log(\"WebhookData\", WebhookData);\n\n useEffect(() => {\n if (webhookID) {\n dispatch(WBgetWebHookbyID(webhookID));\n }\n }, [webhookID]);\n useEffect(() => {\n wbHookbyID && render === \"WebhookUpdate\" && setWebhookData(wbHookbyID);\n if (wbHookbyID?.queryParams?.length > 0) {\n setShowParm(true);\n }\n if (wbHookbyID?.headers?.length > 0) {\n setShowHeadres(true);\n }\n if (wbHookbyID?.requestBody?.length > 0) {\n setShowFormData(true);\n }\n }, [wbHookbyID]);\n useEffect(() => {\n return () => {\n wbHookbyID &&\n render === \"WebhookUpdate\" &&\n dispatch({ type: WB_WEBHOOK_BY_ID, data: {} });\n };\n }, []);\n const addP = () => {\n setWebhookData({\n ...WebhookData,\n queryParams: [\n ...WebhookData?.queryParams,\n {\n name: \"\",\n value: \"\",\n type: \"Fixed\",\n },\n ],\n });\n };\n const addH = () => {\n setWebhookData({\n ...WebhookData,\n headers: [\n ...WebhookData?.headers,\n {\n name: \"\",\n value: \"\",\n type: \"Fixed\",\n },\n ],\n });\n };\n const addF = () => {\n setWebhookData({\n ...WebhookData,\n requestBody: [\n ...WebhookData?.requestBody,\n {\n name: \"\",\n value: \"\",\n type: \"Fixed\",\n },\n ],\n });\n };\n const rmvP = (inedx) => {\n let filter = WebhookData.queryParams.filter((d, i) => i !== inedx);\n setWebhookData({ ...WebhookData, queryParams: filter });\n };\n const rmvH = (inedx) => {\n let filter = WebhookData.headers.filter((d, i) => i !== inedx);\n setWebhookData({ ...WebhookData, headers: filter });\n };\n const rmvF = (inedx) => {\n let filter = WebhookData.requestBody.filter((d, i) => i !== inedx);\n setWebhookData({ ...WebhookData, requestBody: filter });\n };\n const Changehandler = (i, val, key) => {\n WebhookData.queryParams[i][key] = val;\n };\n\n const ChangehandlerH = (i, val, key) => {\n WebhookData.headers[i][key] = val;\n };\n const ChangehandlerF = (i, val, key) => {\n WebhookData.requestBody[i][key] = val;\n };\n return (\n \n {!headerHide && (\n \n \n Create Webhook\n \n
\n history.push(\"/admin/bot-workbench/Webhooks\")}\n >\n Cancel\n \n \n render === \"WebhookUpdate\" ? UpdateWebhook() : CreateWebhook()\n }\n >\n {render === \"WebhookUpdate\" ? \"Update\" : \"Create\"}\n \n
\n
\n )}\n
\n
\n
Webhook name
\n onChangeHandler(\"name\", e.target.value)}\n defaultValue={WebhookData?.name ?? \"\"}\n />\n
\n
\n
Webhook URL
\n
\n onChangeHandler(\"baseUrlId\", val)}\n defaultValue={WebhookData?.baseUrlId ?? \"\"}\n >\n {BaseUrls.map((d) => {\n return {d.url};\n })}\n \n onChangeHandler(\"endpoint\", e.target.value)}\n defaultValue={WebhookData?.endpoint ?? \"\"}\n />\n
\n
\n
\n
Method
\n onChangeHandler(\"apiMethod\", val)}\n defaultValue={WebhookData?.apiMethod ?? \"\"}\n >\n POST\n GET\n PUT\n DELETE\n \n
\n
\n
Expected Status Code
\n onChangeHandler(\"expectedStatusCode\", val)}\n defaultValue={WebhookData?.expectedStatusCode ?? 200}\n >\n 200\n \n
\n
\n
Content Type
\n onChangeHandler(\"contentType\", val)}\n defaultValue={WebhookData?.contentType ?? \"\"}\n >\n {WebhookData?.apiMethod !== \"GET\" && (\n application/json\n )}\n \n application/x-www-form-urlencoded\n \n \n
\n\n
\n
\n
\n
Headers
\n setShowHeadres(event)}\n defaultChecked={ShowHeadres}\n />\n
\n
\n {ShowHeadres && (\n
\n
\n
KEY
\n
Value
\n {!headerHide &&
Type
}\n {!headerHide &&
Action
}\n
\n {WebhookData?.headers?.map((res, i) => {\n return (\n
\n
\n \n ChangehandlerH(i, e.target.value, \"name\")\n }\n />\n
\n
\n \n ChangehandlerH(i, e.target.value, \"value\")\n }\n />\n
\n {!headerHide && (\n
\n ChangehandlerH(i, val, \"type\")}\n >\n Fixed\n Dynamic\n \n
\n )}\n {!headerHide && (\n
\n rmvH(i)}\n />\n
\n )}\n
\n );\n })}\n {!headerHide && (\n
\n addH()}\n >\n \n Add Headers\n
\n
\n )}\n
\n )}\n
\n
Query Parameters
\n setShowParm(event)}\n />\n
\n {ShowParm && (\n
\n
\n
KEY
\n
Value
\n {!headerHide &&
Type
}\n {!headerHide &&
Action
}\n
\n {WebhookData?.queryParams?.map((res, i) => {\n return (\n
\n
\n Changehandler(i, e.target.value, \"name\")}\n />\n
\n
\n \n Changehandler(i, e.target.value, \"value\")\n }\n />\n
\n {!headerHide && (\n
\n Changehandler(i, val, \"type\")}\n >\n Fixed\n Dynamic\n \n
\n )}\n {!headerHide && (\n
\n rmvP(i)}\n />\n
\n )}\n
\n );\n })}\n {!headerHide && (\n
\n addP()}\n >\n \n Add Query Parameters\n
\n
\n )}\n \n )}\n {WebhookData?.contentType === \"urlEncoded\" &&\n WebhookData?.apiMethod !== \"GET\" && (\n <>\n
\n
Form Data
\n setShowFormData(event)}\n />\n
\n {ShowFormData && (\n
\n
\n
KEY
\n
Value
\n {!headerHide &&
Type
}\n {!headerHide &&
Action
}\n
\n {WebhookData?.requestBody?.map((res, i) => {\n return (\n
\n
\n \n ChangehandlerF(i, e.target.value, \"name\")\n }\n />\n
\n
\n \n ChangehandlerF(i, e.target.value, \"value\")\n }\n />\n
\n {!headerHide && (\n
\n \n ChangehandlerF(i, val, \"type\")\n }\n >\n Fixed\n Dynamic\n \n
\n )}\n {!headerHide && (\n
\n rmvF(i)}\n />\n
\n )}\n
\n );\n })}\n {!headerHide && (\n
\n addF()}\n >\n \n Add Form Data\n
\n \n )}\n
\n )}\n \n )}\n \n
\n {WebhookData?.contentType === \"applicationJson\" && (\n \n
Body
\n 0\n ? JSON.parse(WebhookData?.bodyParams)\n : null\n }\n locale={locale}\n height=\"300px\"\n width=\"100%\"\n onChange={(val) => onChangeHandler(\"bodyParams\", val.jsObject)}\n />\n
\n )}\n
\n\n {WebhookData?.contentType === undefined && (\n
\n Select Content Type json to display the data fields\n
\n )}\n \n
\n );\n};\n\nexport default WebhookCreate;\n","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHome(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 2.10156L1 12.002H4V21.002H11V15.002H13V21.002H20V12.002H23L12 2.10156ZM12 4.79297L18 10.1934V11.002V19.002H15V13.002H9V19.002H6V10.1934L12 4.79297Z\",\n fill: \"#C4C4C4\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHome);\nexport default __webpack_public_path__ + \"static/media/home.364ad3657c7d99b9bc1360a783be9c93.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHomeActive(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 2.10156L1 12.002H4V21.002H11V15.002H13V21.002H20V12.002H23L12 2.10156ZM12 4.79297L18 10.1934V11.002V19.002H15V13.002H9V19.002H6V10.1934L12 4.79297Z\",\n fill: \"#4CB567\",\n fillOpacity: 0.5\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHomeActive);\nexport default __webpack_public_path__ + \"static/media/homeActive.d8bd2231cb8a79a71ad5ece62e75a417.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgQuestion(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.08997 9.00057C9.32507 8.33224 9.78912 7.76868 10.3999 7.4097C11.0107 7.05073 11.7289 6.91951 12.4271 7.03928C13.1254 7.15906 13.7588 7.52209 14.215 8.0641C14.6713 8.6061 14.921 9.29209 14.92 10.0006C14.92 12.0006 11.92 13.0006 11.92 13.0006\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 17H12.01\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgQuestion);\nexport default __webpack_public_path__ + \"static/media/question.9e8ad3f81d571a75e5dac7b2319dd1b9.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgContact(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 22,\n viewBox: \"0 0 16 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.11441 9.34759C9.11441 8.63174 8.53426 8.0516 7.81857 8.05158L9.11441 9.34759ZM9.11441 9.34759C9.11441 10.0633 8.53424 10.6436 7.81853 10.6436M9.11441 9.34759L7.81853 10.6436M7.81853 10.6436C7.10269 10.6436 6.52252 10.0633 6.52251 9.34761L7.81853 10.6436ZM7.8184 11.72H7.81853C9.1312 11.72 10.1952 10.6557 10.1952 9.34319C10.1952 8.03053 9.1312 6.96641 7.81853 6.96641C6.50573 6.96641 5.44175 8.03053 5.44175 9.34319L5.44175 9.34331C5.44333 10.6552 6.5064 11.7182 7.8184 11.72ZM6.52251 9.34759C6.52265 8.6319 7.10279 8.05185 7.81853 8.05158L6.52251 9.34759Z\",\n fill: \"#767676\",\n stroke: \"#767676\",\n strokeWidth: 0.2\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.22165 16.081L4.22166 16.0813C4.2225 16.3791 4.46369 16.6205 4.76175 16.6214H4.76204L10.8744 16.6214L10.8747 16.6214C11.1728 16.6205 11.4139 16.3791 11.4148 16.0813V16.081C11.4148 15.0613 11.0446 14.1197 10.3647 13.4261C9.69655 12.7389 8.77663 12.3541 7.81829 12.361C6.85981 12.3541 5.94003 12.7389 5.27179 13.4261C4.59183 14.1197 4.22166 15.0613 4.22165 16.081ZM9.59189 14.1824C9.95422 14.5564 10.1957 15.0296 10.2865 15.5406H5.34971C5.43964 15.0294 5.6814 14.5561 6.04451 14.1825C6.51301 13.7086 7.15183 13.4418 7.81829 13.4418C8.48459 13.4418 9.12339 13.7085 9.59189 14.1824Z\",\n fill: \"#767676\",\n stroke: \"#767676\",\n strokeWidth: 0.2\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.1025 20.0204C13.7761 20.0185 14.3219 19.4728 14.3239 18.7993C14.3239 18.7992 14.3239 18.7991 14.3239 18.799M13.1025 20.0204L14.4239 18.7993L14.3239 18.799M13.1025 20.0204H2.53386C1.86022 20.0185 1.31442 19.4728 1.31243 18.7991V3.20987C1.31442 2.53629 1.86014 1.99056 2.53372 1.98858L13.1025 20.0204ZM14.3239 18.799V3.21001M14.3239 18.799V3.21001M14.3239 3.21001L14.3239 3.20973L14.3239 3.21001ZM13.1028 0.907812H13.1028L2.53358 0.907812L2.53353 0.907813C1.26248 0.908388 0.232097 1.93861 0.231665 3.20969V3.20973L0.231665 18.7993L0.231665 18.7993C0.232097 20.0704 1.26248 21.1006 2.53354 21.1012H2.53358H13.1028H13.1028C14.3739 21.1006 15.4041 20.0704 15.4047 18.7993V18.7993V3.20973V3.20968C15.4041 1.93862 14.3739 0.908388 13.1028 0.907812Z\",\n fill: \"#767676\",\n stroke: \"#767676\",\n strokeWidth: 0.2\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.98213 4.0628H9.5052C9.8036 4.0628 10.0456 3.82082 10.0456 3.52241C10.0456 3.22401 9.8036 2.98203 9.5052 2.98203H5.98213C5.68357 2.98203 5.44175 3.22403 5.44175 3.52241C5.44175 3.8208 5.68357 4.0628 5.98213 4.0628Z\",\n fill: \"#767676\",\n stroke: \"#767676\",\n strokeWidth: 0.2\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgContact);\nexport default __webpack_public_path__ + \"static/media/contact.d9b579290ad448613ce81ed11c6c90b6.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHand(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 14,\n height: 15,\n viewBox: \"0 0 14 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 14.98H14V0.98H0V14.98Z\",\n fill: \"url(#pattern0)\"\n })), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"pattern\", {\n id: \"pattern0\",\n patternContentUnits: \"objectBoundingBox\",\n width: 1,\n height: 1\n }, /*#__PURE__*/React.createElement(\"use\", {\n xlinkHref: \"#image0_871_19632\",\n transform: \"scale(0.015625)\"\n })), /*#__PURE__*/React.createElement(\"image\", {\n id: \"image0_871_19632\",\n width: 64,\n height: 64,\n xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAa90lEQVR4AczWA3RkWRrA8f/VUzGViprDtW3btm2Pbds21rbHtmd61IzKfLr7Nr3oM+xenf2dfKmkXJ9uCf4PffKTn5zodDqf9TxvfyDkv0h89KMf5f9NmqYfbDQaZzuOc1mhUHg/cC//JVoIwf8bIcQNxphboih6XqvVuqRYLL4buJj/As1/2cFvuXhr1UuelBqvkSKuBlo8uhu/+fNnvqDf758YhuF7ms3mL8vl8luBP/IfJj7+8Y/z33LQa377SVOeOkr7jp/GMcN296ZwvvUF4EIeYOdLXlXp9XqfCILgUCD92yiIrAuOzfbB56SUzVKp9FLgev6DxMc+9jH+G3Z/zi+e54+OXlBZvthoR5MmEWG3TWe+GbdnGh8BzmMDu1z0qje22+2fuY7zp0Kx+PG/zT2u6+p6vX5u1g3vNsbcVqlUngc0+Q/RjuOwqfZ5/QUmiZLNtEhMkoj7gQ4P0K31vyCkMoIUSJACXN+Fiq+jbu+sdm3QAX7K33ied1lW7QMHg8G2abN5QfZB3wFcFWey9v94kiRbZ+PwtGwnnAy8m/8Q8b73vW/TZvrVV22ZG/OPlsZ5dRqHIh7074zjdC/gHDZQu2f6t+WlE68aXb4YNxeASCGNs58hvUaduftqDduNXwdczga2v+yVn8qScJLWemZ0dPSVwE2s98T5+fmr0jT1slH4JHDq//wYPOj9P1yWzFT/VN5syeZO4GPTkKjXYtBs0Z8bnBxMhZ8DEjK3/bl98OiS4JvjWywhP1ZFKglpvPCYOOzTmZ2ntrpzTTTsvgqos4F9r3/Xp7LFd5LjOHeMjY09G2iRyXbEl7Lrj1JKzWbJeSxQ598kPvOZz7CxvvHYb283umxq/9KiSYzngBBgI+JBh/bMbPahGicDnyZzz+3h0/IFrpjcompGlkzhFXIIUmwakSYhw172mOkGrTXDk4DP8AC7XfOao7rd7pfy+fxZwEfIZJX35ubmroii6MnZsjwc+Dr/JvGBD3yAjbXrs362z8iiyR1LU2MYz0UahwU2JOo1aKyZIWx1dwL2JbPi1uEPqlPO28eXj1Gaqq5Pmo1J44g4GjLotGmv7TDfjR/Y0hxz87v8Wq12aRzHT832wVuBn5AR8Opavf4boD0yMvI4YA3/Bu15Hhur30jvcfwmftFDCItRCiEVoDBejny1RDOJ9ohXhrcD33fd5EvN2eGzXL++VLuaQrWM1AJrLUIIHN8nqCbYsL//Wju4DLiFv/nUU8/vH3/1Oz83P1+7NFt8h46MlH8BxFqbPxhjLsn2xAuy2B74yv+sAz44/t2p8aJ77eKtRyaKY6M4+QLG8wALNiKNenSbDVpr6/1hkr4KuOS+qzuvy1f1T8eXF3RlUZWgHIAAmySQieOI3nz2mOnBr+/MN98MRGzg1F++45zsCPxAsVj8DHASGa3167Pu+IVSajrbBVsCXf5F4tOf/jSb4kP+WdtVFnv7T24xSlAu4+ZyKPO3BWdjkmhIt/HXJLRW1Qv9FwH3Tf852b06qXYbW15iZGoUvxgglSJDmsQMe13a67LHNPt7Abuygf2ueccT5ufmbjbG3J6NwhOAVAiRm8uui6JoeXZEPuKJsNfr7hjpOKufMx7FT0kJ3KGnbir01KXANBl94MsuYlP84Y/2mGg6fIvjNV4gpUAKiwhcpAJsilQar5AniZIlYp5zVTR49dhT9O633xI9WzmdNxjXYPwAx/XBghRDHD/Fr4TEg2SnuWZyDfAj/kZJeavjOBeEYfji4XD4LOAKoOu57qnZ/3tki/LrD5WAfV/wR+UE+sNO4u651BlZqis5pBLE/YjQxrNJsvKrwHk6dmbZFC95baFz79G1j6wW6W+VZnOwQA4n8EBYrE3R2pAbKYHlBd2Z9ATgw5bwQ62Z8BLHaz3OCfJIt4B2DGCRKsYJAryRoSxFg0M9+lcBq8js9Yzz7LaXvuPwbN5fksXOwFvIBEFwehbLgAYPsMcLL/Ckled4peI7youncHIFEBJsgnIGCN0d6zQmz2jOObO6Pr+MTVV6/7IV0zdc/+7pe7q/kYoKCyzaMwghFrrANd5Cm1trP9Su9+/Y/Kmlve65qfnF2trhz1x/ztdeQG60gpQShEJpjVfMEQ3jzdvrvOOBN/E3WusLpJSnRVGYfTmqSiAF7s+OxU/xEJQITwkq5XeUpqZwC2UQijQFi8BKF6FC4mFivMLq54r7z5lgY5TGqEb1YiU1dg6okbn6R/e+prRI/WRys5xbGi+TK+dxfA+hfVAe2JioO09z7Ry9Zu+DwLkrrutsn6+Y/RZtNcLIkkUEpRzYkDQeEkchg26XzkyHuXq8C7A3m0iHwy8H5cKR1c2WZgmugnJIE0uaJtg0zSJi0Giw7q6ZdhTXn6Ob030eyfLrYyd+49KdSPNfcssUon63Fg0GZ6o/Ng56tp//zVW14aeU6J6ltEIbg/aKKOkCEqSHyVUojCckSXqGqLfmnvhEZ/+bbomfNbuy+U7tGLRROL6Chc5RuH6AHU0h7u403x9eCvyejdSLum4+9T6fJQC3UEQohyRJSOJw4cOnNothn9Z0k+mZ9vdA36ZrNc0jKb3R361cKOwY/LVdhSUJ3Yl+o7ZN6yXeO20nftcT0WffeHlzxHidI43roN0Crg5QRgEWhMEJilkSYt2KkrN77fCl2aB/NNsHT3T9+uOMayhOjKKNRiBRyqwfndR64Vp7THMQvhSYZiPopvNqVRCPdwMf5XhYIE0WuiuLCJtE9Ottamsa3bBnDyWjsz94OI/dKi6qbvA+VdUoYUEptFcgX1VIo7boJvO/vKfeeXPlqe5R9dviCe00d1LaILJwCyWkSiGNENLg5Yok48lYktS+Ozblv2i6O/j4/LrBr92gXjS+R75aRXgOWIvRPQKbkoTxY5kR5/XdzmuAmEdhZsJnSROgXQchFWkakyZZRAOSv8YwpDnTptuKfhwYbiKjA8PDSlZFk3aLeMpGQ9LYRQoXkAjlERTLgJ1YZu0Pw759HU9l5xU3NBdrU/+YVBIhUtychxBkJFIZ/GKBJE6eqNLWt0efbF57402dr82t6Z3q5uqYfBXPKwMRIDBegj8SEYf1lye1woHAN3gUXTWbc5VEKAWk2CTGxgsdsFD9YWdAc3ZAlAxO4G909g8Pp7vCrBPV3ppCp76lNhInJxBag00XquoXitjJdHF7bf1XrUbyCunbT86tHCySuvYaIUBQwQ1yIOKF5aOUJj9SRlhe06q1T3jc0wqfvffCxrOm3cYXnGAG6VVwAh9UjEgdXC8gGY1JotbX+634euAMHkEqMUqphVElHcBC6/cWXjuNE3rNIVn1L5Y4F/A3WlqHh1NbTsudjn/ZyrW+tL6tBMYPEFJCRkpnfRJSuzi1tV8sitwXT6+M3rPunv5FUH+SkAIhBMaTkBFSo4MCBeOSIj4zXFmvBWPyq/W14dONWfN843vIyWVoI0AYlHHwghxpNcGmnWMGvXQFcBEPx8pJ5WiklgsJyD58FkOwliRK6LUihoNow6WKzq7gkcSOPnnmvsFHjNcoyoUPBMZzQShAoLQhKBYAuyVp49dVq1648p7ea2bu612hlFgipMiqXsD4PqggizzSlCiNC2ppun2lF60Qzd6H5tb1rvLzK0eMq5GVUaTQIB20k+AXClhLjtnO+cqqlwB38wCrVkxLx9fZAgyQxgUbQZqFTQBBEqUM+2kaefyQDejsikcUEV+f9MznWNE5XSCcggWBXVg0CAGkC5XKlSuAfLK18z+fCN1Xz66O3j59X+/XUsvKQls6RZTrg3Sz8JA5ych4TNQZHOfL4duG09GHZu7v/CxXnhbG8zC5ACEdhE0wxhKUimQW92abPxOd9tuAO9hAry8+XJrwn+KXy0jjIZKQ9SxpmhKFcRbpzcW7whvYgM6u4NGF53ULgjU0T5+yOGBxbQ7lGKSSIByk65CvSLDpi21S/42Q9lUz94fvz74t/lRp5UingO+UUH/bIUgflRtnZFFPDzu97/Xd9ru63eTc1lzvg6WJ3t86RoN1EEbgaAcpFZA+vjEcXhw2Ol/uR/xW3c9wUBUvLVW8A4rjFdziKFJqSMXfCsTCERgNQkSSrDSPz6VsQGdXsDEMnLeyO/C4s3WyBVkCXJFD6jxIA8JBmAJBOSZN0pfESfrDQtl90903dr40fW/7RO2sAxPgKw9lDCQRoPFK44xvEXvac7/7l/KtAcqSXWt/O0nhuD281rNt2+/avs+2bdujZ9u2bd6Z6Yu57dMHVZVK8lKVnDW1pvv69/+ttVdWp7m/7STdXcizIA5BXMAQgcABBsCQFQURGhtO4wWJU725pQ9hvj+fHEZJox5vHp9ps9aGLeC1MYBlrlq5TOyaoFwDjC7DARBghKuKzVFt2/L8UBq2uosJDiYCsMCAcwbAlMLDOpqTBkab+y/sXt5x6HWbZ1z45/4h+y5cfjbjs6UV43YbjBvvCXXUJzcjarZqU6muGQQIG01nbSJ/d6MAnQMGECJEvTNWdoytmXRK5QZBVCvLKI8nwYRwX0sMBAIrVlaswGpC6RoC7CauFhr19/cWV9v7/tl9qxC8jNOAAogITiGwkoTWlIEx5vT5C1eWDz668fi9f+ttIZovewRgUzkyj84EwBvgVmneFAA0oF3icqRq/3MtyH2+VCqMIELX8FDQBoJxN38U0G7A8lWoJJMLDql1uIYAu4mrCxk03rY8168zsfzqTURoAiDTAg+FPx1i4EENrekJWDxu/sLl+YOOapy196/9Jg/mjmWisMjG8kSp8CSQmxuseGWHgE691TO/Gk9I1WAEYq5agFwYwiiAmBPmhIqVM0y1+eY1BNhNXDO0X2OPtdtEi8/dYAyapuj8mp4EC+LlXNDZwKG1edFl/1jqhgInzF+UfDcIF27PhXAtc6MJ8AhgNaeIlv60WXkSpFccfjVOIaMdGSx0OYiHvjSbYvUhUAhc/xIxMMEO7S3qoHrsJgZdXGXc6C6bGkbn00qmXTcSt5/32+9d3NB66UmbDICShKI6hADnZXwz0cDYJoLKsjfINE0WLtUPvGzP4MdRbfHoIK5DxAVpkVMCGLm8I8Dk/mPlFKuAiLmQ4LEjDwIO5IlwlidyezxgCGvs0DoNDgfwF3iIOiW4KjjiroceK4LopaDoYDMw3WRp8YPD3uBVhxwlnjz71yzgbOmxgCk9NW4XXVzkLEsBeJ0wsTVDnsl3ZMlKf3lOP3T+ksFPm5P9RjRuwCGcy2pZbWA8Efla1yfhrR9YCZ0Qg4VfuSdhfylkjBCFFC2G0U1RJWAQRrgyXO/6Y6eIuP7+uDNWZvw4b8Qipifoi/UpepCeeNgxweP+9te0BrZy7gbGywORULQgxCgcIoj6FKYP0wDxHSRWd+Y5LWjDGsS4i2+dOcV1Wung1ot75j/2BFAhHA7kF+bFhwC5MAhDBhmb6x/QCRpcGaRRxzUEhyhJNRBBjNbUNHhA0yuz81+cmx+cN3VIcN7cnixmfPlUxgXA4nJq5KFwyrAIQWMGG4+MWK3dPTMZGIxtnnYdJVJAqf0eAAWYkeK+MoC8dRm8SX2sC79XBfk+oBDynFDZUE2I8GBUIOwGrgzD1SGv9boIY160vY5ZClBvjQFbKSKa2zm4rNdpHkSn7d2d1okWHjZDHGACUasJzskpRBFYbRrjB0/BGFefgRxQI5c3XnntLe8tWfUCgidDVIRhDYi87OdOBATimEAFgjiuFN2l3g9EaB4QhIS41YKr5e52p95qgx3EgIC/ebC314lic+ylFyafBOYeMmMIZDYgajbdhFaCAyIurFOJ9UqZM2qt14P5WK6IV9zHuhOHNV/rfQCMM/CAtVCBsBu4MiR9tW3x4v45Ipw7UusccaNeKkRls8HKmX9iS/HDxUukWJkG2EMvuXD4kTy/9PgZmaMxNYPaWBtcjAYo5pprRp4EPbK8EyL3eejK13uMFHXTols9HHOokOSVNxUvENRBBcJuoIqX/vxuZC8bjmJEM+PjEz/0AbjvpPauJ5t/9T6hlRJmpuOsynVJAOcCUWMck1trEEI8fn7P0kyjwU7fd2HKZTL38JnUncfVJybdRDiynNG+/BlAabeiavVCsJ6FK/mA1lG+skWFGB+CBpxRu5frmuu2ADHUBlUEQcCtvDZJkgdkMhtdO2HHwgmfvSD52PmXqME7jdJBcdIbNhoIwhCGuZaY15o2sXEwwU8C5se0Sk9duCQ1Kl861mhdDjn1yQiMH+jOvKKQ9itVXXkdK6PSLldhKjlEwxhjpZoWaFKy4ThGBLzl9/c5ut8fHF6r1eYA/AIweavVelGWZQ+wnvA8e/n4odEX71CnbTt+ceciVPJBpXW9Na1BncK1A1fGiINFY2jPAMbQfY2e/4xR8qTufJbzoHtiWF8sj6tZ2PCKGi8+xo0brR1orY7Vr68qS6WpK3vKiyfAr6506k4raW0aXasLpfS5g8HgqVrrv1plb+DbxJ9ZQnbY/TN6vd7Lqg8R3oeHfeY8/omH6gvTj0J3O4wYCgkIYN6lWRCjs2GqYPsOoPkv6X2Ds/or8hhbTW4Klbhaz6rJS7vkyMgptMbS5gCfrsJ3ij6bO8VlKUYrK6aUEmRgCKirdLL6SOoNQohzrcWPtgo/GcArYGG94Bl277527/H2BvYLAL4Ojx3dk756lvzQAy/V2SeMWZ4u2K1pXZ7kMs5BPAQLGhjbGEKEwQ2i5uI3uwsS9U4MzgGozCss9ivGgsokaCrK6MtXfmRpwH+d7xx1WopWsnIjpAFjQNogCcIWPOhPr9mCV/zuHufap6nv5pwvWy+4+ejMLc/z+9h7+C8xxubsa4zbAvgHKjghfv9N2232mektwUHtmSZq7Wb56EGEkXNzXgd0ApX0IDONIAp93x9bidwAA7Y2jnXuXXm0wq3Q1ZzgvIhCT15lgFIDQK4iTwdIhwNkSQqlDNRQYnne2D19fwBfdBcjuUQcx9ujKDotTdM72UdI2ycmJ+4MwHDBv9xut59j915i5fPWE+4B4CJ4fDQ97VfHz++4l0nxUZ13b6iVgjEAYwyMZ75WB+C1DnidKp1tJcF5K1dDws8FFe+vtsSeGGN8zlCeKOwnIO9D5WlhwFJ0rkpRMrdCMDqch4ewH+CRh3whf4u6z/n2GdpvpJR3tHH/fAAvGFXGZrO5tXitab3kW/ZG9p4AdsPjI+b0Pz/ujx+48yWR/oIxvdu622HmyiPtn8yc0qIyvsYVa2vA+M/D7C9zRq/N8Dr3BChPlqh4igLUsLwFymUxfKVQUkKpvFQ+T6TdD/elxP8OD5H65HHeEV/7y9vkXS4oPKDf6z/XWvu3AD4Ji7AePhqAtFXhsfbV5k8ajca5AD4Pj9dMH7d05uBj95ubpZ1arT7QaFd3o4YB48L15Myf77HAuT9CpzgbNT/cCeD3i4V8TvatNLQnoaIwUkCRo8co/wBLFspbyaBKUdAFARJQOvhbALkID/rlSzejitf+8a6vsdZ+MmNsYK39oOrtrE2Kj7RJ8c1aa25D5pNhGD7LH0+bksTOpwMR5u8am6Ezx7cUj6bGUJ7Tc2GFuU4waAFizErTeYbJ18Y2qm3xKLn5YUkncJVEwpjcZ3ntSp3WhbVLxWVBQJohTzIXAplGrxdgOKi/FsBTKiHAUIW17lOVUhuSJDm12+1+ul6vHwfgy0AZ22+373S+b/ffkKbpw/Jc3qbTGTty1CdsHxwnL6BdZ8/tE/ty2Xu6ksqSIBE3m+XVeQHOUoBlfkJ0o+zakkdudecBbiUNB+X3JIwy7vJTK7v6OPceUCgv0xQqy4FcI0uAJOGJyNkOVEC/ef7aFyJv3HsPYb1gl1XyRMZYZnNAEQLvQQVSyvsBuDWA52MdnD/56Sd2xvRrJ7ZE1JpplUNUEEcIwhgUjgHhOMBbjoD1UfGCfD8ZalDGOfJVKJm6+M5zH+s+BFLplC+sLxVMbtDrx+gOap8AcCwqoB88dyPWw7v33ie0BLx1OBye6x8zv8XK05y1rxpOb3zwpEbTvGdik6i3N7ZRH+sgrtchogYQeQJ4c91xdv3EJwHVL0kwcnWU5NyqnBfkaQqZeNfPJIw0SDKBpZVmV6/yOx343F7oZayLc1pfztDCee9cusfvrDe8zhLxGGv1uwohXmO7xJ0ANK4EO/snf+g08+HZPM8/kcvlaa00iMhVCCaAEXgNoOCKSUAO6MTngQzGK6zykeV97BfKD53rm0whzRiWezHSJXoloJ3yFQiZX7EeZ7e++qbt7D4/sQS80ibBO1sStmmt7wLgTFwFvKP/wO9dMP3pu8/Nqk+rbPnwcijaAMSMwEYurjN/uGmFWOU0CN7ymXN7lZQeoPMhlJKF63uRPuE5AnRaWF4hTRlWujH6S+ZLs/WlV2Ad0LYnBrgq+N7KacKScKKVF0dR9LUizHE1cGrj4xubNfrYxAzuMH34GMY2TSOs1cFFBIia7w5DVyKJV6Y67VpnnbgGRw4xKnUyTVy2TzJHwLBw+7wseUnC0O1GWFkO/izSrOhdZtcl4Gtn1HB1sEM9/JZCCAng17iaODH8YD3gZufYlHn4xqPG0dk4gahWA2MCJELQqEliYn/tN7kTlUDJzGf5zLl7Ge+OAJUWli+SoUYyBJaXInRX+axW5r7ufw7WB33urAb+qxHy7C2dSTx64xENjG92r0IY52DMCZg7zDTGAK6+u3hXeWl5JZ3FC+VlqbyEyfKy4RkMCIuLIfqr/G/GmIcD+B3WhyfgzDr+O8C4fFyraV654dAoHj+og7hRA+cC5JUnXxn0AQSU/XwmCw9wlk+KeM8hU43eKrPZPkQvZT8W0hzr5pYrBn3+v4UAB2LqvnGkdk5tZlMTWxuodWpgQoBVyqKBgVYVEjwBulhTu2YKyUCjuyIsAQGSOb19akE/GsAAVwH0o7uE+O/E4hHsaEZ629iYvt3kZo7aeIwgCkDck2AMtG93R1Odkc7d5VCh1wVWugGyhM/tSVXRp2zH1QC967QI/92YEjqIIvP8KKcnjk3oemOCEDU4eOjCAaYgwHmClgp5otHvE1ZWOIZDkeWp/jD15DMAXIKrCfrcQxn+p+DiaX6dDS16cnvV3DeKzZYgNuChcbfccJdHwxRIUg45YLM1RV/7dabeeG3+mZLeeHKA/2lYvli1D93KbtMO2e2jnK4HYLJnwIzEakuLv/ZX5bfCSfkdAKu4lqDPnEr4/4x/A+GHjYuRFdySAAAAAElFTkSuQmCC\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHand);\nexport default __webpack_public_path__ + \"static/media/hand.92086a4786b35dbaeec35f2a64e5e350.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgBuild(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.05005 12H7.00005\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.01 12H22.96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgBuild);\nexport default __webpack_public_path__ + \"static/media/build.efb19c473e6181126360e570783cea09.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgDesign(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 9H21\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 21V9\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgDesign);\nexport default __webpack_public_path__ + \"static/media/design.d1eec4714f2dc7b6479b988d02052eaa.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgConfigureWp(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_701_19182)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.41 9.38296L21.0759 9.14859C20.9084 8.61309 20.6937 8.09357 20.4342 7.59609L21.2114 6.48843C21.7483 5.7247 21.6577 4.68539 20.9967 4.02609L19.9734 3.00281C19.3141 2.34183 18.2748 2.25122 17.5111 2.78812L16.403 3.56531C15.9055 3.30581 15.386 3.09108 14.8505 2.92359L14.6161 1.58953C14.4547 0.670594 13.6567 0.000282547 12.7237 1.29703e-06H11.2762C10.3425 -0.00107683 9.54355 0.670079 9.38343 1.59L9.14905 2.92359C8.61355 3.09103 8.09399 3.30576 7.59656 3.56531L6.4889 2.78812C5.72517 2.25122 4.68586 2.34183 4.02656 3.00281L3.00281 4.02656C2.34183 4.68586 2.25122 5.72517 2.78812 6.4889L3.56484 7.59656C3.30534 8.09404 3.09061 8.61355 2.92312 9.14905L1.58953 9.38343C0.669797 9.54374 -0.00107683 10.3427 1.29758e-06 11.2762V12.7237C9.50475e-05 13.6571 0.670688 14.4554 1.59 14.6165L2.92359 14.8509C3.09103 15.3864 3.30576 15.906 3.56531 16.4034L2.78812 17.5111C2.25122 18.2748 2.34183 19.3141 3.00281 19.9734L4.02656 20.9972C4.68586 21.6582 5.72517 21.7488 6.4889 21.2119L7.59656 20.4351C8.09399 20.6947 8.61355 20.9095 9.14905 21.0769L9.38343 22.4109C9.54393 23.3305 10.3428 24.0011 11.2762 24H12.7237C13.6573 24.0011 14.4562 23.3302 14.6165 22.4104C14.6748 22.0789 14.4533 21.763 14.1218 21.7047C13.7903 21.6465 13.4743 21.868 13.4161 22.1995C13.3571 22.5358 13.0651 22.7811 12.7237 22.7812H11.2762C10.9347 22.7814 10.6424 22.536 10.5834 22.1995L10.2839 20.4919C10.2433 20.259 10.0717 20.0707 9.84374 20.0086C9.15093 19.8232 8.48526 19.548 7.86374 19.1901C7.65806 19.071 7.40184 19.0823 7.20749 19.2192L5.78953 20.2139C5.50992 20.4099 5.12995 20.3766 4.88859 20.1351L3.86484 19.1114C3.62334 18.87 3.59011 18.4901 3.78609 18.2105L4.78125 16.793C4.91812 16.5986 4.92947 16.3424 4.81031 16.1367C4.45214 15.515 4.17665 14.8492 3.99093 14.1562C3.92962 13.9273 3.74109 13.7547 3.50765 13.7137L1.80047 13.4142C1.46489 13.3554 1.21978 13.0644 1.21875 12.7237V11.2762C1.21884 10.9348 1.46419 10.6429 1.80047 10.5839L3.50812 10.2844C3.7409 10.2435 3.92906 10.0718 3.99093 9.84374C4.17656 9.15079 4.45186 8.48498 4.80984 7.86327C4.929 7.65759 4.91765 7.40137 4.78078 7.20703L3.78609 5.78953C3.59011 5.50992 3.62334 5.12995 3.86484 4.88859L4.88859 3.86484C5.12995 3.62334 5.50992 3.59011 5.78953 3.78609L7.20703 4.78125C7.40137 4.91812 7.65759 4.92947 7.86327 4.81031C8.48493 4.45223 9.15074 4.17693 9.84374 3.9914C10.0727 3.93004 10.2453 3.74156 10.2862 3.50812L10.5858 1.80047C10.6446 1.46489 10.9356 1.21978 11.2762 1.21875H12.7237C13.0653 1.21861 13.3576 1.464 13.4165 1.80047L13.7161 3.50812C13.7567 3.74095 13.9282 3.92929 14.1562 3.9914C14.849 4.17708 15.5147 4.45237 16.1362 4.81031C16.3419 4.92947 16.5981 4.91812 16.7925 4.78125L18.2105 3.78656C18.4901 3.59058 18.87 3.62381 19.1114 3.86531L20.1351 4.88906C20.3766 5.13042 20.4099 5.51039 20.2139 5.79L19.2187 7.20749C19.0819 7.40184 19.0705 7.65806 19.1897 7.86374C19.5476 8.4853 19.8229 9.15093 20.0086 9.84374C20.0701 10.0725 20.2586 10.2449 20.4919 10.2858L22.1995 10.5853C22.5353 10.6442 22.7804 10.9354 22.7812 11.2762V12.7237C22.7814 13.0653 22.536 13.3576 22.1995 13.4165C21.868 13.4748 21.6465 13.7908 21.7047 14.1223C21.763 14.4538 22.0789 14.6753 22.4104 14.617C23.3303 14.4567 24.0013 13.6575 24 12.7237V11.2762C24.0001 10.3428 23.3294 9.54416 22.41 9.38296Z\",\n fill: \"#979797\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.2689 18.3517L18.3708 14.335C17.8611 13.8126 17.6057 13.0931 17.6719 12.3663C17.9516 9.16596 15.5841 6.34483 12.3838 6.06508C12.044 6.03536 11.7023 6.0356 11.3625 6.06579C11.0963 6.08744 10.8461 6.20191 10.6556 6.38922C10.1923 6.84494 10.1852 7.58969 10.6397 8.05422L12.3192 9.76657C12.6606 10.1142 12.6555 10.6728 12.3078 11.0141C12.3077 11.0142 12.3076 11.0143 12.3075 11.0144L11.0072 12.2898C10.6593 12.6309 10.101 12.6254 9.75986 12.2777L8.08032 10.5653C7.6246 10.102 6.87985 10.0948 6.41532 10.5494C6.22412 10.7362 6.10463 10.9842 6.07782 11.2502C5.73226 14.444 8.04128 17.3133 11.2351 17.6588C11.5744 17.6955 11.9163 17.7023 12.2569 17.6791C12.9834 17.6269 13.6963 17.8951 14.2083 18.4131L18.1041 22.427C18.3385 22.6686 18.7243 22.6744 18.9659 22.4399C19.2074 22.2055 19.2132 21.8197 18.9788 21.5781L15.0806 17.5619C14.3191 16.7883 13.2572 16.3867 12.1744 16.4627C9.64093 16.6363 7.44643 14.7233 7.27281 12.1898C7.25682 11.9565 7.25865 11.7223 7.27829 11.4892L8.88892 13.1299C9.27831 13.5289 9.81118 13.7556 10.3688 13.7594H10.3894C10.9392 13.7611 11.4675 13.5456 11.8594 13.1598L13.1597 11.8844C13.988 11.0718 14.0008 9.74177 13.1883 8.91344L11.5777 7.27282C14.1116 7.1073 16.3 9.0273 16.4656 11.5613C16.4808 11.7948 16.4783 12.0291 16.4579 12.2622C16.3608 13.3421 16.741 14.4105 17.4985 15.1863L21.3943 19.2006C21.6287 19.4422 22.0145 19.4479 22.2561 19.2135C22.4976 18.9791 22.5033 18.5933 22.2689 18.3517Z\",\n fill: \"#979797\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_701_19182\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n fill: \"white\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgConfigureWp);\nexport default __webpack_public_path__ + \"static/media/configureWP.0a101a32ced61ea765f958764a1511d1.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgLight(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 22,\n viewBox: \"0 0 20 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11 1L1 13H10L9 21L19 9H10L11 1Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgLight);\nexport default __webpack_public_path__ + \"static/media/light.59ddce95c25c71fd95edcc7979865e77.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgGraph(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 20,\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.7776 13.3347V15.5547C17.7776 18.0083 15.7876 20 13.3333 20V17.7767C14.5596 17.7767 15.5556 16.7814 15.5556 15.5547V13.3347C15.5556 11.9993 16.1566 10.815 17.0889 10C16.1566 9.18535 15.5556 8.00267 15.5556 6.66667V4.44466C15.5556 3.21732 14.5596 2.22233 13.3323 2.22233V0C15.7853 0 17.7776 1.989 17.7776 4.44466V6.66667C17.7776 7.89401 18.7736 8.889 19.9999 8.889V11.1123C18.7716 11.1123 17.7776 12.1077 17.7776 13.3347Z\",\n fill: \"#c6c6c6\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.44564 13.3333V15.5557C4.44564 16.783 5.44167 17.778 6.66894 17.778V20C4.21465 20 2.22331 18.011 2.22331 15.5557L2.22233 13.3333C2.22233 12.106 1.22734 11.1113 0 11.1113V8.889L0.000976562 8.88802C1.22832 8.88802 2.22331 7.89303 2.22331 6.66569V4.4457C2.22331 1.99238 4.2123 6.48499e-05 6.66764 6.48499e-05V2.22337C5.4403 2.22337 4.44564 3.21836 4.44564 4.4457V6.66569C4.44564 8.00137 3.84427 9.18535 2.9123 10C3.84434 10.815 4.44564 11.9983 4.44564 13.3333Z\",\n fill: \"#c6c6c6\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgGraph);\nexport default __webpack_public_path__ + \"static/media/graph.0761d73dd7c891f0e3ec164e8247a333.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _mask, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgAi(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 32,\n height: 32,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.8394 8.89558C10.743 8.64412 10.5051 8.47858 10.2401 8.47852C10.24 8.47852 10.24 8.47852 10.2399 8.47852C9.97502 8.47852 9.73706 8.64392 9.64051 8.89538L7.74 13.8443C7.61043 14.1816 7.77379 14.562 8.10482 14.6941C8.18187 14.7248 8.26123 14.7393 8.33924 14.7393C8.59651 14.7393 8.83942 14.5811 8.9388 14.3223L9.26114 13.483H11.2173L11.5392 14.3221C11.6686 14.6595 12.042 14.8262 12.373 14.6941C12.7042 14.5622 12.8676 14.1818 12.7381 13.8445L10.8394 8.89558ZM9.76493 12.1712L10.2397 10.9349L10.7141 12.1712H9.76493Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.5442 14.7394C14.8683 14.7394 15.1312 14.4457 15.1312 14.0835V9.13441C15.1312 8.77216 14.8683 8.47852 14.5442 8.47852C14.2201 8.47852 13.9573 8.77216 13.9573 9.13441V14.0835C13.9573 14.4457 14.2201 14.7394 14.5442 14.7394Z\"\n })), _mask || (_mask = /*#__PURE__*/React.createElement(\"mask\", {\n id: \"path-3-outside-1_537_19303\",\n maskUnits: \"userSpaceOnUse\",\n x: 1,\n y: 1,\n width: 20,\n height: 20\n }, /*#__PURE__*/React.createElement(\"rect\", {\n fill: \"white\",\n x: 2,\n y: 2,\n width: 20,\n height: 20\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9308 18.9359V19.6209C12.9308 19.6246 12.9252 19.6299 12.9221 19.6299H12.103C12.1016 19.6299 12.1002 19.6299 12.0987 19.6299H11.0779C11.0749 19.6299 11.0692 19.6246 11.0692 19.6209V18.9359C11.0692 18.6334 10.8586 18.3714 10.5622 18.3049C9.83429 18.1416 9.14564 17.857 8.51549 17.4589C8.40837 17.3911 8.28748 17.3581 8.16736 17.3581C7.99941 17.3581 7.83288 17.4228 7.70744 17.5477L7.21892 18.0341C7.21612 18.0369 7.20988 18.0369 7.20709 18.0341L5.90266 16.7351C5.90019 16.7326 5.90019 16.7247 5.90266 16.7223L6.39118 16.2358C6.60619 16.0217 6.64324 15.6879 6.48035 15.4322C6.08055 14.8046 5.79463 14.1188 5.63064 13.3938C5.56389 13.0987 5.30052 12.8891 4.99653 12.8891H4.30866C4.3056 12.8891 4.29995 12.8838 4.29995 12.88V11.0436C4.29995 11.0399 4.3056 11.0346 4.30866 11.0346H4.99653C5.30052 11.0346 5.56389 10.8249 5.63064 10.5298C5.79463 9.80489 6.08055 9.11906 6.48035 8.49138C6.64324 8.2357 6.60619 7.90187 6.39118 7.68784L5.90266 7.20143C5.90012 7.19891 5.90012 7.19101 5.90266 7.18856L7.20709 5.88961C7.20988 5.88683 7.21612 5.88689 7.21892 5.88961L7.70744 6.37602C7.92271 6.59031 8.25855 6.62718 8.51555 6.46489C9.14577 6.06677 9.83442 5.78211 10.5622 5.61885C10.8587 5.55236 11.0693 5.29027 11.0693 4.98788V4.30289C11.0693 4.29914 11.075 4.29384 11.078 4.29384H12.9222C12.9252 4.29384 12.9309 4.29914 12.9309 4.30289V4.98788C12.9309 5.29033 13.1415 5.55242 13.438 5.61885C14.1658 5.78204 14.8544 6.06671 15.4846 6.46489C15.7415 6.62725 16.0775 6.59038 16.2928 6.37602L16.7813 5.88961C16.7841 5.88683 16.7903 5.88689 16.7931 5.88961L18.0975 7.18856C18.1001 7.19108 18.1001 7.19897 18.0975 7.20143L17.609 7.68784C17.394 7.90194 17.357 8.23576 17.5198 8.49138C17.9196 9.11906 18.2056 9.80489 18.3696 10.5298C18.4363 10.8249 18.6997 11.0346 19.0037 11.0346H19.6915C19.6946 11.0346 19.7002 11.0399 19.7002 11.0436V12.88C19.7002 12.8838 19.6946 12.8891 19.6915 12.8891H19.0037C18.6997 12.8891 18.4363 13.0987 18.3696 13.3938C18.2056 14.1188 17.9196 14.8046 17.5198 15.4322C17.357 15.6879 17.394 16.0217 17.609 16.2358L18.0975 16.7223C18.1 16.7247 18.1 16.7326 18.0975 16.7351L16.7931 18.034C16.7903 18.0368 16.7841 18.0368 16.7813 18.034L16.2928 17.5475C16.0775 17.3332 15.7416 17.2963 15.4846 17.4587C14.8545 17.8568 14.1658 18.1414 13.4379 18.3047C13.1414 18.3714 12.9308 18.6334 12.9308 18.9359Z\"\n }))), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9308 18.9359V19.6209C12.9308 19.6246 12.9252 19.6299 12.9221 19.6299H12.103C12.1016 19.6299 12.1002 19.6299 12.0987 19.6299H11.0779C11.0749 19.6299 11.0692 19.6246 11.0692 19.6209V18.9359C11.0692 18.6334 10.8586 18.3714 10.5622 18.3049C9.83429 18.1416 9.14564 17.857 8.51549 17.4589C8.40837 17.3911 8.28748 17.3581 8.16736 17.3581C7.99941 17.3581 7.83288 17.4228 7.70744 17.5477L7.21892 18.0341C7.21612 18.0369 7.20988 18.0369 7.20709 18.0341L5.90266 16.7351C5.90019 16.7326 5.90019 16.7247 5.90266 16.7223L6.39118 16.2358C6.60619 16.0217 6.64324 15.6879 6.48035 15.4322C6.08055 14.8046 5.79463 14.1188 5.63064 13.3938C5.56389 13.0987 5.30052 12.8891 4.99653 12.8891H4.30866C4.3056 12.8891 4.29995 12.8838 4.29995 12.88V11.0436C4.29995 11.0399 4.3056 11.0346 4.30866 11.0346H4.99653C5.30052 11.0346 5.56389 10.8249 5.63064 10.5298C5.79463 9.80489 6.08055 9.11906 6.48035 8.49138C6.64324 8.2357 6.60619 7.90187 6.39118 7.68784L5.90266 7.20143C5.90012 7.19891 5.90012 7.19101 5.90266 7.18856L7.20709 5.88961C7.20988 5.88683 7.21612 5.88689 7.21892 5.88961L7.70744 6.37602C7.92271 6.59031 8.25855 6.62718 8.51555 6.46489C9.14577 6.06677 9.83442 5.78211 10.5622 5.61885C10.8587 5.55236 11.0693 5.29027 11.0693 4.98788V4.30289C11.0693 4.29914 11.075 4.29384 11.078 4.29384H12.9222C12.9252 4.29384 12.9309 4.29914 12.9309 4.30289V4.98788C12.9309 5.29033 13.1415 5.55242 13.438 5.61885C14.1658 5.78204 14.8544 6.06671 15.4846 6.46489C15.7415 6.62725 16.0775 6.59038 16.2928 6.37602L16.7813 5.88961C16.7841 5.88683 16.7903 5.88689 16.7931 5.88961L18.0975 7.18856C18.1001 7.19108 18.1001 7.19897 18.0975 7.20143L17.609 7.68784C17.394 7.90194 17.357 8.23576 17.5198 8.49138C17.9196 9.11906 18.2056 9.80489 18.3696 10.5298C18.4363 10.8249 18.6997 11.0346 19.0037 11.0346H19.6915C19.6946 11.0346 19.7002 11.0399 19.7002 11.0436V12.88C19.7002 12.8838 19.6946 12.8891 19.6915 12.8891H19.0037C18.6997 12.8891 18.4363 13.0987 18.3696 13.3938C18.2056 14.1188 17.9196 14.8046 17.5198 15.4322C17.357 15.6879 17.394 16.0217 17.609 16.2358L18.0975 16.7223C18.1 16.7247 18.1 16.7326 18.0975 16.7351L16.7931 18.034C16.7903 18.0368 16.7841 18.0368 16.7813 18.034L16.2928 17.5475C16.0775 17.3332 15.7416 17.2963 15.4846 17.4587C14.8545 17.8568 14.1658 18.1414 13.4379 18.3047C13.1414 18.3714 12.9308 18.6334 12.9308 18.9359Z\",\n strokeWidth: 2,\n mask: \"url(#path-3-outside-1_537_19303)\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgAi);\nexport default __webpack_public_path__ + \"static/media/AI.f599f6660b2eafb1f7c9c297531b8fec.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgSettings(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.4 15C19.2669 15.3016 19.2272 15.6362 19.286 15.9606C19.3448 16.285 19.4995 16.5843 19.73 16.82L19.79 16.88C19.976 17.0657 20.1235 17.2863 20.2241 17.5291C20.3248 17.7719 20.3766 18.0322 20.3766 18.295C20.3766 18.5578 20.3248 18.8181 20.2241 19.0609C20.1235 19.3037 19.976 19.5243 19.79 19.71C19.6043 19.896 19.3837 20.0435 19.1409 20.1441C18.8981 20.2448 18.6378 20.2966 18.375 20.2966C18.1122 20.2966 17.8519 20.2448 17.6091 20.1441C17.3663 20.0435 17.1457 19.896 16.96 19.71L16.9 19.65C16.6643 19.4195 16.365 19.2648 16.0406 19.206C15.7162 19.1472 15.3816 19.1869 15.08 19.32C14.7842 19.4468 14.532 19.6572 14.3543 19.9255C14.1766 20.1938 14.0813 20.5082 14.08 20.83V21C14.08 21.5304 13.8693 22.0391 13.4942 22.4142C13.1191 22.7893 12.6104 23 12.08 23C11.5496 23 11.0409 22.7893 10.6658 22.4142C10.2907 22.0391 10.08 21.5304 10.08 21V20.91C10.0723 20.579 9.96512 20.258 9.77251 19.9887C9.5799 19.7194 9.31074 19.5143 9 19.4C8.69838 19.2669 8.36381 19.2272 8.03941 19.286C7.71502 19.3448 7.41568 19.4995 7.18 19.73L7.12 19.79C6.93425 19.976 6.71368 20.1235 6.47088 20.2241C6.22808 20.3248 5.96783 20.3766 5.705 20.3766C5.44217 20.3766 5.18192 20.3248 4.93912 20.2241C4.69632 20.1235 4.47575 19.976 4.29 19.79C4.10405 19.6043 3.95653 19.3837 3.85588 19.1409C3.75523 18.8981 3.70343 18.6378 3.70343 18.375C3.70343 18.1122 3.75523 17.8519 3.85588 17.6091C3.95653 17.3663 4.10405 17.1457 4.29 16.96L4.35 16.9C4.58054 16.6643 4.73519 16.365 4.794 16.0406C4.85282 15.7162 4.81312 15.3816 4.68 15.08C4.55324 14.7842 4.34276 14.532 4.07447 14.3543C3.80618 14.1766 3.49179 14.0813 3.17 14.08H3C2.46957 14.08 1.96086 13.8693 1.58579 13.4942C1.21071 13.1191 1 12.6104 1 12.08C1 11.5496 1.21071 11.0409 1.58579 10.6658C1.96086 10.2907 2.46957 10.08 3 10.08H3.09C3.42099 10.0723 3.742 9.96512 4.0113 9.77251C4.28059 9.5799 4.48572 9.31074 4.6 9C4.73312 8.69838 4.77282 8.36381 4.714 8.03941C4.65519 7.71502 4.50054 7.41568 4.27 7.18L4.21 7.12C4.02405 6.93425 3.87653 6.71368 3.77588 6.47088C3.67523 6.22808 3.62343 5.96783 3.62343 5.705C3.62343 5.44217 3.67523 5.18192 3.77588 4.93912C3.87653 4.69632 4.02405 4.47575 4.21 4.29C4.39575 4.10405 4.61632 3.95653 4.85912 3.85588C5.10192 3.75523 5.36217 3.70343 5.625 3.70343C5.88783 3.70343 6.14808 3.75523 6.39088 3.85588C6.63368 3.95653 6.85425 4.10405 7.04 4.29L7.1 4.35C7.33568 4.58054 7.63502 4.73519 7.95941 4.794C8.28381 4.85282 8.61838 4.81312 8.92 4.68H9C9.29577 4.55324 9.54802 4.34276 9.72569 4.07447C9.90337 3.80618 9.99872 3.49179 10 3.17V3C10 2.46957 10.2107 1.96086 10.5858 1.58579C10.9609 1.21071 11.4696 1 12 1C12.5304 1 13.0391 1.21071 13.4142 1.58579C13.7893 1.96086 14 2.46957 14 3V3.09C14.0013 3.41179 14.0966 3.72618 14.2743 3.99447C14.452 4.26276 14.7042 4.47324 15 4.6C15.3016 4.73312 15.6362 4.77282 15.9606 4.714C16.285 4.65519 16.5843 4.50054 16.82 4.27L16.88 4.21C17.0657 4.02405 17.2863 3.87653 17.5291 3.77588C17.7719 3.67523 18.0322 3.62343 18.295 3.62343C18.5578 3.62343 18.8181 3.67523 19.0609 3.77588C19.3037 3.87653 19.5243 4.02405 19.71 4.21C19.896 4.39575 20.0435 4.61632 20.1441 4.85912C20.2448 5.10192 20.2966 5.36217 20.2966 5.625C20.2966 5.88783 20.2448 6.14808 20.1441 6.39088C20.0435 6.63368 19.896 6.85425 19.71 7.04L19.65 7.1C19.4195 7.33568 19.2648 7.63502 19.206 7.95941C19.1472 8.28381 19.1869 8.61838 19.32 8.92V9C19.4468 9.29577 19.6572 9.54802 19.9255 9.72569C20.1938 9.90337 20.5082 9.99872 20.83 10H21C21.5304 10 22.0391 10.2107 22.4142 10.5858C22.7893 10.9609 23 11.4696 23 12C23 12.5304 22.7893 13.0391 22.4142 13.4142C22.0391 13.7893 21.5304 14 21 14H20.91C20.5882 14.0013 20.2738 14.0966 20.0055 14.2743C19.7372 14.452 19.5268 14.7042 19.4 15V15Z\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgSettings);\nexport default __webpack_public_path__ + \"static/media/settings.515228262963cf3016adc21a72569702.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgClock(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n fill: \"url(#pattern0)\"\n })), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"pattern\", {\n id: \"pattern0\",\n patternContentUnits: \"objectBoundingBox\",\n width: 1,\n height: 1\n }, /*#__PURE__*/React.createElement(\"use\", {\n xlinkHref: \"#image0_871_19571\",\n transform: \"scale(0.00195312)\"\n })), /*#__PURE__*/React.createElement(\"image\", {\n id: \"image0_871_19571\",\n width: 512,\n height: 512,\n xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAgAElEQVR4Ae2dCdx1U/X4v+Z5isicJmkiFD9F86D8KpKKZCj6aVJJs1KaJw1K0aR50KxJQkpJIpRkSlKSOWT2/3+W7uV5n/fe57nDGfbe57s/n/e997n33H3W+u5hrXPO3muBRQISkIAEJCABCUhAAhIoisCiwNLAMsBywPLACsBKwMrAKsCqwGrA3YE1eu+XBRYpioTKSEACEpCABDIjEIb7vsA2wLOBfYDXAm8HPgJ8DvgW8FPgN8CfgL8D/wZuB/7fhP/it9cDlwEXAmcBvwV+DvwQOBI4AjgEeDPwIuAZwJbABkA4ERYJSEACEpCABGYRWLxn2B8N7AzsB7wf+DJwHPDnnhGf1ICn8LtrgfOAXwLfBD4OHADs0nMU4s6DRQISkIAEJFAkgTWBRwF79wz893vG/ZYJr8xTMOxVynAN8Dvg68A7gRcA4RSt42OIIseDSklAAhIojkDcpo9b9HE7/EvAKQVcwVdp6Cep6wbgTOCLwKuBx/XWLBTXeVRIAhKQgATyIBC3rp8KvBX4MXCFV/MTrzWYxDH4G/A94G3A9r01B3n0HKWUgAQkIIFsCMQq+q2AVwBfAc7X2Ddq7Ed1EK4Gjgc+0HMKVs+mhymoBCQgAQm0TiC2vm0E7N5bsBbPpm/W4Cdp8EdxDM4GPgXsBtyr9d6lABKQgAQkkAyBuEp8OvAO4BggFqSNYlg8Jk9O/wC+BrwM2ASIOAkWCUhAAhLoAIG4wt+89+z49xr7zjs74fB9txfDYN0O9H9VlIAEJNApAvEMPxbsfbIXIMer9zyv3ptotzOAdwFbA4t1apSorAQkIIFCCMSt/T2B7/Si2TVhPDxHWY7FlcBXgV17YZILGRqqIQEJSKA8Ag8EXg/8CrjN2/udv71fpUMW/emkXhTDWCRqkYAEJCCBFglEKN3HAAe7NU9j37DDdzrwBuDeLfZ/Ty0BCUigUwQii91zevHyr2p40q/yitK6ynlcEBEf9wfW79RIVFkJSEACDRCIrHKxLz+26bknvxzDWZoTFNkT4/HTvsBaDYwLTyEBCUigWAKxTzuyx0WEt9KMhfqU3aaxZiDSJr8QWL7YEVqtYncDHg5sZhKoasFamwRyIbBCL2te5J3XSMqghD4QKZEP68WfyGUcNiln7Nj5LBCJn/rtfSGwXZNCeC4JSKA9AuH5Hw7EZNmfBHyVRWl94DTgxUCsZbHAFkAkdhrUzrf2smvKSQISKJDAysBLgFhRPWgC8DO5lNoHru9d9f5PgeN6VJUeMEK67Hj8d49RK/Q4CUggfQKPBI4A/qPh1/GxD/CH3sLBVdIfupVJGM/7zxux7ePxgEUCEsiYwKrAK4GzRhz0pV75qZd3NYb1gbgrcEhHYgtEhM5hHGZ/HmsDfGSS8eSv6N0kEIl3IlDPl4EbxxjwsycA/x59spRV/qxiB8E3gVIfD+wxwVywVzenULWWQH4ElgT+Dzh3goGuAcvfgNmG1bXhicAOBaUtvucIz/0H9Z+f5DcNKrEEukWgb/j/quEf+fbmoMnOz6ozoKWwDGc6dg9EUKxcy6LACRPODfEYYJlcFVduCZRMoG/4L5pwcJcySauHhrvuPnA5cBCwRoYTSoRLnobPkzLUWZElUCyBMPz7ABr+6Sa2aSZFf9tN9rGD5gMZpSl+CHDTlA7AB4udSVVMAhkR0PB30+jobKTX7tcB7wJiW12qJeaLKmJ9xA4iiwQk0BKBpXrPIYdF7tJApGcgbJNutMk1wFsT3S73nimv/Gf24XVbmvs8rQQ6S0DD3w0jMnOi9X2ebX4l8MaEEhBtDcS2xqr6UyRXskhAAg0QCMMfoXq94q9uAqtqIrQe22SuPnAZEIvu2tw1EIm9LqjQ+Ie+32hg3vMUEug0AQ2/xmUu4+J3+fSPfwIvAxZvYUb7dMXGP/rdVcBiLejiKSVQPIG+4b+4hoGr0cjHaNhW5bVVLKB7coMz2NNrnENKjZDYYPN4KgksSOCJwDk1DlqNSnlGxTbNr01/AGy44NCv/K/VgX/VOJccWLnEViiBjhJYC/hajYNVI5GfkbDNym6zm4GDgUjHXUf5bs3zyUl1CG2dEugSgXiOFtn5/l3zYNWYlG1MbN982zcWCkbOjiqfqe/ZwHwSuwpSjnvQJTuirhkS2KqiwBxO/vlO/radbdfvA2cAj61gHtugwQuKnSqQ1yok0CkCqwKfAm5vwEvvTy6+amjsA3n0gW8Dka1vkhKJfn7R4LwSOwwsEpDACAQWASKARiQScTKWgX3APjCsD1wP7DfBY4HXNDy3xE4liwQkMA+BjYFfNTw4h00ufq7hsQ/k0Qd+B2w6z9zS/7qKRD+T9IsH9gXwVQISWJBAROGKlb63avy962EfsA9M0Adi7nj/PNEEI3ZIrCGYxIBP+5u4U2GRgARmEXg28PeWBuW0g9rftzOZyl3uw/pAhPN90qw5pv/ne1ucZ47uC+GrBCQA9wViUAwbyH5eDpt4VhthXs8FTgV+Dnwf+DLwyd6V25t7Wz1j/Uc4hU8BIjnLI4DHABH8aTtg+973zwNiG9eLeuFj4wrrdUDUcxAQWd3irtIXgGOAP/TWlbiotJx+Ndcc8UXg7jMm2m0qTvQz17kHfXcDsMwMeXwrgU4SWBp4G3Cjxr8I5ycCtZwP/Ky3a+NNQBjnRwLrTLBAq+5BEfneI03rw4CnAXv3nIZDgVhZ/mvgQiAm7EETuZ/lwyUWEu8GrAj8JYH2bDK8cd3jyPolMDaBWOR3dgID0Ul89En8ll6WtGOBz/SM5fN7V+dhSGNLVakltqLGXYh9gEOA492dkqVTdGkic07ckbJIoJMEXupVf/KT503Ab4FPAHsBDwWW6GRvnVvpewCPB17Ru+sRdw2MUjm6U9lVBzySHFkk0CkCEQYzbq12ddCnqncY+1NmGPvYRqWxn3xoRvyK9YGnAq/trT34o/3ecT+rD6w3eRfzlxLIi0A8B75o1gBI1SCWLFff2MeCu3jmHcY+noVb6icQC9F2BD7a24LmIsRuXwzEnTWLBIomEM+FYzGY+/rbmezCyMTV/dt7z7A19ukMt1hXEDsZPgSc1vLK9JKd3lR1OzKdrqgkEqiewJpALBhLdQCWKtclwBHAzrO2P1XfwtZYJYFVersRPtBz2nSay547rkpwZ0yV/dm6OkxgW+BfGv9GnJ+4rR9b7yKueeyuiGfQlvwJxJa1iIHwPuDPjqVGxlLTFwWR4dQigWIIxOKxCMPp8816r17O6T1LjoVmyxXTe1RkLgIRuz7iZvxJZ6AYZ+CtczW430kgJwL3Bk52cqptcgq2+wKRv9zSbQKRUObAXlTDpq9aPV91zv1vut2N1b4UAs8BrtH4V278zwPiKuF+pXQU9aicwEbAAS0mt9EhmNwhuA2I7dEWCWRJYNleABQngckngdnsYu1ERJvbMsseodBtEghH8Y29XQWz+5V/VzdGq2QZ+S4sEsiOwIOBiGhV5WDoal2RJCcS4sSir8Wz6wkKnCKB+/SSIjlG056jIqy2RQJZEYjMayZJmW5iiW1ePwZ2BZbPqvUVNjcCkUUx9p1HPoeuOtmp6h0p0C0SyIJABPb5sJPIVJNopKONxXxrZNHiClkSgbV7OwkiVkSqBrGLcj2opE6mLmUSiBzWxvKffOKMq/3IZW+RQNsEYrtuLNz9hY5AEo7Qq9vuEJ5fAnMRiDjmJzlZjD1ZxGOSw4HYtmWRQIoEIr5A5Ia4zvE99viu6m7FT1PsGMokgSAQK4vPd3IYa3KIvONvMRSvAygjAiv1Hk0ZdXDyu3yTOgQ3ArGjyiKBpAhEFr8rNP4jG/8zgT2BpZJqRYWRwOgEIpT0E4DvmKBo5HE/qeGf+bsIn26RQDIEdgLCM53ZSX2/MI8Ie/yj3qSZTOMpiAQqIHB/4KuG9m5kDoyskBYJJEFgfwf9vIM+nu8fBjwgiRZTCAnURyBifnzLOWHeOWGaC6TI8WCRQKsEFgM+5lX/nAP95l6kPrfxtdpVPXkLBDYFjnJ+mHN+mMYJWL+FNvWUEriDQGSV+76De+jgjlv9Ea3vXvYXCXScwBbA0c4VQ+eKSZ2AvTver1S/JQJxNftbB/TQAR3P+DdpqW08rQRSJbA1cLzzxtB5Y1xH4JupNrRylUsgson9xUE8cBBH7INHl9v0aiaBSgg8DjjROWTgHDKOE3C1uUAq6Y9WMiKBRwFXOnAXGrixIGeHERl6mAQk8F8CsZXNO4kL7xQaxwl4hJ1JAk0Q2Bm4SeO/gPG/GHghEIshLRKQwGQEng6c69yywNwyqhPwtsmQ+ysJjE7g9W7pWWBwxl2Q2Pq49OgIPVICEpiDQATDOtBYIgvMM6M4ASfPwdSvJDA1gYP0zO8clLGl7z3AylNTtQIJSGAQgfsAP3HOuXPOmc8JuA1YdRBIP5PAtATe4EC8cyDGAr8IcGKRgATqJxCRRf/u/HPn/DOXIxCZGi0SqJTAqxx8dwy+fwMvBRatlK6VSUAC8xFYATgYuNW5aE5H4LPzgfR7CYxD4CUOuDsG3HeBdcYB57ESkEDlBDYGfu2cNNQJiDslFglUQuAFLvjjH8COldC0EglIoAoCkXVwL7ONDnUCfDxZRS/reB3P63hKzwjf+wkgcp1bJCCB9AisBnzGi5SFHIHYlWSRwMQEntXxZ21nAY+cmJ4/lIAEmiQQY/VMHwvc6Qgc0yR8z1UWgacBscVtrpWmpX4XwY3eAixZVpOqjQSKJxDZBuOuXalz0zh63QgsW3yLq2DlBJ7c4Qh/vwAit4FFAhLIi0A47Kdr/Bdwfp6SVxMqbdsEHgv8p4ODKK769wViYZFFAhLIj8C7OzhvzXdH4MP5NaMSt0UgnqFd18FBFJkMN28LuueVgASmJhBzV0TAm88gdu37s6cmawWdIPBwIALcdG2AxL7+VTrRwiopgTIJLA+c38G5a9S5+p5lNrtaVUXgocBVHRtAt/SS93jLv6peZD0SaIfA4R2bu0Y1/P3jXtROs3jWHAg8CLisYwMoomS5vS+H3qmMEpibwHYdm7v6Rn2c12/NjdBvu0pgQ+CfHRtARwN372qDq7cECiIQAYC6Nn+NY/j7x14DLF5Qu6tKBQTWBS7ukPGPBUKRW9wEPhV0HquQQAIE4sq2b+R8nZuFdzwT6LCpiLAM8LsODZ5/AU9IBb5ySEACUxPYrUPzVxXOzUFTE7eCYgh8pUODJwL7rF1My6mIBCSwHhC3taswjF2p47d2GwkEgdd1ZOBEOND3+uzLTi+BogjErp1jOzKHVemcxCPQWDNh6TCBp3YkWMaVQOQysJRJYDHgvsCjgOcC+wA7AFt6t6fMBp+h1Ss1/hPf+dhpBkffdozA/Tty2yzWNhj4orzOvTSwPfA54PJ5jMCfe3d/tioPQ6c1egBwwzxtX+VVc2l1vbPTvafDyq8MnNOBgfNjYLkOt3OJqseujd2Biybsvyca86GIbrFExxYu1+F8RNRTS8cIxO3SMIx1dKiU6vwSEJOEpRwCDwbOqKjvxpYxQz7n2zfeXlE/SGnOalqWGEuWjhF4fwcGzsFm8SuuVz8DuLbivhuPBu5XHKnyFYq1HbdW3BeaNr4pnO/k8ruKGs4ksGsHBk3sarCUReBlQOziqGPSjAWiZn7Mp78s25HHl3X09dl1xu4JS0cIRHa/khfMxBXBHh1pyy6p+ZQGdqpELoi1ugQ1Y10/XpMjONs4duHvT2bcDxR9DAJrAjHJldqp/wP87xg8PDQPAk3uVPkNEDsLLOkSeHLBc1gbc/OO6Ta1klVFYCngpIIHTtzCfURVsKwnKQI/b7jfvj4p7RVmJoG7FX4R07QDcL2LYGd2r3Lfxz7ppjtXU+eL5EWRvthSHoEIUtVUP+qf52pg1fJQFqHR11roD/1+UeLrO4roFSoxJ4GSo2SdDaw/p/Z+mTOBqrb7jTt5vy9naIXKvrPGv1Jn+BJgxUL7imr1CES2u1K3ysTzWuNYl9vVN2txwo9MkRErw5IGgTWAq1rsD+M6kKkfH7f+H5ZG0ypFXQTuA8Sz8dQ74yTyGd2vrl6TTr1va7nvRk4BSxoEDm+5L0wyR6X6m+uA7dJoVqWoi0Dc2vljoYPG6H519Zq06j295f77obRwdFaajRvYApqqsa5arlOBDTvbkzqk+Pdanjyr7rj9+j5ldL9O9OK4/d72oysDpKTR1T5a6FzWn9OaeI3HpbsYFj2NDl23FPsWOmC+6XPZurtOMvVHQJ4mJsa5znFWMjS6K8giQOzymaud/O6/fCIOyl96270jwU+Eew+jH3E0LB0hsAlwY4ED5hggYhlYukEgFii1PbHH+hlLuwRWSKAftNkP/w2cC/wSiMRVhwIHAvsAO/Rin8Rar+Bk6TiBiI8d2+La7LB1nDuSVSzf8bbtmvpPSqQfd417avpGPIY65pQ26wzH8k/A8cDXgXjE8SZgL+BpwBbAPYFlUmsM5UmbQDwfb7Nj13HuuA1rUJa0+10d0qUS7rUO3axzPAKRrbGOuaWqOm8DYtvomUDcqYxFypGJNBKSRV6SyGMRW1rXAZYcT3WPlsBoBOJ2UFUdOpV6LuwNmtEIeFRJBHQASmrN6XR5YQtz2y3AP4DTgNhyfAQQwaFeDUQ21ScCsTvhHq5Lmq5x/fX0BO7e80BTMdxVyHGpOdqn7xgZ16ADkHHj1SD6AcBNUzoC8fuLgN8CRwGfBt4FvAJ4LvBY4IG94GKx+NAigSwIHDnlwKjCYFdZxzXAQ7Mgr5B1EdABqItsvvVGyO+IXR/bM+OW++VAXChcAPwa+A4QqW0PAl4KPAvYprfvfeV81VZyCQwnEJ5rlca37bpu6A3a4Rr7TRcI6AB0oZXVUQISmJhAPH+6oiAHIJ67/e/ENPxhSQR0AEpqTXWRgAQqJ1BStL/be4trKodkhVkS0AHIstkUWgISaILAbgVd+cdjh4heaJFAn4AOQJ+ErxKQgARmEFi7sNSYkfXNIoGZBHQAZtLwvQQkIIEegdjC0vZivarO/zFbVQIDCOgADIDiRxKQQLcJPKMg4x8BNhbtdnOq/RACOgBDwPixBCTQTQIRGzqyPVV19d1mPX81xG83O/GIWusAjAjKwyQggW4QiCxQbRrtqs4dEbke3o0mU8sJCegATAjOn0lAAuURiOxQESSnKiPcZj2RytIigbkI6ADMRcfvJCCBThH4diHG/wudajWVnZSADsCk5PydBCRQFIHIPNXmFXtV5450mcsW1TIqUxcBHYC6yFqvBCSQDYElgLMLcAAiwc/9sqGuoG0T0AFouwU8vwQk0DqB/Qsw/nEH4Zmtk1SAnAjoAOTUWsoqAQlUTmAt4NoCHID3V07GCksnoANQegurnwQkMCeBLxVg/E8AFp9TS7+UwMIEdAAWZuInEpBARwhsXYDxvwRYsyPtpZrVEtABqJantUlAApkQWAz4feYOwK3AozLhrZjpEdABSK9NlEgCEmiAwEsyN/6x6C8WL1okMCkBHYBJyfk7CUggWwKrAVdm7gB8K1v6Cp4KAR2AVFpCOSQggcYIHJa58T8HWLExWp6oVAI6AKW2rHpJQAIDCWwO3JaxA3ALsOlAzfxQAuMR0AEYj5dHS0ACGRNYBDgpY+Mfz/3fljF/RU+LgA5AWu2hNBKQQI0Eds3c+J8OLFkjH6vuFgEdgG61t9pKoLMEYttfPDuvKulO0/V467+zXbc2xXUAakNrxRKQQEoEdsnY+HvrP6WeVI4sOgDltKWaSEACQwgsCpyVsQPgrf8hDevHUxHQAZgKnz+WgARyILBTxsbfW/859LA8ZdQByLPdlFoCEhiRQKz8PzNjB8BV/yM2tIeNTUAHYGxk/kACEsiJwA4ZG39v/efU0/KTVQcgvzZTYglIYAwCp2XqAESwos3G0NNDJTAuAR2AcYl5vAQkkA2B/83U+Meq/0OzoayguRLQAci15ZRbAhKYl8BvM3UALgfuNq92HiCB6QjoAEzHz19LQAKJEtg2U+MfV/97JcpUscoioANQVnuqjQQk0CPwq0wdgLhrEXELLBKom4AOQN2ErV8CEmicwOMzNf63Aw9vnJYn7CoBHYCutrx6S6BgAidk6gAcXnCbqFp6BHQA0msTJZJAVQRWBJauqrJc6nl0psb/SmC1XCArZxEEdACKaEaV6DiBsBs7A58HTgEuAm7s2cG4q/xP4DfAN4CXAmuXzOvYTB2AF5fcKOqWJAEdgCSbRaEkMC+BJYB9gJOBiBkzTnbacAp+DbwSWG7eM2V0wCPGBDEOtDqPjWBFLvzLqKMVIqoOQCENqRqdIRBp7XcDLqjI1l0C/B+weAkEf1IRlDqN/aC6n1gCfHXIjoAOQHZNpsAdJvAg4I812bg/A1vnzHbjmsAMMthVfnZcztCVPWsCOgBZN5/Cd4jA04Fra7ZxNwF75Mr04zXDqdLoz6xry1yBK3f2BHQAsm9CFegAgTcC8dx+pt2o8/37cnskHQsZrmkQUFXwv9uBzquK6RLQAUi3bZRMAkHg1S3ZtQ/nhP8FLUGaxhGIlZvxTMcigbYI6AC0Rd7zSmB+Ak+ZYIX/NDZp9m93n1/ENI6IrRCzhU/97y+kgU4pOkxAB6DDja/qSRPYKIG72hFLYIukKQGbZGj8bwY2SB2s8hVPQAeg+CZWwUwJxD79FC5iY7vhkikzPDQRUOM01iEpA1W2zhDQAehMU6toRgSelZhNe0mq7GLx378TgzWfI3A9cI9UgSpXpwjoAHSquVU2AwJxtX1+YjbtH8AyKbJ7YWKg5jP+8f17UwSpTJ0koAPQyWZX6YQJ7J2oTds/RWa/TRTWMEcgFlWsmSJIZeokAR2ATja7SidM4JhEbdqFwCIpcXtooqCGGf/4/LCUACpL5wnoAHS+CwggIQKrArckbNci024y5RMJgxrkBMS+//smQ09BJAA6APYCCaRDIMLwDrIdqXz26VRQLZ/h4r8jU4GnHBLoEdABsCtIIB0CRyTuAES03SQWA+6VOKhBHtvD0ulnSiKBOwjoANgRJJAOgWMzsGvPSQHXKRmAmukE/CwFaMoggVkEdABmAfFPCbRI4JwM7NoPW+Rzx6k3zQDSTOMf75/YNjTPL4EBBHQABkDxIwm0ROA/Gdi2W4E1WuJzx2k/mQGkmQ7AqW3C8twSmIOADsAccPxKAg0SWLTlxD8zbdZ871/ZIJcFThWL/67NzAF49gIa+IcE0iGgA5BOWyiJBC7PxLa1dlG7ZyaA+h7U34DF7NcSSJSADkCiDaNYnSRwdkb2rZVU9kdlBCicgDd3shurdC4EdAByaSnl7AKBX2Zk397TdIPE7f8Ipdu/uk79NSI6rdU0JM8ngTEI6ACMActDJVAzgU9lZN8uBmLdQmNlx4zghHPyzcbIeCIJTEZAB2Aybv5KAnUQeGZmNu7xdUAYVucXhTMMjZ9LYCICOgATYfNHEqiFwIrAzRnZuc/XQmFApUsAV2UE5tzUMicNYOpHEtABsA9IIC0Cx2dk564DlmoCX9xqSP2Z/0z59msCiueQwJQEdACmBOjPJVAxgX0zs3VbVqz/wOoOyQhKLFSMtI4WCaROQAcg9RZSvq4RWD3xlMAzL3TjfSNBgWI//ewTp/p3Y89FujYy1LdyAjoAlSO1QglMTSCn7e5fn1rbeSrYPCPjH07JVvPo49cSSIWADkAqLaEcEriLQESPTfUCd7ZcF9wldj3v3p4RjMjmZJFALgR0AHJpKeXsEoGlgaszsXtX1N0wf8gERHhGb60bhvVLoEICOgAVwrQqCVRIIJegQJGbp7Zyn4yMfzgAG9ZGwoolUD0BHYDqmVqjBKogsE0mtu+mKpQdVkdsp5v9zCHVv1vLkDQMnp9LYB4COgDzAPJrCbREYBHgLxnYvwh5X1v5RQYA+g7Jq2ujYMUSqIeADkA9XK1VAlUQOCgD+3dWFYoOqiP2Q96WAYBwAG4H1hmkhJ9JIGECOgAJN46idZ7A/TKwf1+pq5VekIHy/av/n9cFwXolUCMBHYAa4Vq1BCogcFLidvB1Feg4sIrvJ6543/jH64sGauCHEkibgA5A2u2jdBJ4ceJ28HF1NNFywA2JK953ACJ7k6F/6+gF1lk3AR2AuglbvwSmI3C3hG3hxcBi06k3+NdPzcT4hxMQYRstEsiRgA5Ajq2mzF0j8LlE7WEsUqylvDNRhftX/TNfY62CRQI5EtAByLHVlLlrBDZL0B7GwvcN6mqIWFQ308im+j4grFkXBOuVQM0EdABqBmz1EqiIQGo28WsV6bVQNUsA/8nEAThlIen9QAL5ENAByKetlLTbBB6cUJrgyFNQ24XvFpkY/7grYez/bg/K3LXXAci9BZW/SwTelYhtjJ0JtZVXJqLkKI8dHl4bBSuWQP0EdADqZ+wZJFAVgWWA01q2j8cDi1al0KB6jmxZwVEMfxxzKRDxmi0SyJWADkCuLafcXSUQt94vbMlGhvOxUt3gL2lJuVENf/+4z9YNwvolUDMBHYCaAVu9BGogsBFwecN28s9AhOevtdyrYaX6xnyS1x1rJWHlEqifgA5A/Yw9gwTqIHBvIBLxTGK7xv3N6cB6dSgxu87nNaTQuABmHx/R/1acLbx/SyAzAjoAmTWY4kpgBoG4Hf+DGm1mbHP/ELDUjHPW+vbQGpWZbcSn+ftntVKwcgk0Q0AHoBnOnkUCdRJ4Wg13AyLMb8wPjZYzMnEAasuA1ChtT9Z1AjoAXe8B6l8KgYjJvxfwjyltaNjg3YElmwYTtzNum1L4aa7qx/ntVk3D8XwSqIGADkANUK1SAi0SWBp4IvB+4MwR7OktQDzj/wzwpBblvuN2wzhGuK1jI0ph495Rmw3juYsloANQbNOqmATuIBDbBp8OxPq6vYFXAG8AIpjPlkDEFkiivG0Eb6Utoz/zvMcmQUshJDA9AR2A6RlagwQkUAGBWFg309Cm+v7ACvi8QEYAACAASURBVHS1CgmkQEAHIIVWUAYJdJxALGC4LhMH4LEdbyvVL4eADkA5bakmEsiWQIr5jgfdgYj9/8tmS1nBJbAgAR2ABXn4lwQk0AKBl2Vy9f+rFth4SgnURUAHoC6y1isBCYxM4POZOADvHlkjD5RA+gR0ANJvIyWUQPEEfpOJA/CU4ltCBbtEQAegS62trhJIlMBVmTgAqyTKT7EkMAkBHYBJqPkbCUigMgKRYnDQgrvUPosczBYJlERAB6Ck1lQXCWRI4JGZOADfyZCtIktgLgI6AHPR8TsJSKB2Antm4gC8pXYSnkACzRLQAWiWt2eTgARmEXhPJg5AxFO2SKAkAjoAJbWmukggQwLfzsQBWC9DtoosgbkI6ADMRcfvJCCB2gmclYEDcGXtFDyBBJonoAPQPHPPKAEJ9AhEDoCbMnAAzABoly2RgA5Aia2qThLIhMC9MjD+sR3xA5nwVEwJjENAB2AcWh4rAQlUSmDbTByAXSvV2sokkAYBHYA02kEpJNBJAvtm4gA8pJOto9KlE9ABKL2F1U8CCRP4eAYOwO2mAE64BynaNAR0AKah528lIIGpCByTgQNw8VQa+mMJpEtAByDdtlEyCRRP4KIMHIDji28FFewqAR2Arra8ekugZQLLAnF7PbWkP7PlObxlTp5eAnUR0AGoi6z1SkACcxLYOAPjH87Aa+fUwi8lkC8BHYB8207JJZA1gZ0ycQB2yJqywktgOAEdgOFs/EYCXSKwJPA4YB/g/UCE6D8ZOA6ITLif633+DGClKsC8IRMHwC2AVbS2daRIQAcgxVZRJgk0Q2AR4JHAJ4AIdz/78fewv28FTgReB6w8qagfGuOEwwRp4vNYq2CRQIkEdABKbFV1ksD8BGLs/6kCG3wN8HZg1flPueARn6/g5HU7AH9fUGT/kkBRBHQAimpOlZHAvAQi/P53a7C91wIvmffsMw44qgYhqnYIfj5DXt9KoDQCOgCltaj6SGA4gecAN9Rsd78OrDhchLu++VXNglThDHz5LnF9J4HiCOgAFNekKiSBgQRe1eC2+3OBjQZKMePDKp4/VGHk56rj4Bny+lYCpRHQASitRdVHAgsTiFX9c9m5Or6LIH9rLyzKXZ9c2oJQ4yoaqxwtEiiVgA5AqS2rXhL4L4GXtmhnT5/rccAtLQo2qiOwu71IAgUT0AEouHFVrfMEHgbc1LKd/SkQ2w0XKCu0LNSoDsC2C0jtHxIoi4AOQFntqTYS6BO4G3BhInZ2z75Q/df1ExFsPkdg077AvkqgQAI6AAU2qipJAPhgQjb2X7MDBj00IeHmcgLmXMRgN5NA5gR0ADJvQMWXwAACqwPXJ2ZjPzpTzog5PJfhTeG7yFS4xEyhfS+BwgjoABTWoKojAeC9CdrXm4F4LHFHeVaCAs52Oi7vC+urBAoloANQaMOqVmcJLA9cl6h9fVG/VeLNbIOb2t9/7AvrqwQKJaADUGjDqlZnCTw1Ydt6Z2Td1ycsZN8R+UVnu5CKd4WADkBXWlo9u0Iggtf1bVhqr/FYfZ1oiPclLGQf2o+60mPUs7MEdAA62/QqXiiBMxK3rdsH908nLmQ4AUcW2kFUSwJ9AjoAfRK+SiB/ApGEp38Bm+rrawLztzMQ9HP59wc1kMCcBHQA5sTjlxLIikCk+k3V8PflOjyIxmKA/gepvh6SVdMrrATGJ6ADMD4zfyGBVAlsnoFdPS7gnZmBoO9JtZWVSwIVEdABqAik1UggAQJPyMCuRoIg/pKBoAck0KCKIIE6CegA1EnXuiXQLIEc4uvExT/nZ+AAvKrZtvNsEmicgA5A48g9oQRqI5CDA3BHfJ3zMnAA9q6tmaxYAmkQ0AFIox2UQgJVEHhmBnb1T6HoORkIunMVLWIdEkiYgA5Awo2jaBIYk8AzMrCrfw6d4r9UV//35dphTPgeLoHcCKTiACyZGzjllUCCBJ6WgV09N7jFbYC+oU319dkJNrAiSaBKAqk4ALEoeA9gsSqVsy4JdIxAynkA+nY+1v8RCwH6H6T6ulvHOo/qdo9AKg5Afw6IO4PPARbpXlOosQSmJrBtBnY1nH3+kIGgLgKcuj9aQeIEUnMA+o5AxDN/euLsFE8CqRF4UgZ29a8BLfWEBTERvSy11lUeCVRMIFUHoO8InAzEpGaRgATmJ/D4DByAv4Uav89A0P3n5+0REsiaQOoOQN8ROAHYJmvSCi+B+gk8NgO7+vfAcFoGgr6p/vbyDBJolUAuDkDfETgaeHirxDy5BNIl8KgM7Oolge93GQj69nTbWckkUAmB3ByAviPwXeAhlRCwEgmUQ2DrDOzqpYH7lAwEfV85/UJNJDCQQK4OQDgCtwNfBTYcqJkfSqB7BLbKwK5eFs0Si3v63nyqrx/pXv9R444RyNkB6M8btwKfBTboWNuprgRmE4jHY/1xkerrFSH0SRkIethsuv4tgcIIlOAA9Ce6m4FDgbULayPVkcCoBMIJ7o+HVF8vD2V+nYGgR4xK3eMkkCmBkhyA/oR3A/BB4O6ZtoliS2BSAktnYFcjBAAnZiBoPF+0SKBkAiU6AH1H4DrgHcAqJTeguklgFoG4wu6PgRRfvx/y/jJxIQPcd2aB9U8JlEagZAegP/ldDRwArFBa46mPBAYQSD3I3iEhcwT26A/QVF9/NACuH0mgJAJdcAD680usPn41sExJDaguEphFIOxWv8+n+LpfyHt84kIGuONmgfVPCZRGoEsOQH8y/AfwEsAUxKX1ZvUJAi9P3LY+IIT8WeJCxmTxK/uTBAon0EUHoO8IXAjsCSxeeBurXrcIxOLX2BHT7+cpvUYW4DvKNxIVcCasiFZokUDJBLrsAPTH+jnAzsCiJTe0unWKQKxf6/fvlF4P7LdC7NdNSbBBstzprfSF9lUChRHQAbhrHjoT2L6w9lWdbhKIfjzIprX52W3A/frNcVCCAs6Gc15fWF8lUCgBHYCFJ8oIUx5cLBLIlUCsb7k4MRv7yZkw901MuNnGP/6+I2/xTKF9L4HCCOgALOwA9OeC2Koc2dUsEsiRQEpjO7biLhCYa5cMHIDrc2x1ZZbAGARWBN4FRNCcvuHzdUEWPwW2GIOph0ogFQJx1Z3CeH7lbCBPSkSw+eCsPltw/5ZAgQSin38IuDGTcTnfuK3j++8BGxfY9qpULoHlgQtaHtM/ABabjXizloUadYKI7EoWCXSFwDrAJxLeRjTquK3ruEhB/HXg/l3pEOqZPYGtW3TsTwPCCVmorJ+JA7DTQpL7gQTKJ3AvIJJhRarduoxpzvUGl+ATnCwSSJ3ANsBVDY/lWIQ4NDPncg0LM+lk85rUW1b5JFAjgbjSjSveuPKddAyV/LsIuBJ3TOLOiUUCKRN4UIM7A2InzXrzwYi0nalPDh+fTwm/l0AHCGwCxDPw1MdrW/LF2omDAdcMdWAwZKxiGOWzah7HnwEiLfG8JbbZtTVgRz3vD+fVwgMk0B0CsRo+VsWPOn66dlzspohdFaYg7s6YyE3TpYCXAZETo8rxGbf8dxsHxqkVC1ClMv26wluySEACCxKI/fE5pPTuj+OmX2Pf85tNQbxgp/GvpAjEVforgH9OaYcjy2Zk+Bvpqn8mgaOnPHETg9pYADNbzPcSWJBABBuJ531NjMUcz3E5sD+w7ILY/EsCyRCI9Niv6iXo+9eIY/kK4GvAHtM4uV8e8WRtD3yf6yXTVxUkUQIRezxi6bc9VlM9/yXAS01BnGjvVayZBNYAHt+7O/Bp4AvAB4HXAy8Athy0r39mBaO+/0gmE4axAEZtUY/rMoHIphdZ9SK7XqqGuG25/gq80BTEXR4m6t4nELfG2h6Qo5zfWAD9FvNVAvMTWBzYE7gwk/E9yhxQ9THnAhEO3RTE8/cnjyiUwNMzmSCMBVBoB1StWglERrKX1LDauGpj3GZ9fwB2ABaptSWsXAIJEnhgJg6AsQAS7DyKlA2BWGT0aiBWC7dpbFM+9++Ap2TTogoqgQoIxLaBHCKMGQuggsa2is4TWAF4ExBb5FI2xm3KdiLwmM73FAF0hkAOwYCMBdCZ7qiiDRCIIDnvMAXxnE7QMb3V1g00h6eQQHsEjsvgauA/7eHxzBIolsDde9uLcggJ3tZdgaOAhxbbA1Ss8wQOz8ABiMFvLIDOd1UB1EQgMobFOptIrNOWoU35vPGY9BvARjXxt1oJtEbgtZkMemMBtNZFPHFHCGwAfNYUxEOdoNuAzwP37kh/UM0OEHhmJg6AsQA60BlVMQkCGwJfzWSBcBt3Dm4BPgmsm0RrKYQEpiCwcSYOQIRBtEhAAs0ReAjw3UzmhzYcgUhB/GEgQrdaJJAlgeUyGeDfzpKuQksgfwLx+O0nmcwTbTgCkbDs3cDd8m9qNegigUiU0cbAGeeckTLRIgEJtEdgG+CEDOaKceaVKo+9BngLsGJ7TeSZJTA+gV9kMqhjkZJFAhJol8ATgZMzmTOqNPCj1hWpWmNxtSmI2+2nnn1EArHyd9TO3eZxkbzDIgEJpEEgcomckcnc0ca8FXctXw4slUZzKYUEBhN4YyaD+JDB4vupBCTQEoFIovMc4OxM5pA2HIGLgL1MQdxSD/W08xJ4diaDNxJ2WCQggfQILAbsDvwlk7mkDUfgPOB5piBOr/N2XaIIddnGgBj3nLH/NnYtWCQggTQJLAHsA/w9kzll3DmoiuP/COxoCuI0O3AXpYq84bGntYrOXXcdj+5iA6mzBDIjEJlGXwX8K5N5pe55a1D9pwJPzaxdFbdQAr/OZKAaEKjQDqhaRRJYHog1RldlMr8MMtR1f/Yr4LFFtr5KZUPgQ5kM0O9lQ1RBJSCBPoGVgYOAazOZZ+o2+oPqPxbYqg/MVwk0SWDnTAbmZU1C8VwSkEClBFYD3g9Eiu9BRtDP4AfAppVStzIJzEMgMlzlMvjuO48ufi0BCaRNYE3gY8BNGc07Tc6PkYL4SOABaTej0pVE4PJMBuPzS4KuLhLoMIH1gU+bgnjoxVekIP4icJ8O95ESVI9FsQ8DXgi8Ysa/CBT1ZGDVFJT8YSYOwKEpwFIGCUigMgL3A74MhMFr8ko7l3PFFujDgfUqI25FdROIuzeRLfJMINpvvr52PvAV4H/bihURiSzmEzKF739fd8tZvwQk0AqBBwGR+TOFeSZFGWK79keAe7TSOp50PgKLAjsBx0/Zhy8A9m86w2Tcikix08+W6VZghflawu8lIIFsCWwO/CiT+Wj2/NTE35GC+D2p3DrOtpdVK/j9gRMr7rP/BvaoVszhtUU+6yY6bxXneNxwNfxGAhIohMAjK7iaqmK+SbWOMBBvNQVxq719ceANNQfT+xYQO2hqL+dm4gS8qXYSnkACEkiFwOOBkzKZm9pwFiIF8esMld54d41Mj0c11C8vATapW8NYcdpGBx73nLFX1iIBCXSLQCyQijVA484XXTk+UhDvawriRgbFssBPG+6LsVPvwXVq97KGFZp0YF7Z1krJOuFbtwQkMC+BSEEcC63+lMlcNekcN83v/gbsDURyJkv1BJYBft5S/7u0zvgQW7Sk1CSdfZvq29UaJSCBTAhECuLdgFgxPcn80YXfxNayiJsSq9Mt1RGInRht9p9w8FaqTp27aopnGrlE54o9lhYJSKDbBOIq90XAxS1Pym0ahPnOfRbwLFMQVzJQYj1KRGqcj3nd3x9WiTYDKvlNAsqNAu8iO/SA1vMjCXSTQERbiyhrcYt0lPmji8ecBmzXze5RidaR1CquvlPpO7VkkfxoQgrOBzoeWVgkIAEJ9AksB0Ta8FgnNN/80dXvI/17XMlaxiPwrsT61HlAPAqrtDwvMSXnGqTvrVRzK5OABEohEM9IY4987JWfaw7p8nfHAY8opcFr1iPuMKWYL2f7qvWObHu5DIrwgCwSkIAEhhGIRCtxoWAK4uHzeuSB2WwYQD+/g0BE5EvRLh5dR/tE0IEUlR0kU+3BEeoAbJ0SkECjBCJ+fjzezGWR86C5ru7PIuJc5GOwLEzg1ERtYixIrDxb5KcSVXbQADho4bbyEwlIQAIDCURGvcisN0qGtkHzTemfRUbGLwFxJ9jyXwIbJ24PIwpkpSWeK+TS0WOLi0UCEpDAOATiqikin5qCePBcfzPwNmDJcaAWeuy7E7eHX6+a+/KZ3SrbqGoA1icBCXSCwAOBbyaytzvFi67IZx/ZGbtaIvLkhYk7AJHDp/ISiwtS7JCDZDI5UOXNb4US6BSBTYFYDDdofun6Z7GA8omd6g13KbtVBn0i1gGscJfI1bx7eQaK9wdmBLiwSEACEpiWQEz4x2Y09/XnwLpfbwSeOi3cDH+fS1ycDatme+/MBsG9qgZgfRKQQGcJPA6IgDl1G9ac6o8dFLEgrislguzkElny/nU0Sk4Zt/avA4B1SkACnSYQV72pbgFrw3k4vUMLA5+QkQNYiwPw/owAnNTpaUrlJSCBugjEQrAdgdhx1IbRTe2c76gLdGL1fiaj9q7FAXh0RgBiIcQ6iXUgxZGABMohEGl1dwUiAmlqRrlJea4HIjFOySUy416dUTuvVkdjLJ4ZhFi4aJGABCRQJ4GYF/cCIiNpk4Y3pXPtVyfgBOp+RkZte0GdvL6WEYif1wnCuiUgAQnMIBBXiXHR8c+M5siqnIjzZ3Ao8W1Odi9kra3ELa+qOk3d9URUrzVqI2HFEpCABBYmsCzwWuCKjObKKubiDRZGUcQnEQgvp+RRr66TejxbyClc5kvrhGHdEpCABIYQWBE4ELimI47As4dwyP3j0KsKB6mpOmrP5PirjIBE6EqLBCQggbYI3A2I+PGxWK4pI9DGeWKXWInliIza7ZwmGuCNGQGJgfDIJqB4DglIQAJzEIjHkR8GIopeGwa67nN+YQ7dc/0qtnzmEvwn2jcSNtVeUk+HOLujR5YviwQkIIEUCKwLHFZgCuKvpgC3Yhkempmz1lgivL9lBCY87lr2RVbc2axOAhLoDoEIr/75zNZUzb64mvl3ZFEsreT0/P/3TcL/REYOQHTSWldGNgnec0lAAkURiKu2bxSQgvhTRbXKf5WJ+AYznZyU38fOk8ZKpINMGcZs2SJHcjzPsUhAAhJIkUDcbj4qs3l15jy7b4pQp5Tp4EzaIyLfrj+lrmP9PMJg5vQYIDpqJHOwSEACEkiZwJbAMZkYnpkOwGNThjqhbLFWY6aOqb4/cUL9pvrZ2zOB02+0Ep9RTdWA/lgCEkiWwGOAmNj781fKrzcAKyVLcnLB3pcJ/1bi3cQilrj1kHLHnCnbLcBak/cFfykBCUigcQLbAr9LfJ4tdafVAYlzD/t2a5sRbyPe/kwjm/r7dzY+fD2hBCQggekIxPqlHYA/JDrfPmo69ZL99T6J8p5pZ49uk95uGQCaCesqYIU2gXluCUhAAhMSiLVXuwCxqHnmvNbm+1Mm1CWHn0VY3TbZjnLuPdoEuRzw7wwgzQTplsA2e4znloAEpiUQKYhfCPy15bk3kuQ0FnxmWmgT/H4x4LqWGc+0XbPfR4yb1tdexP7P2YKl/PffgSUn6Az+RAISkEBKBGIeiwVgl7Q0B78kJRg1yfLTltiOYkO/XZPOY1W7VcKAhkHccywNPVgCEpBAugSWAfYHLm9wLv5hujgqlSzlx9w7VarpFJWd3WDHG2bUx/k85DUw0BQN7k8lIIHkCMT6pjcDV9c8H8f2xLsnp309AoVzdWXNPMexXf1j4/FPMneyIwxhX7BcXrevp79YqwQkIIFWCawCxI6nOp5ffwxYolXtmj95ihEB924ew/Azrtnbj5iL8Q85Txqujt9IQAISyJ7A6kAYrwjUM+3cHHXE7fAuluBY912VcdrnLyk6YTnGsS51/2oXB6k6S0ACgwmsA3xkwlvZYfg+ANxzcNWd+fRlFThR4xj5uY7dPUXqEahiLqFT/O4nKYJUJglIQAI1EFgK2BH4PnDzHPP1TUCkl40dBsvXIEeOVcaWwBQiMn41VXjxXOiyOTpVig5AyORdgFR7lHJJQAJ1EYhYApFBbhtgVyACysRcuC4QAYcsCxMINv9o0cadlbpDluJiifkcj1YyKS3ct/xEAhKQgAQSJ7BpTYsr57NTEXDv/omz4cEtekfzAZzr++1SB6t8EpCABCSQBIHI1Njk1sC/ARsnofkIQvw2QyfgdOMCjNCyHiIBCUhAAkHgvkAT8W9i3UFWWWxzyKA06G7Ac+3XEpCABCQggREJrAx8pqYt8LcBhwORbyersmymiwEjw1YsjLFIQAISkIAERiXwACDi8g+6sJzks5/ldMt/EKQDKoQxCcBJf5NUdKVBYP1MAhKQgASSJLAFcPSEdwQis+KRwLZJajamUBGKMrc0weE0XAwsPaauHi4BCUhAAhLoE4hHAxEX51DgnCGRGK8BTgViX/8uQORxKKq8L9O7AJFVyyIBCUhAAhKoikBcWMZivnhcsGpVlaZcT+QHuDFDJyA8szVSBqtsEpCABCQggdQJfDJDByAeBXw2dbDKJwEJSEACEkiZwH0mXBAx6SK+qn53OxALOiwSkIAEJCABCUxIIBY5VGWYm6znZIMDTdji/kwCEpCABCQAbJKpAxDOxp62oAQkIAEJSEACkxP4YaZOwKXASpOr7S8lIAEJSEAC3SawdaYOQNwF+GC3m07tJSABCUhAAtMRiLS7TT7Dr+pctwAbTae6v5aABCQgAQl0l0Ck3K3KKDddzzHdbTY1l4AEJCABCUxHYBHgjIydABcETtf+/loCEpCABDpMYOeMHYCrgbU73HaqLgEJSEACEpiYwGLABRk7Ad+fWHN/KAEJSEACEug4gX0ydgBi7UFkbrJIQAISkIAEJDAmgciKFGl3m17IV9X5LjdZ0Jgt7uESkIAEJCCBHoHnZewAhCNxpC0pAQlIQAISkMD4BGJHwEmZOwE7jq+2v5CABCQggYYJRHr3+wGbAtsAEZhurYZl8HSzCGwJRNa9qm7NN11PhAledZZO/ikBCUhAAu0SeCDwcuDrwD/msDHXAacDh/Ucg7gwtTRI4EtzNE7TBn2S832tQVaeSgISkIAEhhPYFjh2CptyIfBO4B7DT+E3VRJYF/jPFA02idGu+jcvqBKIdUlAAhKQwFgEngycWaEduQbYF4ht65aaCRxYYcNVbdxHqe964P41M7J6CUhAAhJYkMCSwME1Pkr+PRCPqi01ElgW+FvmTkB0lKVqZGTVEpCABCRwF4FY1HdqA3bjJmCnu07ruzoI5L4tMO4UfLQOMNYpAQlIQAILELgXcEkDxr9/B/g24P8WkMA/KiVQwrbA6CxPq5SKlUlAAhKQwEwCsUDv/AaNf98JiNfXzBTE99USyH1bYHSQiBJowqBq+4W1SUACEggCKwHxuHWmUW7yfWxbf7xNUR+BL7bYuFV1pOOBRetDZM0SkIAEOkcg5tQfJmAfIq7Aap2j35DC6wCxqr4qY9xWPW9uiJenkYAEJNAFAu9IyC6YFbbGHpf7tsBwOmLRSASlsEhAAhKQwHQEnpmQ8e9fVD5hOpX89TACJWwLjE5yVS/+9DA9/VwCEpCABOYmEGF9r03QATh6brH9dhoCuyTY4H3Pb5zXs4AVpwHhbyUgAQl0lMDKwLkJ24KNO9outatdyrbAcBa+B5hkovYu4wkkIIGCCMSivx8kbPxjbv9MQbyTU+VhwK2Jd4BR7wYclBxdBZKABCSQLoG3ZzD3X5wuvjIke1cGnWAUJyD2j+5YRpOohQQkIIFaCWxfY3z/UebrcY6JqISWmghEsoczCnECIvf0Q2riZLUSkIAESiDwAODfGc35e5QAPWUdNgFuzqhDzOU9XgCsmjJsZZOABCTQEoGI9HdOZnP9x1pi1anTHpBZp5jLCTgBWLpTraeyEpCABOYncGSG8/yX5lfLI6YlsDjw2ww7xzBH4JuGC562S/h7CUigIAK7Zjq/f7egNkhalY2AGzLtJIMcgUOSpq1wEpCABJohsC5wdaZz+7HNIPIsQWC/TDvJIAcgPnu9zSoBCUig4wR+kvG8rgPQYOeN4BC/yLizDHIEdmuQn6eSgAQkkBKBzTKfzw9LCWYXZLk3EFvqBhnTHD+7BXhyFxpOHSUgAQnMInBE5nN53JW2NExgn8w7zWxHJZJdbN4wQ08nAQlIoE0CqwM3Zj6Xb9cmwC6fO7IxzTakOf99KRB3NywSkIAEukBg38zn8Ej7vmYXGipFHXNeOTrMUfkLsF6KsJVJAhKQQMUEvpK5A3BcxTysbkwCsYBumDHN9fPzgXBuLBKQgARKJhBzXa7zdMj9wpIbJxfdIhBDzp1okOznAWvn0gDKKQEJSGBMAhESfdDcl8tnNwGrjKmzh9dAYA3g8sw706BOHzGx16qBl1VKQAISaJvAlpnP2QZya7sHzTj/MzPvTIMcgPjsbOAeM/T0rQQkIIESCGyd8ZwdC7ZXLqERStLh/Rl3qGEOQHz+JyDuclgkIAEJlELgMRnP188vpRFK0mMx4JiMO9VcTsAfgdgza5GABCRQAoEnZDpXG/o34d4XC0tiK91cxjTX787UCUi45ymaBCQwDoEtMpynL/Zu7DhN3M6xmwDXZ9i5RnFMzgXu1Q5WzyoBCUigMgLLA7dnNE9HxMJwWiwZENg5o441iuGfecwlwMYZtIEiSkACEpiLQE5xAPacSxG/S49AqYsCwxmI3NmPSg+5EklAAhIYmcB3MrlQ+9jIGnlgMgRKXhQYTkDckto+GdoKIgEJSGA8AjkkdYv080uMp5ZHp0Kg5EWB4QTcCuydCmzlkIAEJDAGgZWA/yR8F8BFf2M0ZqqHlrwosL824E2pwlcuCUhAAnMQ+EKiDkDcYX34HHL7VUYESl4U2HcCPgosmlGbKKoEJCCBbRJ1AFz0V1jfLHlRYN8J+B6wQmHtpjoSkEDZBL6VmBPgor8C+1vpiwL7TkAEDLpnge2nShKQQJkEIunZNYk4lMo6EQAADwlJREFUASe46K/MThZalb4osO8EXAZEsg2LBCQggRwIvDgBB8BFfzn0lCll7MKiwHAEbgZeMCUrfy4BCUigCQKLAF9p0Qm4wUV/TTRzGufowqLA/t2Ag4F4/GGRgAQkkDKBxYE21gPEVsRITmTpEIHXt+ht9o1zU68/AmLPrUUCEpBAygSWBI5qcG6+DojUxJYOEnhvgx2tKWM/7Dx/Au7bwTZWZQlIIC8CSwGfa2Bu/qdrpfLqGHVIe3gDHW2YUW7681hp++w6IFqnBCQggYoJ7A6Eka5jnjwCuFvF8lpdhgQieM7Xa+pkdXTcKur8JLBMhm2lyBKQQLcIRFyTdwKxSK+Kue8s4MndQqi28xGI504/rqiDVdFJm6gj4gVsNB8Yv5eABCSQAIH1gAOBcyaYp28BvuGz/gRaMWERlgVOnKBzNWGs6zrH9cAeCbeJoklAAhKYTWBz4G29O7enAv/uzdth6K8FLgWOB94D7ACsPrsC/5bAIAIrA7/vmBMQzsUXgeUHAfEzCUhAAhkQiC2EFglMTWCNCW8z1XWV3lS9cWvtoVPTswIJSEACEpBAxgTWB/7WwTsBkQLzFWYVzLjnKroE5icQC5/v19sC90wgwvC+FHgGELfX7zF/FR4hgbIJxAK5iKnf1BV4Suf5hTEDyu7catc5ApEH5bnAF0ac1yIu/qHAtkDsy7dIoHMENpuxwCQlA92ELBEe07sBnevyKlwYgXikGeltIzfIpPNGLLKLrXhGEy2sc6jO/AQeVeEe1EkHYJu/+6V3A+bvJB4hgcQIrAgcBESo26rmjyuA/YClE9NVcSRQK4HtgNhiUtVAyq2euBvwStcG1NrHrFwCVRHYpcYIejF3nQFsUJWw1iOBHAjEoLq9w05ADPy4GxCLhywSkEB6BGJs/qyhOSrWRz06PQRKJIH6COwF3NbQAEv1LkHcDXiVdwPq62TWLIExCcQt+QiMc1PDc1PcFd1tTFk9XAJZE4jIUrFdLlUD3ZRcvwEelnVLKrwE8ifwROC8FuejcAIemz9GNZDA6ATi1ldk1mvK2KZ6nngk8mlDbY7ecTxSAhURWBP4aiJzUCwOvHdFelmNBLIgsAlwSSIDsG0H4erelkHDcWbRdRUyYwIRxOdlCV6ARJY9w4ln3LEUfXwC9wLO1Qm4807IH4HHjY/RX0hAAiMQiLgkpyQ830S2PosEOkUgMk39LuFB2cbdgW8C9+xUL1BZCdRHIK7635DBVuQIGLRafRisWQJpElgBOEYn4M47AeF0xG6BuCJYJs0mUyoJZEFgbeC4jOaWD2RBVSElUDGBJXv5qdu44k75nH8F9gRcH1Bxh7O64glsClyekfGPeegGIPIOWCTQOQJxq+6QzAZsU85DbFV6PrBY53qFCktgfAIR1Odfmc4lzxtfXX8hgXIIHJDpwG3CGfgzsLOBhMrp7GpSOYF1gLhz1sR4rOMcX66ciBVKIDMCewO3ZjyI65gYZtYZOwZ2AhbJrF0VVwJ1EohHZadlPm9EXADv9NXZS6w7CwLbGzVw3quYSCwS0RV1BLLo0gpZM4FIujXTUc71fcRJsUig8wQinXAEysl1IDcld1z1PK3zvUUAXSawFhBb6Zoac3WeZ9suN6S6S2AmgY2NGjjypHZyzxGIBZUWCXSJwBcLMf7hWJgkqEs9V13nJRD5s40aOPrVzQW9rIMrz0vWAySQP4E1Mgj0M84dg/3zbxI1kEC1BO4G/LAgL3+cCWHSY68DPg5sVG1TWJsEkiKwX2HzgmGBk+peCpMKgVjsFtsEbytswE9q4Mf53dHAdm4hTKUrK0eFBGJXzDhjIfVjYxeURQISGELg8RkH+mh78omgQq8AVhzC1o8lkBOBBxZm/GN+cBFgTj1QWVshEAE/flXg4G/KQbgW+CiwYSut50klUA2B5xY4Bzy4GjTWIoGyCSwBfKjACaApJyDOczvwS2Afs5GVPVgK1e7thY3/G4FlC20r1ZJALQSeVdAe4CaN/+xz3QIcBcRVlZNQLV3VSism8O3CHIAfV8zH6iTQCQJxK/sPhU0Gsw10k3/HDoLYW/0UsxF2YvzkquQphY35l+baEMotgbYJxFXrFwqbEJo0+sPOFZnVIlPjVm03sOeXwCwCJxY23u85Sz//lIAExiTwf+YRqG1bVAQZiueuD3NL4Zi90sPrIPCzghyAH9UByDol0EUCmwMXFjQ5DLs6b/Pzy4AvAbsCq3exk6lz6wR+UMgYj8W4JgFqvTspQEkEInpgKRNEm4Z+lHPHBPY74B3A1q4bKGkYJa3LZwpxAMKRtkhAAhUTiOiBbzR6YG2PBIY5B9cA3wT2AtaruE2trl4CESRqU+DhwP2BtYHl6z3lxLW/qAAHILIYRr4TiwQkUBOBxxk9sHEnYKZzEOFaPwLsAtynpja22vEIRNbIBwEvBA7vxYO4dA6DGus/PgXsDNxjvFPVdvRD5pB3Zv9L9X3cOTOVd23dw4olcBeBNYHvZT5hpDqRjSvX5b3HM28GngSsclcz+a4mApE1L4xNPKaJxXNx5Tluu/WPj3wc30jguXU4MdPo0denrdc31NTWVisBCQwhEIvWrpxi8mtrsij5vHEl9Gfg88BLgFjEGZEeLZMRWArYspf34SvAX2rs7xE8auPJxKzkV6FfjmPjiEq0txIJSGBsAt4NSH/SvKGX7yGuWLdxYeG8fTxiyL8W+DlwU8NGMc738nklrOeA2JKakwMQzu5bgFifZJGABFok4N2AfCbPWFgYoV8jG6TlvwRiwV7kj/9bIkYw2qeNxznh9OTgBESEzR3svBKQQDoEvBuQx+Q5c4I/ruORCZcG9gNiLcVMLim8j5DcTTsBsbYhBd3nkuE3vUWX6cx8SiIBCdxJwLsB6U+isyfYI4GV7mzBbrx5aM3P9GcznuTvCNHbdEKp7yfqBFzdy7YZCxYtEpBAwgS8G5CfE3AO8ICE+1SVou0EXJ+ooZvtKEQQrsWrVH6eulYFLk6MzZeB2H1hkYAEMiLg3YC8HIFrgWdk1L8mEfWtiRm32QZ/0N9Nb3N7dCJBv8Ipda3KJL3c30ggEQKrAYclMqEMmlz9bEEn5WbgMYn0narF2DdD4x/98z9A0xnuXt8iqxt7izJjG6ZFAhIogMBmve1oGtwFDW6KPCK+w30L6HMzVXgKcGuLRm3ado7gW02XF7fA7Bjgfk0r6vkkIIH6CcSe3ecDl2Q8EU87kefy+7j9unL9XaKRM2yUeaS7fp+JUNxNl9gZ0MR6iX/2Qlw3rZ/nk4AEGiawAvA+IG439yc3X9Nj8dGG+0Vdp4uryhL61xfrAjRPvREk6Pc1MYxwyIcW5GzOg9KvJSCBPoENgR/XNLGUMOG3rcMtvUx2/fbK8fWpBfWvCICzXEuNEHfvngVEQqoq+mUY/tjhsEVL+nhaCUggEQJPB86vaGKpYnKyjrsm+dgXnmtZDDirsH4VWQTbLLEPP7JRxiOiScbJX3shfNdtUwnPLQEJpEUgVvy+qaHnjZNMXF3+TSzgzLE8c0IjlXJbfz2RhgjnKhIlxULBSG986oDcCbGa/yLgFOCrwLaAgXwSaUDFkECKBNYCPu76gImuruoyXO9JsaOMIFMEkKmLSVv1njGC3m0dsmQvTO99gMivYJGABCQwEYENgEj1Gc8K25psPe9/2cfjmdxK3FHKOcf9sL4XMQHMgJdbb1ReCUhgIgKxhSti1Uf6z2GTop/Xzya3xwAlLf6b3b/XmWgk+SMJSEACmRLYFPiRTkBrTlBbeeon7a6R3ne24Szl7/+ZFIq/k4AEJJAzgUcCJxQ8uadqpA7OrNN8puA+EpkMLRKQgAQ6S+BJvdXFqRrM0uT6dmY9rZTgP4P60b0zawvFlYAEJFALgR2A3xR8tTfIALTx2Wm1tF59lU66T70NtuOe8+71YbNmCUhAAvkRiEcDcZXqroF6nn1HQJ2cynmFOoURnTG221kkIAEJSGAWgchiF3EEmkhgMu6VW87HHz+Lc+p//rpQB+DE1MErnwQkIIG2Cazaiyxo5sFq7gh8o+0GHfP8kT43Z4drmOxvG5ODh0tAAhLoLIEICLMn8IdCDcIwQ1H153FXJafy6ULb+9E5NYKySkACEkiFwJOBnxZqGKo2+LPre0UqjTiiHK8usJ3/5fP/EVvfwyQgAQkMIfBAIPa1X16gkZhtuKv6OyIy5lSijavSPZV63phTAyirBCQggZQJxGrqyHH+E3cPzGksI4VrjiXkTsV4TytH5DVYOcdGUGYJSEACqRNYr5en/MKCjMa0Rqf/+0+m3nhD5Au5+zrk/vruITr6sQQkIAEJVEQg8pU/oZe/PPKZ5244qpB/64rYNl3Nwwtpvz8DyzcNz/NJQAIS6DKB2Eq4LxA52KswpDnW8ePMO0AEh8qRe1/mG4BNMm8DxZeABCSQNYFIwPIO4E+ZG5S+YRn1dfOsWw0elPn6jn0y56/4EpCABIoi8ADgAOD3hTsDuQX/GdbJcs0M+M5hCvm5BCQgAQm0TyAys72ml5Do9oIcglhBv1r7eCuRYDng9IzaJvrRfpVobiUSkIAEJNAIgXV7awZOyPy2cyx+zP3W/+wG3yCTuA83AXvMFt6/JSABCUggHwJrAHsDcRv9ioyuPmNtQKkG6HFALKobdf1D08dFPIpIZmWRgAQkIIFCCMTWws2A1/ZCEadqhOLqc/dCmA9TYyvgssScgIg98cxhAvu5BCQgAQmUQ2BpIK5GY5HXyYk8Log4848sB/GcmsS6jbNbdgKuAT4LPB4IB9EiAQlIQAIdJLAKsAMQGffOacEwHQPcs2PcI6zuR4FbGuJ9HXAcEBH9ngYs0zHeqisBCUhAAiMQWB14Si808Q+AS2syUnEVvN0I8pR8yIbA9yrmG6v4/wjE9sNYB7IxsFjJENVNAhKQgATqI7A+sCPwHuBYIG4hT7JI7VYgrvhfACxen7jZ1fww4IPARRNwjTUFRwFv6oWRXik77RVYAhKQgASyIbAIcH9gV+AjwIlALCa7dpYBi2f7sc7ga8BeBe3tr6uhgmssFIzUu4cBRwMRi/+fvav643s7OyKd9C5ArCewSEACEpCABJIgEGmO1wSWTUIahZCABCQgAQlIQAISkIAEJBAE/j9lP/n5YpaaOAAAAABJRU5ErkJggg==\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgClock);\nexport default __webpack_public_path__ + \"static/media/clock.1e999ae3e9e67b55357efa1d569f535e.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgMore(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 20C12.5523 20 13 19.5523 13 19C13 18.4477 12.5523 18 12 18C11.4477 18 11 18.4477 11 19C11 19.5523 11.4477 20 12 20Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgMore);\nexport default __webpack_public_path__ + \"static/media/more.c6dcc042994559c1325608ff484fd821.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgCheck(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20 6L9 17L4 12\",\n stroke: \"#767676\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgCheck);\nexport default __webpack_public_path__ + \"static/media/check.a93a3f0eadff46a5dff2fbabb23f384c.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgCloseDrw(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18 6L6 18\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 6L18 18\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgCloseDrw);\nexport default __webpack_public_path__ + \"static/media/closeDrw.e20279ac4433a2ac04225d21f9064a29.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHandOver(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.6694 17.5377C26.0998 16.9683 25.3274 16.6484 24.522 16.6484C23.7166 16.6484 22.9442 16.9683 22.3746 17.5377L21.2453 18.667C21.2437 18.2425 21.0739 17.8359 20.7732 17.5363C20.4725 17.2367 20.0653 17.0684 19.6408 17.0684H15.4033C15.2227 17.0679 15.0438 17.1032 14.8769 17.1724C14.71 17.2415 14.5585 17.3431 14.4311 17.4711L11.8354 20.0675L11.454 19.6863C11.3925 19.6248 11.3091 19.5902 11.2221 19.5902C11.1351 19.5902 11.0517 19.6248 10.9901 19.6863L9.33057 21.3458C9.30007 21.3763 9.27588 21.4125 9.25938 21.4523C9.24287 21.4921 9.23438 21.5348 9.23438 21.5779C9.23438 21.621 9.24287 21.6636 9.25938 21.7034C9.27588 21.7433 9.30007 21.7794 9.33057 21.8099L14.1906 26.6699C14.221 26.7004 14.2572 26.7246 14.297 26.7411C14.3368 26.7576 14.3795 26.7661 14.4226 26.7661C14.4657 26.7661 14.5084 26.7576 14.5482 26.7411C14.588 26.7246 14.6242 26.7004 14.6546 26.6699L16.3142 25.0103C16.3757 24.9488 16.4102 24.8654 16.4102 24.7784C16.4102 24.6914 16.3757 24.608 16.3142 24.5465L16.0245 24.2568L17.1714 23.1098C17.2105 23.0706 17.257 23.0396 17.3081 23.0184C17.3592 22.9973 17.414 22.9865 17.4694 22.9866H20.9625C21.1917 22.9872 21.4187 22.9424 21.6305 22.8546C21.8422 22.7669 22.0345 22.638 22.1961 22.4755L26.6698 18.0018C26.7003 17.9713 26.7245 17.9351 26.7409 17.8953C26.7574 17.8554 26.7659 17.8128 26.7658 17.7697C26.7658 17.7266 26.7573 17.6839 26.7407 17.6441C26.7242 17.6043 26.7 17.5681 26.6694 17.5377V17.5377ZM14.4225 25.9739L10.0266 21.578L11.2221 20.3817L15.6188 24.7784L14.4225 25.9739ZM21.7313 22.0115C21.5269 22.2146 21.2507 22.3292 20.9625 22.3302H17.4694C17.3278 22.3298 17.1876 22.3575 17.0568 22.4116C16.926 22.4658 16.8072 22.5454 16.7074 22.6458L15.561 23.7923L12.3043 20.5266L14.8958 17.935C14.9624 17.8681 15.0415 17.8151 15.1288 17.779C15.216 17.7429 15.3095 17.7244 15.4039 17.7246H19.6414C19.7739 17.7246 19.9049 17.7524 20.026 17.8061C20.1471 17.8598 20.2556 17.9383 20.3445 18.0366C20.4334 18.1348 20.5008 18.2505 20.5423 18.3763C20.5837 18.5022 20.5984 18.6353 20.5853 18.7671C20.5529 19.0074 20.4332 19.2274 20.2489 19.3849C20.0647 19.5425 19.8288 19.6267 19.5864 19.6214H17.5163C17.4292 19.6214 17.3458 19.656 17.2842 19.7175C17.2227 19.779 17.1881 19.8625 17.1881 19.9495C17.1881 20.0365 17.2227 20.12 17.2842 20.1815C17.3458 20.2431 17.4292 20.2776 17.5163 20.2776H20.4266C20.5137 20.2776 20.5972 20.243 20.6588 20.1815L22.8386 18.0018C23.245 17.5955 23.7845 17.3498 24.3577 17.3101C24.9309 17.2703 25.4992 17.4392 25.9577 17.7856L21.7313 22.0115Z\",\n fill: \"white\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.8912 14.3066H19.8828L21.7016 15.3716C21.7515 15.4008 21.8081 15.4162 21.8659 15.4164C21.9236 15.4167 21.9804 15.4017 22.0305 15.3729C22.0806 15.3442 22.1222 15.3027 22.1512 15.2528C22.1802 15.2028 22.1954 15.1461 22.1955 15.0883V13.2679C22.1955 13.2602 22.1955 13.2525 22.1955 13.2448C22.1955 13.2371 22.1955 13.2272 22.1955 13.2184V10.3316C22.1951 10.0433 22.0804 9.76696 21.8765 9.5631C21.6726 9.35924 21.3963 9.24454 21.108 9.24414H14.8912C14.6029 9.24449 14.3265 9.35918 14.1226 9.56305C13.9187 9.76692 13.8041 10.0433 13.8037 10.3316V13.2191C13.8041 13.5075 13.9187 13.7839 14.1226 13.9877C14.3265 14.1916 14.6029 14.3063 14.8912 14.3066ZM14.46 10.3316C14.46 10.2173 14.5054 10.1076 14.5863 10.0267C14.6671 9.94583 14.7768 9.90039 14.8912 9.90039H21.1087C21.2231 9.90039 21.3328 9.94583 21.4137 10.0267C21.4945 10.1076 21.54 10.2173 21.54 10.3316V13.2049C21.5381 13.2188 21.5364 13.2325 21.5355 13.2463C21.5338 13.2719 21.5354 13.2976 21.54 13.3228V14.5157L20.1375 13.6948C20.0873 13.6653 20.0301 13.6497 19.9719 13.6498H14.8912C14.7768 13.6498 14.6671 13.6044 14.5863 13.5235C14.5054 13.4426 14.46 13.333 14.46 13.2186V10.3316Z\",\n fill: \"white\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.082 12.2344C18.1979 12.2344 18.3112 12.2 18.4076 12.1356C18.5039 12.0712 18.579 11.9797 18.6234 11.8727C18.6677 11.7656 18.6793 11.6478 18.6567 11.5341C18.6341 11.4205 18.5783 11.3161 18.4964 11.2341C18.4144 11.1522 18.31 11.0964 18.1963 11.0738C18.0827 11.0512 17.9649 11.0628 17.8578 11.1071C17.7507 11.1515 17.6592 11.2266 17.5948 11.3229C17.5305 11.4193 17.4961 11.5326 17.4961 11.6484C17.4963 11.8038 17.5581 11.9527 17.6679 12.0625C17.7778 12.1724 17.9267 12.2342 18.082 12.2344V12.2344ZM18.082 11.5781C18.0959 11.5781 18.1095 11.5822 18.1211 11.59C18.1327 11.5977 18.1417 11.6087 18.147 11.6215C18.1523 11.6344 18.1537 11.6485 18.151 11.6622C18.1483 11.6758 18.1416 11.6883 18.1317 11.6982C18.1219 11.708 18.1094 11.7147 18.0957 11.7174C18.0821 11.7201 18.068 11.7187 18.0551 11.7134C18.0423 11.7081 18.0313 11.6991 18.0236 11.6875C18.0158 11.6759 18.0117 11.6623 18.0117 11.6484C18.0117 11.6298 18.0191 11.6119 18.0323 11.5987C18.0455 11.5855 18.0634 11.5781 18.082 11.5781Z\",\n fill: \"white\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.9453 12.2344C20.0612 12.2344 20.1745 12.2 20.2708 12.1356C20.3672 12.0712 20.4423 11.9797 20.4867 11.8727C20.531 11.7656 20.5426 11.6478 20.52 11.5341C20.4974 11.4205 20.4416 11.3161 20.3596 11.2341C20.2777 11.1522 20.1733 11.0964 20.0596 11.0738C19.946 11.0512 19.8282 11.0628 19.7211 11.1071C19.614 11.1515 19.5225 11.2266 19.4581 11.3229C19.3937 11.4193 19.3594 11.5326 19.3594 11.6484C19.3596 11.8038 19.4214 11.9527 19.5312 12.0625C19.6411 12.1724 19.79 12.2342 19.9453 12.2344V12.2344ZM19.9453 11.5781C19.9592 11.5781 19.9728 11.5822 19.9844 11.59C19.9959 11.5977 20.005 11.6087 20.0103 11.6215C20.0156 11.6344 20.017 11.6485 20.0143 11.6622C20.0116 11.6758 20.0049 11.6883 19.995 11.6982C19.9852 11.708 19.9727 11.7147 19.959 11.7174C19.9454 11.7201 19.9313 11.7187 19.9184 11.7134C19.9056 11.7081 19.8946 11.6991 19.8869 11.6875C19.8791 11.6759 19.875 11.6623 19.875 11.6484C19.875 11.6298 19.8824 11.6119 19.8956 11.5987C19.9088 11.5855 19.9267 11.5781 19.9453 11.5781Z\",\n fill: \"white\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.2187 12.2344C16.3346 12.2344 16.4479 12.2 16.5443 12.1356C16.6406 12.0712 16.7157 11.9797 16.7601 11.8727C16.8044 11.7656 16.816 11.6478 16.7934 11.5341C16.7708 11.4205 16.715 11.3161 16.6331 11.2341C16.5511 11.1522 16.4467 11.0964 16.3331 11.0738C16.2194 11.0512 16.1016 11.0628 15.9945 11.1071C15.8875 11.1515 15.7959 11.2266 15.7316 11.3229C15.6672 11.4193 15.6328 11.5326 15.6328 11.6484C15.633 11.8038 15.6948 11.9527 15.8046 12.0625C15.9145 12.1724 16.0634 12.2342 16.2187 12.2344V12.2344ZM16.2187 11.5781C16.2327 11.5781 16.2463 11.5822 16.2578 11.59C16.2694 11.5977 16.2784 11.6087 16.2837 11.6215C16.289 11.6344 16.2904 11.6485 16.2877 11.6622C16.285 11.6758 16.2783 11.6883 16.2685 11.6982C16.2586 11.708 16.2461 11.7147 16.2325 11.7174C16.2188 11.7201 16.2047 11.7187 16.1918 11.7134C16.179 11.7081 16.168 11.6991 16.1603 11.6875C16.1526 11.6759 16.1484 11.6623 16.1484 11.6484C16.1484 11.6298 16.1558 11.6119 16.169 11.5987C16.1822 11.5855 16.2001 11.5781 16.2187 11.5781V11.5781Z\",\n fill: \"white\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHandOver);\nexport default __webpack_public_path__ + \"static/media/handOver.e5124208c335faf3dffbdc94fd19ec8e.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgMail(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 10H26C27.1 10 28 10.9 28 12V24C28 25.1 27.1 26 26 26H10C8.9 26 8 25.1 8 24V12C8 10.9 8.9 10 10 10Z\",\n stroke: \"white\",\n strokeWidth: 1.3,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M28 12L18 19L8 12\",\n stroke: \"white\",\n strokeWidth: 1.3,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgMail);\nexport default __webpack_public_path__ + \"static/media/mail.52e0384bc1202aa4af5f1a66f122c691.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgSendAction(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_525_17780)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.7031 22.1484C18.7031 22.5368 18.3883 22.8516 18 22.8516H13.8516C13.4632 22.8516 13.1484 22.5368 13.1484 22.1484C13.1484 21.7601 13.4632 21.4453 13.8516 21.4453H18C18.3883 21.4453 18.7031 21.7601 18.7031 22.1484ZM27 13.224V21.457C27 22.5366 26.7634 23.7367 26 24.5L24.5 26C23.7367 26.7633 22.5366 27 21.457 27H13.224C10.8893 27 9 25.1105 9 22.776V13.224C9 10.8893 10.8895 9 13.224 9H22.776C25.1107 9 27 10.8895 27 13.224ZM25.4994 22.1601C25.5 24 23.5 26.4476 22.1601 25.4994C22.5947 25.3799 23.1726 25.3273 23.5 25L25 23.5C25.3274 23.1726 25.3799 22.5947 25.4994 22.1601ZM25.5938 13.224C25.5938 11.6666 24.3334 10.4062 22.776 10.4062H13.224C11.6666 10.4062 10.4062 11.6666 10.4062 13.224V22.776C10.4062 24.3334 11.6666 25.5938 13.224 25.5938H20.7539C22 25.5938 25.3092 24.8219 25.5938 20.7539V13.224ZM22.1484 17.2969H13.8516C13.4632 17.2969 13.1484 17.6117 13.1484 18C13.1484 18.3883 13.4632 18.7031 13.8516 18.7031H22.1484C22.5368 18.7031 22.8516 18.3883 22.8516 18C22.8516 17.6117 22.5368 17.2969 22.1484 17.2969ZM22.1484 13.1484H13.8516C13.4632 13.1484 13.1484 13.4632 13.1484 13.8516C13.1484 14.2399 13.4632 14.5547 13.8516 14.5547H22.1484C22.5368 14.5547 22.8516 14.2399 22.8516 13.8516C22.8516 13.4632 22.5368 13.1484 22.1484 13.1484Z\",\n fill: \"white\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_525_17780\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18,\n fill: \"white\",\n transform: \"translate(9 9)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgSendAction);\nexport default __webpack_public_path__ + \"static/media/sendAction.7e04a5b499286662e06d542033a49dad.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgTask(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.6095 22.86L13.375 24.0952L12.8905 23.61C12.8201 23.5396 12.7246 23.5 12.625 23.5C12.5254 23.5 12.4299 23.5396 12.3595 23.61C12.2891 23.6804 12.2495 23.7759 12.2495 23.8755C12.2495 23.9751 12.2891 24.0706 12.3595 24.141L13.1095 24.891C13.1443 24.9259 13.1857 24.9536 13.2313 24.9725C13.2768 24.9914 13.3257 25.0011 13.375 25.0011C13.4243 25.0011 13.4732 24.9914 13.5187 24.9725C13.5643 24.9536 13.6057 24.9259 13.6405 24.891L15.1405 23.391C15.2109 23.3206 15.2505 23.2251 15.2505 23.1255C15.2505 23.0259 15.2109 22.9304 15.1405 22.86C15.0701 22.7896 14.9746 22.75 14.875 22.75C14.7754 22.75 14.6799 22.7896 14.6095 22.86V22.86Z\",\n fill: \"white\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.6095 19.11L13.375 20.3452L12.8905 19.86C12.8556 19.8251 12.8142 19.7975 12.7687 19.7786C12.7231 19.7597 12.6743 19.75 12.625 19.75C12.5757 19.75 12.5269 19.7597 12.4813 19.7786C12.4357 19.7975 12.3944 19.8251 12.3595 19.86C12.3246 19.8948 12.297 19.9362 12.2781 19.9818C12.2592 20.0273 12.2495 20.0762 12.2495 20.1255C12.2495 20.1748 12.2592 20.2236 12.2781 20.2692C12.297 20.3147 12.3246 20.3561 12.3595 20.391L13.1095 21.141C13.1443 21.1759 13.1857 21.2036 13.2313 21.2225C13.2768 21.2414 13.3257 21.2511 13.375 21.2511C13.4243 21.2511 13.4732 21.2414 13.5187 21.2225C13.5643 21.2036 13.6057 21.1759 13.6405 21.141L15.1405 19.641C15.2109 19.5706 15.2505 19.4751 15.2505 19.3755C15.2505 19.2759 15.2109 19.1804 15.1405 19.11C15.0701 19.0396 14.9746 19 14.875 19C14.7754 19 14.6799 19.0396 14.6095 19.11V19.11Z\",\n fill: \"white\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.375 19.75H19.375C19.4745 19.75 19.5698 19.7105 19.6402 19.6402C19.7105 19.5698 19.75 19.4745 19.75 19.375C19.75 19.2755 19.7105 19.1802 19.6402 19.1098C19.5698 19.0395 19.4745 19 19.375 19H16.375C16.2755 19 16.1802 19.0395 16.1098 19.1098C16.0395 19.1802 16 19.2755 16 19.375C16 19.4745 16.0395 19.5698 16.1098 19.6402C16.1802 19.7105 16.2755 19.75 16.375 19.75Z\",\n fill: \"white\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.6095 15.36L13.375 16.5952L12.8905 16.11C12.8556 16.0751 12.8142 16.0475 12.7687 16.0286C12.7231 16.0097 12.6743 16 12.625 16C12.5757 16 12.5269 16.0097 12.4813 16.0286C12.4357 16.0475 12.3944 16.0751 12.3595 16.11C12.3246 16.1448 12.297 16.1862 12.2781 16.2318C12.2592 16.2773 12.2495 16.3262 12.2495 16.3755C12.2495 16.4248 12.2592 16.4736 12.2781 16.5192C12.297 16.5647 12.3246 16.6061 12.3595 16.641L13.1095 17.391C13.1443 17.4259 13.1857 17.4536 13.2313 17.4725C13.2768 17.4914 13.3257 17.5011 13.375 17.5011C13.4243 17.5011 13.4732 17.4914 13.5187 17.4725C13.5643 17.4536 13.6057 17.4259 13.6405 17.391L15.1405 15.891C15.2109 15.8206 15.2505 15.7251 15.2505 15.6255C15.2505 15.5259 15.2109 15.4304 15.1405 15.36C15.0701 15.2896 14.9746 15.25 14.875 15.25C14.7754 15.25 14.6799 15.2896 14.6095 15.36V15.36Z\",\n fill: \"white\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.375 16H22.375C22.4745 16 22.5698 15.9605 22.6402 15.8902C22.7105 15.8198 22.75 15.7245 22.75 15.625C22.75 15.5255 22.7105 15.4302 22.6402 15.3598C22.5698 15.2895 22.4745 15.25 22.375 15.25H16.375C16.2755 15.25 16.1802 15.2895 16.1098 15.3598C16.0395 15.4302 16 15.5255 16 15.625C16 15.7245 16.0395 15.8198 16.1098 15.8902C16.1802 15.9605 16.2755 16 16.375 16Z\",\n fill: \"white\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.375 17.5H22.375C22.4745 17.5 22.5698 17.4605 22.6402 17.3902C22.7105 17.3198 22.75 17.2245 22.75 17.125C22.75 17.0255 22.7105 16.9302 22.6402 16.8598C22.5698 16.7895 22.4745 16.75 22.375 16.75H16.375C16.2755 16.75 16.1802 16.7895 16.1098 16.8598C16.0395 16.9302 16 17.0255 16 17.125C16 17.2245 16.0395 17.3198 16.1098 17.3902C16.1802 17.4605 16.2755 17.5 16.375 17.5Z\",\n fill: \"white\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.25 19.825V13.7058C24.2494 13.3198 24.0958 12.9499 23.823 12.677C23.5501 12.4042 23.1802 12.2506 22.7943 12.25H21.25V11.71C21.2482 11.4559 21.1465 11.2128 20.9669 11.0331C20.7872 10.8535 20.5441 10.7518 20.29 10.75H14.71C14.4559 10.7518 14.2128 10.8535 14.0331 11.0331C13.8535 11.2128 13.7518 11.4559 13.75 11.71V12.25H12.205C11.8192 12.2504 11.4494 12.4038 11.1766 12.6766C10.9038 12.9494 10.7504 13.3192 10.75 13.705V25.795C10.7504 26.1808 10.9038 26.5506 11.1766 26.8234C11.4494 27.0962 11.8192 27.2496 12.205 27.25H23.5C24.3119 27.2532 25.1024 26.9897 25.75 26.5C26.3284 26.0664 26.7692 25.475 27.0192 24.7967C27.2693 24.1185 27.3181 23.3825 27.1596 22.6772C27.0011 21.9719 26.6421 21.3275 26.1259 20.8215C25.6097 20.3155 24.9583 19.9694 24.25 19.825V19.825ZM14.5 11.71C14.5012 11.6547 14.5236 11.6019 14.5628 11.5628C14.6019 11.5236 14.6547 11.5011 14.71 11.5H20.29C20.3453 11.5011 20.3981 11.5236 20.4372 11.5628C20.4764 11.6019 20.4989 11.6547 20.5 11.71V12.79C20.4989 12.8453 20.4764 12.8981 20.4372 12.9372C20.3981 12.9764 20.3453 12.9989 20.29 13H14.71C14.6547 12.9989 14.6019 12.9764 14.5628 12.9372C14.5236 12.8981 14.5012 12.8453 14.5 12.79V11.71ZM12.205 26.5C12.1124 26.5001 12.0207 26.4819 11.9351 26.4465C11.8495 26.4111 11.7718 26.3592 11.7063 26.2937C11.6408 26.2283 11.5889 26.1505 11.5535 26.0649C11.5181 25.9793 11.4999 25.8876 11.5 25.795V13.705C11.4999 13.6124 11.5181 13.5207 11.5535 13.4351C11.5889 13.3495 11.6408 13.2718 11.7063 13.2063C11.7718 13.1408 11.8495 13.0889 11.9351 13.0535C12.0207 13.0181 12.1124 12.9999 12.205 13H13.78C13.8258 13.2125 13.9431 13.4029 14.1124 13.5394C14.2816 13.6759 14.4926 13.7503 14.71 13.75H20.29C20.5074 13.7503 20.7184 13.6759 20.8876 13.5394C21.0569 13.4029 21.1742 13.2125 21.22 13H22.795C22.982 13.0004 23.1612 13.0749 23.2933 13.2072C23.4255 13.3395 23.4998 13.5188 23.5 13.7058V19.75C22.7129 19.75 21.9458 19.9976 21.3073 20.4578C20.6688 20.918 20.1913 21.5675 19.9424 22.3142C19.6936 23.0608 19.6859 23.8669 19.9206 24.6181C20.1553 25.3694 20.6204 26.0278 21.25 26.5H12.205ZM23.5 26.5C22.9067 26.5 22.3266 26.3241 21.8333 25.9944C21.3399 25.6648 20.9554 25.1962 20.7284 24.6481C20.5013 24.0999 20.4419 23.4967 20.5576 22.9147C20.6734 22.3328 20.9591 21.7982 21.3787 21.3787C21.7982 20.9591 22.3328 20.6734 22.9147 20.5576C23.4967 20.4419 24.0999 20.5013 24.6481 20.7284C25.1962 20.9554 25.6648 21.3399 25.9944 21.8333C26.3241 22.3266 26.5 22.9067 26.5 23.5C26.5 24.2957 26.1839 25.0587 25.6213 25.6213C25.0587 26.1839 24.2957 26.5 23.5 26.5Z\",\n fill: \"white\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.875 23.3447V22C23.875 21.9005 23.8355 21.8052 23.7652 21.7348C23.6948 21.6645 23.5995 21.625 23.5 21.625C23.4005 21.625 23.3052 21.6645 23.2348 21.7348C23.1645 21.8052 23.125 21.9005 23.125 22V23.5C23.1249 23.5493 23.1345 23.5981 23.1533 23.6436C23.1721 23.6892 23.1997 23.7306 23.2345 23.7655L23.9845 24.5155C24.0549 24.5859 24.1504 24.6255 24.25 24.6255C24.3496 24.6255 24.4451 24.5859 24.5155 24.5155C24.5859 24.4451 24.6255 24.3496 24.6255 24.25C24.6255 24.1504 24.5859 24.0549 24.5155 23.9845L23.875 23.3447Z\",\n fill: \"white\"\n })), _path9 || (_path9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.375 20.5H16.375C16.2755 20.5 16.1802 20.5395 16.1098 20.6098C16.0395 20.6802 16 20.7755 16 20.875C16 20.9745 16.0395 21.0698 16.1098 21.1402C16.1802 21.2105 16.2755 21.25 16.375 21.25H19.375C19.4745 21.25 19.5698 21.2105 19.6402 21.1402C19.7105 21.0698 19.75 20.9745 19.75 20.875C19.75 20.7755 19.7105 20.6802 19.6402 20.6098C19.5698 20.5395 19.4745 20.5 19.375 20.5Z\",\n fill: \"white\"\n })), _path10 || (_path10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.625 24.25H16.375C16.2755 24.25 16.1802 24.2895 16.1098 24.3598C16.0395 24.4302 16 24.5255 16 24.625C16 24.7245 16.0395 24.8198 16.1098 24.8902C16.1802 24.9605 16.2755 25 16.375 25H18.625C18.7245 25 18.8198 24.9605 18.8902 24.8902C18.9605 24.8198 19 24.7245 19 24.625C19 24.5255 18.9605 24.4302 18.8902 24.3598C18.8198 24.2895 18.7245 24.25 18.625 24.25Z\",\n fill: \"white\"\n })), _path11 || (_path11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.625 22.75H16.375C16.2755 22.75 16.1802 22.7895 16.1098 22.8598C16.0395 22.9302 16 23.0255 16 23.125C16 23.2245 16.0395 23.3198 16.1098 23.3902C16.1802 23.4605 16.2755 23.5 16.375 23.5H18.625C18.7245 23.5 18.8198 23.4605 18.8902 23.3902C18.9605 23.3198 19 23.2245 19 23.125C19 23.0255 18.9605 22.9302 18.8902 22.8598C18.8198 22.7895 18.7245 22.75 18.625 22.75Z\",\n fill: \"white\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgTask);\nexport default __webpack_public_path__ + \"static/media/task.8a4ee1f3f370f48574aeaf8a23611504.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgText(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_525_17836)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.625 27H12.375C11.3415 27 10.5 26.1585 10.5 25.125V10.875C10.5 9.8415 11.3415 9 12.375 9H23.625C24.6585 9 25.5 9.8415 25.5 10.875V25.125C25.5 26.1585 24.6585 27 23.625 27ZM12.375 9.75C11.7548 9.75 11.25 10.2547 11.25 10.875V25.125C11.25 25.7452 11.7548 26.25 12.375 26.25H23.625C24.2453 26.25 24.75 25.7452 24.75 25.125V10.875C24.75 10.2547 24.2453 9.75 23.625 9.75H12.375Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.625 16.5C17.418 16.5 17.25 16.332 17.25 16.125V15.75H13.5V16.125C13.5 16.332 13.332 16.5 13.125 16.5C12.918 16.5 12.75 16.332 12.75 16.125V15.375C12.75 15.168 12.918 15 13.125 15H17.625C17.832 15 18 15.168 18 15.375V16.125C18 16.332 17.832 16.5 17.625 16.5Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.375 20.25C15.168 20.25 15 20.082 15 19.875V15.375C15 15.168 15.168 15 15.375 15C15.582 15 15.75 15.168 15.75 15.375V19.875C15.75 20.082 15.582 20.25 15.375 20.25Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.125 20.25H14.625C14.418 20.25 14.25 20.082 14.25 19.875C14.25 19.668 14.418 19.5 14.625 19.5H16.125C16.332 19.5 16.5 19.668 16.5 19.875C16.5 20.082 16.332 20.25 16.125 20.25Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.875 15.75H19.875C19.668 15.75 19.5 15.582 19.5 15.375C19.5 15.168 19.668 15 19.875 15H22.875C23.082 15 23.25 15.168 23.25 15.375C23.25 15.582 23.082 15.75 22.875 15.75Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.875 18H19.875C19.668 18 19.5 17.832 19.5 17.625C19.5 17.418 19.668 17.25 19.875 17.25H22.875C23.082 17.25 23.25 17.418 23.25 17.625C23.25 17.832 23.082 18 22.875 18Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.875 20.25H19.875C19.668 20.25 19.5 20.082 19.5 19.875C19.5 19.668 19.668 19.5 19.875 19.5H22.875C23.082 19.5 23.25 19.668 23.25 19.875C23.25 20.082 23.082 20.25 22.875 20.25Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.875 22.5H13.125C12.918 22.5 12.75 22.332 12.75 22.125C12.75 21.918 12.918 21.75 13.125 21.75H22.875C23.082 21.75 23.25 21.918 23.25 22.125C23.25 22.332 23.082 22.5 22.875 22.5Z\",\n fill: \"white\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.875 24.75H13.125C12.918 24.75 12.75 24.582 12.75 24.375C12.75 24.168 12.918 24 13.125 24H22.875C23.082 24 23.25 24.168 23.25 24.375C23.25 24.582 23.082 24.75 22.875 24.75Z\",\n fill: \"white\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_525_17836\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18,\n fill: \"white\",\n transform: \"translate(9 9)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgText);\nexport default __webpack_public_path__ + \"static/media/text.24271393514926e09e84436160197096.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgZendex(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n rx: 4,\n fill: \"url(#pattern0)\"\n })), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"pattern\", {\n id: \"pattern0\",\n patternContentUnits: \"objectBoundingBox\",\n width: 1,\n height: 1\n }, /*#__PURE__*/React.createElement(\"use\", {\n xlinkHref: \"#image0_525_17849\",\n transform: \"scale(0.000833333)\"\n })), /*#__PURE__*/React.createElement(\"image\", {\n id: \"image0_525_17849\",\n width: 1200,\n height: 1200,\n xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABLAAAASwCAYAAADrIbPPAAAgAElEQVR4AezdT4gdVfo//s8vDLpw4cKF4MKNGzeCC/lmMAkakYgSUQKBCFGMKGShogxmoXyChAkIQUZQ9DOiiA4EFEMQCQ4ZhohgkCBRDCr+I2KIGOJ/CZEY+vx47kxrctJ/bnffW/epqtcF6Zzu2/eeej2njrfeXXXqf0opX/33v69LKd/7j4ExYAwYA8aAMWAMGAPGgDFgDBgDxoAxYAwYA8ZAgjEwnVl99T9nBFjxTQEWA2PAGDAGjAFjwBgwBowBY8AYMAaMAWPAGDAGjIEMYyBOthqEWGcGWPHNX/zHwBgwBowBY8AYMAaMAWPAGDAGjAFjwBgwBowBYyDBGDgrwPplqpRT8V/xIECAAAECBAgQIECAAAECBAgQIJBAYDqviq9xBpYHAQIECBAgQIAAAQIECBAgQIAAgZQCU1NTRYCVsjQ6RYAAAQIECBAgQIAAAQIECBAgMC3wP7+fjjU1Nf09XwkQIECAAAECBAgQIECAAAECBAhMVCDOvJrOreIMrMHC7fGNifbKmxMgQIAAAQIECBAgQIAAAQIECBD4r8B/s6pBbhUB1vRtEeMbHgQIECBAgAABAgQIECBAgAABAgQyCERWNcitBFgZyqEPBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINvJA7RYAACAASURBVAECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAgAABAgQIECBAgAABAgQIEKgFBFi1iDYBAgQIECBAgAABAgQIECBAgEAqAQFWqnLoDAECBAgQIECAAAECBAgQIECAQC0gwKpFtAkQIECAAAECBAgQIECAAAECBFIJCLBSlUNnCBAgQIAAAQIECBAgQIAAAQIEagEBVi2iTYAAAQIECBAgQIAAAQIECBAgkEpAgJWqHDpDgAABAgQIECBAgAABAgQIECBQCwiwahFtAgQIECBAgAABAgQIECBAgACBVAICrFTl0BkCBAgQIECAAAECBAgQIECAAIFaQIBVi2gTIECAAAECBAgQIECAAAECBAikEhBgpSqHzhAgQIAAAQIECBAgQIAAAQIECNQCAqxaRJsAAQIECBAgQIAAAQIECBAgQCCVgAArVTl0hgABAgQIECBAgAABAgQIECBAoBYQYNUi2gQIECBAgAABAgQIECBAgAABAqkEBFipyqEzBAgQIECAAAECBAgQIECAAAECtYAAqxbRJkCAAAECBAgQIECAAAECBAgQSCUgwEpVDp0hQIAAAQIECBAgQIAAAQIECBCoBQRYtYg2AQIECBAgQIAAAQIECBAgQIBAKgEBVqpy6AwBAgQIECBAgAABAgQIECBAgEAtIMCqRbQJECBAgAABAgQIECBAgAABAgRSCQiwUpVDZwgQIECAAAECBAgQIECAAAECBGoBAVYtok2AAAECBAgQIECAAAECBAgQIJBKQICVqhw6Q4AAAQIECBAgQIAAAQIECBAgUAsIsGoRbQIECBAgQIAAAQIECBAgQIAAgVQCAqxU5dAZAgQIECBAgAABAgQIECBAgACBWkCAVYtoEyBAgAABAgQIECBAgAABAgQIpBIQYKUqh84QIECAAAECBAgQIECAAAECBAjUAgKsWkSbAAECBAgQIECAAAECBAgQIEAglYAAK1U5dIYAAQIECBAgQIAAAQIECBAgQKAWEGDVItoECBAgQIAAAQIECBAgQIAAAQKpBARYqcqhMwQIECBAgAABAgQIECBAgAABArWAAKsW0SZAgAABAgQIECBAgAABAgQIEEglIMBKVQ6dIUCAAAECBAgQIECAAAECBAgQqAUEWLWINgECBAgQIECAAAECBAgQIECAQCoBAVaqcugMAQIECBAgQIAAAQIECBAgQIBALSDAqkW0CRAgQIAAAQIECBAgQIAAAQIEUgkIsFKVQ2cIECBAgAABAgQIECBAgAABAgRqAQFWLaJNgAABAgQIECBAgAABAgQIECCQSkCAlaocOkOAAAECBAgQIECAAAECBAgQIFALCLBqEW0CBAgQIECAAAECBAgQIECAAIFUAgKsVOXQGQIECBAgQIAAAQIECBAgQIAAgVpAgFWLaBMgQIAAAQIECBAgQIAAAQIECKQSEGClKofOECBAgAABAgQIECBAgAABAgQI1AICrFpEmwABAgQIECBAgAABAgQIECBAIJWAACtVOXSGAAECBAgQIECAAAECBAgQIECgFhBg1SLaBAgQIECAAAECBAgQIECAAAECqQQEWKnKoTMECBAgQIAAAQIECBAgQIAAAQK1gACrFtEmQIAAAQIECBAgQIAAAQIECBBIJSDASlUOnSFAYMkCG7duK1fdcZf/GBgDxsC8Y+CZXbuXPOc0+QL73j047zaZ/8z/xoAxsHzTPWXLk083OT15LwIECDQhIMBqQtl7ECDQnEB8cP///t8K/zEwBoyBecfAo88+39zkNIJ32v3mW/Nuk/nP/G8MGAOXr7+tfHz4yxHMOl6CAAECqQQEWKnKoTMECCxZIP7q6MO7D+/GgDEwzBjY/sJLS55zmnwBAZZxPcy49px+j5NLb15XDnz4UZNTk/ciQIBAUwICrKakvQ8BAs0IrLh7swDLmTfGgDEw1BgQYPX7QF/Qo/5dGwMXrLquvPyvf5ffTp9u5kOXdyFAgECzAgKsZr29GwEC4xZYvfneoQ5cu/ah1fY4EDMGFj4G/rbz5XFPSSN9fWdgLbzG9gtmfRkD56+41rpXI51xvRgBAgkFBFgJi6JLBAgsQWDtgw8JsJx9YwwYA0ONgedee30Js03zvyrAEsb0JYyxnQsb68uWryybH9tRfj11qvmJyTsSIECgOQEBVnPW3okAgSYENjyydagDVx+OF/bhmBevro2BP/15VXlxzxtNTEsjew8Blv2wa/uh7RnNmF5z3wPlq2+OjWyu8UIECBBIKiDASloY3SJAYJEC8RdIH4hH84GYI8cuj4G43GbnP/cucqaZzK8JsOyTXd4nbdvixvfFN6wtnx05MplJybsSIECgWQEBVrPe3o0AgXELbHnyaQGWy8eMAWNg3jFw4eo1Zc/b+8c9JY309QVYizvAF4xw6+oYuOSmW8q+dw+OdJ7xYgQIEEgsIMBKXBxdI0BgEQJxV7GuflC1XQ7CjIHRjYGLrr+xdQd+AqzR1d++xLLtYyDuOBjr+Lnj4CI+LPoVAgTaKiDAamvl9JsAgZkFntm1W4Dl7BtjwBiYdwzEmQsHPvxo5okk6XcFWEKXtocu+j+6MRxnnJ84eTLpbKVbBAgQGIuAAGssrF6UAIGJCeza9+a8B64+QI/uAzRLlm0dA5fdur5168YIsOxvbd3f9Ht0YzduQLFuy8POvJrYJ01vTIDABAUEWBPE99YECIxBYP8HhwRYzr4xBoyBecfA5etvK8e++34Ms9D4XlKANboQQKDCsq1jYPXme8vho1+Pb6LxygQIEMgrIMDKWxs9I0BgMQKHPv+ixLoQbf1gqt8OqoyBZsbAlRvvLL+eOrWYaWZivyPAamZs2Ac5Zx0DceZo2y59ntiE6Y0JEOiigACri1W1TQT6LBC3kr705nUCLGfgGAPGwJxjYM19D7RuqhRgCVayBiv6Nf6xGXdOfeu991s3b+kwAQIERiggwBohppciQCCBwNHjx0ucWeHD9Pg/TDNm3OYxcPdfH0swYy2sCwIs+1yb9zl9X/z4jTPL/7bz5TI1NbWwScOzCRAg0C0BAVa36mlrCBD49sefSqwP4YPy4j8os2PXhzHw6LPPt27CFGDZN/uwb9rGc8f5/Y8/4Y6DrZuxdZgAgTEICLDGgOolCRCYoECsabPhka0CLJePGQPGwJxj4MU9b0xwplrcWwuwzj2wF3Yw6foYiM80P/wSx2weBAgQ6L2AAKv3QwAAgQ4KbHny6TkPXLv+Ydf2OaAzBuYeA8uWr2zlWjICrLnratzz6doYuGLD7SWWRvAgQIAAgYGAAMtAIECgewLP7NotwHL2jTFgDMw6BmIx5LhjadseAiwBTdcCGtsz+5i+5KZbWhm0t21e1V8CBFolIMBqVbl0lgCBoQT2vnNg1gNXH5Zn/7DMhk1fxkCc1fDVN8eGmk8yPUmAZR/tyz7a9+286PobS+zvHgQIECBwloAA6ywODQIEOiEQp9vHJUJ9/wBs+x3sGgMzj4E19z3QyjVlBFgz19M459KlMXDe1dcM7jgYa3p6ECBAgMBZAgKsszg0CBDohEDcZjouEerSB1rb4gDNGBjdGNi0bXv57fTp1s13AqzRjQH7E8uMYyD++LZx67ZWzk+tm1B1mACBNgoIsNpYNX0mQGB+gRV3bxZgWQPJGDAGZhwD2194af5JJOEzBFhCl4yhiz6NblyuffChVp4dmnC61CUCBLopIMDqZl1tFQECmx/bMeOBqw/ao/ugzZJlW8dArJPXxocAyz7X1n1Ov+cfu1duvLOVN5do41yqzwQItFZAgNXa0uk4AQJzCsSdCK2DNf8HZgcVjPo4Btp6W3oBlv21j/trH7b5glXXlf0fHJrzc40fEiBAgEARYBkEBAh0UyDOsIi7+PThg69tdFBrDAw/Bi69eV1rJz0B1vB1tk+wassYiDU7d/5zb2vnJR0nQIBAgwICrAaxvRUBAg0KHD76dbns1vUCLGsgGQPGwFljINaYaetDgCWUaUsoo5/DjdXzV1xbHn32+eKOg22dlfWbAIGGBQRYDYN7OwIEGhKIO4xZyH24D9AONDj1aQzEwWJbHwIs+2qf9tU+bGvccfDnEyfaOiXpNwECBJoWEGA1Le79CBBoTuD+x58468yLPnwYto0OcI2B2cdArDMTIVBbHwKs2Wtr3LNp2xiIP7IJr9o6G+s3AQITEhBgTQje2xIg0IBArCnRtg+0+usgzBgY3xiI9a8+PvxlA7PPeN5CgDW+sWG/Y9vkGLhiw+3lwIcfjWei8KoECBDoroAAq7u1tWUECBz6/AsLuVv/SIhpDPw+Bq66465WrzUjwBKyNBmyeK/xjLe4wcyet/f7kEaAAAECCxcQYC3czG8QINAWgWPffW8dLOHF7+GFg7HxHIy1yTUuK27zQ4BlDLdpf9PXc8frn/68anDHwampqTZPRfpOgACBSQkIsCYl730JEBi/QCzkfvdfHxNgCLGMAWOgLFu+suza9+b4J54xvoMA69xAQEjCpC1jIO44+Jcnnizx2cSDAAECBBYlIMBaFJtfIkCgFQLxF84X97whvBBeGAPGQLn4hrWtXv8qJl0BlrCmLWGNfp47Vtdtebj88Esce3kQIECAwCIFBFiLhPNrBAi0RCAuI4xT9n2YPvfDNBMmfRoDa+57oPUHjwIs+2yf9tkubevqzfeWo8ePt+STk24SIEAgrYAAK21pdIwAgZEIxFlYV268U4DlDBxjoOdj4OGn/17avu6MAEuA1aVQpy/b0va7n47kw5gXIUCAwGgEBFijcfQqBAhkFog1J/ryQdl2OsA1BmYeA/vePZh5mhqqbwKsmWtrzHPJOgbijoMv/+vfQ+3fnkSAAAEC8woIsOYl8gQCBFovELervnD1GiFWz8/AyXqAo1/jP/iO9a+6sHCyAGv8Y8X+yHhUY+CCVdeVp155tfWfoWwAAQIEEgkIsBIVQ1cIEBiTQKw7cfn62wRYAixjoKdjYOPWbWOaXZp9WQGWcGVU4YrXGe9YiruextnfJ06ebHaS8G4ECBDotoAAq9v1tXUECEwLbHhkq/Cip+GFA7XxHqhl941b1z/32uvTU0Grvwqw+j2Ws+9r+vfH+IxF238+caLV843OEyBAIKGAACthUXSJAIExCOza96a7EQqwhJg9HAOX3bq+HD769RhmleZfUoD1R0AgLGGRdQws33RPZ+ac5mc570iAAIE5BQRYc/L4IQECnRGIA1iXETrgyXrAo1/jGZtxGc/aBx/qxPpXMRkLsMYzTux/XEc1BiIwf+u99zvz2cmGECBAIJmAACtZQXSHAIExCfx66lSJdXBG9SHV6zjgMQbaMQa6cvlgTI0CrHaMOXNDP+v0pz+vGuyjXbhhxJg+inlZAgQILFVAgLVUQb9PgEB7BOJuhA4s+nlgoe79rHuXLh+MmVaA1c9xbP7KX/e44+COf+xszwciPSVAgEA7BQRY7aybXhMgsBiBuBvQxTesFWL1cB0kB4D5DwDHUaM46zLOvuzKQ4DVz3E8jn3Da45uLMWZV5sf2+GOg12ZaG0HAQKZBQRYmaujbwQIjF5g07btAiwBljHQkzEQN2/o0kOANbrQQYDDclRjIO44ePT48S5NNbaFAAECWQUEWFkro18ECIxHYO87B8qFq9cIMHoSYIzqAMXrtO9g95KbbunU2VcxIwqw2jcOzR3drlncHEZ4NZ7Pa16VAAECMwgIsGZA8S0CBDos8MMvv5S4xbWDim4fVKhvv+sbdx+8//EnOjeTCbD6Pa7Na7nqf+nN60r8UcyDAAECBBoTEGA1Ru2NCBBII7D9hZcEWM7AMgY6PAYuuv7Gsu/dg2nmnFF1RICVK8AQKPW3HrFoe9zhdGpqalS7t9chQIAAgfkFBFjzG3kGAQJdE/j48JclLi9y8NHfgw+173bt19z3QOcuH4x5WIDV7XFrXmpPfeOOg7+dPt21j0e2hwABAtkFBFjZK6R/BAiMXiDuRhh3J3Ow0J6DBbVSq2HHQNwR7MU9b4x+4kjwigIs+8Gw+4HnjWesxPyy4ZGt7jiYYD7UBQIEeikgwOpl2W00AQKDdSt8wB/PB3yuXCc5BmJR5cNHv+7kLCfAsm9Nct/y3isGa2h+9c2xTs4vNooAAQItEBBgtaBIukiAwJgErrrjLmdhdXgdJAdb/TzYf/TZ5zu7Lo0Aq59j2lyWo+4RjscSBB4ECBAgMDEBAdbE6L0xAQITF3hm1+5y/oprhVhCLGOgI2MgFlbu6tlXMWEKsHIEGQKl/tXhwtVrBjeGsGj7xD+66QABAv0WEGD1u/62nkC/BeIygPiLqoOR/h2MqHk3ax5r03T5IcDq5rg1H+WuawTjsWi7BwECBAhMXECANfES6AABAhMV2P7CSwKsjpx94yAw90HguOtz0fU3lrfee3+i88m431yA1e8xPu59yOufO75i0fb//b9nO3tZ8rjnLK9PgACBEQsIsEYM6uUIEGiZQKxncdmt64VYQixjoOVjYN2Wh8uvp061bAZaWHcFWOcGDEIXJuMcA3HH4m9//GlhO6pnEyBAgMC4BARY45L1ugQItEPgt9Ony1+eeFJ40fLwYpwHMF47/wFyrGW35+397Zh0ltBLAVb+sWi+6E6NYomBo8ePL2GP9asECBAgMGIBAdaIQb0cAQItFIgPqLFAqwOP7hx4qGW/ahlnX/3wS3ym6fZDgNWvcW0em1y9I7w69PkX3Z5QbB0BAgTaJyDAal/N9JgAgXEI3P/4EyXWunDAMLkDBvbsFzMGYr/d+86BcUwL6V5TgGUfWcw+4ncWNm5iPb1d+9607lW6GVCHCBAgUARYBgEBAgRC4OAnn5ZLbrpFgOVSQmOgZWNg+aZ7enOgKcBaWBAhuOG1mDHw1CuvllhewIMAAQIE0gkIsNKVRIcIEJiYwMNP/1140bLwYjEHJ36nOwe1celvH9a+mp4UBVjdGbvmoXy1PO/qa0qcje1BgAABAmkFBFhpS6NjBAg0LuCOhPkOKBzkqclcYyDWvjpx8mTjc8Wk3lCAZX+Ya3/ws8WPj2XLV5a1Dz5Ujn33/aR2b+9LgAABAvMLCLDmN/IMAgT6IhCXDDz67PPOwnIWljHQgjEQZ1/te/dgX6anwXYKsBYfUAh32M01Bq7YcHuJP2J5ECBAgEBqAQFW6vLoHAECjQvE2RyX3bpegNGCAGOugxE/6/7B6ubHdpRfT51qfI6Y5BsKsLo/rs1dzdf44hvWuuPgJCc2702AAIHhBQRYw1t5JgECfRF4ZtfucsGq64RYQixjIOkYiLOvDh/9ui9T0u/bKcBqPtwQKHXbPO44+OKeN37fx/yDAAECBFILCLBSl0fnCBCYiMAPv/xSVty9WXiRNLxwQNntA8r56vunP68qW558eiJzw6TfVIDV77E/377h5wsbH7Hu1fYXXnLHwUlPbN6fAAECwwsIsIa38kwCBPokEGvrxFkeDggWdkDAi9e4x8BVd9xVjh4/3qfp6PdtFWDZv8a9f/Xp9eOOg326CcTvE4l/ECBAoL0CAqz21k7PCRAYp0B8qI01dvr0Yd62OjjOPgbOX3Ftry/3EWDZR7Pvo23oX5x5FWdZx9nWHgQIECDQKgEBVqvKpbMECDQq8NU3x0qsj9GGD+T66MC262Ng+jb3fT7oFGDZz7u+nzexfZevv82i7Y1+mvJmBAgQGJmAAGtklF6IAIFOCljQ3QFjEwdU3mP+cRaX9H525Egn55lhN0qANf84sS8xmmsMXHLTLWX/B4eG3eU8jwABAgRyCQiwctVDbwgQyCYQZ3usffAhZ2FZ0N0YmOAYOO/qa8qjzz6fbXpovD8CLOHMXOGMn809PqYvQf7t9OnG911vSIAAAQIjERBgjYTRixAg0GmBt95736WEEwwvHJTNfVDWB59Yr+bYd993ep4ZZuMEWPaFPuzv49jGCMFj0XYPAgQIEGi1gACr1eXTeQIEGhGIv9b+befLzsARYhkDExgDsQ6dS37+M9UJsARY4wh3+vCam7Ztd8fBRj4xeRMCBAiMVUCANVZeL06AQGcE4q6EcRZIHz7o20YHyVnGQCzcHpcO/nrqVGfmkqVsiADLvpll32xTP1ZvvrccPvr1UnY9v0uAAAECOQQEWDnqoBcECLRBYN+7B8vFN6wVYk3gLJw2HSzp6+hChqvuuKv8fOJEG6aHRvoowBrd2LKf9sMy/p/98eEvG9k/vQkBAgQIjF1AgDV2Ym9AgECnBOJSwj/9eZUQS4hlDIx5DLhb2LlTpwCrH6GLcG00dY7wau87B87dkXyHAAECBNoqIMBqa+X0mwCByQh8++NPZcMjW4UXYw4vHMCN5gCurY5xt7Ad/9hZ3C3s7HlOgNXv/aKt+/Mk+n3BquvKU6+8ag45ewrRIkCAQNsFBFhtr6D+EyDQvECspeFSQgeSkzgo68t7rtvycPnhl/iM4nGmgADLvNOXOWCp2/mXJ560aPuZk4d/EyBAoBsCAqxu1NFWECDQtMCufW+WC1evcSaWM7GMgRGPgctuXV+Offd907t0K95PgCXAWmqw0/Xfj0v81z74kDOvWjGj6SQBAgQWLCDAWjCZXyBAgEApg7ui/e//PVvOu/oaAcaIA4yuH2DZvtlDiDizMUIaj5kFBFizjx37FZsYA3G34M+OHJl5B/JdAgQIEGi7gACr7RXUfwIEJicQ62HFX3odODlwMgaWPgaWLV9ZHn32eWdOzDGlCbCWPs7sq901vPTmdWX/B4fm2IP8iAABAgRaLiDAankBdZ8AgQkLHD1+vMQlTw6KuntQpLbN1Pbuvz5Wfj5xYsJ7dO63F2A1Mxbt8+1zjkXb3XEw9/yldwQIEBiBgABrBIheggCBngvseXt/ueSmW4RYLiU0BhYxBuLMqys33mndqyHmUQFW+4IVYdj4axbh1fYXXipTU1ND7EWeQoAAAQItFhBgtbh4uk6AQBKB+ND8t50vl1g81sHK+A9WGHfL2GU/w09kAqxujX1z2WjqufmxHe44OPw04pkECBBos4AAq83V03cCBPII/Hrq1GD9Hgckozkg4dgPx4uuv9Gi7QuYxgRY/dgvzH/D13ndlodLrEfpQYAAAQK9EBBg9aLMNpIAgUYEYv2e+DDtTKzhDz4cqPXX6vwV15anXnl1cEfPRnbQDryJAKu/+4u58tzaX77+tvLVN8c6sGfbBAIECBAYUkCANSSUpxEgQGAogfgwHbfxdrBx7sEGEybTYyBC3rjsx5o1Q00rvz9JgGUfmt6H+v411p3c9+7B3/cN/yBAgACBXggIsHpRZhtJgECjAp8dOVKuuuMuIdYiFvTu+0FZH7Y/Fm2POw6eOHmy0f2yC28mwBJg9WGOmG8bL1y9prz8r393YZe2DQQIECCwMAEB1sK8PJsAAQLzC8RZJQc/+dSdCQVYQswZxkBcZnv0+PH5dyTPOEdAgCXAmi/c6frP4+zNHf/Y6dLjc2YH3yBAgEAvBARYvSizjSRAYCICe97eXy6+Ya0QY4YQo+sHWbZv5qDhig23C6+WMBsJsGYeV/a3frjE2ZsRgMdNUzwIECBAoJcCAqxelt1GEyDQiECciSXE6seBlQPo+eu8fNM9JS6v9Vi8gABr/nFmX+yu0Zr7HnDHwcVPH36TAAECXRAQYHWhiraBAIG8Ar+dPj1YqyPW7HBg1d0DK7Wdu7ZXbryzHPjwo7w7akt6JsCae5zZD7vrE3NIXJrvQYAAAQK9FhBg9br8Np4AgcYEnnrl1SLE6u7BlQPn2Wt76c3rHHiOaKYRYM0+zuyD3bW5YNV15a333h/RXuRlCBAgQKDFAgKsFhdP1wkQaJnAi3veKBddf6MzsayJ1ZsxEGteOWtidBOVAKu7IY0Abubaxh9+4v+dHgQIECBAoJQiwDIMCBAg0JRALDwbH8SdiTXzgYoDuG65xCU/+z841NTu1Yv3EWB1ax8x581dz/NXXFv+9/+etWh7L2Y3G0mAAIGhBARYQzF5EgECBEYo8Myu3UIsZ2F1+iwslw2OcMI446UEWHMHHgKhbvnEHQd/+CWOVTwIECBAgMBAQIBlIBAgQGASAnEgeslNt3Q6xHAw2a2DyWHrueLuzeXjw19OYrfq/HsKsPq5Tw2773XpeVfdcVf5+cSJzu/TNpAAAQIEFiQgwFoQlycTIEBgRAJxd8K97xwQYjkTq1MhZtzmXng1oklihpcRYAmwuhRSzbYtsXaeu5bOMAH4FgECBAgIsIwBAgQITFJg37sHy2W3ru9UiDHbQYnvd/fge9nylWX15nvL0ePHJ7k7df69BVjd3YfMj/+pbawRGePcgwABAgQIzCAgwJoBxbcIECDQqECcsRIH/w5gHJy2cQz86c+ryubHdrjcp4FZQ4BljmjjHDFsn2Mu2fnPvWVqaqqBvclbECBAgEALBQRYLSyaLhMg0DGB+LD+1TfHytoHHyrnXX2NIMtlha0ZAxesuq5sjqSZhgAAIABJREFUf+ElCy03NCcJsARYw4ZBbXte/L/v/sefKHF5vQcBAgQIEJhFQIA1C4xvEyBAoHGBY999XzZt217icqy2HXzob/8OrONSn7/tfNnZEg3OFAKs/u1nfZlb4w843/74U4N7k7ciQIAAgRYKCLBaWDRdJkCgwwK/njpVntm1u0Q40JcDF9vZvoPyy9ffVmL9No9mBQRY7dtXzG/z1yzuXBpnIXsQIECAAIF5BARY8wD5MQECBBoXiEsoXv7Xv0uEBA5+5j/4YdScUaxRE+u1xbpt1qlpfGoYLG5tvDc33lmP3/riG9aWg598aj5pfjrxjgQIEGijgACrjVXTZwIE+iEQtxGPv0w7iBr/QRTj+Y2nF2uPS109JiPgDKz5x6l9uT1Gcabxi3vemMzO5F0JECBAoI0CAqw2Vk2fCRDoj8CJkycHd3iLxbIdmLXnwKxrtYqzJOLuYBZYnuzcI8AyB3Rlbjl/xbWDNfQmu0d5dwIECBBomYAAq2UF010CBHooECHWc6+9Xi67db0Qyx0KGx0DcdZVnAUY6125ZHDyk48AS4DVhQArblQSdxz8+cSJye9UekCAAAECbRIQYLWpWvpKgEB/BSI8iHVCrrrjLncpFGI1FmJtfmyHxZUTTTsCLAFWFwKsCMWFV4kmFl0hQIBAewQEWO2plZ4SIECgDD70P/rs8+Wi629sLMTowgGTbVjYgX/cQCAuGfTIJSDAWtg4tt/n81q+6Z5y+OjXuXYsvSFAgACBtggIsNpSKf0kQIDAtMCvp06Vve8cKFdsuL3EJV4O0vIdpLW1JrEuzcat28qhz79wyeD0DpfoqwDLvt7WuSX6fenN6waXIyfapXSFAAECBNolIMBqV730lgABAn8IfPXNscE6IhE6tPmgRt9zHJRfctMtg0WVIyD1yCkgwMqxr5izFlcHN4LIOa/oFQECBFokIMBqUbF0lQABAucIxNpYb733/mBtLGdjLe6gqu8HozFu4qyrz44cOWd8+UYuAQGWfbyN81XcRXf7Cy/l2pn0hgABAgTaKCDAamPV9JkAAQK1QJyN9b//92yJs2jaeICjz80fmEdwFZehxh0uLahc71E52wKs5vcTc9PSzGOe2bRtuzkm55SiVwQIEGibgACrbRXTXwIECMwm8Nvp0+XAhx+V1ZvvtTaWOxXOGWTGQeVfnnjSWVez7UxJvy/AWlqYIoxq3i/+f3T0+PGke5RuESBAgEDLBARYLSuY7hIgQGBegQiyYq2RKzfeOWeI4WCu+YO5SZvHemnrtjxcDn7y6bzjqOtPiMtv27belwCrf/vspOeMpbz/ZbeuL3F2sAcBAgQIEBiRgABrRJBehgABAqkE4uA8/ur98NN/L3EQsWz5SmFWj8/KOu/qawaB5sv/+nf54Zf4f79HnK344p43WgUhwBJgLSVQavJ343L2PW/vb9X+pbMECBAgkF5AgJW+RDpIgACBJQhEkBVn22x+bIfLCnsaYF18w9rBAsou4/ljRwqLuLQp1o1r00OAJcBqMoRa7HvFmZ5PvfJqif//eBAgQIAAgREKCLBGiOmlCBAgkFrg0OdfDO42d+HqNc7G6kGYdenN6wZn4Fmg/ezd8sTJk2XNfQ8M9gEBlkBosSGN35t97MQdB9t2ee7Zs4QWAQIECCQVEGAlLYxuESBAYCwCcfC+/4NDg3WQLrr+RkFWx4KsWJw9Lt3Z8uTTJQLLWA/N4w+BGP8RWk1fUivAmj2EENCwWegYiPkn1tiL/cyDAAECBAiMQUCANQZUL0mAAIH0AvHX8b3vHCgbHtnq0sKOhFgRSEZwZYH22Xe/5157vZx5BqIAS0iz0JDG82cfM8s33WPR9tmnHz8hQIAAgaULCLCWbugVCBAg0G6BCDzu/utjgzN3HJzNfnCW0SbOeLhiw+3l0WefL9/++FO7B+KYex/rR9VnHQqw2jXeM+6D+vSfMXT5+tsGZ32OeTf28gQIECDQbwEBVr/rb+sJECDwH4E4I+vjw1+WvzzxZIkDkViE14FZ3oP7OIsoznaIu+jFbepdKjj3nvzZkSODu3HWY1qAlXeM17XSzlurmI/ijF6Lts89D/kpAQIECCxZQIC1ZEIvQIAAgY4JRCASl1pddcddLi9MdnnheVdfM7jsM84msjj7cDvese++/33R9joEEWDlDUXqWmnnrNUFq64b3OV0uL3RswgQIECAwJIEBFhL4vPLBAgQ6LBA/DX9wIcflfsff2Jw9kpcruYgsvmDyHBfcffmwUFihIsewwtEyBfrvM02bgVYzY/n2Wrh++2rRcxNse6eM0CHn5M8kwABAgSWJCDAWhKfXyZAgEAPBOLg5PDRrweXq6198KFy8Q1rnZk15jOz4hLOy25dP1ibbM/b+0ucReTynIXtbDFuI6Ca63JYAVb7QhNBV56aRTgcc5MHAQIECBBoSECA1RC0tyFAgEAnBCIUiLOydvxj5+CsIAeToz2YjMtx4jb0cQlnhIZCq8XtNuG2a9+bc4ZXMXYFWKMdv+aD/njGWolHjx9f3A7qtwgQIECAwOIEBFiLc/NbBAgQIBACEbL8befLZfrMrGXLV856uZaD23MPbsMrDgQ3bt1Wdv5zr3WtRrRbxYLScabgfGNOgHXumJzPzM+Zxdmh8YcMDwIECBAg0LCAAKthcG9HgACBzgnE2S6x1lDcxTDuihdhTIQycWcqgdbZB7uxZkwEK7FAfqwtFpcHRggYd4H0GI1AjMPwHSZoEWCdPT6HMfOcfptddP2Ng7Dd2aGjma+8CgECBAgsSECAtSAuTyZAgACBoQRiXZQ4C2b7Cy8N7gAXYVZfD3wjxLvkplsGi4k/9cqrZf8Hh5xpNdQoWviTIghcc98DQwenAqx+hzF9nZOWst1x+bjAfeFzk98gQIAAgZEICLBGwuhFCBAgQGBOgTjgmV47K87QWr7pnhJ/ye/aGVqxPZfevK6s3nzvYAH2OCPtsyNHrGU15+gYzQ/jLMC7//rYgoJSAZYAaylhTp9+N84ejf3LgwABAgQITFBAgDVBfG9NgACBXgpEmBWL/x76/IvBJXTxF/1YuDwu+4q1VSLYmuvOcZM+aIyQKhZbj7Oq4lLJCOPiwC7WAtv37sFBYPXtjz+5tXyDoztuLhDjKOqykPEhwBJgLWS89Pm5sc6hOw42OKl5KwIECBCYSUCANZOK7xEgQIBA8wIRbMV6UBECvfyvfw8Cic2P7RgsEB9B0ULDiVEdbMaaVVduvHPQj7888WSJywDjDndxRtlX3xwTVDU/VM55x91vvjUIPhdacwGWAGuhY6aPz79iw+2DNQ7P2fF8gwABAgQINCsgwGrW27sRIECAwGIFYtHgH375ZXAgNR1yPbNr92CdrS1PPl0i7Nq0bftgEfk4oyv+i7MG6v/i+xse2Tp4Xpw5FYupP/z03weB2XOvvV4iDIl1qiJMO3Hy5GK76/caEjj4yaeDGwYsJlgQYAmwFjNu+vQ7cUZs7GMeBAgQIEAggYAAK0ERdIEAAQIERiQQIVecyRXBU/wX6yLV/8X34zlx2Zk7aY0IfkIvE+uLrbh784IuGzwzfBBgCbDOHA/+ffZ4iPAqQn0PAgQIECCQRECAlaQQukGAAAECBAgsQCCCyTibbimhgwDr7MBiKZZ+t1uWsdbfo88+7xLpBcxJnkqAAAECYxcQYI2d2BsQIECAAAECIxWIM+fi8s+4M9pSghMBVrdCl6WMBb979liIS7IjJPYgQIAAAQKJBARYiYqhKwQIECBAgMA8AnH5Z1zWNIo7VQqwzg4thDg84syruLNq3EnVgwABAgQIJBMQYCUriO4QIECAAAECcwjsfefAou44OFM4I8AS2Mw0Lvr8vctuXW/R9jnmHz8iQIAAgYkKCLAmyu/NCRAgQIAAgaEFDnz4Ubn05nVLumzwzHBCgCXAOnM89P3fF9+wtsQdXj0IECBAgEBSAQFW0sLoFgECBAgQIHCGwLHvvi9X3XFXiUucRhU0CLAEWKMaS21/nbgkNy7NjbuzehAgQIAAgaQCAqykhdEtAgQIECBA4L8CsZj0pm3bRxZcTYcNAiwB1vRY6PPXuBlCLNoeN0fwIECAAAECiQUEWImLo2sECBAgQKD3ArFo+5Ynnx55eBWBhQBLgNXn4Gp62zdu3eaOg72faQEQIECgFQICrFaUSScJECBAgEBPBZ7ZtbtcuHqNAKuUsvvNt8biMB1k+Nq/QG/15nvL4aNf93R2sdkECBAg0DIBAVbLCqa7BAgQIECgNwKxaPu4wqsIa5yB1b/ARkj3R80vuv7G8vHhL3szn9hQAgQIEGi9gACr9SW0AQQIECBAoIMCBz/5tFy+/raxnnEkwPojzBDs9Msi7ji45+39HZw5bBIBAgQIdFhAgNXh4to0AgQIECDQSoGjx4+XNfc9MNbwyhlY/QpsBHR/1PuCVdeVp1551R0HWzk76jQBAgR6LSDA6nX5bTwBAgQIEEgoEItKx53Rxh06OAPrj1Bj3NZeP4/1/Y8/UU6cPJlwz9clAgQIECAwp4AAa04ePyRAgAABAgQaE4g7Dm5/4aWxB1fTYYoAK0+oMl0TX8dXk2XLVw7ObIz9zIMAAQIECLRQQIDVwqLpMgECBAgQ6JzAb6dPlxf3vDHWRdvrcESANb6wpLbWnrz18k33WLS9czOnDSJAgECvBARYvSq3jSVAgAABAkkF9n9wqFx687rGzr6KQEWANflQRbDVTA0uuemW8tZ77yfd+3WLAAECBAgMJSDAGorJkwgQIECAAIGxCXz1zbFy2a3rGw2vBFjNBCcCqsk7x6Lt7jg4tunLCxMgQIBAcwICrOasvRMBAgQIECBQC8QdB9dtebjx8EqANflgRbg1/hpEeBXryk1NTdW7njYBAgQIEGibgACrbRXTXwIECBAg0BWBWEw67ojWxB0HZwpLXEI4/gBlJnffa85907bt7jjYlQnTdhAgQICAAMsYIECAAAECBCYj8Oizz5fzV1w7kbOvIkQRYDUXpAitmrde++BD5dsff5rMzu1dCRAgQIDA6AUEWKM39YoECBAgQIDAXAJxx8Hdb75V4vKmSQYbAqzmQ5VJ1rtP7x1ryh0++vVcu6GfESBAgACBtgkIsNpWMf0lQIAAAQJtFzj4yacTWbS9DjAEWAKsekx0oX3xDWvL3ncOtH2a0H8CBAgQIFALCLBqEW0CBAgQIEBgfAKfHTlSrtx450TPvJoOKQRYAqzpsdCVrxeuXlN2/nPv+HZgr0yAAAECBCYnIMCanL13JkCAAAEC/RL4+cSJEuvyTGrR9jqkEGAJsOox0eZ27Fdxx8G4OYIHAQIECBDooIAAq4NFtUkECBAgQCCdQBxUx6LtmQICAZYAK9N4XEpfli1fWdZteVh4lW7m0yECBAgQGKGAAGuEmF6KAAECBAgQmEEgFm3/286X05x5NR0UCLAEWNNjoe1f19z3QDl6/PgMe59vESBAgACBzggIsDpTShtCgAABAgSSCuza92a55KZbUp19FYGFAEuA1fbgKvp/xYbbS9wYwYMAAQIECHRcQIDV8QLbPAIECBAgMFGBr745Vi69eV268EqAJbzqQnh13tXXlH3vHixTU1MT3c+9OQECBAgQaEBAgNUAsrcgQIAAAQK9FDh89OuyfNM9KcMrAZYAq+0BVtxx8LnXXu/l3GKjCRAgQKCXAgKsXpbdRhMgQIAAgTEL/PDLL2Xj1m3p1r06M7RwCaEQ68zx0KZ/x5lXW5582qLtY57HvDwBAgQIpBIQYKUqh84QIECAAIGOCEQ4dP6Ka9OefRVhhQBLgNWm0OrMvsYdB7/98aeOzBY2gwABAgQIDCUgwBqKyZMIECBAgACBoQTijoMv7nkjdXA1HQQIsARY02OhTV+vuuOu8vOJE0Ptj55EgAABAgQ6JCDA6lAxbQoBAgQIEJi4wN53DqS84+BMAYUAS4A107jI/L3L199W9n9waOL7uQ4QIECAAIEJCAiwJoDuLQkQIECAQCcFPjtypFy58c5WnH0VIYUAS4CVOayq+xaLtr/8r393cu6wUQQIECBAYAgBAdYQSJ5CgAABAgQIzCMQi7bHpU31QXfmtgBLgJV5fJ7Zt2XLVw7uOBiX6HoQIECAAIGeCgiwelp4m02AAAECBEYmEOHV5sd2tCq8inBAgCXAOjMkyvrvuONg7F+/njo1sn3WCxEgQIAAgRYKCLBaWDRdJkCAAAECqQR2/GNn+jsOzhROCLAEWDONi2zfW3PfA+XYd9+n2ud1hgABAgQITEBAgDUBdG9JgAABAgQ6I/Dca6+XWJsn20H/MP0RYAmwhhknk3zO8k33lK++OdaZ+cKGECBAgACBJQgIsJaA51cJECBAgEBvBaampsrBTz4tF9+wtpXhVYQSAiwB1iTDqfneO/at2MdiX/MgQIAAAQIEigDLICBAgAABAgQWLhBnhcTZIfMdhGf+uQBLgJV1fMZZjXF2owcBAgQIECDwu4AA63cK/yBAgAABAgSGEoj1eGJdnqwH/8P2S4AlwBp2rDT5vPNXXFtiXTkPAgQIECBA4CwBAdZZHBoECBAgQIDAnAJxJ7S4I1rcGa3Jg/pxvJcAS4A1jnG11NeM/Svu7OlBgAABAgQInCUgwDqLQ4MAAQIECBCYVeC306cHlzUtW76y9eFVhAwCLAHWUsOmUf9+XJYrvJp1CvIDAgQIEOi3gACr3/W39QQIECBAYHiBl//179becXCmoEGAJcCaaVxM6ntXbryzfHbkyPA7pGcSIECAAIF+CQiw+lVvW0uAAAECBBYnsP+DQ+Xy9bd14syr6YBCgCXAmh4Lk/566c3ryr53Dy5u5/RbBAgQIECgHwICrH7U2VYSIECAAIHFC/x84kSJs0MmfZA/6vcXYAmwRj2mFvt6L+55o8Qluh4ECBAgQIDArAICrFlp/IAAAQIECBAo3/74U1n74EOdC68iaBBgCbAWGziN6vfijoOPPvu8mYYAAQIECBCYX0CANb+RZxAgQIAAgX4KxB0Htzz5dCfuODhT4CDAEmDNNC6a+t6f/ryqbNy6zaLt/ZxebTUBAgQILFxAgLVwM79BgAABAgT6IfDMrt2dWrS9DiYEWAKsekw02Y47Dn71zbF+TCa2kgABAgQILF1AgLV0Q69AgAABAgS6JTA1NVX2vnOgs2deTYcUAiwB1vRYaPprLNouvOrWvGlrCBAgQGDsAgKssRN7AwIECBAg0DKBg598Wq7YcHsn1706M6gQYAmwzhwPTf37kptuKbvffKtls4LuEiBAgACBiQsIsCZeAh0gQIAAAQKJBI4eP15Wb7638+FVhBUCLAFWU6HV9PvEou1PvfJqibMcPQgQIECAAIEFCQiwFsTlyQQIECBAoMMCsWj7ui0Pl2XLVwqwEtY5ztqZDkJ8bWf4FnccjP3MgwABAgQIEFiwgABrwWR+gQABAgQIdFAgDqq3v/BSiTuj9SUccQZWO0OgNo7P2K/WPvhQ+fnEiQ7OHjaJAAECBAg0IiDAaoTZmxAgQIAAgeQCL+55o9N3HJwp9BBgCbBmGhfj+N6VG+8sh49+nXwW0D0CBAgQIJBaQICVujw6R4AAAQIEGhCIOw5efMPa3px5NR1QCLAEWNNjYZxfL7t1fYkbI3gQIECAAAECSxIQYC2Jzy8TIECAAIGWC8RZIXGAPc4D+KyvLcASYI17bF64ek3Z8/b+8tvp0y2fKXSfAAECBAhMXECANfES6AABAgQIEJiQwLc//jRYl2fcB/FZX1+AJcAa59iMOw7Gou0eBAgQIECAwEgEBFgjYfQiBAgQIECgZQInTp4sm7Zt7+WZV9OhhQBLgDU9Fkb9NRZtv//xJ9xxsGXzou4SIECAQGoBAVbq8ugcAQIECBAYg8DU1NTgjoMXrLpOgDUG33G95O433+p1vUYdMo3z9dZtebgcPX58XEPB6xIgQIAAgT4KCLD6WHXbTIAAAQL9FYjwKtbk6Xt4FeGFM7CcgTWOECvWlPvqm2P9nWRsOQECBAgQGI+AAGs8rl6VAAECBAjkFHjrvffLJTfd4kweAZYx8P9GH+BdevO6sv+DQzl3fr0iQIAAAQLtFhBgtbt+ek+AAAECBIYX+Pjwl2X5pnsEF/8NLpyBNfoAZxxnNLXlNeOOgy/ueaPEWY4eBAgQIECAwMgFBFgjJ/WCBAgQIEAgocCvp06VNfc9UJYtXynAEmAZA2M4+2r7Cy9ZtD3h3KdLBAgQINAZAQFWZ0ppQwgQIECAwCwCccfBuCNaW85kaaqfzsByBtYoxlrccXDj1m2z7H2+TYAAAQIECIxIQIA1IkgvQ4AAAQIEUgr8dvp02fGPnRZtn+GMGwGWAGsUAdbaBx9yx8GUs59OESBAgEDHBARYHSuozSFAgAABAmcJxB0HL75hrbOvBFjGwAxjYKkB1uXrbyuHPv/irH1OgwABAgQIEBiLgABrLKxelAABAgQIJBCIRdsvuv5GwcUswYUzsJyBtZQAKxZtP/DhRwn2dF0gQIAAAQK9EBBg9aLMNpIAAQIEeifw2ZEjZcXdm4VXs4RXEVwIsARYiw2wIrx6Ztfu3s0rNpgAAQIECExQQIA1QXxvTYAAAQIExiLw84kTZcMjW4VXc4RXAizh1WLDq/i9LU8+7Y6DY5m9vCgBAgQIEJhVQIA1K40fECBAgACBFgpMTU2VzY/tKHFntKUcoPfhd52BJcRazDjftG17iZDYgwABAgQIEGhUQIDVKLc3I0CAAAECYxSIOw4+99rr5fwV1wqv5jn7KoILAZYAayEB1rLlK8tVd9xVjn33/Rj3Yi9NgAABAgQIzCIgwJoFxrcJECBAgEDrBPa9e9AdB4cIrqZDCwGWAGt6LAzz9bJb11u0vXWzog4TIECAQIcEBFgdKqZNIUCAAIEeCxz85NMSB9jDHIh7zn+CGwGWAGvYfeHiG9aWve8c6PEMY9MJECBAgMDEBQRYEy+BDhAgQIAAgSUKfPvjT2X5pntKXOI07AG557mE0BgYLsCLS3Lj0ty4RNeDAAECBAgQmJiAAGti9N6YAAECBAiMQCAWk45F24URw4URZzo5A2vhZmf69eHfcTOE2L/i5ggeBAgQIECAwEQFBFgT5ffmBAgQIEBgCQJxRsjDT//dmVcLWPfqzNBFgCXAOnM8zPTvDY9sdcfBJcxRfpUAAQIECIxQQIA1QkwvRYAAAQIEGhWIy5ouXL3G2VcCLGNgkWNgptBq+nsr7t5cPjtypNF92psRIECAAAECswoIsGal8QMCBAgQIJBYIBZtv+j6GwUXSwgunIHlDKzpsKr+GsFw7GMeBAgQIECAQBoBAVaaUugIAQIECBAYUuDQ51+UKzbcLrxaQngVgYUAS4BVB1fRjmB495tvDbk3ehoBAgQIECDQkIAAqyFob0OAAAECBEYicOy778vaBx8SXi0xvBJgCa9mCq8uWHVd2fGPne44OJLZyosQIECAAIGRCgiwRsrpxQgQIECAwJgF7v7rYyXujDbTwbfvLSyUcQbWwrz6ML5i/4o7e3oQIECAAAEC6QQEWOlKokMECBAgQGAGgV9PnRqcGdKHEKGpbRRgCbCmx9qy5SvLmvseKLGfeRAgQIAAAQIpBQRYKcuiUwQIECBA4AyBqampsvOfey3aPoLLBqcDi/gqwBJgTY+Hq+64q3x8+Msz9jr/JECAAAECBJIJCLCSFUR3CBAgQIDAOQIHPvyoXHbrepcNCrCMgRGPgQiwLr5hbdn7zoFz9jvfIECAAAECBFIJCLBSlUNnCBAgQIBAJfDVN8eEV2MILZyB5eyrGAPnr7i27Hl7f4mzHD0IECBAgACB1AICrNTl0TkCBAgQ6LVA3HFw3ZaHnXUjwBrsB7vffMtYGOFYiPAqLiP97fTpXs8zNp4AAQIECLREQIDVkkLpJgECBAj0TCAOqrc8+bQ7Do4wsJhe72j6qzWw+n0W1oZHtrrjYM/mVZtLgAABAq0WEGC1unw6T4AAAQKdFdj+wkuDy5umwxZfRx+2CLBGb9qWcbr2wYdKnOHoQYAAAQIECLRGQIDVmlLpKAECBAj0QiDW4okFpS9cvcblYmM8+yqCFgFWPwOsuCHCZ0eO9GI+sZEECBAgQKBDAgKsDhXTphAgQIBABwQOff5FuXz9bcKrMYdXAqx+hlcXXX9jibXEPAgQIECAAIHWCQiwWlcyHSZAgACBzgocPvp1uXLjncKrBsIrAVb/Aqw4q/HFPW90dv6wYQQIECBAoOMCAqyOF9jmESBAgEBLBE6cPDm44+Cf/rxKgCXAmnHUugvh4kO3ZctXDi4Zjf3MgwABAgQIEGilgACrlWXTaQIECBDolMCvp06VWLS9LQtgd6Wf1sBafCDUpjEQ4VUs2h77mQcBAgQIECDQWgEBVmtLp+MECBAg0AmBWLT9qVdedcfBhs66OjN4EWD1I8BavfnecvT48U7MFzaCAAECBAj0WECA1ePi23QCBAgQSCCw5+395ZKbbnH2lQBr3tHoEsKFB25xQ4QDH340r60nECBAgAABAukFBFjpS6SDBAgQINBZga++OVYuu3W98GoC4VWcieUMrIUHQmeewZb93+ddfU3Z+86BEmc5ehAgQIAAAQKtFxBgtb6ENoAAAQIEWikQ4dWKuzcLryYUXgmwuh1eXbDquvLMrt2tnBt0mgABAgQIEJhRQIA1I4tvEiBAgACBMQr8fOJE2bRte3HHwcmGKM7Amqz/uM7giv3q/sefKO44OMZJzEsTIECAAIHmBQRYzZt7RwIECBDou8Cjzz5f4gyRcR3Ae93hghkB1nBObRtPccfBY9993/dpxvYTIECAAIGuCQiwulZR20OAAAECeQV+O3267PznXsHVBC8bPDOMEWB1L8C6YsPt5dsff8o7CegZAQIECBAgsFgBAdZi5fweAQIECBBYqMC+dw/DLAOfAAAgAElEQVSWS29eJ8ASYC106Aye7y6EcwducUOEt957f1G2fokAAQIECBBILyDASl8iHSRAgACBTgh8duRIueqOu4RXScKrOBPLGVhzB0Jnnq2W/d8Xrl4zOLuxE5OFjSBAgAABAgRmEhBgzaTiewQIECBAYJQCsWi7Ow7mC0sEWPlqspigbNnylYM7DsYluh4ECBAgQIBAZwUEWJ0trQ0jQIAAgRQCEV7FHdHiIHsxB+d+Z3whiwBrfLZNjdvzrr5mcEfPX0+dSrG/6wQBAgQIECAwNgEB1thovTABAgQIECil/G3ny+X8FdcKrxJdOjgdrgiw2h9grbnvAXccNNMSIECAAIF+CAiw+lFnW0mAAAECkxB4cc8bJdbmmQ5MfM0VmAiwctVjofvHlRvvLLG2nAcBAgQIECDQCwEBVi/KbCMJECBAoFGBqampcvCTT8vFN6wVXiU882o6KBFgtTfAuuj6G8v+Dw6V2Nc8CBAgQIAAgV4ICLB6UWYbSYAAAQKNCnz1zbGyfNM9wqvE4VWEWAKsdgZYcVbjc6+93ug+7c0IECBAgACBiQsIsCZeAh0gQIAAgU4JfPvjT2Xtgw8Jr5KHVwKsdoZXsZ7c9hdecuZVp2ZNG0OAAAECBIYSEGANxeRJBAgQIEDg/2/v/kKtqtb+gb9E1MW58KKLoItuuukm6CJ+RiblIYzCKATBwCLDYF9UFIe8MJCIBEGioCiKIioQjEQipIOHQyIkIVGRVJxTYShGYv9jY5js8ePZb/u1P+69xtp7rfXMP58FobnHXmPOz3zm2Gt+95hjVgj8euZMmdq+o8ST0eZuU/Nnc4MSM7Cae2zmO282Pba9fP9zfH71IkCAAAECBHomIMDq2QG3uwQIECAwJoFYiycWbT//6pXCqxbMvjIDq33h1VV33l1ihqMXAQIECBAg0EsBAVYvD7udJkCAAIGRC+x+e78nDrYkuJqb3WMGVntCrCvW31E+PfLlyM9bb0iAAAECBAi0RkCA1ZpDZUMJECBAoLEChz7+pFy+7nYzrwRYY63RPfsP9LLG4mmee985OFZbb06AAAECBAg0XkCA1fhDZAMJECBAoNECP01Pl7i1aW5Wjz/bM6vHDKx2HKt44mCsL+dFgAABAgQI9FpAgNXrw2/nCRAgQGBJArGY9NrNW4RXLZt5NRcyCrCaHWDFEwc3P/XMks5R30yAAAECBAh0RkCA1ZlDaUcIECBAYKICv5w+XSIAiYvsuUDEn80ORP58fARYzT1e8TCE9Q9v9cTBiY5qOiNAgAABAo0WEGA1+vDYOAIECBBorEA8cXDZqtXCq5bOvoowS4DV3ABr+cZ7ypHjXzX2/LdhBAgQIECAwMQFBFgTJ9chAQIECLRe4MAHH5a/rfy78KrF4ZUAq7nh1SU331o+O3as9eOEHSBAgAABAgRGKiDAGimnNyNAgACBzgu8/5//livW3yG8anl4JcBqZoAV4dXut/d3fhyxgwQIECBAgMDQAgKsocl8AwECBAj0VuCbH34sq+97QHjVgfBKgNW8ACvWvdrx6k5PHOztCGvHCRAgQIDAggICrAV5fJEAAQIECPwmEIu2xxMHz1t+rQBLgJVyXuzZf6DTtbflmedKnGdeBAgQIECAAIFzCAiwzoHinwgQIECAwB8E4qJ620uvlJghEjN3/NcNA4u4N+M4xnm15sGHyk/T03847/wPAQIECBAgQOB3AgKs32H4KwECBAgQOKfArn/92xMHOxjcCbCaEWDFmnIWbT/n0OMfCRAgQIAAgbMCAqyzFv5GgAABAgT+KvD2e++XWFjarKtmhB2jPA4CrPxjeukta8uhjz/564nnXwgQIECAAAECfxQQYP3Rw/8RIECAAIGzAke/PlEuX3e78KqDs68iCBNg5QZYf1v59xLrev165szZk87fCBAgQIAAAQLnFhBgndvFvxIgQIBA3wXiiYOxaPsoZ/x4r9zA5M/+Aqy843HhiutbFyD2fUy0/wQIECBAIFlAgJV8AHRPgAABAg0UmD51qkxt3yG86ujMq7kgS4CVE2DFkzzj/PLEwQYOfjaJAAECBAg0V0CA1dxjY8sIECBAIENgZmZm9omDcXvTXNDhz5ygY9zuAqyc4xpPHDx+8mTG6a1PAgQIECBAoL0CAqz2HjtbToAAAQLjENj37qEivMoJNsYdWP35/QVYkz/OsWj7keNfjePU9Z4ECBAgQIBAtwUEWN0+vvaOAAECBIYROPDBhyUusP8cdPj/yQcdkzAXYE32uMbTPOMc8yJAgAABAgQILEJAgLUINN9CgAABAh0U+OzYsbJ84z3Cq46ve/X7YEyANbkAa9mq1eXlvW954mAHx067RIAAAQIEJiQgwJoQtG4IECBAoMECv545U2JdnvOvXinAEmA1tlL37D/Q2vqMsNCi7Y0tLRtGgAABAgTaICDAasNRso0ECBAgMD6BeOLgP558qrXBwO9nFPn7cDOKzMAazmsx9RWh8PqHt47vBPbOBAgQIECAQF8EBFh9OdL2kwABAgT+KhAzr55+7XWLtvdo1tXvQxgB1vgDrFVT95ajX5/468nnXwgQIECAAAECwwkIsIbz0poAAQIEuiQQTxy8+MY1Zl8JsFpR1m27hfCy29aVQx9/0gpbG0mAAAECBAg0XkCA1fhDZAMJECBAYCwCnx75UnjV0+BqbhaWGVjjm4EVi7Z74uBYhi5vSoAAAQIE+iogwOrrkbffBAgQ6LPAkeNflbi1aS7I8Of4gowm2wqwxnPcI7x6YueuMjMz0+dhxr4TIECAAAECoxUQYI3W07sRIECAQNMFYtH2jY9uE171fPZVBGsCrPEEWPFQBE8cbPpIaPsIECBAgEDrBARYrTtkNpgAAQIEliRw/+NPlguuuU6AJcASYI2hBiIc/ml6eknnqG8mQIAAAQIECJxDQIB1DhT/RIAAAQIdFIgnDr68961y4YrrhVdjCC6afKvgfNtmBtboZmCdt/zacuWGu8qJb7/r4OhhlwgQIECAAIEGCAiwGnAQbAIBAgQITEAgFpS+5OZbhVfCq/+rAQHW6AKsS29ZWw5+dHgCZ7IuCBAgQIAAgZ4KCLB6euDtNgECBHolcPjzL8plt637v+Bivhk5/n10gUYbLAVYozneF91wU9n37qFejSl2lgABAgQIEJi4gABr4uQ6JECAAIGJCnz/889lxaapErc4tSFUsY2jCVVqHAVYS7eO9eSefu11i7ZPdFTTGQECBAgQ6KWAAKuXh91OEyBAoCcC8cTBWLS9JszQZulhRtsMBVhLO+YRCm/Y+miJ9eW8CBAgQIAAAQJjFhBgjRnY2xMgQIBAkkBcVD/y/ItmXlnzat4AU4C1tABr7eYtJWY4ehEgQIAAAQIEJiAgwJoAsi4IECBAIEEgnjgYa/O0bVaQ7V1aqDKMnwBr8dbLN95TPj3yZcKZrUsCBAgQIECgpwICrJ4eeLtNgACBTgvEou0X37hGeGX21YI1IMBaXIC1bNXqcujjTzo9htg5AgQIECBAoHECAqzGHRIbRIAAAQJLEohZIVesv2PB4GKYWTraLi7kaIObAGv4YxuzGne/vX9J56hvJkCAAAECBAgsQkCAtQg030KAAAECDRU48e13Zc2DD1n3ysyrqgBTgDVcgHXhiuvLtpdesWh7Q8c/m0WAAAECBDouIMDq+AG2ewQIEOiVwNT2HeWCa66rCi/aMEPINg4XsAzrJcAaznfjo9vKT9PTvRpT7CwBAgQIECDQGAEBVmMOhQ0hQIAAgUULxBMHd7y6U3Bl5tVQNSDAqg+wVmyaKtOnTi36HPWNBAgQIECAAIElCgiwlgjo2wkQIEAgWWBmZmZ2TR5PHKwPI4adqdTV9gKsupqJNeXiwQheBAgQIECAAIFEAQFWIr6uCRAgQGAEAu//57/l8nW3DzXzpquBjP2qC2TmnARYg73iaZ573zk4gjPVWxAgQIAAAQIEliQgwFoSn28mQIAAgVSB4ydPCq/cNrjo8FKAtXCAFYu2xxMHY5ajFwECBAgQIEAgWUCAlXwAdE+AAAECixT45ocfy4atjy46vJibhePPhUOMLvsIsOY/9hFebX7qGU8cXOT45NsIECBAgACBkQsIsEZO6g0JECBAYOwCsWh7XFyff/VKAZYZWIuuAQHW/AHW+oe3lu9/js+JXgQIECBAgACBRggIsBpxGGwEAQIECAwlEE8c/NvKvy86uOjyrCL7Nn8o82cbAda5rVZN3VtOfPvdUOekxgQIECBAgACBMQsIsMYM7O0JECBAYIQCsRbP2++9X5atWi28MvNqyTUgwPprgHXpLWvLZ8eOjfCs9VYECBAgQIAAgZEICLBGwuhNCBAgQGAiAp8e+dKi7YKrJQdXczOxBFh/DLAuuuGmsmf/gYmcyzohQIAAAQIECAwpIMAaEkxzAgQIEEgSOPr1ibJ84z0jCy/mQgx//jHE6JOHAOvssY9bcl94482ks1u3BAgQIECAAIGBAgKsgUQaECBAgEC6wPSpUyUWlbZo+9nAoU9B07j2VYD1v/V03vJrS1jEeeZFgAABAgQIEGiogACroQfGZhEgQIDAbwK/nD5dYtH2cYUY3re/oZgA63+P/er7HhBeGXEJECBAgACBpgsIsJp+hGwfAQIE+iwQi7Y/u3tPuXDF9QIsa1+NvAYEWCvKik1TJW7P9SJAgAABAgQINFxAgNXwA2TzCBAg0GuBfe8eKvFUNLOk+jtLapzHvu8B1mW3rSsHPzrc6zHGzhMgQIAAAQKtERBgteZQ2VACBAj0TOD4yZOeOGjW1VjDyz4HWLGe3N53DpaY5ehFgAABAgQIEGiBgACrBQfJJhIgQKB3AhFerZq6d6zhxThn9njvdswY62uAFU8cfGLnrt6NK3aYAAECBAgQaLWAAKvVh8/GEyBAoIMCP01Pl6ntOzxx0OyrsQeYfQywYuZVnF+eONjBwdMuESBAgACBbgsIsLp9fO0dAQIE2iew7aVXSswQMYupHbOY2nyc+hhgxRMHT3z7XfsGBltMgAABAgQI9F1AgNX3CrD/BAgQaIrAr2fOlD37D5h5ZebVxMLLvgVYl6+7XXjVlAHPdhAgQIAAAQLDCgiwhhXTngABAgTGI3Dggw9LPBWtzTN6bHu7Zo31KcCKc+vt994fz8nrXQkQIECAAAEC4xcQYI3fWA8ECBAgMEjgyPGvyvKN9wivzL6aaA30JcCKW3Jf3vvWoNPQ1wkQIECAAAECTRYQYDX56Ng2AgQI9EEgFm33xMF2zVzqykyzvgRY8cTBuEXXiwABAgQIECDQYgEBVosPnk0nQIBA6wUivPrHk0+V85ZfO9GZN10JYOzH0oK/rgdY8cTBjY9uK7+cPt36scIOECBAgAABAr0XEGD1vgQAECBAIFHg6ddeLxeuuF545dbBlBrocoAVofCKTVPl+MmTiWe4rhcjMH3qVDn69Yny/n/+W/a+c7Ds/Oe+8uzuPWXHqztLPKV1yzPPlfsff/L//pvavqPEf3P/tvmpZ2bbRNsYY+P20XifWGfw8OdflG9++NGMvMUcGN9DgAABAtkCAqzsI6B/AgQI9FUgLsouuuGmlODCzKWlzVzqil+XA6wr1t9RPjt2rK/DS2P3+/uff54NkWJB/RgDI2Ta9Nj2svq+B0ocs2WrVk9kTIxfHFxy862zaw+u3bxldiZshF27394/G3TFuoRm7jW2jGwYAQIE+iogwOrrkbffBAgQyBT49MiXsxdPXQlC7Ec7A7GuBlgRDMdsm5mZmczTvLd9h3sEVRECxSyqmAEVt0rPhVSX3rJ2Nry/4JrrJhJW1Y5PMWsvFvy/+MY1s0+EverOu0uEW488/2LZs//AbPAWM/pihpgXAQIECBBIEBBgJaDrkgABAr0WiAsgi7a3M/CpvRBuS7suBlgRQMRMGq/JC8SMt5hVNRdWXXbbuk7dIh2zw34fau1799BsUDd5aT0SIECAQE8FBFg9PfB2mwABAikCMSshfqPfloDDdnY7aOtagBWLtsdsGTOvxj+8xQMoDn38yezaVBu2Pjo7Y6mP40XMIrtyw10l1t3a9a9/z87S8sTL8defHggQINBTAQFWTw+83SZAgMDEBeKiJhYZtmh7t0OhNl3Edy3AiicOxgLdXqMXiNvm4pbAWAw9xrGYiRRrSEVo2KaaH+e2xuy/uD0yZtjG2l5xG+uJb7+zYPzoy9E7EiBAoK8CAqy+Hnn7TYAAgUkKxIyQuLXGxZ7wapwX0MO+d5cCrFgAXHg1+lEtAphYw2r9w1vL5etuN4YN8cTU+GXF8o33zAZ+cbuhReFHX5/ekQABAj0TEGD17IDbXQIECKQIxKwFTxwUXg0bMI27fVcCrAhWDn/+Rcq53bVOY6ZoPGTihTfenJ1JZMbo6MatWBw+breMWw0jGPQiQIAAAQJDCgiwhgTTnAABAgSGFIh1YmJ2yLjDCO8/ugvNvlh2IcCKUCACYq/FC0RodfTrE7NP2os1+uI2uKY9IbBL52Tcahg/E+JWzLjNMGYOWrdt8fXrOwkQINAjAQFWjw62XSVAgMDEBWKh4xWbpoRXQ9x206UL1abvSxcCrGd377HG0CJHtghNYrZVPDUwAhW3OE8+BI8wK9bMemLnLrOyFlnHvo0AAQI9EhBg9ehg21UCBAhMVCCeOBi3izQ9xLB9k79obYp5mwOsuLUtZrB4DS8Qt6/N3SIotGrO+R9hVjyIIGYUxqL5XgQIECBA4E8CAqw/gfhfAgQIEBiBQCzWG+GA9WOac3HYlNCoSdvR1gDrvOXXlrjVzaLt9YPV3NpW8XS8KzfcZWxq8KzQWC8xZu7Ggz/i1k63F9bXuZYECBDouIAAq+MH2O4RIEAgRSAuPJatWm32VYMvEpsUJGVtS1sDrAhgPjt2LOXcbmOncZtgzFa75OZbjUktGpNidtxVd95ddry6s8Tt6F4ECBAg0HsBAVbvSwAAAQIERixw8KPDJW4FyQol9GvWV20NtDHAihAmAhmvhQViFmgsEB4z1cwEbf+YELOytjzznNpfuOx9lQABAl0XEGB1/QjbPwIECExS4PDnX8zenlMbIGjX/gvLNh/DtgVYEcjE7Eav+QUiuHr7vffL+oe3lgg92lyftv2P42PMyIonRM4FWXFbqBcBAgQI9EpAgNWrw21nCRAgMEaBWLR9zYMPuWBs0S06fb9AbluAFeGMi/b5B7EI0Dc9tt3tyz0Ygy67bd1skGUduPnPB18hQIBABwUEWB08qHaJAAECExeIi+p44mAsLt33UMT+/3HWRJM92hZgTfzEbkGHscB3BFcx/rh1uT3n3qjGhYtvXFNiYf7jJ0+2oFptIgECBAgsUUCAtURA306AAIHeC8SskFhk94JrrhNe9WDmw6guPJvwPgKsdg9fR45/Nfu007itrAn1ZBtyArT42XPF+jtmb6+NmcBeBAgQINBZAQFWZw+tHSNAgMCEBPbsP2CtGcFVKwMEAdaEBokRdxOh+a5//btcvu72EusiCY5ygqOmucdi/XEbezxIxIsAAQIEOikgwOrkYbVTBAgQmJBALCrt0fQuHpt2IVu7PQKsCQ0UI+xm37uHyqqpe4VWQvN5ayBCzfsff9ITC0d43nkrAgQINERAgNWQA2EzCBAg0DqBWHMkbtuoDQu0E3Q1rQYEWO0ZduJ2wc1PPWO2p+Cq6mdOhFgxQ+/Z3XvKT9PT7Sl0W0qAAAECCwkIsBbS8TUCBAgQOLdArDMSj6lvWiBhe4Rkw9SAAOvc53fT/jVuU77qzruNN8KroWsgHiwSP6s+PfJl08ra9hAgQIDA8AICrOHNfAcBAgT6LTB96lSZ2r5j6AuJYYIFbQVRk6gBAVazx7LPjh0rmx7bbqwRXC25Bi664abyyPMvmo3V7FPe1hEgQGCQgABrkJCvEyBAgMBZgXhkfTxx0OPqBUyTCJjG3YcA6+y53aS/xSLtO/+5b/YWZYu0G2tGNQ7E0wpjkfdDH39Sfj1zpkklb1sIECBAoE5AgFXnpBUBAgQIhEAs2r5s1eol/zZ8VBck3sfF7VJqQIDVvHHtmx9+nF3rSkju3F7Kub3Q9156y9rZtbGaV/22iAABAgQGCAiwBgD5MgECBAj8JhCPJo8P/gtdGPiai8421YAAq1nD2953DnowhNsFJ/YzxtpYzTr/bQ0BAgQqBARYFUiaECBAoPcC8QSwFZumJnZh0aYQxLa2N7QTYDVjaIuHQjyxc5cnDAqvJvozJhZ4v3LDXSUeEuCWwmaMBbaCAAECAwQEWAOAfJkAAQK9F4gP9ms3bynWomlvUCNkO/exE2DlD2/HT54sGx/dVi5ccf1EwwvnxLnPiT66xG3xEaDGA0q8CBAgQKDRAgKsRh8eG0eAAIFkgfhAv/mpZ1xYmhnRyRoQYOUNMBGMx5p6l922rpO11ccgqO37HL+oiSdfehEgQIBAYwUEWI09NDaMAAECyQJxgfnCG2964qDwqrMBgwArZ5CJYDzGlktuvrWztdX2MKeP2x+zjK9Yf0eJ9R7dUpgzNuiVAAECAwQEWAOAfJkAAQK9FXj7vfddYAqvOh0wCLAmP7xFMHD/408Kxo0tjR1b4mElu/7178mfHHokQIAAgUECAqxBQr5OgACBPgrEbRQX37imsRcYfZwdYJ9Hv2aPAGuyo1s8DGLNgw8ZV4RXja+Bv638e/nHk0+VX06fnuxJojcCBAgQWEhAgLWQjq8RIECgjwJHvz5RVt/3QOMvMAQ6ow90+mYqwJrcCHfo409mn2TqYRDO27aMMxdcc12Z2r6jxIMGvAgQIECgEQICrEYcBhtBgACBhgjEb5vjiWDxePG2XGTYThfEi60BAdZkBp4IryzW7jxd7Hma+X3xszAWd49f7HgRIECAQLqAACv9ENgAAgQINEggbpmI3zpnXjDo24XupGpAgDXewSfWu9r5z33lohtuMqa4bbDVNXD5utvLp0e+HO8J490JECBAYJCAAGuQkK8TIECgDwJxoRmL1sa6H5MKD/QjqMquAQHW+Ea3GFOe2LnLWnqCq878TIknFMbDTWZmZsZ34nhnAgQIEFhIQIC1kI6vESBAoC8C8djwePJSdqCgf6HWJGtAgDWeES5uRX52955y4YrrjSkCrM7UQNxOGLfC7nv30HhOHO9KgAABAoMEBFiDhHydAAECXReI2yLi9ohJBgf6ElQ1oQYEWKMf3aZPnSpbnnmuWKzdOd6Ec3wc27Bs1eqy952DJWYZehEgQIDARAUEWBPl1hkBAgQaJvD9zz/PPnHQxaaLzXFc6DX9PQVYox2QYuZVrKPnVmTjSdPP/aVu3yU33zq7vpsQa7RjiHcjQIDAAAEB1gAgXyZAgEBnBWKmRFxsLvWDvO93sdrWGhBgjW54i/Hkkedf9ARTtwz25mfKxTeuKbvf3j+6k8g7ESBAgMAgAQHWICFfJ0CAQBcF4rfG2156xW0+LjZ7c7F5rpBNgDWa0W0uDI81gs7l7N+E3F2tgXhqb4RYZmKNZizxLgQIEBggIMAaAOTLBAgQ6KRAPNo+fnvc1YsK++WCuaYGBFhLH97cNuhcqznXutwmbicUYi19LPEOBAgQqBAQYFUgaUKAAIFOCcSi7cIrF51dvqCs3TcB1tKGtgivnti5y0xOMzl7/8uQeIrv2++9v7QTyncTIECAwCABAdYgIV8nQIBAlwQ+O3asXLnhrt5fbNQGHNp1O+gTYC1+dItbpiK8unDF9cYTAZYa+H8rykU33FQOffzJ4k8q30mAAAECgwQEWIOEfJ0AAQJdEfjmhx/L2s1bLLLsYtPF5m81IMBa3Og2MzNTnt29Z/aCXcjb7ZDX8R3u+F6x/g4h1uKGFd9FgACBGgEBVo2SNgQIEOiCwP2PP1liwVkXJMNdkPDqrpcAa3Ej24EPPizLVq02lgjD1cA5amDFpqly5PhXizu5fBcBAgQILCQgwFpIx9cIECDQBYG41SdmSwhiuhvEOLaLO7YCrOFHuAivYr0fNbe4muPWD7cIsb7/Oa6zvAgQIEBghAICrBFieisCBAg0TiBu9dmz/4BF28/xW3IXkv24kFzoOAuwhhuy4gEQV915t/DKeKIGBtTAecuvLVPbdwixhhtitCZAgMAgAQHWICFfJ0CAQJsFDn/+Rbl83e0uNgZcbCwUcvhad4MuAVb96DZ96lRZNXWvNfSMJX6eVNbA+VevLNteeqXEL5K8CBAgQGAkAgKskTB6EwIECDRQIBZtjwVlBTDdDWAc26UdWwFW3cD10/R02fTYdmNJZXDhvFzaedklv7+t/Ht5+rXX6040rQgQIEBgkIAAa5CQrxMgQKCNAhFebXx0mwtOF5xqYIEaEGANHt1iDb0dr+4scSHepWDBvgiZJlUDF91wUzn40WEzsQYPN1oQIEBgkIAAa5CQrxMgQKBtAnG7wiPPv1ji9oVJfUDXj4vBNtaAAGvw6Lb3nYPW0FsgBG1j3dvmyY/XsXbc0a9PDD7htCBAgACBhQQEWAvp+BoBAgTaKBC3K5gtMfkLFBeF7TMXYC08wn127JjwSnjlFyEjqoE1Dz5kUfeFhxxfJUCAwCABAdYgIV8nQIBAWwRi5lU84j5uVxCmtC9Mccwmf8wEWPOPbsdPnixxwa0uJ1+XzLtpfuGK60uMORZ1n3/c8RUCBAgMEBBgDQDyZQIECLRGIB5xb9H2bl74uKAdz3EVYJ17eIsL7C3PPOc25BHNvHH+juf8baNrzI6OXzR5ESBAgMCiBARYi2LzTQQIEGiYQMyWWLFpymwJF5xqYIgaEGCdeyB7ee9bZdmq1WppiFpqY5him3OCtcvX3V7iF05eBAgQIDC0gABraDLfQIAAgYYJ/HL69OwTBy3annMx4iKwve4CrL8OZkeOf1UuvWWt8Ep4pQbGWAPrH95afpqe/usJ6F8IECBAYCEBAR6vYJIAACAASURBVNZCOr5GgACBpgvEI+6f2LnLhcYYLzQEVO0NqAYdOwHWH0e4uKCOC+tBbr7e3XPCsZ3MsY1bCeOBK14ECBAgMJSAAGsoLo0JECDQMIG41ccTBydzweHCrnvOAqyzA1qsexVh+HnLrxVgCcTVwARqIH52H/78i7Mnob8RIECAwCABAdYgIV8nQIBAUwX2vXuoXHbbOhcaE7jQEF51L7yKYyrAOju6HfzosFsHjSV+nky4BuJJnye+/e7siehvBAgQILCQgABrIR1fI0CAQFMF4gNvLAQrWOlmsOK4Tua4CrD+d4SLW5FX3/eA8WTC4YXzfDLneZOdY+3KbS+90tSPGraLAAECTRMQYDXtiNgeAgQIDBKI8MrFpgufJl+UtWXbBFilRHi149WdwivhlRpIqoGLb1xT3n7v/UE/+n2dAAECBEoRYKkCAgQItElg+tSpMrV9R/HEQQFWW0KiJm+nAKuUQx9/4tbBpOCiyeeGbZvsz5hVU/eWeKKwFwECBAgsKCDAWpDHFwkQINAwgVhk2aLtk72wcCHXXe++B1hxweypg92tb2NXu45tPJQlHqbgRYAAAQLzCgiw5qXxBQIECDRIID7U7n3noJlXZkq4zWeENdD3AOvZ3XsE4iOsJ4FRuwKjph2vS29Z66mEDfrcZVMIEGikgACrkYfFRhEgQOBPAvGEME8cdHHUtAuutm9PnwOsb3740a2DwiuBeMNqYOOj29xK+KfPP/6XAAECvxMQYP0Ow18JECDQSIGjX58oKzZNudBo2IVG28Mb27+i9DXAioXbH3n+RWOKMUUNNKwGLrrhprLv3UON/CxiowgQINAAAQFWAw6CTSBAgMC8ArFoeyzuKmww+0oNjL4G+hpgxYzOuFBWU6OvKaZMl1oDV6y/wyyseT8V+QIBAj0XEGD1vADsPgECDRaI8CousM9bfq0LzYb9lnypFyi+vxkXuX0MsGJcWbt5izHFmKIGGloD8TP/hTfetKB7gz+f2TQCBNIEBFhp9DomQIDAAIH4AOuJg80IOgRO3TwOfQyw4mEQy1atFl40NLww1nRzrBn2uMYsrFg+wIsAAQIE/iAgwPoDh/8hQIBAQwR2v73fLT4uMIUMY66BvgVYv5w+XeLCeNiLae2FKmpg8jWw5ZnnzMJqyGcym0GAQGMEBFiNORQ2hAABAr8JfHrkS08HG3Nw4WJs8hdjTTTvU4A1MzNTdv5zn1uSjS0CzJbUQDx5+PDnX/hsRIAAAQJnBQRYZy38jQABAvkCJ779zqLtLbm4aGIgY5uGC+b6FGDF2OJppsPVh/OJV2YNnH/1yjK1fUf+BxNbQIAAgeYICLCacyxsCQECfRf4/uefy/qHt/rtuABLDUyoBvoUYD2xc5e6mlBdZYYe+u5W6HbBNdeVz44d6/vHI/tPgACBOQEB1pyEPwkQIJAp8OuZM2XzU8+UC1dc7yLTRaYamFAN9CXAOn7yZLlyw13qakJ1JUTqVoiUfTzvf/zJEuvXeREgQIBAEWApAgIECGQLxNo0sWi78MpFT/aFUt/670uA9fRrrxtfhFcCzJbWwMU3rrEWVvYHNf0TINAUAQFWU46E7SBAoL8C8Vj7i264ycVFSy8u+hb6dGl/+xBgTZ865aEQxhY/X1peAxsf3VZiprYXAQIEei4gwOp5Adh9AgSSBeIJQx5rb+ZVl0KhNu1L1wOsmN358t63hBctDy/adE7Z1vH8PLv0lrXl/f/8N/kTi+4JECCQLiDASj8ENoAAgd4KxMwITwUbz4d9F1Fca2qg6wHWNz/86KmmwisBZgdqIJ5IGOtkehEgQKDnAgKsnheA3SdAIEngp+npErcE1FxkayOMUQPjqYGuB1ixtl5c+Kqf8dQPV66TrIFlq1aXeFqxFwECBHosIMDq8cG36wQIJAnEOhbbXnrFosod+K34JC9e9DX6i+UuB1gxw3PNgw8Jr4wzaqBDNfDEzl0lbg32IkCAQE8FBFg9PfB2mwCBRIGYFWHR9tGHEQIepsPWQJcDrAMffGic6VBwMWxta9/N8XD5xnvKiW+/S/wEo2sCBAikCgiwUvl1ToBA7wQOffxJidsAXFx08+LCcW3Xce1ygLVh66PGGQGWGuhYDZy3/Nqy61//7t1nJztMgACB3wQEWEqBAAECkxL49MiXJX57KuRoV8jheHX3eHU1wIoZGoLy7tatManfxzZuDf7l9OlJfXTRDwECBJokIMBq0tGwLQQIdFcgFl5du3mL8Kpjvw13IdnuC8muBlixTo7abHdtOn6O33w1cPGNa8rBjw539wOTPSNAgMD8AgKs+W18hQABAqMRiEXb43aemPo/3wdS/+5iRQ1Mvga6GGDF7KsVm6aMNcJyNdDhGrj/8SdH8wHFuxAgQKBdAgKsdh0vW0uAQNsEYpr/06+9Xi645joXEx2+mBA+TT58GoV5FwOsfe8e8oRTY42fNx2vgUtuvrXEk0a9CBAg0DMBAVbPDrjdJUBgwgJ79h/wJLCOX0iMIkjxHjkBWBcDrE2PbRdeGHPUQA9qYO87Byf8iUZ3BAgQSBcQYKUfAhtAgEBnBWKNiktvWetCogcXEgKonABqqe5dC7A+O3asXHbbOmOOMUcN9KAG1j+81Syszn6CtGMECMwjIMCaB8Y/EyBAYEkCsQ7NlRvusu5VDy4ilhqi+P688KtrAdbLe99y+6AxR3jVkxqI2wjj6cZeBAgQ6JGAAKtHB9uuEiAwIYF44mAs2i6YyAsm2LOvqYGuBVhrHnzIuNOT8KKmvrXp/jj4whtvTuiTjW4IECDQCAEBViMOg40gQKAzArFoezwdyIVD9y8cHOP2H+MuBVgx69PDItpfk8YVx3CYGlg1dW+Jzx1eBAgQ6ImAAKsnB9puEiAwAYGZmZnyxM5dZdmq1QIssyDUQAtqoEsBVszEGObCV1tBiRpofw3EbYSHPv5kAp9wdEGAAIFGCAiwGnEYbAQBAp0QOPDBh8KrFoQWLtraf9E2qmPYlQBr+tSpsnbzFgGW8UcN9KwGzr965ewvzjrxIcpOECBAYLCAAGuwkRYECBAYLBC/AfX0L8HIqIIV7zOZWupKgBULOcdMDHUzmbrhzLlJNRC3EXoRIECgJwICrJ4caLtJgMAYBY5+faLEB8gmfaC1LS6w1MDgGuhKgBVPHzxv+bXGoJ7NvnGODz7H+2B04YrrS6yB50WAAIEeCAiwenCQ7SIBAmMWWP/w1hLT+PvwQdk+umDqUg10JcCKMahLx8W+GGfUwHA1sPOf+8b8ScfbEyBAoBECAqxGHAYbQYBAKwXiyT9xAeyD9nAftHnxakoNdCHAihmgl6+73Thk9pUa6HENbNj6qKcRtvKTpI0mQGBIAQHWkGCaEyBAYFbg1zNnSjz1yxMHhTFNCWNsx/C12IUAa+87B41DPQ4unPfDn/ddNLti/R0lwmwvAgQIdFxAgNXxA2z3CBAYk0A8cdCiyS4cungh1Kd96kKA9cjzL5p5I8BSAz2vgVgHKz6XeBEgQKDjAgKsjh9gu0eAwBgEjhz/qlx6y1oXDD2/YOhT0NPVfe1CgHXlhruMRcYiNaAGSoTZXgQIEOi4gACr4wfY7hEgMGKB4ydPljUPPuRiwcWCGuhADbQ9wPrmhx/LBddcpxY7UItdDYnt1+RmKsfTkGN5Ay8CBAh0WECA1eGDa9cIEBixQCzaPrV9h8fVu1gUGHSkBtoeYMX6VwKCyQUErFk3uQYuu21d+ezYsRF/8vF2BAgQaJSAAKtRh8PGECDQaIG42I11Jpr8Ada2ucBSA/U10OYAa2ZmpvzjyaeMRx0JU5239ectq3Nb/W3l38ue/Qca/TnKxhEgQGCJAgKsJQL6dgIEeiAQU/LjQ2F8OPTB+dwfnLlwaWMNtDnA+v7nn8vq+x4wJgmw1IAamK2B85Zfax2sHnwmtYsEei4gwOp5Adh9AgQqBA59/IlF210guEjsYA20OcCKW4XilqE2Boe2WeCtBsZTAxFqexEgQKDDAgKsDh9cu0aAwAgE4iLxivV3uEjsYHjhAmo8F1Btcm1zgLXv3UPW4zMu+dmkBv5QA8tWrbaQ+wg++3kLAgQaKyDAauyhsWEECKQL/DQ9PXuLzvlXr/zDB8Q2XaDbViGNGpi/BtocYG176RXjkvBCDaiBv9TAp0e+TP/8ZAMIECAwJgEB1phgvS0BAi0XiCcObn7qmb98MBQGzB8GsGHTthpoc4C1/uGtxifhhRpQA3+pgZf3vtXyT2A2nwABAvMKCLDmpfEFAgR6KxCLtu94dWcx80og07ZAxvYOV7NtDbCmT51ya7Pg4i/BhfN/uPO/q173P/5kiaeUehEgQKCDAgKsDh5Uu0SAwBIFdv3r3+XiG9e4OHCBqAY6XgNtDbDiFqFLb1mrPjten10NWOzXeIO2NQ8+VGIJBC8CBAh0UECA1cGDapcIEFiCQCzafsnNt7owdGGoBnpQA20NsPa+c7DEYs2CgPEGAXz5trEG4sEzR78+sYRPQr6VAAECjRUQYDX20NgwAgQmLnDk+Fdl+cZ7XBT2ILho40WJbR79xXRbA6xnd+/xBELjlJ9VauCcNRDh9uHPv5j4ZygdEiBAYAICAqwJIOuCAIEWCHzzw49l7eYt1r1yQXDOCwLh0ejDoyaYtjXAijVumuBnG7p5Xjiu7T6u5y2/tux791ALPnnZRAIECAwtIMAamsw3ECDQSYF44uCFK653USjAUgM9qoG2Blirpu5Vpz2qU4FSuwOljOP39Guvd/Kzmp0iQKD3AgKs3pcAAAI9F4gnDr7wxpsuBl0MqoEe1kBbAywLuAs0MkIRfban7jY9tr3nn+7sPgECHRUQYHX0wNotAgQqBWIxZE8cbM+HchdQjtUoa6CNAdb0qVNude5h2DrKuvde3R9HV9/3QOWnIM0IECDQKgEBVqsOl40lQGCkAvEo+nhajw/z3f8w7xg7xueqgTYGWDFunWtf/JsaVwNqYK4G4rNNhN1eBAgQ6JiAAKtjB9TuECBQKRCLtl91590uBM1kUAM9roE2Blh79h9Qsz2u2bmAwp/CqoVq4LLb1pV4srIXAQIEOiYgwOrYAbU7BAhUCER4FetDLPThz9dcHKiB7tdAGwOsWJxZbXa/Nh1jx3gpNXDJzbeWQx9/UvGJSBMCBAi0SkCA1arDZWMJEFiywMzMTNn20ivWkDGDQQigBkobA6wtzzyndtWuGlADC9bAslWrS6zx6UWAAIGOCQiwOnZA7Q4BAgME4omD8cFuKb/Z9L1+M64GulEDbQuw4qmpGx/dZvwSXqgBNbBgDZx/9cry8t63Bnwi8mUCBAi0TkCA1bpDZoMJEFiUQMy8OvjR4XLRDTct+KFPMNGNYMJxdBxraqBtAVYsyrx28xZjmPBCDaiBgTXwxM5di/q85JsIECDQYAEBVoMPjk0jQGCEAp8dO1au3HDXwA98NRe92ghH1EA3aqBtAVas37dq6l7jmPBCDaiBgTUQtxt7ESBAoGMCAqyOHVC7Q4DAOQROfPtdWX3fAwM/7AkluhFKOI6OY20NtC3AOvr1CUG84MLPMjVQVQPxsBovAgQIdExAgNWxA2p3CBD4k8Avp0/PrhkT60HUXtRqJwBRA/2ogbYFWEeOf1UuX3e7sUyAoQbUwMAaWPPgQ3/6ROR/CRAg0HoBAVbrD6EdIEBgXoFY8PjZ3XvKecuvHfhBT2DRj8DCcXacf18DbQuwPj3yZbnk5luNZ8ILNaAGBtbAik1T834+8gUCBAi0VECA1dIDZ7MJEKgQ2PnPfZ446EP+wA/5vw80/L1fAVfbAqzDn39hTDOmGdPUQFUNXLH+jopPSpoQIECgVQICrFYdLhtLgEC1wIEPPiyX3bau6kOe0KJfoYXj7XjP1UDbAqz3//Pf4nZo9TtXv/5UCwvVwKW3rK3+zKQhAQIEWiIgwGrJgbKZBAgMIRBP6orfPC70wc7XfPBXA2qgbQHWwY8OG9fMvlEDaqCqBi664aYhPjlpSoAAgVYICLBacZhsJAEC1QLxxMFYuFQ4IZxQA2pgUA20LcDa9+4hY5vwQg2ogaoauHDF9dWfnTQkQIBASwQEWC05UDaTAIFKgRfeeLMs33hPuerOu/3HQA2ogQVrIB7y0KZX3BptbDO2qwE1UFsDbRrfbCsBAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgfntujQAAF8JJREFUQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBPQICVZ69nAgQIECBAgAABAgQIECBAgACBCgEBVgWSJgQIECBAgAABAgQIECBAgAABAnkCAqw8ez0TIECAAAECBAgQIECAAAECBAhUCAiwKpA0IUCAAAECBAgQIECAAAECBAgQyBMQYOXZ65kAAQIECBAgQIAAAQIECBAgQKBCQIBVgaQJAQIECBAgQIAAAQIECBAgQIBAnoAAK89ezwQIECBAgAABAgQIECBAgAABAhUCAqwKJE0IECBAgAABAgQIECBAgAABAgTyBARYefZ6JkCAAAECBAgQIECAAAECBAgQqBAQYFUgaUKAAAECBAgQIECAAAECBAgQIJAnIMDKs9czAQIECBAgQIAAAQIECBAgQIBAhYAAqwJJEwIECBAgQIAAAQIECBAgQIAAgTwBAVaevZ4JECBAgAABAgQIECBAgAABAgQqBARYFUiaECBAgAABAgQIECBAgAABAgQI5AkIsPLs9UyAAAECBAgQIECAAAECBAgQIFAhIMCqQNKEAAECBAgQIECAAAECBAgQIEAgT0CAlWevZwIECBAgQIAAAQIECBAgQIAAgQoBAVYFkiYECBAgQIAAAQIECBAgQIAAAQJ5AgKsPHs9EyBAgAABAgQIECBAgAABAgQIVAgIsCqQNCFAgAABAgQIECBAgAABAgQIEMgTEGDl2euZAAECBAgQIECAAAECBAgQIECgQkCAVYGkCQECBAgQIECAAAECBAgQIECAQJ6AACvPXs8ECBAgQIAAAQIECBAgQIAAAQIVAgKsCiRNCBAgQIAAAQIECBAgQIAAAQIE8gQEWHn2eiZAgAABAgQIECBAgAABAgQIEKgQEGBVIGlCgAABAgQIECBAgAABAgQIECCQJyDAyrPXMwECBAgQIECAAAECBAgQIECAQIWAAKsCSRMCBAgQIECAAAECBAgQIECAAIE8AQFWnr2eCRAgQIAAAQIECBAgQIAAAQIEKgQEWBVImhAgQIAAAQIECBAgQIAAAQIECOQJCLDy7PVMgAABAgQIECBAgAABAgQIECBQISDAqkDShAABAgQIECBAgAABAgQIECBAIE9AgJVnr2cCBAgQIECAAAECBAgQIECAAIEKAQFWBZImBAgQIECAAAECBAgQIECAAAECeQICrDx7PRMgQIAAAQIECBAgQIAAAQIECFQICLAqkDQhQIAAAQIECBAgQIAAAQIECBDIExBg5dnrmQABAgQIECBAgAABAgQIECBAoEJAgFWBpAkBAgQIECBAgAABAgQIECBAgECegAArz17PBAgQIECAAAECBAgQIECAAAECFQICrAokTQgQIECAAAECBAgQIECAAAECBPIEBFh59nomQIAAAQIECBAgQIAAAQIECBCoEBBgVSBpQoAAAQIECBAgQIAAAQIECBAgkCcgwMqz1zMBAgQIECBAgAABAgQIECBAgECFgACrAkkTAgQIECBAgAABAgQIECBAgACBPAEBVp69ngkQIECAAAECBAgQIECAAAECBCoEBFgVSJoQIECAAAECBAgQIECAAAECBAjkCQiw8uz1TIAAAQIECBAgQIAAAQIECBAgUCEgwKpA0oQAAQIECBAgQIAAAQIECBAgQCBP4A8BVvzPzzOlnM7bHj0TIECAAAECBAgQIECAAAECBAgQOCvwW1Y1m1v9T/zP7H8zM2db+BsBAgQIECBAgAABAgQIECBAgACBRIGZmZkyl1v9T+J26JoAAQIECBAgQIAAAQIECBAgQIDAQAEB1kAiDQgQIECAAAECBAgQIECAAAECBDIFzt5CaA2szOOgbwIECBAgQIAAAQIECBAgQIAAgd8JzN0+GH/GDKyvfvff7MJYsai7/xioATWgBtSAGlADakANqAE1oAbUgBpQA2pADSTWQGRWRyO3igAr/jL7P6WU7/zHQA2oATWgBtSAGlADakANqAE1oAbUgBpQA2oguQZ++F1mdfT3AVaEWAIsBmpADagBNaAG1IAaUANqQA2oATWgBtSAGlADTaiBuRlYR/8/TdRoYs9ARQAAAAAASUVORK5CYII=\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgZendex);\nexport default __webpack_public_path__ + \"static/media/zendex.6ae02c74d0e85a2d3221e0e332fbc2ca.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgTextW(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 40,\n height: 40,\n viewBox: \"0 0 40 40\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 0.500214,\n y: 0.5,\n width: 39,\n height: 39,\n rx: 1.5,\n fill: \"white\",\n stroke: \"#E5E5E5\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_1456_20564)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.6251 29H14.3751C13.3416 29 12.5001 28.1585 12.5001 27.125V12.875C12.5001 11.8415 13.3416 11 14.3751 11H25.6251C26.6586 11 27.5001 11.8415 27.5001 12.875V27.125C27.5001 28.1585 26.6586 29 25.6251 29ZM14.3751 11.75C13.7548 11.75 13.2501 12.2547 13.2501 12.875V27.125C13.2501 27.7452 13.7548 28.25 14.3751 28.25H25.6251C26.2453 28.25 26.7501 27.7452 26.7501 27.125V12.875C26.7501 12.2547 26.2453 11.75 25.6251 11.75H14.3751Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.6251 18.5C19.4181 18.5 19.2501 18.332 19.2501 18.125V17.75H15.5001V18.125C15.5001 18.332 15.3321 18.5 15.1251 18.5C14.9181 18.5 14.7501 18.332 14.7501 18.125V17.375C14.7501 17.168 14.9181 17 15.1251 17H19.6251C19.8321 17 20.0001 17.168 20.0001 17.375V18.125C20.0001 18.332 19.8321 18.5 19.6251 18.5Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.3751 22.25C17.1681 22.25 17.0001 22.082 17.0001 21.875V17.375C17.0001 17.168 17.1681 17 17.3751 17C17.5821 17 17.7501 17.168 17.7501 17.375V21.875C17.7501 22.082 17.5821 22.25 17.3751 22.25Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.1251 22.25H16.6251C16.4181 22.25 16.2501 22.082 16.2501 21.875C16.2501 21.668 16.4181 21.5 16.6251 21.5H18.1251C18.3321 21.5 18.5001 21.668 18.5001 21.875C18.5001 22.082 18.3321 22.25 18.1251 22.25Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.8751 17.75H21.8751C21.6681 17.75 21.5001 17.582 21.5001 17.375C21.5001 17.168 21.6681 17 21.8751 17H24.8751C25.0821 17 25.2501 17.168 25.2501 17.375C25.2501 17.582 25.0821 17.75 24.8751 17.75Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.8751 20H21.8751C21.6681 20 21.5001 19.832 21.5001 19.625C21.5001 19.418 21.6681 19.25 21.8751 19.25H24.8751C25.0821 19.25 25.2501 19.418 25.2501 19.625C25.2501 19.832 25.0821 20 24.8751 20Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.8751 22.25H21.8751C21.6681 22.25 21.5001 22.082 21.5001 21.875C21.5001 21.668 21.6681 21.5 21.8751 21.5H24.8751C25.0821 21.5 25.2501 21.668 25.2501 21.875C25.2501 22.082 25.0821 22.25 24.8751 22.25Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.8751 24.5H15.1251C14.9181 24.5 14.7501 24.332 14.7501 24.125C14.7501 23.918 14.9181 23.75 15.1251 23.75H24.8751C25.0821 23.75 25.2501 23.918 25.2501 24.125C25.2501 24.332 25.0821 24.5 24.8751 24.5Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.8751 26.75H15.1251C14.9181 26.75 14.7501 26.582 14.7501 26.375C14.7501 26.168 14.9181 26 15.1251 26H24.8751C25.0821 26 25.2501 26.168 25.2501 26.375C25.2501 26.582 25.0821 26.75 24.8751 26.75Z\",\n fill: \"black\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_1456_20564\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 18,\n height: 18,\n fill: \"white\",\n transform: \"translate(11.0001 11)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgTextW);\nexport default __webpack_public_path__ + \"static/media/textW.f48436d9f739d13bfc35b13f1a2a0bd0.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgImageW(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_525_16466)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.2495 24.5313C10.6486 24.5313 9.22456 23.5062 8.70746 21.9802L8.67248 21.8652C8.55053 21.4611 8.49944 21.1212 8.49944 20.7812V13.9629L6.07342 22.0611C5.7614 23.2522 6.47241 24.4871 7.66538 24.8162L23.1288 28.9574C23.3218 29.0074 23.5148 29.0314 23.7049 29.0314C24.7008 29.0314 25.6109 28.3704 25.866 27.3962L26.7669 24.5313H12.2495Z\",\n fill: \"#ECEFF1\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.0001 9.2813V20.7817C30.0001 22.0217 28.99 23.0318 27.75 23.0318H12.2496C12.1496 23.0318 12.0496 23.0217 11.9595 23.0116C10.9096 22.8818 10.0896 22.0217 10.0096 20.9617C9.99951 20.9016 9.99951 20.8416 9.99951 20.7817V9.2813C9.99951 8.04128 11.0095 7.03125 12.2496 7.03125H27.75C28.99 7.03125 30.0001 8.04128 30.0001 9.2813Z\",\n fill: \"#ECEFF1\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.9996 12.0314C16.9996 13.1359 16.1042 14.0315 14.9997 14.0315C13.895 14.0315 12.9996 13.1359 12.9996 12.0314C12.9996 10.9268 13.895 10.0312 14.9997 10.0312C16.1042 10.0312 16.9996 10.9268 16.9996 12.0314Z\",\n fill: \"#FFC107\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30 17.9712V20.7814C30 22.0214 28.99 23.0315 27.75 23.0315H12.2495C12.1495 23.0315 12.0496 23.0214 11.9595 23.0113L22.2598 12.7112C22.9398 12.0312 24.0597 12.0312 24.7398 12.7112L30 17.9712Z\",\n fill: \"#388E3C\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.0598 23.0314H12.2496C12.1496 23.0314 12.0496 23.0213 11.9595 23.0112C10.9096 22.8814 10.0896 22.0213 10.0096 20.9613L14.7596 16.2111C15.4397 15.5312 16.5596 15.5312 17.2397 16.2111L24.0598 23.0314Z\",\n fill: \"#4CAF50\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_525_16466\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n fill: \"white\",\n transform: \"translate(6 6)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgImageW);\nexport default __webpack_public_path__ + \"static/media/imageW.4bd0e297f0d41bf9634d5f42a631e95a.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgQuestionW(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.4062 14.625H9.28125C7.72795 14.625 6.46875 15.8842 6.46875 17.4375V24.6562C6.46875 26.2095 7.72795 27.4688 9.28125 27.4688H12.3271L12.2849 27.4724L14.3438 29.5312L14.3452 27.4688H19.4062C20.9595 27.4688 22.2188 26.2095 22.2188 24.6562V17.4375C22.2188 15.8842 20.9595 14.625 19.4062 14.625Z\",\n fill: \"#C7EAFF\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.3438 30C14.2218 30 14.102 29.9524 14.0123 29.8627L12.0871 27.9375H9.28125C7.47197 27.9375 6 26.4655 6 24.6562V17.4375C6 15.6282 7.47197 14.1562 9.28125 14.1562H14.0156C14.2745 14.1562 14.4844 14.3661 14.4844 14.625C14.4844 14.8839 14.2745 15.0938 14.0156 15.0938H9.28125C7.98891 15.0938 6.9375 16.1452 6.9375 17.4375V24.6562C6.9375 25.9486 7.98891 27 9.28125 27H12.3271C12.5189 27 12.6846 27.1154 12.757 27.2816L13.8758 28.4004L13.8765 27.4684C13.8767 27.2097 14.0865 27 14.3453 27H19.4062C20.6986 27 21.75 25.9486 21.75 24.6562V21.4219C21.75 21.163 21.9599 20.9531 22.2188 20.9531C22.4776 20.9531 22.6875 21.163 22.6875 21.4219V24.6562C22.6875 26.4655 21.2155 27.9375 19.4062 27.9375H14.8136L14.8125 29.5316C14.8124 29.7211 14.6981 29.8919 14.523 29.9644C14.4651 29.9883 14.4042 30 14.3438 30Z\",\n fill: \"black\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.187 6.46875H22.0006C18.4967 6.46875 15.6562 9.30919 15.6562 12.8131C15.6562 16.317 18.4967 19.1574 22.0006 19.1574H23.187C23.8364 19.1574 24.4629 19.0597 25.0528 18.8784L27 20.8245V17.8838C28.5372 16.7261 29.5312 14.8857 29.5312 12.813C29.5312 9.30919 26.6908 6.46875 23.187 6.46875Z\",\n fill: \"#FFBC53\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.0001 21.2932C26.8781 21.2932 26.7583 21.2456 26.6686 21.156L24.9161 19.4045C24.3536 19.5517 23.7733 19.6261 23.1869 19.6261H22.0005C18.2438 19.6261 15.1875 16.5698 15.1875 12.8131C15.1875 9.05634 18.2438 6 22.0006 6H23.187C26.9437 6 30 9.05634 30 12.8131C30 13.9013 29.751 14.9415 29.2597 15.9045C28.8271 16.7525 28.2107 17.5116 27.4688 18.1125V20.8245C27.4688 21.014 27.3546 21.1849 27.1794 21.2575C27.1215 21.2815 27.0605 21.2932 27.0001 21.2932ZM25.0528 18.4096C25.1752 18.4096 25.2949 18.4576 25.3842 18.5468L26.5312 19.6933V17.8839C26.5312 17.7367 26.6004 17.598 26.718 17.5095C28.208 16.3873 29.0625 14.6755 29.0625 12.8131C29.0625 9.57328 26.4268 6.9375 23.187 6.9375H22.0006C18.7608 6.9375 16.125 9.57328 16.125 12.8131C16.125 16.0529 18.7607 18.6887 22.0006 18.6887H23.187C23.7758 18.6887 24.3572 18.6018 24.9151 18.4303C24.9604 18.4164 25.0068 18.4096 25.0528 18.4096Z\",\n fill: \"black\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.725 14.756C22.4662 14.756 22.2563 14.5461 22.2563 14.2872V13.1611C22.2563 12.7412 22.5436 12.3836 22.9551 12.2916C23.4629 12.1779 23.8054 11.7166 23.7694 11.1946C23.7338 10.6777 23.3171 10.261 22.8002 10.2254C22.5054 10.205 22.2251 10.3041 22.0107 10.5042C21.7961 10.7045 21.6779 10.9764 21.6779 11.2698C21.6779 11.5287 21.468 11.7385 21.2092 11.7385C20.9503 11.7385 20.7404 11.5287 20.7404 11.2698C20.7404 10.7218 20.9702 10.1929 21.371 9.81882C21.7774 9.43946 22.3083 9.25182 22.8646 9.29002C23.846 9.35766 24.637 10.1487 24.7047 11.1301C24.7719 12.106 24.1382 12.9703 23.1937 13.1985V14.2872C23.1938 14.5461 22.9839 14.756 22.725 14.756Z\",\n fill: \"black\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.725 16.6094C22.6017 16.6094 22.4808 16.5597 22.3936 16.4725C22.3064 16.3853 22.2562 16.2644 22.2562 16.1406C22.2562 16.0173 22.3064 15.8964 22.3936 15.8092C22.4808 15.722 22.6017 15.6719 22.725 15.6719C22.8483 15.6719 22.9692 15.722 23.0564 15.8092C23.1435 15.8964 23.1937 16.0173 23.1937 16.1406C23.1937 16.2644 23.1436 16.3848 23.0564 16.4725C22.9692 16.5597 22.8483 16.6094 22.725 16.6094Z\",\n fill: \"black\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.8906 21.4688H9C8.74116 21.4688 8.53125 21.2589 8.53125 21C8.53125 20.7411 8.74116 20.5312 9 20.5312H18.8906C19.1495 20.5312 19.3594 20.7411 19.3594 21C19.3594 21.2589 19.1495 21.4688 18.8906 21.4688Z\",\n fill: \"black\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.8906 24.0938C18.7673 24.0938 18.6464 24.0436 18.5592 23.9564C18.472 23.8692 18.4219 23.7483 18.4219 23.625C18.4219 23.5017 18.472 23.3808 18.5592 23.2936C18.6464 23.2064 18.7673 23.1562 18.8906 23.1562C19.0139 23.1562 19.1348 23.2064 19.222 23.2936C19.3092 23.3808 19.3594 23.5017 19.3594 23.625C19.3594 23.7488 19.3092 23.8692 19.222 23.9564C19.1348 24.0436 19.0139 24.0938 18.8906 24.0938Z\",\n fill: \"black\"\n })), _path9 || (_path9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.0469 24.0938H9C8.74116 24.0938 8.53125 23.8839 8.53125 23.625C8.53125 23.3661 8.74116 23.1562 9 23.1562H17.0469C17.3057 23.1562 17.5156 23.3661 17.5156 23.625C17.5156 23.8839 17.3058 24.0938 17.0469 24.0938Z\",\n fill: \"black\"\n })), _path10 || (_path10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.8438 18.8438H9C8.74116 18.8438 8.53125 18.6339 8.53125 18.375C8.53125 18.1161 8.74116 17.9062 9 17.9062H15.8438C16.1026 17.9062 16.3125 18.1161 16.3125 18.375C16.3125 18.6339 16.1026 18.8438 15.8438 18.8438Z\",\n fill: \"black\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgQuestionW);\nexport default __webpack_public_path__ + \"static/media/questionW.b4d591ab2565d915b5058cf6ac913863.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgButtonW(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 40,\n height: 40,\n viewBox: \"0 0 40 40\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 0.500214,\n y: 0.5,\n width: 39,\n height: 39,\n rx: 1.5,\n fill: \"white\",\n stroke: \"#E5E5E5\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_1456_20780)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31.3932 19.0865C31.3443 18.8181 31.2645 18.5574 31.1613 18.3146C31.0399 18.0336 30.8859 17.7784 30.7065 17.5682C30.6178 17.5102 30.529 17.4559 30.4384 17.4088C30.4203 17.3995 30.404 17.3961 30.3877 17.3923C30.2953 17.3325 30.1847 17.3017 30.076 17.2492C30.0688 17.2474 30.0652 17.2474 30.0597 17.2455C30.0126 17.2184 29.9637 17.1948 29.9112 17.1785C29.7101 17.1242 29.5108 17.1205 29.3042 17.1205C29.2825 17.1205 29.2662 17.126 29.2481 17.1316C29.1539 17.1205 29.0578 17.1133 28.96 17.1133H10.5364C9.60152 17.1133 8.79348 17.6622 8.41301 18.454C8.36953 18.463 8.32967 18.4866 8.29887 18.5337C8.03617 18.9341 7.95645 19.4088 8.02167 19.8708C8.0108 19.8943 8.00356 19.9213 8.00356 19.9541C8.00899 20.1858 8.03798 20.4016 8.08508 20.6118C8.1485 20.646 8.20466 20.6969 8.24633 20.7694C8.46374 21.1426 8.76811 21.4053 9.11959 21.5899C9.34425 21.7095 9.58883 21.7966 9.84248 21.8617C10.1849 22.4722 10.8371 22.8853 11.5836 22.8853H20.4231C20.4847 22.8455 20.5644 22.8382 20.626 22.8853H30.0072C31.1069 22.8853 32.0001 21.9905 32.0001 20.8924V20.5174C32.0001 19.9561 31.7664 19.4488 31.3932 19.0865ZM30.9529 19.8438C30.9529 20.9419 30.0579 21.8367 28.96 21.8367H19.577C19.5154 21.7896 19.4357 21.7968 19.3741 21.8367H10.5364C10.2592 21.8367 9.99285 21.7787 9.75189 21.6754C9.48738 21.5631 9.25366 21.3946 9.06343 21.1845L9.06162 21.1825C8.73912 20.8293 8.54346 20.3581 8.54346 19.8436V19.4685C8.54346 18.369 9.43665 17.4756 10.5364 17.4756H28.96C29.5633 17.4756 30.105 17.7456 30.4692 18.1695C30.6015 18.3237 30.7102 18.4958 30.7917 18.6842C30.895 18.925 30.9529 19.1895 30.9529 19.4685V19.8438Z\",\n fill: \"black\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.7528 19.544C14.8728 19.582 14.9668 19.646 15.0348 19.736C15.1028 19.824 15.1368 19.933 15.1368 20.063C15.1368 20.247 15.0648 20.389 14.9208 20.489C14.7788 20.587 14.5708 20.636 14.2968 20.636H13.2108V18.536H14.2368C14.4928 18.536 14.6888 18.585 14.8248 18.683C14.9628 18.781 15.0318 18.914 15.0318 19.082C15.0318 19.184 15.0068 19.275 14.9568 19.355C14.9088 19.435 14.8408 19.498 14.7528 19.544ZM13.6938 18.902V19.397H14.1768C14.2968 19.397 14.3878 19.376 14.4498 19.334C14.5118 19.292 14.5428 19.23 14.5428 19.148C14.5428 19.066 14.5118 19.005 14.4498 18.965C14.3878 18.923 14.2968 18.902 14.1768 18.902H13.6938ZM14.2608 20.27C14.3888 20.27 14.4848 20.249 14.5488 20.207C14.6148 20.165 14.6478 20.1 14.6478 20.012C14.6478 19.838 14.5188 19.751 14.2608 19.751H13.6938V20.27H14.2608Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.4377 20.672C16.1377 20.672 15.9037 20.589 15.7357 20.423C15.5697 20.257 15.4867 20.02 15.4867 19.712V18.536H15.9727V19.694C15.9727 20.07 16.1287 20.258 16.4407 20.258C16.5927 20.258 16.7087 20.213 16.7887 20.123C16.8687 20.031 16.9087 19.888 16.9087 19.694V18.536H17.3887V19.712C17.3887 20.02 17.3047 20.257 17.1367 20.423C16.9707 20.589 16.7377 20.672 16.4377 20.672Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.2688 18.932H17.5968V18.536H19.4268V18.932H18.7548V20.636H18.2688V18.932Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.1526 18.932H19.4806V18.536H21.3106V18.932H20.6386V20.636H20.1526V18.932Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M22.5598 20.672C22.3418 20.672 22.1448 20.625 21.9688 20.531C21.7948 20.437 21.6578 20.308 21.5578 20.144C21.4598 19.978 21.4108 19.792 21.4108 19.586C21.4108 19.38 21.4598 19.195 21.5578 19.031C21.6578 18.865 21.7948 18.735 21.9688 18.641C22.1448 18.547 22.3418 18.5 22.5598 18.5C22.7778 18.5 22.9738 18.547 23.1478 18.641C23.3218 18.735 23.4588 18.865 23.5588 19.031C23.6588 19.195 23.7088 19.38 23.7088 19.586C23.7088 19.792 23.6588 19.978 23.5588 20.144C23.4588 20.308 23.3218 20.437 23.1478 20.531C22.9738 20.625 22.7778 20.672 22.5598 20.672ZM22.5598 20.258C22.6838 20.258 22.7958 20.23 22.8958 20.174C22.9958 20.116 23.0738 20.036 23.1298 19.934C23.1878 19.832 23.2168 19.716 23.2168 19.586C23.2168 19.456 23.1878 19.34 23.1298 19.238C23.0738 19.136 22.9958 19.057 22.8958 19.001C22.7958 18.943 22.6838 18.914 22.5598 18.914C22.4358 18.914 22.3238 18.943 22.2238 19.001C22.1238 19.057 22.0448 19.136 21.9868 19.238C21.9308 19.34 21.9028 19.456 21.9028 19.586C21.9028 19.716 21.9308 19.832 21.9868 19.934C22.0448 20.036 22.1238 20.116 22.2238 20.174C22.3238 20.23 22.4358 20.258 22.5598 20.258Z\",\n fill: \"#4CB580\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.0001 18.536V20.636H25.6011L24.5541 19.361V20.636H24.0741V18.536H24.4761L25.5201 19.811V18.536H26.0001Z\",\n fill: \"#4CB580\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_1456_20780\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n fill: \"white\",\n transform: \"translate(8.00011 8)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgButtonW);\nexport default __webpack_public_path__ + \"static/media/buttonW.68151ee24e7d91735eabc1013497ed23.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgStIcon(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 13C9.55228 13 10 12.5523 10 12C10 11.4477 9.55228 11 9 11C8.44772 11 8 11.4477 8 12C8 12.5523 8.44772 13 9 13Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 13C15.5523 13 16 12.5523 16 12C16 11.4477 15.5523 11 15 11C14.4477 11 14 11.4477 14 12C14 12.5523 14.4477 13 15 13Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 6C9.55228 6 10 5.55228 10 5C10 4.44772 9.55228 4 9 4C8.44772 4 8 4.44772 8 5C8 5.55228 8.44772 6 9 6Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 6C15.5523 6 16 5.55228 16 5C16 4.44772 15.5523 4 15 4C14.4477 4 14 4.44772 14 5C14 5.55228 14.4477 6 15 6Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 20C9.55228 20 10 19.5523 10 19C10 18.4477 9.55228 18 9 18C8.44772 18 8 18.4477 8 19C8 19.5523 8.44772 20 9 20Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z\",\n stroke: \"#F1DD96\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgStIcon);\nexport default __webpack_public_path__ + \"static/media/stIcon.728ed039d95e99f455460d1e092b7eba.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgUploadImage(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 323,\n height: 97,\n viewBox: \"0 0 323 97\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 0.5,\n y: 0.5,\n width: 322,\n height: 96,\n rx: 3.5,\n stroke: \"#E5E5E5\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M115.516 54.168C114.116 54.168 113.024 53.7807 112.24 53.006C111.465 52.2313 111.078 51.1253 111.078 49.688V44.2H113.346V49.604C113.346 51.3587 114.074 52.236 115.53 52.236C116.239 52.236 116.781 52.026 117.154 51.606C117.527 51.1767 117.714 50.5093 117.714 49.604V44.2H119.954V49.688C119.954 51.1253 119.562 52.2313 118.778 53.006C118.003 53.7807 116.916 54.168 115.516 54.168ZM126.493 46.356C127.193 46.356 127.828 46.5193 128.397 46.846C128.976 47.1633 129.429 47.616 129.755 48.204C130.082 48.7827 130.245 49.4593 130.245 50.234C130.245 51.0087 130.082 51.69 129.755 52.278C129.429 52.8567 128.976 53.3093 128.397 53.636C127.828 53.9533 127.193 54.112 126.493 54.112C125.532 54.112 124.776 53.8087 124.225 53.202V56.716H122.041V46.468H124.127V47.336C124.669 46.6827 125.457 46.356 126.493 46.356ZM126.115 52.32C126.675 52.32 127.133 52.1333 127.487 51.76C127.851 51.3773 128.033 50.8687 128.033 50.234C128.033 49.5993 127.851 49.0953 127.487 48.722C127.133 48.3393 126.675 48.148 126.115 48.148C125.555 48.148 125.093 48.3393 124.729 48.722C124.375 49.0953 124.197 49.5993 124.197 50.234C124.197 50.8687 124.375 51.3773 124.729 51.76C125.093 52.1333 125.555 52.32 126.115 52.32ZM131.707 43.612H133.891V54H131.707V43.612ZM139.502 54.112C138.709 54.112 137.995 53.9487 137.36 53.622C136.735 53.286 136.245 52.824 135.89 52.236C135.535 51.648 135.358 50.9807 135.358 50.234C135.358 49.4873 135.535 48.82 135.89 48.232C136.245 47.644 136.735 47.1867 137.36 46.86C137.995 46.524 138.709 46.356 139.502 46.356C140.295 46.356 141.005 46.524 141.63 46.86C142.255 47.1867 142.745 47.644 143.1 48.232C143.455 48.82 143.632 49.4873 143.632 50.234C143.632 50.9807 143.455 51.648 143.1 52.236C142.745 52.824 142.255 53.286 141.63 53.622C141.005 53.9487 140.295 54.112 139.502 54.112ZM139.502 52.32C140.062 52.32 140.519 52.1333 140.874 51.76C141.238 51.3773 141.42 50.8687 141.42 50.234C141.42 49.5993 141.238 49.0953 140.874 48.722C140.519 48.3393 140.062 48.148 139.502 48.148C138.942 48.148 138.48 48.3393 138.116 48.722C137.752 49.0953 137.57 49.5993 137.57 50.234C137.57 50.8687 137.752 51.3773 138.116 51.76C138.48 52.1333 138.942 52.32 139.502 52.32ZM148.007 46.356C149.174 46.356 150.07 46.636 150.695 47.196C151.32 47.7467 151.633 48.582 151.633 49.702V54H149.589V53.062C149.178 53.762 148.413 54.112 147.293 54.112C146.714 54.112 146.21 54.014 145.781 53.818C145.361 53.622 145.039 53.3513 144.815 53.006C144.591 52.6607 144.479 52.2687 144.479 51.83C144.479 51.13 144.74 50.5793 145.263 50.178C145.795 49.7767 146.612 49.576 147.713 49.576H149.449C149.449 49.1 149.304 48.736 149.015 48.484C148.726 48.2227 148.292 48.092 147.713 48.092C147.312 48.092 146.915 48.1573 146.523 48.288C146.14 48.4093 145.814 48.5773 145.543 48.792L144.759 47.266C145.17 46.9767 145.66 46.7527 146.229 46.594C146.808 46.4353 147.4 46.356 148.007 46.356ZM147.839 52.642C148.212 52.642 148.544 52.558 148.833 52.39C149.122 52.2127 149.328 51.956 149.449 51.62V50.85H147.951C147.055 50.85 146.607 51.144 146.607 51.732C146.607 52.012 146.714 52.236 146.929 52.404C147.153 52.5627 147.456 52.642 147.839 52.642ZM161.364 43.612V54H159.278V53.132C158.736 53.7853 157.952 54.112 156.926 54.112C156.216 54.112 155.572 53.9533 154.994 53.636C154.424 53.3187 153.976 52.866 153.65 52.278C153.323 51.69 153.16 51.0087 153.16 50.234C153.16 49.4593 153.323 48.778 153.65 48.19C153.976 47.602 154.424 47.1493 154.994 46.832C155.572 46.5147 156.216 46.356 156.926 46.356C157.887 46.356 158.638 46.6593 159.18 47.266V43.612H161.364ZM157.304 52.32C157.854 52.32 158.312 52.1333 158.676 51.76C159.04 51.3773 159.222 50.8687 159.222 50.234C159.222 49.5993 159.04 49.0953 158.676 48.722C158.312 48.3393 157.854 48.148 157.304 48.148C156.744 48.148 156.282 48.3393 155.918 48.722C155.554 49.0953 155.372 49.5993 155.372 50.234C155.372 50.8687 155.554 51.3773 155.918 51.76C156.282 52.1333 156.744 52.32 157.304 52.32ZM167.504 44.2H169.772V54H167.504V44.2ZM181.59 46.356C182.532 46.356 183.279 46.636 183.83 47.196C184.39 47.7467 184.67 48.5773 184.67 49.688V54H182.486V50.024C182.486 49.4267 182.36 48.9833 182.108 48.694C181.865 48.3953 181.515 48.246 181.058 48.246C180.544 48.246 180.138 48.414 179.84 48.75C179.541 49.0767 179.392 49.5667 179.392 50.22V54H177.208V50.024C177.208 48.8387 176.732 48.246 175.78 48.246C175.276 48.246 174.874 48.414 174.576 48.75C174.277 49.0767 174.128 49.5667 174.128 50.22V54H171.944V46.468H174.03V47.336C174.31 47.0187 174.65 46.776 175.052 46.608C175.462 46.44 175.91 46.356 176.396 46.356C176.928 46.356 177.408 46.4633 177.838 46.678C178.267 46.8833 178.612 47.1867 178.874 47.588C179.182 47.196 179.569 46.8927 180.036 46.678C180.512 46.4633 181.03 46.356 181.59 46.356ZM189.665 46.356C190.832 46.356 191.728 46.636 192.353 47.196C192.978 47.7467 193.291 48.582 193.291 49.702V54H191.247V53.062C190.836 53.762 190.071 54.112 188.951 54.112C188.372 54.112 187.868 54.014 187.439 53.818C187.019 53.622 186.697 53.3513 186.473 53.006C186.249 52.6607 186.137 52.2687 186.137 51.83C186.137 51.13 186.398 50.5793 186.921 50.178C187.453 49.7767 188.27 49.576 189.371 49.576H191.107C191.107 49.1 190.962 48.736 190.673 48.484C190.384 48.2227 189.95 48.092 189.371 48.092C188.97 48.092 188.573 48.1573 188.181 48.288C187.798 48.4093 187.472 48.5773 187.201 48.792L186.417 47.266C186.828 46.9767 187.318 46.7527 187.887 46.594C188.466 46.4353 189.058 46.356 189.665 46.356ZM189.497 52.642C189.87 52.642 190.202 52.558 190.491 52.39C190.78 52.2127 190.986 51.956 191.107 51.62V50.85H189.609C188.713 50.85 188.265 51.144 188.265 51.732C188.265 52.012 188.372 52.236 188.587 52.404C188.811 52.5627 189.114 52.642 189.497 52.642ZM203.12 46.468V52.74C203.12 54.1213 202.76 55.148 202.042 55.82C201.323 56.492 200.273 56.828 198.892 56.828C198.164 56.828 197.473 56.7393 196.82 56.562C196.166 56.3847 195.625 56.128 195.196 55.792L196.064 54.224C196.381 54.4853 196.782 54.6907 197.268 54.84C197.753 54.9987 198.238 55.078 198.724 55.078C199.48 55.078 200.035 54.9053 200.39 54.56C200.754 54.224 200.936 53.7107 200.936 53.02V52.698C200.366 53.3233 199.573 53.636 198.556 53.636C197.865 53.636 197.23 53.4867 196.652 53.188C196.082 52.88 195.63 52.4507 195.294 51.9C194.958 51.3493 194.79 50.7147 194.79 49.996C194.79 49.2773 194.958 48.6427 195.294 48.092C195.63 47.5413 196.082 47.1167 196.652 46.818C197.23 46.51 197.865 46.356 198.556 46.356C199.648 46.356 200.478 46.7153 201.048 47.434V46.468H203.12ZM198.99 51.844C199.568 51.844 200.04 51.676 200.404 51.34C200.777 50.9947 200.964 50.5467 200.964 49.996C200.964 49.4453 200.777 49.002 200.404 48.666C200.04 48.3207 199.568 48.148 198.99 48.148C198.411 48.148 197.935 48.3207 197.562 48.666C197.188 49.002 197.002 49.4453 197.002 49.996C197.002 50.5467 197.188 50.9947 197.562 51.34C197.935 51.676 198.411 51.844 198.99 51.844ZM212.531 50.262C212.531 50.29 212.517 50.486 212.489 50.85H206.791C206.893 51.3167 207.136 51.6853 207.519 51.956C207.901 52.2267 208.377 52.362 208.947 52.362C209.339 52.362 209.684 52.306 209.983 52.194C210.291 52.0727 210.575 51.886 210.837 51.634L211.999 52.894C211.289 53.706 210.253 54.112 208.891 54.112C208.041 54.112 207.29 53.9487 206.637 53.622C205.983 53.286 205.479 52.824 205.125 52.236C204.77 51.648 204.593 50.9807 204.593 50.234C204.593 49.4967 204.765 48.834 205.111 48.246C205.465 47.6487 205.946 47.1867 206.553 46.86C207.169 46.524 207.855 46.356 208.611 46.356C209.348 46.356 210.015 46.5147 210.613 46.832C211.21 47.1493 211.677 47.6067 212.013 48.204C212.358 48.792 212.531 49.478 212.531 50.262ZM208.625 48.008C208.13 48.008 207.715 48.148 207.379 48.428C207.043 48.708 206.837 49.0907 206.763 49.576H210.473C210.398 49.1 210.193 48.722 209.857 48.442C209.521 48.1527 209.11 48.008 208.625 48.008Z\",\n fill: \"#4982D2\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgUploadImage);\nexport default __webpack_public_path__ + \"static/media/uploadImage.fa53b8c1970352b42a6cfb96a26b4dd2.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgEditBtn(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 36,\n height: 36,\n viewBox: \"0 0 36 36\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.75 11.2502C21.947 11.0532 22.1808 10.897 22.4382 10.7904C22.6956 10.6838 22.9714 10.6289 23.25 10.6289C23.5286 10.6289 23.8044 10.6838 24.0618 10.7904C24.3192 10.897 24.553 11.0532 24.75 11.2502C24.947 11.4472 25.1032 11.6811 25.2098 11.9384C25.3165 12.1958 25.3713 12.4717 25.3713 12.7502C25.3713 13.0288 25.3165 13.3047 25.2098 13.562C25.1032 13.8194 24.947 14.0532 24.75 14.2502L14.625 24.3752L10.5 25.5002L11.625 21.3752L21.75 11.2502Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgEditBtn);\nexport default __webpack_public_path__ + \"static/media/editBtn.631b2559cccaa2b5ece7ab8e140c9c6c.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgDelbtn(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 40,\n height: 40,\n viewBox: \"0 0 40 40\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.25 15.5H14.75H26.75\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 15.5V14C17 13.6022 17.158 13.2206 17.4393 12.9393C17.7206 12.658 18.1022 12.5 18.5 12.5H21.5C21.8978 12.5 22.2794 12.658 22.5607 12.9393C22.842 13.2206 23 13.6022 23 14V15.5M25.25 15.5V26C25.25 26.3978 25.092 26.7794 24.8107 27.0607C24.5294 27.342 24.1478 27.5 23.75 27.5H16.25C15.8522 27.5 15.4706 27.342 15.1893 27.0607C14.908 26.7794 14.75 26.3978 14.75 26V15.5H25.25Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgDelbtn);\nexport default __webpack_public_path__ + \"static/media/delbtn.28c3c1fb3fcf586dbefbf8c0be9e2213.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgWbDelete(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 14,\n height: 14,\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.03604 14H9.28092C10.3798 13.9985 11.2886 13.1436 11.357 12.0468L11.9512 2.59513C11.9606 2.45347 11.9109 2.31424 11.8138 2.21067C11.7167 2.10709 11.5809 2.04847 11.439 2.04878H1.87799C1.73476 2.05215 1.5991 2.11381 1.50238 2.21952C1.40854 2.32147 1.35936 2.45671 1.3658 2.59513L1.98726 12.0468C2.05495 13.1332 2.94768 13.9843 4.03604 14ZM2.9775 11.9854L2.45165 3.07318L10.8926 3.10732L10.3395 11.9854C10.3001 12.5416 9.83854 12.9734 9.28092 12.9756H4.03604C3.47709 12.9768 3.01356 12.5432 2.9775 11.9854Z\",\n fill: \"#767676\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.8049 3.07317H0.512195C0.229318 3.07317 0 2.84386 0 2.56098C0 2.2781 0.229318 2.04878 0.512195 2.04878H12.8049C13.0878 2.04878 13.3171 2.2781 13.3171 2.56098C13.3171 2.84386 13.0878 3.07317 12.8049 3.07317Z\",\n fill: \"#767676\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.60973 3.07317H8.70729C8.98863 3.06949 9.21581 2.84232 9.21949 2.56098V1.36585C9.21972 0.62465 8.62875 0.0185301 7.88778 0H5.42924C4.70134 0.0179811 4.11552 0.603804 4.09753 1.33171V2.56098C4.10121 2.84232 4.32839 3.06949 4.60973 3.07317ZM8.1951 2.04878H5.12192V1.36585C5.12192 1.19613 5.25951 1.05854 5.42924 1.05854H7.88778C8.0575 1.05854 8.1951 1.19613 8.1951 1.36585V2.04878Z\",\n fill: \"#767676\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.70726 11.2683C8.42592 11.2646 8.19875 11.0374 8.19507 10.7561V5.29268C8.19507 5.0098 8.42439 4.78049 8.70726 4.78049C8.99014 4.78049 9.21946 5.0098 9.21946 5.29268V10.7561C9.21578 11.0374 8.9886 11.2646 8.70726 11.2683Z\",\n fill: \"#767676\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.60973 11.2683C4.32839 11.2646 4.10121 11.0374 4.09753 10.7561V5.29268C4.09753 5.0098 4.32685 4.78049 4.60973 4.78049C4.89261 4.78049 5.12192 5.0098 5.12192 5.29268V10.7561C5.11825 11.0374 4.89107 11.2646 4.60973 11.2683Z\",\n fill: \"#767676\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.65856 11.2683C6.37722 11.2646 6.15004 11.0374 6.14636 10.7561V5.29268C6.14636 5.0098 6.37568 4.78049 6.65856 4.78049C6.94143 4.78049 7.17075 5.0098 7.17075 5.29268V10.7561C7.16707 11.0374 6.9399 11.2646 6.65856 11.2683Z\",\n fill: \"#767676\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgWbDelete);\nexport default __webpack_public_path__ + \"static/media/wbDelete.f8ab6cbfc63d3b21e8d255f2ee0fb8c7.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgPlusIcon(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 5V19\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5 12H19\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgPlusIcon);\nexport default __webpack_public_path__ + \"static/media/PlusIcon.bb2625a88183963c5ff24e34e15f125b.svg\";\nexport { ForwardRef as ReactComponent };","var _rect, _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgFile(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 40,\n height: 40,\n viewBox: \"0 0 40 40\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 0.500214,\n y: 0.5,\n width: 39,\n height: 39,\n rx: 1.5,\n fill: \"white\",\n stroke: \"#E5E5E5\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_1456_20597)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.2497 26.5293C12.6487 26.5293 11.2247 25.5043 10.7076 23.9782L10.6726 23.8632C10.5507 23.4591 10.4996 23.1193 10.4996 22.7792V15.9609L8.07354 24.0592C7.76152 25.2503 8.47254 26.4852 9.6655 26.8142L25.129 30.9554C25.322 31.0054 25.5149 31.0294 25.705 31.0294C26.701 31.0294 27.611 30.3684 27.8661 29.3943L28.767 26.5293H14.2497Z\",\n fill: \"#ECEFF1\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.0001 11.2813V22.7817C32.0001 24.0217 30.9901 25.0318 29.7501 25.0318H14.2496C14.1497 25.0318 14.0497 25.0217 13.9596 25.0116C12.9096 24.8818 12.0897 24.0217 12.0097 22.9617C11.9996 22.9016 11.9996 22.8416 11.9996 22.7817V11.2813C11.9996 10.0413 13.0096 9.03125 14.2496 9.03125H29.7501C30.9901 9.03125 32.0001 10.0413 32.0001 11.2813Z\",\n fill: \"#ECEFF1\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.9997 14.0314C18.9997 15.1359 18.1043 16.0315 16.9998 16.0315C15.8951 16.0315 14.9997 15.1359 14.9997 14.0314C14.9997 12.9268 15.8951 12.0312 16.9998 12.0312C18.1043 12.0312 18.9997 12.9268 18.9997 14.0314Z\",\n fill: \"#FFC107\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.0001 19.9693V22.7795C32.0001 24.0195 30.9901 25.0295 29.7501 25.0295H14.2497C14.1497 25.0295 14.0497 25.0195 13.9596 25.0094L24.2599 14.7093C24.94 14.0292 26.0599 14.0292 26.7399 14.7093L32.0001 19.9693Z\",\n fill: \"#388E3C\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.0599 25.0294H14.2496C14.1497 25.0294 14.0497 25.0194 13.9596 25.0093C12.9096 24.8795 12.0897 24.0194 12.0097 22.9594L16.7597 18.2091C17.4398 17.5292 18.5597 17.5292 19.2398 18.2091L26.0599 25.0294Z\",\n fill: \"#4CAF50\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_1456_20597\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n fill: \"white\",\n transform: \"translate(8.00011 8)\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgFile);\nexport default __webpack_public_path__ + \"static/media/file.439581b048ba242400dd1951f4e8d841.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgQrDefault(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.08984 9.00057C9.32495 8.33224 9.789 7.76868 10.3998 7.4097C11.0106 7.05073 11.7287 6.91951 12.427 7.03928C13.1253 7.15906 13.7587 7.52209 14.2149 8.0641C14.6712 8.6061 14.9209 9.29209 14.9198 10.0006C14.9198 12.0006 11.9198 13.0006 11.9198 13.0006\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 17H12.01\",\n stroke: \"black\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgQrDefault);\nexport default __webpack_public_path__ + \"static/media/QRDefault.b75610e74239c5c0b16e68c6e90e8e07.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgACdefault(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13 2L3 14H12L11 22L21 10H12L13 2Z\",\n stroke: \"#F2C254\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgACdefault);\nexport default __webpack_public_path__ + \"static/media/ACdefault.a4e01121c1e24b10fe4cd7c38f5fb01f.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgConditionDef(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.7777 15.3347V17.5547C19.7777 20.0083 17.7877 22 15.3334 22V19.7767C16.5597 19.7767 17.5557 18.7814 17.5557 17.5547V15.3347C17.5557 13.9993 18.1567 12.815 19.089 12C18.1567 11.1854 17.5557 10.0027 17.5557 8.66667V6.44466C17.5557 5.21732 16.5597 4.22233 15.3324 4.22233V2C17.7854 2 19.7777 3.989 19.7777 6.44466V8.66667C19.7777 9.89401 20.7737 10.889 22 10.889V13.1123C20.7717 13.1123 19.7777 14.1077 19.7777 15.3347Z\",\n fill: \"#A44EBC\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.44564 15.3333V17.5557C6.44564 18.783 7.44167 19.778 8.66894 19.778V22C6.21465 22 4.22331 20.011 4.22331 17.5557L4.22233 15.3333C4.22233 14.106 3.22734 13.1113 2 13.1113V10.889L2.00098 10.888C3.22832 10.888 4.22331 9.89303 4.22331 8.66569V6.4457C4.22331 3.99238 6.2123 2.00006 8.66764 2.00006V4.22337C7.4403 4.22337 6.44564 5.21836 6.44564 6.4457V8.66569C6.44564 10.0014 5.84427 11.1854 4.9123 12C5.84434 12.815 6.44564 13.9983 6.44564 15.3333Z\",\n fill: \"#A44EBC\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgConditionDef);\nexport default __webpack_public_path__ + \"static/media/conditionDef.70be1bae4990979e21651d234c656146.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgJumpIcon(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 122.879 122.867\",\n enableBackground: \"new 0 0 122.879 122.867\",\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M83.88,0.451L122.427,39c0.603,0.601,0.603,1.585,0,2.188l-13.128,13.125 c-0.602,0.604-1.586,0.604-2.187,0l-3.732-3.73l-17.303,17.3c3.882,14.621,0.095,30.857-11.37,42.32 c-0.266,0.268-0.535,0.529-0.808,0.787c-1.004,0.955-0.843,0.949-1.813-0.021L47.597,86.48L0,122.867l36.399-47.584L11.874,50.76 c-0.978-0.98-0.896-0.826,0.066-1.837c0.24-0.251,0.485-0.503,0.734-0.753C24.137,36.707,40.376,32.917,54.996,36.8l17.301-17.3 l-3.733-3.732c-0.601-0.601-0.601-1.585,0-2.188L81.691,0.451C82.295-0.15,83.279-0.15,83.88,0.451L83.88,0.451z\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgJumpIcon);\nexport default __webpack_public_path__ + \"static/media/jumpIcon.3737984b45382f58a5d055b1e0e25f73.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgBtedit(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 13,\n height: 14,\n viewBox: \"0 0 13 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.35016 8.5C5.54216 8.5 4.88416 7.827 4.88416 7C4.88416 6.173 5.54216 5.5 6.35116 5.5C7.15916 5.5 7.81716 6.173 7.81716 7C7.81716 7.827 7.16016 8.5 6.35116 8.5H6.35016ZM6.34616 4.5C5.00316 4.5 3.91016 5.621 3.91016 7C3.91016 8.379 5.00316 9.5 6.34616 9.5C7.68916 9.5 8.78216 8.379 8.78216 7C8.78216 5.621 7.68916 4.5 6.34616 4.5Z\",\n fill: \"#979797\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.6544 9.567L11.1674 10.433C11.1365 10.4896 11.0945 10.5394 11.044 10.5794C10.9934 10.6194 10.9354 10.6488 10.8732 10.6659C10.811 10.683 10.7461 10.6873 10.6822 10.6788C10.6183 10.6702 10.5568 10.6489 10.5014 10.616L10.2454 10.464C9.95128 10.2865 9.61433 10.1927 9.27085 10.1927C8.92738 10.1927 8.59042 10.2865 8.29635 10.464C7.99647 10.642 7.74865 10.8958 7.5777 11.1997C7.40676 11.5037 7.3187 11.8473 7.32235 12.196V12.5C7.32235 12.776 7.10335 13 6.83535 13H5.86135C5.73042 12.9982 5.60555 12.9445 5.51408 12.8508C5.42262 12.7571 5.37202 12.6309 5.37335 12.5V12.196C5.37701 11.8473 5.28895 11.5037 5.118 11.1997C4.94706 10.8958 4.69923 10.642 4.39935 10.464C4.10528 10.2865 3.76833 10.1927 3.42485 10.1927C3.08138 10.1927 2.74442 10.2865 2.45035 10.464L2.19435 10.616C2.13894 10.6487 2.07751 10.6699 2.01373 10.6784C1.94995 10.6869 1.88512 10.6825 1.82308 10.6654C1.76105 10.6483 1.70308 10.6189 1.65262 10.579C1.60216 10.5391 1.56024 10.4894 1.52935 10.433L1.04235 9.567C0.977468 9.45234 0.959764 9.31693 0.992989 9.18944C1.02621 9.06195 1.10776 8.95241 1.22035 8.884L1.47635 8.732C1.77642 8.55409 2.02445 8.30043 2.19557 7.99644C2.3667 7.69245 2.4549 7.34882 2.45135 7C2.45501 6.65127 2.36695 6.30771 2.196 6.00373C2.02506 5.69975 1.77723 5.44603 1.47735 5.268L1.22135 5.116C1.10876 5.04759 1.02721 4.93805 0.993989 4.81056C0.960764 4.68307 0.978468 4.54766 1.04335 4.433L1.53035 3.567C1.56124 3.51056 1.60316 3.4609 1.65362 3.42097C1.70408 3.38105 1.76205 3.35168 1.82408 3.33461C1.88612 3.31754 1.95095 3.31311 2.01473 3.3216C2.07851 3.33008 2.13994 3.3513 2.19535 3.384L2.45135 3.536C3.06135 3.898 3.79135 3.898 4.40135 3.536C4.70105 3.35784 4.94868 3.10407 5.11944 2.8001C5.2902 2.49613 5.37811 2.15263 5.37435 1.804V1.5C5.37435 1.225 5.59435 1 5.86235 1H6.83635C7.10435 1 7.32335 1.225 7.32335 1.5V1.804C7.32335 2.527 7.68835 3.174 8.29735 3.536C8.90735 3.898 9.63735 3.898 10.2474 3.536L10.5024 3.384C10.5578 3.35114 10.6193 3.32979 10.6832 3.32122C10.7471 3.31265 10.812 3.31704 10.8742 3.33412C10.9364 3.35119 10.9944 3.38062 11.045 3.42063C11.0955 3.46064 11.1375 3.51042 11.1684 3.567L11.6554 4.433C11.7202 4.54766 11.7379 4.68307 11.7047 4.81056C11.6715 4.93805 11.5899 5.04759 11.4774 5.116L11.2204 5.268C10.9203 5.44591 10.6723 5.69957 10.5011 6.00356C10.33 6.30755 10.2418 6.65118 10.2454 7C10.2454 7.723 10.6104 8.37 11.2194 8.732L11.4764 8.884C11.7064 9.02 11.7904 9.324 11.6544 9.567V9.567ZM11.9634 8.018L11.7074 7.866C11.5572 7.77711 11.4331 7.6503 11.3475 7.49831C11.2618 7.34631 11.2176 7.17446 11.2194 7C11.2194 6.639 11.4024 6.315 11.7074 6.134L11.9634 5.982C12.3015 5.77712 12.5465 5.44855 12.6464 5.066C12.7463 4.68345 12.6932 4.27704 12.4984 3.933L12.0114 3.067C11.9184 2.8977 11.7924 2.74878 11.6408 2.62907C11.4893 2.50937 11.3152 2.4213 11.129 2.37011C10.9427 2.31891 10.7481 2.30562 10.5567 2.33102C10.3652 2.35643 10.1808 2.42001 10.0144 2.518L9.75835 2.67C9.61141 2.75875 9.44301 2.80565 9.27135 2.80565C9.09969 2.80565 8.93129 2.75875 8.78435 2.67C8.63423 2.58111 8.51011 2.4543 8.42446 2.30231C8.33881 2.15031 8.29463 1.97846 8.29635 1.804V1.5C8.29635 0.673 7.64135 0 6.83535 0H5.86135C5.05535 0 4.39935 0.673 4.39935 1.5V1.804C4.40118 1.97836 4.35715 2.15015 4.27168 2.30214C4.18621 2.45412 4.06229 2.58098 3.91235 2.67C3.76538 2.75864 3.59699 2.80549 3.42535 2.80549C3.25372 2.80549 3.08533 2.75864 2.93835 2.67L2.68135 2.518C2.51492 2.42001 2.3305 2.35643 2.13904 2.33102C1.94758 2.30562 1.75296 2.31891 1.56673 2.37011C1.3805 2.4213 1.20644 2.50937 1.05487 2.62907C0.903304 2.74878 0.777308 2.8977 0.684353 3.067L0.197353 3.933C0.00252914 4.27704 -0.0505752 4.68345 0.0493091 5.066C0.149193 5.44855 0.394205 5.77712 0.732353 5.982L0.989353 6.134C1.29435 6.314 1.47635 6.639 1.47635 7C1.47818 7.17436 1.43415 7.34615 1.34868 7.49814C1.26321 7.65012 1.13929 7.77698 0.989353 7.866L0.733353 8.018C0.395205 8.22288 0.150193 8.55145 0.0503091 8.934C-0.0495752 9.31655 0.00352915 9.72296 0.198353 10.067L0.685353 10.933C1.08835 11.65 1.98535 11.896 2.68135 11.482L2.93835 11.331C3.08529 11.2423 3.25369 11.1953 3.42535 11.1953C3.59701 11.1953 3.76541 11.2423 3.91235 11.331C4.06215 11.4199 4.18596 11.5466 4.27143 11.6984C4.35689 11.8502 4.401 12.0218 4.39935 12.196V12.5C4.39935 13.327 5.05535 14 5.86135 14H6.83535C7.64135 14 8.29635 13.327 8.29635 12.5V12.196C8.29635 11.834 8.47935 11.511 8.78435 11.33C8.93133 11.2414 9.09972 11.1945 9.27135 11.1945C9.44299 11.1945 9.61138 11.2414 9.75835 11.33L10.0144 11.482C10.1808 11.5799 10.3652 11.6433 10.5567 11.6687C10.7481 11.694 10.9427 11.6807 11.1289 11.6295C11.3151 11.5783 11.4891 11.4903 11.6407 11.3706C11.7922 11.251 11.9183 11.1022 12.0114 10.933L12.4984 10.067C12.6932 9.72296 12.7463 9.31655 12.6464 8.934C12.5465 8.55145 12.3015 8.22288 11.9634 8.018V8.018Z\",\n fill: \"#979797\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgBtedit);\nexport default __webpack_public_path__ + \"static/media/Btedit.f18024ce6561f1372d907dc5e84788c6.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgAddH(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 22,\n height: 22,\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z\",\n stroke: \"#1E1E1E\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11 7V15\",\n stroke: \"#1E1E1E\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7 11H15\",\n stroke: \"#1E1E1E\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgAddH);\nexport default __webpack_public_path__ + \"static/media/addH.0130db0f00532a8c035ce255bee5c294.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHookClearKey(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M19 6.4L17.6 5L12 10.6L6.4 5L5 6.4L10.6 12L5 17.6L6.4 19L12 13.4L17.6 19L19 17.6L13.4 12L19 6.4Z\",\n fill: \"#E02424\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHookClearKey);\nexport default __webpack_public_path__ + \"static/media/hookClearKey.006bca081dca0cdcae636d5779d2bc6d.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as Home } from \"./images/home.svg\";\nimport { ReactComponent as HomeAct } from \"./images/homeActive.svg\";\nimport { ReactComponent as Question } from \"./images/question.svg\";\nimport { ReactComponent as Contact } from \"./images/contact.svg\";\nimport { ReactComponent as Hand } from \"./images/hand.svg\";\nimport { ReactComponent as Settings } from \"./images/hand.svg\";\nimport { ReactComponent as BuildLogo } from \"./images/build.svg\";\nimport { ReactComponent as DesignLogo } from \"./images/design.svg\";\nimport { ReactComponent as configureWP } from \"./images/configureWP.svg\";\nimport { ReactComponent as QuestionLogo } from \"./images/question.svg\";\nimport { ReactComponent as LightLogo } from \"./images/light.svg\";\nimport { ReactComponent as GraphLogo } from \"./images/graph.svg\";\nimport { ReactComponent as AILogo } from \"./images/AI.svg\";\nimport { ReactComponent as SettingsLogo } from \"./images/settings.svg\";\nimport { ReactComponent as ClockLogo } from \"./images/clock.svg\";\nimport { ReactComponent as More } from \"./images/more.svg\";\nimport { ReactComponent as Check } from \"./images/check.svg\";\nimport { ReactComponent as Close } from \"./images/closeDrw.svg\";\nimport { ReactComponent as HandOver } from \"./images/handOver.svg\";\nimport { ReactComponent as Mail } from \"./images/mail.svg\";\nimport { ReactComponent as Send } from \"./images/sendAction.svg\";\nimport { ReactComponent as Task } from \"./images/task.svg\";\nimport { ReactComponent as Text } from \"./images/text.svg\";\nimport { ReactComponent as Zendex } from \"./images/zendex.svg\";\nimport { ReactComponent as TextW } from \"./images/textW.svg\";\nimport { ReactComponent as ImageW } from \"./images/imageW.svg\";\nimport { ReactComponent as QuestionW } from \"./images/questionW.svg\";\nimport { ReactComponent as ButtonsW } from \"./images/buttonW.svg\";\nimport { ReactComponent as StIcon } from \"./images/stIcon.svg\";\nimport { ReactComponent as UploadImage } from \"./images/uploadImage.svg\";\nimport { ReactComponent as EditBtn } from \"./images/editBtn.svg\";\nimport { ReactComponent as DelBtn } from \"./images/delbtn.svg\";\nimport { ReactComponent as DelNode } from \"./images/wbDelete.svg\";\nimport { ReactComponent as PlusIcon } from \"./images/PlusIcon.svg\";\nimport { ReactComponent as File } from \"./images/file.svg\";\nimport { ReactComponent as QRdefault } from \"./images/QRDefault.svg\";\nimport { ReactComponent as ACdefault } from \"./images/ACdefault.svg\";\nimport { ReactComponent as HandlerIcon } from \"./images/handlerIcon.svg\";\nimport { ReactComponent as ConditionDef } from \"./images/conditionDef.svg\";\nimport { ReactComponent as JumpTo } from \"./images/jumpIcon.svg\";\nimport { ReactComponent as Btedit } from \"./images/Btedit.svg\";\nimport { ReactComponent as AddH } from \"./images/addH.svg\";\nimport { ReactComponent as HookClear } from \"./images/hookClearKey.svg\";\nexport const imageMapper = {\n Home,\n HomeAct,\n Question,\n Contact,\n Hand,\n Settings,\n BuildLogo,\n DesignLogo,\n configureWP,\n QuestionLogo,\n LightLogo,\n GraphLogo,\n AILogo,\n SettingsLogo,\n ClockLogo,\n More,\n Check,\n Close,\n HandOver,\n Mail,\n Send,\n Task,\n Text,\n Zendex,\n TextW,\n ImageW,\n QuestionW,\n ButtonsW,\n StIcon,\n UploadImage,\n EditBtn,\n DelBtn,\n DelNode,\n PlusIcon,\n File,\n QRdefault,\n HandlerIcon,\n ACdefault,\n ConditionDef,\n JumpTo,\n Btedit,\n AddH,\n HookClear,\n};\n","import { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport React, { useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport \"./styles/navbar.style.css\";\nimport { imageMapper } from \"../ImageMapper\";\n\nexport const WBNavbar = (props) => {\n const dispatch = useDispatch();\n const Nav = [\n { name: \"QuestionResponse\", icon: imageMapper[\"QuestionLogo\"] },\n { name: \"Actions\", icon: imageMapper[\"LightLogo\"] },\n { name: \"conditions\", icon: imageMapper[\"GraphLogo\"] },\n // { name: \"AILogo\", icon: imageMapper[\"AILogo\"] },\n // { name: \"SettingsLogo\", icon: imageMapper[\"SettingsLogo\"] },\n ];\n const handleClick = (name) => {\n let obj = {\n convNodeType: name,\n type: name,\n };\n // setActive(name);\n dispatch({ type: SET_WIDGET_DRAWER, data: true });\n dispatch({ type: SELECTED_NODE, data: obj });\n };\n\n return (\n
\n {Nav.map((res, i) => {\n return (\n handleClick(res.name)}\n className={\n i < Nav?.length - 1\n ? \"wb_navbar_list\"\n : \"wb_navbar_list_withoutborder\"\n }\n >\n \n
\n );\n })}\n \n );\n};\n\nexport default WBNavbar;\n","import React from \"react\";\nimport \"./styles/wbtopbar.style.css\";\nimport { imageMapper } from \"../ImageMapper\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { SET_ACTIVE_STEPPER } from \"constant\";\nimport { PreviewWidget, publishAction } from \"action/WorkbenchAction\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\n\nexport const WBTopbar = () => {\n const dispatch = useDispatch();\n const { url } = useRouteMatch();\n const { id } = useParams();\n const WrokbenchReducer = useSelector((state) => state.WrokbenchReducer);\n const StepperList = [\n { name: \"Configure\", Icon: imageMapper[\"configureWP\"] },\n { name: \"Build\", Icon: imageMapper[\"BuildLogo\"] },\n // { name: \"Design\", Icon: imageMapper[\"DesignLogo\"] },\n // { name: \"Faq\", Icon: imageMapper[\"DesignLogo\"] },\n ];\n\n const publishBotHandler = () => {\n dispatch(publishAction());\n };\n return (\n
\n
\n {StepperList.map((res, i) => {\n return (\n
\n (\n dispatch({ type: SET_ACTIVE_STEPPER, data: res.name }),\n history.push(`${url}/${res.name}`)\n )}\n >\n
\n {\n \n }\n
\n \n {res.name}\n
\n
\n {res.name === WrokbenchReducer.StepperActive && (\n
\n )}\n \n );\n })}\n \n
\n {/* dispatch(PreviewWidget(id))}\n >\n Preview\n */}\n publishBotHandler()}\n >\n Publish\n \n
\n
\n \n );\n};\n\nexport default WBTopbar;\n","import {\n deleteNodeAPI,\n deleteNodeLinkAPI,\n updateConvNode,\n updateNodeSettings,\n} from \"action/WorkbenchAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXInput } from \"component/Input\";\nimport { CXPopover } from \"component/Popover\";\nimport { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { imageMapper } from \"../../ImageMapper\";\n\nexport const WBNodeTopbar = (props) => {\n const [visible, setVisible] = useState(false);\n const [hvisible, sethvisible] = useState(false);\n const [jumperName, setjumperName] = useState(\"\");\n const dispatch = useDispatch();\n\n const NodeDelete = (e, id) => {\n e.stopPropagation();\n dispatch(deleteNodeAPI(id));\n };\n const StartNode = (e, id) => {\n e.stopPropagation();\n sethvisible(true);\n };\n const JumpSet = (e, id) => {\n e.stopPropagation();\n setVisible(true);\n };\n const DynamicIconLoad = (val) => {\n const Icon = imageMapper[val];\n return ;\n };\n useEffect(() => {\n !props?.isMouseEnter && setVisible(false);\n !props?.isMouseEnter && sethvisible(false);\n }, [props?.isMouseEnter]);\n const jumpContent = (id) => {\n const onSave = () => {\n const payload = {\n isJl: true,\n displayName: jumperName,\n _id: id,\n };\n dispatch(updateNodeSettings(payload));\n setVisible(false);\n };\n const onRemove = () => {\n const payload = {\n isJl: false,\n displayName: jumperName,\n _id: id,\n };\n dispatch(updateNodeSettings(payload));\n setVisible(false);\n };\n return (\n
e.stopPropagation()}>\n
\n
Set jump identifier
\n {\n setjumperName(e.target.value);\n }}\n placeholer=\"Name\"\n defaultValue={\n props?.nodeData?.displayName?.length > 0\n ? props?.nodeData?.displayName\n : \"\"\n }\n />\n
\n
\n \n Save\n \n \n Remove\n \n
\n
\n );\n };\n const SetStart = (id) => {\n const onSave = () => {\n const payload = {\n isStartNode: true,\n _id: id,\n };\n dispatch(updateNodeSettings(payload));\n sethvisible(false);\n };\n return (\n
e.stopPropagation()}>\n
\n
\n This will change your default conversation start point\n
\n
Are you sure ?
\n
\n
\n \n Yes\n \n sethvisible(false)}>\n No\n \n
\n
\n );\n };\n return (\n {\n dispatch({ type: SET_WIDGET_DRAWER, data: true });\n dispatch({ type: SELECTED_NODE, data: props.nodeData });\n }}\n >\n
\n
\n
\n {DynamicIconLoad(props.icon)}\n
\n
{props?.title}
\n
\n
\n {(props?.isMouseEnter || props?.nodeData?.jl) &&\n props?.nodeData?.convNodeType === \"content\" && (\n
\n \n JumpSet(e)}\n />\n \n
\n )}\n {(props?.isMouseEnter || props?.nodeData?.startNode) &&\n (props?.nodeData?.convNodeType === \"content\" ||\n props?.nodeData.name === \"Send Message\") && (\n StartNode(e)}\n >\n \n {DynamicIconLoad(\n props?.nodeData?.startNode ? \"HomeAct\" : \"Home\"\n )}\n \n
\n )}\n {props?.isMouseEnter ? (\n
\n NodeDelete(e, props.nodeData.id)}\n />\n
\n ) : null}\n
\n \n \n );\n};\n\nexport default WBNodeTopbar;\n","export const WIDGET_LIST = [\n {\n label: \"Welcome Node\",\n image: \"/images/Workbench/welcome.svg\",\n },\n {\n label: \"Name\",\n image: \"/images/Workbench/name.svg\",\n subH: \"Ask user name\",\n type: \"text\",\n validation: \"Name\",\n dType: \"content\",\n },\n {\n label: \"Email\",\n image: \"/images/Workbench/email.svg\",\n subH: \"Ask for a email address\",\n type: \"text\",\n validation: \"Email\",\n dType: \"content\",\n },\n {\n label: \"Text\",\n image: \"/images/Workbench/text.svg\",\n subH: \"Ask anything to the user\",\n type: \"text\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"File\",\n image: \"/images/Workbench/file.svg\",\n subH: \"Ask user to upload file\",\n type: \"file\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Date\",\n image: \"/images/Workbench/date.svg\",\n subH: \"Ask for a date select\",\n type: \"calendar\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Number\",\n image: \"/images/Workbench/numbers.svg\",\n subH: \"Ask for a number\",\n type: \"text\",\n validation: \"Numeric\",\n dType: \"content\",\n },\n {\n label: \"Phone\",\n image: \"/images/Workbench/phone.svg\",\n subH: \"Ask for a phone number\",\n type: \"text\",\n validation: \"Phone\",\n dType: \"content\",\n },\n {\n label: \"Buttons\",\n image: \"/images/Workbench/buttons.svg\",\n subH: \"Choices based on button\",\n type: \"button\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Content\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Add Content\",\n type: \"content\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Categories\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Add Categories\",\n type: \"shopifyCategory\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Items\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Add Items\",\n type: \"shopifyItem\",\n validation: \"None\",\n dType: \"content\",\n },\n // {\n // label: \"Variant\",\n // image: \"/images/Workbench/task.svg\",\n // subH: \"Add Variant\",\n // type: \"shopifyVariant\",\n // validation: \"None\",\n // dType: \"content\",\n // },\n // {\n // label: \"WhatsApp\",\n // image: \"/images/Workbench/task.svg\",\n // subH: \"Select a template\",\n // type: \"whatsapp\",\n // validation: \"None\",\n // dType: \"content\",\n // },\n {\n label: \"Rating\",\n image: \"/images/Workbench/rating.svg\",\n subH: \"Ask for a review\",\n type: \"rating\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Webhook\",\n image: \"/images/Workbench/webhooks.svg\",\n subH: \"Add a Webhook\",\n type: \"webhook\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Task\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Create a task\",\n type: \"createTask\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Zendesk\",\n image: \"/images/Workbench/Zendesk.svg\",\n subH: \"Add zendex \",\n type: \"integration_znd\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Yes/No\",\n image: \"/images/Workbench/yn.svg\",\n subH: \"Choices based on button\",\n type: \"yesNo\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Close chat\",\n image: \"/images/Workbench/closeChat.svg\",\n subH: \"Close Chat\",\n type: \"closeChat\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Goodbye\",\n image: \"/images/Workbench/GoodBye.svg\",\n subH: \"Add Goodbye Text\",\n type: \"goodbye\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Human Hand Over\",\n image: \"/images/Workbench/humanTakeover.svg\",\n subH: \"Add human over\",\n type: \"humanHandOverNode\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"aiNode\",\n image: \"/images/Workbench/AiBot.svg\",\n subH: \"Add a AI node\",\n type: \"aiNode\",\n validation: \"None\",\n dType: \"ai\",\n },\n {\n label: \"Payments\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Add payment action\",\n type: \"payments\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Send Message\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Send message action\",\n type: \"sendMessage\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Update Contact\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Update Contact\",\n type: \"updateContact\",\n validation: \"None\",\n dType: \"action\",\n },\n {\n label: \"Jump-To\",\n image: \"/images/Workbench/jumpIcon.svg\",\n subH: \"Add a Jumper action\",\n type: \"jumper\",\n validation: \"None\",\n dType: \"action\",\n },\n // {\n // label: \"WhatsApp Template\",\n // image: \"/images/Workbench/task.svg\",\n // subH: \"Select a template\",\n // type: \"smTemplate\",\n // validation: \"None\",\n // dType: \"content\",\n // },\n {\n label: \"SMS Template\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Select a template\",\n type: \"waTemplate\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Qualifier\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Use qualifier Questions\",\n type: \"qualifierQuestions\",\n validation: \"None\",\n dType: \"content\",\n },\n {\n label: \"Date & Time\",\n image: \"/images/Workbench/task.svg\",\n subH: \"Use date & time\",\n type: \"dateTime\",\n validation: \"None\",\n dType: \"content\",\n },\n\n // =============> Un-used nodes<=============\n // {\n // label: \"Multi Question\",\n // image: \"/images/Workbench/multiQ.svg\",\n // subH: \"Group Several Questions\",\n // type: \"text\",\n // validation: \"None\",\n // dType: \"content\",\n // },\n // {\n // label: \"URL\",\n // image: \"/images/Workbench/url.svg\",\n // },\n // {\n // label: \"Yes/No\",\n // image: \"/images/Workbench/yn.svg\",\n // },\n // {\n // label: \"Auto-Complete\",\n // image: \"/images/Workbench/autoC.svg\",\n // },\n // {\n // label: \"Scale\",\n // image: \"/images/Workbench/scale.svg\",\n // },\n // {\n // label: \"Picture Choice\",\n // image: \"/images/Workbench/pictureC.svg\",\n // },\n\n // {\n // label: \"Address\",\n // image: \"/images/Workbench/address.svg\",\n // },\n // {\n // label: \"Media\",\n // image: \"/images/Workbench/ovalDummy.svg\",\n // },\n // {\n // label: \"Global Keywords\",\n // image: \"/images/Workbench/ovalDummy.svg\",\n // },\n //{\n // label: \"Set Variable\",\n // image: \"/images/Workbench/ovalDummy.svg\",\n //},\n];\n","import React, { useState, useRef, useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Handle } from \"reactflow\";\nimport WBNodeTopbar from \"./WBNodeTopbar\";\nimport \"./styles/question.style.css\";\nimport { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport { WIDGET_LIST } from \"../../WBconstants\";\nimport ConnectIcon from \"../../images/handlerIcon.svg\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { InfoBox } from \"component/InfoBox\";\nexport const WBQuestionNode = ({ data, type, id }) => {\n const ref = useRef(null);\n const [isMouseEnter, setMouseEnter] = useState(false);\n const content =\n data &&\n data?.convNodeContent?.length > 0 &&\n data?.convNodeContent[0]?.content\n ? data?.convNodeContent[0]?.content\n : [];\n let Drag = useSelector((state) => state?.WrokbenchReducer?.nodeDrag);\n const dispatch = useDispatch();\n const OpenDrawer = (e) => {\n if (!Drag) {\n dispatch({ type: SET_WIDGET_DRAWER, data: true });\n dispatch({\n type: SELECTED_NODE,\n data: { ...data, type, id },\n });\n }\n };\n const nodeBg = (res, i) => {\n if (res?.name === \"text\") {\n return (\n
\n \n
\n );\n }\n if (res?.name === \"eventText\") {\n return ;\n }\n if (res?.name === \"media\") {\n return (\n
\n {res?.attachments[0]?.mType === \"image\" && (\n \n )}\n {res?.attachments[0]?.mType === \"iframe\" && (\n \n )}\n
\n );\n }\n if (res?.name === \"button\" && res?.buttons?.length > 0) {\n return (\n
\n {res.buttons.map((res, i) => {\n return (\n
\n
{res.text}
\n \n
\n );\n })}\n
\n );\n }\n if (res?.name === \"shopifyCategory\") {\n return res?.items?.map((res, i) => {\n return
{res?.catName}
;\n });\n }\n if (res?.name === \"shopifyItem\") {\n return res?.items?.map((res, i) => {\n return (\n
\n {res?.storeItems?.map((res, i) => {\n return
{res?.name}
;\n })}\n
\n );\n });\n }\n };\n\n const renderRating = (type) => {\n if (type === \"stars\") {\n return (\n
\n \n \n \n \n \n
\n );\n }\n if (type === \"emojis\") {\n return (\n
\n 😠\n 🙁\n 😐\n 😃\n 🤩\n
\n );\n }\n };\n return (\n {\n setMouseEnter(true);\n }}\n onMouseLeave={() => {\n setMouseEnter(false);\n }}\n >\n \n {![\"button\", \"waTemplate\"].includes(type) &&\n data?.rhandler.map((rh, i) => {\n return (\n \n );\n })}\n \n
OpenDrawer(e)}>\n
\n d.label === data.name).map(\n (res) => res.image\n )[0]\n }\n alt=\"logo\"\n />\n \n Question: {data.name ? data.name : \"Text\"}\n \n
\n {data.name === \"Rating\" && (\n
\n {renderRating(\n content?.filter((val) => val.name === \"rating\")?.[0].rType\n )}\n
\n )}\n
\n {content?.map((res, i) => {\n return nodeBg(res, i);\n })}\n
\n
\n \n );\n};\n\nexport default WBQuestionNode;\n","var _rect, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgHandlerIconFail(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 24,\n rx: 12,\n fill: \"#dc3545\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.75 16.5L14.25 12L9.75 7.5\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgHandlerIconFail);\nexport default __webpack_public_path__ + \"static/media/handlerIconFail.a1e34fb3ddb2806483ae8599c338536f.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Handle } from \"reactflow\";\nimport WBNodeTopbar from \"./WBNodeTopbar\";\nimport \"./styles/question.style.css\";\nimport { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport ConnectIcon from \"../../images/handlerIcon.svg\";\nimport FailIcon from \"../../images/handlerIconFail.svg\";\nimport { WIDGET_LIST } from \"../../WBconstants\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { InfoBox } from \"component/InfoBox\";\nexport const WBActionNode = ({ data, type, id, name }) => {\n const [isMouseEnter, setMouseEnter] = useState(false);\n let Drag = useSelector((state) => state.WrokbenchReducer.nodeDrag);\n const { jumpLocationSet } = useSelector((state) => state.WrokbenchReducer);\n const dispatch = useDispatch();\n const OpenDrawer = (e) => {\n if (!Drag) {\n dispatch({ type: SET_WIDGET_DRAWER, data: true });\n dispatch({ type: SELECTED_NODE, data: { ...data, type, id } });\n }\n };\n const content =\n data &&\n data?.convNodeContent?.length > 0 &&\n data?.convNodeContent[0]?.content\n ? data?.convNodeContent[0]?.content\n : [];\n const displayName = {\n webhook: \"Webhook\",\n createTask: \"Task\",\n integration_znd: \"Zendesk\",\n conditions: \"Conditions\",\n closeChat: \"Close chat\",\n humanHandOverNode: \"Human Hand Over\",\n conditionalNode: \"Yes/No\",\n jumper: \"Jump-To\",\n yesNo: \"Yes/No\",\n goodbye: \"Goodbye\",\n payments: \"Payments\",\n sendMessage: \"Send Message\",\n rating: \"Rating\",\n updateContact: \"Update Contact\",\n };\n const nodeBg = (res, i) => {\n if (res.name === \"text\") {\n return (\n
\n \n
\n );\n }\n if (res?.name === \"eventText\") {\n return ;\n }\n if (res.name === \"media\") {\n return (\n
\n \n
\n );\n }\n };\n return (\n {\n setMouseEnter(true);\n }}\n onMouseLeave={() => {\n setMouseEnter(false);\n }}\n >\n \n \n
OpenDrawer(e)}>\n
\n d.label === displayName[type]).map(\n (res) => res.image\n )[0]\n }\n alt=\"logo\"\n />\n \n Action: {displayName[type] ? displayName[type] : \"\"}\n \n
\n {content?.length > 0 && (\n
\n {content.map((res, i) => {\n return nodeBg(res, i);\n })}\n
\n )}\n {data?.rhandler?.length > 0 && (\n
\n
\n {data.rhandler[0]?.id && (\n
\n
\n {type === \"yesNo\" ? \"Yes\" : \"On Success\"}\n
\n \n
\n )}\n {data.rhandler[1]?.id && (\n
\n
\n {type === \"yesNo\" ? \"No\" : \"On Failure\"}\n
\n \n
\n )}\n
\n
\n )}\n {type === \"jumper\" && data?.actionConfig?.refId && (\n
\n
\n {\n jumpLocationSet.filter(\n (d) => d._id === data?.actionConfig?.refId\n )[0]?.name\n }\n
{\" \"}\n
\n )}\n {type === \"updateContact\" &&\n data?.actionConfig?.updateConfig &&\n Object.keys(data.actionConfig.updateConfig)?.length > 0 && (\n
\n
\n {Object.keys(data?.actionConfig?.updateConfig).map((res, i) => {\n return (\n
\n {res} : {data?.actionConfig.updateConfig[res]}\n
\n );\n })}\n
\n
\n )}\n
\n \n );\n};\nexport default WBActionNode;\n","import React, { useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Handle } from \"reactflow\";\nimport WBNodeTopbar from \"./WBNodeTopbar\";\nimport \"./styles/question.style.css\";\nimport { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport ConnectIcon from \"../../images/handlerIcon.svg\";\nimport FailIcon from \"../../images/handlerIconFail.svg\";\nexport const WBConditionNode = ({ data, type, id }) => {\n const [isMouseEnter, setMouseEnter] = useState(false);\n let Drag = useSelector((state) => state.WrokbenchReducer.nodeDrag);\n const dispatch = useDispatch();\n const OpenDrawer = (e) => {\n if (!Drag) {\n dispatch({ type: SET_WIDGET_DRAWER, data: true });\n dispatch({ type: SELECTED_NODE, data: { ...data, type, id } });\n }\n };\n return (\n {\n setMouseEnter(true);\n }}\n onMouseLeave={() => {\n setMouseEnter(false);\n }}\n >\n \n \n
OpenDrawer(e)}>\n
\n Condition\n
\n
\n
\n
\n
{\"On Success\"}
\n \n
\n
\n
{\"On Failure\"}
\n \n
\n
\n
\n
\n \n );\n};\nexport default WBConditionNode;\n","import React, { useEffect, useMemo } from \"react\";\nimport ReactFlow, { Controls } from \"reactflow\";\nimport QuestionNode from \"./node/WBQuestionNode\";\nimport WBActionNode from \"./node/WBActionNode\";\nimport WBConditionNode from \"./node/WBConditionNode\";\nimport { useDispatch } from \"react-redux\";\nimport { SET_ACTIVE_STEPPER } from \"constant\";\n\nconst WBCanvas = (props) => {\n const dispatch = useDispatch();\n const nodeTypes = useMemo(\n () => ({\n button: QuestionNode,\n text: QuestionNode,\n calendar: QuestionNode,\n content: QuestionNode,\n file: QuestionNode,\n webhook: WBActionNode,\n createTask: WBActionNode,\n rating: QuestionNode,\n aiNode: WBActionNode,\n integration_znd: WBActionNode,\n closeChat: WBActionNode,\n conditionalNode: WBActionNode,\n humanHandOverNode: WBActionNode,\n jumper: WBActionNode,\n yesNo: WBActionNode,\n goodbye: WBActionNode,\n payments: WBActionNode,\n sendMessage: WBActionNode,\n conditions: WBConditionNode,\n shopifyCategory: QuestionNode,\n shopifyItem: QuestionNode,\n updateContact: WBActionNode,\n waTemplate: QuestionNode,\n qualifierQuestions: QuestionNode,\n dateTime: QuestionNode,\n }),\n []\n );\n useEffect(() => {\n dispatch({ type: SET_ACTIVE_STEPPER, data: \"Build\" });\n }, []);\n return (\n \n \n \n );\n};\n\nexport default WBCanvas;\n","import { post, get, del } from \"helper/networkClient\";\nimport { INTENT_LIST, INTENT_DATA, ENTITY_LIST } from \"constant\";\n\nconst IntentList = (data) => ({\n type: INTENT_LIST,\n data: data,\n});\nconst IntentData = (data) => ({\n type: INTENT_DATA,\n data: data,\n});\nconst EntityList = (data) => ({\n type: ENTITY_LIST,\n data: data,\n});\n\nexport const GetIntentList = (botId) => async (dispatch) => {\n try {\n await get(`/ie/intents`, null, \"workbench\").then((resp) => {\n resp.status === 200 && dispatch(IntentList(resp.data));\n });\n } catch (error) {}\n};\n\nexport const createIntent = (data, botId) => async (dispatch) => {\n try {\n await post(`/ie/intent`, data, null, \"workbench\").then((res) => {\n res.status === 200 && dispatch(GetIntentList(botId));\n });\n } catch (error) {}\n};\n\nexport const getIntentbyId = (intentId) => async (dispatch) => {\n try {\n await get(`/ie/intent/${intentId}`, null, \"workbench\").then((res) => {\n res.status === 200 && dispatch(IntentData(res.data));\n });\n } catch (error) {}\n};\n\nexport const TrainIntent = (data, botId) => async (dispatch) => {\n try {\n await post(`/train`, data, null, \"workbench\").then((res) => {\n (res.status === 200 || res.status === 201) &&\n dispatch(getTrainedData(data.intentId));\n });\n } catch (error) {}\n};\n\nexport const getTrainedData = (intentId) => async (dispatch) => {\n try {\n await get(`/train/data/intent/${intentId}`, null, \"workbench\").then(\n (resp) => {\n (resp.status === 200 || resp.status === 201) &&\n dispatch(IntentList(resp.data));\n }\n );\n } catch (error) {}\n};\nexport const deleteIntent = (id, botID) => async (dispatch) => {\n await del(`/ie/intent/${id}`, null, null, \"workbench\").then((res) => {\n if (res.status === 200) {\n dispatch(GetIntentList(botID));\n } else {\n dispatch(GetIntentList(botID));\n }\n });\n};\n\n//Entity\nexport const GetEntityList = (botId) => async (dispatch) => {\n try {\n await get(`/ie/${botId}/entities`, null, \"workbench\").then((resp) => {\n (resp.status === 200 || resp.status === 201) &&\n dispatch(EntityList(resp.data));\n });\n } catch (error) {}\n};\n\nexport const CreateEntity = (botId, data) => async (dispatch) => {\n try {\n await post(`/ie/${botId}/entity`, data, null, \"workbench\").then((resp) => {\n (resp.status === 200 || resp.status === 201) &&\n dispatch(GetEntityList(botId));\n });\n } catch (error) {}\n};\nexport const deleteEntity = (id, botID) => async (dispatch) => {\n await del(`/ie/entity/${id}`, null, null, \"workbench\").then((res) => {\n if (res.status === 200) {\n dispatch(GetEntityList(botID));\n } else {\n dispatch(GetEntityList(botID));\n }\n });\n};\n","export const getNodeData = (nData, metaData, node = null) => {\n const content = (type) => {\n switch (type) {\n case \"button\":\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n _type: \"rtc\",\n name: \"button\",\n buttons: [\n {\n text: \"Add buttons\",\n value: \"\",\n onClick: \"sendBack\",\n intent: \"\",\n meta: {\n type: \"cf\",\n },\n },\n ],\n },\n ];\n case \"rating\":\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n rType: \"\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n rType: \"\",\n _type: \"rtc\",\n name: \"rating\",\n },\n ];\n case \"file\":\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n _type: \"rtc\",\n name: \"file\",\n },\n ];\n case \"calendar\":\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n _type: \"rtc\",\n name: \"calendar\",\n },\n ];\n case \"shopifyCategory\":\n return [\n {\n _type: \"store\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n _type: \"store\",\n name: \"shopifyCategory\",\n stId: 1,\n storeContentType: \"category\",\n },\n ];\n case \"shopifyItem\":\n return [\n {\n _type: \"store\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n {\n _type: \"store\",\n name: \"shopifyItem\",\n stId: 1,\n storeContentType: \"item\",\n },\n ];\n case \"waTemplate\":\n return [\n {\n _type: \"template\",\n name: \"text\",\n prompt: {\n q: [\"Select a template\"],\n },\n templateId: \"\",\n },\n {\n _type: \"template\",\n name: \"button\",\n buttons: [],\n templateId: \"\",\n },\n ];\n default:\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n ];\n }\n };\n let Card = {\n name: nData.label,\n validation: {\n type: nData.validation,\n },\n qType: nData.type,\n nodeContext: [],\n convNodeContent: [\n {\n lang: \"en\",\n temp: false,\n content: content(nData.type),\n },\n ],\n parentId: node?.nodeId ? [node?.nodeId] : [],\n linkRef: node?.handleId || \"\",\n position: { x: metaData.pos.x, y: metaData.pos.y },\n };\n return Card;\n};\n\nexport const getActionData = (nData, metaData, node = null) => {\n const dataConfig = (type) => {\n switch (type) {\n case \"webhook\":\n return {\n _type: \"webhook\",\n onSuccessConfig: {},\n onFailureConfig: {},\n name: \"\",\n description: \"\",\n apiRecordId: \"\",\n };\n case \"createTask\":\n return {\n _type: \"createTask\",\n onSuccessConfig: {},\n onFailureConfig: {},\n name: \"\",\n description: \"\",\n stage: \"\",\n };\n case \"integration_znd\":\n return {\n _type: \"integration_znd\",\n onSuccessConfig: {},\n onFailureConfig: {},\n name: \"\",\n description: \"\",\n };\n case \"humanHandOverNode\":\n return {\n _type: \"humanHandOverNode\",\n onSuccessConfig: {},\n onFailureConfig: {},\n };\n case \"jumper\":\n return {\n _type: \"jumper\",\n };\n case \"yesNo\":\n return {\n _type: \"yesNo\",\n onSuccessConfig: {},\n onFailureConfig: {},\n };\n case \"goodbye\":\n return {\n _type: \"goodbye\",\n };\n case \"payments\":\n return {\n _type: \"payments\",\n onSuccessConfig: {},\n onFailureConfig: {},\n iaId: null,\n itemId: null,\n text: null,\n };\n case \"updateContact\":\n return {\n _type: \"updateContact\",\n updateConfig: {},\n };\n case \"sendMessage\":\n return {\n _type: \"sendMessage\",\n onSuccessConfig: {},\n onFailureConfig: {},\n md: null,\n text: null,\n };\n default:\n break;\n }\n };\n const content = (type) => {\n switch (type) {\n case \"goodbye\":\n return [\n {\n _type: \"rtc\",\n name: \"text\",\n prompt: {\n q: [`${nData.label}`],\n },\n },\n ];\n default:\n return [];\n }\n };\n let Card = {\n name: nData.label,\n validation: {\n type: nData.validation,\n },\n convNodeContent: [\n {\n lang: \"en\",\n temp: false,\n content: content(nData.type),\n },\n ],\n qType: nData.type,\n nodeContext: [],\n actionConfig: dataConfig(nData.type) || {},\n parentId: node?.nodeId ? [node?.nodeId] : [],\n linkRef: node?.handleId || \"\",\n position: { x: metaData.pos.x, y: metaData.pos.y },\n };\n return Card;\n};\n\nexport const getAiData = (nData, metaData, node = null) => {\n let Card = {\n name: nData.label,\n validation: {\n type: nData.validation,\n },\n qType: nData.type,\n nodeContext: [],\n aiConfig: {\n ci: [\n {\n intentId: \"\",\n entityId: \"\",\n },\n ],\n },\n parentId: node?.nodeId ? [node?.nodeId] : [],\n linkRef: node?.handleId || \"\",\n position: { x: metaData.pos.x, y: metaData.pos.y },\n };\n return Card;\n};\n\nexport const ConditionNode = (ConditionList) => {\n let Card = {\n name: \"Condition Node\",\n qType: \"conditions\",\n position: {\n x: 500,\n y: 350,\n },\n actionConfig: {\n _type: \"conditions\",\n onSuccessConfig: {},\n onFailureConfig: {},\n conditions: ConditionList,\n },\n };\n return Card;\n};\n\nexport const ConditionsMenu = [\n {\n value: \"eq\",\n name: \"EQUAL TO\",\n },\n {\n value: \"gt\",\n name: \"GREATER THAN\",\n },\n {\n value: \"lt\",\n name: \"LESS THAN\",\n },\n {\n value: \"gte\",\n name: \"GREATER THAN OR EQUAL TO\",\n },\n {\n value: \"lte\",\n name: \"LESS THAN OR EQUAL TO\",\n },\n {\n value: \"contains\",\n name: \"CONTAINS\",\n },\n {\n value: \"and\",\n name: \"AND\",\n },\n {\n value: \"or\",\n name: \"OR\",\n },\n];\n","var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgFacebook(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.25 0H3.75C1.68187 0 0 1.68187 0 3.75V26.25C0 28.3181 1.68187 30 3.75 30H26.25C28.3181 30 30 28.3181 30 26.25V3.75C30 1.68187 28.3181 0 26.25 0Z\",\n fill: \"#1976D2\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.3125 15H20.625V11.25C20.625 10.215 21.465 10.3125 22.5 10.3125H24.375V5.625H20.625C17.5181 5.625 15 8.14313 15 11.25V15H11.25V19.6875H15V30H20.625V19.6875H23.4375L25.3125 15Z\",\n fill: \"#FAFAFA\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgFacebook);\nexport default __webpack_public_path__ + \"static/media/facebook.76e02aadcb5d71a540f52c02e00efed8.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgGmail(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.25 3.75H3.75V26.25H26.25V3.75Z\",\n fill: \"#ECEFF1\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 17.3659L26.25 26.2497V8.71094L15 17.3659Z\",\n fill: \"#CFD8DC\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.1875 3.75H26.25L15 12.6337L3.75 3.75H2.8125C1.26 3.75 0 5.01 0 6.5625V23.4375C0 24.99 1.26 26.25 2.8125 26.25H3.75V8.71125L15 17.3644L26.25 8.70937V26.25H27.1875C28.74 26.25 30 24.99 30 23.4375V6.5625C30 5.01 28.74 3.75 27.1875 3.75Z\",\n fill: \"#F44336\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgGmail);\nexport default __webpack_public_path__ + \"static/media/gmail.46da9de2bc618ac61608105ae5ccda9b.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgGoogle(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 28,\n height: 28,\n viewBox: \"0 0 28 28\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.9428 11.567L15.5219 11.5664C15.0176 11.5664 14.6088 11.9751 14.6088 12.4795V16.1279C14.6088 16.6322 15.0176 17.041 15.5218 17.041H21.9534C21.2491 18.8687 19.9347 20.3994 18.2576 21.3719L21 26.1193C25.3992 23.5751 28 19.111 28 14.1137C28 13.4022 27.9476 12.8936 27.8427 12.3208C27.763 11.8857 27.3852 11.567 26.9428 11.567Z\",\n fill: \"#167EE6\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 22.5223C10.8525 22.5223 8.10478 20.8026 6.62904 18.2578L1.88184 20.994C4.29766 25.181 8.82326 28.0006 14 28.0006C16.5395 28.0006 18.9357 27.3168 21 26.1252V26.1187L18.2576 21.3713C17.0031 22.0988 15.5515 22.5223 14 22.5223Z\",\n fill: \"#12B347\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21 26.125V26.1185L18.2576 21.3711C17.0032 22.0986 15.5516 22.5221 14 22.5221V28.0004C16.5395 28.0004 18.9359 27.3166 21 26.125Z\",\n fill: \"#0F993E\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.47827 14.0013C5.47827 12.4499 5.90166 10.9984 6.62905 9.74405L1.88185 7.00781C0.683703 9.06554 0 11.4553 0 14.0013C0 16.5473 0.683703 18.9371 1.88185 20.9948L6.62905 18.2586C5.90166 17.0042 5.47827 15.5527 5.47827 14.0013Z\",\n fill: \"#FFD500\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 5.47827C16.0525 5.47827 17.9378 6.20758 19.4103 7.42071C19.7736 7.71996 20.3016 7.69836 20.6344 7.36559L23.2195 4.78051C23.597 4.40295 23.5701 3.78492 23.1668 3.43503C20.6996 1.29462 17.4894 0 14 0C8.82326 0 4.29766 2.81952 1.88184 7.00651L6.62904 9.74274C8.10478 7.19797 10.8525 5.47827 14 5.47827Z\",\n fill: \"#FF4B26\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.4103 7.42071C19.7736 7.71996 20.3017 7.69836 20.6344 7.36559L23.2195 4.78051C23.597 4.40295 23.5701 3.78492 23.1668 3.43503C20.6996 1.29456 17.4894 0 14 0V5.47827C16.0524 5.47827 17.9378 6.20758 19.4103 7.42071Z\",\n fill: \"#D93F21\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgGoogle);\nexport default __webpack_public_path__ + \"static/media/google.6253d1f86d59e2b044de97f9dd1c5879.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgShopify(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 28,\n height: 28,\n viewBox: \"0 0 28 28\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_705_19431)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.2878 5.39162C23.2684 5.25025 23.1446 5.17205 23.0425 5.16351C22.9404 5.15498 20.9472 5.12469 20.9472 5.12469C20.9472 5.12469 19.2803 3.50577 19.1156 3.341C18.951 3.17622 18.6293 3.22621 18.5045 3.26296C18.5026 3.26351 18.1916 3.35981 17.6668 3.52229C17.5793 3.2378 17.4501 2.8884 17.266 2.53731C16.6724 1.40506 15.8035 0.805739 14.7532 0.804208C14.752 0.804208 14.7509 0.804208 14.7497 0.804208C14.6769 0.804208 14.6043 0.811044 14.5317 0.817661C14.5008 0.780474 14.4696 0.743614 14.4367 0.70845C13.9795 0.219052 13.3923 -0.0193861 12.6895 0.00123114C11.3328 0.040114 9.98245 1.01973 8.88711 2.75945C8.11607 3.9839 7.53031 5.5221 7.36374 6.71259C5.80635 7.19488 4.7167 7.53236 4.69313 7.53974C3.907 7.78644 3.88228 7.81116 3.77919 8.55179C3.70115 9.1125 1.64441 25.0188 1.64441 25.0188L18.8838 27.9999L26.3554 26.1428C26.3554 26.1428 23.3071 5.53298 23.2878 5.39162ZM8.32952 6.41345C8.79567 4.23383 10.622 0.963896 12.7156 0.903685C13.0341 0.897013 13.3024 0.966903 13.5314 1.11768C13.165 1.30793 12.8106 1.58137 12.4782 1.93793C11.6165 2.86226 10.9565 4.29748 10.6933 5.68146C9.87187 5.93581 9.06857 6.18459 8.32952 6.41345ZM14.5636 4.48309C13.6605 4.76271 12.6745 5.06803 11.6854 5.37428C11.9639 4.30908 12.491 3.24852 13.1387 2.55372C13.3796 2.29526 13.7167 2.00684 14.1158 1.84218C14.4913 2.62459 14.5726 3.73376 14.5636 4.48309ZM15.4654 4.20386C15.4554 3.51693 15.3733 2.56148 15.0533 1.73554C16.0826 1.93055 16.5894 3.09518 16.8033 3.7896C16.4066 3.91237 15.9548 4.05226 15.4654 4.20386Z\",\n fill: \"#95BF47\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.0424 5.16337C22.9403 5.15484 20.9472 5.12454 20.9472 5.12454C20.9472 5.12454 19.2803 3.50563 19.1156 3.34085C19.0542 3.27938 18.9709 3.24794 18.8842 3.23438L18.8846 27.9996L26.3553 26.1426C26.3553 26.1426 23.3071 5.53284 23.2877 5.39147C23.2683 5.2501 23.1445 5.1719 23.0424 5.16337Z\",\n fill: \"#5E8E3E\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.7433 9.00664L13.8755 12.2529C13.8755 12.2529 12.9075 11.8122 11.7599 11.8846C10.0772 11.9909 10.0593 13.0523 10.0761 13.3183C10.1678 14.7702 13.9873 15.0875 14.202 18.488C14.3709 21.1635 12.7829 22.9935 10.4947 23.138C7.74888 23.3114 6.23694 21.6911 6.23694 21.6911L6.81876 19.2157C6.81876 19.2157 8.34033 20.3637 9.55833 20.2868C10.3539 20.2366 10.6382 19.5895 10.6093 19.1319C10.4897 17.2379 7.37953 17.3495 7.18303 14.2376C7.01766 11.6185 8.73747 8.96524 12.5323 8.7256C13.9945 8.63334 14.7433 9.00664 14.7433 9.00664Z\",\n fill: \"white\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_705_19431\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 28,\n height: 28,\n fill: \"white\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgShopify);\nexport default __webpack_public_path__ + \"static/media/shopify.d3b43f06c3e0ecbe68d4c7cd49d4c583.svg\";\nexport { ForwardRef as ReactComponent };","var _g;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgWeb(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_3\",\n height: 30,\n viewBox: \"0 0 52 52\",\n width: 30,\n xmlns: \"http://www.w3.org/2000/svg\",\n \"data-name\": \"Layer 3\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#037ca9\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m21.213 13.925a13.063 13.063 0 0 0 -6.734 6.075h4.167a16.756 16.756 0 0 1 2.567-6.075z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m18 26a28.351 28.351 0 0 1 .286-4h-4.65a12.9 12.9 0 0 0 0 8h4.65a28.351 28.351 0 0 1 -.286-4z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m31.3 20c-1.077-4.338-3.239-7-5.3-7s-4.227 2.662-5.3 7z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m20 26a26.651 26.651 0 0 0 .294 4h11.412a27.358 27.358 0 0 0 0-8h-11.412a26.651 26.651 0 0 0 -.294 4z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m14.479 32a13.063 13.063 0 0 0 6.734 6.075 16.756 16.756 0 0 1 -2.567-6.075z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m34 26a28.351 28.351 0 0 1 -.286 4h4.65a12.9 12.9 0 0 0 0-8h-4.65a28.351 28.351 0 0 1 .286 4z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m26 2a24 24 0 1 0 24 24 24.028 24.028 0 0 0 -24-24zm0 39a15 15 0 1 1 15-15 15.017 15.017 0 0 1 -15 15z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m20.7 32c1.077 4.338 3.239 7 5.3 7s4.227-2.662 5.3-7z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m30.787 13.925a16.756 16.756 0 0 1 2.567 6.075h4.167a13.063 13.063 0 0 0 -6.734-6.075z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m30.787 38.075a13.063 13.063 0 0 0 6.734-6.075h-4.167a16.756 16.756 0 0 1 -2.567 6.075z\"\n }))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgWeb);\nexport default __webpack_public_path__ + \"static/media/WEB.660a33dcdf854edfb1d4a86b970abdc7.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgSms(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 30,\n height: 27,\n viewBox: \"0 0 30 27\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.5 21L6 27V17.25L15 12L13.5 21Z\",\n fill: \"#4CB580\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26.25 22.5H3.75C2.09325 22.5 0.75 21.1568 0.75 19.5V3C0.75 1.34325 2.09325 0 3.75 0H26.25C27.9067 0 29.25 1.34325 29.25 3V19.5C29.25 21.1568 27.9067 22.5 26.25 22.5Z\",\n fill: \"#4CB580\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 13.5C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.1716 15.8284 10.5 15 10.5C14.1716 10.5 13.5 11.1716 13.5 12C13.5 12.8284 14.1716 13.5 15 13.5Z\",\n fill: \"white\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21 13.5C21.8284 13.5 22.5 12.8284 22.5 12C22.5 11.1716 21.8284 10.5 21 10.5C20.1716 10.5 19.5 11.1716 19.5 12C19.5 12.8284 20.1716 13.5 21 13.5Z\",\n fill: \"white\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 13.5C9.82842 13.5 10.5 12.8284 10.5 12C10.5 11.1716 9.82842 10.5 9 10.5C8.17157 10.5 7.5 11.1716 7.5 12C7.5 12.8284 8.17157 13.5 9 13.5Z\",\n fill: \"white\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgSms);\nexport default __webpack_public_path__ + \"static/media/sms.ae2eeec8b019346a1bf67b52a66efe8b.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11, _path12;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgWebsite(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30 2.69531C30 1.23908 28.8195 0.0585938 27.3633 0.0585938H2.63672C1.18049 0.0585938 0 1.23908 0 2.69531V7.96875L0.585938 8.55469H29.4141C29.6429 8.32588 29.7712 8.19756 30 7.96875V2.69531Z\",\n fill: \"#0052C2\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30 2.69531V7.96875C29.7709 8.19785 29.6432 8.32559 29.4141 8.55469H15V0.0585938H27.3633C28.8193 0.0585938 30 1.23926 30 2.69531Z\",\n fill: \"#003481\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.5469 3.57422H20.2734C19.788 3.57422 19.3945 3.96773 19.3945 4.45312C19.3945 4.93852 19.788 5.33203 20.2734 5.33203H25.5469C26.0323 5.33203 26.4258 4.93852 26.4258 4.45312C26.4258 3.96773 26.0323 3.57422 25.5469 3.57422Z\",\n fill: \"#0052C2\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.4844 5.33203C11.9698 5.33203 12.3633 4.93853 12.3633 4.45312C12.3633 3.96772 11.9698 3.57422 11.4844 3.57422C10.999 3.57422 10.6055 3.96772 10.6055 4.45312C10.6055 4.93853 10.999 5.33203 11.4844 5.33203Z\",\n fill: \"#F03800\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.96875 5.33203C8.45416 5.33203 8.84766 4.93853 8.84766 4.45312C8.84766 3.96772 8.45416 3.57422 7.96875 3.57422C7.48334 3.57422 7.08984 3.96772 7.08984 4.45312C7.08984 4.93853 7.48334 5.33203 7.96875 5.33203Z\",\n fill: \"#FDBF00\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4.45312 5.33203C4.93853 5.33203 5.33203 4.93853 5.33203 4.45312C5.33203 3.96772 4.93853 3.57422 4.45312 3.57422C3.96772 3.57422 3.57422 3.96772 3.57422 4.45312C3.57422 4.93853 3.96772 5.33203 4.45312 5.33203Z\",\n fill: \"#37D742\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 7.96875V27.3047C0 28.7586 1.18283 29.9414 2.63672 29.9414H27.3633C28.8172 29.9414 30 28.7586 30 27.3047V7.96875H0Z\",\n fill: \"#E0F4FF\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30 7.96875V27.3047C30 28.7584 28.817 29.9414 27.3633 29.9414H15V7.96875H30Z\",\n fill: \"#B8E0F5\"\n })), _path9 || (_path9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.9829 11.5557C17.5368 11.3645 17.0201 11.5711 16.8289 12.0173L11.5554 24.3219C11.3642 24.7681 11.5709 25.2848 12.017 25.476C12.4633 25.6673 12.98 25.4604 13.1711 25.0144L18.4445 12.7097C18.6358 12.2635 18.4291 11.7468 17.9829 11.5557Z\",\n fill: \"#FF641A\"\n })), _path10 || (_path10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.4447 12.7098L15 20.7477V16.284L16.8287 12.0172C17.0203 11.5713 17.5365 11.3645 17.983 11.5555C18.4289 11.7471 18.6357 12.2633 18.4447 12.7098Z\",\n fill: \"#F03800\"\n })), _path11 || (_path11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.2756 21.3449L6.739 18.5156L10.2756 15.6863C10.6547 15.3831 10.7161 14.83 10.4129 14.451C10.1096 14.0719 9.55642 14.0105 9.17756 14.3137L4.78302 17.8294C4.34363 18.1807 4.34334 18.8503 4.78302 19.202L9.17756 22.7176C9.5566 23.0209 10.1098 22.9593 10.4129 22.5804C10.7161 22.2012 10.6547 21.6481 10.2756 21.3449Z\",\n fill: \"#FF641A\"\n })), _path12 || (_path12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.217 17.8294L20.8225 14.3138C20.4435 14.0105 19.8903 14.0719 19.5872 14.451C19.2839 14.83 19.3454 15.3832 19.7245 15.6863L23.2611 18.5157L19.7245 21.345C19.3454 21.6482 19.2839 22.2013 19.5872 22.5803C19.8908 22.9598 20.444 23.0205 20.8225 22.7176L25.217 19.2019C25.6564 18.8506 25.6567 18.1811 25.217 17.8294Z\",\n fill: \"#F03800\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgWebsite);\nexport default __webpack_public_path__ + \"static/media/website.9f9dbde6903594b67755d40e21f855c9.svg\";\nexport { ForwardRef as ReactComponent };","var _g, _defs;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgZendesk(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 18,\n viewBox: \"0 0 24 18\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_705_19440)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.087 4.75172V17.9974H0L11.087 4.75172ZM11.087 0C11.087 3.02706 8.60881 5.47913 5.54946 5.47913C2.49011 5.47913 0 3.02706 0 0H11.087ZM12.9133 17.9979C12.9133 14.9708 15.3915 12.5187 18.4509 12.5187C21.5102 12.5187 23.9885 14.9708 23.9885 17.9979H12.9133ZM12.9133 13.2462V0H24L12.9133 13.2462Z\",\n fill: \"#03363D\"\n }))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_705_19440\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 24,\n height: 18,\n fill: \"white\"\n })))));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgZendesk);\nexport default __webpack_public_path__ + \"static/media/zendesk.8744eba6fa54349ed6ec327b2cdca6b0.svg\";\nexport { ForwardRef as ReactComponent };","var _defs, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgWts(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n \"data-name\": \"Layer 1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 240 241.19\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".cls-1{fill:#25d366;fill-rule:evenodd;}\"))), title === undefined ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, \"whatsapp-color\") : title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n className: \"cls-1\",\n d: \"M205,35.05A118.61,118.61,0,0,0,120.46,0C54.6,0,1,53.61,1,119.51a119.5,119.5,0,0,0,16,59.74L0,241.19l63.36-16.63a119.43,119.43,0,0,0,57.08,14.57h0A119.54,119.54,0,0,0,205,35.07v0ZM120.5,219A99.18,99.18,0,0,1,69.91,205.1l-3.64-2.17-37.6,9.85,10-36.65-2.35-3.76A99.37,99.37,0,0,1,190.79,49.27,99.43,99.43,0,0,1,120.49,219ZM175,144.54c-3-1.51-17.67-8.71-20.39-9.71s-4.72-1.51-6.75,1.51-7.72,9.71-9.46,11.72-3.49,2.27-6.45.76-12.63-4.66-24-14.84A91.1,91.1,0,0,1,91.25,113.3c-1.75-3-.19-4.61,1.33-6.07s3-3.48,4.47-5.23a19.65,19.65,0,0,0,3-5,5.51,5.51,0,0,0-.24-5.23C99,90.27,93,75.57,90.6,69.58s-4.89-5-6.73-5.14-3.73-.09-5.7-.09a11,11,0,0,0-8,3.73C67.48,71.05,59.75,78.3,59.75,93s10.69,28.88,12.19,30.9S93,156.07,123,169c7.12,3.06,12.68,4.9,17,6.32a41.18,41.18,0,0,0,18.8,1.17c5.74-.84,17.66-7.21,20.17-14.18s2.5-13,1.75-14.19-2.69-2.06-5.7-3.59l0,0Z\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgWts);\nexport default __webpack_public_path__ + \"static/media/wts.e1dd3eafcb5d42f2ee8f0e7b23638679.svg\";\nexport { ForwardRef as ReactComponent };","import { patchDittoConfig } from \"action/WorkbenchAction\";\nimport { CXSwitch } from \"component/Switch\";\nimport React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\n\nconst HeaderComponent = ({ data, icon }) => {\n const { configChannels } = useSelector((state) => state.WrokbenchReducer);\n const dispatch = useDispatch();\n const { id } = useParams();\n const updateConfig = (val) => {\n let mds = configChannels?.mds || [];\n if (mds.includes(val)) {\n mds = mds.filter((item) => item !== val);\n } else {\n mds.push(val);\n }\n dispatch(\n patchDittoConfig({\n id,\n mds,\n })\n );\n };\n return (\n
\n
\n
\n
\n \n
\n
\n
{data.name}
\n
{data.description}
\n
\n
\n {/* {icon &&
Check
} */}\n {/* {[\"Website\", \"Facebook\", \"Whatsapp\"].includes(data.name) && (\n
\n updateConfig(data?.config, val)}\n />\n
\n )} */}\n
\n
\n
\n );\n};\n\nexport default HeaderComponent;\n","var _path, _path2, _path3, _path4, _path5, _path6;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgSmsSelector(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 13C9.55228 13 10 12.5523 10 12C10 11.4477 9.55228 11 9 11C8.44772 11 8 11.4477 8 12C8 12.5523 8.44772 13 9 13Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 13C15.5523 13 16 12.5523 16 12C16 11.4477 15.5523 11 15 11C14.4477 11 14 11.4477 14 12C14 12.5523 14.4477 13 15 13Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 6C9.55228 6 10 5.55228 10 5C10 4.44772 9.55228 4 9 4C8.44772 4 8 4.44772 8 5C8 5.55228 8.44772 6 9 6Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 6C15.5523 6 16 5.55228 16 5C16 4.44772 15.5523 4 15 4C14.4477 4 14 4.44772 14 5C14 5.55228 14.4477 6 15 6Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 20C9.55228 20 10 19.5523 10 19C10 18.4477 9.55228 18 9 18C8.44772 18 8 18.4477 8 19C8 19.5523 8.44772 20 9 20Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z\",\n stroke: \"#979797\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgSmsSelector);\nexport default __webpack_public_path__ + \"static/media/smsSelector.960c68a2ec985ba51ccd5afbaa12a703.svg\";\nexport { ForwardRef as ReactComponent };","import { CXInput } from \"component/Input\";\nimport React, { Fragment, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport { ReactComponent as Selector } from \"./images/smsSelector.svg\";\nimport \"./Style.css\";\nimport { CXSwitch } from \"component/Switch\";\nimport { useDispatch } from \"react-redux\";\nimport { patchConfig } from \"action/AdminActions\";\nimport { useParams } from \"react-router-dom\";\nimport { generateUniqueKey } from \"utils\";\n\nconst SmsComp = ({ data }) => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const [Data, setData] = useState(allConfigData);\n const searchHandler = (value) => {\n if (value?.length > 0) {\n let filterData = Data.filter((item) => {\n if (item.configSms) {\n return item.configSms.number\n .toLowerCase()\n .includes(value.toLowerCase());\n }\n });\n setData(filterData);\n } else {\n setData(allConfigData);\n }\n };\n\n const updateConfig = (_id, val) => {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n dispatch(patchConfig(obj, _id));\n };\n return (\n \n \n
\n
\n searchHandler(event.target.value)}\n prefix={\"search\"}\n />\n
\n
\n
NUMBER
\n
STATUS
\n
\n {Data?.map((res, index) => {\n if (res.md === \"sms\") {\n return (\n
\n
\n \n {`${res?.configSms?.areaCode}-${res?.configSms?.number}`}\n
\n
\n updateConfig(res._id, val)}\n />\n
\n
\n );\n }\n })}\n
\n
\n );\n};\n\nexport default SmsComp;\n","import { CXInput } from \"component/Input\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { Fragment, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport { ReactComponent as Selector } from \"./images/smsSelector.svg\";\nimport { useDispatch } from \"react-redux\";\nimport { patchConfig } from \"action/AdminActions\";\nimport { useParams } from \"react-router-dom\";\nimport { generateUniqueKey } from \"utils\";\nconst EmailComp = ({ data }) => {\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { id } = useParams();\n const [Data, setData] = useState(allConfigData);\n const searchHandler = (value) => {\n if (value?.length > 0) {\n let filterData = Data.filter((item) => {\n if (item.configEmail) {\n return item.configEmail.email\n .toLowerCase()\n .includes(value.toLowerCase());\n }\n });\n setData(filterData);\n } else {\n setData(allConfigData);\n }\n };\n const updateConfig = (_id, val) => {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n dispatch(patchConfig(obj, _id));\n };\n return (\n \n \n
\n
\n searchHandler(event.target.value)}\n prefix={\"search\"}\n />\n
\n
\n
EMAIL
\n
STATUS
\n
\n {Data?.map((res) => {\n if (res.md === \"email\") {\n return (\n
\n
\n \n {`${res?.configEmail?.email}`}\n
\n
\n updateConfig(res._id, val)}\n />\n
\n
\n );\n }\n })}\n
\n
\n );\n};\n\nexport default EmailComp;\n","import React from \"react\";\n\nconst StatusComponent = ({ data, Status }) => {\n return (\n
\n
\n
\n \n
\n
\n {Status} your account\n
\n
\n
\n );\n};\n\nexport default StatusComponent;\n","import { CXSwitch } from \"component/Switch\";\nimport React, { Fragment } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport { ReactComponent as Selector } from \"./images/smsSelector.svg\";\nimport StatusComponent from \"./StatusComponent\";\nimport { patchConfig } from \"action/AdminActions\";\nimport { useParams } from \"react-router-dom\";\nimport { generateUniqueKey } from \"utils\";\nconst FacebookComp = ({ data }) => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const updateConfig = (_id, val) => {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n dispatch(patchConfig(obj, _id));\n };\n return (\n \n \n {!allConfigData.some((data) => data.md === \"facebook\") && (\n \n )}\n {allConfigData.some((data) => data.md === \"facebook\") && (\n
\n
\n
USERID
\n
STATUS
\n
\n {allConfigData?.map((res) => {\n if (res.md === \"facebook\") {\n return (\n
\n
\n \n {`${res?.configFb?.userId}`}\n
\n
\n updateConfig(res._id, val)}\n />\n
\n
\n );\n }\n })}\n
\n )}\n
\n );\n};\n\nexport default FacebookComp;\n","import React, { Fragment } from \"react\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport StatusComponent from \"./StatusComponent\";\n\nconst GoogleComp = ({ data }) => {\n return (\n \n \n \n \n );\n};\n\nexport default GoogleComp;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport StatusComponent from \"./StatusComponent\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport {\n getConnectedBot,\n getIntegrationShopify,\n patchConfig,\n} from \"action/AdminActions\";\nimport { useParams } from \"react-router-dom\";\nimport { CXInput } from \"component/Input\";\nimport { ReactComponent as Selector } from \"./images/smsSelector.svg\";\nimport { CXSwitch } from \"component/Switch\";\nimport { truncateSt } from \"utils\";\nimport { CXLottie } from \"component/Lottie\";\nimport history from \"utils/history\";\nimport { CXButton } from \"component/Button\";\nimport { CXTag } from \"component/Tag\";\nimport { CXPopover } from \"component/Popover\";\nimport { InfoCircleOutlined, LoadingOutlined } from \"@ant-design/icons\";\n\nconst ShopifyComp = ({ data }) => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const { ShopifyIntegration, storeSettings, Loading, ConnectedBot } =\n useSelector((state) => state.AdminReducer);\n const [loading, setloading] = useState(false);\n const [Data, setData] = useState(null);\n const [open, setopen] = useState(null);\n const updateConfig = (_id, val) => {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n dispatch(patchConfig(obj, _id));\n };\n const searchHandler = (value) => {\n if (value?.length > 0) {\n let filterData = Data?.filter((item) => {\n return item?.dtls?.name.toLowerCase()?.includes(value?.toLowerCase());\n });\n setData(filterData);\n } else {\n setData(ShopifyIntegration);\n }\n };\n useEffect(() => {\n dispatch(getIntegrationShopify({ provider: \"shopify\" }));\n }, []);\n useEffect(() => {\n setData(ShopifyIntegration);\n }, [ShopifyIntegration]);\n const deepLink = (data) => {\n // open shopify app editor\n window.open(\n `https://${data.dtls.domain}/admin/themes/current/editor?context=apps&activateAppId=${process.env.REACT_APP_ActivateAppId}/app-embed`\n );\n };\n const ConnectedBotCheck = (id) => {\n return loading ? (\n
\n \n
\n ) : (\n
\n The account is engaged by bot{\" \"}\n {ConnectedBot?.botDetails?.name}.\n Please unlink from the bot first to use this account elsewhere.\n
\n );\n };\n const handleOpenChange = (id, val) => {\n if (val) {\n setloading(true);\n dispatch(getConnectedBot(id));\n setopen(id);\n } else {\n setopen(null);\n }\n };\n useEffect(() => {\n setloading(false);\n }, [ConnectedBot]);\n const checkLink = (res) => {\n if (res?.botConf?.dittoId === id && res?.botConf?.isActive) {\n return false;\n } else {\n return true;\n }\n };\n return (\n \n \n {!Loading && ShopifyIntegration?.length === 0 && (\n
history(\"/admin/admin/Integration/Shopify\")}>\n \n
\n )}\n {Loading && ShopifyIntegration?.length === 0 && (\n \n )}\n {ShopifyIntegration?.length > 0 && (\n
\n
\n searchHandler(event.target.value)}\n prefix={\"search\"}\n />\n
\n
\n
WHATSAPP
\n
\n
APP EXTENSION
\n
STATUS
\n
\n
\n {Data?.map((res) => {\n return (\n
\n
\n \n {res?.dtls?.name}\n
\n {truncateSt(res?.dtls?.domain, 40)}\n
\n
\n\n
\n
\n deepLink(res)}\n >\n LINK\n \n
\n
\n {!res?.botConf ? (\n
\n updateConfig(res._id, val)}\n />\n
\n ) : res?.botConf?.dittoId &&\n res?.botConf?.dittoId !== id ? (\n
\n Engaged\n handleOpenChange(res._id, val)}\n content={ConnectedBotCheck()}\n >\n \n \n
\n ) : (\n
\n updateConfig(res._id, val)}\n />\n
\n )}\n
\n
\n
\n );\n })}\n
\n )}\n
\n );\n};\n\nexport default ShopifyComp;\n","import React, { Fragment } from \"react\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport StatusComponent from \"./StatusComponent\";\n\nconst ZendeskComp = ({ data }) => {\n return (\n \n \n \n \n );\n};\n\nexport default ZendeskComp;\n","import { getConnectedBot } from \"action/AdminActions\";\nimport { CXInput } from \"component/Input\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport { ReactComponent as Selector } from \"./images/smsSelector.svg\";\nimport { useDispatch } from \"react-redux\";\nimport { patchConfig } from \"action/AdminActions\";\nimport { useParams } from \"react-router-dom\";\nimport { CXTag } from \"component/Tag\";\nimport { InfoCircleOutlined, LoadingOutlined } from \"@ant-design/icons\";\nimport { CXPopover } from \"component/Popover\";\nconst WhatsAppComp = ({ data }) => {\n const dispatch = useDispatch();\n const { allConfigData, ConnectedBot } = useSelector(\n (state) => state.AdminReducer\n );\n const [loading, setloading] = useState(false);\n const [open, setopen] = useState(null);\n const { id } = useParams();\n const [Data, setData] = useState(allConfigData);\n const searchHandler = (value) => {\n if (value?.length > 0) {\n let filterData = Data.filter((item) => {\n if (item.configWp) {\n return item.configWp.senderId\n .toLowerCase()\n .includes(value.toLowerCase());\n }\n });\n setData(filterData);\n } else {\n setData(allConfigData);\n }\n };\n const updateConfig = (_id, val) => {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n dispatch(patchConfig(obj, _id));\n };\n\n const ConnectedBotCheck = (id) => {\n return loading ? (\n
\n \n
\n ) : (\n
\n The account is engaged by bot{\" \"}\n {ConnectedBot?.botDetails?.name}.\n Please unlink from the bot first to use this account elsewhere.\n
\n );\n };\n const handleOpenChange = (id, val) => {\n if (val) {\n setloading(true);\n dispatch(getConnectedBot(id));\n setopen(id);\n } else {\n setopen(null);\n }\n };\n useEffect(() => {\n setloading(false);\n }, [ConnectedBot]);\n return (\n \n \n
\n
\n searchHandler(event.target.value)}\n prefix={\"search\"}\n />\n
\n
\n
WHATSAPP
\n
STATUS
\n
\n {Data?.map((res) => {\n if (res.md === \"whatsapp\") {\n return (\n
\n
\n \n {`${res.configWp?.senderId}`}\n
\n
\n {!res?.botConf?.isActive ? (\n updateConfig(res._id, val)}\n />\n ) : res?.botConf.dittoId !== id ? (\n
\n Engaged\n handleOpenChange(res._id, val)}\n content={ConnectedBotCheck()}\n >\n \n \n
\n ) : (\n updateConfig(res._id, val)}\n />\n )}\n
\n
\n );\n }\n })}\n
\n
\n );\n};\n\nexport default WhatsAppComp;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport HeaderComponent from \"./HeaderComponent\";\nimport { CXSwitch } from \"component/Switch\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { WebAccountCreateAction, patchConfig } from \"action/AdminActions\";\n\nconst Web = ({ data }) => {\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { id } = useParams();\n const [webActive, setwebActive] = useState(false);\n useEffect(() => {\n if (allConfigData?.length > 0) {\n let webData = allConfigData.find((item) => item.md === \"web\");\n if (webData && webData?.botConf?.isActive) {\n setwebActive(webData?.botConf?.isActive);\n }\n }\n }, [allConfigData]);\n const enableWebChat = (val) => {\n setwebActive(val);\n if (allConfigData.find((item) => item.md === \"web\")) {\n let obj = {\n isActive: val,\n dittoId: id,\n };\n let wId = allConfigData.find((item) => item.md === \"web\")._id;\n dispatch(patchConfig(obj, wId));\n } else {\n dispatch(WebAccountCreateAction({ dittoId: id }));\n }\n };\n return (\n \n \n
\n {\n enableWebChat(c);\n }}\n />\n Enable web account for communication\n
\n
\n );\n};\n\nexport default Web;\n","import React, { Fragment, useState, useEffect } from \"react\";\nimport { ReactComponent as FacebookIcon } from \"./images/facebook.svg\";\nimport { ReactComponent as GmailIcon } from \"./images/gmail.svg\";\nimport { ReactComponent as GoogleIcon } from \"./images/google.svg\";\nimport { ReactComponent as ShopifyIcon } from \"./images/shopify.svg\";\nimport { ReactComponent as WebIcon } from \"./images/WEB.svg\";\nimport { ReactComponent as SmsIcon } from \"./images/sms.svg\";\nimport { ReactComponent as WebsiteIcon } from \"./images/website.svg\";\nimport { ReactComponent as ZendexIcon } from \"./images/zendesk.svg\";\nimport { ReactComponent as Wtsapp } from \"./images/wts.svg\";\nimport SMS from \"./SmsComp\";\nimport Email from \"./EmailComp\";\nimport Facebook from \"./FacebookComp\";\nimport Google from \"./GoogleComp\";\nimport Shopify from \"./ShopifyComp\";\nimport Zendesk from \"./ZendeskComp\";\nimport Whatsapp from \"./WhatsAppComp\";\nimport Web from \"./Web\";\nimport { CXRow } from \"component/Row\";\nimport { CXCol } from \"component/Col\";\nimport { useDispatch } from \"react-redux\";\nimport { GetAllConfig } from \"action/AdminActions\";\nimport \"./Style.css\";\nimport { SET_ACTIVE_STEPPER } from \"constant\";\nimport { getBotDetailsById } from \"action/WorkbenchAction\";\nimport { useParams } from \"react-router-dom\";\n\nconst Index = () => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const Maptabs = [\n {\n name: \"Web\",\n icon: WebIcon,\n description: \"Connect your web account\",\n },\n // {\n // name: \"Website\",\n // icon: WebsiteIcon,\n // description: \"Embed into your website\",\n // config: \"web\",\n // },\n // {\n // name: \"SMS\",\n // icon: SmsIcon,\n // description: \"Configure your SMS numbers\",\n // },\n // {\n // name: \"Email\",\n // icon: GmailIcon,\n // description: \"Configure your email\",\n // },\n {\n name: \"Facebook\",\n icon: FacebookIcon,\n description: \"Connect your facebook account\",\n config: \"facebook\",\n },\n {\n name: \"Whatsapp\",\n icon: Wtsapp,\n description: \"Connect your whatsapp account\",\n config: \"whatsapp\",\n },\n // {\n // name: \"Google\",\n // icon: GoogleIcon,\n // description: \"Connect your google account\",\n // },\n {\n name: \"Shopify\",\n icon: ShopifyIcon,\n description: \"Connect your shopify account\",\n },\n // {\n // name: \"Zendesk\",\n // icon: ZendexIcon,\n // description: \"Connect your shopify account\",\n // },\n ];\n const [Active, setActive] = useState(Maptabs[0]);\n const Componentlist = {\n // Website,\n Web,\n SMS,\n Email,\n Facebook,\n Google,\n Shopify,\n Zendesk,\n Whatsapp,\n };\n const renderComponent = (val) => {\n const Component = Componentlist[val.name];\n return ;\n };\n\n useEffect(() => {\n dispatch(GetAllConfig());\n dispatch(getBotDetailsById(id));\n dispatch({ type: SET_ACTIVE_STEPPER, data: \"Configure\" });\n }, []);\n return (\n \n \n \n
Configure Platforms
\n
\n {Maptabs.map((res) => {\n return (\n setActive(res)}\n >\n {\" \"}\n {res.name}\n \n );\n })}\n
\n
\n \n
{renderComponent(Active)}
\n
\n \n
\n );\n};\n\nexport default Index;\n","import React from \"react\";\nimport { CXRow } from \"component/Row\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { updateConvNode } from \"action/WorkbenchAction\";\nimport \"../index.css\";\nimport { GET_ALL_CONVERSATION_BY_IDS } from \"constant\";\nimport { CXButton } from \"component/Button\";\n\nexport const WidgetFooter = ({\n ActiveNodeType,\n node,\n ActiveLang,\n ErrorEnable,\n retryUnit,\n ErrorNodeType,\n RatingType,\n ListName,\n useNum,\n updateContact,\n}) => {\n const dispatch = useDispatch();\n const handleOnClickSave = () => {\n const { type, id, ...rest } = node;\n rest.qType = type;\n rest._id = id;\n let Content = node?.convNodeContent.filter(\n (data) => data.lang === ActiveLang\n );\n let mutatedContent = JSON.parse(JSON.stringify(Content));\n mutatedContent[0].content = ActiveNodeType ? ActiveNodeType : [];\n rest.convNodeContent = mutatedContent;\n if (node.type === \"button\") {\n const index = Content[0].content.findIndex(\n (item) => item.name === \"button\"\n );\n if (rest.convNodeContent[0].content[index].name !== \"button\") {\n dispatch({\n type: GET_ALL_CONVERSATION_BY_IDS,\n data: [],\n });\n }\n }\n if (ErrorEnable) {\n rest.onError = {\n errContent: ErrorNodeType ? ErrorNodeType : [],\n retry: retryUnit,\n };\n } else {\n rest.onError = {};\n }\n if (updateContact) {\n rest.updateContact = updateContact;\n }\n dispatch(updateConvNode(rest));\n };\n return (\n
\n \n handleOnClickSave()}>\n Save\n \n \n
\n );\n};\n\nexport default WidgetFooter;\n","import React from \"react\";\nimport \"../index.css\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { useSelector } from \"react-redux\";\n\nexport const WidgetVariable = ({ node }) => {\n const handleChange = (data) => {\n let UpdatedData = data.map((res) => {\n return { name: res, dataType: \"string\" };\n });\n node.nodeContext = UpdatedData;\n };\n return (\n
\n
Save answers in the variable
\n
\n
{`{{`}
\n
\n rs.name)}\n >\n {node?.nodeContext?.map((rs) => {\n return {rs.name};\n })}\n \n
\n\n
{`}}`}
\n
\n
\n );\n};\n\nexport default WidgetVariable;\n","import React from \"react\";\nimport { imageMapper } from \"../../../../ImageMapper\";\n\nconst Heading = ({ heading }) => {\n return (\n
\n \n {heading}\n
\n );\n};\n\nexport default Heading;\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n // TODO: get all emoji style\n const allEmojiStyle = {};\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n const style = allEmojiStyle[emoji];\n\n if (!style) return;\n\n text = replaceAll(\n text,\n emoji,\n ``\n );\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// /**\n// * Get all emoji stlye from emoji mart\n// * @return {Object.}\n// */\n// function getAllEmojiStyle() {\n// /** @type {NodeListOf} */\n// const allEmojiButton = Array.prototype.slice.call(\n// document.querySelectorAll(\".emoji-mart-category-list > li > button\")\n// );\n\n// /** @type {Object.} */\n// const allEmojiStyle = {};\n\n// allEmojiButton.forEach(emojiButton => {\n// const label = emojiButton.getAttribute(\"aria-label\");\n// const [emoji] = label.split(\",\");\n\n// const emojiSpanEl = emojiButton.querySelector(\"span\");\n\n// const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n// allEmojiStyle[emoji] = style;\n// });\n\n// return allEmojiStyle;\n// }\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n let shortNames = `${emoji.short_names}`;\n\n shortNames = replaceAll(shortNames, \",\", \", \");\n\n /** @type {HTMLSpanElement} */\n const emojiSpanEl =\n document.querySelector(\n `[aria-label=\"${emoji.native}, ${shortNames}\"] > span`\n ) || document.querySelector(`[aria-label=\"${emoji.id}\"] > span`);\n\n if (!emojiSpanEl) return \"\";\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n let dataEmoji = emoji.native;\n\n if (!dataEmoji && emoji.emoticons && emoji.emoticons.length > 0) {\n dataEmoji = emoji.emoticons[0];\n }\n\n return ``;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject} cleanedTextRef\n * @property {React.MutableRefObject} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/ void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject} cleanedTextRef\n * @param {React.MutableRefObject} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef\n) {\n return event => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return event => {\n onFocus(event);\n };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useSanitize() {\n /** @type {React.MutableRefObject} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result);\n\n sanitizedTextRef.current = result;\n\n return result;\n }, []);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllHtmlToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n let text = container.innerText || \"\";\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef } from \"react\";\nimport { handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {React.CSSProperties} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && textInputRef.current.innerHTML.trim() === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n if (value.trim() === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.MutableRefObject} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current) {\n if (input?.innerText?.trim() === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n
\n
\n
\n {placeholder}\n
\n \n
\n
\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement }) {\n const buttonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n buttonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n \n {!showCustomButtonContent && (\n \n {/* eslint-disable-next-line max-len */}\n \n {/* eslint-disable-next-line max-len */}\n \n \n )}\n \n );\n}\n\nexport default EmojiPickerButton;\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}","function _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, descriptor.key, descriptor);\n }\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 _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}","var mapping = {\n name: 'a',\n unified: 'b',\n non_qualified: 'c',\n has_img_apple: 'd',\n has_img_google: 'e',\n has_img_twitter: 'f',\n has_img_facebook: 'h',\n keywords: 'j',\n sheet: 'k',\n emoticons: 'l',\n text: 'm',\n short_names: 'n',\n added_in: 'o'\n};\n\nvar buildSearch = function buildSearch(emoji) {\n var search = [];\n\n var addToSearch = function addToSearch(strings, split) {\n if (!strings) {\n return;\n }\n\n ;\n (Array.isArray(strings) ? strings : [strings]).forEach(function (string) {\n ;\n (split ? string.split(/[-|_|\\s]+/) : [string]).forEach(function (s) {\n s = s.toLowerCase();\n\n if (search.indexOf(s) == -1) {\n search.push(s);\n }\n });\n });\n };\n\n addToSearch(emoji.short_names, true);\n addToSearch(emoji.name, true);\n addToSearch(emoji.keywords, false);\n addToSearch(emoji.emoticons, false);\n return search.join(',');\n};\n\nvar compress = function compress(emoji) {\n emoji.short_names = emoji.short_names.filter(function (short_name) {\n return short_name !== emoji.short_name;\n });\n delete emoji.short_name;\n emoji.sheet = [emoji.sheet_x, emoji.sheet_y];\n delete emoji.sheet_x;\n delete emoji.sheet_y;\n emoji.added_in = parseInt(emoji.added_in);\n\n if (emoji.added_in === 6) {\n delete emoji.added_in;\n }\n\n for (var key in mapping) {\n emoji[mapping[key]] = emoji[key];\n delete emoji[key];\n }\n\n for (var _key in emoji) {\n var value = emoji[_key];\n\n if (Array.isArray(value) && !value.length) {\n delete emoji[_key];\n } else if (typeof value === 'string' && !value.length) {\n delete emoji[_key];\n } else if (value === null) {\n delete emoji[_key];\n }\n }\n};\n\nvar uncompress = function uncompress(data) {\n data.compressed = false;\n\n for (var id in data.emojis) {\n var emoji = data.emojis[id];\n\n for (var key in mapping) {\n emoji[key] = emoji[mapping[key]];\n delete emoji[mapping[key]];\n }\n\n if (!emoji.short_names) emoji.short_names = [];\n emoji.short_names.unshift(id);\n emoji.sheet_x = emoji.sheet[0];\n emoji.sheet_y = emoji.sheet[1];\n delete emoji.sheet;\n if (!emoji.text) emoji.text = '';\n if (!emoji.added_in) emoji.added_in = 6;\n emoji.added_in = emoji.added_in.toFixed(1);\n emoji.search = buildSearch(emoji);\n }\n};\n\nexport { buildSearch, compress, uncompress };","var _String = String;\nexport default _String.fromCodePoint || function stringFromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n\n if (!length) {\n return '';\n }\n\n var result = '';\n\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n\n if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10ffff || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xffff) {\n // BMP code point\n codeUnits.push(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xd800;\n lowSurrogate = codePoint % 0x400 + 0xdc00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n\n if (index + 1 === length || codeUnits.length > MAX_SIZE) {\n result += String.fromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n\n return result;\n};","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport { buildSearch } from './data';\nimport stringFromCodePoint from '../polyfills/stringFromCodePoint';\nimport { uncompress } from './data';\nvar COLONS_REGEX = /^(?:\\:([^\\:]+)\\:)(?:\\:skin-tone-(\\d)\\:)?$/;\nvar SKINS = ['1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];\n\nfunction unifiedToNative(unified) {\n var unicodes = unified.split('-'),\n codePoints = unicodes.map(function (u) {\n return \"0x\".concat(u);\n });\n return stringFromCodePoint.apply(null, codePoints);\n}\n\nfunction sanitize(emoji) {\n var name = emoji.name,\n short_names = emoji.short_names,\n skin_tone = emoji.skin_tone,\n skin_variations = emoji.skin_variations,\n emoticons = emoji.emoticons,\n unified = emoji.unified,\n custom = emoji.custom,\n customCategory = emoji.customCategory,\n imageUrl = emoji.imageUrl,\n id = emoji.id || short_names[0],\n colons = \":\".concat(id, \":\");\n\n if (custom) {\n return {\n id: id,\n name: name,\n short_names: short_names,\n colons: colons,\n emoticons: emoticons,\n custom: custom,\n customCategory: customCategory,\n imageUrl: imageUrl\n };\n }\n\n if (skin_tone) {\n colons += \":skin-tone-\".concat(skin_tone, \":\");\n }\n\n return {\n id: id,\n name: name,\n short_names: short_names,\n colons: colons,\n emoticons: emoticons,\n unified: unified.toLowerCase(),\n skin: skin_tone || (skin_variations ? 1 : null),\n \"native\": unifiedToNative(unified)\n };\n}\n\nfunction getSanitizedData() {\n return sanitize(getData.apply(void 0, arguments));\n}\n\nfunction getData(emoji, skin, set, data) {\n var emojiData = {};\n\n if (typeof emoji == 'string') {\n var matches = emoji.match(COLONS_REGEX);\n\n if (matches) {\n emoji = matches[1];\n\n if (matches[2]) {\n skin = parseInt(matches[2], 10);\n }\n }\n\n if (data.aliases.hasOwnProperty(emoji)) {\n emoji = data.aliases[emoji];\n }\n\n if (data.emojis.hasOwnProperty(emoji)) {\n emojiData = data.emojis[emoji];\n } else {\n return null;\n }\n } else if (emoji.id) {\n if (data.aliases.hasOwnProperty(emoji.id)) {\n emoji.id = data.aliases[emoji.id];\n }\n\n if (data.emojis.hasOwnProperty(emoji.id)) {\n emojiData = data.emojis[emoji.id];\n skin || (skin = emoji.skin);\n }\n }\n\n if (!Object.keys(emojiData).length) {\n emojiData = emoji;\n emojiData.custom = true;\n\n if (!emojiData.search) {\n emojiData.search = buildSearch(emoji);\n }\n }\n\n emojiData.emoticons || (emojiData.emoticons = []);\n emojiData.variations || (emojiData.variations = []);\n\n if (emojiData.skin_variations && skin > 1) {\n emojiData = JSON.parse(JSON.stringify(emojiData));\n var skinKey = SKINS[skin - 1],\n variationData = emojiData.skin_variations[skinKey];\n\n if (variationData) {\n if (!variationData.variations && emojiData.variations) {\n delete emojiData.variations;\n }\n\n if (set && (variationData[\"has_img_\".concat(set)] == undefined || variationData[\"has_img_\".concat(set)]) || !set) {\n emojiData.skin_tone = skin;\n\n for (var k in variationData) {\n var v = variationData[k];\n emojiData[k] = v;\n }\n }\n }\n }\n\n if (emojiData.variations && emojiData.variations.length) {\n emojiData = JSON.parse(JSON.stringify(emojiData));\n emojiData.unified = emojiData.variations.shift();\n }\n\n return emojiData;\n}\n\nfunction getEmojiDataFromNative(nativeString, set, data) {\n if (data.compressed) {\n uncompress(data);\n }\n\n var skinTones = ['🏻', '🏼', '🏽', '🏾', '🏿'];\n var skinCodes = ['1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];\n var skin;\n var skinCode;\n var baseNativeString = nativeString;\n skinTones.forEach(function (skinTone, skinToneIndex) {\n if (nativeString.indexOf(skinTone) > 0) {\n skin = skinToneIndex + 2;\n skinCode = skinCodes[skinToneIndex];\n }\n });\n var emojiData;\n\n for (var id in data.emojis) {\n var emoji = data.emojis[id];\n var emojiUnified = emoji.unified;\n\n if (emoji.variations && emoji.variations.length) {\n emojiUnified = emoji.variations.shift();\n }\n\n if (skin && emoji.skin_variations && emoji.skin_variations[skinCode]) {\n emojiUnified = emoji.skin_variations[skinCode].unified;\n }\n\n if (unifiedToNative(emojiUnified) === baseNativeString) emojiData = emoji;\n }\n\n if (!emojiData) {\n return null;\n }\n\n emojiData.id = emojiData.short_names[0];\n return getSanitizedData(emojiData, skin, set, data);\n}\n\nfunction uniq(arr) {\n return arr.reduce(function (acc, item) {\n if (acc.indexOf(item) === -1) {\n acc.push(item);\n }\n\n return acc;\n }, []);\n}\n\nfunction intersect(a, b) {\n var uniqA = uniq(a);\n var uniqB = uniq(b);\n return uniqA.filter(function (item) {\n return uniqB.indexOf(item) >= 0;\n });\n}\n\nfunction deepMerge(a, b) {\n var o = {};\n\n for (var key in a) {\n var originalValue = a[key],\n value = originalValue;\n\n if (b.hasOwnProperty(key)) {\n value = b[key];\n }\n\n if (_typeof(value) === 'object') {\n value = deepMerge(originalValue, value);\n }\n\n o[key] = value;\n }\n\n return o;\n} // https://github.com/sonicdoe/measure-scrollbar\n\n\nfunction measureScrollbar() {\n if (typeof document == 'undefined') return 0;\n var div = document.createElement('div');\n div.style.width = '100px';\n div.style.height = '100px';\n div.style.overflow = 'scroll';\n div.style.position = 'absolute';\n div.style.top = '-9999px';\n document.body.appendChild(div);\n var scrollbarWidth = div.offsetWidth - div.clientWidth;\n document.body.removeChild(div);\n return scrollbarWidth;\n} // Use requestIdleCallback() if available, else fall back to setTimeout().\n// Throttle so as not to run too frequently.\n\n\nfunction throttleIdleTask(func) {\n var doIdleTask = typeof requestIdleCallback === 'function' ? requestIdleCallback : setTimeout;\n var running = false;\n return function throttled() {\n if (running) {\n return;\n }\n\n running = true;\n doIdleTask(function () {\n running = false;\n func();\n });\n };\n}\n\nexport { getData, getEmojiDataFromNative, getSanitizedData, uniq, intersect, deepMerge, unifiedToNative, measureScrollbar, throttleIdleTask };","var NAMESPACE = 'emoji-mart';\nvar isLocalStorageSupported = typeof window !== 'undefined' && 'localStorage' in window;\nvar getter;\nvar setter;\n\nfunction setHandlers(handlers) {\n handlers || (handlers = {});\n getter = handlers.getter;\n setter = handlers.setter;\n}\n\nfunction setNamespace(namespace) {\n NAMESPACE = namespace;\n}\n\nfunction update(state) {\n for (var key in state) {\n var value = state[key];\n set(key, value);\n }\n}\n\nfunction set(key, value) {\n if (setter) {\n setter(key, value);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n window.localStorage[\"\".concat(NAMESPACE, \".\").concat(key)] = JSON.stringify(value);\n } catch (e) {}\n }\n}\n\nfunction get(key) {\n if (getter) {\n return getter(key);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n var value = window.localStorage[\"\".concat(NAMESPACE, \".\").concat(key)];\n\n if (value) {\n return JSON.parse(value);\n }\n } catch (e) {\n return;\n }\n }\n}\n\nexport default {\n update: update,\n set: set,\n get: get,\n setNamespace: setNamespace,\n setHandlers: setHandlers\n};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport { getData, getSanitizedData, intersect } from '..';\nimport { uncompress } from '../data';\nimport store from '../store';\n\nvar NimbleEmojiIndex =\n/*#__PURE__*/\nfunction () {\n function NimbleEmojiIndex(data, set) {\n _classCallCheck(this, NimbleEmojiIndex);\n\n if (data.compressed) {\n uncompress(data);\n }\n\n this.data = data || {};\n this.set = set || null;\n this.originalPool = {};\n this.index = {};\n this.emojis = {};\n this.emoticons = {};\n this.customEmojisList = [];\n this.buildIndex();\n }\n\n _createClass(NimbleEmojiIndex, [{\n key: \"buildIndex\",\n value: function buildIndex() {\n var _this = this;\n\n var _loop = function _loop(emoji) {\n var emojiData = _this.data.emojis[emoji],\n short_names = emojiData.short_names,\n emoticons = emojiData.emoticons,\n skin_variations = emojiData.skin_variations,\n id = short_names[0];\n\n if (emoticons) {\n emoticons.forEach(function (emoticon) {\n if (_this.emoticons[emoticon]) {\n return;\n }\n\n _this.emoticons[emoticon] = id;\n });\n } // If skin variations include them\n\n\n if (skin_variations) {\n _this.emojis[id] = {};\n\n for (var skinTone = 1; skinTone <= 6; skinTone++) {\n _this.emojis[id][skinTone] = getSanitizedData({\n id: id,\n skin: skinTone\n }, skinTone, _this.set, _this.data);\n }\n } else {\n _this.emojis[id] = getSanitizedData(id, null, _this.set, _this.data);\n }\n\n _this.originalPool[id] = emojiData;\n };\n\n for (var emoji in this.data.emojis) {\n _loop(emoji);\n }\n }\n }, {\n key: \"clearCustomEmojis\",\n value: function clearCustomEmojis(pool) {\n var _this2 = this;\n\n this.customEmojisList.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n delete pool[emojiId];\n delete _this2.emojis[emojiId];\n });\n }\n }, {\n key: \"addCustomToPool\",\n value: function addCustomToPool(custom, pool) {\n var _this3 = this;\n\n if (this.customEmojisList.length) this.clearCustomEmojis(pool);\n custom.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n\n if (emojiId && !pool[emojiId]) {\n pool[emojiId] = getData(emoji, null, null, _this3.data);\n _this3.emojis[emojiId] = getSanitizedData(emoji, null, null, _this3.data);\n }\n });\n this.customEmojisList = custom;\n this.index = {};\n }\n }, {\n key: \"search\",\n value: function search(value) {\n var _this4 = this;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n emojisToShowFilter = _ref.emojisToShowFilter,\n maxResults = _ref.maxResults,\n include = _ref.include,\n exclude = _ref.exclude,\n _ref$custom = _ref.custom,\n custom = _ref$custom === void 0 ? [] : _ref$custom;\n\n if (this.customEmojisList != custom) this.addCustomToPool(custom, this.originalPool);\n var skinTone = store.get('skin') || 1;\n maxResults || (maxResults = 75);\n include || (include = []);\n exclude || (exclude = []);\n var results = null,\n pool = this.originalPool;\n\n if (value.length) {\n if (value == '-' || value == '-1') {\n return [this.emojis['-1'][skinTone]];\n }\n\n var values = value.toLowerCase().split(/[\\s|,|\\-|_]+/),\n allResults = [];\n\n if (values.length > 2) {\n values = [values[0], values[1]];\n }\n\n if (include.length || exclude.length) {\n pool = {};\n this.data.categories.forEach(function (category) {\n var isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;\n var isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n return;\n }\n\n category.emojis.forEach(function (emojiId) {\n return pool[emojiId] = _this4.data.emojis[emojiId];\n });\n });\n\n if (custom.length) {\n var customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;\n var customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;\n\n if (customIsIncluded && !customIsExcluded) {\n this.addCustomToPool(custom, pool);\n }\n }\n }\n\n allResults = values.map(function (value) {\n var aPool = pool,\n aIndex = _this4.index,\n length = 0;\n\n for (var charIndex = 0; charIndex < value.length; charIndex++) {\n var _char = value[charIndex];\n length++;\n aIndex[_char] || (aIndex[_char] = {});\n aIndex = aIndex[_char];\n\n if (!aIndex.results) {\n (function () {\n var scores = {};\n aIndex.results = [];\n aIndex.pool = {};\n\n for (var id in aPool) {\n var emoji = aPool[id],\n search = emoji.search,\n sub = value.substr(0, length),\n subIndex = search.indexOf(sub);\n\n if (subIndex != -1) {\n var score = subIndex + 1;\n if (sub == id) score = 0;\n\n if (_this4.emojis[id] && _this4.emojis[id][skinTone]) {\n aIndex.results.push(_this4.emojis[id][skinTone]);\n } else {\n aIndex.results.push(_this4.emojis[id]);\n }\n\n aIndex.pool[id] = emoji;\n scores[id] = score;\n }\n }\n\n aIndex.results.sort(function (a, b) {\n var aScore = scores[a.id],\n bScore = scores[b.id];\n\n if (aScore == bScore) {\n return a.id.localeCompare(b.id);\n } else {\n return aScore - bScore;\n }\n });\n })();\n }\n\n aPool = aIndex.pool;\n }\n\n return aIndex.results;\n }).filter(function (a) {\n return a;\n });\n\n if (allResults.length > 1) {\n results = intersect.apply(null, allResults);\n } else if (allResults.length) {\n results = allResults[0];\n } else {\n results = [];\n }\n }\n\n if (results) {\n if (emojisToShowFilter) {\n results = results.filter(function (result) {\n return emojisToShowFilter(pool[result.id]);\n });\n }\n\n if (results && results.length > maxResults) {\n results = results.slice(0, maxResults);\n }\n }\n\n return results;\n }\n }]);\n\n return NimbleEmojiIndex;\n}();\n\nexport { NimbleEmojiIndex as default };","import data from '../../../data/all.json';\nimport NimbleEmojiIndex from './nimble-emoji-index';\nvar emojiIndex = new NimbleEmojiIndex(data);\nvar emojis = emojiIndex.emojis,\n emoticons = emojiIndex.emoticons;\n\nfunction search() {\n return emojiIndex.search.apply(emojiIndex, arguments);\n}\n\nexport default {\n search: search,\n emojis: emojis,\n emoticons: emoticons\n};","import store from './store';\nvar DEFAULTS = ['+1', 'grinning', 'kissing_heart', 'heart_eyes', 'laughing', 'stuck_out_tongue_winking_eye', 'sweat_smile', 'joy', 'scream', 'disappointed', 'unamused', 'weary', 'sob', 'sunglasses', 'heart', 'poop'];\nvar frequently, initialized;\nvar defaults = {};\n\nfunction init() {\n initialized = true;\n frequently = store.get('frequently');\n}\n\nfunction add(emoji) {\n if (!initialized) init();\n var id = emoji.id;\n frequently || (frequently = defaults);\n frequently[id] || (frequently[id] = 0);\n frequently[id] += 1;\n store.set('last', id);\n store.set('frequently', frequently);\n}\n\nfunction get(perLine) {\n if (!initialized) init();\n\n if (!frequently) {\n defaults = {};\n var result = [];\n\n for (var i = 0; i < perLine; i++) {\n defaults[DEFAULTS[i]] = perLine - i;\n result.push(DEFAULTS[i]);\n }\n\n return result;\n }\n\n var quantity = perLine * 4;\n var frequentlyKeys = [];\n\n for (var key in frequently) {\n if (frequently.hasOwnProperty(key)) {\n frequentlyKeys.push(key);\n }\n }\n\n var sorted = frequentlyKeys.sort(function (a, b) {\n return frequently[a] - frequently[b];\n }).reverse();\n var sliced = sorted.slice(0, quantity);\n var last = store.get('last');\n\n if (last && sliced.indexOf(last) == -1) {\n sliced.pop();\n sliced.push(last);\n }\n\n return sliced;\n}\n\nexport default {\n add: add,\n get: get\n};","export default function _defineProperty(obj, key, value) {\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\n return obj;\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\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\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\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\n return assertThisInitialized(self);\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 _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\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}","import React from 'react';\nvar categories = {\n activity: function activity() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113\"\n }));\n },\n custom: function custom() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"g\", {\n transform: \"translate(2.000000, 1.000000)\"\n }, React.createElement(\"rect\", {\n id: \"Rectangle\",\n x: \"8\",\n y: \"0\",\n width: \"3\",\n height: \"21\",\n rx: \"1.5\"\n }), React.createElement(\"rect\", {\n id: \"Rectangle\",\n transform: \"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) \",\n x: \"8.343\",\n y: \"0.049\",\n width: \"3\",\n height: \"21\",\n rx: \"1.5\"\n }), React.createElement(\"rect\", {\n id: \"Rectangle\",\n transform: \"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) \",\n x: \"8.343\",\n y: \"0.049\",\n width: \"3\",\n height: \"21\",\n rx: \"1.5\"\n })));\n },\n flags: function flags() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z\"\n }));\n },\n foods: function foods() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9\"\n }));\n },\n nature: function nature() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8\"\n }), React.createElement(\"path\", {\n d: \"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235\"\n }));\n },\n objects: function objects() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z\"\n }), React.createElement(\"path\", {\n d: \"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789\"\n }));\n },\n people: function people() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\"\n }), React.createElement(\"path\", {\n d: \"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\"\n }));\n },\n places: function places() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5\"\n }), React.createElement(\"path\", {\n d: \"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z\"\n }));\n },\n recent: function recent() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z\"\n }), React.createElement(\"path\", {\n d: \"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\"\n }));\n },\n symbols: function symbols() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n width: \"24\",\n height: \"24\"\n }, React.createElement(\"path\", {\n d: \"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76\"\n }));\n }\n};\nvar search = {\n search: function search() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 20 20\",\n opacity: \"0.5\"\n }, React.createElement(\"path\", {\n d: \"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\"\n }));\n },\n \"delete\": function _delete() {\n return React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 20 20\",\n opacity: \"0.5\"\n }, React.createElement(\"path\", {\n d: \"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z\"\n }));\n }\n};\nexport { categories, search };","import PropTypes from 'prop-types';\nvar EmojiPropTypes = {\n data: PropTypes.object.isRequired,\n onOver: PropTypes.func,\n onLeave: PropTypes.func,\n onClick: PropTypes.func,\n fallback: PropTypes.func,\n backgroundImageFn: PropTypes.func,\n \"native\": PropTypes.bool,\n forceSize: PropTypes.bool,\n tooltip: PropTypes.bool,\n useButton: PropTypes.bool,\n skin: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),\n sheetSize: PropTypes.oneOf([16, 20, 32, 64]),\n sheetColumns: PropTypes.number,\n sheetRows: PropTypes.number,\n set: PropTypes.oneOf(['apple', 'google', 'twitter', 'facebook']),\n size: PropTypes.number.isRequired,\n emoji: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nvar PickerPropTypes = {\n onClick: PropTypes.func,\n onSelect: PropTypes.func,\n onSkinChange: PropTypes.func,\n perLine: PropTypes.number,\n emojiSize: PropTypes.number,\n i18n: PropTypes.object,\n style: PropTypes.object,\n title: PropTypes.string,\n emoji: PropTypes.string,\n color: PropTypes.string,\n set: EmojiPropTypes.set,\n skin: EmojiPropTypes.skin,\n \"native\": PropTypes.bool,\n backgroundImageFn: EmojiPropTypes.backgroundImageFn,\n sheetSize: EmojiPropTypes.sheetSize,\n emojisToShowFilter: PropTypes.func,\n showPreview: PropTypes.bool,\n showSkinTones: PropTypes.bool,\n emojiTooltip: EmojiPropTypes.tooltip,\n useButton: EmojiPropTypes.useButton,\n theme: PropTypes.oneOf(['auto', 'light', 'dark']),\n include: PropTypes.arrayOf(PropTypes.string),\n exclude: PropTypes.arrayOf(PropTypes.string),\n recent: PropTypes.arrayOf(PropTypes.string),\n autoFocus: PropTypes.bool,\n enableFrequentEmojiSort: PropTypes.bool,\n custom: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n short_names: PropTypes.arrayOf(PropTypes.string).isRequired,\n emoticons: PropTypes.arrayOf(PropTypes.string),\n keywords: PropTypes.arrayOf(PropTypes.string),\n imageUrl: PropTypes.string,\n spriteUrl: PropTypes.string,\n sheet_x: PropTypes.number,\n sheet_y: PropTypes.number,\n size: PropTypes.number,\n sheetColumns: PropTypes.number,\n sheetRows: PropTypes.number\n })),\n skinEmoji: PropTypes.string,\n notFound: PropTypes.func,\n notFoundEmoji: PropTypes.string,\n icons: PropTypes.object\n};\nexport { EmojiPropTypes, PickerPropTypes };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar Anchors =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(Anchors, _React$PureComponent);\n\n function Anchors(props) {\n var _this;\n\n _classCallCheck(this, Anchors);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Anchors).call(this, props));\n var defaultCategory = props.categories.filter(function (category) {\n return category.first;\n })[0];\n _this.state = {\n selected: defaultCategory.name\n };\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Anchors, [{\n key: \"handleClick\",\n value: function handleClick(e) {\n var index = e.currentTarget.getAttribute('data-index');\n var _this$props = this.props,\n categories = _this$props.categories,\n onAnchorClick = _this$props.onAnchorClick;\n onAnchorClick(categories[index], index);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n categories = _this$props2.categories,\n color = _this$props2.color,\n i18n = _this$props2.i18n,\n icons = _this$props2.icons,\n selected = this.state.selected;\n return React.createElement(\"nav\", {\n className: \"emoji-mart-anchors\",\n \"aria-label\": i18n.categorieslabel\n }, categories.map(function (category, i) {\n var id = category.id,\n name = category.name,\n anchor = category.anchor,\n isSelected = name == selected;\n\n if (anchor === false) {\n return null;\n }\n\n var iconId = id.startsWith('custom-') ? 'custom' : id;\n return React.createElement(\"button\", {\n key: id,\n \"aria-label\": i18n.categories[iconId],\n title: i18n.categories[iconId],\n \"data-index\": i,\n type: 'button',\n onClick: _this2.handleClick,\n className: \"emoji-mart-anchor \".concat(isSelected ? 'emoji-mart-anchor-selected' : ''),\n style: {\n color: isSelected ? color : null\n }\n }, React.createElement(\"div\", {\n className: \"emoji-mart-anchor-icon\"\n }, icons.categories[iconId]()), React.createElement(\"span\", {\n className: \"emoji-mart-anchor-bar\",\n style: {\n backgroundColor: color\n }\n }));\n }));\n }\n }]);\n\n return Anchors;\n}(React.PureComponent);\n\nexport { Anchors as default };\nAnchors.propTypes\n/* remove-proptypes */\n= {\n categories: PropTypes.array,\n onAnchorClick: PropTypes.func,\n icons: PropTypes.object\n};\nAnchors.defaultProps = {\n categories: [],\n onAnchorClick: function onAnchorClick() {},\n icons: {}\n};","var EmojiDefaultProps = {\n skin: 1,\n set: 'apple',\n sheetSize: 64,\n sheetColumns: 57,\n sheetRows: 57,\n \"native\": false,\n forceSize: false,\n tooltip: false,\n useButton: true,\n backgroundImageFn: function backgroundImageFn(set, sheetSize) {\n return \"https://unpkg.com/emoji-datasource-\".concat(set, \"@\").concat(\"5.0.1\", \"/img/\").concat(set, \"/sheets-256/\").concat(sheetSize, \".png\");\n }\n};\nvar PickerDefaultProps = {\n onClick: function onClick() {},\n onSelect: function onSelect() {},\n onSkinChange: function onSkinChange() {},\n emojiSize: 24,\n perLine: 9,\n i18n: {},\n style: {},\n title: 'Emoji Mart™',\n emoji: 'department_store',\n color: '#ae65c5',\n set: EmojiDefaultProps.set,\n theme: 'light',\n skin: null,\n defaultSkin: EmojiDefaultProps.skin,\n \"native\": EmojiDefaultProps[\"native\"],\n sheetSize: EmojiDefaultProps.sheetSize,\n backgroundImageFn: EmojiDefaultProps.backgroundImageFn,\n emojisToShowFilter: null,\n showPreview: true,\n showSkinTones: true,\n emojiTooltip: EmojiDefaultProps.tooltip,\n useButton: EmojiDefaultProps.useButton,\n autoFocus: false,\n enableFrequentEmojiSort: false,\n custom: [],\n skinEmoji: '',\n notFound: function notFound() {},\n notFoundEmoji: 'sleuth_or_spy',\n icons: {}\n};\nexport { PickerDefaultProps, EmojiDefaultProps };","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData, getSanitizedData, unifiedToNative } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { EmojiPropTypes } from '../../utils/shared-props';\nimport { EmojiDefaultProps } from '../../utils/shared-default-props';\n\nvar _getData = function _getData(props) {\n var emoji = props.emoji,\n skin = props.skin,\n set = props.set,\n data = props.data;\n return getData(emoji, skin, set, data);\n};\n\nvar _getPosition = function _getPosition(props) {\n var _getData2 = _getData(props),\n sheet_x = _getData2.sheet_x,\n sheet_y = _getData2.sheet_y,\n multiplyX = 100 / (props.sheetColumns - 1),\n multiplyY = 100 / (props.sheetRows - 1);\n\n return \"\".concat(multiplyX * sheet_x, \"% \").concat(multiplyY * sheet_y, \"%\");\n};\n\nvar _getSanitizedData = function _getSanitizedData(props) {\n var emoji = props.emoji,\n skin = props.skin,\n set = props.set,\n data = props.data;\n return getSanitizedData(emoji, skin, set, data);\n};\n\nvar _handleClick = function _handleClick(e, props) {\n if (!props.onClick) {\n return;\n }\n\n var onClick = props.onClick,\n emoji = _getSanitizedData(props);\n\n onClick(emoji, e);\n};\n\nvar _handleOver = function _handleOver(e, props) {\n if (!props.onOver) {\n return;\n }\n\n var onOver = props.onOver,\n emoji = _getSanitizedData(props);\n\n onOver(emoji, e);\n};\n\nvar _handleLeave = function _handleLeave(e, props) {\n if (!props.onLeave) {\n return;\n }\n\n var onLeave = props.onLeave,\n emoji = _getSanitizedData(props);\n\n onLeave(emoji, e);\n};\n\nvar _isNumeric = function _isNumeric(value) {\n return !isNaN(value - parseFloat(value));\n};\n\nvar _convertStyleToCSS = function _convertStyleToCSS(style) {\n var div = document.createElement('div');\n\n for (var key in style) {\n var value = style[key];\n\n if (_isNumeric(value)) {\n value += 'px';\n }\n\n div.style[key] = value;\n }\n\n return div.getAttribute('style');\n};\n\nvar NimbleEmoji = function NimbleEmoji(props) {\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n for (var k in NimbleEmoji.defaultProps) {\n if (props[k] == undefined && NimbleEmoji.defaultProps[k] != undefined) {\n props[k] = NimbleEmoji.defaultProps[k];\n }\n }\n\n var data = _getData(props);\n\n if (!data) {\n if (props.fallback) {\n return props.fallback(null, props);\n } else {\n return null;\n }\n }\n\n var unified = data.unified,\n custom = data.custom,\n short_names = data.short_names,\n imageUrl = data.imageUrl,\n style = {},\n children = props.children,\n className = 'emoji-mart-emoji',\n nativeEmoji = unified && unifiedToNative(unified),\n label = [nativeEmoji].concat(short_names).filter(Boolean).join(', '),\n title = null;\n\n if (!unified && !custom) {\n if (props.fallback) {\n return props.fallback(data, props);\n } else {\n return null;\n }\n }\n\n if (props.tooltip) {\n title = short_names[0];\n }\n\n if (props[\"native\"] && unified) {\n className += ' emoji-mart-emoji-native';\n style = {\n fontSize: props.size\n };\n children = nativeEmoji;\n\n if (props.forceSize) {\n style.display = 'inline-block';\n style.width = props.size;\n style.height = props.size;\n style.wordBreak = 'keep-all';\n }\n } else if (custom) {\n className += ' emoji-mart-emoji-custom';\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block'\n };\n\n if (data.spriteUrl) {\n style = _objectSpread({}, style, {\n backgroundImage: \"url(\".concat(data.spriteUrl, \")\"),\n backgroundSize: \"\".concat(100 * props.sheetColumns, \"% \").concat(100 * props.sheetRows, \"%\"),\n backgroundPosition: _getPosition(props)\n });\n } else {\n style = _objectSpread({}, style, {\n backgroundImage: \"url(\".concat(imageUrl, \")\"),\n backgroundSize: 'contain',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center'\n });\n }\n } else {\n var setHasEmoji = data[\"has_img_\".concat(props.set)] == undefined || data[\"has_img_\".concat(props.set)];\n\n if (!setHasEmoji) {\n if (props.fallback) {\n return props.fallback(data, props);\n } else {\n return null;\n }\n } else {\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block',\n backgroundImage: \"url(\".concat(props.backgroundImageFn(props.set, props.sheetSize), \")\"),\n backgroundSize: \"\".concat(100 * props.sheetColumns, \"% \").concat(100 * props.sheetRows, \"%\"),\n backgroundPosition: _getPosition(props)\n };\n }\n }\n\n var Tag = {\n name: 'span',\n props: {}\n };\n\n if (props.onClick && props.useButton) {\n Tag.name = 'button';\n Tag.props = {\n type: 'button'\n };\n }\n\n if (props.html) {\n style = _convertStyleToCSS(style);\n return \"<\".concat(Tag.name, \" style='\").concat(style, \"' aria-label='\").concat(label, \"' \").concat(title ? \"title='\".concat(title, \"'\") : '', \" class='\").concat(className, \"'>\").concat(children || '', \"\");\n } else {\n return React.createElement(Tag.name, _extends({\n onClick: function onClick(e) {\n return _handleClick(e, props);\n },\n onMouseEnter: function onMouseEnter(e) {\n return _handleOver(e, props);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _handleLeave(e, props);\n },\n \"aria-label\": label,\n title: title,\n className: className\n }, Tag.props), React.createElement(\"span\", {\n style: style\n }, children));\n }\n};\n\nNimbleEmoji.propTypes\n/* remove-proptypes */\n= _objectSpread({}, EmojiPropTypes, {\n data: PropTypes.object.isRequired\n});\nNimbleEmoji.defaultProps = EmojiDefaultProps;\nexport default NimbleEmoji;","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport NimbleEmoji from './emoji/nimble-emoji';\n\nvar NotFound =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(NotFound, _React$PureComponent);\n\n function NotFound() {\n _classCallCheck(this, NotFound);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NotFound).apply(this, arguments));\n }\n\n _createClass(NotFound, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n data = _this$props.data,\n emojiProps = _this$props.emojiProps,\n i18n = _this$props.i18n,\n notFound = _this$props.notFound,\n notFoundEmoji = _this$props.notFoundEmoji;\n var component = notFound && notFound() || React.createElement(\"div\", {\n className: \"emoji-mart-no-results\"\n }, NimbleEmoji(_objectSpread({\n data: data\n }, emojiProps, {\n size: 38,\n emoji: notFoundEmoji,\n onOver: null,\n onLeave: null,\n onClick: null\n })), React.createElement(\"div\", {\n className: \"emoji-mart-no-results-label\"\n }, i18n.notfound));\n return component;\n }\n }]);\n\n return NotFound;\n}(React.PureComponent);\n\nexport { NotFound as default };\nNotFound.propTypes\n/* remove-proptypes */\n= {\n notFound: PropTypes.func.isRequired,\n emojiProps: PropTypes.object.isRequired\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport frequently from '../utils/frequently';\nimport { getData } from '../utils';\nimport NimbleEmoji from './emoji/nimble-emoji';\nimport NotFound from './not-found';\n\nvar Category =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(Category, _React$Component);\n\n function Category(props) {\n var _this;\n\n _classCallCheck(this, Category);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Category).call(this, props));\n _this.data = props.data;\n _this.setContainerRef = _this.setContainerRef.bind(_assertThisInitialized(_this));\n _this.setLabelRef = _this.setLabelRef.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Category, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.margin = 0;\n this.minMargin = 0;\n this.memoizeSize();\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n var _this$props = this.props,\n name = _this$props.name,\n perLine = _this$props.perLine,\n _native = _this$props[\"native\"],\n hasStickyPosition = _this$props.hasStickyPosition,\n emojis = _this$props.emojis,\n emojiProps = _this$props.emojiProps,\n skin = emojiProps.skin,\n size = emojiProps.size,\n set = emojiProps.set,\n nextPerLine = nextProps.perLine,\n nextNative = nextProps[\"native\"],\n nextHasStickyPosition = nextProps.hasStickyPosition,\n nextEmojis = nextProps.emojis,\n nextEmojiProps = nextProps.emojiProps,\n nextSkin = nextEmojiProps.skin,\n nextSize = nextEmojiProps.size,\n nextSet = nextEmojiProps.set,\n shouldUpdate = false;\n\n if (name == 'Recent' && perLine != nextPerLine) {\n shouldUpdate = true;\n }\n\n if (name == 'Search') {\n shouldUpdate = !(emojis == nextEmojis);\n }\n\n if (skin != nextSkin || size != nextSize || _native != nextNative || set != nextSet || hasStickyPosition != nextHasStickyPosition) {\n shouldUpdate = true;\n }\n\n return shouldUpdate;\n }\n }, {\n key: \"memoizeSize\",\n value: function memoizeSize() {\n if (!this.container) {\n // probably this is a test environment, e.g. jest\n this.top = 0;\n this.maxMargin = 0;\n return;\n }\n\n var parent = this.container.parentElement;\n\n var _this$container$getBo = this.container.getBoundingClientRect(),\n top = _this$container$getBo.top,\n height = _this$container$getBo.height;\n\n var _parent$getBoundingCl = parent.getBoundingClientRect(),\n parentTop = _parent$getBoundingCl.top;\n\n var _this$label$getBoundi = this.label.getBoundingClientRect(),\n labelHeight = _this$label$getBoundi.height;\n\n this.top = top - parentTop + parent.scrollTop;\n\n if (height == 0) {\n this.maxMargin = 0;\n } else {\n this.maxMargin = height - labelHeight;\n }\n }\n }, {\n key: \"handleScroll\",\n value: function handleScroll(scrollTop) {\n var margin = scrollTop - this.top;\n margin = margin < this.minMargin ? this.minMargin : margin;\n margin = margin > this.maxMargin ? this.maxMargin : margin;\n if (margin == this.margin) return;\n\n if (!this.props.hasStickyPosition) {\n this.label.style.top = \"\".concat(margin, \"px\");\n }\n\n this.margin = margin;\n return true;\n }\n }, {\n key: \"getEmojis\",\n value: function getEmojis() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n name = _this$props2.name,\n emojis = _this$props2.emojis,\n recent = _this$props2.recent,\n perLine = _this$props2.perLine;\n\n if (name == 'Recent') {\n var custom = this.props.custom;\n var frequentlyUsed = recent || frequently.get(perLine);\n\n if (frequentlyUsed.length) {\n emojis = frequentlyUsed.map(function (id) {\n var emoji = custom.filter(function (e) {\n return e.id === id;\n })[0];\n\n if (emoji) {\n return emoji;\n }\n\n return id;\n }).filter(function (id) {\n return !!getData(id, null, null, _this2.data);\n });\n }\n\n if (emojis.length === 0 && frequentlyUsed.length > 0) {\n return null;\n }\n }\n\n if (emojis) {\n emojis = emojis.slice(0);\n }\n\n return emojis;\n }\n }, {\n key: \"updateDisplay\",\n value: function updateDisplay(display) {\n var emojis = this.getEmojis();\n\n if (!emojis || !this.container) {\n return;\n }\n\n this.container.style.display = display;\n }\n }, {\n key: \"setContainerRef\",\n value: function setContainerRef(c) {\n this.container = c;\n }\n }, {\n key: \"setLabelRef\",\n value: function setLabelRef(c) {\n this.label = c;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props3 = this.props,\n id = _this$props3.id,\n name = _this$props3.name,\n hasStickyPosition = _this$props3.hasStickyPosition,\n emojiProps = _this$props3.emojiProps,\n i18n = _this$props3.i18n,\n notFound = _this$props3.notFound,\n notFoundEmoji = _this$props3.notFoundEmoji,\n emojis = this.getEmojis(),\n labelStyles = {},\n labelSpanStyles = {},\n containerStyles = {};\n\n if (!emojis) {\n containerStyles = {\n display: 'none'\n };\n }\n\n if (!hasStickyPosition) {\n labelStyles = {\n height: 28\n };\n labelSpanStyles = {\n position: 'absolute'\n };\n }\n\n var label = i18n.categories[id] || name;\n return React.createElement(\"section\", {\n ref: this.setContainerRef,\n className: \"emoji-mart-category\",\n \"aria-label\": label,\n style: containerStyles\n }, React.createElement(\"div\", {\n style: labelStyles,\n \"data-name\": name,\n className: \"emoji-mart-category-label\"\n }, React.createElement(\"span\", {\n style: labelSpanStyles,\n ref: this.setLabelRef,\n \"aria-hidden\": true\n /* already labeled by the section aria-label */\n\n }, label)), React.createElement(\"ul\", {\n className: \"emoji-mart-category-list\"\n }, emojis && emojis.map(function (emoji) {\n return React.createElement(\"li\", {\n key: emoji.short_names && emoji.short_names.join('_') || emoji\n }, NimbleEmoji(_objectSpread({\n emoji: emoji,\n data: _this3.data\n }, emojiProps)));\n })), emojis && !emojis.length && React.createElement(NotFound, {\n i18n: i18n,\n notFound: notFound,\n notFoundEmoji: notFoundEmoji,\n data: this.data,\n emojiProps: emojiProps\n }));\n }\n }]);\n\n return Category;\n}(React.Component);\n\nexport { Category as default };\nCategory.propTypes\n/* remove-proptypes */\n= {\n emojis: PropTypes.array,\n hasStickyPosition: PropTypes.bool,\n name: PropTypes.string.isRequired,\n \"native\": PropTypes.bool.isRequired,\n perLine: PropTypes.number.isRequired,\n emojiProps: PropTypes.object.isRequired,\n recent: PropTypes.arrayOf(PropTypes.string),\n notFound: PropTypes.func,\n notFoundEmoji: PropTypes.string.isRequired\n};\nCategory.defaultProps = {\n emojis: [],\n hasStickyPosition: true\n};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar Skins =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(Skins, _React$PureComponent);\n\n function Skins(props) {\n var _this;\n\n _classCallCheck(this, Skins);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Skins).call(this, props));\n _this.state = {\n opened: false\n };\n return _this;\n }\n\n _createClass(Skins, [{\n key: \"handleClick\",\n value: function handleClick(e) {\n var skin = parseInt(e.currentTarget.getAttribute('data-skin'));\n var onChange = this.props.onChange;\n\n if (!this.state.opened) {\n this.setState({\n opened: true\n });\n } else {\n this.setState({\n opened: false\n });\n\n if (skin != this.props.skin) {\n onChange(skin);\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return null;\n }\n }]);\n\n return Skins;\n}(React.PureComponent);\n\nexport { Skins as default };\nSkins.propTypes\n/* remove-proptypes */\n= {\n onChange: PropTypes.func,\n skin: PropTypes.number.isRequired\n};\nSkins.defaultProps = {\n onChange: function onChange() {}\n};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport NimbleEmoji from './emoji/nimble-emoji';\nimport Skins from './skins';\n\nvar SkinsEmoji =\n/*#__PURE__*/\nfunction (_Skins) {\n _inherits(SkinsEmoji, _Skins);\n\n function SkinsEmoji(props) {\n var _this;\n\n _classCallCheck(this, SkinsEmoji);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SkinsEmoji).call(this, props));\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(SkinsEmoji, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n skin = _this$props.skin,\n emojiProps = _this$props.emojiProps,\n data = _this$props.data,\n skinEmoji = _this$props.skinEmoji,\n i18n = _this$props.i18n;\n var opened = this.state.opened;\n var skinToneNodes = [];\n\n for (var skinTone = 1; skinTone <= 6; skinTone++) {\n var selected = skinTone === skin;\n skinToneNodes.push(React.createElement(\"span\", {\n key: \"skin-tone-\".concat(skinTone),\n className: \"emoji-mart-skin-swatch custom\".concat(selected ? ' selected' : '')\n }, React.createElement(\"span\", {\n onClick: this.handleClick,\n \"data-skin\": skinTone,\n className: \"emoji-mart-skin-tone-\".concat(skinTone)\n }, NimbleEmoji({\n emoji: skinEmoji,\n data: data,\n skin: skinTone,\n backgroundImageFn: emojiProps.backgroundImageFn,\n \"native\": emojiProps[\"native\"],\n set: emojiProps.set,\n sheetSize: emojiProps.sheetSize,\n size: 23\n }))));\n }\n\n return React.createElement(\"div\", {\n className: \"emoji-mart-skin-swatches custom\".concat(opened ? ' opened' : '')\n }, React.createElement(\"div\", {\n className: \"emoji-mart-skin-text\".concat(opened ? ' opened' : '')\n }, i18n.skintext), skinToneNodes);\n }\n }]);\n\n return SkinsEmoji;\n}(Skins);\n\nexport { SkinsEmoji as default };\nSkinsEmoji.propTypes\n/* remove-proptypes */\n= {\n onChange: PropTypes.func,\n skin: PropTypes.number.isRequired,\n emojiProps: PropTypes.object.isRequired,\n skinTone: PropTypes.number,\n skinEmoji: PropTypes.string.isRequired,\n i18n: PropTypes.object\n};\nSkinsEmoji.defaultProps = {\n onChange: function onChange() {},\n skinTone: null\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Skins from './skins';\n\nvar SkinsDot =\n/*#__PURE__*/\nfunction (_Skins) {\n _inherits(SkinsDot, _Skins);\n\n function SkinsDot(props) {\n var _this;\n\n _classCallCheck(this, SkinsDot);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SkinsDot).call(this, props));\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(SkinsDot, [{\n key: \"handleKeyDown\",\n value: function handleKeyDown(event) {\n // if either enter or space is pressed, then execute\n if (event.keyCode === 13 || event.keyCode === 32) {\n event.preventDefault();\n this.handleClick(event);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n skin = _this$props.skin,\n i18n = _this$props.i18n;\n var opened = this.state.opened;\n var skinToneNodes = [];\n\n for (var skinTone = 1; skinTone <= 6; skinTone++) {\n var selected = skinTone === skin;\n var visible = opened || selected;\n skinToneNodes.push(React.createElement(\"span\", _extends({\n key: \"skin-tone-\".concat(skinTone),\n className: \"emoji-mart-skin-swatch\".concat(selected ? ' selected' : ''),\n \"aria-label\": i18n.skintones[skinTone],\n \"aria-hidden\": !visible\n }, opened ? {\n role: 'menuitem'\n } : {}), React.createElement(\"span\", _extends({\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n role: \"button\"\n }, selected ? {\n 'aria-haspopup': true,\n 'aria-expanded': !!opened\n } : {}, opened ? {\n 'aria-pressed': !!selected\n } : {}, {\n tabIndex: visible ? '0' : '',\n \"aria-label\": i18n.skintones[skinTone],\n title: i18n.skintones[skinTone],\n \"data-skin\": skinTone,\n className: \"emoji-mart-skin emoji-mart-skin-tone-\".concat(skinTone)\n }))));\n }\n\n return React.createElement(\"section\", {\n className: \"emoji-mart-skin-swatches\".concat(opened ? ' opened' : ''),\n \"aria-label\": i18n.skintext\n }, React.createElement(\"div\", opened ? {\n role: 'menubar'\n } : {}, skinToneNodes));\n }\n }]);\n\n return SkinsDot;\n}(Skins);\n\nexport { SkinsDot as default };\nSkinsDot.propTypes\n/* remove-proptypes */\n= {\n onChange: PropTypes.func,\n skin: PropTypes.number.isRequired,\n i18n: PropTypes.object\n};\nSkinsDot.defaultProps = {\n onChange: function onChange() {}\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData } from '../utils';\nimport NimbleEmoji from './emoji/nimble-emoji';\nimport SkinsEmoji from './skins-emoji';\nimport SkinsDot from './skins-dot';\n\nvar Preview =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(Preview, _React$PureComponent);\n\n function Preview(props) {\n var _this;\n\n _classCallCheck(this, Preview);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Preview).call(this, props));\n _this.data = props.data;\n _this.state = {\n emoji: null\n };\n return _this;\n }\n\n _createClass(Preview, [{\n key: \"render\",\n value: function render() {\n var emoji = this.state.emoji,\n _this$props = this.props,\n emojiProps = _this$props.emojiProps,\n skinsProps = _this$props.skinsProps,\n showSkinTones = _this$props.showSkinTones,\n title = _this$props.title,\n idleEmoji = _this$props.emoji,\n i18n = _this$props.i18n,\n showPreview = _this$props.showPreview;\n\n if (emoji && showPreview) {\n var emojiData = getData(emoji, null, null, this.data),\n _emojiData$emoticons = emojiData.emoticons,\n emoticons = _emojiData$emoticons === void 0 ? [] : _emojiData$emoticons,\n knownEmoticons = [],\n listedEmoticons = [];\n emoticons.forEach(function (emoticon) {\n if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {\n return;\n }\n\n knownEmoticons.push(emoticon.toLowerCase());\n listedEmoticons.push(emoticon);\n });\n return React.createElement(\"div\", {\n className: \"emoji-mart-preview\"\n }, React.createElement(\"div\", {\n className: \"emoji-mart-preview-emoji\",\n \"aria-hidden\": \"true\"\n }, NimbleEmoji(_objectSpread({\n key: emoji.id,\n emoji: emoji,\n data: this.data\n }, emojiProps))), React.createElement(\"div\", {\n className: \"emoji-mart-preview-data\",\n \"aria-hidden\": \"true\"\n }, React.createElement(\"div\", {\n className: \"emoji-mart-preview-name\"\n }, emoji.name), React.createElement(\"div\", {\n className: \"emoji-mart-preview-shortnames\"\n }, emojiData.short_names.map(function (short_name) {\n return React.createElement(\"span\", {\n key: short_name,\n className: \"emoji-mart-preview-shortname\"\n }, \":\", short_name, \":\");\n })), React.createElement(\"div\", {\n className: \"emoji-mart-preview-emoticons\"\n }, listedEmoticons.map(function (emoticon) {\n return React.createElement(\"span\", {\n key: emoticon,\n className: \"emoji-mart-preview-emoticon\"\n }, emoticon);\n }))));\n } else {\n return React.createElement(\"div\", {\n className: \"emoji-mart-preview\"\n }, React.createElement(\"div\", {\n className: \"emoji-mart-preview-emoji\",\n \"aria-hidden\": \"true\"\n }, idleEmoji && idleEmoji.length && NimbleEmoji(_objectSpread({\n emoji: idleEmoji,\n data: this.data\n }, emojiProps))), React.createElement(\"div\", {\n className: \"emoji-mart-preview-data\",\n \"aria-hidden\": \"true\"\n }, React.createElement(\"span\", {\n className: \"emoji-mart-title-label\"\n }, title)), showSkinTones && React.createElement(\"div\", {\n className: \"emoji-mart-preview-skins\".concat(skinsProps.skinEmoji ? ' custom' : '')\n }, skinsProps.skinEmoji ? React.createElement(SkinsEmoji, {\n skin: skinsProps.skin,\n emojiProps: emojiProps,\n data: this.data,\n skinEmoji: skinsProps.skinEmoji,\n i18n: i18n,\n onChange: skinsProps.onChange\n }) : React.createElement(SkinsDot, {\n skin: skinsProps.skin,\n i18n: i18n,\n onChange: skinsProps.onChange\n })));\n }\n }\n }]);\n\n return Preview;\n}(React.PureComponent);\n\nexport { Preview as default };\nPreview.propTypes\n/* remove-proptypes */\n= {\n showSkinTones: PropTypes.bool,\n title: PropTypes.string.isRequired,\n emoji: PropTypes.string.isRequired,\n emojiProps: PropTypes.object.isRequired,\n skinsProps: PropTypes.object.isRequired\n};\nPreview.defaultProps = {\n showSkinTones: true,\n onChange: function onChange() {}\n};","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { search as icons } from '../svgs';\nimport NimbleEmojiIndex from '../utils/emoji-index/nimble-emoji-index';\nimport { throttleIdleTask } from '../utils/index';\nvar id = 0;\n\nvar Search =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(Search, _React$PureComponent);\n\n function Search(props) {\n var _this;\n\n _classCallCheck(this, Search);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Search).call(this, props));\n _this.state = {\n icon: icons.search,\n isSearching: false,\n id: ++id\n };\n _this.data = props.data;\n _this.emojiIndex = new NimbleEmojiIndex(_this.data);\n _this.setRef = _this.setRef.bind(_assertThisInitialized(_this));\n _this.clear = _this.clear.bind(_assertThisInitialized(_this));\n _this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this)); // throttle keyboard input so that typing isn't delayed\n\n _this.handleChange = throttleIdleTask(_this.handleChange.bind(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(Search, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // in some cases (e.g. preact) the input may already be pre-populated\n // this.input is undefined in Jest tests\n if (this.input && this.input.value) {\n this.search(this.input.value);\n }\n }\n }, {\n key: \"search\",\n value: function search(value) {\n if (value == '') this.setState({\n icon: icons.search,\n isSearching: false\n });else this.setState({\n icon: icons[\"delete\"],\n isSearching: true\n });\n this.props.onSearch(this.emojiIndex.search(value, {\n emojisToShowFilter: this.props.emojisToShowFilter,\n maxResults: this.props.maxResults,\n include: this.props.include,\n exclude: this.props.exclude,\n custom: this.props.custom\n }));\n }\n }, {\n key: \"clear\",\n value: function clear() {\n if (this.input.value == '') return;\n this.input.value = '';\n this.input.focus();\n this.search('');\n }\n }, {\n key: \"handleChange\",\n value: function handleChange() {\n if (this.input) {\n this.search(this.input.value);\n }\n }\n }, {\n key: \"handleKeyUp\",\n value: function handleKeyUp(e) {\n if (e.keyCode === 13) {\n this.clear();\n }\n }\n }, {\n key: \"setRef\",\n value: function setRef(c) {\n this.input = c;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n i18n = _this$props.i18n,\n autoFocus = _this$props.autoFocus;\n var _this$state = this.state,\n icon = _this$state.icon,\n isSearching = _this$state.isSearching,\n id = _this$state.id;\n var inputId = \"emoji-mart-search-\".concat(id);\n return React.createElement(\"section\", {\n className: \"emoji-mart-search\",\n \"aria-label\": i18n.search\n }, React.createElement(\"input\", {\n id: inputId,\n ref: this.setRef,\n type: \"search\",\n onChange: this.handleChange,\n placeholder: i18n.search,\n autoFocus: autoFocus\n }), React.createElement(\"label\", {\n className: \"emoji-mart-sr-only\",\n htmlFor: inputId\n }, i18n.search), React.createElement(\"button\", {\n className: \"emoji-mart-search-icon\",\n onClick: this.clear,\n onKeyUp: this.handleKeyUp,\n \"aria-label\": i18n.clear,\n disabled: !isSearching\n }, icon()));\n }\n }]);\n\n return Search;\n}(React.PureComponent);\n\nexport { Search as default };\nSearch.propTypes\n/* remove-proptypes */\n= {\n onSearch: PropTypes.func,\n maxResults: PropTypes.number,\n emojisToShowFilter: PropTypes.func,\n autoFocus: PropTypes.bool\n};\nSearch.defaultProps = {\n onSearch: function onSearch() {},\n maxResults: 75,\n emojisToShowFilter: null,\n autoFocus: false\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport * as icons from '../../svgs';\nimport store from '../../utils/store';\nimport frequently from '../../utils/frequently';\nimport { deepMerge, measureScrollbar, getSanitizedData } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { PickerPropTypes } from '../../utils/shared-props';\nimport Anchors from '../anchors';\nimport Category from '../category';\nimport Preview from '../preview';\nimport Search from '../search';\nimport { PickerDefaultProps } from '../../utils/shared-default-props';\nvar I18N = {\n search: 'Search',\n clear: 'Clear',\n // Accessible label on \"clear\" button\n notfound: 'No Emoji Found',\n skintext: 'Choose your default skin tone',\n categories: {\n search: 'Search Results',\n recent: 'Frequently Used',\n people: 'Smileys & People',\n nature: 'Animals & Nature',\n foods: 'Food & Drink',\n activity: 'Activity',\n places: 'Travel & Places',\n objects: 'Objects',\n symbols: 'Symbols',\n flags: 'Flags',\n custom: 'Custom'\n },\n categorieslabel: 'Emoji categories',\n // Accessible title for the list of categories\n skintones: {\n 1: 'Default Skin Tone',\n 2: 'Light Skin Tone',\n 3: 'Medium-Light Skin Tone',\n 4: 'Medium Skin Tone',\n 5: 'Medium-Dark Skin Tone',\n 6: 'Dark Skin Tone'\n }\n};\n\nvar NimblePicker =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(NimblePicker, _React$PureComponent);\n\n function NimblePicker(props) {\n var _this;\n\n _classCallCheck(this, NimblePicker);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NimblePicker).call(this, props));\n _this.CUSTOM = [];\n _this.RECENT_CATEGORY = {\n id: 'recent',\n name: 'Recent',\n emojis: null\n };\n _this.SEARCH_CATEGORY = {\n id: 'search',\n name: 'Search',\n emojis: null,\n anchor: false\n };\n\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n _this.data = props.data;\n _this.i18n = deepMerge(I18N, props.i18n);\n _this.icons = deepMerge(icons, props.icons);\n _this.state = {\n firstRender: true\n };\n _this.categories = [];\n var allCategories = [].concat(_this.data.categories);\n\n if (props.custom.length > 0) {\n var customCategories = {};\n var customCategoriesCreated = 0;\n props.custom.forEach(function (emoji) {\n if (!customCategories[emoji.customCategory]) {\n customCategories[emoji.customCategory] = {\n id: emoji.customCategory ? \"custom-\".concat(emoji.customCategory) : 'custom',\n name: emoji.customCategory || 'Custom',\n emojis: [],\n anchor: customCategoriesCreated === 0\n };\n customCategoriesCreated++;\n }\n\n var category = customCategories[emoji.customCategory];\n\n var customEmoji = _objectSpread({}, emoji, {\n // `` expects emoji to have an `id`.\n id: emoji.short_names[0],\n custom: true\n });\n\n category.emojis.push(customEmoji);\n\n _this.CUSTOM.push(customEmoji);\n });\n allCategories = allCategories.concat(Object.keys(customCategories).map(function (key) {\n return customCategories[key];\n }));\n }\n\n _this.hideRecent = true;\n\n if (props.include != undefined) {\n allCategories.sort(function (a, b) {\n if (props.include.indexOf(a.id) > props.include.indexOf(b.id)) {\n return 1;\n }\n\n return -1;\n });\n }\n\n for (var categoryIndex = 0; categoryIndex < allCategories.length; categoryIndex++) {\n var category = allCategories[categoryIndex];\n var isIncluded = props.include && props.include.length ? props.include.indexOf(category.id) > -1 : true;\n var isExcluded = props.exclude && props.exclude.length ? props.exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n continue;\n }\n\n if (props.emojisToShowFilter) {\n var newEmojis = [];\n var emojis = category.emojis;\n\n for (var emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {\n var emoji = emojis[emojiIndex];\n\n if (props.emojisToShowFilter(_this.data.emojis[emoji] || emoji)) {\n newEmojis.push(emoji);\n }\n }\n\n if (newEmojis.length) {\n var newCategory = {\n emojis: newEmojis,\n name: category.name,\n id: category.id\n };\n\n _this.categories.push(newCategory);\n }\n } else {\n _this.categories.push(category);\n }\n }\n\n var includeRecent = props.include && props.include.length ? props.include.indexOf(_this.RECENT_CATEGORY.id) > -1 : true;\n var excludeRecent = props.exclude && props.exclude.length ? props.exclude.indexOf(_this.RECENT_CATEGORY.id) > -1 : false;\n\n if (includeRecent && !excludeRecent) {\n _this.hideRecent = false;\n\n _this.categories.unshift(_this.RECENT_CATEGORY);\n }\n\n if (_this.categories[0]) {\n _this.categories[0].first = true;\n }\n\n _this.categories.unshift(_this.SEARCH_CATEGORY);\n\n _this.setAnchorsRef = _this.setAnchorsRef.bind(_assertThisInitialized(_this));\n _this.handleAnchorClick = _this.handleAnchorClick.bind(_assertThisInitialized(_this));\n _this.setSearchRef = _this.setSearchRef.bind(_assertThisInitialized(_this));\n _this.handleSearch = _this.handleSearch.bind(_assertThisInitialized(_this));\n _this.setScrollRef = _this.setScrollRef.bind(_assertThisInitialized(_this));\n _this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));\n _this.handleScrollPaint = _this.handleScrollPaint.bind(_assertThisInitialized(_this));\n _this.handleEmojiOver = _this.handleEmojiOver.bind(_assertThisInitialized(_this));\n _this.handleEmojiLeave = _this.handleEmojiLeave.bind(_assertThisInitialized(_this));\n _this.handleEmojiClick = _this.handleEmojiClick.bind(_assertThisInitialized(_this));\n _this.handleEmojiSelect = _this.handleEmojiSelect.bind(_assertThisInitialized(_this));\n _this.setPreviewRef = _this.setPreviewRef.bind(_assertThisInitialized(_this));\n _this.handleSkinChange = _this.handleSkinChange.bind(_assertThisInitialized(_this));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));\n _this.handleDarkMatchMediaChange = _this.handleDarkMatchMediaChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(NimblePicker, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.state.firstRender) {\n this.testStickyPosition();\n this.firstRenderTimeout = setTimeout(function () {\n _this2.setState({\n firstRender: false\n });\n }, 60);\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.updateCategoriesSize();\n this.handleScroll();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.SEARCH_CATEGORY.emojis = null;\n clearTimeout(this.leaveTimeout);\n clearTimeout(this.firstRenderTimeout);\n\n if (this.darkMatchMedia) {\n this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange);\n }\n }\n }, {\n key: \"testStickyPosition\",\n value: function testStickyPosition() {\n var stickyTestElement = document.createElement('div');\n var prefixes = ['', '-webkit-', '-ms-', '-moz-', '-o-'];\n prefixes.forEach(function (prefix) {\n return stickyTestElement.style.position = \"\".concat(prefix, \"sticky\");\n });\n this.hasStickyPosition = !!stickyTestElement.style.position.length;\n }\n }, {\n key: \"getPreferredTheme\",\n value: function getPreferredTheme() {\n if (this.props.theme != 'auto') return this.props.theme;\n if (this.state.theme) return this.state.theme;\n if (typeof matchMedia !== 'function') return PickerDefaultProps.theme;\n\n if (!this.darkMatchMedia) {\n this.darkMatchMedia = matchMedia('(prefers-color-scheme: dark)');\n this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange);\n }\n\n if (this.darkMatchMedia.media.match(/^not/)) return PickerDefaultProps.theme;\n return this.darkMatchMedia.matches ? 'dark' : 'light';\n }\n }, {\n key: \"handleDarkMatchMediaChange\",\n value: function handleDarkMatchMediaChange() {\n this.setState({\n theme: this.darkMatchMedia.matches ? 'dark' : 'light'\n });\n }\n }, {\n key: \"handleEmojiOver\",\n value: function handleEmojiOver(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n } // Use Array.prototype.find() when it is more widely supported.\n\n\n var emojiData = this.CUSTOM.filter(function (customEmoji) {\n return customEmoji.id === emoji.id;\n })[0];\n\n for (var key in emojiData) {\n if (emojiData.hasOwnProperty(key)) {\n emoji[key] = emojiData[key];\n }\n }\n\n preview.setState({\n emoji: emoji\n });\n clearTimeout(this.leaveTimeout);\n }\n }, {\n key: \"handleEmojiLeave\",\n value: function handleEmojiLeave(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n }\n\n this.leaveTimeout = setTimeout(function () {\n preview.setState({\n emoji: null\n });\n }, 16);\n }\n }, {\n key: \"handleEmojiClick\",\n value: function handleEmojiClick(emoji, e) {\n this.props.onClick(emoji, e);\n this.handleEmojiSelect(emoji);\n }\n }, {\n key: \"handleEmojiSelect\",\n value: function handleEmojiSelect(emoji) {\n var _this3 = this;\n\n this.props.onSelect(emoji);\n if (!this.hideRecent && !this.props.recent) frequently.add(emoji);\n var component = this.categoryRefs['category-1'];\n\n if (component) {\n var maxMargin = component.maxMargin;\n\n if (this.props.enableFrequentEmojiSort) {\n component.forceUpdate();\n }\n\n requestAnimationFrame(function () {\n if (!_this3.scroll) return;\n component.memoizeSize();\n if (maxMargin == component.maxMargin) return;\n\n _this3.updateCategoriesSize();\n\n _this3.handleScrollPaint();\n\n if (_this3.SEARCH_CATEGORY.emojis) {\n component.updateDisplay('none');\n }\n });\n }\n }\n }, {\n key: \"handleScroll\",\n value: function handleScroll() {\n if (!this.waitingForPaint) {\n this.waitingForPaint = true;\n requestAnimationFrame(this.handleScrollPaint);\n }\n }\n }, {\n key: \"handleScrollPaint\",\n value: function handleScrollPaint() {\n this.waitingForPaint = false;\n\n if (!this.scroll) {\n return;\n }\n\n var activeCategory = null;\n\n if (this.SEARCH_CATEGORY.emojis) {\n activeCategory = this.SEARCH_CATEGORY;\n } else {\n var target = this.scroll,\n scrollTop = target.scrollTop,\n scrollingDown = scrollTop > (this.scrollTop || 0),\n minTop = 0;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var ii = scrollingDown ? this.categories.length - 1 - i : i,\n category = this.categories[ii],\n component = this.categoryRefs[\"category-\".concat(ii)];\n\n if (component) {\n var active = component.handleScroll(scrollTop);\n\n if (!minTop || component.top < minTop) {\n if (component.top > 0) {\n minTop = component.top;\n }\n }\n\n if (active && !activeCategory) {\n activeCategory = category;\n }\n }\n }\n\n if (scrollTop < minTop) {\n activeCategory = this.categories.filter(function (category) {\n return !(category.anchor === false);\n })[0];\n } else if (scrollTop + this.clientHeight >= this.scrollHeight) {\n activeCategory = this.categories[this.categories.length - 1];\n }\n }\n\n if (activeCategory) {\n var anchors = this.anchors,\n _activeCategory = activeCategory,\n categoryName = _activeCategory.name;\n\n if (anchors.state.selected != categoryName) {\n anchors.setState({\n selected: categoryName\n });\n }\n }\n\n this.scrollTop = scrollTop;\n }\n }, {\n key: \"handleSearch\",\n value: function handleSearch(emojis) {\n this.SEARCH_CATEGORY.emojis = emojis;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs[\"category-\".concat(i)];\n\n if (component && component.props.name != 'Search') {\n var display = emojis ? 'none' : 'inherit';\n component.updateDisplay(display);\n }\n }\n\n this.forceUpdate();\n\n if (this.scroll) {\n this.scroll.scrollTop = 0;\n }\n\n this.handleScroll();\n }\n }, {\n key: \"handleAnchorClick\",\n value: function handleAnchorClick(category, i) {\n var component = this.categoryRefs[\"category-\".concat(i)],\n scroll = this.scroll,\n anchors = this.anchors,\n scrollToComponent = null;\n\n scrollToComponent = function scrollToComponent() {\n if (component) {\n var top = component.top;\n\n if (category.first) {\n top = 0;\n } else {\n top += 1;\n }\n\n scroll.scrollTop = top;\n }\n };\n\n if (this.SEARCH_CATEGORY.emojis) {\n this.handleSearch(null);\n this.search.clear();\n requestAnimationFrame(scrollToComponent);\n } else {\n scrollToComponent();\n }\n }\n }, {\n key: \"handleSkinChange\",\n value: function handleSkinChange(skin) {\n var newState = {\n skin: skin\n },\n onSkinChange = this.props.onSkinChange;\n this.setState(newState);\n store.update(newState);\n onSkinChange(skin);\n }\n }, {\n key: \"handleKeyDown\",\n value: function handleKeyDown(e) {\n var handled = false;\n\n switch (e.keyCode) {\n case 13:\n var emoji;\n\n if (this.SEARCH_CATEGORY.emojis && this.SEARCH_CATEGORY.emojis.length && (emoji = getSanitizedData(this.SEARCH_CATEGORY.emojis[0], this.state.skin, this.props.set, this.props.data))) {\n this.handleEmojiSelect(emoji);\n handled = true;\n }\n\n break;\n }\n\n if (handled) {\n e.preventDefault();\n }\n }\n }, {\n key: \"updateCategoriesSize\",\n value: function updateCategoriesSize() {\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs[\"category-\".concat(i)];\n if (component) component.memoizeSize();\n }\n\n if (this.scroll) {\n var target = this.scroll;\n this.scrollHeight = target.scrollHeight;\n this.clientHeight = target.clientHeight;\n }\n }\n }, {\n key: \"getCategories\",\n value: function getCategories() {\n return this.state.firstRender ? this.categories.slice(0, 3) : this.categories;\n }\n }, {\n key: \"setAnchorsRef\",\n value: function setAnchorsRef(c) {\n this.anchors = c;\n }\n }, {\n key: \"setSearchRef\",\n value: function setSearchRef(c) {\n this.search = c;\n }\n }, {\n key: \"setPreviewRef\",\n value: function setPreviewRef(c) {\n this.preview = c;\n }\n }, {\n key: \"setScrollRef\",\n value: function setScrollRef(c) {\n this.scroll = c;\n }\n }, {\n key: \"setCategoryRef\",\n value: function setCategoryRef(name, c) {\n if (!this.categoryRefs) {\n this.categoryRefs = {};\n }\n\n this.categoryRefs[name] = c;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$props = this.props,\n perLine = _this$props.perLine,\n emojiSize = _this$props.emojiSize,\n set = _this$props.set,\n sheetSize = _this$props.sheetSize,\n sheetColumns = _this$props.sheetColumns,\n sheetRows = _this$props.sheetRows,\n style = _this$props.style,\n title = _this$props.title,\n emoji = _this$props.emoji,\n color = _this$props.color,\n _native = _this$props[\"native\"],\n backgroundImageFn = _this$props.backgroundImageFn,\n emojisToShowFilter = _this$props.emojisToShowFilter,\n showPreview = _this$props.showPreview,\n showSkinTones = _this$props.showSkinTones,\n emojiTooltip = _this$props.emojiTooltip,\n useButton = _this$props.useButton,\n include = _this$props.include,\n exclude = _this$props.exclude,\n recent = _this$props.recent,\n autoFocus = _this$props.autoFocus,\n skinEmoji = _this$props.skinEmoji,\n notFound = _this$props.notFound,\n notFoundEmoji = _this$props.notFoundEmoji;\n var width = perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar();\n var theme = this.getPreferredTheme();\n var skin = this.props.skin || this.state.skin || store.get('skin') || this.props.defaultSkin;\n return React.createElement(\"section\", {\n style: _objectSpread({\n width: width\n }, style),\n className: \"emoji-mart emoji-mart-\".concat(theme),\n \"aria-label\": title,\n onKeyDown: this.handleKeyDown\n }, React.createElement(\"div\", {\n className: \"emoji-mart-bar\"\n }, React.createElement(Anchors, {\n ref: this.setAnchorsRef,\n data: this.data,\n i18n: this.i18n,\n color: color,\n categories: this.categories,\n onAnchorClick: this.handleAnchorClick,\n icons: this.icons\n })), React.createElement(Search, {\n ref: this.setSearchRef,\n onSearch: this.handleSearch,\n data: this.data,\n i18n: this.i18n,\n emojisToShowFilter: emojisToShowFilter,\n include: include,\n exclude: exclude,\n custom: this.CUSTOM,\n autoFocus: autoFocus\n }), React.createElement(\"div\", {\n ref: this.setScrollRef,\n className: \"emoji-mart-scroll\",\n onScroll: this.handleScroll\n }, this.getCategories().map(function (category, i) {\n return React.createElement(Category, {\n ref: _this4.setCategoryRef.bind(_this4, \"category-\".concat(i)),\n key: category.name,\n id: category.id,\n name: category.name,\n emojis: category.emojis,\n perLine: perLine,\n \"native\": _native,\n hasStickyPosition: _this4.hasStickyPosition,\n data: _this4.data,\n i18n: _this4.i18n,\n recent: category.id == _this4.RECENT_CATEGORY.id ? recent : undefined,\n custom: category.id == _this4.RECENT_CATEGORY.id ? _this4.CUSTOM : undefined,\n emojiProps: {\n \"native\": _native,\n skin: skin,\n size: emojiSize,\n set: set,\n sheetSize: sheetSize,\n sheetColumns: sheetColumns,\n sheetRows: sheetRows,\n forceSize: _native,\n tooltip: emojiTooltip,\n backgroundImageFn: backgroundImageFn,\n useButton: useButton,\n onOver: _this4.handleEmojiOver,\n onLeave: _this4.handleEmojiLeave,\n onClick: _this4.handleEmojiClick\n },\n notFound: notFound,\n notFoundEmoji: notFoundEmoji\n });\n })), (showPreview || showSkinTones) && React.createElement(\"div\", {\n className: \"emoji-mart-bar\"\n }, React.createElement(Preview, {\n ref: this.setPreviewRef,\n data: this.data,\n title: title,\n emoji: emoji,\n showSkinTones: showSkinTones,\n showPreview: showPreview,\n emojiProps: {\n \"native\": _native,\n size: 38,\n skin: skin,\n set: set,\n sheetSize: sheetSize,\n sheetColumns: sheetColumns,\n sheetRows: sheetRows,\n backgroundImageFn: backgroundImageFn\n },\n skinsProps: {\n skin: skin,\n onChange: this.handleSkinChange,\n skinEmoji: skinEmoji\n },\n i18n: this.i18n\n })));\n }\n }]);\n\n return NimblePicker;\n}(React.PureComponent);\n\nexport { NimblePicker as default };\nNimblePicker.propTypes\n/* remove-proptypes */\n= _objectSpread({}, PickerPropTypes, {\n data: PropTypes.object.isRequired\n});\nNimblePicker.defaultProps = _objectSpread({}, PickerDefaultProps);","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimblePicker from './nimble-picker';\nimport { PickerPropTypes } from '../../utils/shared-props';\nimport { PickerDefaultProps } from '../../utils/shared-default-props';\n\nvar Picker =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(Picker, _React$PureComponent);\n\n function Picker() {\n _classCallCheck(this, Picker);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Picker).apply(this, arguments));\n }\n\n _createClass(Picker, [{\n key: \"render\",\n value: function render() {\n return React.createElement(NimblePicker, _extends({}, this.props, this.state));\n }\n }]);\n\n return Picker;\n}(React.PureComponent);\n\nexport { Picker as default };\nPicker.propTypes\n/* remove-proptypes */\n= PickerPropTypes;\nPicker.defaultProps = _objectSpread({}, PickerDefaultProps, {\n data: data\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimbleEmoji from './nimble-emoji';\nimport { EmojiPropTypes } from '../../utils/shared-props';\nimport { EmojiDefaultProps } from '../../utils/shared-default-props';\n\nvar Emoji = function Emoji(props) {\n for (var k in Emoji.defaultProps) {\n if (props[k] == undefined && Emoji.defaultProps[k] != undefined) {\n props[k] = Emoji.defaultProps[k];\n }\n }\n\n return NimbleEmoji(_objectSpread({}, props));\n};\n\nEmoji.propTypes\n/* remove-proptypes */\n= EmojiPropTypes;\nEmoji.defaultProps = _objectSpread({}, EmojiDefaultProps, {\n data: data\n});\nexport default Emoji;","// vendors\nimport React, { memo, useMemo } from \"react\";\nimport { Picker } from \"emoji-mart\";\nimport t from \"prop-types\";\nimport \"emoji-mart/css/emoji-mart.css\";\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n * @return {React.FC}\n */\nfunction EmojiPicker(props) {\n const {\n theme,\n onSelectEmoji,\n disableRecent,\n customEmojis\n } = props;\n\n const excludePicker = useMemo(() => {\n /** @type import(\"emoji-mart\").CategoryName[] */\n const exclude = [];\n\n if (disableRecent) {\n exclude.push(\"recent\");\n }\n\n return exclude;\n }, [disableRecent]);\n\n return (\n \n );\n}\n\nEmojiPicker.propTypes = {\n theme: t.oneOf(['light', 'dark', 'auto']),\n onSelectEmoji: t.func,\n disableRecent: t.bool,\n customEmojis: t.array\n};\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis\n}) {\n return (\n
\n {showPicker && (\n evt.stopPropagation()}\n >\n
\n \n
\n
\n )}\n \n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch>]} */\n const [customButton, setCustomButton] = useState();\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n \n \n ,\n customButton\n ))\n ) : (\n (<>\n \n \n )\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\nimport t from \"prop-types\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `${selectedText}${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n \n {usersFiltered.map((user, index) => (\n
  • \n setSelectedUser(index)}\n >\n \n \n \n
  • \n ))}\n \n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nMentionUserListWithRef.propTypes = {\n users: t.array.isRequired\n};\n\nexport default MentionUserListWithRef;\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `@${user.name} `\n );\n }\n\n return (\n <>\n {loading ? (\n
    \n
    \n
    \n Loading...\n
    \n
    \n
    \n ) : (\n showUserList && (\n evt.stopPropagation()}\n >\n \n \n )\n )}\n \n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"} theme\n * @property {boolean} cleanOnEnter\n * @property {(text: string) => void} onEnter\n * @property {string} placeholder\n * @property {(size: {width: number, height: number}) => void} onResize\n * @property {() => void} onClick\n * @property {() => void} onFocus\n * @property {() => void=} onBlur\n * @property {number} maxLength\n * @property {boolean} keepOpened\n * @property {(event: KeyboardEvent) => void} onKeyDown\n * @property {string} inputClass\n * @property {boolean} disableRecent\n * @property {number} tabIndex\n * @property {number} height\n * @property {number} borderRadius\n * @property {string} borderColor\n * @property {number} fontSize\n * @property {string} fontFamily\n * @property {object[]=} customEmojis\n * @property {(text: string) => Promise=} searchMention\n * @property {HTMLDivElement=} buttonElement\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n searchMention,\n buttonElement,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily\n } = props;\n\n /** @type {React.MutableRefObject} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize();\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n value => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n useEffect(() => {\n updateHTML();\n }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n emitChange(sanitizedTextRef.current);\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\n function handleCopy(event) {\n event.clipboardData.setData(\"text\", sanitizedTextRef.current);\n event.preventDefault();\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n
    \n \n \n \n
    \n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n tabIndex: 0,\n customEmojis: []\n};\n\nexport default InputEmojiWithRef;\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref} ref\n * @property {React.MutableRefObject} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange }) {\n const { sanitize, sanitizedTextRef } = useSanitize();\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","import React, { useState, useEffect, Fragment, useMemo } from \"react\";\nimport { imageMapper } from \"../../../../../ImageMapper\";\nimport \"./style.css\";\nimport { CXGroup } from \"component/Input\";\nimport InputEmoji from \"react-input-emoji\";\nimport { useSelector } from \"react-redux\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CheckCircleOutlined, CloseCircleOutlined } from \"@ant-design/icons\";\nimport { CXSwitch } from \"component/Switch\";\nconst btnIdGen = () => {\n const array = new Uint32Array(1);\n window?.crypto?.getRandomValues(array);\n const randomNumber = (array[0] % 900) + 100;\n return `btn_${randomNumber}`;\n};\nconst Index = ({ AddText, data }) => {\n const { jumpLocationSet, AccountIntents } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const [visible, setVisible] = useState(false);\n const [buttonData, setbuttonData] = useState(data.buttons);\n const [Active, setActive] = useState(\"\");\n const [BtnName, setBtnName] = useState(\"\");\n const [BtnValueOnClick, setBtnOnClick] = useState(null);\n const [metaVal, setmetaVal] = useState(null);\n const [intent, setintent] = useState(\"\");\n const [ActiveIntent, setActiveIntent] = useState(false);\n const addButton = () => {\n const button = {\n text: \"Add button name\",\n onClick: \"sendBack\",\n _id: btnIdGen(),\n intent: \"\",\n meta: {\n type: \"cf\",\n },\n };\n setbuttonData([...buttonData, button]);\n };\n const handleDeleteBtn = (loc) => {\n let newAry = buttonData.filter((res) => res._id !== loc);\n setbuttonData(newAry);\n };\n const activeBtn = (res) => {\n setActive(res?._id);\n setmetaVal(null);\n setintent(res?.intent ?? \"\");\n setActiveIntent(res?.intent ? true : false);\n setBtnOnClick(res?.onClick);\n setTimeout(() => {\n setBtnName(res?.text ?? \"\");\n }, 1);\n };\n const changeBtnName = (index) => {\n buttonData[index].text = BtnName ?? buttonData[index].text;\n buttonData[index].value = BtnName ?? buttonData[index].value;\n buttonData[index].onClick = BtnValueOnClick ?? buttonData[index].onClick;\n buttonData[index].intent = intent ?? buttonData[index]?.intent;\n buttonData[index].meta = {\n jt: [\"back\", \"home\"].includes(metaVal)\n ? metaVal\n : buttonData[index].meta.jt\n ? buttonData[index].meta.jt\n : \"id\",\n ref: [\"back\", \"home\"].includes(metaVal)\n ? null\n : buttonData[index].meta.ref\n ? buttonData[index].meta.ref\n : metaVal\n ? metaVal\n : null,\n };\n activeBtn(null);\n setmetaVal(null);\n setBtnOnClick(null);\n };\n useEffect(() => {\n data.buttons = buttonData;\n }, [buttonData]);\n return (\n
    \n {buttonData.map((res, i) => {\n return (\n \n {Active !== res._id && (\n
    setVisible(res._id)}>\n
    \n activeBtn(res)}\n style={{\n height: \"14px\",\n marginTop: \"5px\",\n cursor: \"pointer\",\n marginRight: 7,\n }}\n />\n handleDeleteBtn(res._id)}\n style={{\n height: \"12px\",\n cursor: \"pointer\",\n width: \"12x\",\n marginTop: \"6px\",\n }}\n />\n
    \n \n {res.text}\n
    \n )}\n {Active === res._id && (\n \n \n \n setBtnOnClick(val)}\n value={BtnValueOnClick}\n defaultValue={res.onClick}\n >\n Send Back\n Open URL\n Jump\n \n {BtnValueOnClick === \"jumper\" && (\n setmetaVal(val, d)}\n defaultValue={res.meta.ref ?? res.meta.jt}\n >\n One Step Back\n Main Menu\n {jumpLocationSet.map((res) => {\n return {res.name};\n })}\n \n )}\n
    \n
    \n Enable intents \n {\n setActiveIntent(e);\n !e && setintent(\"\");\n }}\n />\n
    \n {ActiveIntent && (\n
    \n {\n setintent(val);\n }}\n value={intent}\n >\n {AccountIntents?.map((res) => {\n return {res.name};\n })}\n \n
    \n )}\n
    \n changeBtnName(i)}\n style={{ color: \"#018fff\" }}\n />\n activeBtn(null)}\n style={{ color: \"red\" }}\n />\n
    \n \n )}\n \n );\n })}\n\n
    addButton()}>\n + {AddText}\n
    \n \n );\n};\n\nexport default Index;\n","import React, { useEffect, useState } from \"react\";\nimport Heading from \"./Heading\";\nimport Buttons from \"./Buttons\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport { getIntentbyId } from \"action/BotAiAction\";\nimport { useDispatch } from \"react-redux\";\nimport { getAccountintents } from \"action/WorkbenchAction\";\n\nconst Button = ({ ondelete, data, delDisable }) => {\n const dispatch = useDispatch();\n useEffect(() => {\n dispatch(getAccountintents());\n }, []);\n return (\n
    \n
    \n \n {!delDisable && (\n ondelete(data)}\n />\n )}\n
    \n
    \n \n
    \n
    \n );\n};\n\nexport default Button;\n","import CXUpload from \"component/Upload\";\nimport { postFormData } from \"helper/networkClient\";\nimport React, { useState } from \"react\";\nimport { getBase64 } from \"utils\";\n\nexport const FileUpload = ({\n uploadText,\n height,\n setlink = null,\n preview,\n defaultValue = null,\n}) => {\n const [previewImage, setPreviewImage] = useState(defaultValue ?? \"\");\n const logoHandler = async (file) => {\n if (!file.url && !file.preview) {\n file.preview = await getBase64(file);\n }\n setPreviewImage(file.url || file.preview);\n const formData = new FormData();\n formData.append(\"file\", file);\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setlink(resp.data.data.url);\n setPreviewImage(resp.data.data.url);\n } else {\n }\n });\n };\n return (\n \n {/* logic need to be fixed for better implementation */}\n {previewImage?.length > 0\n ? preview && (\n \n )\n : preview && {uploadText}}\n {!preview && {uploadText}}\n \n );\n};\n","function _taggedTemplateLiteral(e, t) {\n return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {\n raw: {\n value: Object.freeze(t)\n }\n }));\n}\nexport { _taggedTemplateLiteral as default };","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n\n// src/log.ts\nvar LogLevel = /* @__PURE__ */ ((LogLevel2) => {\n LogLevel2[LogLevel2[\"DEBUG\"] = 0] = \"DEBUG\";\n LogLevel2[LogLevel2[\"INFO\"] = 1] = \"INFO\";\n LogLevel2[LogLevel2[\"WARN\"] = 2] = \"WARN\";\n LogLevel2[LogLevel2[\"ERROR\"] = 3] = \"ERROR\";\n return LogLevel2;\n})(LogLevel || {});\nvar Logger = {\n ENABLED: typeof window !== \"undefined\" && typeof location !== \"undefined\" && location.search.indexOf(\"giphy-debug\") !== -1,\n LEVEL: 0,\n PREFIX: \"GiphyJS\",\n debug: (...msg) => {\n if (Logger.ENABLED && Logger.LEVEL <= 0 /* DEBUG */) {\n console.debug(Logger.PREFIX, ...msg);\n }\n },\n info: (...msg) => {\n if (Logger.ENABLED && Logger.LEVEL <= 1 /* INFO */) {\n console.info(Logger.PREFIX, ...msg);\n }\n },\n warn: (...msg) => {\n if (Logger.ENABLED && Logger.LEVEL <= 2 /* WARN */) {\n console.warn(Logger.PREFIX, ...msg);\n }\n },\n error: (...msg) => {\n if (Logger.ENABLED && Logger.LEVEL <= 3 /* ERROR */) {\n console.error(Logger.PREFIX, ...msg);\n }\n }\n};\n\n// src/bestfit.ts\nvar closestArea = (width, height, renditions) => {\n let currentBest = Infinity;\n let result;\n renditions.forEach((rendition) => {\n const widthPercentage = rendition.width / width;\n const heightPercentage = rendition.height / height;\n const areaPercentage = widthPercentage * heightPercentage;\n const testBest = Math.abs(1 - areaPercentage);\n if (testBest < currentBest) {\n currentBest = testBest;\n result = rendition;\n }\n });\n return result;\n};\nvar SCALE_UP_MAX_PIXELS = 50;\nvar setRenditionScaleUpMaxPixels = (pixels) => {\n Logger.debug(`@giphy/js-util set rendition selection scale up max pixels to ${pixels}`);\n SCALE_UP_MAX_PIXELS = pixels;\n};\nfunction bestfit(renditions, width, height, scaleUpMaxPixels = SCALE_UP_MAX_PIXELS) {\n let [largestRendition] = renditions;\n const testRenditions = renditions.filter((rendition) => {\n if (rendition.width * rendition.height > largestRendition.width * largestRendition.height) {\n largestRendition = rendition;\n }\n return width - rendition.width <= scaleUpMaxPixels && height - rendition.height <= scaleUpMaxPixels;\n });\n if (testRenditions.length === 0) {\n return largestRendition;\n }\n return closestArea(width, height, testRenditions);\n}\nvar bestfit_default = bestfit;\n\n// src/collections.ts\nfunction mapValues(object, mapFn) {\n if (Array.isArray(object)) {\n throw `This map is just for objects, just use array.map for arrays`;\n }\n return Object.keys(object).reduce((result, key) => {\n result[key] = mapFn(object[key], key);\n return result;\n }, {});\n}\nfunction forEach(object, mapFn) {\n if (Array.isArray(object)) {\n throw `This map is just for objects, just use array.forEach for arrays`;\n }\n return Object.keys(object).forEach((key) => {\n mapFn(object[key], key);\n });\n}\nfunction take(arr, count = 0) {\n return arr.slice(0, count);\n}\nfunction without(arr, values) {\n return arr.filter((val) => values.indexOf(val) === -1);\n}\nfunction pick(object, pick2) {\n const res = {};\n pick2.forEach((key) => {\n if (object[key] !== void 0) {\n res[key] = object[key];\n }\n });\n return res;\n}\n\n// src/get-client-rect-from-el.ts\nvar getClientRect = (el) => {\n let left = 0;\n let top = 0;\n const width = el.offsetWidth;\n const height = el.offsetHeight;\n do {\n left += el.offsetLeft;\n top += el.offsetTop;\n el = el.offsetParent;\n } while (el);\n const result = {\n left,\n top,\n width,\n height,\n right: left + width,\n bottom: top + height,\n x: left,\n y: top\n };\n return __spreadProps(__spreadValues({}, result), { toJSON: () => JSON.stringify(result) });\n};\nvar get_client_rect_from_el_default = getClientRect;\n\n// src/get-pingback-id.ts\nimport { v4 as uuid } from \"uuid\";\nvar pingbackId = \"\";\nvar idLength = 16;\nvar noUUIDRandom = () => {\n let result = \"\";\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n const charactersLength = characters.length;\n for (let i = 0; i < idLength; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n};\nvar getPingbackId = () => {\n if (!pingbackId) {\n try {\n pingbackId = sessionStorage.getItem(\"giphyPingbackId\");\n } catch (_) {\n }\n if (!pingbackId) {\n const hexTime = (/* @__PURE__ */ new Date()).getTime().toString(16);\n try {\n pingbackId = `${hexTime}${uuid().replace(/-/g, \"\")}`.substring(0, idLength);\n } catch (error) {\n pingbackId = noUUIDRandom();\n }\n try {\n sessionStorage.setItem(\"giphyPingbackId\", pingbackId);\n } catch (_) {\n }\n }\n }\n return pingbackId;\n};\nvar get_pingback_id_default = getPingbackId;\n\n// src/webp-check.ts\nvar SUPPORTS_WEBP = null;\nvar checkIfWebP = new Promise((resolve) => {\n if (typeof Image === \"undefined\") {\n resolve(false);\n }\n const webp = new Image();\n webp.onload = () => {\n SUPPORTS_WEBP = true;\n resolve(SUPPORTS_WEBP);\n };\n webp.onerror = () => {\n SUPPORTS_WEBP = false;\n resolve(SUPPORTS_WEBP);\n };\n webp.src = \"data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA\";\n});\n\n// src/gif-utils.ts\nvar getSpecificRendition = ({ images, is_sticker: isSticker }, renditionLabel, isStill = false, useVideo = false) => {\n if (!images || !renditionLabel)\n return \"\";\n isStill = isStill && !useVideo;\n const rendition = images[`${renditionLabel}${isStill ? \"_still\" : \"\"}`];\n if (rendition) {\n if (isSticker || isStill) {\n return rendition.url;\n }\n const webP = SUPPORTS_WEBP && rendition.webp;\n return useVideo ? rendition.mp4 : webP || rendition.url;\n }\n return \"\";\n};\nvar getBestVideo = (video, width, height) => {\n let assets = video == null ? void 0 : video.assets;\n if (assets) {\n assets = __spreadValues({}, assets);\n delete assets.source;\n const filteredAssets = Object.values(assets).sort((a, b) => a.width - b.width);\n return bestfit_default(filteredAssets, width, height);\n }\n};\nvar getRenditions = (type, images, video) => type === \"video\" && video && video.previews && !Object.keys(images).length ? video.previews : images;\nvar getBestRendition = (images, gifWidth, gifHeight, scaleUpMaxPixels) => {\n const checkRenditions = pick(images, [\n \"original\",\n \"fixed_width\",\n \"fixed_height\",\n \"fixed_width_small\",\n \"fixed_height_small\"\n ]);\n const testImages = Object.entries(checkRenditions).map(([renditionName, val]) => __spreadValues({\n renditionName\n }, val));\n return bestfit_default(testImages, gifWidth, gifHeight, scaleUpMaxPixels);\n};\nvar getBestRenditionUrl = ({ images, video, type }, gifWidth, gifHeight, options = { isStill: false, useVideo: false }) => {\n if (!gifWidth || !gifHeight || !images)\n return \"\";\n const { useVideo, isStill, scaleUpMaxPixels } = options;\n const renditions = getRenditions(type, images, video);\n const { renditionName } = getBestRendition(renditions, gifWidth, gifHeight, scaleUpMaxPixels);\n const key = `${renditionName}${isStill && !useVideo ? \"_still\" : \"\"}`;\n const rendition = renditions[key];\n const match = useVideo ? rendition.mp4 : SUPPORTS_WEBP && rendition.webp ? rendition.webp : rendition.url;\n return match || \"\";\n};\nvar getGifHeight = ({ images }, gifWidth) => {\n const { fixed_width } = images;\n if (fixed_width) {\n const { width, height } = fixed_width;\n const aspectRatio = width / height;\n return Math.round(gifWidth / aspectRatio);\n }\n return 0;\n};\nvar getGifWidth = ({ images }, gifHeight) => {\n const { fixed_width } = images;\n if (fixed_width) {\n const { width, height } = fixed_width;\n const aspectRatio = width / height;\n return Math.round(gifHeight * aspectRatio);\n }\n return 0;\n};\nvar getAltText = ({ alt_text, user, tags = [], is_sticker = false, title = \"\" }) => {\n if (alt_text) {\n return alt_text;\n }\n if (title) {\n return title;\n }\n const username = user && user.username || \"\";\n const filteredTags = take(without(tags, [\"transparent\"]), username ? 4 : 5);\n return `${username ? `${username} ` : ``}${filteredTags.join(\" \")} ${is_sticker ? \"Sticker\" : \"GIF\"}`;\n};\n\n// src/sdk-headers.ts\nvar gl = (typeof window !== \"undefined\" ? window : global) || {};\ngl._GIPHY_SDK_HEADERS_ = gl._GIPHY_SDK_HEADERS_ || (gl.Headers ? new gl.Headers({\n \"X-GIPHY-SDK-PLATFORM\": \"web\"\n}) : void 0);\nvar getGiphySDKRequestHeaders = () => gl._GIPHY_SDK_HEADERS_;\nvar appendGiphySDKRequestHeader = (key, value) => {\n var _a;\n return (_a = getGiphySDKRequestHeaders()) == null ? void 0 : _a.set(key, value);\n};\nvar appendGiphySDKRequestParam = (key, value) => {\n var _a;\n return (_a = getGiphySDKRequestHeaders()) == null ? void 0 : _a.set(key, value);\n};\nexport {\n LogLevel,\n Logger,\n appendGiphySDKRequestHeader,\n appendGiphySDKRequestParam,\n bestfit_default as bestfit,\n checkIfWebP,\n forEach,\n getAltText,\n getBestRendition,\n getBestRenditionUrl,\n getBestVideo,\n get_client_rect_from_el_default as getClientRect,\n getGifHeight,\n getGifWidth,\n getGiphySDKRequestHeaders,\n get_pingback_id_default as getPingbackId,\n getSpecificRendition,\n mapValues,\n pick,\n setRenditionScaleUpMaxPixels,\n take,\n without\n};\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","import * as React from 'react';\nimport { createContext, useContext, forwardRef, createElement, Fragment } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = useContext(ThemeContext);\n return /*#__PURE__*/createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : function useInsertionEffect(create) {\n create();\n};\nfunction useInsertionEffectMaybe(create) {\n\n useInsertionEffect(create);\n}\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectMaybe(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nexport { CacheProvider as C, Emotion as E, ThemeContext as T, __unsafe_useEmotionCache as _, useTheme as a, ThemeProvider as b, createEmotionProps as c, withTheme as d, hasOwnProperty as h, useInsertionEffectMaybe as u, withEmotionCache as w };\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport { useContext, createElement, Fragment } from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : function useInsertionEffect(create) {\n create();\n};\nfunction useInsertionEffectMaybe(create) {\n\n useInsertionEffect(create);\n}\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectMaybe(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if ( // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport default createStyled;\n","import '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport default newStyled;\n","// src/index.ts\nvar giphyBlack = \"#121212\";\nvar giphyDarkestGrey = \"#212121\";\nvar giphyDarkGrey = \"#2e2e2e\";\nvar giphyDarkCharcoal = \"#3e3e3e\";\nvar giphyCharcoal = \"#4a4a4a\";\nvar giphyLightCharcoal = \"#5c5c5c\";\nvar giphyLightGrey = \"#a6a6a6\";\nvar giphyLightestGrey = \"#d8d8d8\";\nvar giphyWhiteSmoke = \"#ececec\";\nvar giphyWhite = \"#ffffff\";\nvar giphyBlue = \"#00ccff\";\nvar giphyGreen = \"#00ff99\";\nvar giphyPurple = \"#9933ff\";\nvar giphyRed = \"#ff6666\";\nvar giphyYellow = \"#fff35c\";\nvar giphyAqua = \"#00e6cc\";\nvar giphyLightBlue = \"#3191ff\";\nvar giphyIndigo = \"#6157ff\";\nvar giphyPink = \"#e646b6\";\nvar facebookColor = \"#3894fc\";\nvar twitterColor = \"#00ccff\";\nvar pinterestColor = \"#e54cb5\";\nvar tumblrColor = \"#529ecc\";\nvar instagramColor = \"#c23c8d\";\nvar redditColor = \"#fc6669\";\nvar smsColor = \"#00ff99\";\nvar errorColor = giphyRed;\nvar deleteColor = giphyRed;\nvar primaryCTA = giphyIndigo;\nvar primaryCTADisabled = \"#241F74\";\nvar secondaryCTA = giphyCharcoal;\nvar dimColor = `rgba(0, 0, 0, 0.8)`;\nvar gifOverlayColor = `rgba(0, 0, 0, 0.4)`;\nexport {\n deleteColor,\n dimColor,\n errorColor,\n facebookColor,\n gifOverlayColor,\n giphyAqua,\n giphyBlack,\n giphyBlue,\n giphyCharcoal,\n giphyDarkCharcoal,\n giphyDarkGrey,\n giphyDarkestGrey,\n giphyGreen,\n giphyIndigo,\n giphyLightBlue,\n giphyLightCharcoal,\n giphyLightGrey,\n giphyLightestGrey,\n giphyPink,\n giphyPurple,\n giphyRed,\n giphyWhite,\n giphyWhiteSmoke,\n giphyYellow,\n instagramColor,\n pinterestColor,\n primaryCTA,\n primaryCTADisabled,\n redditColor,\n secondaryCTA,\n smsColor,\n tumblrColor,\n twitterColor\n};\n","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\")\n return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// package.json\nvar require_package = __commonJS({\n \"package.json\"(exports, module) {\n module.exports = {\n scripts: {\n lint: \"run -T eslint . --ext .ts,.tsx\",\n clean: \"rm -rf ./dist\",\n dev: \"parcel public/test.html\",\n docs: \"typedoc src/index.ts\",\n build: \"run -T tsup src/index.ts --format cjs,esm --dts && run -T publint\",\n prepublish: \"npm run clean && npm run build\",\n test: \"run -T jest --config ./jestconfig.js\",\n \"test:watch\": \"run -T jest --config ./jestconfig.js --watchAll\"\n },\n name: \"@giphy/js-fetch-api\",\n version: \"5.6.0\",\n description: \"Javascript API to fetch gifs and stickers from the GIPHY API.\",\n homepage: \"https://github.com/Giphy/giphy-js/tree/master/packages/fetch-api\",\n main: \"dist/index.cjs\",\n types: \"dist/index.d.ts\",\n module: \"dist/index.js\",\n type: \"module\",\n sideEffects: false,\n exports: {\n \".\": {\n types: \"./dist/index.d.ts\",\n import: \"./dist/index.js\",\n require: \"./dist/index.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n files: [\n \"dist/\",\n \"src/**/*\"\n ],\n license: \"MIT\",\n publishConfig: {\n access: \"public\"\n },\n dependencies: {\n \"@giphy/js-types\": \"*\",\n \"@giphy/js-util\": \"*\"\n },\n devDependencies: {\n \"jest-fetch-mock\": \"^3.0.3\",\n \"parcel-bundler\": \"latest\",\n typedoc: \"^0.20.37\",\n \"typedoc-thunder-theme\": \"^0.0.3\",\n typescript: \"^5.0.4\"\n }\n };\n }\n});\n\n// src/index.ts\nimport { appendGiphySDKRequestHeader, getGiphySDKRequestHeaders } from \"@giphy/js-util\";\n\n// src/api.ts\nimport { getPingbackId } from \"@giphy/js-util\";\n\n// src/normalize/gif.ts\nvar BOOL_PROPS = [\n \"is_anonymous\",\n \"is_community\",\n \"is_featured\",\n \"is_hidden\",\n \"is_indexable\",\n \"is_preserve_size\",\n \"is_realtime\",\n \"is_removed\",\n \"is_sticker\",\n \"is_dynamic\"\n // not finalized, and not adding to Gif type until type RFC is finished\n];\nvar USER_BOOL_PROPS = [\"suppress_chrome\", \"is_public\", \"is_verified\"];\nvar makeBool = (obj) => (prop) => obj[prop] = !!obj[prop];\nvar getTag = (tag) => typeof tag === \"string\" ? tag : tag.text;\nvar normalize = (gif, responseId = \"\") => {\n const newGif = __spreadValues({}, gif);\n newGif.id = String(newGif.id);\n newGif.tags = (newGif.tags || []).map(getTag);\n if (!newGif.bottle_data) {\n newGif.bottle_data = {};\n }\n newGif.response_id = responseId;\n BOOL_PROPS.forEach(makeBool(newGif));\n Object.keys(newGif.images || {}).forEach((name) => {\n const img = newGif.images[name];\n img.width = parseInt(img.width);\n img.height = parseInt(img.height);\n });\n const { user } = newGif;\n if (user) {\n const newUser = __spreadValues({}, user);\n USER_BOOL_PROPS.forEach(makeBool(newUser));\n newGif.user = newUser;\n }\n return newGif;\n};\nvar normalizeGif = (result) => {\n const { response_id } = result.meta;\n result.data = normalize(result.data, response_id);\n return result;\n};\nvar normalizeGifs = (result) => {\n const { response_id } = result.meta;\n result.data = result.data.map((gif) => normalize(gif, response_id));\n return result;\n};\n\n// src/constants.ts\nvar gl = (typeof window !== \"undefined\" ? window : global) || {};\nvar serverUrl = gl.GIPHY_API_URL || \"https://api.giphy.com/v1/\";\nvar setServerUrl = (url) => {\n serverUrl = url;\n};\n\n// src/fetch-error.ts\nvar FetchError = class extends Error {\n constructor(message, url, status = 0, statusText = \"\") {\n super(message);\n this.url = url;\n this.status = status;\n this.statusText = statusText;\n }\n};\nvar GeoFetchError = class extends FetchError {\n};\nvar fetch_error_default = FetchError;\n\n// src/request.ts\nvar ERROR_PREFIX = `@giphy/js-fetch-api: `;\nvar DEFAULT_ERROR = \"Error fetching\";\nvar identity = (i) => i;\nvar requestMap = {};\nvar maxLife = 6e4;\nvar errorMaxLife = 6e3;\nvar purgeCache = () => {\n const now = Date.now();\n Object.keys(requestMap).forEach((key) => {\n const ttl = requestMap[key].isError ? errorMaxLife : maxLife;\n if (now - requestMap[key].ts >= ttl) {\n delete requestMap[key];\n }\n });\n};\nfunction request(url, options = {}) {\n const { apiVersion = 1, noCache = false, normalizer = identity } = options;\n const serverUrl_ = serverUrl.replace(/\\/v\\d+\\/$/, `/v${apiVersion}/`);\n purgeCache();\n if (!requestMap[url] || noCache) {\n const fullUrl = `${serverUrl_}${url}`;\n const makeRequest = () => __async(this, null, function* () {\n var _a2, _b;\n let fetchError;\n try {\n const response = yield fetch(fullUrl, {\n method: \"get\"\n });\n if (response.ok) {\n const result = yield response.json();\n if (!((_a2 = result.meta) == null ? void 0 : _a2.response_id)) {\n throw { message: `synthetic response` };\n } else {\n return normalizer(result);\n }\n } else {\n let message = DEFAULT_ERROR;\n try {\n const result = yield response.json();\n if (result.message)\n message = result.message;\n if ((_b = result.meta) == null ? void 0 : _b.msg)\n message = result.meta.msg;\n } catch (_) {\n }\n if (requestMap[url]) {\n requestMap[url].isError = true;\n }\n let Cls = fetch_error_default;\n if (message === \"This content is not available in your location\") {\n Cls = GeoFetchError;\n }\n fetchError = new Cls(`${ERROR_PREFIX}${message}`, fullUrl, response.status, response.statusText);\n }\n } catch (unexpectedError) {\n fetchError = new fetch_error_default(unexpectedError.message, fullUrl);\n if (requestMap[url]) {\n requestMap[url].isError = true;\n }\n }\n throw fetchError;\n });\n requestMap[url] = { request: makeRequest(), ts: Date.now() };\n }\n return requestMap[url].request;\n}\nvar request_default = request;\n\n// src/api.ts\nvar getType = (options) => options && options.type ? options.type : \"gifs\";\nvar GiphyFetch = class {\n constructor(apiKey, qsParams = {}) {\n /**\n * @hidden\n */\n this.getQS = (options = {}) => {\n const searchParams = new URLSearchParams(__spreadValues(__spreadProps(__spreadValues({}, options), {\n api_key: this.apiKey,\n pingback_id: getPingbackId()\n }), this.qsParams));\n return searchParams.toString();\n };\n this.apiKey = apiKey;\n this.qsParams = qsParams;\n }\n /**\n * A list of categories\n *\n * @param {CategoriesOptions} [options]\n * @returns {Promise}\n */\n categories(options) {\n return request_default(`gifs/categories?${this.getQS(options)}`);\n }\n /**\n * Get a single gif by a id\n * @param {string} id\n * @returns {Promise}\n **/\n gif(id, options) {\n const prefix = (options == null ? void 0 : options.internal) ? \"internal/\" : \"\";\n return request_default(`${prefix}gifs/${id}?${this.getQS()}`, { normalizer: normalizeGif });\n }\n gifs(arg1, arg2) {\n if (Array.isArray(arg1)) {\n return request_default(`gifs?${this.getQS({ ids: arg1.join(\",\") })}`, {\n normalizer: normalizeGifs\n });\n }\n return request_default(`gifs/categories/${arg1}/${arg2}?${this.getQS()}`, {\n normalizer: normalizeGifs\n });\n }\n emoji(options) {\n return request_default(`emoji?${this.getQS(options)}`, { normalizer: normalizeGifs });\n }\n /**\n * Returns a list of all the default emoji variations\n *\n * @param {PaginationOptions} options\n * @returns {Promise}\n **/\n emojiDefaultVariations(options) {\n return request_default(`emoji?${this.getQS(options)}`, {\n apiVersion: 2,\n normalizer: normalizeGifs\n });\n }\n /**\n * Returns a list of gifs representing all the variations for the emoji\n *\n * @param {string} id\n * @returns {Promise}\n **/\n emojiVariations(id) {\n return request_default(`emoji/${id}/variations?${this.getQS()}`, {\n apiVersion: 2,\n normalizer: normalizeGifs\n });\n }\n animate(text, options = {}) {\n const qsParams = this.getQS(__spreadProps(__spreadValues({}, options), { m: text }));\n return request_default(`text/animate?${qsParams}`, { normalizer: normalizeGifs });\n }\n /**\n * @param term: string The term you're searching for\n * @param options: SearchOptions\n * @returns {Promise}\n **/\n search(term, options = {}) {\n const q = options.channel ? `@${options.channel} ${term}` : term;\n let excludeDynamicResults;\n if (options.type === \"text\") {\n excludeDynamicResults = true;\n }\n const qsParams = this.getQS(__spreadProps(__spreadValues({ rating: \"pg-13\" }, options), { q, excludeDynamicResults }));\n return request_default(`${getType(options)}/search?${qsParams}`, { normalizer: normalizeGifs });\n }\n /**\n * Get a list of subcategories\n * @param {string} category\n * @param {SubcategoriesOptions} options\n * @returns {Promise}\n */\n subcategories(category, options) {\n return request_default(`gifs/categories/${category}?${this.getQS(options)}`);\n }\n /**\n * Get trending gifs\n *\n * @param {TrendingOptions} options\n * @returns {Promise}\n */\n trending(options = {}) {\n return request_default(`${getType(options)}/trending?${this.getQS(__spreadValues({ rating: \"pg-13\" }, options))}`, {\n normalizer: normalizeGifs\n });\n }\n /**\n * Get a random gif\n * @param {RandomOptions} options\n * @returns {Promise}\n **/\n random(options) {\n return request_default(`${getType(options)}/random?${this.getQS(__spreadValues({ rating: \"pg-13\" }, options))}`, {\n noCache: true,\n normalizer: normalizeGif\n });\n }\n /**\n * Get related gifs by a id\n * @param {string} id\n * @param {SubcategoriesOptions} options\n * @returns {Promise}\n **/\n related(id, options = {}) {\n const { type = \"gifs\" } = options;\n return request_default(\n `${type}/related?${this.getQS(__spreadValues({\n gif_id: id,\n rating: \"pg-13\"\n }, options))}`,\n { normalizer: normalizeGifs }\n );\n }\n /**\n * Search for channels based on a term\n * @param {string} term\n * @param options: SearchOptions\n * @returns {Promise}\n **/\n channels(term, options = {}) {\n return request_default(\n `channels/search?${this.getQS(__spreadValues({ q: term, rating: \"pg-13\" }, options))}`\n );\n }\n};\nvar api_default = GiphyFetch;\n\n// src/paginator.ts\nvar gifPaginator = (fetchGifs, initialGifs = []) => {\n const gifs = [...initialGifs];\n const gifIds = initialGifs.map((g) => g.id);\n let offset = initialGifs.length;\n let isDoneFetching = false;\n return () => __async(void 0, null, function* () {\n if (isDoneFetching) {\n return gifs;\n }\n const result = yield fetchGifs(offset);\n const { pagination, data: newGifs } = result;\n offset = pagination.count + pagination.offset;\n isDoneFetching = offset === pagination.total_count;\n newGifs.forEach((gif) => {\n const { id } = gif;\n if (!gifIds.includes(id)) {\n gifs.push(gif);\n gifIds.push(id);\n }\n });\n return [...gifs];\n });\n};\n\n// src/index.ts\nvar _a;\nif (typeof __require !== \"undefined\") {\n const { version } = require_package();\n if (!((_a = getGiphySDKRequestHeaders()) == null ? void 0 : _a.get(`X-GIPHY-SDK-NAME`))) {\n appendGiphySDKRequestHeader(`X-GIPHY-SDK-NAME`, \"FetchAPI\");\n appendGiphySDKRequestHeader(`X-GIPHY-SDK-VERSION`, version);\n }\n}\nexport {\n fetch_error_default as FetchError,\n GeoFetchError,\n api_default as GiphyFetch,\n gifPaginator,\n request_default as request,\n serverUrl,\n setServerUrl\n};\n","/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {boolean} [noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the\n * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time\n * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,\n * the internal counter is reset).\n * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the throttled-function is executed.\n * @param {boolean} [debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),\n * schedule `callback` to execute after `delay` ms.\n *\n * @returns {Function} A new, throttled, function.\n */\nexport default function (delay, noTrailing, callback, debounceMode) {\n\t/*\n\t * After wrapper has stopped being called, this timeout ensures that\n\t * `callback` is executed at the proper times in `throttle` and `end`\n\t * debounce modes.\n\t */\n\tlet timeoutID;\n\tlet cancelled = false;\n\n\t// Keep track of the last time `callback` was executed.\n\tlet lastExec = 0;\n\n\t// Function to clear existing timeout\n\tfunction clearExistingTimeout() {\n\t\tif (timeoutID) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\t}\n\n\t// Function to cancel next exec\n\tfunction cancel() {\n\t\tclearExistingTimeout();\n\t\tcancelled = true;\n\t}\n\n\t// `noTrailing` defaults to falsy.\n\tif (typeof noTrailing !== 'boolean') {\n\t\tdebounceMode = callback;\n\t\tcallback = noTrailing;\n\t\tnoTrailing = undefined;\n\t}\n\n\t/*\n\t * The `wrapper` function encapsulates all of the throttling / debouncing\n\t * functionality and when executed will limit the rate at which `callback`\n\t * is executed.\n\t */\n\tfunction wrapper(...arguments_) {\n\t\tlet self = this;\n\t\tlet elapsed = Date.now() - lastExec;\n\n\t\tif (cancelled) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec() {\n\t\t\tlastExec = Date.now();\n\t\t\tcallback.apply(self, arguments_);\n\t\t}\n\n\t\t/*\n\t\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t * to allow future `callback` executions.\n\t\t */\n\t\tfunction clear() {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif (debounceMode && !timeoutID) {\n\t\t\t/*\n\t\t\t * Since `wrapper` is being called for the first time and\n\t\t\t * `debounceMode` is true (at begin), execute `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t}\n\n\t\tclearExistingTimeout();\n\n\t\tif (debounceMode === undefined && elapsed > delay) {\n\t\t\t/*\n\t\t\t * In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t * `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t} else if (noTrailing !== true) {\n\t\t\t/*\n\t\t\t * In trailing throttle mode, since `delay` time has not been\n\t\t\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t * recent execution.\n\t\t\t *\n\t\t\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t * after `delay` ms.\n\t\t\t *\n\t\t\t * If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t * execute after `delay` ms.\n\t\t\t */\n\t\t\ttimeoutID = setTimeout(\n\t\t\t\tdebounceMode ? clear : exec,\n\t\t\t\tdebounceMode === undefined ? delay - elapsed : delay\n\t\t\t);\n\t\t}\n\t}\n\n\twrapper.cancel = cancel;\n\n\t// Return the wrapper function.\n\treturn wrapper;\n}\n","/* eslint-disable no-undefined */\n\nimport throttle from './throttle';\n\n/**\n * Debounce execution of a function. Debouncing, unlike throttling,\n * guarantees that a function is only executed a single time, either at the\n * very beginning of a series of calls, or at the very end.\n *\n * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {boolean} [atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds\n * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.\n * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).\n * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the debounced-function is executed.\n *\n * @returns {Function} A new, debounced function.\n */\nexport default function (delay, atBegin, callback) {\n\treturn callback === undefined\n\t\t? throttle(delay, atBegin, false)\n\t\t: throttle(delay, callback, atBegin !== false);\n}\n","import * as React from 'react';\nimport { createElement, useLayoutEffect, useContext, useRef, Fragment } from 'react';\nimport '@emotion/cache';\nimport { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, u as useInsertionEffectMaybe } from './emotion-element-cbed451f.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, b as ThemeProvider, _ as __unsafe_useEmotionCache, a as useTheme, w as withEmotionCache, d as withTheme } from './emotion-element-cbed451f.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport 'hoist-non-react-statics';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.9.3\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.cjs.js\": \"./dist/emotion-react.browser.cjs.js\",\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.js\",\n\t\t\"macro.d.ts\",\n\t\t\"macro.js.flow\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.13.10\",\n\t\t\"@emotion/babel-plugin\": \"^11.7.1\",\n\t\t\"@emotion/cache\": \"^11.9.3\",\n\t\t\"@emotion/serialize\": \"^1.0.4\",\n\t\t\"@emotion/utils\": \"^1.1.0\",\n\t\t\"@emotion/weak-memoize\": \"^0.2.5\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\t\"@babel/core\": \"^7.0.0\",\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@babel/core\": {\n\t\t\toptional: true\n\t\t},\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@babel/core\": \"^7.13.10\",\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.9.0\",\n\t\t\"@emotion/css-prettifier\": \"1.0.1\",\n\t\t\"@emotion/server\": \"11.4.0\",\n\t\t\"@emotion/styled\": \"11.9.3\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\"\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return createElement.apply(null, createElementArgArray);\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useLayoutEffect;\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = useRef();\n useInsertionEffect(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffect(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n var rules = useInsertionEffectMaybe(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n var res = insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727 for some reason Jest evaluates modules twice if some consuming module gets mocked with jest.mock\n\n var isJest = typeof jest !== 'undefined';\n\n if (isBrowser && !isJest) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\n\n// src/merge-attributes.ts\nimport { pick } from \"@giphy/js-util\";\nvar mergeAttribute = (attributes, newAttributes, key) => {\n const result1 = pick(attributes, [key]);\n const result2 = pick(newAttributes, [key]);\n if (result1[key] && result2[key]) {\n return __spreadValues(__spreadValues(__spreadValues({}, attributes), newAttributes), { [key]: result1[key] + \", \" + result2[key] });\n }\n return __spreadValues(__spreadValues({}, attributes), newAttributes);\n};\nvar merge_attributes_default = mergeAttribute;\n\n// src/pingback.ts\nimport { getPingbackId, Logger as Logger2 } from \"@giphy/js-util\";\nimport { debounce } from \"throttle-debounce\";\n\n// src/global.ts\nvar global_default = (typeof window !== \"undefined\" ? window : global) || {};\n\n// src/send-pingback.ts\nimport { getGiphySDKRequestHeaders, Logger } from \"@giphy/js-util\";\nvar _a;\nvar environment = ((_a = global_default) == null ? void 0 : _a.GIPHY_PINGBACK_URL) || \"https://pingback.giphy.com\";\nvar pingBackUrl = `${environment}/v2/pingback?apikey=l0HlIwPWyBBUDAUgM`;\nvar sendPingback = (events) => {\n const headers = getGiphySDKRequestHeaders();\n headers == null ? void 0 : headers.set(\"Content-Type\", \"application/json\");\n Logger.debug(`Pingback session`, events);\n if (!events.length) {\n return new Promise((resolve) => resolve());\n }\n return fetch(pingBackUrl, {\n method: \"POST\",\n body: JSON.stringify({ events }),\n headers\n }).catch((error) => {\n Logger.warn(`pingbacks failing to post ${error}`);\n });\n};\n\n// src/pingback.ts\nvar queuedPingbackEvents = [];\nglobal_default.giphyRandomId = getPingbackId();\nvar loggedInUserId = \"\";\nfunction sendPingbacks() {\n const sendEvents = [...queuedPingbackEvents];\n queuedPingbackEvents = [];\n sendPingback(sendEvents);\n}\nvar debouncedPingbackEvent = debounce(1e3, sendPingbacks);\nvar _a2, _b;\n(_b = (_a2 = global_default).addEventListener) == null ? void 0 : _b.call(_a2, \"beforeunload\", sendPingbacks);\nvar pingback = ({\n userId,\n eventType,\n actionType,\n attributes,\n queueEvents = true,\n analyticsResponsePayload\n}) => {\n loggedInUserId = userId ? String(userId) : loggedInUserId;\n const newEvent = {\n ts: Date.now(),\n attributes,\n action_type: actionType,\n user_id: getPingbackId(),\n analytics_response_payload: analyticsResponsePayload\n };\n if (loggedInUserId) {\n newEvent.logged_in_user_id = loggedInUserId;\n }\n if (newEvent.analytics_response_payload) {\n newEvent.analytics_response_payload = `${newEvent.analytics_response_payload}${Logger2.ENABLED ? \"&mode=verification\" : \"\"}`;\n }\n if (eventType) {\n newEvent.event_type = eventType;\n }\n queuedPingbackEvents.push(newEvent);\n queueEvents ? debouncedPingbackEvent() : sendPingbacks();\n};\nvar pingback_default = pingback;\nexport {\n merge_attributes_default as mergeAttributes,\n pingback_default as pingback\n};\n","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// src/index.ts\nimport { appendGiphySDKRequestHeader } from \"@giphy/js-util\";\n\n// src/components/attribution/index.tsx\nimport styled3 from \"@emotion/styled\";\nimport React4 from \"react\";\n\n// src/components/attribution/avatar.tsx\nimport styled from \"@emotion/styled\";\nimport React, { useRef } from \"react\";\nvar getSmallAvatar = (avatar) => {\n var _a, _b;\n if (!avatar)\n return \"\";\n const ext = (_b = (_a = avatar == null ? void 0 : avatar.split(\".\")) == null ? void 0 : _a.pop()) == null ? void 0 : _b.toLowerCase();\n return avatar.replace(`.${ext}`, `/80h.${ext}`);\n};\nvar Img = styled.img`\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n`;\nvar Avatar = ({ user, className = \"\" }) => {\n const defaultAvatarId = useRef(Math.floor(Math.random() * 5) + 1);\n const url = user.avatar_url ? getSmallAvatar(user.avatar_url) : `https://media.giphy.com/avatars/default${defaultAvatarId.current}.gif`;\n return /* @__PURE__ */ React.createElement(Img, { src: url, className });\n};\nvar avatar_default = Avatar;\n\n// src/components/attribution/user.tsx\nimport styled2 from \"@emotion/styled\";\nimport React3 from \"react\";\n\n// src/components/attribution/verified-badge.tsx\nimport { giphyBlack } from \"@giphy/colors\";\nimport React2 from \"react\";\nvar VerifiedBadge = ({ className = \"\", size = 17, fill = \"#15CDFF\" }) => /* @__PURE__ */ React2.createElement(\"svg\", { className: [VerifiedBadge.className, className].join(\" \"), height: size, width: \"19px\", viewBox: \"0 0 19 17\" }, /* @__PURE__ */ React2.createElement(\n \"path\",\n {\n className: VerifiedBadge.checkMarkClassName,\n d: \"M9.32727273,9.44126709 L9.32727273,3.03016561 L6.55027155,3.03016561 L6.55027155,10.8150746 L6.55027155,12.188882 L12.1042739,12.188882 L12.1042739,9.44126709 L9.32727273,9.44126709 Z\",\n fill: giphyBlack,\n transform: \"translate(9.327273, 7.609524) scale(-1, 1) rotate(-45.000000) translate(-9.327273, -7.609524) \"\n }\n), /* @__PURE__ */ React2.createElement(\"g\", { transform: \"translate(-532.000000, -466.000000)\", fill }, /* @__PURE__ */ React2.createElement(\"g\", { transform: \"translate(141.000000, 235.000000)\" }, /* @__PURE__ */ React2.createElement(\"g\", { transform: \"translate(264.000000, 0.000000)\" }, /* @__PURE__ */ React2.createElement(\"g\", { transform: \"translate(10.000000, 224.000000)\" }, /* @__PURE__ */ React2.createElement(\"g\", { transform: \"translate(114.000000, 2.500000)\" }, /* @__PURE__ */ React2.createElement(\"path\", { d: \"M15.112432,4.80769231 L16.8814194,6.87556817 L19.4157673,7.90116318 L19.6184416,10.6028916 L21.0594951,12.9065042 L19.6184416,15.2101168 L19.4157673,17.9118452 L16.8814194,18.9374402 L15.112432,21.0053161 L12.4528245,20.3611511 L9.79321699,21.0053161 L8.02422954,18.9374402 L5.48988167,17.9118452 L5.28720734,15.2101168 L3.84615385,12.9065042 L5.28720734,10.6028916 L5.48988167,7.90116318 L8.02422954,6.87556817 L9.79321699,4.80769231 L12.4528245,5.4518573 L15.112432,4.80769231 Z M17.8163503,10.8991009 L15.9282384,9.01098901 L11.5681538,13.3696923 L9.68115218,11.4818515 L7.81302031,13.3499833 L9.7011322,15.2380952 L11.5892441,17.1262071 L17.8163503,10.8991009 Z\" })))))));\nVerifiedBadge.className = \"giphy-verified-badge\";\nVerifiedBadge.checkMarkClassName = \"giphy-verified-checkmark\";\nvar verified_badge_default = VerifiedBadge;\n\n// src/components/attribution/user.tsx\nvar Username = styled2.div`\n color: white;\n font-size: 16px;\n font-weight: 700;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n -webkit-font-smoothing: antialiased;\n`;\nvar VerifiedBadge2 = styled2(verified_badge_default)`\n margin-left: 4px;\n flex-shrink: 0;\n`;\nvar Container = styled2.div`\n display: flex;\n align-items: center;\n min-width: 0;\n`;\nvar User = ({ user }) => {\n const { display_name, username } = user;\n return /* @__PURE__ */ React3.createElement(Container, null, /* @__PURE__ */ React3.createElement(Username, null, display_name || `@${username}`), user.is_verified ? /* @__PURE__ */ React3.createElement(VerifiedBadge2, { size: 14 }) : null);\n};\nvar user_default = User;\n\n// src/components/attribution/index.tsx\nvar Container2 = styled3.div`\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n`;\nvar Avatar2 = styled3(avatar_default)`\n flex-shrink: 0;\n`;\nvar Attribution = ({ gif, className, onClick }) => {\n const { user } = gif;\n if (!(user == null ? void 0 : user.username) && !(user == null ? void 0 : user.display_name)) {\n return null;\n }\n return /* @__PURE__ */ React4.createElement(\n Container2,\n {\n className: [Attribution.className, className].join(\" \"),\n onClick: (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (onClick) {\n onClick(gif);\n } else {\n const url = user.profile_url;\n if (url)\n window.open(url, \"_blank\");\n }\n }\n },\n /* @__PURE__ */ React4.createElement(Avatar2, { user }),\n /* @__PURE__ */ React4.createElement(user_default, { user: gif.user })\n );\n};\nAttribution.className = \"giphy-attribution\";\nvar attribution_default = Attribution;\n\n// src/components/attribution/overlay.tsx\nimport styled4 from \"@emotion/styled\";\nimport React5, { useRef as useRef2 } from \"react\";\nvar Background = styled4.div`\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n`;\nvar Attribution2 = styled4(attribution_default)`\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n`;\nvar Container3 = styled4.div`\n transition: opacity 150ms ease-in;\n`;\nvar AttributionOverlay = ({ gif, isHovered, onClick }) => {\n const hasHovered = useRef2(isHovered);\n if (isHovered) {\n hasHovered.current = true;\n }\n return gif.user && hasHovered.current ? /* @__PURE__ */ React5.createElement(Container3, { style: { opacity: isHovered ? 1 : 0 } }, /* @__PURE__ */ React5.createElement(Background, null), /* @__PURE__ */ React5.createElement(Attribution2, { gif, onClick })) : null;\n};\nvar overlay_default = AttributionOverlay;\n\n// src/components/carousel.tsx\nimport styled6 from \"@emotion/styled\";\nimport { gifPaginator } from \"@giphy/js-fetch-api\";\nimport { getGifWidth } from \"@giphy/js-util\";\nimport React9, { PureComponent } from \"react\";\nimport { debounce } from \"throttle-debounce\";\n\n// src/util/observer.tsx\nimport \"intersection-observer\";\nimport React6, { useEffect, useRef as useRef3 } from \"react\";\nvar Observer = ({ children, className, onVisibleChange, config }) => {\n const container = useRef3(null);\n useEffect(() => {\n let io;\n if (container.current) {\n io = new IntersectionObserver(([entry]) => {\n if (onVisibleChange)\n onVisibleChange(entry.isIntersecting);\n }, config);\n io.observe(container.current);\n }\n return () => io == null ? void 0 : io.disconnect();\n }, [onVisibleChange, container, config]);\n return /* @__PURE__ */ React6.createElement(\"div\", { ref: container, className }, children);\n};\nvar observer_default = Observer;\n\n// src/components/gif.tsx\nimport { css } from \"@emotion/react\";\nimport styled5 from \"@emotion/styled\";\nimport { giphyBlue, giphyGreen, giphyPurple, giphyRed, giphyYellow } from \"@giphy/colors\";\nimport { Logger, getAltText, getBestRendition, getGifHeight } from \"@giphy/js-util\";\nimport \"intersection-observer\";\nimport React8, {\n useContext as useContext2,\n useEffect as useEffect2,\n useRef as useRef4,\n useState\n} from \"react\";\n\n// src/util/pingback.ts\nimport { pingback } from \"@giphy/js-analytics\";\nimport { getClientRect } from \"@giphy/js-util\";\nvar firePingback = (actionType) => (gif, userId, target, attributes = {}) => {\n if (!gif.analytics_response_payload) {\n return;\n }\n pingback({\n analyticsResponsePayload: gif.analytics_response_payload,\n userId,\n actionType,\n attributes: __spreadValues({ position: JSON.stringify(getClientRect(target)) }, attributes)\n });\n};\nvar onGifSeen = (gif, userId, position, attributes = {}) => {\n if (!gif.analytics_response_payload) {\n return;\n }\n pingback({\n analyticsResponsePayload: gif.analytics_response_payload,\n userId,\n actionType: \"SEEN\",\n attributes: __spreadValues({ position: JSON.stringify(position) }, attributes)\n });\n};\nvar onGifClick = firePingback(\"CLICK\");\nvar onGifHover = firePingback(\"HOVER\");\n\n// src/components/pingback-context-manager.tsx\nimport { mergeAttributes } from \"@giphy/js-analytics\";\nimport React7, { createContext, useContext } from \"react\";\nvar PingbackContext = createContext({});\nvar PingbackContextManager = ({ attributes, children }) => {\n const { attributes: parentAttributes = {} } = useContext(PingbackContext);\n return /* @__PURE__ */ React7.createElement(PingbackContext.Provider, { value: { attributes: mergeAttributes(parentAttributes, attributes, \"layout_type\") } }, children);\n};\nvar pingback_context_manager_default = PingbackContextManager;\n\n// src/components/gif.tsx\nvar GifContainer = styled5.div`\n display: block;\n ${(props) => props.borderRadius && css`\n border-radius: ${props.borderRadius}px;\n overflow: hidden;\n `}\n img {\n display: block;\n }\n .${verified_badge_default.className} {\n g {\n fill: white;\n }\n }\n .${verified_badge_default.checkMarkClassName} {\n opacity: 0;\n }\n`;\nvar GRID_COLORS = [giphyBlue, giphyGreen, giphyPurple, giphyRed, giphyYellow];\nvar getColor = () => GRID_COLORS[Math.round(Math.random() * (GRID_COLORS.length - 1))];\nvar hoverTimeoutDelay = 200;\nvar Container4 = (props) => /* @__PURE__ */ React8.createElement(GifContainer, __spreadValues({ as: props.href ? \"a\" : \"div\" }, props));\nvar placeholder = \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nvar noop = () => {\n};\nvar RenderOnClient = ({ children }) => {\n const [render, setRender] = useState(false);\n useEffect2(() => {\n setRender(true);\n }, []);\n return render ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, children) : null;\n};\nvar Gif = ({\n gif,\n width,\n height: forcedHeight,\n onGifRightClick = noop,\n className = \"\",\n onGifClick: onGifClick2 = noop,\n onGifKeyPress = noop,\n onGifSeen: onGifSeen2 = noop,\n onGifVisible = noop,\n user = {},\n backgroundColor,\n overlay,\n hideAttribution = false,\n noLink = false,\n borderRadius = 4,\n style,\n tabIndex\n}) => {\n const [hasFiredSeen, setHasFiredSeen] = useState(false);\n const [isHovered, setHovered] = useState(false);\n const [shouldShowMedia, setShouldShowMedia] = useState(!canUseDOM);\n const [loadedClassname, setLoadedClassName] = useState(\"\");\n const defaultBgColor = useRef4(getColor());\n const container = useRef4(null);\n const image = useRef4(null);\n const showGifObserver = useRef4();\n const fullGifObserver = useRef4();\n const hoverTimeout = useRef4();\n const sendOnSeen = useRef4(noop);\n const { attributes } = useContext2(PingbackContext);\n let Overlay = overlay;\n if (!Overlay && !hideAttribution) {\n Overlay = overlay_default;\n }\n const onMouseOver = (e) => {\n clearTimeout(hoverTimeout.current);\n e.persist();\n setHovered(true);\n hoverTimeout.current = window.setTimeout(() => {\n onGifHover(gif, user == null ? void 0 : user.id, e.target, attributes);\n }, hoverTimeoutDelay);\n };\n const onMouseLeave = () => {\n clearTimeout(hoverTimeout.current);\n setHovered(false);\n };\n const onClick = (e) => {\n onGifClick(gif, user == null ? void 0 : user.id, e.target, attributes);\n onGifClick2(gif, e);\n };\n const onKeyPress = (e) => {\n onGifKeyPress(gif, e);\n };\n sendOnSeen.current = (entry) => {\n setHasFiredSeen(true);\n Logger.debug(`GIF ${gif.id} seen. ${gif.title}`);\n onGifSeen(gif, user == null ? void 0 : user.id, entry.boundingClientRect, attributes);\n onGifSeen2 == null ? void 0 : onGifSeen2(gif, entry.boundingClientRect);\n if (fullGifObserver.current) {\n fullGifObserver.current.disconnect();\n }\n };\n const watchGif = () => {\n if (!fullGifObserver.current) {\n fullGifObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n sendOnSeen.current(entry);\n }\n },\n { threshold: [0.99] }\n );\n }\n if (!hasFiredSeen && container.current && fullGifObserver.current) {\n fullGifObserver.current.observe(container.current);\n }\n };\n const onImageLoad = (e) => {\n watchGif();\n onGifVisible(gif, e);\n setLoadedClassName(Gif.imgLoadedClassName);\n };\n useEffect2(() => {\n var _a, _b;\n if ((_a = image.current) == null ? void 0 : _a.complete) {\n watchGif();\n onGifVisible(gif);\n }\n (_b = fullGifObserver.current) == null ? void 0 : _b.disconnect();\n setHasFiredSeen(false);\n }, [gif.id]);\n useEffect2(() => {\n showGifObserver.current = new IntersectionObserver(([entry]) => {\n const { isIntersecting } = entry;\n setShouldShowMedia(isIntersecting);\n if (!isIntersecting && fullGifObserver.current) {\n fullGifObserver.current.disconnect();\n }\n });\n showGifObserver.current.observe(container.current);\n return () => {\n if (showGifObserver.current)\n showGifObserver.current.disconnect();\n if (fullGifObserver.current)\n fullGifObserver.current.disconnect();\n if (hoverTimeout.current)\n clearTimeout(hoverTimeout.current);\n };\n }, []);\n const height = forcedHeight || getGifHeight(gif, width);\n const bestRendition = getBestRendition(gif.images, width, height);\n const rendition = gif.images[bestRendition.renditionName];\n const background = backgroundColor || // <- specified background prop\n // sticker has black if no backgroundColor is specified\n (gif.is_sticker ? `url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4AQMAAACSSKldAAAABlBMVEUhIiIWFhYoSqvJAAAAGElEQVQY02MAAv7///8PWxqIPwDZw5UGABtgwz2xhFKxAAAAAElFTkSuQmCC') 0 0` : defaultBgColor.current);\n return /* @__PURE__ */ React8.createElement(\n Container4,\n {\n href: noLink ? void 0 : gif.url,\n \"data-giphy-id\": gif.id,\n \"data-giphy-is-sticker\": gif.is_sticker,\n style: __spreadValues({\n width,\n height\n }, style),\n borderRadius,\n className: [Gif.className, className].join(\" \"),\n onMouseOver,\n onMouseLeave,\n onClick,\n onContextMenu: (e) => onGifRightClick(gif, e),\n onKeyPress,\n tabIndex\n },\n /* @__PURE__ */ React8.createElement(\"div\", { style: { width, height, position: \"relative\" }, ref: container }, /* @__PURE__ */ React8.createElement(\"picture\", null, /* @__PURE__ */ React8.createElement(\n \"source\",\n {\n type: \"image/webp\",\n srcSet: shouldShowMedia ? rendition.webp : placeholder,\n suppressHydrationWarning: true\n }\n ), /* @__PURE__ */ React8.createElement(\n \"img\",\n {\n ref: image,\n suppressHydrationWarning: true,\n className: [Gif.imgClassName, loadedClassname].join(\" \"),\n src: shouldShowMedia ? rendition.url : placeholder,\n style: { background },\n width,\n height,\n alt: getAltText(gif),\n onLoad: shouldShowMedia ? onImageLoad : () => {\n }\n }\n )), Overlay && // only render the overlay on the client since it depends on shouldShowMedia\n /* @__PURE__ */ React8.createElement(RenderOnClient, null, shouldShowMedia && /* @__PURE__ */ React8.createElement(Overlay, { gif, isHovered, width, height })))\n );\n};\nGif.className = \"giphy-gif\";\nGif.imgClassName = \"giphy-gif-img\";\nGif.imgLoadedClassName = \"giphy-img-loaded\";\nvar gif_default = Gif;\n\n// src/components/carousel.tsx\nvar Container5 = styled6.div`\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n`;\nvar Gif2 = styled6(gif_default)`\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ${(props) => props.ml}px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .${gif_default.imgClassName} {\n position: absolute;\n top: 0;\n left: 0;\n }\n`;\nvar Observer2 = styled6(observer_default)`\n display: inline-block;\n`;\nvar Loader = styled6.div`\n width: 30px;\n display: inline-block;\n opacity: ${(props) => props.isFirstLoad ? 0 : 1};\n height: ${(props) => props.height}px;\n`;\nvar defaultProps = Object.freeze({ gutter: 6, user: {}, initialGifs: [] });\nvar initialState = Object.freeze({\n isFetching: false,\n gifs: [],\n isLoaderVisible: false,\n isDoneFetching: false\n});\nvar _Carousel = class _Carousel extends PureComponent {\n constructor() {\n super(...arguments);\n this.state = __spreadProps(__spreadValues({}, initialState), { gifs: this.props.initialGifs || [] });\n this.unmounted = false;\n this.paginator = gifPaginator(this.props.fetchGifs, this.state.gifs);\n this.onLoaderVisible = (isVisible) => {\n if (this.unmounted)\n return;\n this.setState({ isLoaderVisible: isVisible }, this.onFetch);\n };\n this.onFetch = debounce(100, () => __async(this, null, function* () {\n if (this.unmounted)\n return;\n const { isFetching, isLoaderVisible, gifs: existingGifs } = this.state;\n if (!isFetching && isLoaderVisible) {\n this.setState({ isFetching: true });\n let gifs;\n try {\n gifs = yield this.paginator();\n } catch (error) {\n this.setState({ isFetching: false });\n }\n if (gifs) {\n if (existingGifs.length === gifs.length) {\n this.setState({ isDoneFetching: true });\n } else {\n this.setState({ gifs, isFetching: false });\n const { onGifsFetched } = this.props;\n if (onGifsFetched)\n onGifsFetched(gifs);\n this.onFetch();\n }\n }\n }\n }));\n }\n componentDidMount() {\n this.unmounted = false;\n this.onFetch();\n }\n componentWillUnmount() {\n this.unmounted = true;\n }\n render() {\n const {\n onGifVisible,\n onGifRightClick,\n gifHeight,\n gifWidth,\n gutter,\n className = _Carousel.className,\n onGifSeen: onGifSeen2,\n onGifClick: onGifClick2,\n onGifKeyPress,\n user,\n overlay,\n hideAttribution,\n noLink,\n noResultsMessage,\n backgroundColor,\n borderRadius,\n tabIndex = 0,\n loaderConfig\n } = this.props;\n const { gifs, isDoneFetching } = this.state;\n const showLoader = !isDoneFetching;\n const isFirstLoad = gifs.length === 0;\n return /* @__PURE__ */ React9.createElement(pingback_context_manager_default, { attributes: { layout_type: \"CAROUSEL\" } }, /* @__PURE__ */ React9.createElement(Container5, { className }, gifs.map((gif) => {\n return /* @__PURE__ */ React9.createElement(\n Gif2,\n {\n gif,\n key: gif.id,\n tabIndex,\n width: gifWidth || getGifWidth(gif, gifHeight),\n height: gifHeight,\n onGifClick: onGifClick2,\n onGifKeyPress,\n onGifSeen: onGifSeen2,\n onGifVisible,\n onGifRightClick,\n user,\n ml: gutter,\n overlay,\n hideAttribution,\n noLink,\n borderRadius,\n backgroundColor\n }\n );\n }), !showLoader && gifs.length === 0 && noResultsMessage, showLoader && /* @__PURE__ */ React9.createElement(Observer2, { onVisibleChange: this.onLoaderVisible, config: loaderConfig }, /* @__PURE__ */ React9.createElement(Loader, { isFirstLoad, height: gifHeight }))));\n }\n};\n_Carousel.className = \"giphy-carousel\";\n_Carousel.defaultProps = defaultProps;\nvar Carousel = _Carousel;\nvar carousel_default = Carousel;\n\n// src/components/emoji-variations-list.tsx\nimport styled8 from \"@emotion/styled\";\nimport { giphyCharcoal, giphyDarkGrey } from \"@giphy/colors\";\nimport { getGifWidth as getGifWidth2 } from \"@giphy/js-util\";\nimport React11, { useEffect as useEffect3 } from \"react\";\nimport useAsyncFn from \"react-use/lib/useAsyncFn\";\nimport useLatest from \"react-use/lib/useLatest\";\n\n// src/components/fetch-error.tsx\nimport styled7 from \"@emotion/styled\";\nimport { giphyBlue as giphyBlue2, giphyLightGrey } from \"@giphy/colors\";\nimport React10 from \"react\";\nvar Message = styled7.div`\n color: ${giphyLightGrey};\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-size: 16px;\n font-weight: 600;\n a {\n color: ${giphyBlue2};\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n`;\nvar FetchError = ({ onClick }) => /* @__PURE__ */ React10.createElement(Message, null, \"Error loading GIFs.\\xA0\", /* @__PURE__ */ React10.createElement(\"a\", { onClick }, \"Try again?\"));\nvar fetch_error_default = FetchError;\n\n// src/components/emoji-variations-list.tsx\nvar DEFAULT_BG_COLOR = giphyDarkGrey;\nvar DEFAULT_DIVIDER_COLOR = giphyCharcoal;\nvar DIVIDER_RELATIVE_HEIGHT = 0.75;\nvar Root = styled8.div`\n align-items: center;\n background-color: ${({ backgroundColor }) => backgroundColor};\n border-radius: 16px;\n display: flex;\n max-width: fit-content;\n overflow: hidden;\n padding: 4px 5px 5px 6px;\n`;\nvar VariationsViewport = styled8.div`\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n -webkit-overflow-scrolling: touch;\n`;\nvar VariationsContainer = styled8.div`\n display: inline-flex;\n justify-content: space-between;\n overflow: hidden;\n white-space: nowrap;\n width: ${({ width }) => `${width}px`};\n`;\nvar Divider = styled8.div`\n background-color: ${({ color }) => color};\n box-sizing: border-box;\n height: ${({ gifHeight }) => `${Math.round(gifHeight * DIVIDER_RELATIVE_HEIGHT)}px`};\n margin: ${({ gutter }) => `0 ${gutter}px`};\n width: 2px;\n`;\nvar Emoji = styled8(gif_default)`\n display: inline-block;\n flex-shrink: 0;\n list-style: none;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n position: relative;\n\n .${gif_default.imgClassName} {\n position: absolute;\n top: 0;\n left: 0;\n }\n`;\nfunction EmojiVariationsList(props) {\n var _b;\n const _a = props, {\n backgroundColor = DEFAULT_BG_COLOR,\n className,\n dividerColor = DEFAULT_DIVIDER_COLOR,\n fetchVariations,\n gif,\n gifHeight,\n GifProps = {},\n gifWidth: gifWidthProp,\n gutter = 6,\n hideAttribution,\n loader: LoaderComponent,\n noLink,\n onGifClick: onGifClick2,\n onGifKeyPress,\n onGifRightClick,\n onGifSeen: onGifSeen2,\n onGifVisible,\n onVariationsFetched,\n overlay,\n tabIndex = 0,\n user\n } = _a, other = __objRest(_a, [\n \"backgroundColor\",\n \"className\",\n \"dividerColor\",\n \"fetchVariations\",\n \"gif\",\n \"gifHeight\",\n \"GifProps\",\n \"gifWidth\",\n \"gutter\",\n \"hideAttribution\",\n \"loader\",\n \"noLink\",\n \"onGifClick\",\n \"onGifKeyPress\",\n \"onGifRightClick\",\n \"onGifSeen\",\n \"onGifVisible\",\n \"onVariationsFetched\",\n \"overlay\",\n \"tabIndex\",\n \"user\"\n ]);\n const variationCount = (_b = gif.variation_count) != null ? _b : 0;\n const gifWidth = gifWidthProp || getGifWidth2(gif, gifHeight);\n const variationsContainerWidth = variationCount * gifWidth + Math.max(0, variationCount - 1) * gutter;\n const fetchVariationsRef = useLatest(fetchVariations);\n const onVariationsFetchedRef = useLatest(onVariationsFetched);\n const [variationsState, syncVariations] = useAsyncFn(\n () => __async(this, null, function* () {\n var _a2;\n const result = yield fetchVariationsRef.current(gif.id);\n const variations = (_a2 = result == null ? void 0 : result.data) != null ? _a2 : [];\n if (onVariationsFetchedRef.current) {\n onVariationsFetchedRef.current(variations);\n }\n return variations;\n }),\n [gif],\n { loading: true, value: [] }\n );\n useEffect3(() => {\n syncVariations();\n }, [syncVariations]);\n const emojiCommonProps = __spreadValues({\n backgroundColor: \"transparent\",\n height: gifHeight,\n hideAttribution,\n noLink,\n onGifClick: onGifClick2,\n onGifKeyPress,\n onGifRightClick,\n onGifSeen: onGifSeen2,\n onGifVisible,\n overlay,\n tabIndex,\n user,\n width: gifWidth\n }, GifProps);\n const getVariationsContent = () => {\n var _a2;\n if (variationsState.loading) {\n return LoaderComponent ? /* @__PURE__ */ React11.createElement(LoaderComponent, { className: EmojiVariationsList.loaderClassName }) : null;\n }\n if (variationsState.error) {\n return /* @__PURE__ */ React11.createElement(fetch_error_default, { onClick: syncVariations });\n }\n return /* @__PURE__ */ React11.createElement(React11.Fragment, null, ((_a2 = variationsState.value) != null ? _a2 : []).map((gif2) => /* @__PURE__ */ React11.createElement(Emoji, __spreadProps(__spreadValues({}, emojiCommonProps), { key: gif2.id, gif: gif2 }))));\n };\n return /* @__PURE__ */ React11.createElement(\n Root,\n __spreadValues({\n backgroundColor,\n className: [EmojiVariationsList.className, className].join(\" \")\n }, other),\n /* @__PURE__ */ React11.createElement(Emoji, __spreadProps(__spreadValues({}, emojiCommonProps), { gif })),\n variationCount ? /* @__PURE__ */ React11.createElement(\n Divider,\n {\n className: EmojiVariationsList.dividerClassName,\n color: dividerColor,\n gifHeight,\n gutter\n }\n ) : null,\n /* @__PURE__ */ React11.createElement(VariationsViewport, { className: EmojiVariationsList.variationsViewportClassName }, /* @__PURE__ */ React11.createElement(\n VariationsContainer,\n {\n className: EmojiVariationsList.variationsContainerClassName,\n width: variationsContainerWidth\n },\n getVariationsContent()\n ))\n );\n}\nEmojiVariationsList.className = \"giphy-emoji-variations-list\";\nEmojiVariationsList.dividerClassName = \"giphy-emoji-variations-divider\";\nEmojiVariationsList.loaderClassName = \"giphy-emoji-variations-loader\";\nEmojiVariationsList.variationsViewportClassName = \"giphy-emoji-variations-viewport\";\nEmojiVariationsList.variationsContainerClassName = \"giphy-emoji-variations-container\";\n\n// src/components/grid.tsx\nimport React14, { useEffect as useEffect4, useCallback, useRef as useRef5, useMemo, useReducer } from \"react\";\nimport { gifPaginator as gifPaginator2 } from \"@giphy/js-fetch-api\";\nimport { getGifHeight as getGifHeight2 } from \"@giphy/js-util\";\nimport { debounce as debounce2 } from \"throttle-debounce\";\n\n// src/components/loader.tsx\nimport { keyframes } from \"@emotion/react\";\nimport styled9 from \"@emotion/styled\";\nimport { giphyBlue as giphyBlue3, giphyGreen as giphyGreen2, giphyPurple as giphyPurple2, giphyRed as giphyRed2, giphyYellow as giphyYellow2 } from \"@giphy/colors\";\nimport React12 from \"react\";\nvar bouncer = keyframes`\n to {\n transform: scale(1.75) translateY(-20px);\n }\n`;\nvar loaderHeight = 37;\nvar Container6 = styled9.div`\n display: flex;\n align-items: center;\n height: ${loaderHeight}px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n`;\nvar Dot = styled9.div`\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ${loaderHeight}px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ${bouncer} cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ${(props) => props.color};\n animation-delay: ${(props) => props.delay};\n`;\nvar Loader2 = ({ className = \"\" }) => /* @__PURE__ */ React12.createElement(Container6, { className }, /* @__PURE__ */ React12.createElement(Dot, { color: giphyGreen2, delay: \"0\" }), /* @__PURE__ */ React12.createElement(Dot, { color: giphyBlue3, delay: \".1s\" }), /* @__PURE__ */ React12.createElement(Dot, { color: giphyPurple2, delay: \".2s\" }), /* @__PURE__ */ React12.createElement(Dot, { color: giphyRed2, delay: \".3s\" }), /* @__PURE__ */ React12.createElement(Dot, { color: giphyYellow2, delay: \".4s\" }));\nvar loader_default = Loader2;\n\n// src/components/masonry-grid.tsx\nimport React13, { memo } from \"react\";\nfunction fillArray(length, columnOffsets = []) {\n return Array.apply(null, Array(length)).map((_, index) => columnOffsets[index] || 0);\n}\nvar MasonryGrid = ({\n columns,\n gutter,\n useTransform = true,\n itemWidth,\n itemHeights,\n children,\n columnOffsets = []\n}) => {\n const containerStyle = {};\n function getChildren() {\n let columnTarget;\n const columnHeights = fillArray(columns, columnOffsets);\n const result = React13.Children.map(children, (child, index) => {\n const style = {\n position: \"absolute\"\n };\n columnTarget = columnHeights.indexOf(Math.min.apply(Math, columnHeights));\n const top = `${columnHeights[columnTarget]}px`;\n const left = `${columnTarget * itemWidth + columnTarget * gutter}px`;\n if (useTransform) {\n style.transform = `translate3d(${left}, ${top}, 0)`;\n } else {\n style.top = top;\n style.left = left;\n }\n const height = itemHeights[index];\n if (height) {\n columnHeights[columnTarget] += height + gutter;\n }\n return React13.cloneElement(child, { style });\n });\n containerStyle.position = \"relative\";\n containerStyle.width = `${columns * itemWidth + (columns - 1) * gutter}px`;\n containerStyle.height = `${Math.max.apply(Math, columnHeights) - gutter}px`;\n return result;\n }\n return /* @__PURE__ */ React13.createElement(\"div\", { style: containerStyle }, getChildren());\n};\nvar masonry_grid_default = memo(MasonryGrid);\n\n// src/components/grid.tsx\nvar DEFAULT_GRID_CLASS_NAME = \"giphy-grid\";\nvar FETCH_DEBOUNCE = 250;\nfunction reducer(state, action) {\n switch (action.type) {\n case \"START_FETCH\":\n return __spreadProps(__spreadValues({}, state), { isFetching: true, isError: false });\n case \"FETCH_SUCCESS\":\n return __spreadProps(__spreadValues({}, state), { gifs: action.gifs, isFetching: false });\n case \"FETCH_FAILURE\":\n return __spreadProps(__spreadValues({}, state), { isFetching: false, isError: true });\n case \"LOADER_VISIBLE\":\n return __spreadProps(__spreadValues({}, state), { isLoaderVisible: action.isVisible });\n case \"DONE_FETCHING\":\n return __spreadProps(__spreadValues({}, state), { isDoneFetching: true });\n default:\n return state;\n }\n}\nvar initialState2 = {\n gifWidth: 0,\n isFetching: false,\n isError: false,\n gifs: [],\n isLoaderVisible: false,\n isDoneFetching: false\n};\nvar Grid = (_a) => {\n var _b = _a, {\n className = DEFAULT_GRID_CLASS_NAME,\n width,\n user = {},\n columns,\n gutter = 6,\n layoutType = \"GRID\",\n fetchGifs,\n onGifsFetched,\n onGifsFetchError,\n overlay,\n hideAttribution,\n noLink,\n noResultsMessage,\n initialGifs = [],\n useTransform,\n columnOffsets,\n backgroundColor,\n borderRadius,\n tabIndex = 0,\n loaderConfig,\n loader: LoaderVisual = loader_default\n } = _b, gifEvents = __objRest(_b, [\n \"className\",\n \"width\",\n \"user\",\n \"columns\",\n \"gutter\",\n \"layoutType\",\n \"fetchGifs\",\n \"onGifsFetched\",\n \"onGifsFetchError\",\n \"overlay\",\n \"hideAttribution\",\n \"noLink\",\n \"noResultsMessage\",\n \"initialGifs\",\n \"useTransform\",\n \"columnOffsets\",\n \"backgroundColor\",\n \"borderRadius\",\n \"tabIndex\",\n \"loaderConfig\",\n \"loader\"\n ]);\n const [state, dispatch] = useReducer(reducer, __spreadProps(__spreadValues({}, initialState2), {\n gifs: initialGifs\n }));\n const gifWidth = useMemo(() => {\n const gutterOffset = gutter * (columns - 1);\n return Math.floor((width - gutterOffset) / columns);\n }, [width, gutter, columns]);\n const paginator = useRef5(gifPaginator2(fetchGifs, initialGifs));\n const unmounted = useRef5(false);\n const handleFetchGifs = useCallback(\n (prefetchCount) => {\n const debounceFetchGifs = debounce2(FETCH_DEBOUNCE, (prefetchCount2) => __async(void 0, null, function* () {\n let gifs2;\n try {\n gifs2 = yield paginator.current();\n if (unmounted.current)\n return;\n } catch (e) {\n const error = e;\n if (unmounted.current)\n return;\n dispatch({ type: \"FETCH_FAILURE\", error });\n if (onGifsFetchError)\n onGifsFetchError(error);\n return;\n }\n if (gifs2) {\n if (prefetchCount2 === gifs2.length) {\n dispatch({ type: \"DONE_FETCHING\" });\n } else {\n dispatch({ type: \"FETCH_SUCCESS\", gifs: gifs2 });\n if (onGifsFetched)\n onGifsFetched(gifs2);\n }\n }\n }));\n if (unmounted.current)\n return;\n debounceFetchGifs(prefetchCount);\n },\n [onGifsFetched, onGifsFetchError]\n );\n const onLoaderVisible = useCallback(\n (isVisible) => {\n if (unmounted.current)\n return;\n dispatch({ type: \"LOADER_VISIBLE\", isVisible });\n if (!state.isFetching && isVisible) {\n dispatch({ type: \"START_FETCH\" });\n handleFetchGifs(state.gifs.length);\n }\n },\n [state.gifs.length, state.isFetching, handleFetchGifs]\n );\n useEffect4(() => {\n unmounted.current = false;\n handleFetchGifs(initialGifs.length);\n return () => {\n unmounted.current = true;\n };\n }, [handleFetchGifs]);\n const { gifs, isDoneFetching, isError } = state;\n const itemHeights = useMemo(() => gifs.map((gif) => getGifHeight2(gif, gifWidth)), [gifs, gifWidth]);\n const isFirstLoad = gifs.length === 0;\n const showLoader = !isDoneFetching;\n return /* @__PURE__ */ React14.createElement(pingback_context_manager_default, { attributes: { layout_type: layoutType } }, /* @__PURE__ */ React14.createElement(\"div\", { className, style: { width } }, /* @__PURE__ */ React14.createElement(\n masonry_grid_default,\n {\n itemHeights,\n useTransform,\n itemWidth: gifWidth,\n columns,\n gutter,\n columnOffsets\n },\n gifs.map((gif) => /* @__PURE__ */ React14.createElement(\n gif_default,\n __spreadValues({\n gif,\n tabIndex,\n key: gif.id,\n width: gifWidth,\n user,\n overlay,\n backgroundColor,\n hideAttribution,\n noLink,\n borderRadius\n }, gifEvents)\n ))\n ), !showLoader && gifs.length === 0 && noResultsMessage, isError ? /* @__PURE__ */ React14.createElement(fetch_error_default, { onClick: () => handleFetchGifs(state.gifs.length) }) : showLoader && !isFirstLoad && /* @__PURE__ */ React14.createElement(observer_default, { onVisibleChange: onLoaderVisible, config: loaderConfig }, /* @__PURE__ */ React14.createElement(LoaderVisual, null))));\n};\nvar grid_default = Grid;\n\n// src/components/search-bar/index.tsx\nimport { css as css4 } from \"@emotion/react\";\nimport styled13 from \"@emotion/styled\";\nimport { giphyBlack as giphyBlack2, giphyCharcoal as giphyCharcoal3, giphyIndigo, giphyLightGrey as giphyLightGrey2, giphyWhite as giphyWhite2 } from \"@giphy/colors\";\nimport React20, { useContext as useContext6, useEffect as useEffect6, useRef as useRef6, useState as useState3 } from \"react\";\nimport useDebounce from \"react-use/lib/useDebounce\";\n\n// src/components/search-bar/cancel-icon.tsx\nimport { css as css3 } from \"@emotion/react\";\nimport styled10 from \"@emotion/styled\";\nimport React16, { useContext as useContext3 } from \"react\";\n\n// src/components/search-bar/context.tsx\nimport { ThemeProvider } from \"@emotion/react\";\nimport { GiphyFetch, request } from \"@giphy/js-fetch-api\";\nimport { Logger as Logger2 } from \"@giphy/js-util\";\nimport React15, { createContext as createContext2, useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useState as useState2 } from \"react\";\n\n// src/components/search-bar/theme.ts\nimport { css as css2 } from \"@emotion/react\";\nvar initTheme = (theme) => {\n return __spreadValues({\n mode: \"light\",\n searchbarHeight: 42,\n smallSearchbarHeight: 35,\n // bump the condensedMediaQuery to force if condensedMode is true\n condensedMediaQuery: (theme == null ? void 0 : theme.condensedMode) ? `max-width: 99999px` : `max-width: 480px`,\n hideCancelButton: false\n }, theme);\n};\nvar getSize = (theme, includeWidth = false) => css2`\n height: ${theme.searchbarHeight}px;\n ${includeWidth && css2`\n width: ${theme.searchbarHeight}px;\n `};\n @media (${theme.condensedMediaQuery}) {\n height: ${theme.smallSearchbarHeight}px;\n ${includeWidth && css2`\n width: ${theme.smallSearchbarHeight}px;\n `};\n }\n`;\n\n// src/components/search-bar/context.tsx\nvar SearchContext = createContext2({});\nvar _SearchContext = createContext2({});\nvar emptyChannels = [];\nvar emptyGifsResult = {\n data: [],\n pagination: { total_count: 0, count: 0, offset: 0 },\n meta: { status: 200, msg: \"OK\", response_id: \"\" }\n};\nvar SearchContextManager = ({\n children,\n options = {},\n apiKey,\n theme,\n initialTerm = \"\",\n initialChannel,\n shouldDefaultToTrending = true,\n shouldFetchChannels = true\n}) => {\n var _a, _b;\n const gf = useMemo2(() => new GiphyFetch(apiKey), [apiKey]);\n const [currentChannels, setChannels] = useState2([]);\n const [term, _setSearch] = useState2(initialTerm);\n const [_inputValOverride, setSearch] = useState2(initialTerm);\n const [isFetching, setIsFetching] = useState2(false);\n const [activeChannel, _setActiveChannel] = useState2(initialChannel);\n const setActiveChannel = useCallback2((activeChannel2) => {\n _setSearch(\"\");\n _setActiveChannel(activeChannel2);\n }, []);\n const [trendingSearches, setTrendingSearches] = useState2([]);\n const [isFocused, setIsFocused] = useState2(false);\n const searchKey = [term, options.type, ((_a = activeChannel == null ? void 0 : activeChannel.user) == null ? void 0 : _a.username) || \"\"].filter((val) => !!val).join(\" / \");\n const fetchGifs = useCallback2(\n (offset) => __async(void 0, null, function* () {\n var _a2;\n setIsFetching(true);\n let result = emptyGifsResult;\n if (term) {\n result = yield gf.search(term, __spreadProps(__spreadValues({}, options), {\n offset,\n channel: (_a2 = activeChannel == null ? void 0 : activeChannel.user) == null ? void 0 : _a2.username\n }));\n } else if (shouldDefaultToTrending) {\n result = yield gf.trending(__spreadProps(__spreadValues({}, options), { offset }));\n }\n setIsFetching(false);\n return result;\n }),\n [(_b = activeChannel == null ? void 0 : activeChannel.user) == null ? void 0 : _b.username, gf, options, term, shouldDefaultToTrending]\n );\n const fetchAnimatedText = useCallback2(\n (offset) => __async(void 0, null, function* () {\n const limit = options.limit || 50;\n const result = yield gf.animate(term, { offset, limit });\n if (!result.pagination) {\n result.pagination = { count: limit, total_count: limit, offset };\n }\n return result;\n }),\n [gf, options.limit, term]\n );\n const fetchChannelSearch = useCallback2(\n (offset) => __async(void 0, null, function* () {\n const search = term.indexOf(\"@\") === 0 ? term.split(\" \")[0] : term;\n const result = yield gf.channels(search, { offset });\n return result.data;\n }),\n [gf, term]\n );\n useEffect5(() => {\n const fetchTrendingSearches = () => __async(void 0, null, function* () {\n let searches = [];\n try {\n const { data = [] } = yield request(`trending/searches?api_key=${apiKey}`);\n searches = data;\n } catch (error) {\n Logger2.warn(`Trending searches request failed: ${error}`);\n }\n setTrendingSearches(searches);\n });\n fetchTrendingSearches();\n }, [apiKey]);\n useEffect5(() => {\n const foundChannel = currentChannels.find(({ slug }) => term.indexOf(`@${slug} `) === 0);\n if (foundChannel) {\n _setActiveChannel(foundChannel);\n }\n }, [term, currentChannels, _setActiveChannel]);\n useEffect5(() => {\n if (shouldFetchChannels) {\n const fetchChannels = () => __async(void 0, null, function* () {\n const channels = yield fetchChannelSearch(0);\n setChannels(channels || emptyChannels);\n });\n if (!activeChannel && term.replace(\"@\", \"\")) {\n fetchChannels();\n }\n }\n }, [term, activeChannel]);\n return /* @__PURE__ */ React15.createElement(\n SearchContext.Provider,\n {\n value: {\n activeChannel,\n setChannels,\n currentChannels,\n setActiveChannel,\n fetchChannelSearch,\n term,\n trendingSearches,\n setSearch,\n fetchGifs,\n fetchAnimatedText,\n searchKey,\n isFetching,\n isFocused\n }\n },\n /* @__PURE__ */ React15.createElement(_SearchContext.Provider, { value: { setIsFocused, _setSearch, _inputValOverride } }, /* @__PURE__ */ React15.createElement(ThemeProvider, { theme: initTheme(theme) }, /* @__PURE__ */ React15.createElement(pingback_context_manager_default, { attributes: { layout_type: \"SEARCH\" } }, children)))\n );\n};\nvar context_default = SearchContextManager;\n\n// src/components/search-bar/cancel-icon.tsx\nvar Icon = styled10.svg`\n position: relative;\n right: 10px;\n margin-left: 5px;\n cursor: pointer;\n ${(props) => props.theme.hideCancelButton && css3`\n display: none;\n `};\n`;\nvar CancelIcon = ({ width = 17, height = 17, setCleared }) => {\n const { term, setActiveChannel, activeChannel } = useContext3(SearchContext);\n return term || activeChannel ? /* @__PURE__ */ React16.createElement(\n Icon,\n {\n className: CancelIcon.className,\n width,\n height,\n viewBox: \"0 0 17 17\",\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n onClick: (e) => {\n e.stopPropagation();\n e.preventDefault();\n setCleared(true);\n setActiveChannel(void 0);\n }\n },\n /* @__PURE__ */ React16.createElement(\"g\", { stroke: \"none\", strokeWidth: \"1\", fill: \"none\", fillRule: \"evenodd\", opacity: \"0.582730817\" }, /* @__PURE__ */ React16.createElement(\"g\", { transform: \"translate(-300.000000, -150.000000)\", fill: \"#8E8E93\", fillRule: \"nonzero\" }, /* @__PURE__ */ React16.createElement(\"g\", { transform: \"translate(0.000000, 135.000000)\" }, /* @__PURE__ */ React16.createElement(\"g\", null, /* @__PURE__ */ React16.createElement(\"g\", null, /* @__PURE__ */ React16.createElement(\"g\", { transform: \"translate(11.000000, 13.000000)\" }, /* @__PURE__ */ React16.createElement(\"g\", { transform: \"translate(289.000000, 2.000000)\" }, /* @__PURE__ */ React16.createElement(\n \"path\",\n {\n d: \"M8.5,0 C3.805875,0 0,3.805875 0,8.5 C0,13.194125 3.805875,17 8.5,17 C13.194125,17 17,13.194125 17,8.5 C17,3.805875 13.194125,0 8.5,0 Z M9.50158333,8.5 C9.50158333,8.5 11.7250417,10.7234583 11.834125,10.8325417 C12.1110833,11.1095 12.1110833,11.557875 11.834125,11.834125 C11.5571667,12.1110833 11.1087917,12.1110833 10.8325417,11.834125 C10.7234583,11.72575 8.5,9.50158333 8.5,9.50158333 C8.5,9.50158333 6.27654167,11.7250417 6.16745833,11.834125 C5.8905,12.1110833 5.442125,12.1110833 5.165875,11.834125 C4.88891667,11.5571667 4.88891667,11.1087917 5.165875,10.8325417 C5.27425,10.7234583 7.49841667,8.5 7.49841667,8.5 C7.49841667,8.5 5.27495833,6.27654167 5.165875,6.16745833 C4.88891667,5.8905 4.88891667,5.442125 5.165875,5.165875 C5.44283333,4.88891667 5.89120833,4.88891667 6.16745833,5.165875 C6.27654167,5.27425 8.5,7.49841667 8.5,7.49841667 C8.5,7.49841667 10.7234583,5.27495833 10.8325417,5.165875 C11.1095,4.88891667 11.557875,4.88891667 11.834125,5.165875 C12.1110833,5.44283333 12.1110833,5.89120833 11.834125,6.16745833 C11.72575,6.27654167 9.50158333,8.5 9.50158333,8.5 Z\",\n opacity: \"0.75\"\n }\n ))))))))\n ) : null;\n};\nCancelIcon.className = \"giphy-search-bar-cancel\";\nvar cancel_icon_default = CancelIcon;\n\n// src/components/search-bar/search-bar-channel.tsx\nimport { keyframes as keyframes2 } from \"@emotion/react\";\nimport styled11 from \"@emotion/styled\";\nimport { giphyCharcoal as giphyCharcoal2, giphyDarkCharcoal, giphyWhite, giphyWhiteSmoke } from \"@giphy/colors\";\nimport React17, { useContext as useContext4 } from \"react\";\nvar channelMargin = 6;\nvar channelSearchHeight = (theme) => theme.searchbarHeight - channelMargin * 2;\nvar smallChannelSearchHeight = (theme) => theme.smallSearchbarHeight - 3 * 2;\nvar animateAvatar = (h) => keyframes2`\nto {\n width: ${h}px;\n}\n`;\nvar Avatar3 = styled11(avatar_default)`\n height: ${(props) => channelSearchHeight(props.theme)}px;\n margin: 0;\n width: 0;\n animation: ${(props) => animateAvatar(channelSearchHeight(props.theme))} 100ms ease-in-out forwards;\n @media (${(props) => props.theme.condensedMediaQuery}) {\n height: ${(props) => smallChannelSearchHeight(props.theme)}px;\n animation: ${(props) => animateAvatar(smallChannelSearchHeight(props.theme))} 100ms ease-in-out forwards;\n }\n`;\nvar Username2 = styled11.div`\n background: ${(props) => props.theme.mode === \"dark\" ? giphyCharcoal2 : giphyWhite};\n display: flex;\n align-items: center;\n padding-left: ${channelMargin}px;\n`;\nvar UsernamePill = styled11.div`\n background: ${giphyWhiteSmoke};\n display: flex;\n padding: 0 4px;\n color: ${giphyDarkCharcoal};\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-weight: 600;\n font-size: 12px;\n align-items: center;\n height: ${(props) => channelSearchHeight(props.theme)}px;\n @media (${(props) => props.theme.condensedMediaQuery}) {\n display: none;\n }\n`;\nvar SearchBarChannel = ({ className = \"\" }) => {\n const { activeChannel } = useContext4(SearchContext);\n return activeChannel ? /* @__PURE__ */ React17.createElement(Username2, { className }, /* @__PURE__ */ React17.createElement(Avatar3, { user: activeChannel.user }), /* @__PURE__ */ React17.createElement(UsernamePill, { key: activeChannel.id }, /* @__PURE__ */ React17.createElement(\"div\", null, \"@\", activeChannel.user.username), activeChannel.user.is_verified && /* @__PURE__ */ React17.createElement(verified_badge_default, { size: 14 }))) : null;\n};\nvar search_bar_channel_default = SearchBarChannel;\n\n// src/components/search-bar/search-button.tsx\nimport { keyframes as keyframes3 } from \"@emotion/react\";\nimport styled12 from \"@emotion/styled\";\nimport React19, { useContext as useContext5 } from \"react\";\nimport useThrottle from \"react-use/lib/useThrottle\";\n\n// src/components/search-bar/search-icon.tsx\nimport React18 from \"react\";\nvar SearchIcon = ({ className = \"\" }) => /* @__PURE__ */ React18.createElement(\"svg\", { viewBox: \"0 0 30 30\", version: \"1.1\", className }, /* @__PURE__ */ React18.createElement(\"defs\", null, /* @__PURE__ */ React18.createElement(\n \"path\",\n {\n d: \"M11.5482521,20.4090671 L4.24727698,28.2009189 C3.68084207,28.8054377 2.73159653,28.8363108 2.12707771,28.2698759 C1.5225589,27.703441 1.4916858,26.7541954 2.0581207,26.1496766 L9.40599838,18.3077689 C7.95982241,16.4371424 7.0978836,14.0789715 7.0978836,11.5181818 C7.0978836,5.44914339 11.9392549,0.518181818 17.9252787,0.518181818 C23.9113026,0.518181818 28.7526738,5.44914339 28.7526738,11.5181818 C28.7526738,17.5872202 23.9113026,22.5181818 17.9252787,22.5181818 C15.539851,22.5181818 13.3361963,21.7351359 11.5482521,20.4090671 Z M17.9252787,19.5181818 C22.242011,19.5181818 25.7526738,15.9425536 25.7526738,11.5181818 C25.7526738,7.09381 22.242011,3.51818182 17.9252787,3.51818182 C13.6085464,3.51818182 10.0978836,7.09381 10.0978836,11.5181818 C10.0978836,15.9425536 13.6085464,19.5181818 17.9252787,19.5181818 Z\",\n id: \"giphy-search-icon-path-1\"\n }\n)), /* @__PURE__ */ React18.createElement(\"g\", { id: \"search\", stroke: \"none\", strokeWidth: \"1\", fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React18.createElement(\"g\", { id: \"icons/search\" }, /* @__PURE__ */ React18.createElement(\"mask\", { id: \"giphy-search-icon-mask-2\", fill: \"white\" }, /* @__PURE__ */ React18.createElement(\"use\", { xlinkHref: \"#giphy-search-icon-path-1\" })), /* @__PURE__ */ React18.createElement(\"use\", { id: \"Mask\", fill: \"#FFFFFF\", fillRule: \"nonzero\", xlinkHref: \"#giphy-search-icon-path-1\" }), /* @__PURE__ */ React18.createElement(\"g\", { mask: \"url(#giphy-search-icon-mask-2)\" }, /* @__PURE__ */ React18.createElement(\"g\", { transform: \"translate(0.250000, 0.250000)\" }, /* @__PURE__ */ React18.createElement(\"g\", null))))));\nvar search_icon_default = SearchIcon;\n\n// src/components/search-bar/search-button.tsx\nvar time = \"2s\";\nvar purp = \"#9933FF\";\nvar pink = \"#FF6666\";\nvar strongEasing = \"cubic-bezier(0.920, 0.240, 0.185, 0.730)\";\nvar searchFx = keyframes3`\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n`;\nvar plus = keyframes3`\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n`;\nvar gradientFade = keyframes3`\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n`;\nvar Container7 = styled12.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n display: none;\n }\n ${(props) => getSize(props.theme, true)}\n`;\nvar GradientBox = styled12.div`\n position: absolute;\n height: 100%;\n width: 100%;\n background: linear-gradient(45deg, ${purp} 0%, ${pink} 100%);\n border-radius: 4px;\n overflow: hidden;\n &:before {\n animation: ${gradientFade} ${time} linear 0s infinite;\n background-image: linear-gradient(45deg, ${purp} 0%, ${pink} 50%, ${purp} 100%);\n background-size: 400%;\n background-position: 0% 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 400%;\n }\n`;\nvar Fx = styled12.div`\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n &::after {\n content: '+';\n color: white;\n font-family: 'SS Standard';\n font-size: 8px;\n position: absolute;\n top: 65%;\n left: 66%;\n animation: ${plus} 1s ${strongEasing} 0s 1 forwards;\n }\n`;\nvar Scanner = styled12.div`\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ${searchFx} 1s ${strongEasing} 0s 1;\n filter: blur(1px);\n`;\nvar SearchIcon2 = styled12(search_icon_default)`\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n`;\nvar SearchButton = () => {\n const { isFetching } = useContext5(SearchContext);\n const throttledFetch = useThrottle(isFetching, 1e3);\n return /* @__PURE__ */ React19.createElement(Container7, null, /* @__PURE__ */ React19.createElement(GradientBox, null), /* @__PURE__ */ React19.createElement(SearchIcon2, null), throttledFetch && /* @__PURE__ */ React19.createElement(Fx, null, /* @__PURE__ */ React19.createElement(Scanner, null)));\n};\nvar search_button_default = SearchButton;\n\n// src/components/search-bar/index.tsx\nfunction usePrevious(value) {\n const ref = useRef6(value);\n useEffect6(() => {\n ref.current = value;\n });\n return ref.current;\n}\nvar SEARCH_DEBOUNCE = 500;\nvar Container8 = styled13.div`\n display: flex;\n background: white;\n align-items: center;\n border-radius: 4px;\n ${(props) => getSize(props.theme)}\n`;\nvar Input = styled13.input`\n background: ${(props) => props.theme.mode === \"dark\" ? giphyCharcoal3 : giphyWhite2};\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ${(props) => props.theme.mode === \"dark\" ? giphyWhite2 : giphyBlack2};\n &::placeholder {\n color: ${(props) => props.theme.mode === \"dark\" ? giphyLightGrey2 : giphyLightGrey2};\n }\n min-width: 150px;\n flex: 1;\n ${(props) => props.isUsernameSearch && css4`\n color: ${giphyIndigo};\n `}\n`;\nvar SearchBar = ({\n className,\n placeholder: placeholder2 = `Search GIPHY`,\n clear = false,\n autoFocus,\n searchDebounce = SEARCH_DEBOUNCE,\n onEnter\n}) => {\n const { activeChannel, setActiveChannel, term, setChannels } = useContext6(SearchContext);\n const { setIsFocused, _inputValOverride, _setSearch } = useContext6(_SearchContext);\n const [val, setVal] = useState3(term);\n useDebounce(() => _setSearch(val), searchDebounce, [val]);\n const inputRef = useRef6(null);\n const previousActiveChannel = usePrevious(activeChannel);\n const [isCleared, setCleared] = useState3(clear);\n useEffect6(() => {\n var _a;\n if (autoFocus) {\n (_a = inputRef.current) == null ? void 0 : _a.focus();\n }\n }, [autoFocus]);\n useEffect6(() => {\n var _a;\n if (activeChannel && !previousActiveChannel) {\n (_a = inputRef.current) == null ? void 0 : _a.focus();\n if (val === \" \") {\n setVal(\"\");\n } else {\n setVal(val.replace(/@?\\w*\\s?/, \"\"));\n }\n }\n }, [val, activeChannel, previousActiveChannel]);\n useEffect6(() => {\n setCleared(clear);\n }, [clear]);\n useEffect6(() => {\n setVal(_inputValOverride);\n }, [_inputValOverride, setVal]);\n const onKeyUp = (e) => {\n const key = e.keyCode || e.key;\n switch (key) {\n case 27:\n case `Escape`:\n setActiveChannel(void 0);\n setChannels([]);\n break;\n case 13:\n case `Enter`:\n onEnter == null ? void 0 : onEnter(val);\n break;\n default:\n break;\n }\n };\n const onKeyDown = (e) => {\n const key = e.keyCode || e.key;\n switch (key) {\n case 8:\n case \"Backspace\":\n if (val === \"\") {\n setActiveChannel(void 0);\n setChannels([]);\n }\n break;\n default:\n break;\n }\n };\n return /* @__PURE__ */ React20.createElement(Container8, { className: [SearchBar.className, className].join(\" \") }, /* @__PURE__ */ React20.createElement(search_bar_channel_default, null), /* @__PURE__ */ React20.createElement(\n Input,\n {\n isUsernameSearch: term.indexOf(\"@\") === 0,\n onChange: ({ target: { value } }) => {\n if (!isCleared || value !== \"\") {\n setCleared(false);\n setVal(value);\n }\n },\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n value: isCleared ? \"\" : val,\n placeholder: activeChannel ? `Search ${activeChannel.display_name}` : placeholder2,\n autoCapitalize: \"off\",\n autoCorrect: \"off\",\n autoComplete: \"off\",\n ref: inputRef,\n onKeyUp,\n onKeyDown\n }\n ), /* @__PURE__ */ React20.createElement(cancel_icon_default, { setCleared: () => setVal(\"\") }), /* @__PURE__ */ React20.createElement(search_button_default, null));\n};\nSearchBar.className = \"giphy-search-bar\";\nvar search_bar_default = SearchBar;\n\n// src/components/search-bar/suggestion-bar/index.tsx\nimport styled15 from \"@emotion/styled\";\nimport React23, { useContext as useContext8 } from \"react\";\n\n// src/components/search-bar/suggestion-bar/pills.tsx\nimport styled14 from \"@emotion/styled\";\nimport { giphyDarkestGrey } from \"@giphy/colors\";\nimport React22, { useContext as useContext7 } from \"react\";\n\n// src/components/search-bar/suggestion-bar/trending-icon.tsx\nimport React21 from \"react\";\nvar TrendingIcon = ({ size = 18, className }) => /* @__PURE__ */ React21.createElement(\n \"svg\",\n {\n width: size,\n height: size,\n viewBox: \"0 0 18 16\",\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n className\n },\n /* @__PURE__ */ React21.createElement(\"g\", { id: \"trending\", stroke: \"none\", strokeWidth: \"1\", fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React21.createElement(\"g\", null, /* @__PURE__ */ React21.createElement(\n \"rect\",\n {\n id: \"Rectangle\",\n stroke: \"#979797\",\n fill: \"#D8D8D8\",\n opacity: \"0\",\n x: \"0.5\",\n y: \"0.5\",\n width: \"17\",\n height: \"17\"\n }\n ), /* @__PURE__ */ React21.createElement(\n \"path\",\n {\n d: \"M12.6093329,3.12057664 L15.156896,3.12057664 L9.64199318,9.04253019 L6.88133868,6.8175119 C6.7544587,6.67603813 6.56616874,6.60087259 6.38404017,6.61897279 C6.2490402,6.63288422 6.11891631,6.69661171 6.02063992,6.79697337 C2.21226835,10.5943119 0.308082561,12.4929812 0.308082561,12.4929812 C0.308082561,12.4929812 0.527106106,12.8074292 0.710953088,13.0215425 C0.833517743,13.1642848 0.975497751,13.3098497 1.13689311,13.4582373 L6.47329888,8.13191205 L9.16381134,10.2953038 C9.40800276,10.5710787 9.68933701,10.7021044 10.019278,10.4570223 L16.0239805,4.04474473 C16.0239805,5.87956383 16.0239805,6.79697337 16.0239805,6.79697337 C16.0239805,6.79697337 16.4320205,6.79697337 17.2481004,6.79697337 L17.2481004,1.80604505 C14.1555887,1.80604505 12.6093329,1.80604505 12.6093329,1.80604505 C12.6093329,1.80604505 12.6093329,2.24422225 12.6093329,3.12057664 Z\",\n id: \"Shape\",\n stroke: \"#00CCFF\",\n strokeWidth: \"0.4\",\n fill: \"#00CCFF\",\n fillRule: \"nonzero\",\n transform: \"translate(8.778091, 7.632141) rotate(-2.000000) translate(-8.778091, -7.632141) \"\n }\n )))\n);\nvar trending_icon_default = TrendingIcon;\n\n// src/components/search-bar/suggestion-bar/pills.tsx\nvar margin = 9;\nvar ChannelPillContainer = styled14.div`\n background: ${giphyDarkestGrey};\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ${margin}px;\n cursor: pointer;\n`;\nvar TrendingSearchPillContainer = styled14.div`\n background: ${giphyDarkestGrey};\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ${margin}px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n`;\nvar Avatar4 = styled14(avatar_default)`\n ${(props) => getSize(props.theme, true)}\n`;\nvar TrendingIcon2 = styled14(trending_icon_default)`\n margin-right: 2px;\n`;\nvar ChannelPill = ({ channel }) => {\n const { setActiveChannel } = useContext7(SearchContext);\n return /* @__PURE__ */ React22.createElement(ChannelPillContainer, { key: channel.id, onClick: () => setActiveChannel(channel) }, /* @__PURE__ */ React22.createElement(Avatar4, { user: channel.user }), /* @__PURE__ */ React22.createElement(\"div\", null, \"@\", channel.user.username), channel.user.is_verified && /* @__PURE__ */ React22.createElement(verified_badge_default, { size: 14 }));\n};\nvar TrendingSearchPill = ({ trendingSearch }) => {\n const { setSearch } = useContext7(SearchContext);\n return /* @__PURE__ */ React22.createElement(TrendingSearchPillContainer, { key: trendingSearch, onClick: () => setSearch(trendingSearch) }, /* @__PURE__ */ React22.createElement(TrendingIcon2, { size: 16 }), trendingSearch);\n};\n\n// src/components/search-bar/suggestion-bar/index.tsx\nvar Container9 = styled15.div`\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ${(props) => getSize(props.theme)}\n`;\nvar SuggestionBar = () => {\n const { trendingSearches, currentChannels } = useContext8(SearchContext);\n return /* @__PURE__ */ React23.createElement(Container9, { className: SuggestionBar.className }, currentChannels.length > 0 ? currentChannels.map((channel) => /* @__PURE__ */ React23.createElement(ChannelPill, { key: channel.id, channel })) : trendingSearches.map((trendingSearch) => /* @__PURE__ */ React23.createElement(TrendingSearchPill, { key: trendingSearch, trendingSearch })));\n};\nSuggestionBar.className = \"giphy-suggestion-bar\";\nvar suggestion_bar_default = SuggestionBar;\n\n// src/components/video/index.tsx\nimport styled18 from \"@emotion/styled\";\nimport { getGifHeight as getGifHeight4, Logger as Logger3 } from \"@giphy/js-util\";\nimport React29, { useCallback as useCallback4, useEffect as useEffect8, useState as useState5 } from \"react\";\nimport useTimeoutFn from \"react-use/lib/useTimeoutFn\";\n\n// src/components/video/attribution.tsx\nimport styled16 from \"@emotion/styled\";\nimport React25 from \"react\";\n\n// src/components/video/clips-branding.tsx\nimport React24 from \"react\";\nvar GIPHYClips = ({ onClick }) => /* @__PURE__ */ React24.createElement(\"svg\", { width: \"66px\", height: \"13px\", viewBox: \"0 0 66 13\", onClick }, /* @__PURE__ */ React24.createElement(\"g\", { stroke: \"none\", strokeWidth: 1, fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React24.createElement(\"g\", { transform: \"translate(-1060.000000, -462.000000)\", fill: \"#FFFFFF\", fillRule: \"nonzero\" }, /* @__PURE__ */ React24.createElement(\"g\", { transform: \"translate(931.000000, 286.375671)\" }, /* @__PURE__ */ React24.createElement(\"g\", { transform: \"translate(86.000000, 136.124329)\" }, /* @__PURE__ */ React24.createElement(\n \"path\",\n {\n d: \"M47.968,49.1962322 C49.588,49.1962322 51.052,48.6202322 51.58,47.5522322 L51.58,43.8202322 L47.476,43.8202322 L47.476,45.6802322 L49.6,45.6802322 L49.6,46.7602322 C49.12,47.1082322 48.424,47.1922322 47.98,47.1922322 C46.288,47.1922322 45.724,45.8602322 45.724,44.7802322 C45.724,43.1362322 46.612,42.3202322 47.98,42.3202322 C48.544,42.3202322 49.288,42.4762322 49.9,43.0522322 L51.28,41.6842322 C50.176,40.5682322 49.144,40.3282322 47.98,40.3282322 C44.824,40.3282322 43.384,42.5842322 43.384,44.7802322 C43.384,46.9762322 44.644,49.1962322 47.968,49.1962322 Z M54.928,48.9682322 L54.928,40.5682322 L52.564,40.5682322 L52.564,48.9682322 L54.928,48.9682322 Z M58.648,48.9682322 L58.648,46.7002322 L60.352,46.7002322 C62.596,46.6762322 63.724,45.3442322 63.724,43.6282322 C63.724,41.9842322 62.608,40.5682322 60.352,40.5682322 L56.272,40.5682322 L56.272,48.9682322 L58.648,48.9682322 Z M60.352,44.6962322 L58.648,44.6962322 L58.648,42.6082322 L60.352,42.6082322 C61,42.6082322 61.348,43.1122322 61.348,43.6642322 C61.348,44.2162322 61.012,44.6962322 60.352,44.6962322 Z M66.796,48.9802322 L66.796,45.8002322 L69.82,45.8002322 L69.82,48.9802322 L72.172,48.9802322 L72.172,40.5802322 L69.82,40.5802322 L69.82,43.7722322 L66.796,43.7722322 L66.796,40.5802322 L64.42,40.5802322 L64.42,48.9802322 L66.796,48.9802322 Z M78.16,48.9682322 L78.16,45.6202322 L81.496,40.6762322 L81.496,40.5682322 L78.82,40.5682322 L77.008,43.4482322 L75.268,40.5682322 L72.592,40.5682322 L72.592,40.6642322 L75.784,45.6202322 L75.784,48.9682322 L78.16,48.9682322 Z M87.796,49.1362322 C88.972,49.1362322 90.088,48.7402322 90.952,47.8882322 L90.028,46.9642322 C89.44,47.5522322 88.576,47.8762322 87.796,47.8762322 C85.624,47.8762322 84.712,46.3522322 84.7,44.8162322 C84.688,43.2682322 85.66,41.6962322 87.796,41.6962322 C88.576,41.6962322 89.368,41.9722322 89.968,42.5602322 L90.868,41.6962322 C90.016,40.8442322 88.924,40.4242322 87.796,40.4242322 C84.796,40.4242322 83.356,42.6202322 83.3679256,44.8282322 C83.38,47.0362322 84.748,49.1362322 87.796,49.1362322 Z M93.028,48.9682322 L93.028,40.5802322 L91.792,40.5802322 L91.792,48.9682322 L93.028,48.9682322 Z M94.252,41.3122322 C94.252,42.3322322 95.788,42.3322322 95.788,41.3122322 C95.788,40.3042322 94.252,40.3042322 94.252,41.3122322 Z M95.632,48.9682322 L95.632,43.0282322 L94.396,43.0282322 L94.396,48.9682322 L95.632,48.9682322 Z M98.188,51.7162322 L98.188,48.1042322 C98.632,48.8362322 99.556,49.1002322 100.276,49.1002322 C102.112,49.1002322 103.264,47.8042322 103.264,46.0162322 C103.264,44.2282322 102.04,42.9442322 100.276,42.9322322 C99.484,42.9322322 98.644,43.2922322 98.188,44.0122322 L98.116,43.0522322 L96.952,43.0522322 L96.952,51.7162322 L98.188,51.7162322 Z M100.156,47.9002322 C99.076,47.9002322 98.296,47.0722322 98.296,46.0162322 C98.296,44.9602322 99.016,44.1322322 100.156,44.1322322 C101.284,44.1322322 102.028,44.9002322 102.028,46.0162322 C102.028,47.1202322 101.236,47.9002322 100.156,47.9002322 Z M106.456,49.1482322 C107.992,49.1482322 108.964,48.3802322 108.976,47.2762322 C108.988,45.7522322 107.56,45.5122322 106.468,45.4162322 C105.712,45.3442322 105.196,45.1522322 105.184,44.6602322 C105.184,44.1922322 105.688,43.9402322 106.444,43.9522322 C107.032,43.9522322 107.536,44.0722322 108.004,44.5042322 L108.7,43.6882322 C108.04,43.1002322 107.332,42.8962322 106.42,42.8962322 C105.316,42.8962322 103.96,43.3882322 103.96,44.6962322 C103.972,46.0042322 105.256,46.3642322 106.372,46.4722322 C107.248,46.5562322 107.752,46.7602322 107.74,47.2882322 C107.728,47.8402322 107.068,48.0562322 106.48,48.0562322 C105.784,48.0442322 104.956,47.7922322 104.404,47.1802322 L103.756,48.0562322 C104.536,48.9322322 105.496,49.1482322 106.456,49.1482322 Z\",\n id: \"GIPHYClips\"\n }\n))))));\nvar clips_branding_default = GIPHYClips;\n\n// src/components/video/attribution.tsx\nvar Container10 = styled16.div`\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n`;\nvar Avatar5 = styled16(avatar_default)`\n flex-shrink: 0;\n`;\nvar Right = styled16.div`\n display: flex;\n flex-direction: column;\n`;\nvar Attribution3 = ({ gif, className, onClick }) => {\n const { user } = gif;\n if (!(user == null ? void 0 : user.username) && !(user == null ? void 0 : user.display_name)) {\n return null;\n }\n return /* @__PURE__ */ React25.createElement(\n Container10,\n {\n className: [Attribution3.className, className].join(\" \"),\n onClick: (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (onClick) {\n onClick(gif);\n } else {\n const url = user.profile_url;\n if (url)\n window.open(url, \"_blank\");\n }\n }\n },\n /* @__PURE__ */ React25.createElement(Avatar5, { user }),\n /* @__PURE__ */ React25.createElement(Right, null, /* @__PURE__ */ React25.createElement(\n clips_branding_default,\n {\n onClick: (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (onClick) {\n onClick(gif);\n } else if (gif.url) {\n window.open(gif.url, \"_blank\");\n }\n }\n }\n ), /* @__PURE__ */ React25.createElement(user_default, { user }))\n );\n};\nAttribution3.className = \"giphy-attribution\";\nvar attribution_default2 = Attribution3;\n\n// src/components/video/controls/volume.tsx\nimport React26 from \"react\";\nvar VolumeSize = 25;\nvar VolumeOnIcon = ({ size = VolumeSize, onClick = () => {\n} }) => /* @__PURE__ */ React26.createElement(\"svg\", { width: size, height: size, viewBox: \"0 0 26 23\", onClick }, /* @__PURE__ */ React26.createElement(\"g\", { stroke: \"none\", strokeWidth: 1, fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React26.createElement(\"g\", { transform: \"translate(1.000000, 0.000000)\", fill: \"#FFF\", fillRule: \"nonzero\" }, /* @__PURE__ */ React26.createElement(\"path\", { d: \"M11.9625091,0.572584405 L11.9625091,22.2272644 C11.9625091,22.4856644 11.8466091,22.6635044 11.6151891,22.7611644 C11.3480491,22.8413444 11.1390491,22.7968844 10.9878091,22.6277844 L4.8732291,15.9143244 L0.573909096,15.9143244 C0.413549096,15.9143244 0.277509096,15.8588444 0.166549096,15.7475044 C0.0573082348,15.6406091 -0.00292164572,15.4933347 -1.77635684e-15,15.3405244 L-1.77635684e-15,7.45058441 C-1.77635684e-15,7.29022441 0.0555890961,7.15456441 0.167309096,7.04322441 C0.278269096,6.93226441 0.414309096,6.87640441 0.573909096,6.87640441 L4.8732291,6.87640441 L10.9874291,0.172064405 C11.1390491,0.00296440549 11.3484291,-0.0414955945 11.6151891,0.0386844055 C11.8466091,0.136344405 11.9621291,0.314564405 11.9621291,0.572584405 L11.9625091,0.572584405 Z\" }), /* @__PURE__ */ React26.createElement(\"path\", { d: \"M15.7579491,16.0914044 L14.6798891,13.6594044 C15.5739159,13.2635547 16.1503537,12.3776671 16.1501091,11.3999244 C16.150386,10.4242626 15.5763999,9.53983269 14.6852091,9.14272441 L15.7697291,6.71376441 C17.6193585,7.53872062 18.810518,9.37466359 18.8101092,11.3999244 C18.8105521,13.4298903 17.6139475,15.2691931 15.7579491,16.0914044 L15.7579491,16.0914044 Z\" }), /* @__PURE__ */ React26.createElement(\"path\", { d: \"M18.3647491,20.2619044 L17.2863091,17.8299044 C19.8302925,16.7031661 21.4705725,14.1822599 21.4701091,11.3999244 C21.4701091,8.59818441 19.8167291,6.09892441 17.3022691,4.97678441 L18.3864091,2.54782441 C21.8804724,4.10607079 24.1307363,7.57414217 24.1301093,11.3999244 C24.1308375,15.2343934 21.8705556,18.7086904 18.3647491,20.2619044 Z\" }))));\nvar VolumeOffIcon = ({ size = VolumeSize, onClick = () => {\n} }) => /* @__PURE__ */ React26.createElement(\n \"svg\",\n {\n onClick,\n height: size,\n width: size,\n viewBox: \"0 0 26 23\",\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\"\n },\n /* @__PURE__ */ React26.createElement(\"g\", { id: \"Page-1\", stroke: \"none\", strokeWidth: 1, fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React26.createElement(\"g\", { id: \"Group\", transform: \"translate(1.000000, 0.000000)\", fill: \"#FFFFFF\", fillRule: \"nonzero\" }, /* @__PURE__ */ React26.createElement(\n \"path\",\n {\n d: \"M11.9625091,0.572584405 L11.9625091,22.2272644 C11.9625091,22.4856644 11.8466091,22.6635044 11.6151891,22.7611644 C11.3480491,22.8413444 11.1390491,22.7968844 10.9878091,22.6277844 L4.8732291,15.9143244 L0.573909096,15.9143244 C0.413549096,15.9143244 0.277509096,15.8588444 0.166549096,15.7475044 C0.0573082348,15.6406091 -0.00292164572,15.4933347 0,15.3405244 L0,7.45058441 C0,7.29022441 0.0555890961,7.15456441 0.167309096,7.04322441 C0.278269096,6.93226441 0.414309096,6.87640441 0.573909096,6.87640441 L4.8732291,6.87640441 L10.9874291,0.172064405 C11.1390491,0.00296440549 11.3484291,-0.0414955945 11.6151891,0.0386844055 C11.8466091,0.136344405 11.9621291,0.314564405 11.9621291,0.572584405 L11.9625091,0.572584405 Z\",\n id: \"Path\"\n }\n )), /* @__PURE__ */ React26.createElement(\"g\", { id: \"Group\", transform: \"translate(14.887009, 6.947630)\", fill: \"#FFFFFF\", fillRule: \"nonzero\" }, /* @__PURE__ */ React26.createElement(\n \"path\",\n {\n d: \"M7.88199149,6.27905236 C7.94693088,6.35707599 7.94693088,6.47033309 7.88199149,6.54835671 L6.54835671,7.88199149 C6.47033309,7.94693088 6.35707599,7.94693088 6.27905236,7.88199149 L3.96534802,5.56828715 L1.65164367,7.88199149 C1.57362004,7.94693088 1.46036294,7.94693088 1.38233932,7.88199149 L0.0487045381,6.54835671 C-0.016234846,6.47033309 -0.016234846,6.35707599 0.0487045381,6.27905236 L2.36240889,3.96534802 L0.0487045381,1.65164367 C-0.016234846,1.57362004 -0.016234846,1.46036294 0.0487045381,1.38233932 L1.38233932,0.0487045381 C1.46036294,-0.016234846 1.57362004,-0.016234846 1.65164367,0.0487045381 L3.96534802,2.36240889 L6.27905236,0.0487045381 C6.35707599,-0.016234846 6.47033309,-0.016234846 6.54835671,0.0487045381 L7.88199149,1.38233932 C7.94693088,1.46036294 7.94693088,1.57362004 7.88199149,1.65164367 L5.56828715,3.96534802 L7.88199149,6.27905236 Z\",\n id: \"Shape\"\n }\n )))\n);\n\n// src/components/video/progress-bar.tsx\nimport styled17 from \"@emotion/styled\";\nimport { giphyWhite as giphyWhite3 } from \"@giphy/colors\";\nimport React27 from \"react\";\nimport useRaf from \"react-use/lib/useRaf\";\nvar Bar = styled17.div`\n background: ${giphyWhite3};\n height: ${(props) => props.barHeight}px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n`;\nvar ProgressBar = ({ videoEl }) => {\n useRaf(2147483647, 100);\n const time2 = (videoEl == null ? void 0 : videoEl.currentTime) || 0;\n const duration = (videoEl == null ? void 0 : videoEl.duration) || 0;\n const val = time2 / duration;\n let percentage = Math.round(val * 100);\n let barHeight = 5;\n if ((videoEl == null ? void 0 : videoEl.height) < 200) {\n barHeight = 3;\n } else if ((videoEl == null ? void 0 : videoEl.height) < 300) {\n barHeight = 4;\n }\n percentage = duration < 10 && percentage > 98 ? 100 : percentage;\n return /* @__PURE__ */ React27.createElement(Bar, { style: { width: `${percentage}%` }, barHeight, className: \"hide-in-percy\" });\n};\nvar progress_bar_default = ProgressBar;\n\n// src/components/video/video.tsx\nimport { pingback as pingback2 } from \"@giphy/js-analytics\";\nimport { getBestVideo, getGifHeight as getGifHeight3 } from \"@giphy/js-util\";\nimport React28, { useCallback as useCallback3, useEffect as useEffect7, useRef as useRef7, useState as useState4 } from \"react\";\n\n// src/components/video/util.ts\nvar getErrorMessage = (code, src = \"\") => {\n switch (code) {\n case 1:\n return \"Aborted. The fetching process for the media resource was aborted by the user agent at the user's request.\";\n case 2:\n return \"Network Error. A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.\";\n case 3:\n return \"Decode Error. An error of some description occurred while decoding the media resource, after the resource was established to be usable.\";\n case 4:\n return `Can not play a video of type \"${src.split(\".\").pop()}\" on this platform.`;\n default:\n return \"\";\n }\n};\nvar shouldFireQuartile = (quartile, playhead, duration, quartilesFired, loopNumber) => {\n const currentQuartile = loopNumber + quartile;\n if (!quartilesFired.has(currentQuartile) && duration > 0 && playhead > duration * quartile) {\n quartilesFired.add(currentQuartile);\n return true;\n }\n return false;\n};\n\n// src/components/video/video.tsx\nvar quartileEvents = [0.25, 0.5, 0.75];\nvar videoClassName = \"giphy-video\";\nvar Network = {\n // The element has not yet been initialized. All attributes are in their initial states.\n EMPTY: 0,\n // The element's resource selection algorithm is active and has selected a resource, but it is not actually using the network at this time.\n IDLE: 1,\n // The user agent is actively trying to download data.\n LOADING: 2,\n // The element's resource selection algorithm is active, but it has not yet found a resource to use.\n NO_SOURCE: 3\n};\nvar Video = ({\n muted,\n ccEnabled = false,\n ccLanguage = \"en\",\n loop = true,\n onStateChange,\n onTimeUpdate,\n onCanPlay,\n onFirstPlay,\n onWaiting,\n onMuted,\n onError,\n onEnded,\n onLoop,\n onQuartile,\n onEndFullscreen,\n setVideoEl,\n gif,\n width,\n height: height_,\n volume = 0.7,\n className = videoClassName\n}) => {\n var _a, _b, _c;\n const height = height_ || getGifHeight3(gif, width);\n const [media, setMedia] = useState4(getBestVideo(gif.video, width, height));\n const seek = useRef7(0);\n if (!media) {\n console.warn(`GiphyJS No video content for id: ${gif.id}`);\n }\n const mountTime = useRef7(Date.now());\n const hasPlayingFired = useRef7(false);\n const loopNumber = useRef7(0);\n const waitingCount = useRef7(0);\n const quartilesFired = useRef7(/* @__PURE__ */ new Set());\n useEffect7(() => {\n mountTime.current = Date.now();\n hasPlayingFired.current = false;\n loopNumber.current = 1;\n waitingCount.current = 0;\n quartilesFired.current = /* @__PURE__ */ new Set();\n }, [gif.id]);\n const videoEl = useRef7(null);\n useEffect7(() => {\n const newMedia = getBestVideo(gif.video, width, height);\n if (videoEl.current && (media == null ? void 0 : media.url) && newMedia.url !== media.url) {\n if (media.url.indexOf(String(gif.id)) !== -1) {\n seek.current = videoEl.current.currentTime;\n }\n setMedia(newMedia);\n }\n }, [width, height_, gif.video, height, media == null ? void 0 : media.url, gif.id]);\n useEffect7(() => {\n if (videoEl.current && (media == null ? void 0 : media.url) && seek.current) {\n videoEl.current.currentTime = seek.current;\n seek.current = 0;\n }\n }, [media == null ? void 0 : media.url, seek]);\n const _onError = useCallback3(() => {\n var _a2;\n const el = videoEl.current;\n const code = (_a2 = el == null ? void 0 : el.error) == null ? void 0 : _a2.code;\n if (code && (el == null ? void 0 : el.src)) {\n const message = getErrorMessage(code, el == null ? void 0 : el.src);\n console.error(message);\n onError == null ? void 0 : onError(code);\n }\n }, [onError]);\n const _onPlaying = useCallback3(() => {\n onStateChange == null ? void 0 : onStateChange(\"playing\");\n if (!hasPlayingFired.current) {\n hasPlayingFired.current = true;\n if (gif.analytics_response_payload) {\n pingback2({ actionType: \"START\", analyticsResponsePayload: gif.analytics_response_payload });\n }\n onFirstPlay == null ? void 0 : onFirstPlay(Date.now() - mountTime.current);\n }\n }, [onFirstPlay, onStateChange, gif]);\n const _onPaused = useCallback3(() => onStateChange == null ? void 0 : onStateChange(\"paused\"), [onStateChange]);\n const _onTimeUpdate = useCallback3(() => {\n const el = videoEl.current;\n if (el) {\n const playhead = el.currentTime;\n quartileEvents.some((q) => {\n if (shouldFireQuartile(q, playhead, el.duration, quartilesFired.current, loopNumber.current)) {\n onQuartile == null ? void 0 : onQuartile(q);\n return true;\n }\n return false;\n });\n onTimeUpdate == null ? void 0 : onTimeUpdate(playhead || 0);\n }\n }, [onQuartile, onTimeUpdate]);\n const _onCanPlay = useCallback3(() => onCanPlay == null ? void 0 : onCanPlay(), [onCanPlay]);\n const _onWaiting = useCallback3(() => {\n const el = videoEl.current;\n if ((el == null ? void 0 : el.currentTime) !== 0 && (el == null ? void 0 : el.networkState) !== Network.IDLE) {\n onWaiting == null ? void 0 : onWaiting(++waitingCount.current);\n }\n }, [onWaiting]);\n const _onEnded = useCallback3(() => {\n if (!hasPlayingFired.current) {\n return;\n }\n if (loop && videoEl.current) {\n videoEl.current.play();\n }\n onLoop == null ? void 0 : onLoop(loopNumber.current);\n loopNumber.current = loopNumber.current + 1;\n onEnded == null ? void 0 : onEnded();\n }, [onEnded, loop, onLoop]);\n const _onEndFullscreen = useCallback3(() => onEndFullscreen == null ? void 0 : onEndFullscreen(), [onEndFullscreen]);\n const tryAutoPlayWithSound = useCallback3(\n (videoEl2) => __async(void 0, null, function* () {\n if (videoEl2) {\n const promisePlay = videoEl2.play();\n if (promisePlay !== void 0) {\n try {\n yield promisePlay;\n onMuted == null ? void 0 : onMuted(false);\n } catch (error) {\n videoEl2.muted = true;\n onMuted == null ? void 0 : onMuted(true);\n videoEl2.play();\n }\n }\n }\n }),\n [onMuted]\n );\n useEffect7(() => {\n const el = videoEl.current;\n if (el) {\n tryAutoPlayWithSound(el);\n setVideoEl == null ? void 0 : setVideoEl(el);\n if (!isNaN(volume)) {\n el.volume = volume;\n }\n }\n }, []);\n useEffect7(() => {\n const el = videoEl.current;\n if (el) {\n el.addEventListener(\"play\", _onPlaying);\n el.addEventListener(\"pause\", _onPaused);\n el.addEventListener(\"error\", _onError);\n el.addEventListener(\"timeupdate\", _onTimeUpdate);\n el.addEventListener(\"canplay\", _onCanPlay);\n el.addEventListener(\"ended\", _onEnded);\n el.addEventListener(\"waiting\", _onWaiting);\n el.addEventListener(\"webkitendfullscreen\", _onEndFullscreen);\n }\n return () => {\n if (el) {\n el.removeEventListener(\"play\", _onPlaying);\n el.removeEventListener(\"pause\", _onPaused);\n el.removeEventListener(\"error\", _onError);\n el.removeEventListener(\"timeupdate\", _onTimeUpdate);\n el.removeEventListener(\"canplay\", _onCanPlay);\n el.removeEventListener(\"ended\", _onEnded);\n el.removeEventListener(\"waiting\", _onWaiting);\n el.removeEventListener(\"webkitendfullscreen\", _onEndFullscreen);\n }\n };\n }, [_onPlaying, _onPaused, _onError, _onTimeUpdate, _onCanPlay, _onEnded, _onWaiting, _onEndFullscreen]);\n const captionSrc = (_c = (_b = (_a = gif.video) == null ? void 0 : _a.captions) == null ? void 0 : _b[ccLanguage]) == null ? void 0 : _c.vtt;\n return (media == null ? void 0 : media.url) ? /* @__PURE__ */ React28.createElement(\n \"video\",\n {\n crossOrigin: \"anonymous\",\n draggable: true,\n className,\n width,\n height,\n muted,\n autoPlay: true,\n playsInline: true,\n ref: videoEl,\n src: media == null ? void 0 : media.url,\n \"data-giphy-id\": gif.id\n },\n ccEnabled && captionSrc && /* @__PURE__ */ React28.createElement(\"track\", { label: \"English\", kind: \"subtitles\", srcLang: ccLanguage, src: captionSrc, default: true })\n ) : null;\n};\nVideo.className = videoClassName;\nvar video_default = Video;\n\n// src/components/video/index.tsx\nvar Container11 = styled18.div`\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n`;\nvar Volume = styled18.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n`;\nvar Controls = styled18.div`\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ${(props) => props.isHovered ? 1 : 0};\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n`;\nvar Title = styled18.div`\n font-size: 22px;\n color: white;\n margin-bottom: 5px;\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n`;\nvar TitleContainer = styled18.div`\n position: relative;\n min-width: 0;\n`;\nvar Gradient = styled18.div`\n &:before {\n background: linear-gradient(rgba(18, 18, 18, 0.6), rgba(0, 0, 0, 0));\n content: '';\n height: ${(props) => props.isLargePlayer ? 125 : 75}px;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n &:after {\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n content: '';\n height: ${(props) => props.isLargePlayer ? 125 : 75}px;\n left: 0;\n pointer-events: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n }\n`;\nvar LARGE_PLAYER_HEIGHT = 300;\nvar AUTO_HIDE_TIMEOUT = 4e3;\nvar VideoPlayer = (props) => {\n const {\n width,\n hideMute,\n hideAttribution,\n hideProgressBar,\n className,\n persistentControls,\n gif,\n overlay: Overlay\n } = props;\n const [isHovered, setIsHovered] = useState5(false);\n const [videoEl, _setVideoEl] = useState5(null);\n const [muted, setMuted] = useState5(props.muted);\n const [mutedByBrowser, setMutedByBrowser] = useState5(false);\n const { setVideoEl, onMuted, onUserMuted } = props;\n const height = props.height || getGifHeight4(gif, width);\n const [, cancelHideTimeout, resetHideTimeout] = useTimeoutFn(() => {\n setIsHovered(false);\n }, AUTO_HIDE_TIMEOUT);\n const combinedOnMuted = useCallback4(\n (args) => {\n onMuted == null ? void 0 : onMuted(args);\n setMutedByBrowser(args);\n },\n [setMutedByBrowser, onMuted]\n );\n const combinedSetVideoEl = useCallback4(\n (args) => {\n setVideoEl == null ? void 0 : setVideoEl(args);\n _setVideoEl(args);\n },\n [setVideoEl, _setVideoEl]\n );\n const toggleMute = () => {\n if (mutedByBrowser) {\n setMutedByBrowser(false);\n setMuted(false);\n } else {\n setMuted(!muted);\n }\n };\n useEffect8(() => {\n setMuted(props.muted);\n }, [props.muted]);\n const showControls = persistentControls || isHovered;\n const isLargePlayer = height >= LARGE_PLAYER_HEIGHT;\n useEffect8(() => {\n if (showControls) {\n resetHideTimeout();\n } else {\n cancelHideTimeout();\n }\n return () => cancelHideTimeout();\n }, [showControls, cancelHideTimeout, resetHideTimeout]);\n return /* @__PURE__ */ React29.createElement(\n Container11,\n {\n className,\n style: { width, height },\n onMouseOver: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n onMouseMove: () => {\n setIsHovered(true);\n resetHideTimeout();\n },\n onClick: (e) => {\n onUserMuted == null ? void 0 : onUserMuted(!(muted || mutedByBrowser));\n videoEl == null ? void 0 : videoEl.play();\n e.preventDefault();\n toggleMute();\n }\n },\n /* @__PURE__ */ React29.createElement(video_default, __spreadProps(__spreadValues({}, props), { onMuted: combinedOnMuted, setVideoEl: combinedSetVideoEl, muted })),\n showControls && /* @__PURE__ */ React29.createElement(Gradient, { isLargePlayer }),\n /* @__PURE__ */ React29.createElement(Controls, { isHovered: showControls }, /* @__PURE__ */ React29.createElement(TitleContainer, null, isLargePlayer && /* @__PURE__ */ React29.createElement(\n Title,\n {\n onClick: (e) => {\n e.preventDefault();\n e.stopPropagation();\n window.open(gif.url, \"_blank\");\n }\n },\n gif.title\n ), videoEl && !hideAttribution ? /* @__PURE__ */ React29.createElement(attribution_default2, { gif }) : null), !hideMute && /* @__PURE__ */ React29.createElement(Volume, null, muted || mutedByBrowser ? /* @__PURE__ */ React29.createElement(VolumeOffIcon, null) : /* @__PURE__ */ React29.createElement(VolumeOnIcon, null))),\n showControls && !hideProgressBar && videoEl ? /* @__PURE__ */ React29.createElement(progress_bar_default, { videoEl }) : null,\n Overlay && /* @__PURE__ */ React29.createElement(Overlay, { gif, isHovered, width, height })\n );\n};\nvar VideoWrapper = (props) => {\n if (props.overlay && !props.controls) {\n console.warn(`${Logger3.PREFIX}: Overlays only work when controls are enabled`);\n }\n return props.controls ? /* @__PURE__ */ React29.createElement(VideoPlayer, __spreadValues({}, props)) : /* @__PURE__ */ React29.createElement(video_default, __spreadValues({}, props));\n};\nvar video_default2 = VideoWrapper;\n\n// src/components/video/controls/play-pause.tsx\nimport React30 from \"react\";\nvar PlayPauseSize = 25;\nvar PlayIcon = ({ size = PlayPauseSize }) => /* @__PURE__ */ React30.createElement(\"svg\", { height: size, viewBox: \"15.39 10.84 18.21 24\", width: size, xmlns: \"http://www.w3.org/2000/svg\" }, /* @__PURE__ */ React30.createElement(\"g\", { fillRule: \"evenodd\", fill: \"none\" }, /* @__PURE__ */ React30.createElement(\n \"path\",\n {\n fill: \"#fff\",\n d: \"M15.836 10.842c.135 0 .27.04.404.12L33.444 22.86c.107.087.161.19.161.311 0 .12-.054.224-.161.31-11.649 7.575-17.528 11.362-17.64 11.362a.632.632 0 0 1-.41-.13l.025-23.75a.804.804 0 0 1 .417-.12z\"\n }\n)));\nvar PauseIcon = ({ size = PlayPauseSize }) => /* @__PURE__ */ React30.createElement(\"svg\", { height: size, viewBox: \"0.92 0.92 23.54 24\", width: size, xmlns: \"http://www.w3.org/2000/svg\" }, /* @__PURE__ */ React30.createElement(\"g\", { id: \"Page-1\", stroke: \"none\", strokeWidth: \"1\", fill: \"none\", fillRule: \"evenodd\" }, /* @__PURE__ */ React30.createElement(\"g\", { id: \"Group\", transform: \"translate(0.916948, 0.916948)\", fill: \"#FFFFFF\", fillRule: \"nonzero\" }, /* @__PURE__ */ React30.createElement(\n \"path\",\n {\n d: \"M0,23.2 L0,0.8 C0,0.3581722 0.3581722,0 0.8,0 L8.2,0 C8.64182776,0 9,0.3581722 9,0.8 L9,23.2 C9,23.6418278 8.64182776,24 8.2,24 L0.8,24 C0.3581722,24 0,23.6418278 0,23.2 Z\",\n id: \"Path\"\n }\n), /* @__PURE__ */ React30.createElement(\n \"path\",\n {\n d: \"M14.5408163,23.2 L14.5408163,0.8 C14.5408163,0.3581722 14.8989886,0 15.3408163,0 L22.7408163,0 C23.1826441,0 23.5408163,0.3581722 23.5408163,0.8 L23.5408163,23.2 C23.5408163,23.6418278 23.1826441,24 22.7408163,24 L15.3408163,24 C14.8989886,24 14.5408163,23.6418278 14.5408163,23.2 Z\",\n id: \"Path\"\n }\n))));\n\n// src/components/video/video-overlay.tsx\nimport styled19 from \"@emotion/styled\";\nimport React31, { useEffect as useEffect9, useState as useState6 } from \"react\";\nvar VideoContainer = styled19.div`\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n`;\nvar VideoStyled = styled19(video_default2)`\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n`;\nvar Button = styled19.div`\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ${(props) => props.isHovered ? 1 : 0.8};\n transition: opacity ease-out 800ms;\n`;\nvar speakerClassName = \"giphy-video-overlay-button\";\nvar VolumeButton = ({ muted, toggleMute, mutedByBrowser, isHovered }) => /* @__PURE__ */ React31.createElement(\n Button,\n {\n className: speakerClassName,\n onClick: (e) => {\n e.preventDefault();\n e.stopPropagation();\n toggleMute();\n },\n isHovered\n },\n muted || mutedByBrowser || !isHovered ? /* @__PURE__ */ React31.createElement(VolumeOffIcon, null) : /* @__PURE__ */ React31.createElement(VolumeOnIcon, null)\n);\nvar VideoOverlay = ({\n gif,\n isHovered,\n hideMuteButton,\n width,\n height,\n className,\n muted: userPrefMuted = false,\n onUserMuted\n}) => {\n const [muted, setMuted] = useState6(userPrefMuted);\n const [mutedByBrowser, setMutedByBrowser] = useState6(false);\n const toggleMute = () => {\n if (mutedByBrowser) {\n setMutedByBrowser(false);\n setMuted(false);\n } else {\n onUserMuted == null ? void 0 : onUserMuted(!muted);\n setMuted(!muted);\n }\n };\n useEffect9(() => {\n setMuted(userPrefMuted);\n }, [userPrefMuted, setMuted]);\n const props = { toggleMute, muted, mutedByBrowser };\n return /* @__PURE__ */ React31.createElement(VideoContainer, { className }, isHovered && /* @__PURE__ */ React31.createElement(\n VideoStyled,\n {\n gif,\n key: gif.id,\n loop: true,\n controls: true,\n hideAttribution: true,\n hideMute: true,\n persistentControls: true,\n muted,\n width,\n height,\n onMuted: setMutedByBrowser\n }\n ), !hideMuteButton && /* @__PURE__ */ React31.createElement(VolumeButton, __spreadProps(__spreadValues({}, props), { isHovered })));\n};\nVideoOverlay.imgClassName = speakerClassName;\nvar video_overlay_default = VideoOverlay;\n\n// src/index.ts\nappendGiphySDKRequestHeader(`X-GIPHY-SDK-NAME`, \"ReactSDK\");\nexport {\n attribution_default as Attribution,\n overlay_default as AttributionOverlay,\n carousel_default as Carousel,\n EmojiVariationsList,\n gif_default as Gif,\n grid_default as Grid,\n loader_default as Loader,\n PauseIcon,\n PingbackContext,\n PlayIcon,\n PlayPauseSize,\n search_bar_default as SearchBar,\n SearchContext,\n context_default as SearchContextManager,\n suggestion_bar_default as SuggestionBar,\n verified_badge_default as VerifiedBadge,\n video_default2 as Video,\n video_overlay_default as VideoOverlay,\n VolumeOffIcon,\n VolumeOnIcon,\n VolumeSize\n};\n","import React, { useState, useEffect } from \"react\";\nimport Heading from \"./Heading\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport { FileUpload } from \"../../../fileUpload\";\nimport { CXInput } from \"component/Input\";\nimport { Grid } from \"@giphy/react-components\";\nimport { GiphyFetch } from \"@giphy/js-fetch-api\";\n\nconst Image = ({ ondelete, data }) => {\n const giphyFetch = new GiphyFetch(\"OAepDuoO2cbMQgfofPzZgXErm2TNY8aI\");\n const [link, setlink] = useState({\n url: data?.attachments[0]?.url ?? \"\",\n mType: data?.attachments[0]?.mType ?? \"\",\n mimeType: data?.attachments[0]?.mimeType ?? \"\",\n });\n function upload() {\n return (\n
    \n setlink({ url: v, mType: \"image\" })}\n preview={false}\n />\n
    \n );\n }\n function Url() {\n return (\n
    \n setlink({ url: e.target.value, mType: \"image\" })}\n />\n \n * Make sure the URL is hosted public\n \n
    \n );\n }\n function Giphy() {\n const [search, setsearch] = useState(\"\");\n const searchFunc = (val) => {\n setlink({});\n setsearch(val);\n };\n return (\n
    \n searchFunc(e.target.value)}\n />\n {search?.length > 0 && (\n
    \n \n
    \n )}\n
    \n );\n }\n function GridComp({ search, setsearch }) {\n const fetchGifs = (offset) =>\n giphyFetch.search(search, { offset, limit: 10 });\n const onGifClick = (gif) => {\n setlink({ url: gif.images.downsized.url, mType: \"image\" });\n setsearch(\"\");\n };\n const Overlay = ({ gif, isHovered }) => {\n return (\n
    \n {isHovered ? use : \"\"}\n
    \n );\n };\n return (\n {\n onGifClick(gif);\n e.preventDefault();\n }}\n fetchGifs={fetchGifs}\n width={306}\n columns={3}\n gutter={6}\n noLink={true}\n hideAttribution={true}\n overlay={Overlay}\n />\n );\n }\n function Video() {\n return (\n
    \n setlink({ url: e.target.value, mType: \"iframe\" })}\n />\n \n * Make sure the URL is hosted public\n \n
    \n );\n }\n const uploadtype = [\n { name: \"File\" },\n { name: \"URL\" },\n { name: \"Giphy\" },\n { name: \"Video\" },\n ];\n const [activebar, setactivebar] = useState(uploadtype[0]);\n const SwitchBar = (res) => {\n setactivebar(res);\n };\n\n let obj = {\n File: upload(),\n URL: Url(),\n Giphy: Giphy(),\n Video: Video(),\n };\n useEffect(() => {\n if (link.mType === \"iframe\") {\n data.attachments = [{ url: link.url, mType: link.mType, mimeType: null }];\n }\n if (link.mType === \"image\") {\n let ext = link.url.split(\".\").pop().split(\"&\")[0];\n data.attachments = [\n { url: link.url, mType: link.mType, mimeType: `image/${ext}` },\n ];\n }\n }, [link]);\n return (\n
    \n
    \n \n ondelete(data)}\n />\n
    \n
    \n
    \n {uploadtype.map((res) => (\n
    SwitchBar(res)}>\n \n {res?.name}\n
    \n {activebar?.name === res?.name && (\n
    \n )}\n
    \n ))}\n
    \n {obj[activebar?.name]}\n {link?.url?.length > 0 && (\n
    \n {(link.mType === \"image\" || link.mType === undefined) && (\n \n )}\n {link.mType === \"iframe\" && (\n \n )}\n
    \n )}\n \n \n );\n};\n\nexport default Image;\n","import React from \"react\";\nimport Heading from \"./Heading\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport { CXMarkdownWorkbenchEditor } from \"component/MarkdownEditor\";\n\nconst Text = ({ ondelete, data }) => {\n return (\n
    \n
    \n \n ondelete(data)}\n />\n
    \n
    \n {\n data.prompt.q[0] = value;\n }}\n onBlur={() => {}}\n />\n
    \n
    \n );\n};\n\nexport default Text;\n","import React from \"react\";\nimport Heading from \"./Heading\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport { CXMarkdownWorkbenchEditor } from \"component/MarkdownEditor\";\n\nconst TextEvent = ({ ondelete, data, text }) => {\n const onChnageHandler = (value) => {\n delete data.prompt;\n delete data.attachments;\n delete data.buttons;\n data._type = \"eventText\";\n data.text.q[0] = value;\n };\n return (\n
    \n
    \n \n ondelete(data)}\n />\n
    \n
    \n onChnageHandler(value)}\n />\n
    \n
    \n );\n};\n\nexport default TextEvent;\n","import React, { useRef } from \"react\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport Button from \"./Button\";\nimport Image from \"./Image\";\nimport Text from \"./Text\";\nimport TextEvent from \"./Text-Event\";\nimport \"./style.css\";\nimport { CXDropdown } from \"component/Dropdown\";\nimport { CXMenu, CXMenuItem } from \"component/Menu\";\n\nconst AddSection = ({ ActiveNodeType, setActiveNodeType, node }) => {\n const dragItem = useRef();\n const dragOverItem = useRef();\n const NodeObj = [\n {\n name: \"text\",\n icon: imageMapper[\"TextW\"],\n sb: \"Ask anything to the user\",\n useCase: [\"all\"],\n },\n {\n name: \"media\",\n icon: imageMapper[\"File\"],\n sb: \"Image, gif, video...\",\n useCase: [\"all\"],\n },\n {\n name: \"button\",\n icon: imageMapper[\"ButtonsW\"],\n sb: \"Add buttons\",\n useCase: [\"button\"],\n },\n {\n name: \"eventText\",\n icon: imageMapper[\"TextW\"],\n sb: \"Add Event Text\",\n useCase: [\"all\"],\n },\n ];\n const NodeComponenets = {\n text: Text,\n media: Image,\n button: Button,\n eventText: TextEvent,\n };\n const dyComponent = (val) => {\n if ([\"text\", \"media\", \"button\", \"eventText\"]?.includes(val?.name)) {\n const DynamicComponentLoad = NodeComponenets[val?.name];\n return (\n removeNodeData(d)}\n data={val}\n delDisable={val?.name === \"button\"}\n />\n );\n }\n };\n const addNodeData = (nodeType) => {\n let obj = {\n _type: \"rtc\",\n name: nodeType.name,\n prompt: { q: [\"\"] },\n text: { q: [\"\"] },\n attachments: [],\n buttons: [],\n };\n if (\n ActiveNodeType.some((val) =>\n [\"rating\", \"calendar\", \"file\"].includes(val.name)\n )\n ) {\n let temp = JSON.parse(JSON.stringify(ActiveNodeType));\n let index = temp.findIndex((val) =>\n [\"rating\", \"calendar\", \"file\"].includes(val.name)\n );\n temp.splice(index, 0, obj);\n setActiveNodeType(temp);\n } else {\n setActiveNodeType([...ActiveNodeType, obj]);\n }\n };\n const dragStart = (e, position) => {\n dragItem.current = position;\n };\n const dragEnter = (e, position) => {\n dragOverItem.current = position;\n };\n const drop = (e) => {\n const copyListItems = [...ActiveNodeType];\n const dragItemContent = copyListItems[dragItem.current];\n copyListItems.splice(dragItem.current, 1);\n copyListItems.splice(dragOverItem.current, 0, dragItemContent);\n dragItem.current = null;\n dragOverItem.current = null;\n setActiveNodeType(copyListItems);\n };\n const removeNodeData = (nodeType) => {\n setActiveNodeType(\n ActiveNodeType.filter(\n (item) =>\n !Object.keys(item).every(\n (key) => nodeType.hasOwnProperty(key) && nodeType[key] === item[key]\n )\n )\n );\n };\n return (\n
    \n \n {NodeObj?.map((res, index) => {\n if (\n res?.useCase.includes(\"all\") ||\n (res?.useCase.includes(node?.type) && node?.type !== \"button\")\n ) {\n return (\n addNodeData({ name: res.name, value: \"\" })}\n >\n
    \n \n
    \n
    \n {res.name.replace(/(^\\w|\\s\\w)/g, (m) =>\n m.toUpperCase()\n )}{\" \"}\n
    \n
    {res.sb}
    \n
    \n
    \n \n );\n }\n })}\n \n }\n >\n
    \n Add Section\n
    \n \n {ActiveNodeType?.map((res, index) => {\n if (\n res?.name !== \"button\" ||\n (res?.name === \"button\" && res._type !== \"store\")\n ) {\n return (\n dragStart(e, index)}\n onDragEnter={(e) => dragEnter(e, index)}\n onDragEnd={drop}\n onDragOver={(e) => e.preventDefault()}\n >\n {dyComponent(res)}\n
    \n );\n } else {\n return;\n }\n })}\n
    \n \n );\n};\n\nexport default AddSection;\n","import { CXMenu } from \"component/Menu\";\nimport { CXSelect } from \"component/Select\";\nimport React, { Fragment } from \"react\";\nimport { generateUniqueKey } from \"utils\";\n\nconst ContentConfigRating = ({ defaultValue, onChange }) => {\n return (\n \n
    \n
    Rating Type
    \n onChange(v)}\n >\n \n \n \n \n \n \n \n ˝\n \n 😠\n 🙁\n 😐\n 😃\n 🤩\n \n \n \n );\n};\n\nexport default ContentConfigRating;\n","import { getStoreCollection } from \"action/AdminActions\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { Fragment, memo, useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { generateUniqueKey } from \"utils\";\n\nconst ShopifyCategory = ({ ActiveNodeType }) => {\n const dispatch = useDispatch();\n const { StoreData, storeCollections } = useSelector(\n (state) => state.AdminReducer\n );\n const addCategory = async (val, name) => {\n let data = name.map((res) => {\n return { catId: res.value, catName: res.children };\n });\n ActiveNodeType.find((item) => item.name === \"shopifyCategory\").items = data;\n };\n const selectStore = (val) => {\n ActiveNodeType.find((item) => item.name === \"shopifyCategory\").storeId =\n val;\n dispatch(getStoreCollection(val));\n };\n useEffect(() => {\n if (\n ActiveNodeType.find((item) => item.name === \"shopifyCategory\")?.storeId\n ) {\n dispatch(\n getStoreCollection(\n ActiveNodeType.find((item) => item.name === \"shopifyCategory\")\n ?.storeId\n )\n );\n }\n }, [ActiveNodeType]);\n return (\n \n
    \n
    Shopify Store
    \n selectStore(val)}\n defaultValue={\n ActiveNodeType.find((item) => item.name === \"shopifyCategory\")\n ?.storeId ?? null\n }\n >\n {StoreData?.map((item) => {\n return {item.title};\n })}\n \n
    \n
    Shopify Category
    \n addCategory(val, name)}\n defaultValue={\n ActiveNodeType.find(\n (item) => item?.name === \"shopifyCategory\"\n )?.items?.map((res) => res?.catId) ?? null\n }\n >\n {storeCollections?.map((item, index) => {\n if (item?.synced) {\n return (\n \n {item.title}\n \n );\n }\n })}\n \n \n );\n};\n\nexport default memo(ShopifyCategory);\n","import { getCollectionProduct, getStoreCollection } from \"action/AdminActions\";\nimport { CXButton } from \"component/Button\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXTag } from \"component/Tag\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nconst ShopifyItem = ({ ActiveNodeType }) => {\n const dispatch = useDispatch();\n const [ItemsList, setItemsList] = useState(\n ActiveNodeType?.find((item) => item?.name === \"shopifyItem\")?.items ?? []\n );\n const [StoreID, setStoreID] = useState(null);\n const [Cat, setCat] = useState({});\n const [Item, setItem] = useState({});\n const { StoreData, storeCollections, ProductCollections } = useSelector(\n (state) => state.AdminReducer\n );\n const { wbSopifyCat, wbSopifyItem } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const SelectHandler = (id, d) => {\n setCat({ id, name: d.children });\n dispatch(getCollectionProduct(StoreID, id));\n setItem(null);\n };\n const SelectItem = (itemId, d) => {\n setItem({ itemId, name: d.children });\n };\n const addItems = () => {\n if (Cat.id && Item.itemId) {\n let check = ItemsList?.find(\n (item) => item.catId === Cat.id\n )?.storeItems?.some((item) => item.itemId === Item.itemId);\n if (!check) {\n let obj = {\n catId: Cat.id,\n catName: Cat.name,\n storeItems: [\n {\n itemId: Item.itemId,\n name: Item.name,\n },\n ],\n };\n let arr = [...ItemsList];\n let index = arr.findIndex((item) => item.catId === Cat.id);\n if (index === -1) {\n arr.push(obj);\n } else {\n arr[index].storeItems.push(obj.storeItems[0]);\n }\n setItemsList(arr);\n ActiveNodeType.find((item) => item.name === \"shopifyItem\").items = arr;\n }\n }\n };\n const removeItem = (item) => {\n let arr = [...ItemsList];\n let index = arr.findIndex((d) => d.catId === item.catId);\n if (index !== -1) {\n let ind = arr[index].storeItems.findIndex(\n (d) => d.itemId === item.itemId\n );\n if (ind !== -1) {\n arr[index].storeItems.splice(ind, 1);\n if (arr[index]?.storeItems?.length === 0) {\n arr.splice(index, 1);\n }\n }\n }\n setItemsList(arr);\n ActiveNodeType.find((item) => item.name === \"shopifyItem\").items = arr;\n };\n useEffect(() => {\n setItemsList(\n ActiveNodeType?.find((item) => item?.name === \"shopifyItem\")?.items ?? []\n );\n }, [ActiveNodeType]);\n const selectStore = (val) => {\n dispatch(getStoreCollection(val));\n };\n return (\n \n
    \n
    Shopify Store
    \n {\n selectStore(val);\n setStoreID(val);\n }}\n >\n {StoreData?.map((item) => {\n return {item.title};\n })}\n \n
    \n
    \n
    Shopify Category
    \n SelectHandler(v, n)}\n >\n {storeCollections?.map((item, index) => {\n if (item?.synced) {\n return (\n \n {item.title}\n \n );\n }\n })}\n \n
    Shopify Items
    \n SelectItem(v, n)}\n >\n {ProductCollections?.products?.map((item, index) => {\n if (item?.synced) {\n return (\n \n {item.title}\n \n );\n }\n })}\n \n
    \n addItems()}>\n ADD ITEM\n \n
    \n {ItemsList?.map((item, index) => {\n return (\n
    \n
    \n \n {item.catName}\n \n
    \n
    \n {item.storeItems?.map((itm, index) => {\n return (\n removeItem({ ...itm, catId: item.catId })}\n >\n {itm.name}\n \n );\n })}\n
    \n
    \n );\n })}\n
    \n \n );\n};\n\nexport default ShopifyItem;\n","var _rect, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nfunction SvgAddLang(_ref, svgRef) {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 30,\n height: 30,\n viewBox: \"0 0 30 30\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 1,\n y: 1,\n width: 28,\n height: 28,\n rx: 2,\n stroke: \"#E5E5E5\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.7241 20V15.7075H20V14.316H15.7241V10H14.2759V14.316H10V15.7075H14.2759V20H15.7241Z\",\n fill: \"black\"\n })));\n}\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgAddLang);\nexport default __webpack_public_path__ + \"static/media/addLang.e479994f73010d38d4e3902850b59c8e.svg\";\nexport { ForwardRef as ReactComponent };","import React, { Fragment, useState } from \"react\";\nimport { ReactComponent as AddIcon } from \"../../../../images/addLang.svg\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXCheckbox } from \"component/Checkbox\";\nimport {\n addLanguageSet,\n deleteLanguageSet,\n getLanguageData,\n} from \"action/WorkbenchAction\";\nimport { imageMapper } from \"../../../../ImageMapper\";\nimport { CXButton } from \"component/Button\";\nimport { isEqual } from \"lodash\";\n\nconst LanguageSection = ({ ActiveLang, setActiveLang, ActiveNodeType }) => {\n const dispatch = useDispatch();\n const { LanguageData, selectedNode } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const [visible, setVisible] = useState(false);\n const [hover, sethover] = useState(null);\n const [AddSet, setAddSet] = useState([]);\n const [confirmString, setconfirmString] = useState(\"\");\n const handleVisibleChange = (newVisible) => {\n setVisible(newVisible);\n };\n const saveLang = () => {\n let obj = {\n lang: AddSet,\n };\n dispatch(addLanguageSet(obj, selectedNode.id));\n setAddSet([]);\n setVisible(false);\n };\n const handleAddSet = (e, code) => {\n e.target.checked\n ? setAddSet([...AddSet, code])\n : setAddSet(AddSet.filter((item) => item !== code));\n };\n const handleDelete = (e, code) => {\n setconfirmString({\n ty: \"dl\",\n st: \"You are about to DELETE this language and all the data associated with it. Do you want to continue?\",\n dt: code,\n });\n e.stopPropagation();\n };\n const handleLang = (data) => {\n const CompareNode = selectedNode?.convNodeContent?.filter(\n (r) => r.lang === ActiveLang\n );\n if (isEqual(CompareNode[0]?.content, ActiveNodeType)) {\n confirmHandler({ ty: \"ln\", dt: data });\n } else {\n if (ActiveLang !== data.code) {\n setconfirmString({\n ty: \"ln\",\n st: \"You are about to CHANGE the language any unsaved data will be lost, Do you want to continue?\",\n dt: data,\n });\n }\n }\n };\n const Content = () => {\n return (\n
    \n
    \n {LanguageData.supportedLanguages.map((lang) => {\n return (\n
    \n
    \n handleAddSet(e, lang.code)}\n className=\"LangCheck\"\n disabled={LanguageData?.activatedLang?.some(\n (item) => item.code === lang.code\n )}\n checked={AddSet.some((item) => item === lang.code)}\n >\n {lang.displayName}\n \n
    \n
    \n );\n })}\n
    \n
    saveLang()}>\n Add\n
    \n
    \n );\n };\n const confirmHandler = ({ ty, dt }) => {\n if (ty === \"ln\") {\n setActiveLang(LanguageData.defaultLang);\n dt?.code && setActiveLang(dt?.code);\n dispatch(getLanguageData(selectedNode.id));\n setconfirmString(\"\");\n } else if (ty === \"dl\") {\n if (LanguageData.activatedLang?.length > 1) {\n let obj = {\n lang: dt,\n };\n dispatch(deleteLanguageSet(obj));\n setconfirmString(\"\");\n }\n }\n };\n const CancelHandler = () => {\n setconfirmString(\"\");\n };\n return (\n \n
    \n \n setVisible(true)} />\n \n
    \n {LanguageData &&\n LanguageData?.activatedLang?.map((res) => {\n return (\n sethover(res?.code)}\n onMouseLeave={() => sethover(null)}\n >\n handleLang(res)}\n >\n {res?.displayName}\n {hover === res.code &&\n LanguageData?.activatedLang?.length > 1 &&\n ActiveLang !== res?.code && (\n handleDelete(e, res?.code)}\n />\n )}\n
    \n
    \n );\n })}\n
    \n
    \n {confirmString && LanguageData?.activatedLang?.length > 1 && (\n
    \n
    {confirmString?.st}
    \n
    \n confirmHandler(confirmString)}\n >\n Yes\n \n \n No\n \n
    \n
    \n )}\n
    \n );\n};\n\nexport default LanguageSection;\n","import { getAccountintents } from \"action/WorkbenchAction\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst IntentSelect = ({ onChange, defaultValue }) => {\n const dispatch = useDispatch();\n const { AccountIntents } = useSelector((state) => state.WrokbenchReducer);\n useEffect(() => {\n dispatch(getAccountintents());\n }, []);\n return (\n
    \n
    Intent Setting
    \n {\n onChange(val);\n }}\n defaultValue={\n AccountIntents?.find((res) => res.name === defaultValue)?._id\n }\n >\n {AccountIntents?.map((res) => {\n return {res?.name};\n })}\n \n
    \n );\n};\n\nexport default IntentSelect;\n","import { getStore } from \"action/AdminActions\";\nimport { WBgetSopifiCat } from \"action/WorkbenchAction\";\nimport { CXInput, CXInputNumber } from \"component/Input\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport WidgetFooter from \"../Common/WidgetFooter\";\nimport WidgetVariable from \"../Common/WidgetVariable\";\nimport AddSection from \"./commonComponent/AddSection\";\nimport ContentConfigRating from \"./commonComponent/ContentConfigRating\";\nimport ShopifyCategory from \"./commonComponent/ContentConfigShopifyCategory\";\nimport ShopifyItem from \"./commonComponent/ContentConfigShopifyItem\";\n// import ShopifyVariant from \"./commonComponent/ContentConfigShopifyVariant\";\nimport LanguageSection from \"./commonComponent/LanguageSection\";\nimport { CXPopover } from \"component/Popover\";\nimport { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { generateUniqueKey } from \"utils\";\nimport IntentSelect from \"./commonComponent/intentSelect\";\nconst ContentQWidget = ({ selectedNode }) => {\n const dispatch = useDispatch();\n const { LanguageData } = useSelector((state) => state.WrokbenchReducer);\n const [ActiveLang, setActiveLang] = useState(LanguageData?.defaultLang);\n const [ActiveNodeType, setActiveNodeType] = useState([]);\n const [ErrorNodeType, setErrorNodeType] = useState([]);\n const [retryUnit, setretryUnit] = useState(2);\n const [ErrorEnable, setErrorEnable] = useState(false);\n const [ListName, setListName] = useState(false);\n const [useNum, setuseNum] = useState(false);\n const [updateContact, setupdateContact] = useState(false);\n const [nudgeEnable, setnudgeEnable] = useState(false);\n const InitialNudge = {\n num: 1,\n delay: 1,\n unit: \"minutes\",\n fillerMessage: {\n q: [],\n },\n };\n const [NudgeDelay, setNudgeDelay] = useState(\"minutes\");\n\n useEffect(() => {\n let Content = selectedNode?.convNodeContent?.filter(\n (data) => data.lang === ActiveLang\n );\n if (selectedNode?.convNodeContent) {\n let mutatedContent = JSON.parse(JSON.stringify(Content));\n setActiveNodeType(mutatedContent[0]?.content);\n }\n setnudgeEnable(\n selectedNode?.nudgeSetting?.delay > 0 &&\n selectedNode?.nudgeSetting?.num > 0\n ? true\n : false\n );\n }, [selectedNode, ActiveLang]);\n useEffect(() => {\n setListName(\n ActiveNodeType?.filter((data) => data?.name === \"button\")[0]?.listName ??\n false\n );\n setuseNum(\n ActiveNodeType?.filter((data) => data?.name === \"button\")[0]?.useNum ??\n false\n );\n }, [ActiveNodeType]);\n\n useEffect(() => {\n dispatch(getStore());\n }, []);\n\n const UpdateContactConfig = [\"Name\", \"Email\", \"Phone\"];\n\n const getUpdateContactInfo = (key) => {\n let info = {\n Name: \"Selecting this will update the contact’s name. If the contact does not exist, a new contact will be created with the input name\",\n Email:\n \"Selecting this will update the contact’s email. If the contact does not exist, a new contact will be created with the input email\",\n Phone:\n \"Selecting this will update the contact’s phone. If the contact does not exist, a new contact will be created with the input phone\",\n };\n return info[key];\n };\n const SetNudge = (val) => {\n setnudgeEnable(val);\n if (val) {\n selectedNode.nudgeSetting = InitialNudge;\n } else {\n selectedNode.nudgeSetting = {};\n }\n };\n return (\n <>\n \n
    Content
    \n \n {UpdateContactConfig.includes(selectedNode?.name) && (\n
    \n
    \n
    \n
    \n Update Contact Field{\" \"}\n \n {getUpdateContactInfo(selectedNode?.name)}\n
    \n }\n >\n \n \n
    \n setupdateContact(event)}\n defaultChecked={selectedNode.updateContact ?? false}\n />\n
    \n
    \n )}\n {selectedNode.type === \"rating\" && (\n data.name === \"rating\")[0]?.rType\n }\n onChange={(v) =>\n (ActiveNodeType.filter((data) => data.name === \"rating\")[0].rType =\n v)\n }\n />\n )}\n {selectedNode.type === \"shopifyCategory\" && (\n \n )}\n {selectedNode.type === \"shopifyItem\" && (\n \n )}\n {/* {selectedNode.type === \"shopifyVariant\" && (\n \n )} */}\n {selectedNode.type === \"button\" && (\n \n
    \n
    \n
    Buttons to number
    \n data.name === \"button\")[0]\n ?.useNum ?? false\n }\n onChange={(event) => (\n (ActiveNodeType.filter(\n (data) => data.name === \"button\"\n )[0].useNum = event),\n setuseNum(event)\n )}\n />\n
    \n \n )}\n {selectedNode.type === \"button\" && (\n \n
    \n
    \n
    WhatsApp list
    \n data.name === \"button\")[0]\n ?.listName ?? false\n }\n onChange={(event) => (\n (ActiveNodeType.filter(\n (data) => data.name === \"button\"\n )[0].listName = event),\n setListName(event)\n )}\n />\n
    \n {ListName && (\n
    \n \n List Name\n
    \n \n (ActiveNodeType.filter(\n (data) => data.name === \"button\"\n )[0].ss = event.target.value)\n }\n defaultValue={\n ActiveNodeType?.filter((data) => data.name === \"button\")[0]\n ?.ss ?? \"list\"\n }\n />\n
    \n )}\n
    \n )}\n
    \n
    \n
    Error Configuration
    \n 0 ? true : false\n }\n onChange={(event) => setErrorEnable(event)}\n />\n
    \n {ErrorEnable && (\n \n
    \n
    Retry
    \n setretryUnit(value)}\n value={retryUnit}\n defaultValue={retryUnit}\n />\n
    \n \n
    \n )}\n {\n \n
    \n
    \n
    Nudge Setting
    \n SetNudge(event)}\n />\n
    \n {nudgeEnable && (\n \n
    \n
    \n
    Number
    \n \n (selectedNode.nudgeSetting.num = value)\n }\n // value={selectedNode?.nudgeSetting?.num}\n defaultValue={selectedNode?.nudgeSetting?.num}\n />\n
    \n
    \n
    \n Unit in (min/hr)\n
    \n {\n selectedNode && (selectedNode.nudgeSetting.unit = val);\n setNudgeDelay(val);\n }}\n defaultValue={selectedNode?.nudgeSetting?.unit}\n >\n Minutes\n Hours\n \n
    \n
    \n
    \n Delay in {NudgeDelay}\n
    \n \n selectedNode && (selectedNode.nudgeSetting.delay = value)\n }\n // value={selectedNode?.nudgeSetting?.delay}\n defaultValue={selectedNode?.nudgeSetting?.delay}\n />\n
    \n
    \n
    \n Filler Message\n
    \n {\n selectedNode.nudgeSetting.fillerMessage.q = [\n e.target.value,\n ];\n }}\n defaultValue={\n selectedNode?.nudgeSetting?.fillerMessage?.q[0]\n }\n />\n
    \n
    \n
    \n )}\n \n }\n
    \n {\n \n {\n if (!selectedNode.aiConfig) {\n selectedNode.aiConfig = {};\n }\n selectedNode.aiConfig.intents = [val];\n }}\n defaultValue={selectedNode?.aiConfig?.intents[0]}\n />\n \n }\n
    \n \n \n \n );\n};\n\nexport default ContentQWidget;\n","import {\n GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER,\n GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE,\n GET_INTEGRATION_ACCOUNT_ACTION_ERROR,\n} from \"constant\";\n\nimport { get, patch } from \"helper/networkClient\";\n\nconst getIntegrationAccountActionResponse = (data) => ({\n type: GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE,\n data: data,\n});\n\nconst getIntegrationAccountActionError = (data) => ({\n type: GET_INTEGRATION_ACCOUNT_ACTION_ERROR,\n data: data,\n});\n\nexport const getIntegrationAccountActionTrigger =\n (data) => async (dispatch) => {\n dispatch({ type: GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER, data });\n await get(\"/integration-account/\", data).then((resp) => {\n if (resp.status === 200) {\n dispatch(getIntegrationAccountActionResponse(resp.data));\n } else {\n dispatch(getIntegrationAccountActionError(resp));\n }\n });\n };\n","import {\n GET_ALL_ITEM_ACTION_TRIGGER,\n GET_ALL_ITEM_ACTION_RESPONSE,\n GET_ALL_ITEM_ACTION_ERROR,\n} from \"constant\";\n\nimport { get, post } from \"helper/networkClient\";\n\nexport const getItemsActionTrigger = (query) => async (dispatch) => {\n dispatch({ type: GET_ALL_ITEM_ACTION_TRIGGER, data: query });\n await get(\"/item\", query).then((resp) => {\n if (resp.status === 200) {\n dispatch(getItemsActionResponse(resp.data));\n } else {\n dispatch(getItemsActionError(resp));\n }\n });\n};\n\nconst getItemsActionResponse = (data) => ({\n type: GET_ALL_ITEM_ACTION_RESPONSE,\n data,\n});\n\nconst getItemsActionError = (data) => ({\n type: GET_ALL_ITEM_ACTION_ERROR,\n data,\n});\n","import { getIntegrationAccountActionTrigger } from \"action/IntegrationAccountAction\";\nimport { getItemsActionTrigger } from \"action/ItemAction\";\nimport { CXTextArea } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXText } from \"component/Typography\";\nimport {\n GET_ALL_ITEM_ACTION_RESPONSE,\n GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE,\n} from \"constant\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\n\nconst ActionConfigPayment = ({ onChangehandler, selectedNode }) => {\n const dispatch = useDispatch();\n const [integrationAccount, setIntegrationAccount] = useState([]);\n const [accountValue, setAccountValue] = useState(\n selectedNode?.actionConfig?.iaId ? selectedNode.actionConfig.iaId : \"\"\n );\n const [itemValue, setItemValue] = useState(\n selectedNode?.actionConfig?.itemName\n ? selectedNode.actionConfig.itemName\n : \"\"\n );\n const [itemData, setItemData] = useState([]);\n const integrationAccountState = useSelector(\n (state) => state.IntegrationAccountReducer\n );\n const itemState = useSelector((state) => state.ItemReducer);\n useEffect(() => {\n switch (integrationAccountState.action) {\n case GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE:\n setIntegrationAccount(integrationAccountState.account.data);\n break;\n default:\n break;\n }\n }, [integrationAccountState.action]);\n useEffect(() => {\n dispatch(getIntegrationAccountActionTrigger());\n }, []);\n useEffect(() => {\n switch (itemState.action) {\n case GET_ALL_ITEM_ACTION_RESPONSE:\n setItemData(itemState.items.data);\n break;\n default:\n break;\n }\n }, [itemState.action]);\n const handleAccount = (value) => {\n setAccountValue(value);\n };\n const integrationAccountOptions = integrationAccount?.map((d) => (\n \n {d?.dtls?.name ? d?.dtls?.name : \"N/A\"}({d.provider ? d.provider : \"N/A\"})\n \n ));\n const handleItemSearch = (newValue) => {\n let filter = {};\n if (newValue) {\n filter.name = newValue;\n if (accountValue) {\n filter.integrationId = accountValue;\n }\n dispatch(getItemsActionTrigger(filter));\n } else {\n setItemData([]);\n }\n };\n const itemOptions = itemData?.map((d) => (\n {d.name}\n ));\n\n return (\n
    \n
    Payment Configuration
    \n Payment Account *\n (\n handleAccount(value), onChangehandler(value, \"iaId\")\n )}\n >\n {integrationAccountOptions}\n \n Product *\n (\n setItemValue(value),\n onChangehandler(value, \"itemId\"),\n onChangehandler(\n itemData?.filter((d) => d._id === value)[0].name,\n \"itemName\"\n )\n )}\n notFoundContent={null}\n disabled={accountValue?.length === 0 ? true : false}\n >\n {itemOptions}\n \n Description\n onChangehandler(e.target.value, \"text\")}\n />\n
    \n );\n};\n\nexport default ActionConfigPayment;\n","import { CXInput, CXTextArea } from \"component/Input\";\nimport { CXText } from \"component/Typography\";\nimport React from \"react\";\nimport \"./style.css\";\n\nconst ActionConfigSection = ({ onChangehandler, selectedNode }) => {\n return (\n
    \n
    Configuration
    \n Name\n onChangehandler(e.target.value, \"name\")}\n />\n Description\n onChangehandler(e.target.value, \"description\")}\n />\n
    \n );\n};\n\nexport default ActionConfigSection;\n","import React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { CXMenu } from \"component/Menu\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { getContactForm } from \"action/ContactAction\";\nimport { conditionalVar } from \"action/WorkbenchAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { Dropdown, Form } from \"antd\";\nimport { getCandidateStageTrigger } from \"action/OpeningsAction\";\nimport { getTag } from \"action/TagAction\";\n\nconst ActionConfigUpdateContact = ({ onChangehandler }) => {\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const { contactForm } = useSelector((state) => state.ContactReducer);\n const { conditionsVarSet, selectedNode } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const { candidateFilterStage } = useSelector((state) => state.OpeningReducer);\n const { tagList } = useSelector((state) => state.TagReducer);\n const [Data, setData] = useState([]);\n useEffect(() => {\n dispatch(getContactForm());\n dispatch(conditionalVar());\n dispatch(getCandidateStageTrigger());\n }, []);\n\n const onFinish = (values) => {\n if (contactForm?.formItems?.length > Data?.length) {\n let obj = {\n [values.key]: values.Value,\n };\n setData([...Data, obj]);\n form.resetFields();\n let objData = {};\n Data.map((res) => {\n objData = { ...objData, ...res };\n });\n let temp = { ...objData, ...obj };\n onChangehandler(temp, \"updateConfig\");\n }\n };\n const removeItem = (key) => {\n let filterData = Data.filter((res) => Object.keys(res)[0] !== key);\n setData(filterData);\n let objData = {};\n filterData.map((res) => {\n objData = { ...objData, ...res };\n });\n let temp = { ...objData };\n\n onChangehandler(temp, \"updateConfig\");\n };\n\n console.log(Data);\n\n useEffect(() => {\n if (\n selectedNode?.actionConfig?.updateConfig &&\n Object.keys(selectedNode?.actionConfig?.updateConfig)?.length > 0\n ) {\n const updateConfig = selectedNode.actionConfig.updateConfig;\n const data = Array.isArray(updateConfig)\n ? [...updateConfig]\n : Object.entries(updateConfig).map(([key, value]) => ({\n [key]: value,\n }));\n setData(data);\n }\n }, [selectedNode]);\n const [keyType, setkeyType] = useState(null);\n const md = [\n {\n key: \"web\",\n value: \"Web\",\n },\n {\n key: \"email\",\n value: \"Email\",\n },\n {\n key: \"sms\",\n value: \"Sms\",\n },\n {\n key: \"whatsapp\",\n value: \"Whatsapp\",\n },\n {\n key: \"call\",\n value: \"Call\",\n },\n {\n key: \"facebook\",\n value: \"Facebook\",\n },\n {\n key: \"googleBusiness\",\n value: \"Google Business\",\n },\n ];\n\n useEffect(() => {\n if (keyType === \"tags\") {\n dispatch(getTag({ type: \"contact\" }));\n }\n }, [keyType]);\n console.log(\"keyType\", keyType);\n return (\n
    \n
    Update Contact
    \n {Data.length > 0 && (\n
    \n {Data.map((res) => {\n return (\n \n removeItem(Object.keys(res)[0])}\n />\n
    \n
    Key
    \n setkeyType(v)}\n >\n \n {\" \"}\n {\"Add opt out\"}\n \n \n {\" \"}\n {\"Tags\"}\n \n {contactForm?.formItems?.map((item) => {\n return (\n \n {item.lebel}\n \n );\n })}\n \n
    \n
    \n
    Value
    \n \n {![\"tags\", \"optOutMd\"].includes(keyType) &&\n conditionsVarSet?.map((item) => {\n return (\n \n \n {item.name}\n \n \n );\n })}\n {keyType === \"tags\" &&\n tagList?.map((res) => {\n return (\n \n {res?.text?.q}\n \n );\n })}\n {keyType === \"optOutMd\" &&\n md.map((item) => {\n return (\n \n {item.value}\n \n );\n })}\n \n
    \n
    \n );\n })}\n \n )}\n\n {contactForm?.formItems?.length > Data?.length && (\n
    \n \n
    \n
    \n \n {\n setkeyType(v);\n }}\n >\n \n {\"Add opt out\"}\n \n \n {\"Contact Stage\"}\n \n \n {\"Tags\"}\n \n {contactForm?.formItems?.map((item) => {\n if (!Data.find((res) => Object.keys(res)[0] === item.key))\n return (\n \n {item.lebel}\n \n );\n })}\n \n \n
    \n
    \n \n {contactForm?.formItems.find((v) => v.key === keyType)\n ?.element === \"dropDown\" ? (\n \n {contactForm?.formItems\n .find((v) => v.key === keyType)\n ?.elementOptions?.map((item) => {\n return (\n \n {item}\n \n );\n })}\n \n ) : (\n \n {![\"tags\", \"optOutMd\"].includes(keyType) &&\n conditionsVarSet?.map((item) => {\n return (\n \n {item.name}\n \n );\n })}\n {keyType === \"tags\" &&\n tagList?.map((res) => {\n return (\n \n {res?.text?.q}\n \n );\n })}\n {keyType === \"optOutMd\" &&\n md.map((item) => {\n return (\n \n {item.value}\n \n );\n })}\n {keyType === \"__contactStage\" &&\n candidateFilterStage?.data?.map((item) => {\n return (\n \n {item.name}\n \n );\n })}\n \n )}\n \n
    \n
    \n
    \n \n Add\n \n
    \n
    \n
    \n )}\n
    \n );\n};\n\nexport default ActionConfigUpdateContact;\n","import { WBBaseUrl, WBgetWebHook } from \"action/WorkbenchAction\";\nimport { CXButton } from \"component/Button\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport WebhookCreate from \"screen/UserPortal/WorkbenchV2/BotConfiguration/webhookConfig/WebhookCreate\";\nimport history from \"utils/history\";\n\nconst ActionWebhook = ({ selectedNode }) => {\n const dispatch = useDispatch();\n const { wbHookApis } = useSelector((state) => state.WrokbenchReducer);\n const [id, setid] = useState(selectedNode?.actionConfig?.apiRecordId ?? null);\n useEffect(() => {\n dispatch(WBBaseUrl());\n dispatch(WBgetWebHook());\n }, []);\n const setHookID = (id) => {\n setid(id);\n selectedNode.actionConfig.apiRecordId = id;\n };\n return (\n
    \n
    Select Webhook
    \n
    \n {\n setHookID(id);\n }}\n >\n {wbHookApis?.map((res) => {\n return (\n \n {res?.name}\n \n );\n })}\n \n {wbHookApis?.length === 0 && (\n
    \n \n history.push(`/admin/bot-workbench/Webhooks/create`)\n }\n >\n Create Webhook\n \n
    \n )}\n\n {id && (\n
    \n
    \n \n window.open(\n `${window.location.origin}/admin/bot-workbench/Webhooks/update/${id}`,\n \"WebhookUpdate\",\n \"width=600,height=600\"\n )\n }\n />\n
    \n
    \n \n
    \n
    \n )}\n
    \n
    \n );\n};\n\nexport default ActionWebhook;\n","import { CXInput, CXInputNumber } from \"component/Input\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { CXSwitch } from \"component/Switch\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport WidgetFooter from \"../Common/WidgetFooter\";\nimport WidgetVariable from \"../Common/WidgetVariable\";\nimport ActionConfigPayment from \"./commonComponent/ActionConfigPayment\";\nimport ActionConfigSection from \"./commonComponent/ActionConfigSection\";\nimport ActionConfigUpdateContact from \"./commonComponent/ActionConfigUpdateContact\";\nimport AddSection from \"./commonComponent/AddSection\";\nimport LanguageSection from \"./commonComponent/LanguageSection\";\nimport ActionWebhook from \"./commonComponent/ActionWebhook\";\nimport { generateUniqueKey } from \"utils\";\nimport IntentSelect from \"./commonComponent/intentSelect\";\nconst ActionQWidget = ({ selectedNode }) => {\n const { LanguageData, jumpLocationSet } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const [ActiveLang, setActiveLang] = useState(LanguageData?.defaultLang);\n const [ActiveNodeType, setActiveNodeType] = useState([]);\n const [ErrorNodeType, setErrorNodeType] = useState([]);\n const [retryUnit, setretryUnit] = useState(2);\n const [ErrorEnable, setErrorEnable] = useState(false);\n useEffect(() => {\n let Content = selectedNode?.convNodeContent?.filter(\n (data) => data.lang === ActiveLang\n );\n if (selectedNode?.convNodeContent?.length > 0) {\n let mutatedContent = JSON.parse(JSON.stringify(Content));\n setActiveNodeType(mutatedContent[0]?.content);\n } else {\n setActiveNodeType([]);\n }\n }, [selectedNode, ActiveLang]);\n\n const onChangehandler = (value, key) => {\n if (selectedNode.actionConfig) {\n selectedNode.actionConfig[key] = value;\n } else {\n selectedNode.actionConfig = {\n _type: selectedNode.type,\n [key]: value,\n };\n }\n };\n const jumpSelect = (val) => {\n selectedNode.actionConfig.refId = val;\n };\n const configure = [\"createTask\", \"integration_znd\"];\n const ErrorConfig = [\n \"webhook\",\n \"createTask\",\n \"integration_znd\",\n \"yesNo\",\n \"payments\",\n \"sendMessage\",\n \"updateContact\",\n ];\n const variable = [];\n const paymentConfig = [\"payments\"];\n const ConfigSendMessage = [\"sendMessage\"];\n const UpdateContactConfig = [\"updateContact\"];\n const WebhookConfig = [\"webhook\"];\n return (\n \n \n
    Content
    \n \n {configure.includes(selectedNode?.type) && (\n \n
    \n \n \n )}\n {paymentConfig.includes(selectedNode?.type) && (\n \n
    \n \n \n )}\n {WebhookConfig.includes(selectedNode?.type) && (\n \n
    \n \n \n )}\n {UpdateContactConfig.includes(selectedNode?.type) && (\n \n
    \n \n \n )}\n {ErrorConfig.includes(selectedNode?.type) && (\n \n
    \n
    \n
    Error Configuration
    \n 0 ? true : false\n }\n onChange={(event) => setErrorEnable(event)}\n />\n
    \n {ErrorEnable && (\n \n
    \n
    Retry
    \n setretryUnit(value)}\n value={retryUnit}\n defaultValue={retryUnit}\n />\n
    \n \n
    \n )}\n \n )}\n {variable.includes(selectedNode?.type) && (\n \n
    \n \n \n )}\n {selectedNode?.type === \"jumper\" && (\n \n
    \n
    \n
    Jump To
    \n jumpSelect(val)}>\n {jumpLocationSet?.map((data, index) => (\n \n {data.name}\n \n ))}\n \n
    \n \n )}\n
    \n {\n {\n if (!selectedNode.aiConfig) {\n selectedNode.aiConfig = {};\n }\n selectedNode.aiConfig.intents = [val];\n }}\n defaultValue={selectedNode?.aiConfig?.intents[0]}\n />\n }\n \n
    \n );\n};\n\nexport default ActionQWidget;\n","import React from \"react\";\n\nimport \"../index.css\";\nimport { CXMarkdownWorkbenchEditor } from \"component/MarkdownEditor\";\n\nexport const WidgetEditor = (props) => {\n return (\n
    \n {\n props.handleOnChange(data);\n }}\n />\n
    \n );\n};\n\nexport default WidgetEditor;\n","import { updateConvNode } from \"action/WorkbenchAction\";\nimport React, { useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\n\nimport { getUpdateNodePayload } from \"../../util/index\";\nimport WidgetEditor from \"../Common/WidgetEditor\";\nimport WidgetFooter from \"../Common/WidgetFooter\";\nimport WidgetHeader from \"../Common/WidgetHeader\";\nimport WidgetVariable from \"../Common/WidgetVariable\";\nimport AddSection from \"./commonComponent/AddSection\";\n\nconst AiWidget = (props) => {\n const [text, setText] = useState(props.node?.content?.[0]?.prompt.q[0]);\n const dispatch = useDispatch();\n const handleOnEditorChange = (text) => {\n setText(text);\n };\n\n const handleOnClickSave = () => {\n let node = props.data;\n node.question = text;\n node.name = \"\";\n const payload = getUpdateNodePayload(\"Name\", node);\n dispatch(updateConvNode(payload));\n };\n return (\n <>\n {/* */}\n \n handleOnClickSave()} />\n \n );\n};\n\nexport default AiWidget;\n","import React from \"react\";\nimport { WIDGET_LIST } from \"../../../WBconstants\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { SET_WIDGET_DRAWER } from \"constant\";\nimport { getNodeData } from \"../../util/NodeLogic\";\nimport { createNodeAPI } from \"action/WorkbenchAction\";\nimport { useParams } from \"react-router-dom\";\n\nconst QuestionResponse = () => {\n const dispatch = useDispatch();\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const { id } = useParams();\n const handleCreateNode = (Data, pos) => {\n let metaData = {\n pos: pos,\n };\n let selectedNode = getNodeData(Data, metaData);\n dispatch(createNodeAPI(selectedNode, id));\n dispatch({ type: SET_WIDGET_DRAWER, data: false });\n };\n return (\n
    \n {WIDGET_LIST?.map((d, index) => {\n if (d.dType === \"content\") {\n if (d.type === \"waTemplate\") {\n if (allConfigData?.some((data) => data?.botConf?.dittoId === id)) {\n return (\n {\n handleCreateNode(d, { x: 315, y: 50 });\n }}\n >\n
    \n \"icon\"\n
    \n
    {d.label}
    \n
    {d?.subH}
    \n
    \n
    \n
    \n );\n }\n } else {\n return (\n {\n handleCreateNode(d, { x: 315, y: 50 });\n }}\n >\n
    \n \"icon\"\n
    \n
    {d.label}
    \n
    {d?.subH}
    \n
    \n
    \n
    \n );\n }\n }\n })}\n
    \n );\n};\n\nexport default QuestionResponse;\n","import React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { WIDGET_LIST } from \"../../../WBconstants\";\nimport { SET_WIDGET_DRAWER } from \"constant\";\nimport { getActionData } from \"../../util/NodeLogic\";\nimport { createNodeAPI } from \"action/WorkbenchAction\";\nimport { useParams } from \"react-router-dom\";\nimport \"../index.css\";\nconst Actions = () => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const handleCreateNode = (Data, pos) => {\n let metaData = {\n pos: pos,\n };\n let selectedNode = getActionData(Data, metaData);\n dispatch(createNodeAPI(selectedNode, id));\n dispatch({ type: SET_WIDGET_DRAWER, data: false });\n };\n return (\n
    \n {WIDGET_LIST.map((d) => {\n if (d.dType === \"action\") {\n return (\n {\n handleCreateNode(d, { x: 315, y: 50 });\n }}\n >\n \"icon\"\n
    \n
    {d.label}
    \n
    {d?.subH}
    \n
    \n
    \n );\n }\n })}\n
    \n );\n};\n\nexport default Actions;\n","import { PlusCircleOutlined } from \"@ant-design/icons\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport React, { useEffect, useState } from \"react\";\nimport { imageMapper } from \"../../../ImageMapper\";\nimport { ConditionNode, ConditionsMenu } from \"../../util/NodeLogic\";\nimport \"../index.css\";\nimport { CXRow } from \"component/Row\";\nimport { useParams } from \"react-router-dom\";\nimport { SET_WIDGET_DRAWER } from \"constant\";\nimport { useDispatch } from \"react-redux\";\nimport {\n conditionalVar,\n createNodeAPI,\n updateConvNode,\n} from \"action/WorkbenchAction\";\nimport { useSelector } from \"react-redux\";\nimport { CXButton } from \"component/Button\";\nconst Conditions = () => {\n const { selectedNode, conditionsVarSet } = useSelector(\n (state) => state.WrokbenchReducer\n );\n const dispatch = useDispatch();\n const { id } = useParams();\n let initialCondition = {\n key: null,\n operator: null,\n operand: [],\n };\n const [ConditionList, setConditionList] = useState([initialCondition]);\n const keyHandler = (val, index) => {\n const temp = [...ConditionList];\n temp[index].key = val;\n setConditionList(temp);\n };\n const operatorHandler = (val, index) => {\n const temp = [...ConditionList];\n temp[index].operator = val;\n setConditionList(temp);\n };\n const operandHandler = (val, index) => {\n const temp = [...ConditionList];\n temp[index].operand = val;\n setConditionList(temp);\n };\n const handleConditionSave = () => {\n let ConditionPayload = ConditionNode(ConditionList);\n if (selectedNode?.actionConfig?.conditions?.length > 0) {\n const { type, id, ...rest } = selectedNode;\n rest.qType = type;\n rest._id = id;\n rest.actionConfig.conditions = ConditionList;\n dispatch(updateConvNode(rest, id));\n } else {\n dispatch(createNodeAPI(ConditionPayload, id));\n }\n dispatch({ type: SET_WIDGET_DRAWER, data: false });\n };\n useEffect(() => {\n if (selectedNode?.actionConfig?.conditions?.length > 0) {\n setConditionList(selectedNode.actionConfig.conditions);\n }\n dispatch(conditionalVar());\n }, []);\n return (\n
    \n
    \n
    Set your condition(s)
    \n
    \n \n setConditionList([...ConditionList, initialCondition])\n }\n />\n
    \n
    \n
    \n {ConditionList.map((res, index) => {\n return (\n
    \n \n setConditionList(\n ConditionList.filter((item, i) => i !== index)\n )\n }\n />\n
    \n
    IF
    \n keyHandler(value, index)}\n value={res.key}\n >\n {conditionsVarSet.map((res) => {\n return {res.name};\n })}\n \n
    \n\n operatorHandler(value, index)}\n value={res.operator}\n >\n {ConditionsMenu.map((item) => (\n {item.name}\n ))}\n \n operandHandler(value, index)}\n >\n
    \n );\n })}\n
    \n
    \n \n handleConditionSave()}\n >\n Save\n \n \n
    \n
    \n );\n};\n\nexport default Conditions;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getStore } from \"action/AdminActions\";\nimport WidgetFooter from \"../Common/WidgetFooter\";\nimport LanguageSection from \"./commonComponent/LanguageSection\";\nimport { CXOption, CXSelect } from \"component/Select\";\nimport { useParams } from \"react-router-dom/cjs/react-router-dom.min\";\nimport { getTemplatesActionTrigger } from \"action/TemplateAction\";\nimport Preview from \"screen/UserPortal/Knowledge/Template/CreateTemplate/Preview\";\nimport IntentSelect from \"./commonComponent/intentSelect\";\n\nconst WATemplate = ({ selectedNode }) => {\n const { id } = useParams();\n const dispatch = useDispatch();\n const [ActiveNodeType, setActiveNodeType] = useState([]);\n const { LanguageData } = useSelector((state) => state.WrokbenchReducer);\n const [ActiveLang, setActiveLang] = useState(LanguageData?.defaultLang);\n const { allConfigData } = useSelector((state) => state.AdminReducer);\n const [ChannelAccountID, setChannelAccountID] = useState(null);\n const [TemplateId, setTemplateId] = useState(null);\n const { templates } = useSelector((state) => state.TemplateReducer);\n const [data, setdata] = useState(null);\n console.log(ChannelAccountID, \"ChannelAccountID\");\n useEffect(() => {\n let Content = selectedNode?.convNodeContent?.filter(\n (data) => data.lang === ActiveLang\n );\n if (selectedNode?.convNodeContent) {\n let mutatedContent = JSON.parse(JSON.stringify(Content));\n setActiveNodeType(mutatedContent[0]?.content);\n }\n if (selectedNode?.channelAccountId) {\n setChannelAccountID(selectedNode?.channelAccountId);\n }\n if (selectedNode.refId) {\n setTemplateId(selectedNode?.refId);\n let d = templates?.data?.find((item) => item._id === selectedNode?.refId);\n let obj = {\n category: d?.category,\n actionType: d?.actionType,\n templateName: d?.name,\n language: d?.language,\n header: {\n type: d?.header?.type,\n link: d?.header?.link,\n },\n body: d?.body,\n footer: d?.footer,\n\n action: d?.action,\n variable: d?.exampleVariable,\n };\n setdata(obj);\n }\n }, [selectedNode, ActiveLang, templates]);\n useEffect(() => {\n dispatch(getTemplatesActionTrigger());\n }, []);\n useEffect(() => {\n let d = templates?.data?.find((item) => item._id === TemplateId);\n if (d) {\n let obj = {\n category: d?.category,\n actionType: d?.actionType,\n templateName: d?.name,\n language: d?.language,\n header: {\n type: d?.header?.type,\n link: d?.header?.link,\n },\n body: d?.body,\n footer: d?.footer,\n\n action: d?.action,\n variable: d?.exampleVariable,\n };\n setdata(obj);\n let buttons = d?.action?.map((item) => {\n return {\n _id: item?.id,\n value: item?.payload,\n text: item?.text,\n onClick: \"sendBack\",\n meta: {\n type: \"cf\",\n },\n };\n });\n if (TemplateId) {\n selectedNode.convNodeContent\n .find((data) => data.lang === ActiveLang)\n .content.find((data) => data.name === \"button\").buttons = buttons;\n selectedNode.convNodeContent\n .find((data) => data.lang === ActiveLang)\n .content.find((data) => data.name === \"button\").templateId =\n selectedNode.refId = TemplateId;\n selectedNode.convNodeContent\n .find((data) => data.lang === ActiveLang)\n .content.find((data) => data.name === \"text\").prompt = {\n q: [d?.name],\n };\n selectedNode.refId = TemplateId;\n selectedNode.channelAccountId = ChannelAccountID;\n let Content = selectedNode?.convNodeContent?.filter(\n (data) => data.lang === ActiveLang\n );\n let mutatedContent = JSON.parse(JSON.stringify(Content));\n setActiveNodeType(mutatedContent[0]?.content);\n }\n }\n }, [TemplateId]);\n return (\n
    \n \n {\n \n
    \n {\n if (!selectedNode.aiConfig) {\n selectedNode.aiConfig = {};\n }\n selectedNode.aiConfig.intents = [val];\n }}\n defaultValue={selectedNode?.aiConfig?.intents[0]}\n />\n
    \n
    \n }\n
    \n
    Select Channel Account
    \n {\n setChannelAccountID(e);\n }}\n >\n {allConfigData?.map((res) => {\n if (res?.botConf?.dittoId === id) {\n return {res?.configWp?.name};\n }\n })}\n \n
    \n
    \n
    Select Template
    \n {\n setTemplateId(e);\n }}\n value={TemplateId}\n >\n {templates?.data?.map((res) => {\n if (\n res?.caid?._id === ChannelAccountID &&\n res?.actionType === \"QUICK_REPLY\"\n ) {\n return {res?.name};\n }\n })}\n \n
    \n {TemplateId && (\n
    \n \n
    \n )}\n \n
    \n );\n};\n\nexport default WATemplate;\n","import ContentQWidget from \"../WidgetList/QWidget-content\";\nimport ActionQWidget from \"../WidgetList/QWidget-action\";\nimport AiWidget from \"../WidgetList/AiWidget\";\nimport QuestionResponseList from \"../WidgetList/List-questionResponse\";\nimport ActionsList from \"../WidgetList/List-actions\";\nimport ConditionsList from \"../WidgetList/QWidget-conditions\";\nimport WATemplate from \"../WidgetList/QWidget-waTemplate\";\nimport QualifierQ from \"../WidgetList/QualifierQ\";\nimport DateTimeW from \"../WidgetList/Date&TimeW\";\n\nexport const WidgetMapper = {\n button: ContentQWidget,\n text: ContentQWidget,\n file: ContentQWidget,\n calendar: ContentQWidget,\n content: ContentQWidget,\n shopifyCategory: ContentQWidget,\n shopifyItem: ContentQWidget,\n // shopifyVariant: ContentQWidget,\n humanHandOverNode: ActionQWidget,\n integration_znd: ActionQWidget,\n closeChat: ActionQWidget,\n card: ActionQWidget,\n conditionalNode: ActionQWidget,\n webhook: ActionQWidget,\n createTask: ActionQWidget,\n jumper: ActionQWidget,\n yesNo: ActionQWidget,\n aiNode: AiWidget,\n QuestionResponse: QuestionResponseList,\n Actions: ActionsList,\n conditions: ConditionsList,\n goodbye: ActionQWidget,\n payments: ActionQWidget,\n sendMessage: ActionQWidget,\n rating: ContentQWidget,\n updateContact: ActionQWidget,\n waTemplate: WATemplate,\n qualifierQuestions: QualifierQ,\n dateTime: ContentQWidget,\n};\n","import React from \"react\";\n\nconst QualifierQ = () => {\n return (\n
    \n {\" \"}\n Qualifier questions will be mapped automatically.\n
    \n );\n};\n\nexport default QualifierQ;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Drawer } from \"antd\";\nimport { SELECTED_NODE, SET_WIDGET_DRAWER } from \"constant\";\nimport { imageMapper } from \"../../ImageMapper\";\nimport { WidgetMapper } from \"./Mapper/WidgetMapper\";\nimport \"./widget.style.css\";\nimport { CXPopover } from \"component/Popover\";\nimport { CXButton } from \"component/Button\";\n\nexport const Widget = (props) => {\n const [node, setNode] = useState(null);\n const dispatch = useDispatch();\n const isWidgetDrawer = useSelector(\n (state) => state.WrokbenchReducer.isWidgetDrawer\n );\n const selectedNode = useSelector(\n (state) => state.WrokbenchReducer.selectedNode\n );\n\n useEffect(() => {\n setNode(selectedNode);\n }, [selectedNode]);\n\n useEffect(() => {\n if (!isWidgetDrawer) {\n dispatch({ type: SELECTED_NODE, data: {} });\n }\n }, [isWidgetDrawer]);\n\n const onClose = () => {\n dispatch({ type: SET_WIDGET_DRAWER, data: false });\n };\n const title = node?.convNodeType;\n const DynamicWidgetLoad = WidgetMapper[node?.type];\n\n return (\n \n onClose()}\n />\n ) : (\n // \n //
    Are your sure you want to exit ?
    {\" \"}\n //
    Any unsaved changes will be lost.
    \n //
    \n // onClose()}>\n // Yes\n // \n //
    \n //
    \n // }\n // >\n // onClose()}\n // />\n // \n onClose()}\n />\n )\n }\n headerStyle={{\n height: \"84px\",\n background: \"#1E2822\",\n boxShadow: \"0px 0px 30px rgba(0, 0, 0, 0.12)\",\n fontFamily: \"Montserrat\",\n fontStyle: \"normal\",\n fontWeight: \"500\",\n fontSize: \"18px\",\n lineHeight: \"22px\",\n textTransform: \"capitalize\",\n color: \"#FFFFFF\",\n }}\n >\n {title && }\n \n
    \n );\n};\n\nexport default Widget;\n","import React from \"react\";\nimport \"./styles/canvas.style.css\";\n\nexport const WBCanvasNode = (props) => {\n return (\n
    \n props.handleOnClickWidget(props.data.label)}\n className=\"cursor-pointer\"\n >\n
    \n \"icon\"\n
    \n
    \n
    {props.data.label}
    \n
    {props.data.subH}
    \n
    \n
    \n
    \n );\n};\n\nexport default WBCanvasNode;\n","import React, { useState, useEffect } from \"react\";\nimport WBCanvasNode from \"./WBCanvasNode\";\nimport { CXSelect } from \"component/Select\";\nimport { WIDGET_LIST } from \"../WBconstants\";\n\nimport \"./styles/canvas.style.css\";\nimport { CXOption } from \"component/Select\";\nimport { CXInput } from \"component/Input\";\nimport { CloseOutlined } from \"@ant-design/icons\";\n\nexport const WBNodePopUp = (props) => {\n const style = {\n background: \"white\",\n left: \"50%\",\n width: \"250px\",\n position: \"absolute\",\n zIndex: 41,\n padding: \"10px\",\n boxShadow: \"0 0 5px rgba(0,0,0,0.4)\",\n };\n\n const [SearchVal, setSearchVal] = useState(\"\");\n const filterItems = (arr, query) => {\n return arr.filter(\n (el) => el.label.toLowerCase().indexOf(query.toLowerCase()) !== -1\n );\n };\n\n // useEffect(() => {\n // let val = SearchVal.length > 0 && filterItems(WIDGET_LIST, SearchVal);\n // }, [SearchVal]);\n\n return (\n \n
    \n
    Essentials
    \n props.handleClosePopUpNode()}\n />\n
    \n setSearchVal(e.target.value)}\n placeholder=\"Search More...\"\n />\n {SearchVal?.length > 0 && (\n
    \n {filterItems(WIDGET_LIST, SearchVal).map((d, index) => {\n return (\n props.handleOnClickWidget(d)}\n />\n );\n })}\n
    \n )}\n
    \n {SearchVal?.length === 0 &&\n WIDGET_LIST.slice(0, 5).map((d, index) => {\n if (d.label !== \"Welcome Node\") {\n return (\n
    \n props.handleOnClickWidget(d)}\n />\n
    \n );\n }\n })}\n
    \n
    \n );\n};\n\nexport default WBNodePopUp;\n","import React from \"react\";\nimport { getSmoothStepPath } from \"reactflow\";\nimport { deleteNodeLinkAPI } from \"action/WorkbenchAction.js\";\nimport { useDispatch } from \"react-redux\";\nimport { imageMapper } from \"./ImageMapper\";\nconst foreignObjectSize = 40;\nexport default function CustomEdge({\n id,\n source,\n target,\n sourceX,\n sourceY,\n targetX,\n targetY,\n style = {},\n markerEnd,\n sourcePosition,\n targetPosition,\n}) {\n const [edgePath, labelX, labelY] = getSmoothStepPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n });\n const dispatch = useDispatch();\n const onEdgeClick = (evt, id) => {\n evt.stopPropagation();\n let obj = {\n toAdd: target,\n parent: source,\n };\n dispatch(deleteNodeLinkAPI(obj));\n };\n\n return (\n <>\n \n \n \n
    \n onEdgeClick(event, id)} />\n
    \n \n \n \n );\n}\n","import React, { useState, useEffect, useRef, useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport WBNavbar from \"./components/WBNavbar\";\nimport WBTopbar from \"./components/WBTopbar\";\nimport WBCanvas from \"./components/WBCanvas\";\nimport {\n createNodeAPI,\n getAllConvertionAPI,\n GetBotDesign,\n getLanguageData,\n GetLanguageSettings,\n JumpLocationsList,\n linkNodeAPI,\n updateConvNodePos,\n} from \"action/WorkbenchAction\";\nimport {\n ACTIVE_WORKBENCH,\n SELECTED_NODE,\n SET_WIDGET,\n SET_NODE_DRAG,\n} from \"constant\";\nimport { GetEntityList, GetIntentList } from \"action/BotAiAction\";\nimport {\n getNodeData,\n getActionData,\n getAiData,\n} from \"./components/util/NodeLogic\";\nimport Configure from \"./Configure\";\nimport WBWidget from \"./components/WBWidget\";\nimport WBNodePopUp from \"./components/WBNodePopUp\";\nimport {\n applyNodeChanges,\n applyEdgeChanges,\n addEdge,\n ReactFlowProvider,\n MarkerType,\n useNodesState,\n useEdgesState,\n} from \"reactflow\";\nimport ButtonEdge from \"./ButtonEdge.js\";\nimport { Switch, Route, useRouteMatch, useParams } from \"react-router-dom\";\nimport \"reactflow/dist/style.css\";\nimport { GetAllConfig } from \"action/AdminActions\";\nlet node = {};\n\nexport const WorkbenchV2 = (props) => {\n const edgeTypes = {\n smoothstep: ButtonEdge,\n };\n const { id } = useParams();\n const { path } = useRouteMatch();\n const dispatch = useDispatch();\n const [reactFlowInstance, setReactFlowInstance] = useState(null);\n const [selectedPos, setPos] = useState();\n const [isToggle, setToggle] = useState(false);\n const convList = useSelector((state) => state.WrokbenchReducer.convList);\n // v11Changes\n\n const [nodes, setNodes] = useNodesState([]);\n const [edges, setEdges] = useEdgesState([]);\n const onNodesChange = useCallback(\n (changes) => setNodes((ns) => applyNodeChanges(changes, ns)),\n [setNodes]\n );\n const onEdgesChange = useCallback(\n (changes) => setEdges((es) => applyEdgeChanges(changes, es)),\n [setEdges]\n );\n const onConnect = useCallback(\n (connection) => {\n setEdges((eds) =>\n addEdge(\n {\n ...connection,\n style: { stroke: \"#00c16e\", strokeWidth: \"3px\" },\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#00c16e\" },\n type: \"smoothstep\",\n },\n eds\n )\n );\n dispatch(\n linkNodeAPI({\n refId: connection.sourceHandle,\n toAdd: connection.target,\n parent: connection.source,\n })\n );\n handleClosePopUpNode();\n },\n [setEdges]\n );\n\n const reactFlowWrapper = useRef(null);\n const ActiveWorkbench = useSelector(\n (state) => state.WrokbenchReducer.Workbench\n );\n\n useEffect(() => {\n dispatch({ type: ACTIVE_WORKBENCH, data: true });\n dispatch(GetAllConfig());\n }, []);\n\n useEffect(() => {\n id?.length > 0 && ActiveWorkbench && dispatch(getAllConvertionAPI(id));\n localStorage.setItem(\"botId\", id);\n dispatch(GetLanguageSettings(id));\n }, [id, ActiveWorkbench]);\n\n useEffect(() => {\n if (convList?.length === 0) {\n setNodes([]);\n } else {\n setNodes(convList.nodes);\n if (convList?.edges?.length > 0) {\n let nw = convList.edges.map((edge) => {\n return {\n ...edge,\n style: { stroke: \"#00c16e\", strokeWidth: \"3px\" },\n markerEnd: { type: MarkerType.ArrowClosed, color: \"#00c16e\" },\n type: \"smoothstep\",\n };\n });\n setEdges(nw);\n } else {\n setEdges([]);\n }\n }\n }, [convList]);\n\n useEffect(() => {\n dispatch(GetBotDesign(id));\n dispatch(GetIntentList(id));\n dispatch(GetEntityList(id));\n dispatch(JumpLocationsList());\n }, [id]);\n\n const onInit = (_reactFlowInstance) =>\n setReactFlowInstance(_reactFlowInstance);\n\n const generateNodeId = () => {\n const array = new Uint32Array(1);\n window.crypto.getRandomValues(array);\n const randomNumber = (array[0] % 900) + 100;\n return `node_${randomNumber}`;\n };\n\n const handleClickOnPopUp = (pos) => {\n setToggle(true);\n setPos(pos);\n };\n\n const handleOnClickWidget = (data, pos) => {\n let nodeId = generateNodeId();\n let selectedNode = {};\n let metaData = {\n pos: selectedPos,\n nodeId: nodeId,\n };\n if (data && data?.dType === \"content\") {\n selectedNode = getNodeData(data, metaData, node);\n dispatch(createNodeAPI(selectedNode, id));\n handleClosePopUpNode();\n } else if (data && data?.dType === \"action\") {\n selectedNode = getActionData(data, metaData, node);\n dispatch(createNodeAPI(selectedNode, id));\n handleClosePopUpNode();\n } else if (data && data?.dType === \"ai\") {\n selectedNode = getAiData(data, metaData, node);\n dispatch(createNodeAPI(selectedNode, id));\n handleClosePopUpNode();\n } else {\n handleClickOnPopUp(pos);\n }\n };\n\n const handleOnClickOnConnectStart = (params) => {\n // setSourceData(params);\n node = params;\n };\n\n const onConnectStart = (event, params) => {\n handleOnClickOnConnectStart(params);\n };\n\n const onConnectEnd = (event, params) => {\n const reactFlowBounds = reactFlowWrapper.current.getBoundingClientRect();\n const position = reactFlowInstance.project({\n x: event.clientX - reactFlowBounds.left,\n y: event.clientY - reactFlowBounds.top,\n });\n const targetIsPane = event.target.classList.contains(\"react-flow__pane\");\n targetIsPane && handleOnClickWidget(null, position);\n };\n\n const onElementClick = (event, element) => {\n if (element.id === \"popup\") {\n setToggle(true);\n } else {\n dispatch({ type: SET_WIDGET, data: false });\n let elem = [];\n convList.map((res) => {\n if (!!res.nodes) {\n res.nodes.map((res) => {\n return elem.push(res);\n });\n }\n });\n elem = elem.filter((d) => {\n if (element.id === d.id) {\n return d;\n }\n });\n dispatch({ type: SELECTED_NODE, data: elem });\n }\n };\n\n const onNodeDragStop = (event, node) => {\n const payload = {\n position: node.position,\n _id: node.id,\n };\n dispatch(updateConvNodePos(payload, id));\n setTimeout(() => {\n dispatch({ type: SET_NODE_DRAG, data: false });\n }, 500);\n };\n\n const connectionLineStyle = { stroke: \"#00c16e\", strokeWidth: \"3px\" };\n const handleClosePopUpNode = () => {\n setToggle(false);\n };\n\n return (\n <>\n
    \n \n
    \n {isToggle ? (\n
    \n handleOnClickWidget(data)}\n handleClosePopUpNode={() => handleClosePopUpNode()}\n />\n
    \n ) : null}\n \n \n
    \n \n
    \n
    \n \n \n \n \n \n dispatch({ type: SET_NODE_DRAG, data: true })\n }\n onElementClick={(event, element) =>\n onElementClick(event, element)\n }\n onConnectStart={(event, params) =>\n onConnectStart(event, params)\n }\n onConnectEnd={(event, params) =>\n onConnectEnd(event, params)\n }\n onInit={(reactFlowInstance) => onInit(reactFlowInstance)}\n connectionLineStyle={connectionLineStyle}\n onNodeDragStop={(event, node) =>\n onNodeDragStop(event, node)\n }\n />\n\n \n \n
    \n \n \n
    \n
    \n \n );\n};\n\nexport default WorkbenchV2;\n","import { connectOath } from \"action/AdminActions\";\nimport React, { useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router-dom\";\nimport history from \"utils/history\";\nimport { ACTIVE_LIST_ADMIN } from \"constant\";\nconst OathComp = () => {\n const search = useLocation().search;\n const code = new URLSearchParams(search).get(\"code\");\n const dispatch = useDispatch();\n useEffect(() => {\n if (code) {\n dispatch({ type: ACTIVE_LIST_ADMIN, data: \"Connected\" });\n history.push(\"/admin/admin\");\n }\n }, [code]);\n return
    Connect Account
    ;\n};\n\nexport default OathComp;\n","// This icon file is generated automatically.\nvar CameraOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M864 248H728l-32.4-90.8a32.07 32.07 0 00-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z\" } }] }, \"name\": \"camera\", \"theme\": \"outlined\" };\nexport default CameraOutlined;\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 CameraOutlinedSvg from \"@ant-design/icons-svg/es/asn/CameraOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CameraOutlined = function CameraOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CameraOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CameraOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CameraOutlined';\n}\nexport default RefIcon;","import React from \"react\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { Form } from \"antd\";\nimport { CXPassword } from \"component/Input\";\nimport { CXButton } from \"component/Button\";\nimport { changePassword } from \"action/UserActions\";\n\nconst ChnagePassword = () => {\n const { user } = useSelector((state) => state.UserProfileReducer);\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const updatepassword = (values) => {\n values.id = user.id;\n let obj = {\n password: btoa(values.password),\n oldPwd: btoa(values.oldPwd),\n };\n dispatch(changePassword(obj));\n form.resetFields();\n };\n return (\n \n \n \n \n \n \n \n ({\n validator(_, value) {\n if (!value || getFieldValue(\"password\") === value) {\n return Promise.resolve();\n }\n return Promise.reject(\n new Error(\"The two passwords that you entered do not match!\")\n );\n },\n }),\n ]}\n >\n \n \n \n \n Update\n \n \n \n );\n};\n\nexport default ChnagePassword;\n","import { CXButton } from \"component/Button\";\nimport { CXForm, CXFormItem } from \"component/Form\";\nimport { CXHeader, CXLayout } from \"component/Layout\";\nimport { CXTitle } from \"component/Typography\";\nimport { Form } from \"antd\";\nimport React, { useEffect, useState } from \"react\";\nimport \"./index.css\";\nimport { CXInput } from \"component/Input\";\nimport { CameraOutlined } from \"@ant-design/icons\";\nimport Input from \"react-phone-number-input/input\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { getUserDetails, updateUserDetails } from \"action/UserActions\";\nimport { CXModal } from \"component/Modal\";\nimport ChnagePassword from \"./ChnagePassword\";\nimport CXUpload from \"component/Upload\";\nimport { postFormData } from \"helper/networkClient\";\nimport { CXSpin } from \"component/Spin\";\nimport { CXSelect } from \"component/Select\";\nimport { CXSwitch } from \"component/Switch\";\nimport { CXHTMLEditorEmail } from \"component/MarkdownEditor\";\n\nconst UserProfile = () => {\n const { user } = useSelector((state) => state.UserProfileReducer);\n const dispatch = useDispatch();\n const [form] = Form.useForm();\n const [profileUrl, setprofileUrl] = useState(null);\n const [loader, setloader] = useState(false);\n const [Signature, setSignature] = useState(\"\");\n const onFinish = (values) => {\n values = {\n ...values,\n info: {\n emailSignature: {\n use: false,\n o: Signature,\n },\n },\n };\n console.log(values);\n values._id = user.id;\n values.profileUrl = profileUrl;\n dispatch(updateUserDetails(values));\n };\n useEffect(() => {\n dispatch(getUserDetails());\n }, []);\n useEffect(() => {\n if (user) {\n setSignature(user?.info?.emailSignature?.o ?? \"\");\n form.setFieldsValue({\n fname: user.fname,\n lname: user.lname,\n email: user.email,\n phone: user.phone,\n skills: user.skill,\n enable2fa: user.enable2fa,\n // o: user?.info?.emailSignature?.o ?? \"\",\n });\n setprofileUrl(user?.profileUrl ?? null);\n }\n }, [user]);\n const [visible, setvisible] = useState(false);\n const handleCancel = () => {\n setvisible(false);\n };\n\n const handleUploadFile = async (file) => {\n setloader(true);\n const formData = new FormData();\n formData.append(\"file\", file);\n try {\n await postFormData(\"/file\", formData).then((resp) => {\n if (resp.status === 200) {\n setprofileUrl(resp?.data?.data?.url);\n setloader(false);\n } else {\n setloader(false);\n }\n });\n } catch (error) {\n setloader(false);\n }\n };\n return (\n \n \n \n User Profile\n \n \n
    \n \n \n \n \n \n
    \n
    \n );\n};\n\nexport default UserProfile;\n","import { compose } from 'redux';\nfunction extensionComposeStub() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n if (funcs.length === 0) return undefined;\n if (typeof funcs[0] === 'object') return compose;\n return compose(...funcs);\n}\nexport const composeWithDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : extensionComposeStub;\nexport const devToolsEnhancer = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\n return function (noop) {\n return noop;\n };\n};\nexport { composeWithDevTools as composeWithDevToolsDevelopmentOnly, devToolsEnhancer as devToolsEnhancerDevelopmentOnly } from './developmentOnly';\nexport { composeWithDevTools as composeWithDevToolsLogOnly, devToolsEnhancer as devToolsEnhancerLogOnly } from './logOnly';\nexport { composeWithDevTools as composeWithDevToolsLogOnlyInProduction, devToolsEnhancer as devToolsEnhancerLogOnlyInProduction } from './logOnlyInProduction';","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","export var KEY_PREFIX = 'persist:';\nexport var FLUSH = 'persist/FLUSH';\nexport var REHYDRATE = 'persist/REHYDRATE';\nexport var PAUSE = 'persist/PAUSE';\nexport var PERSIST = 'persist/PERSIST';\nexport var PURGE = 'persist/PURGE';\nexport var REGISTER = 'persist/REGISTER';\nexport var DEFAULT_VERSION = -1;","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\nexport default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n } // otherwise hard set the new value\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\n}","import { KEY_PREFIX, REHYDRATE } from './constants';\n// @TODO remove once flow < 0.63 support is no longer required.\nexport default function createPersistoid(config) {\n // defaults\n var blacklist = config.blacklist || null;\n var whitelist = config.whitelist || null;\n var transforms = config.transforms || [];\n var throttle = config.throttle || 0;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var serialize;\n\n if (config.serialize === false) {\n serialize = function serialize(x) {\n return x;\n };\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize;\n } else {\n serialize = defaultSerialize;\n }\n\n var writeFailHandler = config.writeFailHandler || null; // initialize stateful values\n\n var lastState = {};\n var stagedState = {};\n var keysToProcess = [];\n var timeIterator = null;\n var writePromise = null;\n\n var update = function update(state) {\n // add any changed keys to the queue\n Object.keys(state).forEach(function (key) {\n if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop\n\n if (lastState[key] === state[key]) return; // value unchanged? noop\n\n if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop\n\n keysToProcess.push(key); // add key to queue\n }); //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n\n Object.keys(lastState).forEach(function (key) {\n if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) {\n keysToProcess.push(key);\n }\n }); // start the time iterator if not running (read: throttle)\n\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle);\n }\n\n lastState = state;\n };\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator);\n timeIterator = null;\n return;\n }\n\n var key = keysToProcess.shift();\n var endState = transforms.reduce(function (subState, transformer) {\n return transformer.in(subState, key, lastState);\n }, lastState[key]);\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState);\n } catch (err) {\n console.error('redux-persist/createPersistoid: error serializing state', err);\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key];\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState();\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(function (key) {\n if (lastState[key] === undefined) {\n delete stagedState[key];\n }\n });\n writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;\n if (blacklist && blacklist.indexOf(key) !== -1) return false;\n return true;\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err);\n\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err);\n }\n }\n\n var flush = function flush() {\n while (keysToProcess.length !== 0) {\n processNextKey();\n }\n\n return writePromise || Promise.resolve();\n }; // return `persistoid`\n\n\n return {\n update: update,\n flush: flush\n };\n} // @NOTE in the future this may be exposed via config\n\nfunction defaultSerialize(data) {\n return JSON.stringify(data);\n}","import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}","import { KEY_PREFIX } from './constants';\nexport default function purgeStoredState(config) {\n var storage = config.storage;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n return storage.removeItem(storageKey, warnIfRemoveError);\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('redux-persist/purgeStoredState: Error purging data stored state', err);\n }\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants';\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1';\nimport createPersistoid from './createPersistoid';\nimport defaultGetStoredState from './getStoredState';\nimport purgeStoredState from './purgeStoredState';\nvar DEFAULT_TIMEOUT = 5000;\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\n\nexport default function persistReducer(config, baseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer');\n if (!config.key) throw new Error('key is required in persistor config');\n if (!config.storage) throw new Error(\"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\");\n }\n\n var version = config.version !== undefined ? config.version : DEFAULT_VERSION;\n var debug = config.debug || false;\n var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler;\n var getStoredState = config.getStoredState || defaultGetStoredState;\n var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT;\n var _persistoid = null;\n var _purge = false;\n var _paused = true;\n\n var conditionalUpdate = function conditionalUpdate(state) {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state);\n return state;\n };\n\n return function (state, action) {\n var _ref = state || {},\n _persist = _ref._persist,\n rest = _objectWithoutProperties(_ref, [\"_persist\"]); // $FlowIgnore need to update State type\n\n\n var restState = rest;\n\n if (action.type === PERSIST) {\n var _sealed = false;\n\n var _rehydrate = function _rehydrate(payload, err) {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed) console.error(\"redux-persist: rehydrate for \\\"\".concat(config.key, \"\\\" called after timeout.\"), payload, err); // only rehydrate if we are not already sealed\n\n if (!_sealed) {\n action.rehydrate(config.key, payload, err);\n _sealed = true;\n }\n };\n\n timeout && setTimeout(function () {\n !_sealed && _rehydrate(undefined, new Error(\"redux-persist: persist timed out for persist key \\\"\".concat(config.key, \"\\\"\")));\n }, timeout); // @NOTE PERSIST resumes if paused.\n\n _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n\n if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first\n\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n }\n\n if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');\n action.register(config.key);\n getStoredState(config).then(function (restoredState) {\n var migrate = config.migrate || function (s, v) {\n return Promise.resolve(s);\n };\n\n migrate(restoredState, version).then(function (migratedState) {\n _rehydrate(migratedState);\n }, function (migrateErr) {\n if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);\n\n _rehydrate(undefined, migrateErr);\n });\n }, function (err) {\n _rehydrate(undefined, err);\n });\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: {\n version: version,\n rehydrated: false\n }\n });\n } else if (action.type === PURGE) {\n _purge = true;\n action.result(purgeStoredState(config));\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush());\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === PAUSE) {\n _paused = true;\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge) return _objectSpread({}, restState, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n }) // @NOTE if key does not match, will continue to default else below\n\n });\n\n if (action.key === config.key) {\n var reducedState = baseReducer(restState, action);\n var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined\n\n var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState;\n\n var _newState = _objectSpread({}, reconciledRest, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n })\n });\n\n return conditionalUpdate(_newState);\n }\n } // if we have not already handled PERSIST, straight passthrough\n\n\n if (!_persist) return baseReducer(state, action); // run base reducer:\n // is state modified ? return original : return updated\n\n var newState = baseReducer(restState, action);\n if (newState === restState) return state;\n return conditionalUpdate(_objectSpread({}, newState, {\n _persist: _persist\n }));\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { createStore } from 'redux';\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants';\nvar initialState = {\n registry: [],\n bootstrapped: false\n};\n\nvar persistorReducer = function persistorReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case REGISTER:\n return _objectSpread({}, state, {\n registry: [].concat(_toConsumableArray(state.registry), [action.key])\n });\n\n case REHYDRATE:\n var firstIndex = state.registry.indexOf(action.key);\n\n var registry = _toConsumableArray(state.registry);\n\n registry.splice(firstIndex, 1);\n return _objectSpread({}, state, {\n registry: registry,\n bootstrapped: registry.length === 0\n });\n\n default:\n return state;\n }\n};\n\nexport default function persistStore(store, options, cb) {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n var optionsToTest = options || {};\n var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];\n bannedKeys.forEach(function (k) {\n if (!!optionsToTest[k]) console.error(\"redux-persist: invalid option passed to persistStore: \\\"\".concat(k, \"\\\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.\"));\n });\n }\n\n var boostrappedCb = cb || false;\n\n var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined);\n\n var register = function register(key) {\n _pStore.dispatch({\n type: REGISTER,\n key: key\n });\n };\n\n var rehydrate = function rehydrate(key, payload, err) {\n var rehydrateAction = {\n type: REHYDRATE,\n payload: payload,\n err: err,\n key: key // dispatch to `store` to rehydrate and `persistor` to track result\n\n };\n store.dispatch(rehydrateAction);\n\n _pStore.dispatch(rehydrateAction);\n\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb();\n boostrappedCb = false;\n }\n };\n\n var persistor = _objectSpread({}, _pStore, {\n purge: function purge() {\n var results = [];\n store.dispatch({\n type: PURGE,\n result: function result(purgeResult) {\n results.push(purgeResult);\n }\n });\n return Promise.all(results);\n },\n flush: function flush() {\n var results = [];\n store.dispatch({\n type: FLUSH,\n result: function result(flushResult) {\n results.push(flushResult);\n }\n });\n return Promise.all(results);\n },\n pause: function pause() {\n store.dispatch({\n type: PAUSE\n });\n },\n persist: function persist() {\n store.dispatch({\n type: PERSIST,\n register: register,\n rehydrate: rehydrate\n });\n }\n });\n\n if (!(options && options.manualPersist)) {\n persistor.persist();\n }\n\n return persistor;\n}","import {\n LOGIN_ACTION_TRIGGER,\n LOGIN_ACTION_RESPONSE,\n LOGIN_ACTION_ERROR,\n GET_USER_ACTION_TRIGGER,\n GET_USER_ACTION_RESPONSE,\n GET_USER_ACTION_ERROR,\n SET_MFA,\n GET_SYSTEM_ACTION_RESPONSE,\n LOGOUT_ACTION_TRIGGER,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n auth: null,\n mfaActive: false,\n user: {},\n system: {},\n mfwAllowed: null,\n mfwAllowedChecking: false,\n wfTypes: [],\n tenantSettings: {},\n};\n\nconst dittoAdminReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case LOGIN_ACTION_TRIGGER:\n return { ...newState, loading: true, action: action.type, auth: null };\n\n case LOGIN_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n auth: action.data,\n error: null,\n };\n\n case LOGIN_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n auth: null,\n };\n\n case LOGOUT_ACTION_TRIGGER:\n return {\n ...newState,\n action: action.type,\n };\n\n case GET_USER_ACTION_TRIGGER:\n return { ...newState, loading: true, action: action.type };\n\n case GET_USER_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n user: action.data,\n error: null,\n };\n case GET_SYSTEM_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n system: action.data,\n error: null,\n };\n\n case GET_USER_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n case SET_MFA:\n return {\n ...newState,\n action: action.type,\n mfaActive: action.data,\n };\n case \"MWF_ALLOWED\":\n return {\n ...newState,\n action: action.type,\n mfwAllowed: action.data,\n };\n case \"MWF_CHECKING\":\n return {\n ...newState,\n action: action.type,\n mfwAllowedChecking: action.data,\n };\n case \"GET_WF_TYPE_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n wfTypes: action.data,\n };\n case \"RESPONSE_GET_WF_TYPE\":\n return {\n ...newState,\n action: action.type,\n wfTypes: action.data,\n };\n case \"TENANT_SETTINGS_DATA\": {\n return {\n ...newState,\n action: action.type,\n tenantSettings: action.data,\n };\n }\n\n default:\n return newState;\n }\n};\n\nexport default dittoAdminReducer;\n","import {\n GET_CONTENT_ACTION_ERROR,\n GET_CONTENT_ACTION_RESPONSE,\n GET_CONTENT_ACTION_TRIGGER,\n GET_SINGLE_CONTENT_ACTION_TRIGGER,\n GET_SINGLE_CONTENT_ACTION_RESPONSE,\n GET_SINGLE_CONTENT_ACTION_ERROR,\n CREATE_CONTENT_ACTION_ERROR,\n CREATE_CONTENT_ACTION_RESPONSE,\n CREATE_CONTENT_ACTION_TRIGGER,\n SEARCH_CONTENT_ACTION_ERROR,\n SEARCH_CONTENT_ACTION_RESPONSE,\n SEARCH_CONTENT_ACTION_TRIGGER,\n UPDATE_CONTENT_ACTION_TRIGGER,\n UPDATE_CONTENT_ACTION_RESPONSE,\n UPDATE_CONTENT_ACTION_ERROR,\n DELETE_CONTENT_ACTION_TRIGGER,\n DELETE_CONTENT_ACTION_RESPONSE,\n DELETE_CONTENT_ACTION_ERROR,\n UPDATE_CONTENT_TAG_ACTION_TRIGGER,\n UPDATE_CONTENT_TAG_ACTION_RESPONSE,\n UPDATE_CONTENT_TAG_ACTION_ERROR,\n REPLY_THREAD_ACTIVE,\n REPLY_ID,\n THREAD_LOAD,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n contentList: null,\n search: [],\n content: null,\n contentById: null,\n updatedcontent: null,\n deletecontent: null,\n replyThread: false,\n replyParentId: \"\",\n threadLoading: true,\n};\n\nconst ContentReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n contentList: null,\n };\n\n case GET_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n contentList: action.data,\n error: null,\n };\n\n case GET_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n contentList: null,\n };\n case GET_SINGLE_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n contentById: null,\n };\n\n case GET_SINGLE_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n contentById: action.data.data,\n error: null,\n };\n\n case GET_SINGLE_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n contentById: null,\n };\n case SEARCH_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n search: [],\n };\n\n case SEARCH_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n search: action.data.data ? action.data.data : action.data,\n error: null,\n };\n\n case SEARCH_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n search: [],\n };\n\n case CREATE_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n content: null,\n };\n\n case CREATE_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n content: action.data,\n error: null,\n };\n\n case CREATE_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n content: null,\n };\n case UPDATE_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n updatedcontent: null,\n };\n\n case UPDATE_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n updatedcontent: action.data,\n error: null,\n };\n\n case UPDATE_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n updatedcontent: null,\n };\n case UPDATE_CONTENT_TAG_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n updatedcontent: null,\n };\n\n case UPDATE_CONTENT_TAG_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n updatedcontent: action.data,\n error: null,\n };\n\n case UPDATE_CONTENT_TAG_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n updatedcontent: null,\n };\n case DELETE_CONTENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n deletecontent: null,\n };\n\n case DELETE_CONTENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n deletecontent: action.data.data,\n error: null,\n };\n\n case DELETE_CONTENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n deletecontent: null,\n };\n case REPLY_THREAD_ACTIVE:\n return {\n ...newState,\n replyThread: action.data,\n };\n case REPLY_ID:\n return {\n ...newState,\n replyParentId: action.data,\n };\n case THREAD_LOAD:\n return {\n ...newState,\n threadLoading: action.data,\n };\n default:\n return newState;\n }\n};\n\nexport default ContentReducer;\n","import {\n GET_FAQ_ACTION_ERROR,\n GET_FAQ_ACTION_RESPONSE,\n GET_FAQ_ACTION_TRIGGER,\n GET_FAQ_CONTENTS_ACTION_TRIGGER,\n GET_FAQ_CONTENTS_ACTION_RESPONSE,\n GET_FAQ_CONTENTS_ACTION_ERROR,\n UPDATE_FAQ_ACTION_TRIGGER,\n UPDATE_FAQ_ACTION_RESPONSE,\n UPDATE_FAQ_ACTION_ERROR,\n CREATE_FAQ_ACTION_TRIGGER,\n CREATE_FAQ_ACTION_RESPONSE,\n CREATE_FAQ_ACTION_ERROR,\n SEARCH_FAQ_ACTION_RESPONSE,\n SEARCH_FAQ_ACTION_ERROR,\n SEARCH_FAQ_ACTION_TRIGGER,\n DELETE_FAQ_ACTION_TRIGGER,\n DELETE_FAQ_ACTION_RESPONSE,\n DELETE_FAQ_ACTION_ERROR,\n FAQ_LIST_TRIGGER,\n GET_FAQ_LIST_RESPONSE,\n FAQ_LIST_RESPONSE_ERROR,\n GET_ARTICLE_LIST_RESPONSE,\n GET_COLLECTION_LIST_RESPONSE,\n} from \"constant\";\n\nlet initialState = {\n loading: false,\n error: null,\n faq: null,\n faqContents: null,\n searchfaq: null,\n createdfaq: null,\n updatedfaq: null,\n deletedfaq: null,\n FaqList: [],\n FaqCollectionsList: [],\n FaqArticleList: [],\n};\n\nconst FaqReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_FAQ_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n faq: null,\n };\n\n case GET_FAQ_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n faq: action.data.data,\n error: null,\n };\n\n case GET_FAQ_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n faq: null,\n };\n\n case GET_FAQ_CONTENTS_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n faqContents: null,\n };\n\n case GET_FAQ_CONTENTS_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n faqContents: action.data,\n error: null,\n };\n\n case GET_FAQ_CONTENTS_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n faqContents: null,\n };\n case SEARCH_FAQ_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n searchfaq: [],\n };\n\n case SEARCH_FAQ_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n searchfaq: action.data.data,\n error: null,\n };\n\n case SEARCH_FAQ_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n searchfaq: [],\n };\n case CREATE_FAQ_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n createdfaq: [],\n };\n\n case CREATE_FAQ_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n createdfaq: action.data.data,\n error: null,\n };\n\n case CREATE_FAQ_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n createdfaq: [],\n };\n\n case UPDATE_FAQ_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n updatedfaq: [],\n };\n\n case UPDATE_FAQ_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n updatedfaq: action.data.data,\n error: null,\n };\n\n case UPDATE_FAQ_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n updatedfaq: [],\n };\n\n case DELETE_FAQ_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n deletedfaq: [],\n };\n\n case DELETE_FAQ_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n deletedfaq: action.data.data,\n error: null,\n };\n\n case DELETE_FAQ_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n deletedfaq: [],\n };\n case FAQ_LIST_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n case GET_FAQ_LIST_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n FaqList: action.data,\n };\n case GET_ARTICLE_LIST_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n FaqArticleList: action.data,\n };\n case GET_COLLECTION_LIST_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n FaqCollectionsList: action.data,\n };\n case FAQ_LIST_RESPONSE_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n };\n default:\n return newState;\n }\n};\n\nexport default FaqReducer;\n","import {\n CREATE_TAG_ACTION_ERROR,\n CREATE_TAG_ACTION_RESPONSE,\n CREATE_TAG_ACTION_TRIGGER,\n SEARCH_TAG_ACTION_ERROR,\n SEARCH_TAG_ACTION_RESPONSE,\n SEARCH_TAG_ACTION_TRIGGER,\n TAG_LIST_TRIGGER,\n TAG_LIST_RESPONSE,\n TAG_LIST_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n search: null,\n tag: null,\n tagList: [],\n};\n\nconst TagReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case CREATE_TAG_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n tag: null,\n };\n\n case CREATE_TAG_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n tag: action.data.data,\n error: null,\n };\n\n case CREATE_TAG_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n tag: null,\n };\n\n case SEARCH_TAG_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n search: null,\n };\n\n case SEARCH_TAG_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n search: action.data.data,\n error: null,\n };\n\n case SEARCH_TAG_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n search: null,\n };\n\n case TAG_LIST_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n tagList: action.data.data,\n error: null,\n };\n case TAG_LIST_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n tagList: [],\n };\n case TAG_LIST_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n tagList: [],\n };\n\n default:\n return newState;\n }\n};\n\nexport default TagReducer;\n","import {\n GET_CONV_ACTION_TRIGGER,\n GET_CONV_ACTION_RESPONSE,\n GET_CONV_ACTION_ERROR,\n UPDATE_CONV_ACTION_TRIGGER,\n UPDATE_CONV_ACTION_RESPONSE,\n UPDATE_CONV_ACTION_ERROR,\n GET_SINGLE_CONV_ACTION_TRIGGER,\n GET_SINGLE_CONV_ACTION_RESPONSE,\n GET_SINGLE_CONV_ACTION_ERROR,\n ASSIGN_AGENT_ACTION_RESPONSE,\n ASSIGN_AGENT_ACTION_ERROR,\n ASSIGN_AGENT_ACTION_TRIGGER,\n GET_TEAMCONV_ACTION_TRIGGER,\n GET_TEAMCONV_ACTION_RESPONSE,\n GET_TEAMCONV_ACTION_ERROR,\n GET_CONV_NOTIFICATION_RESPONSE,\n GET_TEAMCONV_NOATIFICATION_RESPONSE,\n GET_GROUP_CONV_ACTION_RESPONSE,\n GET_GROUP_CONV_ACTION_TRIGGER,\n SET_CHANNEL_TOPBAR,\n UPDATE_GROUP_CONV_ACTION_RESPONSE,\n GET_GROUP_NOATIFICATION_RESPONSE,\n GET_CONV_SEARCH_RESPONSE,\n SET_WIDGET_REQUEST,\n TOTAL_UNREAD_MSG_COUNT,\n GET_UNREAD_NOTIFICATION,\n GET_UNREAD_NOTIFICATION_RESPONSE,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n convList: [],\n search: [],\n TeamConv: [],\n ConvNotification: \"\",\n TeamNotification: \"\",\n GroupNotification: \"\",\n group: [],\n channelActive: true,\n widgetNew: {},\n totalUnread: 0,\n paging: {},\n unreadNotification: null,\n};\n\nconst ConvReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_CONV_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n convList: [],\n };\n case \"GET_CONV_ACTION_TRIGGER_LOADING\":\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n case GET_CONV_ACTION_RESPONSE:\n const existingIds = newState.convList.map((conv) => conv._id);\n const newConversations = action.data.data.filter(\n (conv) => !existingIds.includes(conv._id)\n );\n const newConvList = [...newState.convList, ...newConversations];\n return {\n ...newState,\n loading: false,\n action: action.type,\n convList: newConvList,\n paging: action.data.paging,\n error: null,\n };\n case SET_WIDGET_REQUEST:\n return {\n ...newState,\n widgetNew: action.data,\n action: action.type,\n };\n\n case GET_CONV_SEARCH_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n convList: action.data.data,\n paging: action.data.paging,\n error: null,\n };\n\n case GET_CONV_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n convList: [],\n };\n // case GET_TEAMCONV_ACTION_TRIGGER:\n // return {\n // ...newState,\n // loading: true,\n // action: action.type,\n // TeamConv: [],\n // };\n\n // case GET_TEAMCONV_ACTION_RESPONSE:\n // return {\n // ...newState,\n // loading: false,\n // action: action.type,\n // TeamConv: action.data,\n // error: null,\n // };\n\n // case GET_TEAMCONV_ACTION_ERROR:\n // return {\n // ...newState,\n // loading: false,\n // action: action.type,\n // error: action.data,\n // TeamConv: [],\n // };\n\n case GET_SINGLE_CONV_ACTION_TRIGGER:\n return {\n ...newState,\n loading: false,\n action: action.type,\n };\n\n case GET_SINGLE_CONV_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n singleConv: action.data,\n };\n\n case GET_SINGLE_CONV_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n\n case UPDATE_CONV_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case UPDATE_CONV_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n singleConv: action.data,\n };\n\n case UPDATE_CONV_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n\n case ASSIGN_AGENT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case ASSIGN_AGENT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n };\n\n case ASSIGN_AGENT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n case GET_CONV_NOTIFICATION_RESPONSE:\n return {\n ...newState,\n loading: true,\n action: action.type,\n ConvNotification: action.data,\n };\n case GET_TEAMCONV_NOATIFICATION_RESPONSE:\n return {\n ...newState,\n loading: true,\n action: action.type,\n TeamNotification: action.data,\n };\n case GET_GROUP_NOATIFICATION_RESPONSE:\n return {\n ...newState,\n loading: true,\n action: action.type,\n GroupNotification: action.data,\n };\n case GET_GROUP_CONV_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n group: action.data,\n };\n case GET_GROUP_CONV_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n case SET_CHANNEL_TOPBAR:\n return {\n ...newState,\n loading: false,\n channelActive: action.data,\n };\n case UPDATE_GROUP_CONV_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n };\n case TOTAL_UNREAD_MSG_COUNT:\n return {\n ...newState,\n action: action.type,\n totalUnread: action.data,\n };\n case GET_UNREAD_NOTIFICATION_RESPONSE:\n return {\n ...newState,\n action: action.type,\n unreadNotification: action?.data,\n };\n case GET_UNREAD_NOTIFICATION:\n return {\n ...newState,\n action: action.type,\n };\n case \"UPDATE_CANDIDATE_DETAILS_RESPONSE_ACTIVE\":\n const updatedlist = newState.convList.map((res) => {\n if (res._id === action.data.data._id) {\n let { conv } = res;\n action.data = {\n conv,\n ...action.data.data,\n };\n return action.data;\n } else {\n return res;\n }\n });\n return {\n ...newState,\n action: action.type,\n convList: updatedlist,\n };\n\n case \"UPDATE_CANDIDATE_STAGE_RESPONSE_ACTIVE\":\n const updatedStageList = newState.convList.map((res) => {\n if (res._id === action.data.candidateID) {\n const data = {\n ...res,\n cd: {\n ...res.cd,\n openings: [\n {\n stageId: action.data.stageId,\n openingId: action.data.openingId,\n },\n ],\n },\n };\n return data;\n } else {\n return res;\n }\n });\n return {\n ...newState,\n action: action.type,\n convList: updatedStageList,\n };\n\n case \"RESET_PAGING\":\n return {\n ...newState,\n action: action.type,\n paging: {},\n };\n\n default:\n return newState;\n }\n};\n\nexport default ConvReducer;\n","import {\n NEW_MESSAGE_ACTION_TRIGGER,\n SEND_MESSAGE_ACTION_TRIGGER,\n SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER,\n HISTORICAL_MESSAGE_ACTION_TRIGGER,\n HISTORICAL_MESSAGE_ACTION_RESPONSE,\n HISTORICAL_MESSAGE_ACTION_ERROR,\n SET_TEAM_MESSAGE,\n SET_CHANNEL_MESSAGE,\n CLEAR_MESSAGE,\n CLEAR_TEAM_MESSAGE,\n CLEAR_CHANNEL_MESSAGE,\n SOCKET_SENT_MESSAGE_ACTION_TRIGGER,\n SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER,\n SOCKET_READ_MESSAGE_ACTION_TRIGGER,\n SOCKET_FAILED_MESSAGE_ACTION_TRIGGER,\n BOT_PROCESSING_START,\n BOT_PROCESSING_END,\n TYPING_START,\n TYPING_END,\n EMIT_TYPING,\n SET_INCOMMING_MSG,\n CHECKED_LIST,\n GET_THREAD_EMAIL_MESSAGES_TRIGGER,\n GET_THREAD_EMAIL_MESSAGES_RESPONSE,\n GET_THREAD_EMAIL_MESSAGES_ERROR,\n} from \"constant\";\nimport {\n SET_ACTIVE_CONVID,\n SET_ACTIVE_CH_CONVID,\n SET_ACTIVE_TM_CONVID,\n} from \"constant/app.constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n messages: [],\n messageTeam: [],\n messageChannel: [],\n activeConvId: null,\n TeamMessageConvId: null,\n ChannelsConvId: null,\n botProcessing: false,\n typing: false,\n emitTyping: false,\n incomingMessage: null,\n checkedList: [],\n threadLoading: false,\n EmailThreadMessages: [],\n};\n\nconst MessageReducer = (state = initialState, action) => {\n let newState = { ...state };\n switch (action.type) {\n case NEW_MESSAGE_ACTION_TRIGGER:\n // if (action.data.to[0].type === \"Contact\") {\n // newState?.messages?.data?.unshift(action.data);\n // newState?.messages?.data?.sort((a, b) => {\n // return new Date(b.createdAt) - new Date(a.createdAt);\n // });\n // }\n // if (action.data.st === \"agent\") {\n // newState?.messageTeam?.data?.unshift(action.data);\n // newState?.messages?.data?.sort((a, b) => {\n // return new Date(b.createdAt) - new Date(a.createdAt);\n // });\n // }\n // if (action.data.st === \"group\") {\n // newState?.messageChannel?.data?.unshift(action.data);\n // newState?.messages?.data?.sort((a, b) => {\n // return new Date(b.createdAt) - new Date(a.createdAt);\n // });\n // }\n if (\n newState?.activeConvId?.conv?._id === action?.data?.convId &&\n newState?.checkedList[0][\"id\"] === action?.data?.channelAccountId\n ) {\n const existingMessage = newState?.messages?.data?.find(\n (message) => message._id === action.data._id\n );\n if (!existingMessage) {\n newState?.messages?.data?.unshift(action.data);\n newState?.messages?.data?.sort((a, b) => {\n return new Date(b.createdAt) - new Date(a.createdAt);\n });\n }\n } else {\n newState.incomingMessage = action.data;\n }\n return {\n ...newState,\n action: action.type,\n };\n\n case SOCKET_SENT_MESSAGE_ACTION_TRIGGER:\n if (newState?.activeConvId?.conv._id === action?.data?.convId) {\n // if (action.data.to[0].type === \"Contact\") {\n // let index = newState?.messages?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messages.data[index] = action.data;\n // }\n // if (action.data.st === \"agent\") {\n // let index = newState?.messageTeam?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageTeam.data[index] = action.data;\n // }\n // if (action.data.st === \"group\") {\n // let index = newState?.messageChannel?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageChannel.data[index] = action.data;\n // }\n\n let index = newState?.messages?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messages.data[index] = action.data;\n }\n return {\n ...newState,\n };\n\n case SOCKET_DELIVERED_MESSAGE_ACTION_TRIGGER:\n if (newState?.activeConvId?.conv._id === action?.data?.convId) {\n // if (action.data.to[0].type === \"Contact\") {\n // let index = newState?.messages?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messages.data[index] = action.data;\n // }\n // if (action.data.st === \"agent\") {\n // let index = newState?.messageTeam?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageTeam.data[index] = action.data;\n // }\n // if (action.data.st === \"group\") {\n // let index = newState?.messageChannel?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageChannel.data[index] = action.data;\n // }\n let index = newState?.messages?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messages.data[index] = action.data;\n }\n return {\n ...newState,\n };\n\n case SOCKET_READ_MESSAGE_ACTION_TRIGGER:\n if (newState?.activeConvId?.conv._id === action?.data?.convId) {\n // if (action.data.to[0].type === \"Contact\") {\n // let index = newState?.messages?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messages.data[index] = action.data;\n // }\n // if (action.data.st === \"agent\") {\n // let index = newState?.messageTeam?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageTeam.data[index] = action.data;\n // }\n // if (action.data.st === \"group\") {\n // let index = newState?.messageChannel?.data?.findIndex(\n // (msg) => msg.reqId === action.data.reqId\n // );\n // newState.messageChannel.data[index] = action.data;\n // }\n let index = newState?.messages?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messages.data[index] = action.data;\n }\n return {\n ...newState,\n };\n\n case SOCKET_FAILED_MESSAGE_ACTION_TRIGGER:\n if (newState?.activeConvId?.conv._id === action?.data?.convId) {\n if (action.data.to[0].type === \"Contact\") {\n let index = newState?.messages?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messages.data[index] = action.data;\n }\n if (action.data.st === \"agent\") {\n let index = newState?.messageTeam?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messageTeam.data[index] = action.data;\n }\n if (action.data.st === \"group\") {\n let index = newState?.messageChannel?.data?.findIndex(\n (msg) => msg.reqId === action.data.reqId\n );\n newState.messageChannel.data[index] = action.data;\n }\n }\n return {\n ...newState,\n };\n\n case SEND_MESSAGE_ACTION_TRIGGER:\n return {\n ...newState,\n action: action.type,\n newMessage: action.data,\n };\n case SEND_MESSAGE_ACTION_ACCOUNT_LOCKED_TRIGGER:\n return {\n ...newState,\n action: action.type,\n newMessage: action.data,\n };\n case BOT_PROCESSING_START:\n return {\n ...newState,\n botProcessing: true,\n };\n case BOT_PROCESSING_END:\n return {\n ...newState,\n botProcessing: false,\n };\n\n case TYPING_START:\n return {\n ...newState,\n typing: true,\n };\n case TYPING_END:\n return {\n ...newState,\n typing: false,\n };\n case EMIT_TYPING:\n return {\n ...newState,\n emitTyping: action.data,\n };\n\n case HISTORICAL_MESSAGE_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case HISTORICAL_MESSAGE_ACTION_RESPONSE:\n const uniqueMessages = new Set(\n newState.messages?.data?.map((message) => message._id)\n );\n const updatedMessages = action.data.data.filter(\n (message) => !uniqueMessages.has(message._id)\n );\n return {\n ...newState,\n loading: false,\n action: action.type,\n messages:\n newState?.messages?.data?.length > 0\n ? {\n ...action.data,\n data: [...newState.messages.data, ...updatedMessages],\n }\n : action.data,\n };\n case HISTORICAL_MESSAGE_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n messages: [],\n };\n case CLEAR_MESSAGE:\n return {\n ...newState,\n messages: [],\n };\n case SET_ACTIVE_CONVID:\n return {\n ...newState,\n action: action.type,\n activeConvId: action.data,\n // messages: [],\n };\n case SET_ACTIVE_CH_CONVID:\n return {\n ...newState,\n action: action.type,\n activeConvId: action.data,\n };\n case SET_ACTIVE_TM_CONVID:\n return {\n ...newState,\n action: action.type,\n activeConvId: action.data,\n };\n case SET_TEAM_MESSAGE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n messageTeam:\n newState?.messageTeam?.data?.length > 0\n ? {\n ...action.data,\n data: [...newState.messageTeam.data, ...action.data.data],\n }\n : action.data,\n };\n case CLEAR_TEAM_MESSAGE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n messageTeam: [],\n };\n case SET_CHANNEL_MESSAGE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n messageChannel:\n newState?.messageChannel?.data?.length > 0\n ? {\n ...action.data,\n data: [...newState.messageChannel.data, ...action.data.data],\n }\n : action.data,\n };\n case CLEAR_CHANNEL_MESSAGE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n messageChannel: [],\n };\n case SET_INCOMMING_MSG:\n return {\n ...newState,\n action: action.type,\n incomingMessage: null,\n };\n case CHECKED_LIST:\n return {\n ...state,\n checkedList: action.data,\n };\n case GET_THREAD_EMAIL_MESSAGES_TRIGGER:\n return {\n ...newState,\n threadLoading: true,\n };\n case GET_THREAD_EMAIL_MESSAGES_RESPONSE:\n return {\n ...newState,\n threadLoading: false,\n EmailThreadMessages: action.data,\n };\n case GET_THREAD_EMAIL_MESSAGES_ERROR:\n return {\n ...newState,\n threadLoading: false,\n EmailThreadMessages: [],\n };\n default:\n return newState;\n }\n};\n\nexport default MessageReducer;\n","import {\n INITIATE_CALL_ACTION_TRIGGER,\n INITIATE_CALL_ACTION_RESPONSE,\n INITIATE_CALL_ACTION_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n call: [],\n};\n\nconst CallReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case INITIATE_CALL_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n call: [],\n };\n\n case INITIATE_CALL_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n call: [],\n error: null,\n };\n\n case INITIATE_CALL_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n call: [],\n };\n\n default:\n return newState;\n }\n};\n\nexport default CallReducer;\n","import {\n GET_TASK_BOARD,\n BOARD_ACTION_TRIGGER,\n BOARD_ACTION_ERROR,\n GET_PROJECT_DATA,\n SET_CARD_VIEW,\n CARD_VIEW_DATA,\n SET_CARD_ASSIGN_POP,\n SET_CARD_LABEL_POP,\n GET_LABEL_DATA,\n GET_USER_TASK_ACTION_TRIGGER,\n GET_USER_TASK_ACTION_RESPONSE,\n GET_USER_TASK_ACTION_ERROR,\n} from \"constant\";\nconst initialState = {\n ProjectData: \"\",\n loading: false,\n TaskBoardColumn: [],\n Cardview: \"\",\n CardViewData: \"\",\n AssignPop: false,\n LabelPop: false,\n LabelData: [],\n};\n\nconst TaskBoard = (state = initialState, action) => {\n switch (action.type) {\n case GET_PROJECT_DATA:\n return { ...state, ProjectData: action.data, action: action.type };\n case BOARD_ACTION_TRIGGER:\n return { ...state, loading: true, action: action.type };\n case SET_CARD_VIEW:\n return { ...state, Cardview: action.data, action: action.type };\n case GET_LABEL_DATA:\n return { ...state, LabelData: action.data, action: action.type };\n case CARD_VIEW_DATA:\n return { ...state, CardViewData: action.data, action: action.type };\n case BOARD_ACTION_ERROR:\n return { ...state, loading: false, action: action.type };\n case SET_CARD_ASSIGN_POP:\n return { ...state, action: action.type, AssignPop: action.data };\n case SET_CARD_LABEL_POP:\n return { ...state, LabelPop: action.data, action: action.type };\n case GET_TASK_BOARD:\n return {\n ...state,\n TaskBoardColumn: action.data,\n action: action.type,\n loading: false,\n };\n case GET_USER_TASK_ACTION_TRIGGER:\n return {\n ...state,\n userTask: action.data,\n action: action.type,\n loading: true,\n };\n case GET_USER_TASK_ACTION_RESPONSE:\n return {\n ...state,\n userTask: action.data,\n action: action.type,\n loading: false,\n };\n case GET_USER_TASK_ACTION_ERROR:\n return {\n ...state,\n userTask: action.data,\n action: action.type,\n loading: false,\n };\n default:\n return state;\n }\n};\n\nexport default TaskBoard;\n","import {\n GET_AGENTS_ACTION_ERROR,\n GET_AGENTS_ACTION_RESPONSE,\n GET_AGENTS_ACTION_TRIGGER,\n GET_TENANT_ACTION_RESPONSE,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n agents: [],\n teams: [],\n};\n\nconst AgentReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_AGENTS_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n agents: [],\n };\n\n case GET_AGENTS_ACTION_RESPONSE:\n case GET_TENANT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n agents: action.data,\n error: null,\n };\n\n case GET_AGENTS_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n agents: [],\n };\n case \"TEAM_LIST\":\n return {\n ...newState,\n action: action.type,\n teams: action.data,\n error: null,\n };\n\n default:\n return newState;\n }\n};\n\nexport default AgentReducer;\n","import {\n GET_ALL_CONTACT_ACTION_ERROR,\n GET_ALL_CONTACT_ACTION_RESPONSE,\n GET_ALL_CONTACT_ACTION_TRIGGER,\n GET_CONTACT_ACTION_ERROR,\n GET_CONTACT_ACTION_RESPONSE,\n GET_CONTACT_ACTION_TRIGGER,\n UPDATE_CONTACT_ACTION_ERROR,\n UPDATE_CONTACT_ACTION_RESPONSE,\n UPDATE_CONTACT_ACTION_TRIGGER,\n ACTIVE_LIST_CONTACT,\n GET_CONTACT_FORM,\n GET_CONTACT_FORM_RESPONSE,\n GET_CONTACT_GRP_RESPONSE,\n GET_ACTIVE_GRP_RESPONSE,\n GET_LOCATION_ACTION_RESPONSE,\n GET_LOCATION_ACTION_ERROR,\n GET_LOCATION_ACTION_TRIGGER,\n CREATE_CONTACT_FORM_FIELD_RESPONSE,\n CREATE_CONTACT_FORM_FIELD_ERROR,\n SEARCH_CONTACT_RESPONSE,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n contacts: [],\n ActiveList: \"\",\n contactForm: null,\n grpList: [],\n activeGrp: [],\n locationList: [],\n searchContact: [],\n ContactStages: [],\n ContactStagesLoading: false,\n updatedContact: null,\n exportingData: false,\n};\n\nconst ContactReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_ALL_CONTACT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n contacts: [],\n };\n\n case GET_ALL_CONTACT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n contacts: action.data,\n error: null,\n };\n\n case GET_ALL_CONTACT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n contacts: [],\n };\n\n case GET_CONTACT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n contacts: [],\n };\n\n case GET_CONTACT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n contacts: action.data,\n error: null,\n };\n\n case GET_CONTACT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n contacts: [],\n };\n\n case UPDATE_CONTACT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case UPDATE_CONTACT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n };\n\n case UPDATE_CONTACT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n case ACTIVE_LIST_CONTACT:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n ActiveList: action.data,\n };\n case GET_CONTACT_FORM:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n case GET_CONTACT_FORM_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n contactForm: action.data,\n };\n case GET_CONTACT_GRP_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n grpList: action.data,\n };\n case GET_ACTIVE_GRP_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n activeGrp: action.data,\n };\n case GET_LOCATION_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n locationList: action.data,\n };\n case CREATE_CONTACT_FORM_FIELD_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n };\n case CREATE_CONTACT_FORM_FIELD_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n case SEARCH_CONTACT_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n searchContact: action.data,\n };\n case \"GET_CONTACT_STAGES_TRIGGER\":\n return {\n ...newState,\n ContactStagesLoading: true,\n };\n case \"GET_CONTACT_STAGES_RESPONSE\":\n return {\n ...newState,\n ContactStagesLoading: false,\n ContactStages: action.data,\n };\n case \"GET_CONTACT_STAGES_ERROR\":\n return {\n ...newState,\n ContactStagesLoading: false,\n };\n case \"CHANGE_CONTACT_STAGE_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n updatedContact: action.data,\n loading: false,\n };\n\n case \"UPDATE_CONTACT_DETAILS_WIDGET\":\n let temp = newState;\n const Contact = temp.contacts.data.map((item) => {\n if (item._id === action.data._id) {\n return action.data;\n } else {\n return item;\n }\n });\n let updatedData = {\n ...temp.contacts,\n data: Contact,\n };\n return {\n ...state,\n loading: false,\n contacts: updatedData,\n action: action.type,\n updatedContact: action.data,\n };\n\n case \"EXPORT_CONTACT_BY_TAG_TRIGGER\":\n return {\n ...newState,\n exportingData: true,\n };\n case \"EXPORT_CONTACT_BY_TAG_RESPONSE\":\n return {\n ...newState,\n exportingData: false,\n };\n case \"EXPORT_CONTACT_BY_TAG_ERROR\":\n return {\n ...newState,\n exportingData: false,\n };\n default:\n return newState;\n }\n};\n\nexport default ContactReducer;\n","import {\n GET_FILE_ACTION_ERROR,\n GET_FILE_ACTION_RESPONSE,\n GET_FILE_ACTION_TRIGGER,\n SEARCH_FILE_ACTION_ERROR,\n SEARCH_FILE_ACTION_RESPONSE,\n SEARCH_FILE_ACTION_TRIGGER,\n UPLOAD_FILE_ACTION_ERROR,\n UPLOAD_FILE_ACTION_RESPONSE,\n UPLOAD_FILE_ACTION_TRIGGER,\n UPLOAD_MESSAGE_FILE_ACTION_ERROR,\n UPLOAD_MESSAGE_FILE_ACTION_RESPONSE,\n UPLOAD_MESSAGE_FILE_ACTION_TRIGGER,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n files: [],\n search: [],\n singleFile: {},\n};\n\nconst FileReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_FILE_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n files: [],\n };\n\n case GET_FILE_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n files: action.data,\n error: null,\n };\n\n case GET_FILE_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n files: [],\n };\n\n case SEARCH_FILE_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n search: [],\n };\n\n case SEARCH_FILE_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n search: action.data.data,\n error: null,\n };\n\n case SEARCH_FILE_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n search: [],\n };\n\n case UPLOAD_FILE_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case UPLOAD_FILE_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n };\n\n case UPLOAD_FILE_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n\n case UPLOAD_MESSAGE_FILE_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n singleFile: {},\n };\n\n case UPLOAD_MESSAGE_FILE_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: null,\n singleFile: action.data,\n };\n\n case UPLOAD_MESSAGE_FILE_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n singleFile: {},\n };\n\n default:\n return newState;\n }\n};\n\nexport default FileReducer;\n","import {\n GET_ALL_CONVERSATION,\n CREATE_CONVERSATION,\n CREATE_CONV_NODE,\n LINK_CONV_NODE,\n GET_ALL_CONVERSATION_BY_IDS,\n ACTIVE_WORKBENCH,\n GET_ALL_BOTS,\n ACTIVE_BOT,\n SET_LOGOURL,\n SET_LAUNCHERURL,\n SET_WIDGET_COLOR,\n SET_WIDGET_ENABLED,\n DEPLOY_URL,\n SELECTED_NODE,\n SET_WIDGET,\n DATA_LOAD,\n ADD_NODE,\n BOT_SKELETON,\n SET_WIDGET_DRAWER,\n SET_ACTIVE_STEPPER,\n SET_NODE_DRAG,\n LANGUAGE_SET,\n UPDATE_SELECTED_NODE,\n WB_DESIGN_JSON,\n CONDITIONS_VAR_SET,\n JUMP_LOCATIONS_SET,\n WB_BASE_URL,\n WB_ALL_API,\n WB_WEBHOOK_BY_ID,\n WB_SOPIFI_CAT,\n WB_SOPIFI_ITEM,\n WB_SOPIFI_VAR,\n CONFIG_CHANNELS,\n} from \"constant\";\nimport { TOGGLE_ADD_BOT_SIDE_BAR } from \"constant/app.constant\";\n\nconst initialState = {\n draftConvList: [],\n convList: [],\n addBotSider: true,\n Workbench: false,\n Bots: [],\n ActiveBot: \"\",\n LogoURL: \"\",\n LauncherURL: \"\",\n widgetColor: \"#51b580\",\n widgetEnabled: [],\n deployUrl: \"\",\n selectedNode: {},\n isWidget: true,\n DataLoad: true,\n addNode: false,\n botSkeleton: true,\n StepperActive: \"Build\",\n nodeDrag: false,\n LanguageData: {},\n isWidgetDrawer: false,\n wbDesignJson: {},\n conditionsVarSet: [],\n jumpLocationSet: [],\n BaseUrls: [],\n wbHookApis: [],\n wbHookbyID: {},\n wbSopifyCat: [],\n wbSopifyItem: [],\n wbSopifyVar: [],\n configChannels: {},\n AccountIntents: [],\n};\n\nconst Workbench = (state = initialState, action) => {\n switch (action.type) {\n case GET_ALL_CONVERSATION:\n return { ...state, draftConvList: action.data };\n case ACTIVE_BOT:\n return { ...state, ActiveBot: action.data };\n case GET_ALL_BOTS:\n return { ...state, Bots: action.data };\n case TOGGLE_ADD_BOT_SIDE_BAR:\n return { ...state, addBotSider: action.data };\n case ACTIVE_WORKBENCH:\n return { ...state, Workbench: action.data };\n case SET_LOGOURL:\n return { ...state, LogoURL: action.data };\n case SET_LAUNCHERURL:\n return { ...state, LauncherURL: action.data };\n case SET_WIDGET_COLOR:\n return { ...state, widgetColor: action.data };\n case DEPLOY_URL:\n return { ...state, deployUrl: action.data };\n case SET_WIDGET_ENABLED:\n return { ...state, widgetEnabled: action.data };\n case SELECTED_NODE:\n return { ...state, selectedNode: action.data };\n case UPDATE_SELECTED_NODE:\n state.selectedNode.convNodeContent = action.data;\n return { ...state };\n case SET_WIDGET:\n return { ...state, isWidget: action.data };\n case SET_WIDGET_DRAWER:\n return { ...state, isWidgetDrawer: action.data };\n case BOT_SKELETON:\n return { ...state, botSkeleton: action.data };\n case DATA_LOAD:\n return { ...state, DataLoad: action.data };\n case ADD_NODE:\n return { ...state, addNode: action.data };\n case GET_ALL_CONVERSATION_BY_IDS:\n return { ...state, convList: action.data };\n case SET_ACTIVE_STEPPER:\n return { ...state, StepperActive: action.data };\n case SET_NODE_DRAG:\n return { ...state, nodeDrag: action.data };\n case LANGUAGE_SET:\n return { ...state, LanguageData: action.data };\n case WB_DESIGN_JSON:\n return { ...state, wbDesignJson: action.data };\n case CONDITIONS_VAR_SET:\n return { ...state, conditionsVarSet: action.data };\n case JUMP_LOCATIONS_SET:\n return { ...state, jumpLocationSet: action.data };\n case WB_BASE_URL:\n return { ...state, BaseUrls: action.data };\n case WB_ALL_API:\n return { ...state, wbHookApis: action.data };\n case WB_WEBHOOK_BY_ID:\n return { ...state, wbHookbyID: action.data };\n case WB_SOPIFI_CAT:\n return { ...state, wbSopifyCat: action.data };\n case WB_SOPIFI_ITEM:\n return { ...state, wbSopifyItem: action.data };\n case WB_SOPIFI_VAR:\n return { ...state, wbSopifyVar: action.data };\n case CONFIG_CHANNELS:\n return { ...state, configChannels: action.data };\n case \"ACCOUNT_INTENTS\":\n return { ...state, AccountIntents: action.data };\n default:\n return state;\n }\n};\n\nexport default Workbench;\n","import {\n GET_TENANT_ACTION_TRIGGER,\n GET_TENANT_ACTION_RESPONSE,\n GET_TENANT_ACTION_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n tenants: [],\n};\n\nconst TenantReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_TENANT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n tenants: [],\n };\n\n case GET_TENANT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n tenants: action.data.data,\n error: null,\n };\n\n case GET_TENANT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n tenants: [],\n };\n\n default:\n return newState;\n }\n};\n\nexport default TenantReducer;\n","import {\n ACTIVE_LIST_BOT_AI,\n BOT_AI_SIDER,\n USED_ENTITIES,\n INTENT_QUESTIONS,\n INTENT_LIST,\n INTENT_DATA,\n ACTIVE_INTENT,\n ENTITY_LIST,\n ACTIVE_ENTITY,\n} from \"constant\";\n\nvar initialState = {\n ActiveList: \"Intent\",\n DataSider: true,\n usedEntities: [],\n IntentQuestions: [],\n IntentList: [],\n IntentData: [],\n ActiveIntent: \"\",\n EntityList: [],\n ActiveEntity: \"\",\n};\n\nconst BotAiReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case ACTIVE_LIST_BOT_AI:\n return {\n ...newState,\n ActiveList: action.data,\n };\n case BOT_AI_SIDER:\n return {\n ...newState,\n DataSider: action.data,\n };\n case USED_ENTITIES:\n return {\n ...newState,\n usedEntities: action.data,\n };\n case INTENT_QUESTIONS:\n return {\n ...newState,\n IntentQuestions: action.data,\n };\n case INTENT_LIST:\n return {\n ...newState,\n IntentList: action.data,\n };\n case INTENT_DATA:\n return {\n ...newState,\n IntentData: action.data,\n };\n case ACTIVE_INTENT:\n return {\n ...newState,\n ActiveIntent: action.data,\n };\n case ENTITY_LIST:\n return {\n ...newState,\n EntityList: action.data,\n };\n case ACTIVE_ENTITY:\n return {\n ...newState,\n ActiveEntity: action.data,\n };\n default:\n return newState;\n }\n};\n\nexport default BotAiReducer;\n","import {\n ACTIVE_LIST_ADMIN,\n SIDEBAR_ADMIN,\n CONN_ACCOUNT,\n CONNECT_SIDEBAR_VIEW,\n CHECK_EMAIL_AVL,\n ALL_CONFIG,\n ACTIVE_INDEX,\n CHECK_PHONE_AVL,\n SMS_SEARCH,\n USER_TENANT_LIST,\n DEF_EMAIL_CONFIG,\n DEF_SMS_CONFIG,\n CHANNEL_ACCOUNT,\n EMAIL_RECIPIENT,\n CC_EMAIL_RECIPERNT,\n BCC_EMAIL_RECIPERNT,\n EMAIL_SUBJECT,\n CHECKED_LIST,\n SMS_NO_DATA,\n CONTENT_LOADING,\n WHATSAPP_ERROR,\n WHATSAPP_RESPONSE,\n GET_LANGUAGES,\n GET_LANGUAGES_FORM,\n STORE_SHOPIFY,\n STORE_FACEBOOK,\n STORE_SETTINGS,\n STORE_COLLECTIONS,\n STORE_DATA,\n STORE_DATA_LIST,\n PRODUCT_COLLECTIONS,\n LOADING_TRIGGER,\n BUSINESS_INFO,\n META_CONNECTION_INFO,\n WHATSAPP_WEBHOOK,\n CONNECTED_BOT,\n GET_INTEGRATION_PAYMENT_TRIGGER,\n GET_INTEGRATION_PAYMENT_RESPONSE,\n GET_INTEGRATION_PAYMENT_ERROR,\n GET_INTEGRATION_SHOPIFY_TRIGGER,\n GET_INTEGRATION_SHOPIFY_RESPONSE,\n GET_INTEGRATION_SHOPIFY_ERROR,\n NOTIFICATION_PREFERENCE_RESPONSE,\n WHATSAPP_CONNECT_SETTINGS,\n META_APIS_BUSINESS_INFO,\n META_APIS_WEB_ID,\n META_APIS_NUMBER,\n SET_MAIL_PREVIEW_DATA,\n REMOVE_MAIL_PREVIEW_DATA,\n SET_MAIL_PREVIEW_DATA_THREAD,\n} from \"constant\";\nimport { setCookie } from \"utils\";\n\nvar initialState = {\n Loading: false,\n ActiveList: \"\",\n DataSider: true,\n ConnectedAccount: \"SMS\",\n SideBarView: \"\",\n CheckEmailAvl: [],\n CheckPhnAvl: [],\n allConfigData: null,\n ActiveIndex: null,\n userTenantList: [],\n defaultEmail: \"\",\n defaultSms: \"\",\n channelAct: \"\",\n emailRecipients: \"\",\n ccEmailRecipients: [],\n bccEmailRecipients: [],\n emailSubject: \"\",\n checkedList: [],\n smsEmpty: false,\n contentLoader: true,\n whatsAppToken: null,\n languages: [],\n languageForm: [],\n storeShopify: null,\n storeFacebook: null,\n storeSettings: null,\n storeCollections: null,\n StoreData: [],\n StoreDataList: [],\n ProductCollections: [],\n BusinessInfo: [],\n StoreConnectionId: null,\n WhatsAppWebhook: null,\n ConnectedBot: null,\n ShopifyIntegration: [],\n PaymentIntegration: [],\n NotificationPreference: [],\n whatsAppConnectSettings: null,\n MetaApisBusinessInfo: null,\n MetaApisWebId: null,\n MetaApisNumber: null,\n MailPreviewData: null,\n MailPreviewDataThread: null,\n ChannelAccountStatus: null,\n ChannelAccountStatusLoading: false,\n SmtpProviders: [],\n SmtpProvidersLoading: false,\n CalendarAccounts: [],\n CalendarAccountsLoading: false,\n QuestionnaireConfiguration: [],\n TrackerConfiguration: [],\n};\n\nconst AdminReducer = (state = initialState, action) => {\n let newState = { ...state };\n switch (action.type) {\n case LOADING_TRIGGER:\n return {\n ...state,\n Loading: action.data,\n };\n\n case ACTIVE_LIST_ADMIN:\n return {\n ...state,\n ActiveList: action.data,\n };\n case SIDEBAR_ADMIN:\n return {\n ...state,\n DataSider: action.data,\n };\n case CONN_ACCOUNT:\n return {\n ...state,\n ConnectedAccount: action.data,\n };\n case CONNECT_SIDEBAR_VIEW:\n return {\n ...state,\n SideBarView: action.data,\n };\n case CHECK_EMAIL_AVL:\n return {\n ...state,\n CheckEmailAvl: action.data,\n };\n case ALL_CONFIG:\n return {\n ...state,\n allConfigData: action.data,\n };\n case ACTIVE_INDEX:\n return {\n ...state,\n ActiveIndex: action.data,\n };\n case CHECK_PHONE_AVL:\n return {\n ...state,\n CheckPhnAvl: action.data,\n };\n case SMS_SEARCH:\n return {\n ...state,\n Loading: action.data,\n };\n case USER_TENANT_LIST:\n return {\n ...state,\n userTenantList: action.data,\n };\n case DEF_EMAIL_CONFIG:\n return {\n ...state,\n defaultEmail: action.data,\n };\n case DEF_SMS_CONFIG:\n return {\n ...state,\n defaultSms: action.data,\n };\n case CHANNEL_ACCOUNT:\n return {\n ...state,\n channelAct: action.data,\n };\n case EMAIL_RECIPIENT:\n return {\n ...state,\n emailRecipients: action.data,\n };\n case CC_EMAIL_RECIPERNT:\n return {\n ...state,\n ccEmailRecipients: action.data,\n };\n case BCC_EMAIL_RECIPERNT:\n return {\n ...state,\n bccEmailRecipients: action.data,\n };\n case EMAIL_SUBJECT:\n return {\n ...state,\n emailSubject: action.data,\n };\n case CHECKED_LIST:\n return {\n ...state,\n checkedList: action.data,\n };\n case SMS_NO_DATA:\n return {\n ...state,\n smsEmpty: action.data,\n };\n case CONTENT_LOADING:\n return {\n ...state,\n contentLoader: action.data,\n };\n case WHATSAPP_RESPONSE:\n return {\n ...state,\n action: action.type,\n whatsAppToken: action.data,\n };\n case WHATSAPP_ERROR:\n return {\n ...state,\n action: action.type,\n };\n case GET_LANGUAGES:\n return {\n ...state,\n languages: action.data,\n };\n case GET_LANGUAGES_FORM:\n return {\n ...state,\n languageForm: action.data,\n };\n case STORE_SHOPIFY:\n return {\n ...state,\n storeShopify: action.data,\n };\n case STORE_FACEBOOK:\n return {\n ...state,\n storeFacebook: action.data,\n Loading: false,\n };\n case STORE_SETTINGS:\n return {\n ...state,\n storeSettings: action.data,\n };\n case STORE_COLLECTIONS:\n return {\n ...state,\n Loading: false,\n storeCollections: action.data,\n };\n case STORE_DATA:\n return {\n ...state,\n Loading: false,\n StoreData: action.data,\n };\n case STORE_DATA_LIST:\n return {\n ...state,\n Loading: false,\n StoreDataList: action.data,\n };\n case PRODUCT_COLLECTIONS:\n return {\n ...state,\n Loading: false,\n ProductCollections: action.data,\n };\n case BUSINESS_INFO:\n return {\n ...state,\n Loading: false,\n BusinessInfo: action.data,\n };\n case META_CONNECTION_INFO:\n return {\n ...state,\n Loading: false,\n StoreConnectionId: action.data,\n };\n case WHATSAPP_WEBHOOK:\n return {\n ...state,\n Loading: false,\n WhatsAppWebhook: action.data,\n };\n case CONNECTED_BOT:\n return {\n ...state,\n Loading: false,\n ConnectedBot: action.data,\n };\n case GET_INTEGRATION_PAYMENT_TRIGGER:\n return {\n ...state,\n Loading: true,\n };\n case GET_INTEGRATION_PAYMENT_RESPONSE:\n return {\n ...state,\n Loading: false,\n PaymentIntegration: action.data,\n };\n case GET_INTEGRATION_PAYMENT_ERROR:\n return {\n ...state,\n Loading: false,\n };\n case GET_INTEGRATION_SHOPIFY_TRIGGER:\n return {\n ...state,\n Loading: true,\n };\n case GET_INTEGRATION_SHOPIFY_RESPONSE:\n return {\n ...state,\n Loading: false,\n ShopifyIntegration: action.data,\n };\n case GET_INTEGRATION_SHOPIFY_ERROR:\n return {\n ...state,\n Loading: false,\n };\n case NOTIFICATION_PREFERENCE_RESPONSE:\n return {\n ...state,\n Loading: false,\n NotificationPreference: action.data,\n };\n case WHATSAPP_CONNECT_SETTINGS:\n return {\n ...state,\n Loading: false,\n whatsAppConnectSettings: action.data,\n };\n case META_APIS_BUSINESS_INFO:\n return {\n ...state,\n Loading: false,\n MetaApisBusinessInfo: action.data,\n };\n case META_APIS_WEB_ID:\n return {\n ...state,\n Loading: false,\n MetaApisWebId: action.data,\n };\n case META_APIS_NUMBER:\n return {\n ...state,\n Loading: false,\n MetaApisNumber: action.data,\n };\n case SET_MAIL_PREVIEW_DATA:\n return {\n ...state,\n MailPreviewData: action.data,\n };\n case REMOVE_MAIL_PREVIEW_DATA:\n return {\n ...state,\n MailPreviewData: null,\n };\n case SET_MAIL_PREVIEW_DATA_THREAD:\n return {\n ...state,\n MailPreviewDataThread: action.data,\n };\n case \"CHANNEL_ACCOUNT_STATUS\":\n return {\n ...state,\n ChannelAccountStatus: action.data,\n ChannelAccountStatusLoading: false,\n };\n case \"CHANNEL_ACCOUNT_STATUS_LOADING\":\n return {\n ...state,\n ChannelAccountStatusLoading: true,\n };\n case \"CHANNEL_ACCOUNT_STATUS_LOADING_FALSE\":\n return {\n ...state,\n ChannelAccountStatusLoading: false,\n };\n case \"SMTP_PROVIDERS_TRIGGER\":\n return {\n ...state,\n SmtpProviders: [],\n SmtpProvidersLoading: true,\n };\n case \"SMTP_PROVIDERS_RESPONSE\":\n return {\n ...state,\n SmtpProviders: action.data,\n SmtpProvidersLoading: false,\n };\n case \"SMTP_PROVIDERS_ERROR\":\n return {\n ...state,\n SmtpProviders: [],\n SmtpProvidersLoading: false,\n };\n case \"CALENDER_LOADING_TRIGGER\":\n return {\n ...state,\n CalendarAccounts: [],\n CalendarAccountsLoading: true,\n };\n case \"CALENDER_ACCOUNTS\":\n return {\n ...state,\n CalendarAccounts: action.data.data,\n CalendarAccountsLoading: false,\n };\n case \"QUESTIONS_CONFIG\":\n return {\n ...state,\n QuestionnaireConfiguration: action.data,\n };\n case \"TRACKER_CONFIG\":\n return {\n ...state,\n TrackerConfiguration: action.data,\n };\n default:\n return newState;\n }\n};\n\nexport default AdminReducer;\n","import {\n CREATE_GROUP_CONV_ACTION_RESPONSE,\n UPDATE_GROUP_CONV_ACTION_RESPONSE,\n} from \"constant\";\nimport {\n TOGGLE_MAIN_MENU,\n TOGGLE_CHAT_SIDE_BAR,\n TOGGLE_CHAT_TOOL_BAR,\n CHAT_SCREEN_COMPONENT,\n CHAT_CONTAINER_COMPONENT,\n TOGGLE_SETTINGS_SIDE_BAR,\n TOGGLE_ADD_CARD_SIDE_BAR,\n DROP_CONTENT,\n SET_ACTIVE_CONVID,\n RESPONSIVE_MAIN_MENU,\n RESPONSIVE_WIDTH,\n SET_ACTIVE_CH_CONVID,\n SET_ACTIVE_TM_CONVID,\n SET_CHAT_BOT_SWITCH,\n MARK_READ_TRIGGER,\n SET_NOTIF_COUNT,\n} from \"constant/app.constant\";\n\nvar initialState = {\n mainMenuCollapsed: false,\n chatSidebarCollapsed: false,\n chatToolbarCollapsed: false,\n chatScreenComponent: \"chatOnly\",\n chatContainerComponent: \"none\",\n settingsSidebarCollapsed: false,\n newCardAddtoTask: true,\n content: {},\n activeConvId: null,\n TeamMessageConvId: null,\n ChannelsConvId: null,\n windowWidth: \"\",\n MarkReadTrigger: false,\n notifCount: {},\n candidateUpdate: false,\n};\n\nconst AppReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case TOGGLE_MAIN_MENU:\n return { ...newState, mainMenuCollapsed: !newState.mainMenuCollapsed };\n case \"TOGGLE_MAIN_MENU_CHECK\":\n return { ...newState, mainMenuCollapsed: action.data };\n\n case TOGGLE_CHAT_SIDE_BAR:\n return {\n ...newState,\n chatSidebarCollapsed: !newState.chatSidebarCollapsed,\n };\n\n case TOGGLE_CHAT_TOOL_BAR:\n return {\n ...newState,\n chatToolbarCollapsed: action.data,\n // mainMenuCollapsed: !action.data,\n };\n\n case CHAT_SCREEN_COMPONENT:\n return {\n ...newState,\n chatScreenComponent: action.data,\n };\n\n case CHAT_CONTAINER_COMPONENT:\n return {\n ...newState,\n chatContainerComponent: action.data.component,\n containerParams: action.data.params,\n };\n\n case TOGGLE_SETTINGS_SIDE_BAR:\n return {\n ...newState,\n settingsSidebarCollapsed: !newState.settingsSidebarCollapsed,\n };\n\n case TOGGLE_ADD_CARD_SIDE_BAR:\n return {\n ...newState,\n newCardAddtoTask: action.data,\n };\n\n case DROP_CONTENT:\n return {\n ...newState,\n action: action.type,\n content: action.data,\n };\n\n case SET_ACTIVE_CONVID:\n return {\n ...newState,\n action: action.type,\n activeConvId: action.data,\n };\n case SET_CHAT_BOT_SWITCH:\n return {\n ...newState,\n action: action.type,\n };\n\n case RESPONSIVE_MAIN_MENU:\n return {\n ...newState,\n mainMenuCollapsed: action.data,\n };\n case RESPONSIVE_WIDTH:\n return {\n ...newState,\n windowWidth: action.data,\n };\n case UPDATE_GROUP_CONV_ACTION_RESPONSE:\n return {\n ...newState,\n activeConvId: action.data.data,\n };\n case SET_ACTIVE_CH_CONVID:\n return {\n ...newState,\n action: action.type,\n ChannelsConvId: action.data,\n };\n case SET_ACTIVE_TM_CONVID:\n return {\n ...newState,\n action: action.type,\n TeamMessageConvId: action.data,\n };\n // case CREATE_GROUP_CONV_ACTION_RESPONSE:\n // return {\n // ...newState,\n // activeConvId: action.data.data,\n // };\n case MARK_READ_TRIGGER:\n return {\n ...newState,\n action: action.type,\n MarkReadTrigger: action.data,\n };\n case SET_NOTIF_COUNT:\n return {\n ...newState,\n action: action.type,\n notifCount: action.data,\n };\n case \"UPDATE_CANDIDATE_DETAILS_RESPONSE_ACTIVE\":\n let { conv } = newState.activeConvId;\n let data = action.data;\n let newD = {\n conv,\n ...data,\n };\n return {\n ...newState,\n action: action.type,\n activeConvId: newD?.conv === undefined ? newD.data : newD,\n candidateUpdate: true,\n };\n case \"CANDIDATE_UPDATE_RESET\":\n return {\n ...newState,\n action: action.type,\n candidateUpdate: false,\n };\n default:\n return newState;\n }\n};\n\nexport default AppReducer;\n","import {\n DASHBOARD_CARDS,\n DASHBOARD_VISITORS,\n DASHBOARD_CONTACT,\n DASHBOARD_CARDS_TRIGGER,\n GET_PAYMENTS_CARD_ACTION_RESPONSE,\n DASHBOARD_UNMOUNT,\n} from \"constant\";\n\nconst initialState = {\n loading: false,\n cards: [],\n visitors: [],\n contact: [],\n payments: { datasets: [] },\n};\n\nconst DashboardReducer = (state = initialState, action) => {\n switch (action.type) {\n case DASHBOARD_CARDS_TRIGGER:\n return { ...state, loading: true };\n case DASHBOARD_CARDS:\n return { ...state, cards: action.data, loading: false };\n case DASHBOARD_VISITORS:\n return { ...state, visitors: action.data };\n case DASHBOARD_CONTACT:\n return { ...state, contact: action.data };\n case GET_PAYMENTS_CARD_ACTION_RESPONSE:\n let SuccessCount = action.data?.data?.status?.find(\n (item) => item._id === \"paid\"\n );\n let CancelCount = action.data?.data?.status?.find(\n (item) => item._id === \"cancel\"\n );\n let PendingCount = action.data?.data?.status?.find(\n (item) => item._id === \"created\"\n );\n let obj = {\n datasets: [\n {\n backgroundColor: [\"#F2C254\", \"#E9ECEF\"],\n data: [PendingCount?.count ?? 0, 89],\n },\n {\n backgroundColor: [\"#4CB580\", \"#E9ECEF\"],\n data: [SuccessCount?.count ?? 0, 33],\n },\n {\n backgroundColor: [\"#E02424\", \"#E9ECEF\"],\n data: [CancelCount?.count ?? 0, 80],\n },\n ],\n };\n state.payments = obj;\n return { ...state };\n case DASHBOARD_UNMOUNT:\n state = initialState;\n return { ...state };\n default:\n return state;\n }\n};\nexport default DashboardReducer;\n","import {\n CREATE_PAYMENTS_ACTION_TRIGGER,\n CREATE_PAYMENTS_ACTION_RESPONSE,\n CREATE_PAYMENTS_ACTION_ERROR,\n GET_PAYMENTS_ACTION_TRIGGER,\n GET_PAYMENTS_ACTION_RESPONSE,\n GET_PAYMENTS_ACTION_ERROR,\n GET_PAYMENTS_CARD_ACTION_TRIGGER,\n GET_PAYMENTS_CARD_ACTION_RESPONSE,\n GET_PAYMENTS_CARD_ACTION_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n newPayment: null,\n payment: null,\n card: null,\n};\n\nconst PaymentReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case CREATE_PAYMENTS_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n };\n\n case CREATE_PAYMENTS_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n newPayment: action.data,\n error: null,\n };\n\n case CREATE_PAYMENTS_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n };\n\n case GET_PAYMENTS_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n payment: null,\n };\n\n case GET_PAYMENTS_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n payment: action.data,\n error: null,\n };\n\n case GET_PAYMENTS_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n card: null,\n };\n\n case GET_PAYMENTS_CARD_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n card: null,\n };\n\n case GET_PAYMENTS_CARD_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n card: action.data.data,\n error: null,\n };\n\n case GET_PAYMENTS_CARD_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n card: null,\n };\n default:\n return newState;\n }\n};\n\nexport default PaymentReducer;\n","import {\n GET_ALL_ITEM_ACTION_TRIGGER,\n GET_ALL_ITEM_ACTION_RESPONSE,\n GET_ALL_ITEM_ACTION_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n items: null,\n};\n\nconst ItemReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_ALL_ITEM_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n items: null,\n };\n\n case GET_ALL_ITEM_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n items: action.data,\n error: null,\n };\n\n case GET_ALL_ITEM_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n items: null,\n };\n\n default:\n return newState;\n }\n};\n\nexport default ItemReducer;\n","import {\n GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER,\n GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE,\n GET_INTEGRATION_ACCOUNT_ACTION_ERROR,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n error: null,\n account: [],\n};\n\nconst IntegrationAccountReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_INTEGRATION_ACCOUNT_ACTION_TRIGGER:\n return {\n ...newState,\n loading: true,\n action: action.type,\n account: [],\n };\n\n case GET_INTEGRATION_ACCOUNT_ACTION_RESPONSE:\n return {\n ...newState,\n loading: false,\n action: action.type,\n account: action.data,\n error: null,\n };\n\n case GET_INTEGRATION_ACCOUNT_ACTION_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n account: [],\n };\n\n default:\n return newState;\n }\n};\n\nexport default IntegrationAccountReducer;\n","import {\n GET_TEMPLATES_ACTION_TRIGGER,\n GET_TEMPLATES_ACTION_RESPONSE,\n GET_TEMPLATES_ACTION_ERROR,\n CREATE_TEMPLATES_ACTION_TRIGGER,\n CREATE_TEMPLATES_ACTION_RESPONSE,\n CREATE_TEMPLATES_ACTION_ERROR,\n EMAIL_TEMPLATES_ACTION_RESPONSE,\n EMAIL_TEMPLATES_ACTION_ERROR,\n GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE,\n TEMPLATE_DETAILS_BY_ID_RESPONSE,\n GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE,\n GET_EMAIL_PLATEFORM_TEMPLATES_ERROR,\n EMAIL_TEMPLATES_ACTION_CLEAR,\n GET_WHATSAPP_TEMPLATES_TRIGGER,\n GET_WHATSAPP_TEMPLATES_RESPONSE,\n GET_WHATSAPP_TEMPLATES_ERROR,\n PUT_WHATSAPP_TEMPLATE_RESPONSE,\n PUT_WHATSAPP_TEMPLATE_ERROR,\n PUT_WHATSAPP_TEMPLATE_TRIGGER,\n GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER,\n GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE,\n GET_WHATSAPP_TEMPLATE_BY_ID_ERROR,\n IMPORT_TEMPLATE_RESPONSE,\n RESET_TEMPLATE_RESPONSE,\n GET_TEMPLATE_VARIABLES_RESPONSE,\n GET_ACCOUNT_VARIABLES_RESPONSE,\n} from \"constant\";\n\nvar initialState = {\n loading: false,\n templates: [],\n EmailTemplates: [],\n EmailTemplatePlatform: [],\n EmailTemplateVariables: [],\n EmailTemplateActive: null,\n WhatsAppTemplate: [],\n createTemplateRep: null,\n WhatsAppTemplateById: [],\n error: null,\n TemplateResponse: null,\n templateVariables: [],\n AccountVariables: [],\n smsTemplates: [],\n smsTemplateLoading: false,\n fetchingTemplates: false,\n};\n\nconst TemplateReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_TEMPLATES_ACTION_TRIGGER:\n return {\n ...newState,\n action: action.type,\n templates: [],\n loading: true,\n error: null,\n };\n\n case GET_TEMPLATES_ACTION_RESPONSE:\n return {\n ...newState,\n action: action.type,\n templates: action.data,\n loading: false,\n error: null,\n };\n\n case GET_TEMPLATES_ACTION_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n\n case CREATE_TEMPLATES_ACTION_TRIGGER:\n return {\n ...newState,\n action: action.type,\n loading: true,\n error: null,\n };\n\n case CREATE_TEMPLATES_ACTION_RESPONSE:\n return {\n ...newState,\n action: action.type,\n createTemplateRep: action.data,\n loading: false,\n error: null,\n };\n\n case CREATE_TEMPLATES_ACTION_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n\n case EMAIL_TEMPLATES_ACTION_RESPONSE:\n return {\n ...newState,\n action: action.type,\n EmailTemplates: action.data,\n loading: false,\n error: null,\n };\n case EMAIL_TEMPLATES_ACTION_CLEAR:\n return {\n ...newState,\n action: action.type,\n EmailTemplates: [],\n loading: false,\n error: null,\n };\n\n case EMAIL_TEMPLATES_ACTION_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n\n case GET_EMAIL_TEMPLATES_VARIABLES_RESPONSE:\n return {\n ...newState,\n action: action.type,\n EmailTemplateVariables: action.data,\n loading: false,\n error: null,\n };\n\n case TEMPLATE_DETAILS_BY_ID_RESPONSE:\n return {\n ...newState,\n action: action.type,\n EmailTemplateActive: action.data,\n loading: false,\n error: null,\n };\n\n case GET_EMAIL_PLATEFORM_TEMPLATES_RESPONSE:\n return {\n ...newState,\n action: action.type,\n EmailTemplatePlatform: action.data,\n loading: false,\n error: null,\n };\n\n case GET_EMAIL_PLATEFORM_TEMPLATES_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n\n case GET_WHATSAPP_TEMPLATES_TRIGGER:\n return {\n ...newState,\n action: action.type,\n WhatsAppTemplate: [],\n loading: true,\n error: null,\n };\n\n case GET_WHATSAPP_TEMPLATES_RESPONSE:\n return {\n ...newState,\n action: action.type,\n WhatsAppTemplate: action.data,\n loading: false,\n error: null,\n };\n\n case GET_WHATSAPP_TEMPLATES_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n\n case PUT_WHATSAPP_TEMPLATE_RESPONSE:\n case PUT_WHATSAPP_TEMPLATE_ERROR:\n case PUT_WHATSAPP_TEMPLATE_TRIGGER:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n case GET_WHATSAPP_TEMPLATE_BY_ID_TRIGGER:\n return {\n ...newState,\n action: action.type,\n WhatsAppTemplateById: [],\n loading: true,\n error: null,\n };\n case GET_WHATSAPP_TEMPLATE_BY_ID_RESPONSE:\n return {\n ...newState,\n action: action.type,\n WhatsAppTemplateById: action.data,\n loading: false,\n error: null,\n };\n case GET_WHATSAPP_TEMPLATE_BY_ID_ERROR:\n return {\n ...newState,\n action: action.type,\n loading: false,\n error: action.data,\n };\n case IMPORT_TEMPLATE_RESPONSE:\n return {\n ...newState,\n action: action.type,\n TemplateResponse: action.data,\n loading: false,\n error: null,\n };\n case RESET_TEMPLATE_RESPONSE:\n return {\n ...newState,\n action: action.type,\n TemplateResponse: null,\n loading: false,\n error: null,\n };\n case GET_TEMPLATE_VARIABLES_RESPONSE:\n return {\n ...newState,\n action: action.type,\n templateVariables: action.data,\n fetchingTemplates: false,\n loading: false,\n error: null,\n };\n case GET_ACCOUNT_VARIABLES_RESPONSE:\n return {\n ...newState,\n action: action.type,\n AccountVariables: action.data,\n loading: false,\n error: null,\n };\n\n case \"GET_SMS_TEMPLATES_TRIGGER\":\n return {\n ...newState,\n smsTemplates: [],\n smsTemplateLoading: true,\n };\n\n case \"GET_SMS_TEMPLATES_RESPONSE\":\n return {\n ...newState,\n smsTemplates: action.data,\n smsTemplateLoading: false,\n };\n\n case \"GET_SMS_TEMPLATES_ERROR\":\n return {\n ...newState,\n smsTemplates: [],\n smsTemplateLoading: false,\n };\n case \"GET_VARIABLES_TRIGGER\":\n return {\n ...newState,\n fetchingTemplates: true,\n };\n default:\n return newState;\n }\n};\n\nexport default TemplateReducer;\n","import {\n GET_CAMPAIGNS_RESPONSE,\n GET_CAMPAIGNS_TRIGGER,\n GET_CAMPAIGN_BY_ID_RESPONSE,\n GET_CAMPAIGNS_ERROR,\n CAMPAIGN_UPDATE_SIDEBAR,\n CAMPAIGN_UPDATE_DATA,\n WAIT_FOR_CAMPAIGN_RESPONSE,\n GET_CAMPAIGNS_PLANS_RESPONSE,\n GET_CAMPAIGNS_PLAN_STATUS_RESPONSE,\n GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE,\n} from \"constant\";\n\nconst initialState = {\n loading: false,\n CampaignsList: [],\n CampaignById: {},\n DataSider: true,\n UpdateData: {},\n WaitForCampaign: false,\n CampaignPlans: [],\n CampaignPlanStatus: null,\n CampaignStepsConditions: [],\n openSelector: false,\n exportInProgress: false,\n ClonedCampaign: [],\n ClonedLoading: false,\n};\n\nconst CampaignReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_CAMPAIGNS_TRIGGER:\n return {\n ...newState,\n loading: true,\n CampaignsList: [],\n };\n case GET_CAMPAIGNS_RESPONSE:\n return {\n ...newState,\n CampaignsList: action.data,\n loading: false,\n };\n case GET_CAMPAIGN_BY_ID_RESPONSE:\n return {\n ...newState,\n CampaignById: action.data,\n loading: false,\n WaitForCampaign: false,\n };\n case GET_CAMPAIGNS_ERROR:\n return {\n ...newState,\n loading: false,\n WaitForCampaign: false,\n };\n case CAMPAIGN_UPDATE_SIDEBAR:\n return {\n ...newState,\n DataSider: action.data,\n };\n case CAMPAIGN_UPDATE_DATA:\n return {\n ...newState,\n UpdateData: action.data,\n };\n case WAIT_FOR_CAMPAIGN_RESPONSE:\n return {\n ...newState,\n WaitForCampaign: action.data,\n };\n case GET_CAMPAIGNS_PLANS_RESPONSE:\n return {\n ...newState,\n CampaignPlans: action.data,\n };\n case GET_CAMPAIGNS_PLAN_STATUS_RESPONSE:\n return {\n ...newState,\n CampaignPlanStatus: action.data,\n };\n case GET_CAMPAIGNS_STEPS_CONDITIONS_RESPONSE:\n return {\n ...newState,\n CampaignStepsConditions: action.data,\n };\n case \"OPEN_SELECTOR\":\n return {\n ...newState,\n openSelector: action.data,\n };\n case \"EXPORT_WF_PLAN_TRIGGER\":\n return {\n ...newState,\n exportInProgress: true,\n };\n case \"EXPORT_WF_PLAN_ERROR\":\n return {\n ...newState,\n exportInProgress: false,\n };\n\n case \"CLONED_CAMPAIGNS_RESPONSE\":\n return {\n ...newState,\n ClonedCampaign: action.data,\n ClonedLoading: false,\n };\n\n case \"CLONED_CAMPAIGNS_ERROR\":\n return {\n ...newState,\n ClonedCampaign: [],\n ClonedLoading: false,\n };\n\n case \"CLONED_CAMPAIGNS_TRIGGER\":\n return {\n ...newState,\n ClonedCampaign: [],\n ClonedLoading: true,\n };\n\n default:\n return newState;\n }\n};\n\nexport default CampaignReducer;\n","import {\n GET_USER_DETAILS,\n GET_USER_DETAILS_ERROR,\n GET_USER_DETAILS_SUCCESS,\n} from \"constant\";\n\nlet initialState = {\n loading: false,\n error: null,\n user: null,\n};\n\nconst UserProfileReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case GET_USER_DETAILS:\n return {\n ...newState,\n loading: true,\n action: action.type,\n user: null,\n };\n\n case GET_USER_DETAILS_SUCCESS:\n return {\n ...newState,\n loading: false,\n action: action.type,\n user: action.data,\n error: null,\n };\n\n case GET_USER_DETAILS_ERROR:\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n user: null,\n };\n\n default:\n return newState;\n }\n};\n\nexport default UserProfileReducer;\n","import {\n SUPPORTED_LANGUAGES,\n POSTAL_CODE,\n STEP_ONE_DATA,\n UNVERIFIED_USER,\n} from \"constant\";\n\nvar initialState = {\n supportedLanguage: [],\n postalCode: null,\n stepOne: null,\n unverified: false,\n Waiting: false,\n};\n\nconst SignUpReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case SUPPORTED_LANGUAGES:\n return {\n ...newState,\n supportedLanguage: action.data,\n };\n\n case POSTAL_CODE:\n return {\n ...newState,\n postalCode: action.data,\n };\n\n case STEP_ONE_DATA:\n return {\n ...newState,\n stepOne: action.data,\n };\n\n case UNVERIFIED_USER:\n return {\n ...newState,\n unverified: action.data,\n };\n\n case \"WAITING\":\n return {\n ...newState,\n Waiting: action.data,\n };\n\n default:\n return newState;\n }\n};\n\nexport default SignUpReducer;\n","import {\n GET_SUBSCRIPTIONS_TRIGGER,\n GET_SUBSCRIPTIONS_RESPONSE,\n GET_SUBSCRIPTIONS_ERROR,\n} from \"constant\";\n\nconst initialState = {\n loading: false,\n error: null,\n Plans: [],\n pageDetailsUpdating: false,\n pageDetailsLoading: false,\n pageDetails: [],\n};\nconst SubscriptionReducer = (state = initialState, action) => {\n switch (action.type) {\n case GET_SUBSCRIPTIONS_TRIGGER:\n return { ...state, loading: true, action: action.type };\n case GET_SUBSCRIPTIONS_RESPONSE:\n return {\n ...state,\n loading: false,\n Plans: action.data,\n action: action.type,\n useAgency: action.orgSettings,\n useAgencyLoading: false,\n };\n case GET_SUBSCRIPTIONS_ERROR:\n return { ...state, loading: false, error: action.error };\n case \"UPDATE_PAGE_DETAILS_TRIGGER\":\n return { ...state, pageDetailsUpdating: true };\n case \"UPDATE_PAGE_DETAILS_SUCCESS\":\n return { ...state, pageDetailsUpdating: false };\n case \"UPDATE_PAGE_DETAILS_ERROR\":\n return { ...state, pageDetailsUpdating: false };\n case \"GET_PAGE_DETAILS_TRIGGER\":\n return { ...state, pageDetailsLoading: true };\n case \"GET_PAGE_DETAILS_SUCCESS\":\n return { ...state, pageDetailsLoading: false, pageDetails: action.data };\n case \"GET_PAGE_DETAILS_ERROR\":\n return { ...state, pageDetailsLoading: false };\n case \"GET_ORG_PAGE_SETTINGS_RESPONSE\":\n return { ...state, useAgency: action.data, useAgencyLoading: false };\n case \"GET_ORG_PAGE_SETTINGS_TRIGGER\":\n return { ...state, useAgencyLoading: true };\n case \"GET_ORG_PAGE_SETTINGS_ERROR\":\n return { ...state, useAgencyLoading: false };\n default:\n return state;\n }\n};\n\nexport default SubscriptionReducer;\n","import {\n SET_OPENING_TAB,\n SET_OPENING_SIDEBAR_VIEW,\n SET_OPENING_SIDEBAR_DATA,\n GET_OPEN_POSITIONS_TRIGGER,\n GET_OPEN_POSITIONS_RESPONSE,\n GET_OPEN_POSITIONS_ERROR,\n GET_ALL_CANDIDATES_BY_POSITION_TRIGGER,\n GET_ALL_CANDIDATES_BY_POSITION_RESPONSE,\n GET_ALL_CANDIDATES_BY_POSITION_ERROR,\n GET_ALL_COMPANIES_TRIGGER,\n GET_ALL_COMPANIES_RESPONSE,\n GET_ALL_COMPANIES_ERROR,\n GET_CANDIDATE_STAGE_TRIGGER,\n GET_CANDIDATE_STAGE_RESPONSE,\n GET_CANDIDATE_STAGE_ERROR,\n} from \"constant\";\n\nlet initialState = {\n loading: false,\n openingLoading: false,\n siderTab: null,\n siderViewClosed: true,\n siderData: null,\n openPositions: [],\n allCandidatesByPosition: [],\n allCompanies: [],\n candidateFilterStage: [],\n candidateLoading: false,\n ActiveStage: null,\n MatrixLoading: false,\n MatrixData: null,\n linkPreview: null,\n linkPreviewLoading: false,\n CandidateActivityLoading: false,\n CandidateActivity: null,\n CandidateActivityCustomLoading: false,\n CandidateActivityCustom: null,\n updateLoading: false,\n loadingIndex: null,\n workFlowCheck: [],\n openPositionData: null,\n tempOpeningData: null,\n clonedWorkflow: true,\n WFCA: null,\n CandidateEngagementLoading: false,\n CandidateEngagement: null,\n sqHistoryLoading: false,\n sqHistory: [],\n stageNextSqLoading: false,\n stageNextSq: [],\n AttachmentLoading: false,\n Attachments: [],\n creatingCompany: false,\n CommentLoading: false,\n CommentData: [],\n CommentAdding: false,\n ActiveAgentFilter: null,\n ArchivedType: \"Active\",\n interViewSlots: [],\n interviewSlotLoading: false,\n CandidateRecordUpdating: false,\n MessageWidget: false,\n BulkOpeningsCaLoading: false,\n BulkOpeningsCA: [],\n activeOpeningsForCandidate: [],\n loadingOpeningsForCandidate: false,\n activeContactOpening: null,\n acoLoading: false,\n candidateImporting: false,\n};\nconst OpeningReducer = (state = initialState, action) => {\n let newState = { ...state };\n switch (action.type) {\n case SET_OPENING_TAB:\n return {\n ...state,\n siderTab: action.data,\n action: action.type,\n };\n case SET_OPENING_SIDEBAR_VIEW:\n return {\n ...state,\n siderViewClosed: action.data,\n action: action.type,\n };\n case SET_OPENING_SIDEBAR_DATA:\n return {\n ...state,\n siderData: action.data,\n action: action.type,\n };\n case GET_OPEN_POSITIONS_TRIGGER:\n return {\n ...state,\n openingLoading: true,\n loading: true,\n action: action.type,\n openPositions: [],\n };\n case GET_OPEN_POSITIONS_RESPONSE:\n return {\n ...state,\n openingLoading: false,\n loading: false,\n openPositions: action.data,\n action: action.type,\n };\n case GET_OPEN_POSITIONS_ERROR:\n return {\n ...state,\n openingLoading: false,\n loading: false,\n action: action.type,\n };\n case GET_ALL_CANDIDATES_BY_POSITION_TRIGGER:\n return {\n ...state,\n candidateLoading: true,\n loading: true,\n action: action.type,\n };\n case GET_ALL_CANDIDATES_BY_POSITION_RESPONSE:\n return {\n ...state,\n loading: false,\n candidateLoading: false,\n allCandidatesByPosition: action.data,\n updateLoading: false,\n action: action.type,\n };\n case GET_ALL_CANDIDATES_BY_POSITION_ERROR:\n return {\n ...state,\n candidateLoading: false,\n loading: false,\n updateLoading: false,\n action: action.type,\n };\n case GET_ALL_COMPANIES_TRIGGER:\n return {\n ...state,\n loading: true,\n action: action.type,\n };\n case GET_ALL_COMPANIES_RESPONSE:\n return {\n ...state,\n loading: false,\n allCompanies: action.data,\n creatingCompany: false,\n action: action.type,\n };\n case GET_ALL_COMPANIES_ERROR:\n return {\n ...state,\n loading: false,\n action: action.type,\n };\n case GET_CANDIDATE_STAGE_TRIGGER:\n return {\n ...state,\n candidateLoading: true,\n MatrixLoading: true,\n action: action.type,\n };\n case GET_CANDIDATE_STAGE_RESPONSE:\n return {\n ...state,\n candidateLoading: false,\n candidateFilterStage: action.data,\n action: action.type,\n };\n case GET_CANDIDATE_STAGE_ERROR:\n return {\n ...state,\n candidateLoading: false,\n action: action.type,\n };\n case \"SET_ACTIVE_STAGE\":\n return {\n ...state,\n ActiveStage: action.data,\n action: action.type,\n };\n case \"RESPONSE_MATRIX_BY_OPENING_IDS\":\n return {\n ...state,\n MatrixLoading: false,\n MatrixData: action.data,\n action: action.type,\n };\n case \"GET_LINK_PREVIEW\":\n return {\n ...state,\n loadingIndex: action.data,\n linkPreviewLoading: true,\n action: action.type,\n };\n case \"RESPONSE_LINK_PREVIEW\":\n return {\n ...state,\n linkPreviewLoading: false,\n linkPreview: action.data,\n action: action.type,\n };\n case \"GET_CANDIDATE_ACTIVITY\":\n return {\n ...state,\n CandidateActivityLoading: true,\n action: action.type,\n };\n case \"RESPONSE_CANDIDATE_ACTIVITY\":\n return {\n ...state,\n CandidateActivityLoading: false,\n CandidateActivity: action.data,\n action: action.type,\n };\n case \"GET_CANDIDATE_CUSTOM_ACTIVITY\":\n return {\n ...state,\n CandidateActivityCustomLoading: true,\n action: action.type,\n };\n case \"RESPONSE_CANDIDATE_CUSTOM_ACTIVITY\":\n return {\n ...state,\n CandidateActivityCustomLoading: false,\n CandidateActivityCustom: action.data,\n action: action.type,\n };\n case \"UPDATE_CANDIDATE_DETAILS\":\n return {\n ...newState,\n updateLoading: true,\n };\n case \"ERROR_UPDATE_CANDIDATE_DETAILS\":\n return {\n ...newState,\n updateLoading: false,\n };\n case \"ADD_CANDIDATE_TO_FLOW_CHECK\":\n return {\n ...newState,\n workFlowCheck: action.data,\n action: action.type,\n };\n case \"ERROR_ADD_CANDIDATE_TO_FLOW_CHECK\":\n return {\n ...newState,\n action: action.type,\n workFlowCheck: [],\n };\n case \"CANDIDATE_ADDED_TO_FLOW\":\n return {\n ...newState,\n action: action.type,\n };\n case \"CANDIDATE_ADDED_TO_FLOW_CLOSED\":\n return {\n ...newState,\n action: action.type,\n };\n case \"POSITION_DATA_RESPONSE\":\n return {\n ...newState,\n openPositionData: action?.data?.data,\n tempOpeningData: action?.data?.data,\n action: action.type,\n };\n case \"POSITION_DATA_ERROR\":\n return {\n ...newState,\n openPositionData: action.data,\n action: action.type,\n };\n case \"RESPONSE_CLONE_WORKFLOW\":\n return {\n ...newState,\n action: action.type,\n openPositionData: null,\n };\n case \"RESPONSE_CLONE_ERROR\":\n return {\n ...newState,\n action: action.type,\n openPositionData: null,\n };\n case \"RESPONSE_GET_WORKFLOW_CA_BY_OPENING\":\n return {\n ...newState,\n WFCA: action.data,\n action: action.type,\n };\n case \"UPDATE_CANDIDATE_DETAILS_RESPONSE_ACTIVE\":\n return {\n ...newState,\n updateLoading: false,\n action: action.type,\n };\n case \"GET_CANDIDATE_ENGAGEMENT_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n CandidateEngagementLoading: true,\n };\n case \"RESPONSE_GET_CANDIDATE_ENGAGEMENT\":\n return {\n ...newState,\n action: action.type,\n CandidateEngagement: action.data,\n CandidateEngagementLoading: false,\n };\n case \"GET_SEQUENCE_HISTORY_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n sqHistoryLoading: true,\n sqHistory: [],\n };\n case \"GET_SEQUENCE_HISTORY_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n sqHistoryLoading: false,\n sqHistory: action.data,\n };\n case \"CHECK_NEXT_STAGE_SEQUENCE_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n stageNextSqLoading: true,\n stageNextSq: [],\n };\n case \"CHECK_NEXT_STAGE_SEQUENCE_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n stageNextSqLoading: false,\n stageNextSq: action.data,\n };\n case \"GET_CANDIDATE_ATTACHMENTS_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n AttachmentLoading: true,\n Attachments: [],\n };\n case \"GET_CANDIDATE_ATTACHMENTS_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n AttachmentLoading: false,\n Attachments: action.data,\n };\n case \"STOP_LOADING_CANDIDATE\":\n return {\n ...state,\n loading: false,\n candidateLoading: false,\n updateLoading: false,\n action: action.type,\n };\n case \"UPDATE_CANDIDATE_DETAILS_WIDGET\":\n let tempS = newState;\n const Candidate = tempS.allCandidatesByPosition.data.map((item) => {\n if (!item.custom) {\n item.custom = {};\n }\n if (item.contactId === action.data.id) {\n let ud = action.data.data;\n let temp = item;\n let { opening, custom, employment, ...rest } = ud.candidate;\n if (ud && ud.data && Object.keys(ud.data).length > 0) {\n Object.keys(ud.data).forEach((key) => {\n temp.profile.data[key] = ud.data[key];\n });\n }\n if (\n ud &&\n ud?.candidate?.custom &&\n Object.keys(ud?.candidate?.custom).length > 0\n ) {\n Object.keys(ud?.candidate?.custom).forEach((key) => {\n temp.custom[key] = ud?.candidate?.custom[key];\n });\n }\n if (ud && ud?.candidate?.employment) {\n temp.employment = [\n {\n ...temp?.employment[0],\n ...ud?.candidate?.employment[0],\n designation:\n ud?.candidate?.employment[0]?.designation ||\n temp?.employment[0]?.designation,\n orgName:\n ud?.candidate?.employment[0]?.orgName ||\n temp?.employment[0]?.orgName,\n },\n ];\n }\n if (rest && Object.keys(rest).length > 0) {\n Object.keys(rest).forEach((key) => {\n temp[key] = rest[key];\n });\n }\n if (ud && ud.tags) {\n temp.profile.tags = ud.tags ?? [];\n }\n if (ud && ud.source) {\n temp.profile.source = ud.source ?? \"\";\n }\n return temp;\n } else {\n return item;\n }\n });\n let updatedData = {\n ...tempS.allCandidatesByPosition,\n data: Candidate,\n };\n return {\n ...state,\n updateLoading: false,\n allCandidatesByPosition: updatedData,\n action: action.type,\n };\n case \"CREATE_COMPANY_LINKEDIN_TRIGGER\":\n return {\n ...state,\n creatingCompany: true,\n action: action.type,\n };\n case \"UPDATE_CONTACT_ACTION_RESPONSE\":\n case \"UPDATE_CONTACT_DETAILS_WIDGET\":\n return {\n ...newState,\n ...state,\n updateLoading: false,\n action: action.type,\n error: null,\n };\n case \"GET_COMMENTS_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n CommentLoading: true,\n CommentData: [],\n };\n case \"GET_COMMENTS_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n CommentLoading: false,\n CommentData: action.data,\n CommentAdding: false,\n };\n case \"GET_COMMENTS_ERROR\":\n return {\n ...newState,\n action: action.type,\n CommentLoading: false,\n };\n\n case \"ADD_COMMENT_TRIGGER\":\n return {\n ...newState,\n action: action.type,\n CommentAdding: true,\n CommentData: [],\n };\n case \"ADD_COMMENT_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n CommentAdding: false,\n };\n case \"ADD_COMMENT_ERROR\":\n return {\n ...newState,\n action: action.type,\n CommentAdding: false,\n };\n case \"ACTIVE_AGENT_FILTER\":\n return {\n ...newState,\n ActiveAgentFilter: action.data,\n };\n case \"SET_ARCHIVED_TYPE\":\n return {\n ...newState,\n ArchivedType: action.data,\n };\n case \"INTERVIEW_SLOT_LOADING\":\n return {\n ...newState,\n interviewSlotLoading: true,\n };\n case \"INTERVIEW_SLOT_RESPONSE\":\n return {\n ...newState,\n interviewSlotLoading: false,\n interViewSlots: action.data,\n };\n case \"CANDIDATE_RECORD_UPDATING\":\n return {\n ...newState,\n CandidateRecordUpdating: action.data,\n };\n case \"MESSAGE_WIDGET\":\n return {\n ...newState,\n MessageWidget: action.data,\n };\n\n case \"TRIGGER_GET_CHANNEL_ACCOUNTS_BULK\":\n return {\n ...newState,\n BulkOpeningsCaLoading: true,\n BulkOpeningsCA: [],\n };\n\n case \"RESPONSE_GET_CHANNEL_ACCOUNTS_BULK\":\n return {\n ...newState,\n BulkOpeningsCaLoading: false,\n BulkOpeningsCA: action.data,\n };\n case \"GET_OPENINGS_FOR_CANDIDATE\":\n return {\n ...newState,\n action: action.type,\n loadingOpeningsForCandidate: true,\n };\n case \"GET_OPENINGS_FOR_CANDIDATE_RESPONSE\":\n return {\n ...newState,\n action: action.type,\n activeOpeningsForCandidate: action.data,\n loadingOpeningsForCandidate: false,\n };\n case \"GET_OPENINGS_FOR_CANDIDATE_RESPONSE_ERROR\":\n return {\n ...newState,\n action: action.type,\n activeOpeningsForCandidate: [],\n loadingOpeningsForCandidate: false,\n };\n case \"SET_ACTIVE_CONTACT_OPENING\":\n return {\n ...newState,\n activeContactOpening: action.data,\n acoLoading: false,\n };\n case \"SET_ACTIVE_CONTACT_OPENING_LOADING\":\n return {\n ...newState,\n activeContactOpening: null,\n acoLoading: true,\n };\n\n case \"CANDIDATE_IMPORTING\":\n return {\n ...newState,\n candidateImporting: true,\n };\n case \"CANDIDATE_IMPORTING_RESPONSE\":\n return {\n ...newState,\n candidateImporting: false,\n };\n default:\n return state;\n }\n};\n\nexport default OpeningReducer;\n","let initialState = {\n loading: false,\n error: null,\n accountVariablesDefinition: [],\n openingAccountVariables: [],\n};\n\nconst AccountVariablesDefinitionReducer = (state = initialState, action) => {\n let newState = { ...state };\n\n switch (action.type) {\n case \"GET_ACCOUNT_VARIABLES_DEFINITION_ACTION_TRIGGER\":\n return {\n ...newState,\n loading: true,\n action: action.type,\n accountVariablesDefinition: [],\n };\n\n case \"ACCOUNT_VARIABLES_DEFINITION_ACTION_RESPONSE\":\n return {\n ...newState,\n loading: false,\n action: action.type,\n accountVariablesDefinition: action.data,\n error: null,\n };\n\n case \"ACCOUNT_VARIABLES_DEFINITION_ACTION_ERROR\":\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n accountVariablesDefinition: [],\n };\n\n case \"GET_ACCOUNT_VARIABLES_OPENING_TRIGGER\":\n return {\n ...newState,\n loading: true,\n action: action.type,\n openingAccountVariables: [],\n };\n\n case \"ACCOUNT_VARIABLES_OPENING_RESPONSE\":\n return {\n ...newState,\n loading: false,\n action: action.type,\n openingAccountVariables: action.data,\n error: null,\n };\n\n case \"ACCOUNT_VARIABLES_OPENING_ERROR\":\n return {\n ...newState,\n loading: false,\n action: action.type,\n error: action.data,\n openingAccountVariables: [],\n };\n\n default:\n return newState;\n }\n};\n\nexport default AccountVariablesDefinitionReducer;\n","let initialState = {\n convUnreadNotif: [],\n sideBarNotif: {},\n stageMetricNotif: [],\n CandidateCardCount: [],\n candidateViewed: null,\n actionType: null,\n};\n\nconst updateStageMetricNotif = (state, openingId, stageId, count) => {\n return state.stageMetricNotif.map((opening) =>\n opening.openingId === openingId\n ? {\n ...opening,\n stages: opening.stages.map((stage) =>\n stage.stageId === stageId ? { ...stage, count } : stage\n ),\n }\n : opening\n );\n};\n\nconst NotificationReducer = (state = initialState, action) => {\n switch (action.type) {\n case \"CONV_UNREAD_NOTIF\":\n return {\n ...state,\n convUnreadNotif: action.data,\n };\n case \"SIDEBAR_NOTIF\":\n return {\n ...state,\n sideBarNotif: action.data,\n };\n case \"STAGE_METRIC_NOTIF\":\n return {\n ...state,\n stageMetricNotif: action.data,\n };\n case \"MARK_READ_NOTIF\": {\n const { opening_id, stage_id } = action.data;\n const openingToUpdate = state.stageMetricNotif.find(\n (opening) => opening.openingId === opening_id\n );\n const stageToUpdate = openingToUpdate?.stages.find(\n (stage) => stage.stageId === stage_id\n );\n const decrementCount = stageToUpdate ? stageToUpdate.count : 0;\n\n return {\n ...state,\n sideBarNotif: {\n ...state.sideBarNotif,\n openingCount: state.sideBarNotif.openingCount - decrementCount,\n },\n stageMetricNotif: updateStageMetricNotif(\n state,\n opening_id,\n stage_id,\n 0\n ),\n };\n }\n case \"ADD_NOTIF_COUNT_STAGE_CHANGE\": {\n const { opening_idSC, stage_idSC } = action.data;\n const openingToUpdateSC = state.stageMetricNotif.find(\n (opening) => opening.openingId === opening_idSC\n );\n const stageToUpdateSC = openingToUpdateSC?.stages.find(\n (stage) => stage.stageId === stage_idSC\n );\n const StageCount = stageToUpdateSC ? stageToUpdateSC.count : 0;\n return {\n ...state,\n sideBarNotif: {\n ...state.sideBarNotif,\n openingCount: state.sideBarNotif.openingCount + 1,\n },\n stageMetricNotif: updateStageMetricNotif(\n state,\n opening_idSC,\n stage_idSC,\n StageCount + 1\n ),\n };\n }\n case \"ADD_MESSAGE_COUNT\": {\n let temp = [...state.convUnreadNotif];\n let findIndex = temp.findIndex(\n (notification) => notification.convId === action.data.convId\n );\n if (findIndex !== -1) {\n temp[findIndex].md = {\n ...temp[findIndex].md,\n [action.data.md]: temp[findIndex].md[action.data.md]\n ? temp[findIndex].md[action.data.md] + 1\n : 1,\n };\n } else {\n temp.push({\n convId: action.data.convId,\n md: {\n [action.data.md]: 1,\n },\n });\n }\n return {\n ...state,\n convUnreadNotif: temp,\n sideBarNotif: {\n ...state.sideBarNotif,\n inboxCount: state.sideBarNotif.inboxCount + 1,\n },\n };\n }\n case \"CONTACT_MESSAGE_COUNT_FOR_OPENING_CARD\": {\n return {\n ...state,\n CandidateCardCount: action.data,\n };\n }\n case \"MARK_READ_NOTIF_MESSAGE\": {\n let temp = [...state.convUnreadNotif];\n let findIndex = temp.findIndex(\n (notification) => notification.convId === action.data.conv_id\n );\n let totalCount = 0;\n if (findIndex !== -1) {\n let emailCount = state.convUnreadNotif[findIndex].md.email || 0;\n let whatsappCount = state.convUnreadNotif[findIndex].md.whatsapp || 0;\n totalCount = emailCount + whatsappCount;\n temp.splice(findIndex, 1);\n }\n let tempCandidateCardCount = [...state.CandidateCardCount];\n let findIndexCandidateCardCount = tempCandidateCardCount.findIndex(\n (notification) => notification.convId === action.data.conv_id\n );\n if (findIndexCandidateCardCount !== -1) {\n let emailCount =\n state.CandidateCardCount[findIndexCandidateCardCount].counts.email ||\n 0;\n let whatsappCount =\n state.CandidateCardCount[findIndexCandidateCardCount].counts\n .whatsapp || 0;\n tempCandidateCardCount.splice(findIndexCandidateCardCount, 1);\n totalCount = emailCount + whatsappCount;\n }\n return {\n ...state,\n CandidateCardCount: tempCandidateCardCount,\n convUnreadNotif: temp,\n sideBarNotif: {\n ...state.sideBarNotif,\n inboxCount: state.sideBarNotif.inboxCount - totalCount,\n },\n };\n }\n case \"CANDIDATE_VIEWED\":\n return {\n ...state,\n candidateViewed: action.data,\n actionType: action.type,\n };\n case \"CANDIDATE_VIEW_TRIGGER\":\n return {\n ...state,\n actionType: action.type,\n };\n default:\n return state;\n }\n};\n\nexport default NotificationReducer;\n","import { combineReducers } from \"redux\";\n\nimport dittoAdminReducer from \"./dittoAdminReducer\";\nimport ContentReducer from \"./ContentReducer\";\nimport FaqReducer from \"./FaqReducer\";\nimport TagReducer from \"./TagReducer\";\nimport ConvReducer from \"./ConvReducer\";\nimport MessageReducer from \"./MessageReducer\";\nimport CallReducer from \"./CallReducer\";\nimport TaskBoardReducer from \"./TaskBoardReducer\";\nimport AgentReducer from \"./AgentReducer\";\nimport ContactReducer from \"./ContactReducer\";\nimport FileReducer from \"./FileReducer\";\nimport WrokbenchReducer from \"./WorkbenchReducer\";\nimport TenantReducer from \"./TenantReducer\";\nimport BotAiReducer from \"./BotAiReducer\";\nimport AdminReducer from \"./AdminReducer\";\nimport AppReducer from \"./AppReducer\";\nimport DashboardReducer from \"./DashboardReducer\";\nimport PaymentReducer from \"./PaymentReducer\";\nimport ItemReducer from \"./ItemReducer\";\nimport IntegrationAccountReducer from \"./IntegrationAccountReducer\";\nimport TemplateReducer from \"./TemplateReducer\";\nimport CampaignReducer from \"./CampaignReducer\";\nimport UserProfileReducer from \"./UserProfileReducer\";\nimport SignUpReducer from \"./SignUpReducer\";\nimport SubscriptionReducer from \"./SubscriptionReducer\";\nimport OpeningReducer from \"./OpeningReducer\";\nimport AccountVariablesDefinitionReducer from \"./AccountVariablesDefinition\";\nimport NotificationReducer from \"./NotificationReducer\";\n\nconst appReducer = combineReducers({\n dittoAdminReducer,\n ContentReducer,\n FaqReducer,\n TagReducer,\n ConvReducer,\n MessageReducer,\n CallReducer,\n AppReducer,\n TaskBoardReducer,\n AgentReducer,\n ContactReducer,\n FileReducer,\n WrokbenchReducer,\n TenantReducer,\n BotAiReducer,\n AdminReducer,\n DashboardReducer,\n PaymentReducer,\n ItemReducer,\n IntegrationAccountReducer,\n TemplateReducer,\n CampaignReducer,\n UserProfileReducer,\n SignUpReducer,\n SubscriptionReducer,\n OpeningReducer,\n AccountVariablesDefinitionReducer,\n NotificationReducer,\n});\n\nconst rootReducer = (state, action) => {\n if (action.type === \"LOGOUT_ACTION_TRIGGER\") {\n return appReducer(undefined, action);\n }\n return appReducer(state, action);\n};\nexport default rootReducer;\n","import { createStore, applyMiddleware } from \"redux\";\nimport { createLogger } from \"redux-logger\";\n// import { composeWithDevTools } from \"redux-devtools-extension\";\nimport { composeWithDevTools } from \"@redux-devtools/extension\";\nimport thunk from \"redux-thunk\";\nimport { persistStore, persistReducer } from \"redux-persist\";\nimport hardSet from \"redux-persist/lib/stateReconciler/hardSet\";\nimport storage from \"redux-persist/lib/storage\";\n\nimport rootReducer from \"reducer\";\n\nconst LOCAL_STORAGE_NAME = \"ditto-admin\";\n\nconst persistConfig = {\n key: LOCAL_STORAGE_NAME,\n storage: storage,\n stateReconciler: hardSet,\n};\n\nconst persistedReducer = persistReducer(persistConfig, rootReducer);\n\nconst store = createStore(\n persistedReducer,\n composeWithDevTools(\n process.env.REACT_APP_NODE_ENV === \"production\"\n ? applyMiddleware(thunk)\n : applyMiddleware(thunk, createLogger())\n )\n);\n\nconst persistor = persistStore(store);\npersistor.pause();\n\nexport { store, persistor };\n","import { createBrowserHistory } from \"history\";\nexport default createBrowserHistory({});\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n }\n else\n strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain)\n strm.ondrain(dat[0]);\n }\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n if (flush) {\n strm.flush = function () { w.postMessage([]); };\n }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o)\n : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain)\n _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this.d & 1))\n return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c)\n _this.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","export var globalObject = (function() {\n return \"undefined\" !== typeof window\n ? window\n : \"undefined\" !== typeof global\n ? global\n : \"undefined\" !== typeof self\n ? self\n : this;\n})();\n","import { globalObject } from \"./globalObject.js\";\n\nfunction consoleLog() {\n if (globalObject.console && typeof globalObject.console.log === \"function\") {\n globalObject.console.log.apply(globalObject.console, arguments);\n }\n}\n\nfunction consoleWarn(str) {\n if (globalObject.console) {\n if (typeof globalObject.console.warn === \"function\") {\n globalObject.console.warn.apply(globalObject.console, arguments);\n } else {\n consoleLog.call(null, arguments);\n }\n }\n}\n\nfunction consoleError(str) {\n if (globalObject.console) {\n if (typeof globalObject.console.error === \"function\") {\n globalObject.console.error.apply(globalObject.console, arguments);\n } else {\n consoleLog(str);\n }\n }\n}\nexport var console = {\n log: consoleLog,\n warn: consoleWarn,\n error: consoleError\n};\n","/**\n * @license\n * FileSaver.js\n * A saveAs() FileSaver implementation.\n *\n * By Eli Grey, http://eligrey.com\n *\n * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)\n * source : http://purl.eligrey.com/github/FileSaver.js\n */\n\nimport { globalObject as _global } from \"./globalObject.js\";\nimport { console } from \"./console.js\";\n\nfunction bom(blob, opts) {\n if (typeof opts === \"undefined\") opts = { autoBom: false };\n else if (typeof opts !== \"object\") {\n console.warn(\"Deprecated: Expected third argument to be a object\");\n opts = { autoBom: !opts };\n }\n\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (\n opts.autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(\n blob.type\n )\n ) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\n\nfunction download(url, name, opts) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.responseType = \"blob\";\n xhr.onload = function() {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function() {\n console.error(\"could not download file\");\n };\n xhr.send();\n}\n\nfunction corsEnabled(url) {\n var xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open(\"HEAD\", url, false);\n try {\n xhr.send();\n } catch (e) {}\n return xhr.status >= 200 && xhr.status <= 299;\n}\n\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent(\"click\"));\n } catch (e) {\n var evt = document.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\n \"click\",\n true,\n true,\n window,\n 0,\n 0,\n 0,\n 80,\n 20,\n false,\n false,\n false,\n false,\n 0,\n null\n );\n node.dispatchEvent(evt);\n }\n}\n\nvar saveAs =\n _global.saveAs ||\n // probably in some web worker\n (typeof window !== \"object\" || window !== _global\n ? function saveAs() {\n /* noop */\n }\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app\n typeof HTMLAnchorElement !== \"undefined\" &&\n \"download\" in HTMLAnchorElement.prototype\n ? function saveAs(blob, name, opts) {\n var URL = _global.URL || _global.webkitURL;\n var a = document.createElement(\"a\");\n name = name || blob.name || \"download\";\n\n a.download = name;\n a.rel = \"noopener\"; // tabnabbing\n\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n\n if (typeof blob === \"string\") {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n corsEnabled(a.href)\n ? download(blob, name, opts)\n : click(a, (a.target = \"_blank\"));\n } else {\n click(a);\n }\n } else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function() {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function() {\n click(a);\n }, 0);\n }\n }\n : // Use msSaveOrOpenBlob as a second approach\n \"msSaveOrOpenBlob\" in navigator\n ? function saveAs(blob, name, opts) {\n name = name || blob.name || \"download\";\n\n if (typeof blob === \"string\") {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n } else {\n var a = document.createElement(\"a\");\n a.href = blob;\n a.target = \"_blank\";\n setTimeout(function() {\n click(a);\n });\n }\n } else {\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n }\n : // Fallback to using FileReader and a popup\n function saveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open(\"\", \"_blank\");\n if (popup) {\n popup.document.title = popup.document.body.innerText =\n \"downloading...\";\n }\n\n if (typeof blob === \"string\") return download(blob, name, opts);\n\n var force = blob.type === \"application/octet-stream\";\n var isSafari =\n /constructor/i.test(_global.HTMLElement) || _global.safari;\n var isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n\n if (\n (isChromeIOS || (force && isSafari)) &&\n typeof FileReader === \"object\"\n ) {\n // Safari doesn't allow downloading of blob URLs\n var reader = new FileReader();\n reader.onloadend = function() {\n var url = reader.result;\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, \"data:attachment/file;\");\n if (popup) popup.location.href = url;\n else location = url;\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n } else {\n var URL = _global.URL || _global.webkitURL;\n var url = URL.createObjectURL(blob);\n if (popup) popup.location = url;\n else location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function() {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n });\n\nexport { saveAs };\n","import { globalObject } from \"./globalObject.js\";\n\nvar atob, btoa;\n\n(function() {\n atob = globalObject.atob.bind(globalObject);\n btoa = globalObject.btoa.bind(globalObject);\n return;\n\n})();\n\nexport { atob, btoa };\n","/**\n * A class to parse color values\n * @author Stoyan Stefanov \n * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}\n * @license Use it if you like it\n */\n\nfunction RGBColor(color_string) {\n color_string = color_string || \"\";\n this.ok = false;\n\n // strip any leading #\n if (color_string.charAt(0) == \"#\") {\n // remove # if any\n color_string = color_string.substr(1, 6);\n }\n\n color_string = color_string.replace(/ /g, \"\");\n color_string = color_string.toLowerCase();\n\n var channels;\n\n // before getting into regexps, try simple matches\n // and overwrite the input\n var simple_colors = {\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 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 darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dodgerblue: \"1e90ff\",\n feldspar: \"d19275\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"ff00ff\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgrey: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslateblue: \"8470ff\",\n lightslategray: \"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: \"9370d8\",\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: \"d87093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\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 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 violetred: \"d02090\",\n wheat: \"f5deb3\",\n white: \"ffffff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ffff00\",\n yellowgreen: \"9acd32\"\n };\n color_string = simple_colors[color_string] || color_string;\n\n // array of color definition objects\n var color_defs = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n example: [\"rgb(123, 234, 45)\", \"rgb(255,234,245)\"],\n process: function(bits) {\n return [parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3])];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n example: [\"#00ff00\", \"336699\"],\n process: function(bits) {\n return [\n parseInt(bits[1], 16),\n parseInt(bits[2], 16),\n parseInt(bits[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n example: [\"#fb0\", \"f0f\"],\n process: function(bits) {\n return [\n parseInt(bits[1] + bits[1], 16),\n parseInt(bits[2] + bits[2], 16),\n parseInt(bits[3] + bits[3], 16)\n ];\n }\n }\n ];\n\n // search through the definitions to find a match\n for (var i = 0; i < color_defs.length; i++) {\n var re = color_defs[i].re;\n var processor = color_defs[i].process;\n var bits = re.exec(color_string);\n if (bits) {\n channels = processor(bits);\n this.r = channels[0];\n this.g = channels[1];\n this.b = channels[2];\n this.ok = true;\n }\n }\n\n // validate/cleanup values\n this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;\n this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;\n this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;\n\n // some getters\n this.toRGB = function() {\n return \"rgb(\" + this.r + \", \" + this.g + \", \" + this.b + \")\";\n };\n this.toHex = function() {\n var r = this.r.toString(16);\n var g = this.g.toString(16);\n var b = this.b.toString(16);\n if (r.length == 1) r = \"0\" + r;\n if (g.length == 1) g = \"0\" + g;\n if (b.length == 1) b = \"0\" + b;\n return \"#\" + r + g + b;\n };\n}\n\nexport { RGBColor };\n","/**\n * @license\n * Joseph Myers does not specify a particular license for his work.\n *\n * Author: Joseph Myers\n * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js\n *\n * Modified by: Owen Leong\n */\n\nfunction md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a = ff(a, b, c, d, k[0], 7, -680876936);\n d = ff(d, a, b, c, k[1], 12, -389564586);\n c = ff(c, d, a, b, k[2], 17, 606105819);\n b = ff(b, c, d, a, k[3], 22, -1044525330);\n a = ff(a, b, c, d, k[4], 7, -176418897);\n d = ff(d, a, b, c, k[5], 12, 1200080426);\n c = ff(c, d, a, b, k[6], 17, -1473231341);\n b = ff(b, c, d, a, k[7], 22, -45705983);\n a = ff(a, b, c, d, k[8], 7, 1770035416);\n d = ff(d, a, b, c, k[9], 12, -1958414417);\n c = ff(c, d, a, b, k[10], 17, -42063);\n b = ff(b, c, d, a, k[11], 22, -1990404162);\n a = ff(a, b, c, d, k[12], 7, 1804603682);\n d = ff(d, a, b, c, k[13], 12, -40341101);\n c = ff(c, d, a, b, k[14], 17, -1502002290);\n b = ff(b, c, d, a, k[15], 22, 1236535329);\n\n a = gg(a, b, c, d, k[1], 5, -165796510);\n d = gg(d, a, b, c, k[6], 9, -1069501632);\n c = gg(c, d, a, b, k[11], 14, 643717713);\n b = gg(b, c, d, a, k[0], 20, -373897302);\n a = gg(a, b, c, d, k[5], 5, -701558691);\n d = gg(d, a, b, c, k[10], 9, 38016083);\n c = gg(c, d, a, b, k[15], 14, -660478335);\n b = gg(b, c, d, a, k[4], 20, -405537848);\n a = gg(a, b, c, d, k[9], 5, 568446438);\n d = gg(d, a, b, c, k[14], 9, -1019803690);\n c = gg(c, d, a, b, k[3], 14, -187363961);\n b = gg(b, c, d, a, k[8], 20, 1163531501);\n a = gg(a, b, c, d, k[13], 5, -1444681467);\n d = gg(d, a, b, c, k[2], 9, -51403784);\n c = gg(c, d, a, b, k[7], 14, 1735328473);\n b = gg(b, c, d, a, k[12], 20, -1926607734);\n\n a = hh(a, b, c, d, k[5], 4, -378558);\n d = hh(d, a, b, c, k[8], 11, -2022574463);\n c = hh(c, d, a, b, k[11], 16, 1839030562);\n b = hh(b, c, d, a, k[14], 23, -35309556);\n a = hh(a, b, c, d, k[1], 4, -1530992060);\n d = hh(d, a, b, c, k[4], 11, 1272893353);\n c = hh(c, d, a, b, k[7], 16, -155497632);\n b = hh(b, c, d, a, k[10], 23, -1094730640);\n a = hh(a, b, c, d, k[13], 4, 681279174);\n d = hh(d, a, b, c, k[0], 11, -358537222);\n c = hh(c, d, a, b, k[3], 16, -722521979);\n b = hh(b, c, d, a, k[6], 23, 76029189);\n a = hh(a, b, c, d, k[9], 4, -640364487);\n d = hh(d, a, b, c, k[12], 11, -421815835);\n c = hh(c, d, a, b, k[15], 16, 530742520);\n b = hh(b, c, d, a, k[2], 23, -995338651);\n\n a = ii(a, b, c, d, k[0], 6, -198630844);\n d = ii(d, a, b, c, k[7], 10, 1126891415);\n c = ii(c, d, a, b, k[14], 15, -1416354905);\n b = ii(b, c, d, a, k[5], 21, -57434055);\n a = ii(a, b, c, d, k[12], 6, 1700485571);\n d = ii(d, a, b, c, k[3], 10, -1894986606);\n c = ii(c, d, a, b, k[10], 15, -1051523);\n b = ii(b, c, d, a, k[1], 21, -2054922799);\n a = ii(a, b, c, d, k[8], 6, 1873313359);\n d = ii(d, a, b, c, k[15], 10, -30611744);\n c = ii(c, d, a, b, k[6], 15, -1560198380);\n b = ii(b, c, d, a, k[13], 21, 1309151649);\n a = ii(a, b, c, d, k[4], 6, -145523070);\n d = ii(d, a, b, c, k[11], 10, -1120210379);\n c = ii(c, d, a, b, k[2], 15, 718787259);\n b = ii(b, c, d, a, k[9], 21, -343485551);\n\n x[0] = add32(a, x[0]);\n x[1] = add32(b, x[1]);\n x[2] = add32(c, x[2]);\n x[3] = add32(d, x[3]);\n}\n\nfunction cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n}\n\nfunction ff(a, b, c, d, x, s, t) {\n return cmn((b & c) | (~b & d), a, b, x, s, t);\n}\n\nfunction gg(a, b, c, d, x, s, t) {\n return cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\n\nfunction hh(a, b, c, d, x, s, t) {\n return cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a, b, c, d, x, s, t) {\n return cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nfunction md51(s) {\n // txt = '';\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i;\n for (i = 64; i <= s.length; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < s.length; i++)\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n tail[i >> 2] |= 0x80 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i++) tail[i] = 0;\n }\n tail[14] = n * 8;\n md5cycle(state, tail);\n return state;\n}\n\n/* there needs to be support for Unicode here,\n * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps\n * by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise\n * I suggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then\n * how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something\n * like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard\n * itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8\n * 8-bit unsigned value arrays.\n */\nfunction md5blk(s) {\n /* I figured global was faster. */\n var md5blks = [],\n i; /* Andy King said do it this way. */\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] =\n s.charCodeAt(i) +\n (s.charCodeAt(i + 1) << 8) +\n (s.charCodeAt(i + 2) << 16) +\n (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n}\n\nvar hex_chr = \"0123456789abcdef\".split(\"\");\n\nfunction rhex(n) {\n var s = \"\",\n j = 0;\n for (; j < 4; j++)\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f];\n return s;\n}\n\nfunction hex(x) {\n for (var i = 0; i < x.length; i++) x[i] = rhex(x[i]);\n return x.join(\"\");\n}\n\n// Converts a 4-byte number to byte string\nfunction singleToByteString(n) {\n return String.fromCharCode(\n (n & 0xff) >> 0,\n (n & 0xff00) >> 8,\n (n & 0xff0000) >> 16,\n (n & 0xff000000) >> 24\n );\n}\n\n// Converts an array of numbers to a byte string\nfunction toByteString(x) {\n return x.map(singleToByteString).join(\"\");\n}\n\n// Returns the MD5 hash as a byte string\nfunction md5Bin(s) {\n return toByteString(md51(s));\n}\n\n// Returns MD5 hash as a hex string\nfunction md5(s) {\n return hex(md51(s));\n}\n\nvar md5Check = md5(\"hello\") != \"5d41402abc4b2a76b9719d911017c592\";\n\nfunction add32(a, b) {\n if (md5Check) {\n /* if the md5Check does not match\n the expected value, we're dealing\n with an old browser and need\n this function. */\n var lsw = (a & 0xffff) + (b & 0xffff),\n msw = (a >> 16) + (b >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xffff);\n } else {\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n return (a + b) & 0xffffffff;\n }\n}\n\nexport { md5, md5Bin };\n","/**\r\n * @license\r\n * FPDF is released under a permissive license: there is no usage restriction.\r\n * You may embed it freely in your application (commercial or not), with or\r\n * without modifications.\r\n *\r\n * Reference: http://www.fpdf.org/en/script/script37.php\r\n */\r\n\r\nfunction repeat(str, num) {\r\n return new Array(num + 1).join(str);\r\n}\r\n\r\n/**\r\n * Converts a byte string to a hex string\r\n *\r\n * @name rc4\r\n * @function\r\n * @param {string} key Byte string of encryption key\r\n * @param {string} data Byte string of data to be encrypted\r\n * @returns {string} Encrypted string\r\n */\r\nfunction rc4(key, data) {\r\n var lastKey, lastState;\r\n if (key !== lastKey) {\r\n var k = repeat(key, ((256 / key.length) >> 0) + 1);\r\n var state = [];\r\n for (var i = 0; i < 256; i++) {\r\n state[i] = i;\r\n }\r\n var j = 0;\r\n for (var i = 0; i < 256; i++) {\r\n var t = state[i];\r\n j = (j + t + k.charCodeAt(i)) % 256;\r\n state[i] = state[j];\r\n state[j] = t;\r\n }\r\n lastKey = key;\r\n lastState = state;\r\n } else {\r\n state = lastState;\r\n }\r\n var length = data.length;\r\n var a = 0;\r\n var b = 0;\r\n var out = \"\";\r\n for (var i = 0; i < length; i++) {\r\n a = (a + 1) % 256;\r\n t = state[a];\r\n b = (b + t) % 256;\r\n state[a] = state[b];\r\n state[b] = t;\r\n k = state[(state[a] + state[b]) % 256];\r\n out += String.fromCharCode(data.charCodeAt(i) ^ k);\r\n }\r\n return out;\r\n}\r\n\r\nexport { rc4 };\r\n","/**\r\n * @license\r\n * Licensed under the MIT License.\r\n * http://opensource.org/licenses/mit-license\r\n * Author: Owen Leong (@owenl131)\r\n * Date: 15 Oct 2020\r\n * References:\r\n * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt\r\n * https://github.com/foliojs/pdfkit/blob/master/lib/security.js\r\n * http://www.fpdf.org/en/script/script37.php\r\n */\r\n\r\nimport { md5Bin } from \"./md5.js\";\r\nimport { rc4 } from \"./rc4.js\";\r\n\r\nvar permissionOptions = {\r\n print: 4,\r\n modify: 8,\r\n copy: 16,\r\n \"annot-forms\": 32\r\n};\r\n\r\n/**\r\n * Initializes encryption settings\r\n *\r\n * @name constructor\r\n * @function\r\n * @param {Array} permissions Permissions allowed for user, \"print\", \"modify\", \"copy\" and \"annot-forms\".\r\n * @param {String} userPassword Permissions apply to this user. Leaving this empty means the document\r\n * is not password protected but viewer has the above permissions.\r\n * @param {String} ownerPassword Owner has full functionalities to the file.\r\n * @param {String} fileId As hex string, should be same as the file ID in the trailer.\r\n * @example\r\n * var security = new PDFSecurity([\"print\"])\r\n */\r\nfunction PDFSecurity(permissions, userPassword, ownerPassword, fileId) {\r\n this.v = 1; // algorithm 1, future work can add in more recent encryption schemes\r\n this.r = 2; // revision 2\r\n\r\n // set flags for what functionalities the user can access\r\n let protection = 192;\r\n permissions.forEach(function(perm) {\r\n if (typeof permissionOptions.perm !== \"undefined\") {\r\n throw new Error(\"Invalid permission: \" + perm);\r\n }\r\n protection += permissionOptions[perm];\r\n });\r\n\r\n // padding is used to pad the passwords to 32 bytes, also is hashed and stored in the final PDF\r\n this.padding =\r\n \"\\x28\\xBF\\x4E\\x5E\\x4E\\x75\\x8A\\x41\\x64\\x00\\x4E\\x56\\xFF\\xFA\\x01\\x08\" +\r\n \"\\x2E\\x2E\\x00\\xB6\\xD0\\x68\\x3E\\x80\\x2F\\x0C\\xA9\\xFE\\x64\\x53\\x69\\x7A\";\r\n let paddedUserPassword = (userPassword + this.padding).substr(0, 32);\r\n let paddedOwnerPassword = (ownerPassword + this.padding).substr(0, 32);\r\n\r\n this.O = this.processOwnerPassword(paddedUserPassword, paddedOwnerPassword);\r\n this.P = -((protection ^ 255) + 1);\r\n this.encryptionKey = md5Bin(\r\n paddedUserPassword +\r\n this.O +\r\n this.lsbFirstWord(this.P) +\r\n this.hexToBytes(fileId)\r\n ).substr(0, 5);\r\n this.U = rc4(this.encryptionKey, this.padding);\r\n}\r\n\r\n/**\r\n * Breaks down a 4-byte number into its individual bytes, with the least significant bit first\r\n *\r\n * @name lsbFirstWord\r\n * @function\r\n * @param {number} data 32-bit number\r\n * @returns {Array}\r\n */\r\nPDFSecurity.prototype.lsbFirstWord = function(data) {\r\n return String.fromCharCode(\r\n (data >> 0) & 0xff,\r\n (data >> 8) & 0xff,\r\n (data >> 16) & 0xff,\r\n (data >> 24) & 0xff\r\n );\r\n};\r\n\r\n/**\r\n * Converts a byte string to a hex string\r\n *\r\n * @name toHexString\r\n * @function\r\n * @param {String} byteString Byte string\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.toHexString = function(byteString) {\r\n return byteString\r\n .split(\"\")\r\n .map(function(byte) {\r\n return (\"0\" + (byte.charCodeAt(0) & 0xff).toString(16)).slice(-2);\r\n })\r\n .join(\"\");\r\n};\r\n\r\n/**\r\n * Converts a hex string to a byte string\r\n *\r\n * @name hexToBytes\r\n * @function\r\n * @param {String} hex Hex string\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.hexToBytes = function(hex) {\r\n for (var bytes = [], c = 0; c < hex.length; c += 2)\r\n bytes.push(String.fromCharCode(parseInt(hex.substr(c, 2), 16)));\r\n return bytes.join(\"\");\r\n};\r\n\r\n/**\r\n * Computes the 'O' field in the encryption dictionary\r\n *\r\n * @name processOwnerPassword\r\n * @function\r\n * @param {String} paddedUserPassword Byte string of padded user password\r\n * @param {String} paddedOwnerPassword Byte string of padded owner password\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.processOwnerPassword = function(\r\n paddedUserPassword,\r\n paddedOwnerPassword\r\n) {\r\n let key = md5Bin(paddedOwnerPassword).substr(0, 5);\r\n return rc4(key, paddedUserPassword);\r\n};\r\n\r\n/**\r\n * Returns an encryptor function which can take in a byte string and returns the encrypted version\r\n *\r\n * @name encryptor\r\n * @function\r\n * @param {number} objectId\r\n * @param {number} generation Not sure what this is for, you can set it to 0\r\n * @returns {Function}\r\n * @example\r\n * out(\"stream\");\r\n * encryptor = security.encryptor(object.id, 0);\r\n * out(encryptor(data));\r\n * out(\"endstream\");\r\n */\r\nPDFSecurity.prototype.encryptor = function(objectId, generation) {\r\n let key = md5Bin(\r\n this.encryptionKey +\r\n String.fromCharCode(\r\n objectId & 0xff,\r\n (objectId >> 8) & 0xff,\r\n (objectId >> 16) & 0xff,\r\n generation & 0xff,\r\n (generation >> 8) & 0xff\r\n )\r\n ).substr(0, 10);\r\n return function(data) {\r\n return rc4(key, data);\r\n };\r\n};\r\n\r\nexport { PDFSecurity };\r\n","/**\n * Convert string to `PDF Name Object`.\n * Detail: PDF Reference 1.3 - Chapter 3.2.4 Name Object\n * @param str\n */\nfunction toPDFName(str) {\n // eslint-disable-next-line no-control-regex\n if (/[^\\u0000-\\u00ff]/.test(str)) {\n // non ascii string\n throw new Error(\n \"Invalid PDF Name Object: \" + str + \", Only accept ASCII characters.\"\n );\n }\n var result = \"\",\n strLength = str.length;\n for (var i = 0; i < strLength; i++) {\n var charCode = str.charCodeAt(i);\n if (\n charCode < 0x21 ||\n charCode === 0x23 /* # */ ||\n charCode === 0x25 /* % */ ||\n charCode === 0x28 /* ( */ ||\n charCode === 0x29 /* ) */ ||\n charCode === 0x2f /* / */ ||\n charCode === 0x3c /* < */ ||\n charCode === 0x3e /* > */ ||\n charCode === 0x5b /* [ */ ||\n charCode === 0x5d /* ] */ ||\n charCode === 0x7b /* { */ ||\n charCode === 0x7d /* } */ ||\n charCode > 0x7e\n ) {\n // Char CharCode hexStr paddingHexStr Result\n // \"\\t\" 9 9 09 #09\n // \" \" 32 20 20 #20\n // \"©\" 169 a9 a9 #a9\n var hexStr = charCode.toString(16),\n paddingHexStr = (\"0\" + hexStr).slice(-2);\n\n result += \"#\" + paddingHexStr;\n } else {\n // Other ASCII printable characters between 0x21 <= X <= 0x7e\n result += str[i];\n }\n }\n return result;\n}\n\nexport { toPDFName };\n","/* eslint-disable no-console */\r\n\r\nimport { saveAs } from \"./libs/FileSaver.js\";\r\nimport { globalObject } from \"./libs/globalObject.js\";\r\nimport { RGBColor } from \"./libs/rgbcolor.js\";\r\nimport { btoa } from \"./libs/AtobBtoa.js\";\r\nimport { console } from \"./libs/console.js\";\r\nimport { PDFSecurity } from \"./libs/pdfsecurity.js\";\r\nimport { toPDFName } from \"./libs/pdfname.js\";\r\n/**\r\n * jsPDF's Internal PubSub Implementation.\r\n * Backward compatible rewritten on 2014 by\r\n * Diego Casorran, https://github.com/diegocr\r\n *\r\n * @class\r\n * @name PubSub\r\n * @ignore\r\n */\r\nfunction PubSub(context) {\r\n if (typeof context !== \"object\") {\r\n throw new Error(\r\n \"Invalid Context passed to initialize PubSub (jsPDF-module)\"\r\n );\r\n }\r\n var topics = {};\r\n\r\n this.subscribe = function(topic, callback, once) {\r\n once = once || false;\r\n if (\r\n typeof topic !== \"string\" ||\r\n typeof callback !== \"function\" ||\r\n typeof once !== \"boolean\"\r\n ) {\r\n throw new Error(\r\n \"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\"\r\n );\r\n }\r\n\r\n if (!topics.hasOwnProperty(topic)) {\r\n topics[topic] = {};\r\n }\r\n\r\n var token = Math.random().toString(35);\r\n topics[topic][token] = [callback, !!once];\r\n\r\n return token;\r\n };\r\n\r\n this.unsubscribe = function(token) {\r\n for (var topic in topics) {\r\n if (topics[topic][token]) {\r\n delete topics[topic][token];\r\n if (Object.keys(topics[topic]).length === 0) {\r\n delete topics[topic];\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n this.publish = function(topic) {\r\n if (topics.hasOwnProperty(topic)) {\r\n var args = Array.prototype.slice.call(arguments, 1),\r\n tokens = [];\r\n\r\n for (var token in topics[topic]) {\r\n var sub = topics[topic][token];\r\n try {\r\n sub[0].apply(context, args);\r\n } catch (ex) {\r\n if (globalObject.console) {\r\n console.error(\"jsPDF PubSub Error\", ex.message, ex);\r\n }\r\n }\r\n if (sub[1]) tokens.push(token);\r\n }\r\n if (tokens.length) tokens.forEach(this.unsubscribe);\r\n }\r\n };\r\n\r\n this.getTopics = function() {\r\n return topics;\r\n };\r\n}\r\n\r\nfunction GState(parameters) {\r\n if (!(this instanceof GState)) {\r\n return new GState(parameters);\r\n }\r\n\r\n /**\r\n * @name GState#opacity\r\n * @type {any}\r\n */\r\n /**\r\n * @name GState#stroke-opacity\r\n * @type {any}\r\n */\r\n var supported = \"opacity,stroke-opacity\".split(\",\");\r\n for (var p in parameters) {\r\n if (parameters.hasOwnProperty(p) && supported.indexOf(p) >= 0) {\r\n this[p] = parameters[p];\r\n }\r\n }\r\n /**\r\n * @name GState#id\r\n * @type {string}\r\n */\r\n this.id = \"\"; // set by addGState()\r\n /**\r\n * @name GState#objectNumber\r\n * @type {number}\r\n */\r\n this.objectNumber = -1; // will be set by putGState()\r\n}\r\n\r\nGState.prototype.equals = function equals(other) {\r\n var ignore = \"id,objectNumber,equals\";\r\n var p;\r\n if (!other || typeof other !== typeof this) return false;\r\n var count = 0;\r\n for (p in this) {\r\n if (ignore.indexOf(p) >= 0) continue;\r\n if (this.hasOwnProperty(p) && !other.hasOwnProperty(p)) return false;\r\n if (this[p] !== other[p]) return false;\r\n count++;\r\n }\r\n for (p in other) {\r\n if (other.hasOwnProperty(p) && ignore.indexOf(p) < 0) count--;\r\n }\r\n return count === 0;\r\n};\r\n\r\nfunction Pattern(gState, matrix) {\r\n this.gState = gState;\r\n this.matrix = matrix;\r\n\r\n this.id = \"\"; // set by addPattern()\r\n this.objectNumber = -1; // will be set by putPattern()\r\n}\r\n\r\nfunction ShadingPattern(type, coords, colors, gState, matrix) {\r\n if (!(this instanceof ShadingPattern)) {\r\n return new ShadingPattern(type, coords, colors, gState, matrix);\r\n }\r\n\r\n // see putPattern() for information how they are realized\r\n this.type = type === \"axial\" ? 2 : 3;\r\n this.coords = coords;\r\n this.colors = colors;\r\n\r\n Pattern.call(this, gState, matrix);\r\n}\r\n\r\nfunction TilingPattern(boundingBox, xStep, yStep, gState, matrix) {\r\n if (!(this instanceof TilingPattern)) {\r\n return new TilingPattern(boundingBox, xStep, yStep, gState, matrix);\r\n }\r\n\r\n this.boundingBox = boundingBox;\r\n this.xStep = xStep;\r\n this.yStep = yStep;\r\n\r\n this.stream = \"\"; // set by endTilingPattern();\r\n\r\n this.cloneIndex = 0;\r\n\r\n Pattern.call(this, gState, matrix);\r\n}\r\n\r\n/**\r\n * Creates new jsPDF document object instance.\r\n * @name jsPDF\r\n * @class\r\n * @param {Object} [options] - Collection of settings initializing the jsPDF-instance\r\n * @param {string} [options.orientation=portrait] - Orientation of the first page. Possible values are \"portrait\" or \"landscape\" (or shortcuts \"p\" or \"l\").
    \r\n * @param {string} [options.unit=mm] Measurement unit (base unit) to be used when coordinates are specified.
    \r\n * Possible values are \"pt\" (points), \"mm\", \"cm\", \"in\", \"px\", \"pc\", \"em\" or \"ex\". Note that in order to get the correct scaling for \"px\"\r\n * units, you need to enable the hotfix \"px_scaling\" by setting options.hotfixes = [\"px_scaling\"].\r\n * @param {string/Array} [options.format=a4] The format of the first page. Can be:
    • a0 - a10
    • b0 - b10
    • c0 - c10
    • dl
    • letter
    • government-letter
    • legal
    • junior-legal
    • ledger
    • tabloid
    • credit-card

    \r\n * Default is \"a4\". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]\r\n * @param {boolean} [options.putOnlyUsedFonts=false] Only put fonts into the PDF, which were used.\r\n * @param {boolean} [options.compress=false] Compress the generated PDF.\r\n * @param {number} [options.precision=16] Precision of the element-positions.\r\n * @param {number} [options.userUnit=1.0] Not to be confused with the base unit. Please inform yourself before you use it.\r\n * @param {string[]} [options.hotfixes] An array of strings to enable hotfixes such as correct pixel scaling.\r\n * @param {Object} [options.encryption]\r\n * @param {string} [options.encryption.userPassword] Password for the user bound by the given permissions list.\r\n * @param {string} [options.encryption.ownerPassword] Both userPassword and ownerPassword should be set for proper authentication.\r\n * @param {string[]} [options.encryption.userPermissions] Array of permissions \"print\", \"modify\", \"copy\", \"annot-forms\", accessible by the user.\r\n * @param {number|\"smart\"} [options.floatPrecision=16]\r\n * @returns {jsPDF} jsPDF-instance\r\n * @description\r\n * ```\r\n * {\r\n * orientation: 'p',\r\n * unit: 'mm',\r\n * format: 'a4',\r\n * putOnlyUsedFonts:true,\r\n * floatPrecision: 16 // or \"smart\", default is 16\r\n * }\r\n * ```\r\n *\r\n * @constructor\r\n */\r\nfunction jsPDF(options) {\r\n var orientation = typeof arguments[0] === \"string\" ? arguments[0] : \"p\";\r\n var unit = arguments[1];\r\n var format = arguments[2];\r\n var compressPdf = arguments[3];\r\n var filters = [];\r\n var userUnit = 1.0;\r\n var precision;\r\n var floatPrecision = 16;\r\n var defaultPathOperation = \"S\";\r\n var encryptionOptions = null;\r\n\r\n options = options || {};\r\n\r\n if (typeof options === \"object\") {\r\n orientation = options.orientation;\r\n unit = options.unit || unit;\r\n format = options.format || format;\r\n compressPdf = options.compress || options.compressPdf || compressPdf;\r\n encryptionOptions = options.encryption || null;\r\n if (encryptionOptions !== null) {\r\n encryptionOptions.userPassword = encryptionOptions.userPassword || \"\";\r\n encryptionOptions.ownerPassword = encryptionOptions.ownerPassword || \"\";\r\n encryptionOptions.userPermissions =\r\n encryptionOptions.userPermissions || [];\r\n }\r\n userUnit =\r\n typeof options.userUnit === \"number\" ? Math.abs(options.userUnit) : 1.0;\r\n if (typeof options.precision !== \"undefined\") {\r\n precision = options.precision;\r\n }\r\n if (typeof options.floatPrecision !== \"undefined\") {\r\n floatPrecision = options.floatPrecision;\r\n }\r\n defaultPathOperation = options.defaultPathOperation || \"S\";\r\n }\r\n\r\n filters =\r\n options.filters || (compressPdf === true ? [\"FlateEncode\"] : filters);\r\n\r\n unit = unit || \"mm\";\r\n orientation = (\"\" + (orientation || \"P\")).toLowerCase();\r\n var putOnlyUsedFonts = options.putOnlyUsedFonts || false;\r\n var usedFonts = {};\r\n\r\n var API = {\r\n internal: {},\r\n __private__: {}\r\n };\r\n\r\n API.__private__.PubSub = PubSub;\r\n\r\n var pdfVersion = \"1.3\";\r\n var getPdfVersion = (API.__private__.getPdfVersion = function() {\r\n return pdfVersion;\r\n });\r\n\r\n API.__private__.setPdfVersion = function(value) {\r\n pdfVersion = value;\r\n };\r\n\r\n // Size in pt of various paper formats\r\n var pageFormats = {\r\n a0: [2383.94, 3370.39],\r\n a1: [1683.78, 2383.94],\r\n a2: [1190.55, 1683.78],\r\n a3: [841.89, 1190.55],\r\n a4: [595.28, 841.89],\r\n a5: [419.53, 595.28],\r\n a6: [297.64, 419.53],\r\n a7: [209.76, 297.64],\r\n a8: [147.4, 209.76],\r\n a9: [104.88, 147.4],\r\n a10: [73.7, 104.88],\r\n b0: [2834.65, 4008.19],\r\n b1: [2004.09, 2834.65],\r\n b2: [1417.32, 2004.09],\r\n b3: [1000.63, 1417.32],\r\n b4: [708.66, 1000.63],\r\n b5: [498.9, 708.66],\r\n b6: [354.33, 498.9],\r\n b7: [249.45, 354.33],\r\n b8: [175.75, 249.45],\r\n b9: [124.72, 175.75],\r\n b10: [87.87, 124.72],\r\n c0: [2599.37, 3676.54],\r\n c1: [1836.85, 2599.37],\r\n c2: [1298.27, 1836.85],\r\n c3: [918.43, 1298.27],\r\n c4: [649.13, 918.43],\r\n c5: [459.21, 649.13],\r\n c6: [323.15, 459.21],\r\n c7: [229.61, 323.15],\r\n c8: [161.57, 229.61],\r\n c9: [113.39, 161.57],\r\n c10: [79.37, 113.39],\r\n dl: [311.81, 623.62],\r\n letter: [612, 792],\r\n \"government-letter\": [576, 756],\r\n legal: [612, 1008],\r\n \"junior-legal\": [576, 360],\r\n ledger: [1224, 792],\r\n tabloid: [792, 1224],\r\n \"credit-card\": [153, 243]\r\n };\r\n\r\n API.__private__.getPageFormats = function() {\r\n return pageFormats;\r\n };\r\n\r\n var getPageFormat = (API.__private__.getPageFormat = function(value) {\r\n return pageFormats[value];\r\n });\r\n\r\n format = format || \"a4\";\r\n\r\n var ApiMode = {\r\n COMPAT: \"compat\",\r\n ADVANCED: \"advanced\"\r\n };\r\n var apiMode = ApiMode.COMPAT;\r\n\r\n function advancedAPI() {\r\n // prepend global change of basis matrix\r\n // (Now, instead of converting every coordinate to the pdf coordinate system, we apply a matrix\r\n // that does this job for us (however, texts, images and similar objects must be drawn bottom up))\r\n this.saveGraphicsState();\r\n out(\r\n new Matrix(\r\n scaleFactor,\r\n 0,\r\n 0,\r\n -scaleFactor,\r\n 0,\r\n getPageHeight() * scaleFactor\r\n ).toString() + \" cm\"\r\n );\r\n this.setFontSize(this.getFontSize() / scaleFactor);\r\n\r\n // The default in MrRio's implementation is \"S\" (stroke), whereas the default in the yWorks implementation\r\n // was \"n\" (none). Although this has nothing to do with transforms, we should use the API switch here.\r\n defaultPathOperation = \"n\";\r\n\r\n apiMode = ApiMode.ADVANCED;\r\n }\r\n\r\n function compatAPI() {\r\n this.restoreGraphicsState();\r\n defaultPathOperation = \"S\";\r\n apiMode = ApiMode.COMPAT;\r\n }\r\n\r\n /**\r\n * @function combineFontStyleAndFontWeight\r\n * @param {string} fontStyle Fontstyle or variant. Example: \"italic\".\r\n * @param {number | string} fontWeight Weight of the Font. Example: \"normal\" | 400\r\n * @returns {string}\r\n * @private\r\n */\r\n var combineFontStyleAndFontWeight = (API.__private__.combineFontStyleAndFontWeight = function(\r\n fontStyle,\r\n fontWeight\r\n ) {\r\n if (\r\n (fontStyle == \"bold\" && fontWeight == \"normal\") ||\r\n (fontStyle == \"bold\" && fontWeight == 400) ||\r\n (fontStyle == \"normal\" && fontWeight == \"italic\") ||\r\n (fontStyle == \"bold\" && fontWeight == \"italic\")\r\n ) {\r\n throw new Error(\"Invalid Combination of fontweight and fontstyle\");\r\n }\r\n if (fontWeight) {\r\n fontStyle =\r\n fontWeight == 400 || fontWeight === \"normal\"\r\n ? fontStyle === \"italic\"\r\n ? \"italic\"\r\n : \"normal\"\r\n : (fontWeight == 700 || fontWeight === \"bold\") &&\r\n fontStyle === \"normal\"\r\n ? \"bold\"\r\n : (fontWeight == 700 ? \"bold\" : fontWeight) + \"\" + fontStyle;\r\n }\r\n return fontStyle;\r\n });\r\n\r\n /**\r\n * @callback ApiSwitchBody\r\n * @param {jsPDF} pdf\r\n */\r\n\r\n /**\r\n * For compatibility reasons jsPDF offers two API modes which differ in the way they convert between the the usual\r\n * screen coordinates and the PDF coordinate system.\r\n * - \"compat\": Offers full compatibility across all plugins but does not allow arbitrary transforms\r\n * - \"advanced\": Allows arbitrary transforms and more advanced features like pattern fills. Some plugins might\r\n * not support this mode, though.\r\n * Initial mode is \"compat\".\r\n *\r\n * You can either provide a callback to the body argument, which means that jsPDF will automatically switch back to\r\n * the original API mode afterwards; or you can omit the callback and switch back manually using {@link compatAPI}.\r\n *\r\n * Note, that the calls to {@link saveGraphicsState} and {@link restoreGraphicsState} need to be balanced within the\r\n * callback or between calls of this method and its counterpart {@link compatAPI}. Calls to {@link beginFormObject}\r\n * or {@link beginTilingPattern} need to be closed by their counterparts before switching back to \"compat\" API mode.\r\n *\r\n * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\r\n * The API mode will be switched back automatically afterwards.\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name advancedAPI\r\n */\r\n API.advancedAPI = function(body) {\r\n var doSwitch = apiMode === ApiMode.COMPAT;\r\n\r\n if (doSwitch) {\r\n advancedAPI.call(this);\r\n }\r\n\r\n if (typeof body !== \"function\") {\r\n return this;\r\n }\r\n\r\n body(this);\r\n\r\n if (doSwitch) {\r\n compatAPI.call(this);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Switches to \"compat\" API mode. See {@link advancedAPI} for more details.\r\n *\r\n * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\r\n * The API mode will be switched back automatically afterwards.\r\n * @return {jsPDF}\r\n * @memberof jsPDF#\r\n * @name compatApi\r\n */\r\n API.compatAPI = function(body) {\r\n var doSwitch = apiMode === ApiMode.ADVANCED;\r\n\r\n if (doSwitch) {\r\n compatAPI.call(this);\r\n }\r\n\r\n if (typeof body !== \"function\") {\r\n return this;\r\n }\r\n\r\n body(this);\r\n\r\n if (doSwitch) {\r\n advancedAPI.call(this);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * @return {boolean} True iff the current API mode is \"advanced\". See {@link advancedAPI}.\r\n * @memberof jsPDF#\r\n * @name isAdvancedAPI\r\n */\r\n API.isAdvancedAPI = function() {\r\n return apiMode === ApiMode.ADVANCED;\r\n };\r\n\r\n var advancedApiModeTrap = function(methodName) {\r\n if (apiMode !== ApiMode.ADVANCED) {\r\n throw new Error(\r\n methodName +\r\n \" is only available in 'advanced' API mode. \" +\r\n \"You need to call advancedAPI() first.\"\r\n );\r\n }\r\n };\r\n\r\n var roundToPrecision = (API.roundToPrecision = API.__private__.roundToPrecision = function(\r\n number,\r\n parmPrecision\r\n ) {\r\n var tmpPrecision = precision || parmPrecision;\r\n if (isNaN(number) || isNaN(tmpPrecision)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.roundToPrecision\");\r\n }\r\n return number.toFixed(tmpPrecision).replace(/0+$/, \"\");\r\n });\r\n\r\n // high precision float\r\n var hpf;\r\n if (typeof floatPrecision === \"number\") {\r\n hpf = API.hpf = API.__private__.hpf = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n }\r\n return roundToPrecision(number, floatPrecision);\r\n };\r\n } else if (floatPrecision === \"smart\") {\r\n hpf = API.hpf = API.__private__.hpf = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n }\r\n if (number > -1 && number < 1) {\r\n return roundToPrecision(number, 16);\r\n } else {\r\n return roundToPrecision(number, 5);\r\n }\r\n };\r\n } else {\r\n hpf = API.hpf = API.__private__.hpf = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n }\r\n return roundToPrecision(number, 16);\r\n };\r\n }\r\n var f2 = (API.f2 = API.__private__.f2 = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.f2\");\r\n }\r\n return roundToPrecision(number, 2);\r\n });\r\n\r\n var f3 = (API.__private__.f3 = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.f3\");\r\n }\r\n return roundToPrecision(number, 3);\r\n });\r\n\r\n var scale = (API.scale = API.__private__.scale = function(number) {\r\n if (isNaN(number)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.scale\");\r\n }\r\n if (apiMode === ApiMode.COMPAT) {\r\n return number * scaleFactor;\r\n } else if (apiMode === ApiMode.ADVANCED) {\r\n return number;\r\n }\r\n });\r\n\r\n var transformY = function(y) {\r\n if (apiMode === ApiMode.COMPAT) {\r\n return getPageHeight() - y;\r\n } else if (apiMode === ApiMode.ADVANCED) {\r\n return y;\r\n }\r\n };\r\n\r\n var transformScaleY = function(y) {\r\n return scale(transformY(y));\r\n };\r\n\r\n /**\r\n * @name setPrecision\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {string} precision\r\n * @returns {jsPDF}\r\n */\r\n API.__private__.setPrecision = API.setPrecision = function(value) {\r\n if (typeof parseInt(value, 10) === \"number\") {\r\n precision = parseInt(value, 10);\r\n }\r\n };\r\n\r\n var fileId = \"00000000000000000000000000000000\";\r\n\r\n var getFileId = (API.__private__.getFileId = function() {\r\n return fileId;\r\n });\r\n\r\n var setFileId = (API.__private__.setFileId = function(value) {\r\n if (typeof value !== \"undefined\" && /^[a-fA-F0-9]{32}$/.test(value)) {\r\n fileId = value.toUpperCase();\r\n } else {\r\n fileId = fileId\r\n .split(\"\")\r\n .map(function() {\r\n return \"ABCDEF0123456789\".charAt(Math.floor(Math.random() * 16));\r\n })\r\n .join(\"\");\r\n }\r\n\r\n if (encryptionOptions !== null) {\r\n encryption = new PDFSecurity(\r\n encryptionOptions.userPermissions,\r\n encryptionOptions.userPassword,\r\n encryptionOptions.ownerPassword,\r\n fileId\r\n );\r\n }\r\n return fileId;\r\n });\r\n\r\n /**\r\n * @name setFileId\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {string} value GUID.\r\n * @returns {jsPDF}\r\n */\r\n API.setFileId = function(value) {\r\n setFileId(value);\r\n return this;\r\n };\r\n\r\n /**\r\n * @name getFileId\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n *\r\n * @returns {string} GUID.\r\n */\r\n API.getFileId = function() {\r\n return getFileId();\r\n };\r\n\r\n var creationDate;\r\n\r\n var convertDateToPDFDate = (API.__private__.convertDateToPDFDate = function(\r\n parmDate\r\n ) {\r\n var result = \"\";\r\n var tzoffset = parmDate.getTimezoneOffset(),\r\n tzsign = tzoffset < 0 ? \"+\" : \"-\",\r\n tzhour = Math.floor(Math.abs(tzoffset / 60)),\r\n tzmin = Math.abs(tzoffset % 60),\r\n timeZoneString = [tzsign, padd2(tzhour), \"'\", padd2(tzmin), \"'\"].join(\"\");\r\n\r\n result = [\r\n \"D:\",\r\n parmDate.getFullYear(),\r\n padd2(parmDate.getMonth() + 1),\r\n padd2(parmDate.getDate()),\r\n padd2(parmDate.getHours()),\r\n padd2(parmDate.getMinutes()),\r\n padd2(parmDate.getSeconds()),\r\n timeZoneString\r\n ].join(\"\");\r\n return result;\r\n });\r\n\r\n var convertPDFDateToDate = (API.__private__.convertPDFDateToDate = function(\r\n parmPDFDate\r\n ) {\r\n var year = parseInt(parmPDFDate.substr(2, 4), 10);\r\n var month = parseInt(parmPDFDate.substr(6, 2), 10) - 1;\r\n var date = parseInt(parmPDFDate.substr(8, 2), 10);\r\n var hour = parseInt(parmPDFDate.substr(10, 2), 10);\r\n var minutes = parseInt(parmPDFDate.substr(12, 2), 10);\r\n var seconds = parseInt(parmPDFDate.substr(14, 2), 10);\r\n // var timeZoneHour = parseInt(parmPDFDate.substr(16, 2), 10);\r\n // var timeZoneMinutes = parseInt(parmPDFDate.substr(20, 2), 10);\r\n\r\n var resultingDate = new Date(year, month, date, hour, minutes, seconds, 0);\r\n return resultingDate;\r\n });\r\n\r\n var setCreationDate = (API.__private__.setCreationDate = function(date) {\r\n var tmpCreationDateString;\r\n var regexPDFCreationDate = /^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\\+0[0-9]|\\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/;\r\n if (typeof date === \"undefined\") {\r\n date = new Date();\r\n }\r\n\r\n if (date instanceof Date) {\r\n tmpCreationDateString = convertDateToPDFDate(date);\r\n } else if (regexPDFCreationDate.test(date)) {\r\n tmpCreationDateString = date;\r\n } else {\r\n throw new Error(\"Invalid argument passed to jsPDF.setCreationDate\");\r\n }\r\n creationDate = tmpCreationDateString;\r\n return creationDate;\r\n });\r\n\r\n var getCreationDate = (API.__private__.getCreationDate = function(type) {\r\n var result = creationDate;\r\n if (type === \"jsDate\") {\r\n result = convertPDFDateToDate(creationDate);\r\n }\r\n return result;\r\n });\r\n\r\n /**\r\n * @name setCreationDate\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {Object} date\r\n * @returns {jsPDF}\r\n */\r\n API.setCreationDate = function(date) {\r\n setCreationDate(date);\r\n return this;\r\n };\r\n\r\n /**\r\n * @name getCreationDate\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {Object} type\r\n * @returns {Object}\r\n */\r\n API.getCreationDate = function(type) {\r\n return getCreationDate(type);\r\n };\r\n\r\n var padd2 = (API.__private__.padd2 = function(number) {\r\n return (\"0\" + parseInt(number)).slice(-2);\r\n });\r\n\r\n var padd2Hex = (API.__private__.padd2Hex = function(hexString) {\r\n hexString = hexString.toString();\r\n return (\"00\" + hexString).substr(hexString.length);\r\n });\r\n\r\n var objectNumber = 0; // 'n' Current object number\r\n var offsets = []; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.\r\n var content = [];\r\n var contentLength = 0;\r\n var additionalObjects = [];\r\n\r\n var pages = [];\r\n var currentPage;\r\n var hasCustomDestination = false;\r\n var outputDestination = content;\r\n\r\n var resetDocument = function() {\r\n //reset fields relevant for objectNumber generation and xref.\r\n objectNumber = 0;\r\n contentLength = 0;\r\n content = [];\r\n offsets = [];\r\n additionalObjects = [];\r\n\r\n rootDictionaryObjId = newObjectDeferred();\r\n resourceDictionaryObjId = newObjectDeferred();\r\n };\r\n\r\n API.__private__.setCustomOutputDestination = function(destination) {\r\n hasCustomDestination = true;\r\n outputDestination = destination;\r\n };\r\n var setOutputDestination = function(destination) {\r\n if (!hasCustomDestination) {\r\n outputDestination = destination;\r\n }\r\n };\r\n\r\n API.__private__.resetCustomOutputDestination = function() {\r\n hasCustomDestination = false;\r\n outputDestination = content;\r\n };\r\n\r\n var out = (API.__private__.out = function(string) {\r\n string = string.toString();\r\n contentLength += string.length + 1;\r\n outputDestination.push(string);\r\n\r\n return outputDestination;\r\n });\r\n\r\n var write = (API.__private__.write = function(value) {\r\n return out(\r\n arguments.length === 1\r\n ? value.toString()\r\n : Array.prototype.join.call(arguments, \" \")\r\n );\r\n });\r\n\r\n var getArrayBuffer = (API.__private__.getArrayBuffer = function(data) {\r\n var len = data.length,\r\n ab = new ArrayBuffer(len),\r\n u8 = new Uint8Array(ab);\r\n\r\n while (len--) u8[len] = data.charCodeAt(len);\r\n return ab;\r\n });\r\n\r\n var standardFonts = [\r\n [\"Helvetica\", \"helvetica\", \"normal\", \"WinAnsiEncoding\"],\r\n [\"Helvetica-Bold\", \"helvetica\", \"bold\", \"WinAnsiEncoding\"],\r\n [\"Helvetica-Oblique\", \"helvetica\", \"italic\", \"WinAnsiEncoding\"],\r\n [\"Helvetica-BoldOblique\", \"helvetica\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n [\"Courier\", \"courier\", \"normal\", \"WinAnsiEncoding\"],\r\n [\"Courier-Bold\", \"courier\", \"bold\", \"WinAnsiEncoding\"],\r\n [\"Courier-Oblique\", \"courier\", \"italic\", \"WinAnsiEncoding\"],\r\n [\"Courier-BoldOblique\", \"courier\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n [\"Times-Roman\", \"times\", \"normal\", \"WinAnsiEncoding\"],\r\n [\"Times-Bold\", \"times\", \"bold\", \"WinAnsiEncoding\"],\r\n [\"Times-Italic\", \"times\", \"italic\", \"WinAnsiEncoding\"],\r\n [\"Times-BoldItalic\", \"times\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n [\"ZapfDingbats\", \"zapfdingbats\", \"normal\", null],\r\n [\"Symbol\", \"symbol\", \"normal\", null]\r\n ];\r\n\r\n API.__private__.getStandardFonts = function() {\r\n return standardFonts;\r\n };\r\n\r\n var activeFontSize = options.fontSize || 16;\r\n\r\n /**\r\n * Sets font size for upcoming text elements.\r\n *\r\n * @param {number} size Font size in points.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setFontSize\r\n */\r\n API.__private__.setFontSize = API.setFontSize = function(size) {\r\n if (apiMode === ApiMode.ADVANCED) {\r\n activeFontSize = size / scaleFactor;\r\n } else {\r\n activeFontSize = size;\r\n }\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets the fontsize for upcoming text elements.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {number}\r\n * @memberof jsPDF#\r\n * @name getFontSize\r\n */\r\n var getFontSize = (API.__private__.getFontSize = API.getFontSize = function() {\r\n if (apiMode === ApiMode.COMPAT) {\r\n return activeFontSize;\r\n } else {\r\n return activeFontSize * scaleFactor;\r\n }\r\n });\r\n\r\n var R2L = options.R2L || false;\r\n\r\n /**\r\n * Set value of R2L functionality.\r\n *\r\n * @param {boolean} value\r\n * @function\r\n * @instance\r\n * @returns {jsPDF} jsPDF-instance\r\n * @memberof jsPDF#\r\n * @name setR2L\r\n */\r\n API.__private__.setR2L = API.setR2L = function(value) {\r\n R2L = value;\r\n return this;\r\n };\r\n\r\n /**\r\n * Get value of R2L functionality.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {boolean} jsPDF-instance\r\n * @memberof jsPDF#\r\n * @name getR2L\r\n */\r\n API.__private__.getR2L = API.getR2L = function() {\r\n return R2L;\r\n };\r\n\r\n var zoomMode; // default: 1;\r\n\r\n var setZoomMode = (API.__private__.setZoomMode = function(zoom) {\r\n var validZoomModes = [\r\n undefined,\r\n null,\r\n \"fullwidth\",\r\n \"fullheight\",\r\n \"fullpage\",\r\n \"original\"\r\n ];\r\n\r\n if (/^(?:\\d+\\.\\d*|\\d*\\.\\d+|\\d+)%$/.test(zoom)) {\r\n zoomMode = zoom;\r\n } else if (!isNaN(zoom)) {\r\n zoomMode = parseInt(zoom, 10);\r\n } else if (validZoomModes.indexOf(zoom) !== -1) {\r\n zoomMode = zoom;\r\n } else {\r\n throw new Error(\r\n 'zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. \"' +\r\n zoom +\r\n '\" is not recognized.'\r\n );\r\n }\r\n });\r\n\r\n API.__private__.getZoomMode = function() {\r\n return zoomMode;\r\n };\r\n\r\n var pageMode; // default: 'UseOutlines';\r\n var setPageMode = (API.__private__.setPageMode = function(pmode) {\r\n var validPageModes = [\r\n undefined,\r\n null,\r\n \"UseNone\",\r\n \"UseOutlines\",\r\n \"UseThumbs\",\r\n \"FullScreen\"\r\n ];\r\n\r\n if (validPageModes.indexOf(pmode) == -1) {\r\n throw new Error(\r\n 'Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. \"' +\r\n pmode +\r\n '\" is not recognized.'\r\n );\r\n }\r\n pageMode = pmode;\r\n });\r\n\r\n API.__private__.getPageMode = function() {\r\n return pageMode;\r\n };\r\n\r\n var layoutMode; // default: 'continuous';\r\n var setLayoutMode = (API.__private__.setLayoutMode = function(layout) {\r\n var validLayoutModes = [\r\n undefined,\r\n null,\r\n \"continuous\",\r\n \"single\",\r\n \"twoleft\",\r\n \"tworight\",\r\n \"two\"\r\n ];\r\n\r\n if (validLayoutModes.indexOf(layout) == -1) {\r\n throw new Error(\r\n 'Layout mode must be one of continuous, single, twoleft, tworight. \"' +\r\n layout +\r\n '\" is not recognized.'\r\n );\r\n }\r\n layoutMode = layout;\r\n });\r\n\r\n API.__private__.getLayoutMode = function() {\r\n return layoutMode;\r\n };\r\n\r\n /**\r\n * Set the display mode options of the page like zoom and layout.\r\n *\r\n * @name setDisplayMode\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {integer|String} zoom You can pass an integer or percentage as\r\n * a string. 2 will scale the document up 2x, '200%' will scale up by the\r\n * same amount. You can also set it to 'fullwidth', 'fullheight',\r\n * 'fullpage', or 'original'.\r\n *\r\n * Only certain PDF readers support this, such as Adobe Acrobat.\r\n *\r\n * @param {string} layout Layout mode can be: 'continuous' - this is the\r\n * default continuous scroll. 'single' - the single page mode only shows one\r\n * page at a time. 'twoleft' - two column left mode, first page starts on\r\n * the left, and 'tworight' - pages are laid out in two columns, with the\r\n * first page on the right. This would be used for books.\r\n * @param {string} pmode 'UseOutlines' - it shows the\r\n * outline of the document on the left. 'UseThumbs' - shows thumbnails along\r\n * the left. 'FullScreen' - prompts the user to enter fullscreen mode.\r\n *\r\n * @returns {jsPDF}\r\n */\r\n API.__private__.setDisplayMode = API.setDisplayMode = function(\r\n zoom,\r\n layout,\r\n pmode\r\n ) {\r\n setZoomMode(zoom);\r\n setLayoutMode(layout);\r\n setPageMode(pmode);\r\n return this;\r\n };\r\n\r\n var documentProperties = {\r\n title: \"\",\r\n subject: \"\",\r\n author: \"\",\r\n keywords: \"\",\r\n creator: \"\"\r\n };\r\n\r\n API.__private__.getDocumentProperty = function(key) {\r\n if (Object.keys(documentProperties).indexOf(key) === -1) {\r\n throw new Error(\"Invalid argument passed to jsPDF.getDocumentProperty\");\r\n }\r\n return documentProperties[key];\r\n };\r\n\r\n API.__private__.getDocumentProperties = function() {\r\n return documentProperties;\r\n };\r\n\r\n /**\r\n * Adds a properties to the PDF document.\r\n *\r\n * @param {Object} A property_name-to-property_value object structure.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setDocumentProperties\r\n */\r\n API.__private__.setDocumentProperties = API.setProperties = API.setDocumentProperties = function(\r\n properties\r\n ) {\r\n // copying only those properties we can render.\r\n for (var property in documentProperties) {\r\n if (documentProperties.hasOwnProperty(property) && properties[property]) {\r\n documentProperties[property] = properties[property];\r\n }\r\n }\r\n return this;\r\n };\r\n\r\n API.__private__.setDocumentProperty = function(key, value) {\r\n if (Object.keys(documentProperties).indexOf(key) === -1) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.setDocumentProperty\");\r\n }\r\n return (documentProperties[key] = value);\r\n };\r\n\r\n var fonts = {}; // collection of font objects, where key is fontKey - a dynamically created label for a given font.\r\n var fontmap = {}; // mapping structure fontName > fontStyle > font key - performance layer. See addFont()\r\n var activeFontKey; // will be string representing the KEY of the font as combination of fontName + fontStyle\r\n var fontStateStack = []; //\r\n var patterns = {}; // collection of pattern objects\r\n var patternMap = {}; // see fonts\r\n var gStates = {}; // collection of graphic state objects\r\n var gStatesMap = {}; // see fonts\r\n var activeGState = null;\r\n var scaleFactor; // Scale factor\r\n var page = 0;\r\n var pagesContext = [];\r\n var events = new PubSub(API);\r\n var hotfixes = options.hotfixes || [];\r\n\r\n var renderTargets = {};\r\n var renderTargetMap = {};\r\n var renderTargetStack = [];\r\n var pageX;\r\n var pageY;\r\n var pageMatrix; // only used for FormObjects\r\n\r\n /**\r\n * A matrix object for 2D homogenous transformations:
    \r\n * | a b 0 |
    \r\n * | c d 0 |
    \r\n * | e f 1 |
    \r\n * pdf multiplies matrices righthand: v' = v x m1 x m2 x ...\r\n *\r\n * @class\r\n * @name Matrix\r\n * @param {number} sx\r\n * @param {number} shy\r\n * @param {number} shx\r\n * @param {number} sy\r\n * @param {number} tx\r\n * @param {number} ty\r\n * @constructor\r\n */\r\n var Matrix = function(sx, shy, shx, sy, tx, ty) {\r\n if (!(this instanceof Matrix)) {\r\n return new Matrix(sx, shy, shx, sy, tx, ty);\r\n }\r\n\r\n if (isNaN(sx)) sx = 1;\r\n if (isNaN(shy)) shy = 0;\r\n if (isNaN(shx)) shx = 0;\r\n if (isNaN(sy)) sy = 1;\r\n if (isNaN(tx)) tx = 0;\r\n if (isNaN(ty)) ty = 0;\r\n\r\n this._matrix = [sx, shy, shx, sy, tx, ty];\r\n };\r\n\r\n /**\r\n * @name sx\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"sx\", {\r\n get: function() {\r\n return this._matrix[0];\r\n },\r\n set: function(value) {\r\n this._matrix[0] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name shy\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"shy\", {\r\n get: function() {\r\n return this._matrix[1];\r\n },\r\n set: function(value) {\r\n this._matrix[1] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name shx\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"shx\", {\r\n get: function() {\r\n return this._matrix[2];\r\n },\r\n set: function(value) {\r\n this._matrix[2] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name sy\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"sy\", {\r\n get: function() {\r\n return this._matrix[3];\r\n },\r\n set: function(value) {\r\n this._matrix[3] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name tx\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"tx\", {\r\n get: function() {\r\n return this._matrix[4];\r\n },\r\n set: function(value) {\r\n this._matrix[4] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name ty\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"ty\", {\r\n get: function() {\r\n return this._matrix[5];\r\n },\r\n set: function(value) {\r\n this._matrix[5] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"a\", {\r\n get: function() {\r\n return this._matrix[0];\r\n },\r\n set: function(value) {\r\n this._matrix[0] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"b\", {\r\n get: function() {\r\n return this._matrix[1];\r\n },\r\n set: function(value) {\r\n this._matrix[1] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"c\", {\r\n get: function() {\r\n return this._matrix[2];\r\n },\r\n set: function(value) {\r\n this._matrix[2] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"d\", {\r\n get: function() {\r\n return this._matrix[3];\r\n },\r\n set: function(value) {\r\n this._matrix[3] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"e\", {\r\n get: function() {\r\n return this._matrix[4];\r\n },\r\n set: function(value) {\r\n this._matrix[4] = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(Matrix.prototype, \"f\", {\r\n get: function() {\r\n return this._matrix[5];\r\n },\r\n set: function(value) {\r\n this._matrix[5] = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name rotation\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"rotation\", {\r\n get: function() {\r\n return Math.atan2(this.shx, this.sx);\r\n }\r\n });\r\n\r\n /**\r\n * @name scaleX\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"scaleX\", {\r\n get: function() {\r\n return this.decompose().scale.sx;\r\n }\r\n });\r\n\r\n /**\r\n * @name scaleY\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"scaleY\", {\r\n get: function() {\r\n return this.decompose().scale.sy;\r\n }\r\n });\r\n\r\n /**\r\n * @name isIdentity\r\n * @memberof Matrix#\r\n */\r\n Object.defineProperty(Matrix.prototype, \"isIdentity\", {\r\n get: function() {\r\n if (this.sx !== 1) {\r\n return false;\r\n }\r\n if (this.shy !== 0) {\r\n return false;\r\n }\r\n if (this.shx !== 0) {\r\n return false;\r\n }\r\n if (this.sy !== 1) {\r\n return false;\r\n }\r\n if (this.tx !== 0) {\r\n return false;\r\n }\r\n if (this.ty !== 0) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n });\r\n\r\n /**\r\n * Join the Matrix Values to a String\r\n *\r\n * @function join\r\n * @param {string} separator Specifies a string to separate each pair of adjacent elements of the array. The separator is converted to a string if necessary. If omitted, the array elements are separated with a comma (\",\"). If separator is an empty string, all elements are joined without any characters in between them.\r\n * @returns {string} A string with all array elements joined.\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.join = function(separator) {\r\n return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty]\r\n .map(hpf)\r\n .join(separator);\r\n };\r\n\r\n /**\r\n * Multiply the matrix with given Matrix\r\n *\r\n * @function multiply\r\n * @param matrix\r\n * @returns {Matrix}\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.multiply = function(matrix) {\r\n var sx = matrix.sx * this.sx + matrix.shy * this.shx;\r\n var shy = matrix.sx * this.shy + matrix.shy * this.sy;\r\n var shx = matrix.shx * this.sx + matrix.sy * this.shx;\r\n var sy = matrix.shx * this.shy + matrix.sy * this.sy;\r\n var tx = matrix.tx * this.sx + matrix.ty * this.shx + this.tx;\r\n var ty = matrix.tx * this.shy + matrix.ty * this.sy + this.ty;\r\n\r\n return new Matrix(sx, shy, shx, sy, tx, ty);\r\n };\r\n\r\n /**\r\n * @function decompose\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.decompose = function() {\r\n var a = this.sx;\r\n var b = this.shy;\r\n var c = this.shx;\r\n var d = this.sy;\r\n var e = this.tx;\r\n var f = this.ty;\r\n\r\n var scaleX = Math.sqrt(a * a + b * b);\r\n a /= scaleX;\r\n b /= scaleX;\r\n\r\n var shear = a * c + b * d;\r\n c -= a * shear;\r\n d -= b * shear;\r\n\r\n var scaleY = Math.sqrt(c * c + d * d);\r\n c /= scaleY;\r\n d /= scaleY;\r\n shear /= scaleY;\r\n\r\n if (a * d < b * c) {\r\n a = -a;\r\n b = -b;\r\n shear = -shear;\r\n scaleX = -scaleX;\r\n }\r\n\r\n return {\r\n scale: new Matrix(scaleX, 0, 0, scaleY, 0, 0),\r\n translate: new Matrix(1, 0, 0, 1, e, f),\r\n rotate: new Matrix(a, b, -b, a, 0, 0),\r\n skew: new Matrix(1, 0, shear, 1, 0, 0)\r\n };\r\n };\r\n\r\n /**\r\n * @function toString\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.toString = function(parmPrecision) {\r\n return this.join(\" \");\r\n };\r\n\r\n /**\r\n * @function inversed\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.inversed = function() {\r\n var a = this.sx,\r\n b = this.shy,\r\n c = this.shx,\r\n d = this.sy,\r\n e = this.tx,\r\n f = this.ty;\r\n\r\n var quot = 1 / (a * d - b * c);\r\n\r\n var aInv = d * quot;\r\n var bInv = -b * quot;\r\n var cInv = -c * quot;\r\n var dInv = a * quot;\r\n var eInv = -aInv * e - cInv * f;\r\n var fInv = -bInv * e - dInv * f;\r\n\r\n return new Matrix(aInv, bInv, cInv, dInv, eInv, fInv);\r\n };\r\n\r\n /**\r\n * @function applyToPoint\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.applyToPoint = function(pt) {\r\n var x = pt.x * this.sx + pt.y * this.shx + this.tx;\r\n var y = pt.x * this.shy + pt.y * this.sy + this.ty;\r\n return new Point(x, y);\r\n };\r\n\r\n /**\r\n * @function applyToRectangle\r\n * @memberof Matrix#\r\n */\r\n Matrix.prototype.applyToRectangle = function(rect) {\r\n var pt1 = this.applyToPoint(rect);\r\n var pt2 = this.applyToPoint(new Point(rect.x + rect.w, rect.y + rect.h));\r\n return new Rectangle(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);\r\n };\r\n\r\n /**\r\n * Clone the Matrix\r\n *\r\n * @function clone\r\n * @memberof Matrix#\r\n * @name clone\r\n * @instance\r\n */\r\n Matrix.prototype.clone = function() {\r\n var sx = this.sx;\r\n var shy = this.shy;\r\n var shx = this.shx;\r\n var sy = this.sy;\r\n var tx = this.tx;\r\n var ty = this.ty;\r\n\r\n return new Matrix(sx, shy, shx, sy, tx, ty);\r\n };\r\n\r\n API.Matrix = Matrix;\r\n\r\n /**\r\n * Multiplies two matrices. (see {@link Matrix})\r\n * @param {Matrix} m1\r\n * @param {Matrix} m2\r\n * @memberof jsPDF#\r\n * @name matrixMult\r\n */\r\n var matrixMult = (API.matrixMult = function(m1, m2) {\r\n return m2.multiply(m1);\r\n });\r\n\r\n /**\r\n * The identity matrix (equivalent to new Matrix(1, 0, 0, 1, 0, 0)).\r\n * @type {Matrix}\r\n * @memberof! jsPDF#\r\n * @name identityMatrix\r\n */\r\n var identityMatrix = new Matrix(1, 0, 0, 1, 0, 0);\r\n API.unitMatrix = API.identityMatrix = identityMatrix;\r\n\r\n /**\r\n * Adds a new pattern for later use.\r\n * @param {String} key The key by it can be referenced later. The keys must be unique!\r\n * @param {API.Pattern} pattern The pattern\r\n */\r\n var addPattern = function(key, pattern) {\r\n // only add it if it is not already present (the keys provided by the user must be unique!)\r\n if (patternMap[key]) return;\r\n\r\n var prefix = pattern instanceof ShadingPattern ? \"Sh\" : \"P\";\r\n var patternKey = prefix + (Object.keys(patterns).length + 1).toString(10);\r\n pattern.id = patternKey;\r\n\r\n patternMap[key] = patternKey;\r\n patterns[patternKey] = pattern;\r\n\r\n events.publish(\"addPattern\", pattern);\r\n };\r\n\r\n /**\r\n * A pattern describing a shading pattern.\r\n *\r\n * Only available in \"advanced\" API mode.\r\n *\r\n * @param {String} type One of \"axial\" or \"radial\"\r\n * @param {Array} coords Either [x1, y1, x2, y2] for \"axial\" type describing the two interpolation points\r\n * or [x1, y1, r, x2, y2, r2] for \"radial\" describing inner and the outer circle.\r\n * @param {Array} colors An array of objects with the fields \"offset\" and \"color\". \"offset\" describes\r\n * the offset in parameter space [0, 1]. \"color\" is an array of length 3 describing RGB values in [0, 255].\r\n * @param {GState=} gState An additional graphics state that gets applied to the pattern (optional).\r\n * @param {Matrix=} matrix A matrix that describes the transformation between the pattern coordinate system\r\n * and the use coordinate system (optional).\r\n * @constructor\r\n * @extends API.Pattern\r\n */\r\n API.ShadingPattern = ShadingPattern;\r\n\r\n /**\r\n * A PDF Tiling pattern.\r\n *\r\n * Only available in \"advanced\" API mode.\r\n *\r\n * @param {Array.} boundingBox The bounding box at which one pattern cell gets clipped.\r\n * @param {Number} xStep Horizontal spacing between pattern cells.\r\n * @param {Number} yStep Vertical spacing between pattern cells.\r\n * @param {API.GState=} gState An additional graphics state that gets applied to the pattern (optional).\r\n * @param {Matrix=} matrix A matrix that describes the transformation between the pattern coordinate system\r\n * and the use coordinate system (optional).\r\n * @constructor\r\n * @extends API.Pattern\r\n */\r\n API.TilingPattern = TilingPattern;\r\n\r\n /**\r\n * Adds a new {@link API.ShadingPattern} for later use. Only available in \"advanced\" API mode.\r\n * @param {String} key\r\n * @param {Pattern} pattern\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name addPattern\r\n */\r\n API.addShadingPattern = function(key, pattern) {\r\n advancedApiModeTrap(\"addShadingPattern()\");\r\n\r\n addPattern(key, pattern);\r\n return this;\r\n };\r\n\r\n /**\r\n * Begins a new tiling pattern. All subsequent render calls are drawn to this pattern until {@link API.endTilingPattern}\r\n * gets called. Only available in \"advanced\" API mode.\r\n * @param {API.Pattern} pattern\r\n * @memberof jsPDF#\r\n * @name beginTilingPattern\r\n */\r\n API.beginTilingPattern = function(pattern) {\r\n advancedApiModeTrap(\"beginTilingPattern()\");\r\n\r\n beginNewRenderTarget(\r\n pattern.boundingBox[0],\r\n pattern.boundingBox[1],\r\n pattern.boundingBox[2] - pattern.boundingBox[0],\r\n pattern.boundingBox[3] - pattern.boundingBox[1],\r\n pattern.matrix\r\n );\r\n };\r\n\r\n /**\r\n * Ends a tiling pattern and sets the render target to the one active before {@link API.beginTilingPattern} has been called.\r\n *\r\n * Only available in \"advanced\" API mode.\r\n *\r\n * @param {string} key A unique key that is used to reference this pattern at later use.\r\n * @param {API.Pattern} pattern The pattern to end.\r\n * @memberof jsPDF#\r\n * @name endTilingPattern\r\n */\r\n API.endTilingPattern = function(key, pattern) {\r\n advancedApiModeTrap(\"endTilingPattern()\");\r\n\r\n // retrieve the stream\r\n pattern.stream = pages[currentPage].join(\"\\n\");\r\n\r\n addPattern(key, pattern);\r\n\r\n events.publish(\"endTilingPattern\", pattern);\r\n\r\n // restore state from stack\r\n renderTargetStack.pop().restore();\r\n };\r\n\r\n var newObject = (API.__private__.newObject = function() {\r\n var oid = newObjectDeferred();\r\n newObjectDeferredBegin(oid, true);\r\n return oid;\r\n });\r\n\r\n // Does not output the object. The caller must call newObjectDeferredBegin(oid) before outputing any data\r\n var newObjectDeferred = (API.__private__.newObjectDeferred = function() {\r\n objectNumber++;\r\n offsets[objectNumber] = function() {\r\n return contentLength;\r\n };\r\n return objectNumber;\r\n });\r\n\r\n var newObjectDeferredBegin = function(oid, doOutput) {\r\n doOutput = typeof doOutput === \"boolean\" ? doOutput : false;\r\n offsets[oid] = contentLength;\r\n if (doOutput) {\r\n out(oid + \" 0 obj\");\r\n }\r\n return oid;\r\n };\r\n // Does not output the object until after the pages have been output.\r\n // Returns an object containing the objectId and content.\r\n // All pages have been added so the object ID can be estimated to start right after.\r\n // This does not modify the current objectNumber; It must be updated after the newObjects are output.\r\n var newAdditionalObject = (API.__private__.newAdditionalObject = function() {\r\n var objId = newObjectDeferred();\r\n var obj = {\r\n objId: objId,\r\n content: \"\"\r\n };\r\n additionalObjects.push(obj);\r\n return obj;\r\n });\r\n\r\n var rootDictionaryObjId = newObjectDeferred();\r\n var resourceDictionaryObjId = newObjectDeferred();\r\n\r\n /////////////////////\r\n // Private functions\r\n /////////////////////\r\n\r\n var decodeColorString = (API.__private__.decodeColorString = function(color) {\r\n var colorEncoded = color.split(\" \");\r\n if (\r\n colorEncoded.length === 2 &&\r\n (colorEncoded[1] === \"g\" || colorEncoded[1] === \"G\")\r\n ) {\r\n // convert grayscale value to rgb so that it can be converted to hex for consistency\r\n var floatVal = parseFloat(colorEncoded[0]);\r\n colorEncoded = [floatVal, floatVal, floatVal, \"r\"];\r\n } else if (\r\n colorEncoded.length === 5 &&\r\n (colorEncoded[4] === \"k\" || colorEncoded[4] === \"K\")\r\n ) {\r\n // convert CMYK values to rbg so that it can be converted to hex for consistency\r\n var red = (1.0 - colorEncoded[0]) * (1.0 - colorEncoded[3]);\r\n var green = (1.0 - colorEncoded[1]) * (1.0 - colorEncoded[3]);\r\n var blue = (1.0 - colorEncoded[2]) * (1.0 - colorEncoded[3]);\r\n\r\n colorEncoded = [red, green, blue, \"r\"];\r\n }\r\n var colorAsRGB = \"#\";\r\n for (var i = 0; i < 3; i++) {\r\n colorAsRGB += (\r\n \"0\" + Math.floor(parseFloat(colorEncoded[i]) * 255).toString(16)\r\n ).slice(-2);\r\n }\r\n return colorAsRGB;\r\n });\r\n\r\n var encodeColorString = (API.__private__.encodeColorString = function(\r\n options\r\n ) {\r\n var color;\r\n\r\n if (typeof options === \"string\") {\r\n options = {\r\n ch1: options\r\n };\r\n }\r\n var ch1 = options.ch1;\r\n var ch2 = options.ch2;\r\n var ch3 = options.ch3;\r\n var ch4 = options.ch4;\r\n var letterArray =\r\n options.pdfColorType === \"draw\" ? [\"G\", \"RG\", \"K\"] : [\"g\", \"rg\", \"k\"];\r\n\r\n if (typeof ch1 === \"string\" && ch1.charAt(0) !== \"#\") {\r\n var rgbColor = new RGBColor(ch1);\r\n if (rgbColor.ok) {\r\n ch1 = rgbColor.toHex();\r\n } else if (!/^\\d*\\.?\\d*$/.test(ch1)) {\r\n throw new Error(\r\n 'Invalid color \"' + ch1 + '\" passed to jsPDF.encodeColorString.'\r\n );\r\n }\r\n }\r\n //convert short rgb to long form\r\n if (typeof ch1 === \"string\" && /^#[0-9A-Fa-f]{3}$/.test(ch1)) {\r\n ch1 = \"#\" + ch1[1] + ch1[1] + ch1[2] + ch1[2] + ch1[3] + ch1[3];\r\n }\r\n\r\n if (typeof ch1 === \"string\" && /^#[0-9A-Fa-f]{6}$/.test(ch1)) {\r\n var hex = parseInt(ch1.substr(1), 16);\r\n ch1 = (hex >> 16) & 255;\r\n ch2 = (hex >> 8) & 255;\r\n ch3 = hex & 255;\r\n }\r\n\r\n if (\r\n typeof ch2 === \"undefined\" ||\r\n (typeof ch4 === \"undefined\" && ch1 === ch2 && ch2 === ch3)\r\n ) {\r\n // Gray color space.\r\n if (typeof ch1 === \"string\") {\r\n color = ch1 + \" \" + letterArray[0];\r\n } else {\r\n switch (options.precision) {\r\n case 2:\r\n color = f2(ch1 / 255) + \" \" + letterArray[0];\r\n break;\r\n case 3:\r\n default:\r\n color = f3(ch1 / 255) + \" \" + letterArray[0];\r\n }\r\n }\r\n } else if (typeof ch4 === \"undefined\" || typeof ch4 === \"object\") {\r\n // assume RGBA\r\n if (ch4 && !isNaN(ch4.a)) {\r\n //TODO Implement transparency.\r\n //WORKAROUND use white for now, if transparent, otherwise handle as rgb\r\n if (ch4.a === 0) {\r\n color = [\"1.\", \"1.\", \"1.\", letterArray[1]].join(\" \");\r\n return color;\r\n }\r\n }\r\n // assume RGB\r\n if (typeof ch1 === \"string\") {\r\n color = [ch1, ch2, ch3, letterArray[1]].join(\" \");\r\n } else {\r\n switch (options.precision) {\r\n case 2:\r\n color = [\r\n f2(ch1 / 255),\r\n f2(ch2 / 255),\r\n f2(ch3 / 255),\r\n letterArray[1]\r\n ].join(\" \");\r\n break;\r\n default:\r\n case 3:\r\n color = [\r\n f3(ch1 / 255),\r\n f3(ch2 / 255),\r\n f3(ch3 / 255),\r\n letterArray[1]\r\n ].join(\" \");\r\n }\r\n }\r\n } else {\r\n // assume CMYK\r\n if (typeof ch1 === \"string\") {\r\n color = [ch1, ch2, ch3, ch4, letterArray[2]].join(\" \");\r\n } else {\r\n switch (options.precision) {\r\n case 2:\r\n color = [f2(ch1), f2(ch2), f2(ch3), f2(ch4), letterArray[2]].join(\r\n \" \"\r\n );\r\n break;\r\n case 3:\r\n default:\r\n color = [f3(ch1), f3(ch2), f3(ch3), f3(ch4), letterArray[2]].join(\r\n \" \"\r\n );\r\n }\r\n }\r\n }\r\n return color;\r\n });\r\n\r\n var getFilters = (API.__private__.getFilters = function() {\r\n return filters;\r\n });\r\n\r\n var putStream = (API.__private__.putStream = function(options) {\r\n options = options || {};\r\n var data = options.data || \"\";\r\n var filters = options.filters || getFilters();\r\n var alreadyAppliedFilters = options.alreadyAppliedFilters || [];\r\n var addLength1 = options.addLength1 || false;\r\n var valueOfLength1 = data.length;\r\n var objectId = options.objectId;\r\n var encryptor = function(data) {\r\n return data;\r\n };\r\n if (encryptionOptions !== null && typeof objectId == \"undefined\") {\r\n throw new Error(\r\n \"ObjectId must be passed to putStream for file encryption\"\r\n );\r\n }\r\n if (encryptionOptions !== null) {\r\n encryptor = encryption.encryptor(objectId, 0);\r\n }\r\n\r\n var processedData = {};\r\n if (filters === true) {\r\n filters = [\"FlateEncode\"];\r\n }\r\n var keyValues = options.additionalKeyValues || [];\r\n if (typeof jsPDF.API.processDataByFilters !== \"undefined\") {\r\n processedData = jsPDF.API.processDataByFilters(data, filters);\r\n } else {\r\n processedData = { data: data, reverseChain: [] };\r\n }\r\n var filterAsString =\r\n processedData.reverseChain +\r\n (Array.isArray(alreadyAppliedFilters)\r\n ? alreadyAppliedFilters.join(\" \")\r\n : alreadyAppliedFilters.toString());\r\n\r\n if (processedData.data.length !== 0) {\r\n keyValues.push({\r\n key: \"Length\",\r\n value: processedData.data.length\r\n });\r\n if (addLength1 === true) {\r\n keyValues.push({\r\n key: \"Length1\",\r\n value: valueOfLength1\r\n });\r\n }\r\n }\r\n\r\n if (filterAsString.length != 0) {\r\n if (filterAsString.split(\"/\").length - 1 === 1) {\r\n keyValues.push({\r\n key: \"Filter\",\r\n value: filterAsString\r\n });\r\n } else {\r\n keyValues.push({\r\n key: \"Filter\",\r\n value: \"[\" + filterAsString + \"]\"\r\n });\r\n\r\n for (var j = 0; j < keyValues.length; j += 1) {\r\n if (keyValues[j].key === \"DecodeParms\") {\r\n var decodeParmsArray = [];\r\n\r\n for (\r\n var i = 0;\r\n i < processedData.reverseChain.split(\"/\").length - 1;\r\n i += 1\r\n ) {\r\n decodeParmsArray.push(\"null\");\r\n }\r\n\r\n decodeParmsArray.push(keyValues[j].value);\r\n keyValues[j].value = \"[\" + decodeParmsArray.join(\" \") + \"]\";\r\n }\r\n }\r\n }\r\n }\r\n\r\n out(\"<<\");\r\n for (var k = 0; k < keyValues.length; k++) {\r\n out(\"/\" + keyValues[k].key + \" \" + keyValues[k].value);\r\n }\r\n out(\">>\");\r\n if (processedData.data.length !== 0) {\r\n out(\"stream\");\r\n out(encryptor(processedData.data));\r\n out(\"endstream\");\r\n }\r\n });\r\n\r\n var putPage = (API.__private__.putPage = function(page) {\r\n var pageNumber = page.number;\r\n var data = page.data;\r\n var pageObjectNumber = page.objId;\r\n var pageContentsObjId = page.contentsObjId;\r\n\r\n newObjectDeferredBegin(pageObjectNumber, true);\r\n out(\"<>\");\r\n out(\"endobj\");\r\n // Page content\r\n var pageContent = data.join(\"\\n\");\r\n\r\n if (apiMode === ApiMode.ADVANCED) {\r\n // if the user forgot to switch back to COMPAT mode, we must balance the graphics stack again\r\n pageContent += \"\\nQ\";\r\n }\r\n\r\n newObjectDeferredBegin(pageContentsObjId, true);\r\n putStream({\r\n data: pageContent,\r\n filters: getFilters(),\r\n objectId: pageContentsObjId\r\n });\r\n out(\"endobj\");\r\n return pageObjectNumber;\r\n });\r\n\r\n var putPages = (API.__private__.putPages = function() {\r\n var n,\r\n i,\r\n pageObjectNumbers = [];\r\n\r\n for (n = 1; n <= page; n++) {\r\n pagesContext[n].objId = newObjectDeferred();\r\n pagesContext[n].contentsObjId = newObjectDeferred();\r\n }\r\n\r\n for (n = 1; n <= page; n++) {\r\n pageObjectNumbers.push(\r\n putPage({\r\n number: n,\r\n data: pages[n],\r\n objId: pagesContext[n].objId,\r\n contentsObjId: pagesContext[n].contentsObjId,\r\n mediaBox: pagesContext[n].mediaBox,\r\n cropBox: pagesContext[n].cropBox,\r\n bleedBox: pagesContext[n].bleedBox,\r\n trimBox: pagesContext[n].trimBox,\r\n artBox: pagesContext[n].artBox,\r\n userUnit: pagesContext[n].userUnit,\r\n rootDictionaryObjId: rootDictionaryObjId,\r\n resourceDictionaryObjId: resourceDictionaryObjId\r\n })\r\n );\r\n }\r\n newObjectDeferredBegin(rootDictionaryObjId, true);\r\n out(\"<>\");\r\n out(\"endobj\");\r\n events.publish(\"postPutPages\");\r\n });\r\n\r\n var putFont = function(font) {\r\n events.publish(\"putFont\", {\r\n font: font,\r\n out: out,\r\n newObject: newObject,\r\n putStream: putStream\r\n });\r\n\r\n if (font.isAlreadyPutted !== true) {\r\n font.objectNumber = newObject();\r\n out(\"<<\");\r\n out(\"/Type /Font\");\r\n out(\"/BaseFont /\" + toPDFName(font.postScriptName));\r\n out(\"/Subtype /Type1\");\r\n if (typeof font.encoding === \"string\") {\r\n out(\"/Encoding /\" + font.encoding);\r\n }\r\n out(\"/FirstChar 32\");\r\n out(\"/LastChar 255\");\r\n out(\">>\");\r\n out(\"endobj\");\r\n }\r\n };\r\n\r\n var putFonts = function() {\r\n for (var fontKey in fonts) {\r\n if (fonts.hasOwnProperty(fontKey)) {\r\n if (\r\n putOnlyUsedFonts === false ||\r\n (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))\r\n ) {\r\n putFont(fonts[fontKey]);\r\n }\r\n }\r\n }\r\n };\r\n\r\n var putXObject = function(xObject) {\r\n xObject.objectNumber = newObject();\r\n\r\n var options = [];\r\n options.push({ key: \"Type\", value: \"/XObject\" });\r\n options.push({ key: \"Subtype\", value: \"/Form\" });\r\n options.push({\r\n key: \"BBox\",\r\n value:\r\n \"[\" +\r\n [\r\n hpf(xObject.x),\r\n hpf(xObject.y),\r\n hpf(xObject.x + xObject.width),\r\n hpf(xObject.y + xObject.height)\r\n ].join(\" \") +\r\n \"]\"\r\n });\r\n options.push({\r\n key: \"Matrix\",\r\n value: \"[\" + xObject.matrix.toString() + \"]\"\r\n });\r\n // TODO: /Resources\r\n\r\n var stream = xObject.pages[1].join(\"\\n\");\r\n putStream({\r\n data: stream,\r\n additionalKeyValues: options,\r\n objectId: xObject.objectNumber\r\n });\r\n out(\"endobj\");\r\n };\r\n\r\n var putXObjects = function() {\r\n for (var xObjectKey in renderTargets) {\r\n if (renderTargets.hasOwnProperty(xObjectKey)) {\r\n putXObject(renderTargets[xObjectKey]);\r\n }\r\n }\r\n };\r\n\r\n var interpolateAndEncodeRGBStream = function(colors, numberSamples) {\r\n var tValues = [];\r\n var t;\r\n var dT = 1.0 / (numberSamples - 1);\r\n for (t = 0.0; t < 1.0; t += dT) {\r\n tValues.push(t);\r\n }\r\n tValues.push(1.0);\r\n // add first and last control point if not present\r\n if (colors[0].offset != 0.0) {\r\n var c0 = {\r\n offset: 0.0,\r\n color: colors[0].color\r\n };\r\n colors.unshift(c0);\r\n }\r\n if (colors[colors.length - 1].offset != 1.0) {\r\n var c1 = {\r\n offset: 1.0,\r\n color: colors[colors.length - 1].color\r\n };\r\n colors.push(c1);\r\n }\r\n var out = \"\";\r\n var index = 0;\r\n\r\n for (var i = 0; i < tValues.length; i++) {\r\n t = tValues[i];\r\n while (t > colors[index + 1].offset) index++;\r\n var a = colors[index].offset;\r\n var b = colors[index + 1].offset;\r\n var d = (t - a) / (b - a);\r\n\r\n var aColor = colors[index].color;\r\n var bColor = colors[index + 1].color;\r\n\r\n out +=\r\n padd2Hex(Math.round((1 - d) * aColor[0] + d * bColor[0]).toString(16)) +\r\n padd2Hex(Math.round((1 - d) * aColor[1] + d * bColor[1]).toString(16)) +\r\n padd2Hex(Math.round((1 - d) * aColor[2] + d * bColor[2]).toString(16));\r\n }\r\n return out.trim();\r\n };\r\n\r\n var putShadingPattern = function(pattern, numberSamples) {\r\n /*\r\n Axial patterns shade between the two points specified in coords, radial patterns between the inner\r\n and outer circle.\r\n The user can specify an array (colors) that maps t-Values in [0, 1] to RGB colors. These are now\r\n interpolated to equidistant samples and written to pdf as a sample (type 0) function.\r\n */\r\n // The number of color samples that should be used to describe the shading.\r\n // The higher, the more accurate the gradient will be.\r\n numberSamples || (numberSamples = 21);\r\n var funcObjectNumber = newObject();\r\n var stream = interpolateAndEncodeRGBStream(pattern.colors, numberSamples);\r\n\r\n var options = [];\r\n options.push({ key: \"FunctionType\", value: \"0\" });\r\n options.push({ key: \"Domain\", value: \"[0.0 1.0]\" });\r\n options.push({ key: \"Size\", value: \"[\" + numberSamples + \"]\" });\r\n options.push({ key: \"BitsPerSample\", value: \"8\" });\r\n options.push({ key: \"Range\", value: \"[0.0 1.0 0.0 1.0 0.0 1.0]\" });\r\n options.push({ key: \"Decode\", value: \"[0.0 1.0 0.0 1.0 0.0 1.0]\" });\r\n\r\n putStream({\r\n data: stream,\r\n additionalKeyValues: options,\r\n alreadyAppliedFilters: [\"/ASCIIHexDecode\"],\r\n objectId: funcObjectNumber\r\n });\r\n out(\"endobj\");\r\n\r\n pattern.objectNumber = newObject();\r\n out(\"<< /ShadingType \" + pattern.type);\r\n out(\"/ColorSpace /DeviceRGB\");\r\n var coords =\r\n \"/Coords [\" +\r\n hpf(parseFloat(pattern.coords[0])) +\r\n \" \" + // x1\r\n hpf(parseFloat(pattern.coords[1])) +\r\n \" \"; // y1\r\n if (pattern.type === 2) {\r\n // axial\r\n coords +=\r\n hpf(parseFloat(pattern.coords[2])) +\r\n \" \" + // x2\r\n hpf(parseFloat(pattern.coords[3])); // y2\r\n } else {\r\n // radial\r\n coords +=\r\n hpf(parseFloat(pattern.coords[2])) +\r\n \" \" + // r1\r\n hpf(parseFloat(pattern.coords[3])) +\r\n \" \" + // x2\r\n hpf(parseFloat(pattern.coords[4])) +\r\n \" \" + // y2\r\n hpf(parseFloat(pattern.coords[5])); // r2\r\n }\r\n coords += \"]\";\r\n out(coords);\r\n\r\n if (pattern.matrix) {\r\n out(\"/Matrix [\" + pattern.matrix.toString() + \"]\");\r\n }\r\n out(\"/Function \" + funcObjectNumber + \" 0 R\");\r\n out(\"/Extend [true true]\");\r\n out(\">>\");\r\n out(\"endobj\");\r\n };\r\n\r\n var putTilingPattern = function(pattern, deferredResourceDictionaryIds) {\r\n var resourcesObjectId = newObjectDeferred();\r\n var patternObjectId = newObject();\r\n\r\n deferredResourceDictionaryIds.push({\r\n resourcesOid: resourcesObjectId,\r\n objectOid: patternObjectId\r\n });\r\n\r\n pattern.objectNumber = patternObjectId;\r\n var options = [];\r\n options.push({ key: \"Type\", value: \"/Pattern\" });\r\n options.push({ key: \"PatternType\", value: \"1\" }); // tiling pattern\r\n options.push({ key: \"PaintType\", value: \"1\" }); // colored tiling pattern\r\n options.push({ key: \"TilingType\", value: \"1\" }); // constant spacing\r\n options.push({\r\n key: \"BBox\",\r\n value: \"[\" + pattern.boundingBox.map(hpf).join(\" \") + \"]\"\r\n });\r\n options.push({ key: \"XStep\", value: hpf(pattern.xStep) });\r\n options.push({ key: \"YStep\", value: hpf(pattern.yStep) });\r\n options.push({ key: \"Resources\", value: resourcesObjectId + \" 0 R\" });\r\n if (pattern.matrix) {\r\n options.push({\r\n key: \"Matrix\",\r\n value: \"[\" + pattern.matrix.toString() + \"]\"\r\n });\r\n }\r\n\r\n putStream({\r\n data: pattern.stream,\r\n additionalKeyValues: options,\r\n objectId: pattern.objectNumber\r\n });\r\n out(\"endobj\");\r\n };\r\n\r\n var putPatterns = function(deferredResourceDictionaryIds) {\r\n var patternKey;\r\n for (patternKey in patterns) {\r\n if (patterns.hasOwnProperty(patternKey)) {\r\n if (patterns[patternKey] instanceof ShadingPattern) {\r\n putShadingPattern(patterns[patternKey]);\r\n } else if (patterns[patternKey] instanceof TilingPattern) {\r\n putTilingPattern(patterns[patternKey], deferredResourceDictionaryIds);\r\n }\r\n }\r\n }\r\n };\r\n\r\n var putGState = function(gState) {\r\n gState.objectNumber = newObject();\r\n out(\"<<\");\r\n for (var p in gState) {\r\n switch (p) {\r\n case \"opacity\":\r\n out(\"/ca \" + f2(gState[p]));\r\n break;\r\n case \"stroke-opacity\":\r\n out(\"/CA \" + f2(gState[p]));\r\n break;\r\n }\r\n }\r\n out(\">>\");\r\n out(\"endobj\");\r\n };\r\n\r\n var putGStates = function() {\r\n var gStateKey;\r\n for (gStateKey in gStates) {\r\n if (gStates.hasOwnProperty(gStateKey)) {\r\n putGState(gStates[gStateKey]);\r\n }\r\n }\r\n };\r\n\r\n var putXobjectDict = function() {\r\n out(\"/XObject <<\");\r\n for (var xObjectKey in renderTargets) {\r\n if (\r\n renderTargets.hasOwnProperty(xObjectKey) &&\r\n renderTargets[xObjectKey].objectNumber >= 0\r\n ) {\r\n out(\r\n \"/\" +\r\n xObjectKey +\r\n \" \" +\r\n renderTargets[xObjectKey].objectNumber +\r\n \" 0 R\"\r\n );\r\n }\r\n }\r\n\r\n // Loop through images, or other data objects\r\n events.publish(\"putXobjectDict\");\r\n out(\">>\");\r\n };\r\n\r\n var putEncryptionDict = function() {\r\n encryption.oid = newObject();\r\n out(\"<<\");\r\n out(\"/Filter /Standard\");\r\n out(\"/V \" + encryption.v);\r\n out(\"/R \" + encryption.r);\r\n out(\"/U <\" + encryption.toHexString(encryption.U) + \">\");\r\n out(\"/O <\" + encryption.toHexString(encryption.O) + \">\");\r\n out(\"/P \" + encryption.P);\r\n out(\">>\");\r\n out(\"endobj\");\r\n };\r\n\r\n var putFontDict = function() {\r\n out(\"/Font <<\");\r\n\r\n for (var fontKey in fonts) {\r\n if (fonts.hasOwnProperty(fontKey)) {\r\n if (\r\n putOnlyUsedFonts === false ||\r\n (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))\r\n ) {\r\n out(\"/\" + fontKey + \" \" + fonts[fontKey].objectNumber + \" 0 R\");\r\n }\r\n }\r\n }\r\n out(\">>\");\r\n };\r\n\r\n var putShadingPatternDict = function() {\r\n if (Object.keys(patterns).length > 0) {\r\n out(\"/Shading <<\");\r\n for (var patternKey in patterns) {\r\n if (\r\n patterns.hasOwnProperty(patternKey) &&\r\n patterns[patternKey] instanceof ShadingPattern &&\r\n patterns[patternKey].objectNumber >= 0\r\n ) {\r\n out(\r\n \"/\" + patternKey + \" \" + patterns[patternKey].objectNumber + \" 0 R\"\r\n );\r\n }\r\n }\r\n\r\n events.publish(\"putShadingPatternDict\");\r\n out(\">>\");\r\n }\r\n };\r\n\r\n var putTilingPatternDict = function(objectOid) {\r\n if (Object.keys(patterns).length > 0) {\r\n out(\"/Pattern <<\");\r\n for (var patternKey in patterns) {\r\n if (\r\n patterns.hasOwnProperty(patternKey) &&\r\n patterns[patternKey] instanceof API.TilingPattern &&\r\n patterns[patternKey].objectNumber >= 0 &&\r\n patterns[patternKey].objectNumber < objectOid // prevent cyclic dependencies\r\n ) {\r\n out(\r\n \"/\" + patternKey + \" \" + patterns[patternKey].objectNumber + \" 0 R\"\r\n );\r\n }\r\n }\r\n events.publish(\"putTilingPatternDict\");\r\n out(\">>\");\r\n }\r\n };\r\n\r\n var putGStatesDict = function() {\r\n if (Object.keys(gStates).length > 0) {\r\n var gStateKey;\r\n out(\"/ExtGState <<\");\r\n for (gStateKey in gStates) {\r\n if (\r\n gStates.hasOwnProperty(gStateKey) &&\r\n gStates[gStateKey].objectNumber >= 0\r\n ) {\r\n out(\"/\" + gStateKey + \" \" + gStates[gStateKey].objectNumber + \" 0 R\");\r\n }\r\n }\r\n\r\n events.publish(\"putGStateDict\");\r\n out(\">>\");\r\n }\r\n };\r\n\r\n var putResourceDictionary = function(objectIds) {\r\n newObjectDeferredBegin(objectIds.resourcesOid, true);\r\n out(\"<<\");\r\n out(\"/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\");\r\n putFontDict();\r\n putShadingPatternDict();\r\n putTilingPatternDict(objectIds.objectOid);\r\n putGStatesDict();\r\n putXobjectDict();\r\n out(\">>\");\r\n out(\"endobj\");\r\n };\r\n\r\n var putResources = function() {\r\n // FormObjects, Patterns etc. might use other FormObjects/Patterns/Images\r\n // which means their resource dictionaries must contain the already resolved\r\n // object ids. For this reason we defer the serialization of the resource\r\n // dicts until all objects have been serialized and have object ids.\r\n //\r\n // In order to prevent cyclic dependencies (which Adobe Reader doesn't like),\r\n // we only put all oids that are smaller than the oid of the object the\r\n // resource dict belongs to. This is correct behavior, since the streams\r\n // may only use other objects that have already been defined and thus appear\r\n // earlier in their respective collection.\r\n // Currently, this only affects tiling patterns, but a (more) correct\r\n // implementation of FormObjects would also define their own resource dicts.\r\n var deferredResourceDictionaryIds = [];\r\n\r\n putFonts();\r\n putGStates();\r\n putXObjects();\r\n putPatterns(deferredResourceDictionaryIds);\r\n\r\n events.publish(\"putResources\");\r\n deferredResourceDictionaryIds.forEach(putResourceDictionary);\r\n putResourceDictionary({\r\n resourcesOid: resourceDictionaryObjId,\r\n objectOid: Number.MAX_SAFE_INTEGER // output all objects\r\n });\r\n events.publish(\"postPutResources\");\r\n };\r\n\r\n var putAdditionalObjects = function() {\r\n events.publish(\"putAdditionalObjects\");\r\n for (var i = 0; i < additionalObjects.length; i++) {\r\n var obj = additionalObjects[i];\r\n newObjectDeferredBegin(obj.objId, true);\r\n out(obj.content);\r\n out(\"endobj\");\r\n }\r\n events.publish(\"postPutAdditionalObjects\");\r\n };\r\n\r\n var addFontToFontDictionary = function(font) {\r\n fontmap[font.fontName] = fontmap[font.fontName] || {};\r\n fontmap[font.fontName][font.fontStyle] = font.id;\r\n };\r\n\r\n var addFont = function(\r\n postScriptName,\r\n fontName,\r\n fontStyle,\r\n encoding,\r\n isStandardFont\r\n ) {\r\n var font = {\r\n id: \"F\" + (Object.keys(fonts).length + 1).toString(10),\r\n postScriptName: postScriptName,\r\n fontName: fontName,\r\n fontStyle: fontStyle,\r\n encoding: encoding,\r\n isStandardFont: isStandardFont || false,\r\n metadata: {}\r\n };\r\n\r\n events.publish(\"addFont\", {\r\n font: font,\r\n instance: this\r\n });\r\n\r\n fonts[font.id] = font;\r\n addFontToFontDictionary(font);\r\n return font.id;\r\n };\r\n\r\n var addFonts = function(arrayOfFonts) {\r\n for (var i = 0, l = standardFonts.length; i < l; i++) {\r\n var fontKey = addFont.call(\r\n this,\r\n arrayOfFonts[i][0],\r\n arrayOfFonts[i][1],\r\n arrayOfFonts[i][2],\r\n standardFonts[i][3],\r\n true\r\n );\r\n\r\n if (putOnlyUsedFonts === false) {\r\n usedFonts[fontKey] = true;\r\n }\r\n // adding aliases for standard fonts, this time matching the capitalization\r\n var parts = arrayOfFonts[i][0].split(\"-\");\r\n addFontToFontDictionary({\r\n id: fontKey,\r\n fontName: parts[0],\r\n fontStyle: parts[1] || \"\"\r\n });\r\n }\r\n events.publish(\"addFonts\", {\r\n fonts: fonts,\r\n dictionary: fontmap\r\n });\r\n };\r\n\r\n var SAFE = function __safeCall(fn) {\r\n fn.foo = function __safeCallWrapper() {\r\n try {\r\n return fn.apply(this, arguments);\r\n } catch (e) {\r\n var stack = e.stack || \"\";\r\n if (~stack.indexOf(\" at \")) stack = stack.split(\" at \")[1];\r\n var m =\r\n \"Error in function \" +\r\n stack.split(\"\\n\")[0].split(\"<\")[0] +\r\n \": \" +\r\n e.message;\r\n if (globalObject.console) {\r\n globalObject.console.error(m, e);\r\n if (globalObject.alert) alert(m);\r\n } else {\r\n throw new Error(m);\r\n }\r\n }\r\n };\r\n fn.foo.bar = fn;\r\n return fn.foo;\r\n };\r\n\r\n var to8bitStream = function(text, flags) {\r\n /**\r\n * PDF 1.3 spec:\r\n * \"For text strings encoded in Unicode, the first two bytes must be 254 followed by\r\n * 255, representing the Unicode byte order marker, U+FEFF. (This sequence conflicts\r\n * with the PDFDocEncoding character sequence thorn ydieresis, which is unlikely\r\n * to be a meaningful beginning of a word or phrase.) The remainder of the\r\n * string consists of Unicode character codes, according to the UTF-16 encoding\r\n * specified in the Unicode standard, version 2.0. Commonly used Unicode values\r\n * are represented as 2 bytes per character, with the high-order byte appearing first\r\n * in the string.\"\r\n *\r\n * In other words, if there are chars in a string with char code above 255, we\r\n * recode the string to UCS2 BE - string doubles in length and BOM is prepended.\r\n *\r\n * HOWEVER!\r\n * Actual *content* (body) text (as opposed to strings used in document properties etc)\r\n * does NOT expect BOM. There, it is treated as a literal GID (Glyph ID)\r\n *\r\n * Because of Adobe's focus on \"you subset your fonts!\" you are not supposed to have\r\n * a font that maps directly Unicode (UCS2 / UTF16BE) code to font GID, but you could\r\n * fudge it with \"Identity-H\" encoding and custom CIDtoGID map that mimics Unicode\r\n * code page. There, however, all characters in the stream are treated as GIDs,\r\n * including BOM, which is the reason we need to skip BOM in content text (i.e. that\r\n * that is tied to a font).\r\n *\r\n * To signal this \"special\" PDFEscape / to8bitStream handling mode,\r\n * API.text() function sets (unless you overwrite it with manual values\r\n * given to API.text(.., flags) )\r\n * flags.autoencode = true\r\n * flags.noBOM = true\r\n *\r\n * ===================================================================================\r\n * `flags` properties relied upon:\r\n * .sourceEncoding = string with encoding label.\r\n * \"Unicode\" by default. = encoding of the incoming text.\r\n * pass some non-existing encoding name\r\n * (ex: 'Do not touch my strings! I know what I am doing.')\r\n * to make encoding code skip the encoding step.\r\n * .outputEncoding = Either valid PDF encoding name\r\n * (must be supported by jsPDF font metrics, otherwise no encoding)\r\n * or a JS object, where key = sourceCharCode, value = outputCharCode\r\n * missing keys will be treated as: sourceCharCode === outputCharCode\r\n * .noBOM\r\n * See comment higher above for explanation for why this is important\r\n * .autoencode\r\n * See comment higher above for explanation for why this is important\r\n */\r\n\r\n var i,\r\n l,\r\n sourceEncoding,\r\n encodingBlock,\r\n outputEncoding,\r\n newtext,\r\n isUnicode,\r\n ch,\r\n bch;\r\n\r\n flags = flags || {};\r\n sourceEncoding = flags.sourceEncoding || \"Unicode\";\r\n outputEncoding = flags.outputEncoding;\r\n\r\n // This 'encoding' section relies on font metrics format\r\n // attached to font objects by, among others,\r\n // \"Willow Systems' standard_font_metrics plugin\"\r\n // see jspdf.plugin.standard_font_metrics.js for format\r\n // of the font.metadata.encoding Object.\r\n // It should be something like\r\n // .encoding = {'codePages':['WinANSI....'], 'WinANSI...':{code:code, ...}}\r\n // .widths = {0:width, code:width, ..., 'fof':divisor}\r\n // .kerning = {code:{previous_char_code:shift, ..., 'fof':-divisor},...}\r\n if (\r\n (flags.autoencode || outputEncoding) &&\r\n fonts[activeFontKey].metadata &&\r\n fonts[activeFontKey].metadata[sourceEncoding] &&\r\n fonts[activeFontKey].metadata[sourceEncoding].encoding\r\n ) {\r\n encodingBlock = fonts[activeFontKey].metadata[sourceEncoding].encoding;\r\n\r\n // each font has default encoding. Some have it clearly defined.\r\n if (!outputEncoding && fonts[activeFontKey].encoding) {\r\n outputEncoding = fonts[activeFontKey].encoding;\r\n }\r\n\r\n // Hmmm, the above did not work? Let's try again, in different place.\r\n if (!outputEncoding && encodingBlock.codePages) {\r\n outputEncoding = encodingBlock.codePages[0]; // let's say, first one is the default\r\n }\r\n\r\n if (typeof outputEncoding === \"string\") {\r\n outputEncoding = encodingBlock[outputEncoding];\r\n }\r\n // we want output encoding to be a JS Object, where\r\n // key = sourceEncoding's character code and\r\n // value = outputEncoding's character code.\r\n if (outputEncoding) {\r\n isUnicode = false;\r\n newtext = [];\r\n for (i = 0, l = text.length; i < l; i++) {\r\n ch = outputEncoding[text.charCodeAt(i)];\r\n if (ch) {\r\n newtext.push(String.fromCharCode(ch));\r\n } else {\r\n newtext.push(text[i]);\r\n }\r\n\r\n // since we are looping over chars anyway, might as well\r\n // check for residual unicodeness\r\n if (newtext[i].charCodeAt(0) >> 8) {\r\n /* more than 255 */\r\n isUnicode = true;\r\n }\r\n }\r\n text = newtext.join(\"\");\r\n }\r\n }\r\n\r\n i = text.length;\r\n // isUnicode may be set to false above. Hence the triple-equal to undefined\r\n while (isUnicode === undefined && i !== 0) {\r\n if (text.charCodeAt(i - 1) >> 8) {\r\n /* more than 255 */\r\n isUnicode = true;\r\n }\r\n i--;\r\n }\r\n if (!isUnicode) {\r\n return text;\r\n }\r\n\r\n newtext = flags.noBOM ? [] : [254, 255];\r\n for (i = 0, l = text.length; i < l; i++) {\r\n ch = text.charCodeAt(i);\r\n bch = ch >> 8; // divide by 256\r\n if (bch >> 8) {\r\n /* something left after dividing by 256 second time */\r\n throw new Error(\r\n \"Character at position \" +\r\n i +\r\n \" of string '\" +\r\n text +\r\n \"' exceeds 16bits. Cannot be encoded into UCS-2 BE\"\r\n );\r\n }\r\n newtext.push(bch);\r\n newtext.push(ch - (bch << 8));\r\n }\r\n return String.fromCharCode.apply(undefined, newtext);\r\n };\r\n\r\n var pdfEscape = (API.__private__.pdfEscape = API.pdfEscape = function(\r\n text,\r\n flags\r\n ) {\r\n /**\r\n * Replace '/', '(', and ')' with pdf-safe versions\r\n *\r\n * Doing to8bitStream does NOT make this PDF display unicode text. For that\r\n * we also need to reference a unicode font and embed it - royal pain in the rear.\r\n *\r\n * There is still a benefit to to8bitStream - PDF simply cannot handle 16bit chars,\r\n * which JavaScript Strings are happy to provide. So, while we still cannot display\r\n * 2-byte characters property, at least CONDITIONALLY converting (entire string containing)\r\n * 16bit chars to (USC-2-BE) 2-bytes per char + BOM streams we ensure that entire PDF\r\n * is still parseable.\r\n * This will allow immediate support for unicode in document properties strings.\r\n */\r\n return to8bitStream(text, flags)\r\n .replace(/\\\\/g, \"\\\\\\\\\")\r\n .replace(/\\(/g, \"\\\\(\")\r\n .replace(/\\)/g, \"\\\\)\");\r\n });\r\n\r\n var beginPage = (API.__private__.beginPage = function(format) {\r\n pages[++page] = [];\r\n pagesContext[page] = {\r\n objId: 0,\r\n contentsObjId: 0,\r\n userUnit: Number(userUnit),\r\n artBox: null,\r\n bleedBox: null,\r\n cropBox: null,\r\n trimBox: null,\r\n mediaBox: {\r\n bottomLeftX: 0,\r\n bottomLeftY: 0,\r\n topRightX: Number(format[0]),\r\n topRightY: Number(format[1])\r\n }\r\n };\r\n _setPage(page);\r\n setOutputDestination(pages[currentPage]);\r\n });\r\n\r\n var _addPage = function(parmFormat, parmOrientation) {\r\n var dimensions, width, height;\r\n\r\n orientation = parmOrientation || orientation;\r\n\r\n if (typeof parmFormat === \"string\") {\r\n dimensions = getPageFormat(parmFormat.toLowerCase());\r\n if (Array.isArray(dimensions)) {\r\n width = dimensions[0];\r\n height = dimensions[1];\r\n }\r\n }\r\n\r\n if (Array.isArray(parmFormat)) {\r\n width = parmFormat[0] * scaleFactor;\r\n height = parmFormat[1] * scaleFactor;\r\n }\r\n\r\n if (isNaN(width)) {\r\n width = format[0];\r\n height = format[1];\r\n }\r\n\r\n if (width > 14400 || height > 14400) {\r\n console.warn(\r\n \"A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400\"\r\n );\r\n width = Math.min(14400, width);\r\n height = Math.min(14400, height);\r\n }\r\n\r\n format = [width, height];\r\n\r\n switch (orientation.substr(0, 1)) {\r\n case \"l\":\r\n if (height > width) {\r\n format = [height, width];\r\n }\r\n break;\r\n case \"p\":\r\n if (width > height) {\r\n format = [height, width];\r\n }\r\n break;\r\n }\r\n\r\n beginPage(format);\r\n\r\n // Set line width\r\n setLineWidth(lineWidth);\r\n // Set draw color\r\n out(strokeColor);\r\n // resurrecting non-default line caps, joins\r\n if (lineCapID !== 0) {\r\n out(lineCapID + \" J\");\r\n }\r\n if (lineJoinID !== 0) {\r\n out(lineJoinID + \" j\");\r\n }\r\n events.publish(\"addPage\", {\r\n pageNumber: page\r\n });\r\n };\r\n\r\n var _deletePage = function(n) {\r\n if (n > 0 && n <= page) {\r\n pages.splice(n, 1);\r\n pagesContext.splice(n, 1);\r\n page--;\r\n if (currentPage > page) {\r\n currentPage = page;\r\n }\r\n this.setPage(currentPage);\r\n }\r\n };\r\n\r\n var _setPage = function(n) {\r\n if (n > 0 && n <= page) {\r\n currentPage = n;\r\n }\r\n };\r\n\r\n var getNumberOfPages = (API.__private__.getNumberOfPages = API.getNumberOfPages = function() {\r\n return pages.length - 1;\r\n });\r\n\r\n /**\r\n * Returns a document-specific font key - a label assigned to a\r\n * font name + font type combination at the time the font was added\r\n * to the font inventory.\r\n *\r\n * Font key is used as label for the desired font for a block of text\r\n * to be added to the PDF document stream.\r\n * @private\r\n * @function\r\n * @param fontName {string} can be undefined on \"falthy\" to indicate \"use current\"\r\n * @param fontStyle {string} can be undefined on \"falthy\" to indicate \"use current\"\r\n * @returns {string} Font key.\r\n * @ignore\r\n */\r\n var getFont = function(fontName, fontStyle, options) {\r\n var key = undefined,\r\n fontNameLowerCase;\r\n options = options || {};\r\n\r\n fontName =\r\n fontName !== undefined ? fontName : fonts[activeFontKey].fontName;\r\n fontStyle =\r\n fontStyle !== undefined ? fontStyle : fonts[activeFontKey].fontStyle;\r\n fontNameLowerCase = fontName.toLowerCase();\r\n\r\n if (\r\n fontmap[fontNameLowerCase] !== undefined &&\r\n fontmap[fontNameLowerCase][fontStyle] !== undefined\r\n ) {\r\n key = fontmap[fontNameLowerCase][fontStyle];\r\n } else if (\r\n fontmap[fontName] !== undefined &&\r\n fontmap[fontName][fontStyle] !== undefined\r\n ) {\r\n key = fontmap[fontName][fontStyle];\r\n } else {\r\n if (options.disableWarning === false) {\r\n console.warn(\r\n \"Unable to look up font label for font '\" +\r\n fontName +\r\n \"', '\" +\r\n fontStyle +\r\n \"'. Refer to getFontList() for available fonts.\"\r\n );\r\n }\r\n }\r\n\r\n if (!key && !options.noFallback) {\r\n key = fontmap[\"times\"][fontStyle];\r\n if (key == null) {\r\n key = fontmap[\"times\"][\"normal\"];\r\n }\r\n }\r\n return key;\r\n };\r\n\r\n var putInfo = (API.__private__.putInfo = function() {\r\n var objectId = newObject();\r\n var encryptor = function(data) {\r\n return data;\r\n };\r\n if (encryptionOptions !== null) {\r\n encryptor = encryption.encryptor(objectId, 0);\r\n }\r\n out(\"<<\");\r\n out(\"/Producer (\" + pdfEscape(encryptor(\"jsPDF \" + jsPDF.version)) + \")\");\r\n for (var key in documentProperties) {\r\n if (documentProperties.hasOwnProperty(key) && documentProperties[key]) {\r\n out(\r\n \"/\" +\r\n key.substr(0, 1).toUpperCase() +\r\n key.substr(1) +\r\n \" (\" +\r\n pdfEscape(encryptor(documentProperties[key])) +\r\n \")\"\r\n );\r\n }\r\n }\r\n out(\"/CreationDate (\" + pdfEscape(encryptor(creationDate)) + \")\");\r\n out(\">>\");\r\n out(\"endobj\");\r\n });\r\n\r\n var putCatalog = (API.__private__.putCatalog = function(options) {\r\n options = options || {};\r\n var tmpRootDictionaryObjId =\r\n options.rootDictionaryObjId || rootDictionaryObjId;\r\n newObject();\r\n out(\"<<\");\r\n out(\"/Type /Catalog\");\r\n out(\"/Pages \" + tmpRootDictionaryObjId + \" 0 R\");\r\n // PDF13ref Section 7.2.1\r\n if (!zoomMode) zoomMode = \"fullwidth\";\r\n switch (zoomMode) {\r\n case \"fullwidth\":\r\n out(\"/OpenAction [3 0 R /FitH null]\");\r\n break;\r\n case \"fullheight\":\r\n out(\"/OpenAction [3 0 R /FitV null]\");\r\n break;\r\n case \"fullpage\":\r\n out(\"/OpenAction [3 0 R /Fit]\");\r\n break;\r\n case \"original\":\r\n out(\"/OpenAction [3 0 R /XYZ null null 1]\");\r\n break;\r\n default:\r\n var pcn = \"\" + zoomMode;\r\n if (pcn.substr(pcn.length - 1) === \"%\")\r\n zoomMode = parseInt(zoomMode) / 100;\r\n if (typeof zoomMode === \"number\") {\r\n out(\"/OpenAction [3 0 R /XYZ null null \" + f2(zoomMode) + \"]\");\r\n }\r\n }\r\n if (!layoutMode) layoutMode = \"continuous\";\r\n switch (layoutMode) {\r\n case \"continuous\":\r\n out(\"/PageLayout /OneColumn\");\r\n break;\r\n case \"single\":\r\n out(\"/PageLayout /SinglePage\");\r\n break;\r\n case \"two\":\r\n case \"twoleft\":\r\n out(\"/PageLayout /TwoColumnLeft\");\r\n break;\r\n case \"tworight\":\r\n out(\"/PageLayout /TwoColumnRight\");\r\n break;\r\n }\r\n if (pageMode) {\r\n /**\r\n * A name object specifying how the document should be displayed when opened:\r\n * UseNone : Neither document outline nor thumbnail images visible -- DEFAULT\r\n * UseOutlines : Document outline visible\r\n * UseThumbs : Thumbnail images visible\r\n * FullScreen : Full-screen mode, with no menu bar, window controls, or any other window visible\r\n */\r\n out(\"/PageMode /\" + pageMode);\r\n }\r\n events.publish(\"putCatalog\");\r\n out(\">>\");\r\n out(\"endobj\");\r\n });\r\n\r\n var putTrailer = (API.__private__.putTrailer = function() {\r\n out(\"trailer\");\r\n out(\"<<\");\r\n out(\"/Size \" + (objectNumber + 1));\r\n // Root and Info must be the last and second last objects written respectively\r\n out(\"/Root \" + objectNumber + \" 0 R\");\r\n out(\"/Info \" + (objectNumber - 1) + \" 0 R\");\r\n if (encryptionOptions !== null) {\r\n out(\"/Encrypt \" + encryption.oid + \" 0 R\");\r\n }\r\n out(\"/ID [ <\" + fileId + \"> <\" + fileId + \"> ]\");\r\n out(\">>\");\r\n });\r\n\r\n var putHeader = (API.__private__.putHeader = function() {\r\n out(\"%PDF-\" + pdfVersion);\r\n out(\"%\\xBA\\xDF\\xAC\\xE0\");\r\n });\r\n\r\n var putXRef = (API.__private__.putXRef = function() {\r\n var p = \"0000000000\";\r\n\r\n out(\"xref\");\r\n out(\"0 \" + (objectNumber + 1));\r\n out(\"0000000000 65535 f \");\r\n for (var i = 1; i <= objectNumber; i++) {\r\n var offset = offsets[i];\r\n if (typeof offset === \"function\") {\r\n out((p + offsets[i]()).slice(-10) + \" 00000 n \");\r\n } else {\r\n if (typeof offsets[i] !== \"undefined\") {\r\n out((p + offsets[i]).slice(-10) + \" 00000 n \");\r\n } else {\r\n out(\"0000000000 00000 n \");\r\n }\r\n }\r\n }\r\n });\r\n\r\n var buildDocument = (API.__private__.buildDocument = function() {\r\n resetDocument();\r\n setOutputDestination(content);\r\n\r\n events.publish(\"buildDocument\");\r\n\r\n putHeader();\r\n putPages();\r\n putAdditionalObjects();\r\n putResources();\r\n if (encryptionOptions !== null) putEncryptionDict();\r\n putInfo();\r\n putCatalog();\r\n\r\n var offsetOfXRef = contentLength;\r\n putXRef();\r\n putTrailer();\r\n out(\"startxref\");\r\n out(\"\" + offsetOfXRef);\r\n out(\"%%EOF\");\r\n\r\n setOutputDestination(pages[currentPage]);\r\n\r\n return content.join(\"\\n\");\r\n });\r\n\r\n var getBlob = (API.__private__.getBlob = function(data) {\r\n return new Blob([getArrayBuffer(data)], {\r\n type: \"application/pdf\"\r\n });\r\n });\r\n\r\n /**\r\n * Generates the PDF document.\r\n *\r\n * If `type` argument is undefined, output is raw body of resulting PDF returned as a string.\r\n *\r\n * @param {string} type A string identifying one of the possible output types.
    \r\n * Possible values are:
    \r\n * 'arraybuffer' -> (ArrayBuffer)
    \r\n * 'blob' -> (Blob)
    \r\n * 'bloburi'/'bloburl' -> (string)
    \r\n * 'datauristring'/'dataurlstring' -> (string)
    \r\n * 'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring
    \r\n * 'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)
    \r\n * 'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)
    \r\n * 'pdfjsnewwindow' -> (wind | null)\r\n * @param {Object|string} options An object providing some additional signalling to PDF generator.
    \r\n * Possible options are 'filename'.
    \r\n * A string can be passed instead of {filename:string} and defaults to 'generated.pdf'\r\n * @function\r\n * @instance\r\n * @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined}\r\n * @memberof jsPDF#\r\n * @name output\r\n */\r\n var output = (API.output = API.__private__.output = SAFE(function output(\r\n type,\r\n options\r\n ) {\r\n options = options || {};\r\n\r\n if (typeof options === \"string\") {\r\n options = {\r\n filename: options\r\n };\r\n } else {\r\n options.filename = options.filename || \"generated.pdf\";\r\n }\r\n\r\n switch (type) {\r\n case undefined:\r\n return buildDocument();\r\n case \"save\":\r\n API.save(options.filename);\r\n break;\r\n case \"arraybuffer\":\r\n return getArrayBuffer(buildDocument());\r\n case \"blob\":\r\n return getBlob(buildDocument());\r\n case \"bloburi\":\r\n case \"bloburl\":\r\n // Developer is responsible of calling revokeObjectURL\r\n if (\r\n typeof globalObject.URL !== \"undefined\" &&\r\n typeof globalObject.URL.createObjectURL === \"function\"\r\n ) {\r\n return (\r\n (globalObject.URL &&\r\n globalObject.URL.createObjectURL(getBlob(buildDocument()))) ||\r\n void 0\r\n );\r\n } else {\r\n console.warn(\r\n \"bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.\"\r\n );\r\n }\r\n break;\r\n case \"datauristring\":\r\n case \"dataurlstring\":\r\n var dataURI = \"\";\r\n var pdfDocument = buildDocument();\r\n try {\r\n dataURI = btoa(pdfDocument);\r\n } catch (e) {\r\n dataURI = btoa(unescape(encodeURIComponent(pdfDocument)));\r\n }\r\n return (\r\n \"data:application/pdf;filename=\" +\r\n options.filename +\r\n \";base64,\" +\r\n dataURI\r\n );\r\n case \"pdfobjectnewwindow\":\r\n if (\r\n Object.prototype.toString.call(globalObject) === \"[object Window]\"\r\n ) {\r\n var pdfObjectUrl =\r\n \"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js\";\r\n var integrity =\r\n ' integrity=\"sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==\" crossorigin=\"anonymous\"';\r\n\r\n if (options.pdfObjectUrl) {\r\n pdfObjectUrl = options.pdfObjectUrl;\r\n integrity = \"\";\r\n }\r\n\r\n var htmlForNewWindow =\r\n \"\" +\r\n '\";\r\n var nW = globalObject.open();\r\n\r\n if (nW !== null) {\r\n nW.document.write(htmlForNewWindow);\r\n }\r\n return nW;\r\n } else {\r\n throw new Error(\r\n \"The option pdfobjectnewwindow just works in a browser-environment.\"\r\n );\r\n }\r\n case \"pdfjsnewwindow\":\r\n if (\r\n Object.prototype.toString.call(globalObject) === \"[object Window]\"\r\n ) {\r\n var pdfJsUrl = options.pdfJsUrl || \"examples/PDF.js/web/viewer.html\";\r\n var htmlForPDFjsNewWindow =\r\n \"\" +\r\n \"\" +\r\n '' +\r\n \"\";\r\n var dataURLNewWindow = globalObject.open();\r\n if (dataURLNewWindow !== null) {\r\n dataURLNewWindow.document.write(htmlForDataURLNewWindow);\r\n dataURLNewWindow.document.title = options.filename;\r\n }\r\n if (dataURLNewWindow || typeof safari === \"undefined\")\r\n return dataURLNewWindow;\r\n } else {\r\n throw new Error(\r\n \"The option dataurlnewwindow just works in a browser-environment.\"\r\n );\r\n }\r\n break;\r\n case \"datauri\":\r\n case \"dataurl\":\r\n return (globalObject.document.location.href = this.output(\r\n \"datauristring\",\r\n options\r\n ));\r\n default:\r\n return null;\r\n }\r\n }));\r\n\r\n /**\r\n * Used to see if a supplied hotfix was requested when the pdf instance was created.\r\n * @param {string} hotfixName - The name of the hotfix to check.\r\n * @returns {boolean}\r\n */\r\n var hasHotfix = function(hotfixName) {\r\n return (\r\n Array.isArray(hotfixes) === true && hotfixes.indexOf(hotfixName) > -1\r\n );\r\n };\r\n\r\n switch (unit) {\r\n case \"pt\":\r\n scaleFactor = 1;\r\n break;\r\n case \"mm\":\r\n scaleFactor = 72 / 25.4;\r\n break;\r\n case \"cm\":\r\n scaleFactor = 72 / 2.54;\r\n break;\r\n case \"in\":\r\n scaleFactor = 72;\r\n break;\r\n case \"px\":\r\n if (hasHotfix(\"px_scaling\") == true) {\r\n scaleFactor = 72 / 96;\r\n } else {\r\n scaleFactor = 96 / 72;\r\n }\r\n break;\r\n case \"pc\":\r\n scaleFactor = 12;\r\n break;\r\n case \"em\":\r\n scaleFactor = 12;\r\n break;\r\n case \"ex\":\r\n scaleFactor = 6;\r\n break;\r\n default:\r\n if (typeof unit === \"number\") {\r\n scaleFactor = unit;\r\n } else {\r\n throw new Error(\"Invalid unit: \" + unit);\r\n }\r\n }\r\n\r\n var encryption = null;\r\n setCreationDate();\r\n setFileId();\r\n\r\n var getEncryptor = function(objectId) {\r\n if (encryptionOptions !== null) {\r\n return encryption.encryptor(objectId, 0);\r\n }\r\n return function(data) {\r\n return data;\r\n };\r\n };\r\n\r\n //---------------------------------------\r\n // Public API\r\n\r\n var getPageInfo = (API.__private__.getPageInfo = API.getPageInfo = function(\r\n pageNumberOneBased\r\n ) {\r\n if (isNaN(pageNumberOneBased) || pageNumberOneBased % 1 !== 0) {\r\n throw new Error(\"Invalid argument passed to jsPDF.getPageInfo\");\r\n }\r\n var objId = pagesContext[pageNumberOneBased].objId;\r\n return {\r\n objId: objId,\r\n pageNumber: pageNumberOneBased,\r\n pageContext: pagesContext[pageNumberOneBased]\r\n };\r\n });\r\n\r\n var getPageInfoByObjId = (API.__private__.getPageInfoByObjId = function(\r\n objId\r\n ) {\r\n if (isNaN(objId) || objId % 1 !== 0) {\r\n throw new Error(\"Invalid argument passed to jsPDF.getPageInfoByObjId\");\r\n }\r\n for (var pageNumber in pagesContext) {\r\n if (pagesContext[pageNumber].objId === objId) {\r\n break;\r\n }\r\n }\r\n return getPageInfo(pageNumber);\r\n });\r\n\r\n var getCurrentPageInfo = (API.__private__.getCurrentPageInfo = API.getCurrentPageInfo = function() {\r\n return {\r\n objId: pagesContext[currentPage].objId,\r\n pageNumber: currentPage,\r\n pageContext: pagesContext[currentPage]\r\n };\r\n });\r\n\r\n /**\r\n * Adds (and transfers the focus to) new page to the PDF document.\r\n * @param format {String/Array} The format of the new page. Can be:
    • a0 - a10
    • b0 - b10
    • c0 - c10
    • dl
    • letter
    • government-letter
    • legal
    • junior-legal
    • ledger
    • tabloid
    • credit-card

    \r\n * Default is \"a4\". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]\r\n * @param orientation {string} Orientation of the new page. Possible values are \"portrait\" or \"landscape\" (or shortcuts \"p\" (Default), \"l\").\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n *\r\n * @memberof jsPDF#\r\n * @name addPage\r\n */\r\n API.addPage = function() {\r\n _addPage.apply(this, arguments);\r\n return this;\r\n };\r\n /**\r\n * Adds (and transfers the focus to) new page to the PDF document.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n *\r\n * @memberof jsPDF#\r\n * @name setPage\r\n * @param {number} page Switch the active page to the page number specified (indexed starting at 1).\r\n * @example\r\n * doc = jsPDF()\r\n * doc.addPage()\r\n * doc.addPage()\r\n * doc.text('I am on page 3', 10, 10)\r\n * doc.setPage(1)\r\n * doc.text('I am on page 1', 10, 10)\r\n */\r\n API.setPage = function() {\r\n _setPage.apply(this, arguments);\r\n setOutputDestination.call(this, pages[currentPage]);\r\n return this;\r\n };\r\n\r\n /**\r\n * @name insertPage\r\n * @memberof jsPDF#\r\n *\r\n * @function\r\n * @instance\r\n * @param {Object} beforePage\r\n * @returns {jsPDF}\r\n */\r\n API.insertPage = function(beforePage) {\r\n this.addPage();\r\n this.movePage(currentPage, beforePage);\r\n return this;\r\n };\r\n\r\n /**\r\n * @name movePage\r\n * @memberof jsPDF#\r\n * @function\r\n * @instance\r\n * @param {number} targetPage\r\n * @param {number} beforePage\r\n * @returns {jsPDF}\r\n */\r\n API.movePage = function(targetPage, beforePage) {\r\n var tmpPages, tmpPagesContext;\r\n if (targetPage > beforePage) {\r\n tmpPages = pages[targetPage];\r\n tmpPagesContext = pagesContext[targetPage];\r\n for (var i = targetPage; i > beforePage; i--) {\r\n pages[i] = pages[i - 1];\r\n pagesContext[i] = pagesContext[i - 1];\r\n }\r\n pages[beforePage] = tmpPages;\r\n pagesContext[beforePage] = tmpPagesContext;\r\n this.setPage(beforePage);\r\n } else if (targetPage < beforePage) {\r\n tmpPages = pages[targetPage];\r\n tmpPagesContext = pagesContext[targetPage];\r\n for (var j = targetPage; j < beforePage; j++) {\r\n pages[j] = pages[j + 1];\r\n pagesContext[j] = pagesContext[j + 1];\r\n }\r\n pages[beforePage] = tmpPages;\r\n pagesContext[beforePage] = tmpPagesContext;\r\n this.setPage(beforePage);\r\n }\r\n return this;\r\n };\r\n\r\n /**\r\n * Deletes a page from the PDF.\r\n * @name deletePage\r\n * @memberof jsPDF#\r\n * @function\r\n * @param {number} targetPage\r\n * @instance\r\n * @returns {jsPDF}\r\n */\r\n API.deletePage = function() {\r\n _deletePage.apply(this, arguments);\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings.\r\n *\r\n * @function\r\n * @instance\r\n * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call.\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.\r\n * @param {Object} [options] - Collection of settings signaling how the text must be encoded.\r\n * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify.\r\n * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle, hanging\r\n * @param {number|Matrix} [options.angle=0] - Rotate the text clockwise or counterclockwise. Expects the angle in degree.\r\n * @param {number} [options.rotationDirection=1] - Direction of the rotation. 0 = clockwise, 1 = counterclockwise.\r\n * @param {number} [options.charSpace=0] - The space between each letter.\r\n * @param {number} [options.horizontalScale=1] - Horizontal scale of the text as a factor of the regular size.\r\n * @param {number} [options.lineHeightFactor=1.15] - The lineheight of each line.\r\n * @param {Object} [options.flags] - Flags for to8bitStream.\r\n * @param {boolean} [options.flags.noBOM=true] - Don't add BOM to Unicode-text.\r\n * @param {boolean} [options.flags.autoencode=true] - Autoencode the Text.\r\n * @param {number} [options.maxWidth=0] - Split the text by given width, 0 = no split.\r\n * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping.\r\n * @param {boolean} [options.isInputVisual] - Option for the BidiEngine\r\n * @param {boolean} [options.isOutputVisual] - Option for the BidiEngine\r\n * @param {boolean} [options.isInputRtl] - Option for the BidiEngine\r\n * @param {boolean} [options.isOutputRtl] - Option for the BidiEngine\r\n * @param {boolean} [options.isSymmetricSwapping] - Option for the BidiEngine\r\n * @param {number|Matrix} transform If transform is a number the text will be rotated by this value around the anchor set by x and y.\r\n *\r\n * If it is a Matrix, this matrix gets directly applied to the text, which allows shearing\r\n * effects etc.; the x and y offsets are then applied AFTER the coordinate system has been established by this\r\n * matrix. This means passing a rotation matrix that is equivalent to some rotation angle will in general yield a\r\n * DIFFERENT result. A matrix is only allowed in \"advanced\" API mode.\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name text\r\n */\r\n API.__private__.text = API.text = function(text, x, y, options, transform) {\r\n /*\r\n * Inserts something like this into PDF\r\n * BT\r\n * /F1 16 Tf % Font name + size\r\n * 16 TL % How many units down for next line in multiline text\r\n * 0 g % color\r\n * 28.35 813.54 Td % position\r\n * (line one) Tj\r\n * T* (line two) Tj\r\n * T* (line three) Tj\r\n * ET\r\n */\r\n options = options || {};\r\n var scope = options.scope || this;\r\n var payload, da, angle, align, charSpace, maxWidth, flags, horizontalScale;\r\n\r\n // Pre-August-2012 the order of arguments was function(x, y, text, flags)\r\n // in effort to make all calls have similar signature like\r\n // function(data, coordinates... , miscellaneous)\r\n // this method had its args flipped.\r\n // code below allows backward compatibility with old arg order.\r\n if (\r\n typeof text === \"number\" &&\r\n typeof x === \"number\" &&\r\n (typeof y === \"string\" || Array.isArray(y))\r\n ) {\r\n var tmp = y;\r\n y = x;\r\n x = text;\r\n text = tmp;\r\n }\r\n\r\n var transformationMatrix;\r\n\r\n if (arguments[3] instanceof Matrix === false) {\r\n flags = arguments[3];\r\n angle = arguments[4];\r\n align = arguments[5];\r\n\r\n if (typeof flags !== \"object\" || flags === null) {\r\n if (typeof angle === \"string\") {\r\n align = angle;\r\n angle = null;\r\n }\r\n if (typeof flags === \"string\") {\r\n align = flags;\r\n flags = null;\r\n }\r\n if (typeof flags === \"number\") {\r\n angle = flags;\r\n flags = null;\r\n }\r\n options = {\r\n flags: flags,\r\n angle: angle,\r\n align: align\r\n };\r\n }\r\n } else {\r\n advancedApiModeTrap(\r\n \"The transform parameter of text() with a Matrix value\"\r\n );\r\n transformationMatrix = transform;\r\n }\r\n\r\n if (isNaN(x) || isNaN(y) || typeof text === \"undefined\" || text === null) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.text\");\r\n }\r\n\r\n if (text.length === 0) {\r\n return scope;\r\n }\r\n\r\n var xtra = \"\";\r\n var isHex = false;\r\n var lineHeight =\r\n typeof options.lineHeightFactor === \"number\"\r\n ? options.lineHeightFactor\r\n : lineHeightFactor;\r\n var scaleFactor = scope.internal.scaleFactor;\r\n\r\n function ESC(s) {\r\n s = s.split(\"\\t\").join(Array(options.TabLen || 9).join(\" \"));\r\n return pdfEscape(s, flags);\r\n }\r\n\r\n function transformTextToSpecialArray(text) {\r\n //we don't want to destroy original text array, so cloning it\r\n var sa = text.concat();\r\n var da = [];\r\n var len = sa.length;\r\n var curDa;\r\n //we do array.join('text that must not be PDFescaped\")\r\n //thus, pdfEscape each component separately\r\n while (len--) {\r\n curDa = sa.shift();\r\n if (typeof curDa === \"string\") {\r\n da.push(curDa);\r\n } else {\r\n if (\r\n Array.isArray(text) &&\r\n (curDa.length === 1 ||\r\n (curDa[1] === undefined && curDa[2] === undefined))\r\n ) {\r\n da.push(curDa[0]);\r\n } else {\r\n da.push([curDa[0], curDa[1], curDa[2]]);\r\n }\r\n }\r\n }\r\n return da;\r\n }\r\n\r\n function processTextByFunction(text, processingFunction) {\r\n var result;\r\n if (typeof text === \"string\") {\r\n result = processingFunction(text)[0];\r\n } else if (Array.isArray(text)) {\r\n //we don't want to destroy original text array, so cloning it\r\n var sa = text.concat();\r\n var da = [];\r\n var len = sa.length;\r\n var curDa;\r\n var tmpResult;\r\n //we do array.join('text that must not be PDFescaped\")\r\n //thus, pdfEscape each component separately\r\n while (len--) {\r\n curDa = sa.shift();\r\n if (typeof curDa === \"string\") {\r\n da.push(processingFunction(curDa)[0]);\r\n } else if (Array.isArray(curDa) && typeof curDa[0] === \"string\") {\r\n tmpResult = processingFunction(curDa[0], curDa[1], curDa[2]);\r\n da.push([tmpResult[0], tmpResult[1], tmpResult[2]]);\r\n }\r\n }\r\n result = da;\r\n }\r\n return result;\r\n }\r\n\r\n //Check if text is of type String\r\n var textIsOfTypeString = false;\r\n var tmpTextIsOfTypeString = true;\r\n\r\n if (typeof text === \"string\") {\r\n textIsOfTypeString = true;\r\n } else if (Array.isArray(text)) {\r\n //we don't want to destroy original text array, so cloning it\r\n var sa = text.concat();\r\n da = [];\r\n var len = sa.length;\r\n var curDa;\r\n //we do array.join('text that must not be PDFescaped\")\r\n //thus, pdfEscape each component separately\r\n while (len--) {\r\n curDa = sa.shift();\r\n if (\r\n typeof curDa !== \"string\" ||\r\n (Array.isArray(curDa) && typeof curDa[0] !== \"string\")\r\n ) {\r\n tmpTextIsOfTypeString = false;\r\n }\r\n }\r\n textIsOfTypeString = tmpTextIsOfTypeString;\r\n }\r\n if (textIsOfTypeString === false) {\r\n throw new Error(\r\n 'Type of text must be string or Array. \"' +\r\n text +\r\n '\" is not recognized.'\r\n );\r\n }\r\n\r\n //If there are any newlines in text, we assume\r\n //the user wanted to print multiple lines, so break the\r\n //text up into an array. If the text is already an array,\r\n //we assume the user knows what they are doing.\r\n //Convert text into an array anyway to simplify\r\n //later code.\r\n\r\n if (typeof text === \"string\") {\r\n if (text.match(/[\\r?\\n]/)) {\r\n text = text.split(/\\r\\n|\\r|\\n/g);\r\n } else {\r\n text = [text];\r\n }\r\n }\r\n\r\n //baseline\r\n var height = activeFontSize / scope.internal.scaleFactor;\r\n var descent = height * (lineHeight - 1);\r\n\r\n switch (options.baseline) {\r\n case \"bottom\":\r\n y -= descent;\r\n break;\r\n case \"top\":\r\n y += height - descent;\r\n break;\r\n case \"hanging\":\r\n y += height - 2 * descent;\r\n break;\r\n case \"middle\":\r\n y += height / 2 - descent;\r\n break;\r\n case \"ideographic\":\r\n case \"alphabetic\":\r\n default:\r\n // do nothing, everything is fine\r\n break;\r\n }\r\n\r\n //multiline\r\n maxWidth = options.maxWidth || 0;\r\n\r\n if (maxWidth > 0) {\r\n if (typeof text === \"string\") {\r\n text = scope.splitTextToSize(text, maxWidth);\r\n } else if (Object.prototype.toString.call(text) === \"[object Array]\") {\r\n text = text.reduce(function(acc, textLine) {\r\n return acc.concat(scope.splitTextToSize(textLine, maxWidth));\r\n }, []);\r\n }\r\n }\r\n\r\n //creating Payload-Object to make text byRef\r\n payload = {\r\n text: text,\r\n x: x,\r\n y: y,\r\n options: options,\r\n mutex: {\r\n pdfEscape: pdfEscape,\r\n activeFontKey: activeFontKey,\r\n fonts: fonts,\r\n activeFontSize: activeFontSize\r\n }\r\n };\r\n events.publish(\"preProcessText\", payload);\r\n\r\n text = payload.text;\r\n options = payload.options;\r\n\r\n //angle\r\n angle = options.angle;\r\n\r\n if (\r\n transformationMatrix instanceof Matrix === false &&\r\n angle &&\r\n typeof angle === \"number\"\r\n ) {\r\n angle *= Math.PI / 180;\r\n\r\n if (options.rotationDirection === 0) {\r\n angle = -angle;\r\n }\r\n\r\n if (apiMode === ApiMode.ADVANCED) {\r\n angle = -angle;\r\n }\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n transformationMatrix = new Matrix(c, s, -s, c, 0, 0);\r\n } else if (angle && angle instanceof Matrix) {\r\n transformationMatrix = angle;\r\n }\r\n\r\n if (apiMode === ApiMode.ADVANCED && !transformationMatrix) {\r\n transformationMatrix = identityMatrix;\r\n }\r\n\r\n //charSpace\r\n\r\n charSpace = options.charSpace || activeCharSpace;\r\n\r\n if (typeof charSpace !== \"undefined\") {\r\n xtra += hpf(scale(charSpace)) + \" Tc\\n\";\r\n this.setCharSpace(this.getCharSpace() || 0);\r\n }\r\n\r\n horizontalScale = options.horizontalScale;\r\n if (typeof horizontalScale !== \"undefined\") {\r\n xtra += hpf(horizontalScale * 100) + \" Tz\\n\";\r\n }\r\n\r\n //lang\r\n\r\n var lang = options.lang;\r\n\r\n if (lang) {\r\n // xtra += \"/Lang (\" + lang +\")\\n\";\r\n }\r\n\r\n //renderingMode\r\n var renderingMode = -1;\r\n var parmRenderingMode =\r\n typeof options.renderingMode !== \"undefined\"\r\n ? options.renderingMode\r\n : options.stroke;\r\n var pageContext = scope.internal.getCurrentPageInfo().pageContext;\r\n\r\n switch (parmRenderingMode) {\r\n case 0:\r\n case false:\r\n case \"fill\":\r\n renderingMode = 0;\r\n break;\r\n case 1:\r\n case true:\r\n case \"stroke\":\r\n renderingMode = 1;\r\n break;\r\n case 2:\r\n case \"fillThenStroke\":\r\n renderingMode = 2;\r\n break;\r\n case 3:\r\n case \"invisible\":\r\n renderingMode = 3;\r\n break;\r\n case 4:\r\n case \"fillAndAddForClipping\":\r\n renderingMode = 4;\r\n break;\r\n case 5:\r\n case \"strokeAndAddPathForClipping\":\r\n renderingMode = 5;\r\n break;\r\n case 6:\r\n case \"fillThenStrokeAndAddToPathForClipping\":\r\n renderingMode = 6;\r\n break;\r\n case 7:\r\n case \"addToPathForClipping\":\r\n renderingMode = 7;\r\n break;\r\n }\r\n\r\n var usedRenderingMode =\r\n typeof pageContext.usedRenderingMode !== \"undefined\"\r\n ? pageContext.usedRenderingMode\r\n : -1;\r\n\r\n //if the coder wrote it explicitly to use a specific\r\n //renderingMode, then use it\r\n if (renderingMode !== -1) {\r\n xtra += renderingMode + \" Tr\\n\";\r\n //otherwise check if we used the rendering Mode already\r\n //if so then set the rendering Mode...\r\n } else if (usedRenderingMode !== -1) {\r\n xtra += \"0 Tr\\n\";\r\n }\r\n\r\n if (renderingMode !== -1) {\r\n pageContext.usedRenderingMode = renderingMode;\r\n }\r\n\r\n //align\r\n align = options.align || \"left\";\r\n var leading = activeFontSize * lineHeight;\r\n var pageWidth = scope.internal.pageSize.getWidth();\r\n var activeFont = fonts[activeFontKey];\r\n charSpace = options.charSpace || activeCharSpace;\r\n maxWidth = options.maxWidth || 0;\r\n\r\n var lineWidths;\r\n flags = Object.assign({ autoencode: true, noBOM: true }, options.flags);\r\n\r\n var wordSpacingPerLine = [];\r\n var findWidth = function(v) {\r\n return (\r\n (scope.getStringUnitWidth(v, {\r\n font: activeFont,\r\n charSpace: charSpace,\r\n fontSize: activeFontSize,\r\n doKerning: false\r\n }) *\r\n activeFontSize) /\r\n scaleFactor\r\n );\r\n };\r\n if (Object.prototype.toString.call(text) === \"[object Array]\") {\r\n da = transformTextToSpecialArray(text);\r\n var newY;\r\n if (align !== \"left\") {\r\n lineWidths = da.map(findWidth);\r\n }\r\n //The first line uses the \"main\" Td setting,\r\n //and the subsequent lines are offset by the\r\n //previous line's x coordinate.\r\n var prevWidth = 0;\r\n var newX;\r\n if (align === \"right\") {\r\n //The passed in x coordinate defines the\r\n //rightmost point of the text.\r\n x -= lineWidths[0];\r\n text = [];\r\n len = da.length;\r\n for (var i = 0; i < len; i++) {\r\n if (i === 0) {\r\n newX = getHorizontalCoordinate(x);\r\n newY = getVerticalCoordinate(y);\r\n } else {\r\n newX = scale(prevWidth - lineWidths[i]);\r\n newY = -leading;\r\n }\r\n text.push([da[i], newX, newY]);\r\n prevWidth = lineWidths[i];\r\n }\r\n } else if (align === \"center\") {\r\n //The passed in x coordinate defines\r\n //the center point.\r\n x -= lineWidths[0] / 2;\r\n text = [];\r\n len = da.length;\r\n for (var j = 0; j < len; j++) {\r\n if (j === 0) {\r\n newX = getHorizontalCoordinate(x);\r\n newY = getVerticalCoordinate(y);\r\n } else {\r\n newX = scale((prevWidth - lineWidths[j]) / 2);\r\n newY = -leading;\r\n }\r\n text.push([da[j], newX, newY]);\r\n prevWidth = lineWidths[j];\r\n }\r\n } else if (align === \"left\") {\r\n text = [];\r\n len = da.length;\r\n for (var h = 0; h < len; h++) {\r\n text.push(da[h]);\r\n }\r\n } else if (align === \"justify\" && activeFont.encoding === \"Identity-H\") {\r\n // when using unicode fonts, wordSpacePerLine does not apply\r\n text = [];\r\n len = da.length;\r\n maxWidth = maxWidth !== 0 ? maxWidth : pageWidth;\r\n let backToStartX = 0;\r\n for (var l = 0; l < len; l++) {\r\n newY = l === 0 ? getVerticalCoordinate(y) : -leading;\r\n newX = l === 0 ? getHorizontalCoordinate(x) : backToStartX;\r\n if (l < len - 1) {\r\n let spacing = scale(\r\n (maxWidth - lineWidths[l]) / (da[l].split(\" \").length - 1)\r\n );\r\n let words = da[l].split(\" \");\r\n text.push([words[0] + \" \", newX, newY]);\r\n backToStartX = 0; // distance to reset back to the left\r\n for (let i = 1; i < words.length; i++) {\r\n let shiftAmount =\r\n (findWidth(words[i - 1] + \" \" + words[i]) -\r\n findWidth(words[i])) *\r\n scaleFactor +\r\n spacing;\r\n if (i == words.length - 1) text.push([words[i], shiftAmount, 0]);\r\n else text.push([words[i] + \" \", shiftAmount, 0]);\r\n backToStartX -= shiftAmount;\r\n }\r\n } else {\r\n text.push([da[l], newX, newY]);\r\n }\r\n }\r\n text.push([\"\", backToStartX, 0]);\r\n } else if (align === \"justify\") {\r\n text = [];\r\n len = da.length;\r\n maxWidth = maxWidth !== 0 ? maxWidth : pageWidth;\r\n for (var l = 0; l < len; l++) {\r\n newY = l === 0 ? getVerticalCoordinate(y) : -leading;\r\n newX = l === 0 ? getHorizontalCoordinate(x) : 0;\r\n if (l < len - 1) {\r\n wordSpacingPerLine.push(\r\n hpf(\r\n scale(\r\n (maxWidth - lineWidths[l]) / (da[l].split(\" \").length - 1)\r\n )\r\n )\r\n );\r\n } else {\r\n wordSpacingPerLine.push(0);\r\n }\r\n text.push([da[l], newX, newY]);\r\n }\r\n } else {\r\n throw new Error(\r\n 'Unrecognized alignment option, use \"left\", \"center\", \"right\" or \"justify\".'\r\n );\r\n }\r\n }\r\n\r\n //R2L\r\n var doReversing = typeof options.R2L === \"boolean\" ? options.R2L : R2L;\r\n if (doReversing === true) {\r\n text = processTextByFunction(text, function(text, posX, posY) {\r\n return [\r\n text\r\n .split(\"\")\r\n .reverse()\r\n .join(\"\"),\r\n posX,\r\n posY\r\n ];\r\n });\r\n }\r\n\r\n //creating Payload-Object to make text byRef\r\n payload = {\r\n text: text,\r\n x: x,\r\n y: y,\r\n options: options,\r\n mutex: {\r\n pdfEscape: pdfEscape,\r\n activeFontKey: activeFontKey,\r\n fonts: fonts,\r\n activeFontSize: activeFontSize\r\n }\r\n };\r\n events.publish(\"postProcessText\", payload);\r\n\r\n text = payload.text;\r\n isHex = payload.mutex.isHex || false;\r\n\r\n //Escaping\r\n var activeFontEncoding = fonts[activeFontKey].encoding;\r\n\r\n if (\r\n activeFontEncoding === \"WinAnsiEncoding\" ||\r\n activeFontEncoding === \"StandardEncoding\"\r\n ) {\r\n text = processTextByFunction(text, function(text, posX, posY) {\r\n return [ESC(text), posX, posY];\r\n });\r\n }\r\n\r\n da = transformTextToSpecialArray(text);\r\n\r\n text = [];\r\n var STRING = 0;\r\n var ARRAY = 1;\r\n var variant = Array.isArray(da[0]) ? ARRAY : STRING;\r\n var posX;\r\n var posY;\r\n var content;\r\n var wordSpacing = \"\";\r\n\r\n var generatePosition = function(\r\n parmPosX,\r\n parmPosY,\r\n parmTransformationMatrix\r\n ) {\r\n var position = \"\";\r\n if (parmTransformationMatrix instanceof Matrix) {\r\n // It is kind of more intuitive to apply a plain rotation around the text anchor set by x and y\r\n // but when the user supplies an arbitrary transformation matrix, the x and y offsets should be applied\r\n // in the coordinate system established by this matrix\r\n if (typeof options.angle === \"number\") {\r\n parmTransformationMatrix = matrixMult(\r\n parmTransformationMatrix,\r\n new Matrix(1, 0, 0, 1, parmPosX, parmPosY)\r\n );\r\n } else {\r\n parmTransformationMatrix = matrixMult(\r\n new Matrix(1, 0, 0, 1, parmPosX, parmPosY),\r\n parmTransformationMatrix\r\n );\r\n }\r\n\r\n if (apiMode === ApiMode.ADVANCED) {\r\n parmTransformationMatrix = matrixMult(\r\n new Matrix(1, 0, 0, -1, 0, 0),\r\n parmTransformationMatrix\r\n );\r\n }\r\n\r\n position = parmTransformationMatrix.join(\" \") + \" Tm\\n\";\r\n } else {\r\n position = hpf(parmPosX) + \" \" + hpf(parmPosY) + \" Td\\n\";\r\n }\r\n return position;\r\n };\r\n\r\n for (var lineIndex = 0; lineIndex < da.length; lineIndex++) {\r\n wordSpacing = \"\";\r\n\r\n switch (variant) {\r\n case ARRAY:\r\n content =\r\n (isHex ? \"<\" : \"(\") + da[lineIndex][0] + (isHex ? \">\" : \")\");\r\n posX = parseFloat(da[lineIndex][1]);\r\n posY = parseFloat(da[lineIndex][2]);\r\n break;\r\n case STRING:\r\n content = (isHex ? \"<\" : \"(\") + da[lineIndex] + (isHex ? \">\" : \")\");\r\n posX = getHorizontalCoordinate(x);\r\n posY = getVerticalCoordinate(y);\r\n break;\r\n }\r\n\r\n if (\r\n typeof wordSpacingPerLine !== \"undefined\" &&\r\n typeof wordSpacingPerLine[lineIndex] !== \"undefined\"\r\n ) {\r\n wordSpacing = wordSpacingPerLine[lineIndex] + \" Tw\\n\";\r\n }\r\n\r\n if (lineIndex === 0) {\r\n text.push(\r\n wordSpacing +\r\n generatePosition(posX, posY, transformationMatrix) +\r\n content\r\n );\r\n } else if (variant === STRING) {\r\n text.push(wordSpacing + content);\r\n } else if (variant === ARRAY) {\r\n text.push(\r\n wordSpacing +\r\n generatePosition(posX, posY, transformationMatrix) +\r\n content\r\n );\r\n }\r\n }\r\n\r\n text = variant === STRING ? text.join(\" Tj\\nT* \") : text.join(\" Tj\\n\");\r\n text += \" Tj\\n\";\r\n\r\n var result = \"BT\\n/\";\r\n result += activeFontKey + \" \" + activeFontSize + \" Tf\\n\"; // font face, style, size\r\n result += hpf(activeFontSize * lineHeight) + \" TL\\n\"; // line spacing\r\n result += textColor + \"\\n\";\r\n result += xtra;\r\n result += text;\r\n result += \"ET\";\r\n\r\n out(result);\r\n usedFonts[activeFontKey] = true;\r\n return scope;\r\n };\r\n\r\n // PDF supports these path painting and clip path operators:\r\n //\r\n // S - stroke\r\n // s - close/stroke\r\n // f (F) - fill non-zero\r\n // f* - fill evenodd\r\n // B - fill stroke nonzero\r\n // B* - fill stroke evenodd\r\n // b - close fill stroke nonzero\r\n // b* - close fill stroke evenodd\r\n // n - nothing (consume path)\r\n // W - clip nonzero\r\n // W* - clip evenodd\r\n //\r\n // In order to keep the API small, we omit the close-and-fill/stroke operators and provide a separate close()\r\n // method.\r\n /**\r\n *\r\n * @name clip\r\n * @function\r\n * @instance\r\n * @param {string} rule Only possible value is 'evenodd'\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @description All .clip() after calling drawing ops with a style argument of null.\r\n */\r\n var clip = (API.__private__.clip = API.clip = function(rule) {\r\n // Call .clip() after calling drawing ops with a style argument of null\r\n // W is the PDF clipping op\r\n if (\"evenodd\" === rule) {\r\n out(\"W*\");\r\n } else {\r\n out(\"W\");\r\n }\r\n return this;\r\n });\r\n\r\n /**\r\n * @name clipEvenOdd\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @description Modify the current clip path by intersecting it with the current path using the even-odd rule. Note\r\n * that this will NOT consume the current path. In order to only use this path for clipping call\r\n * {@link API.discardPath} afterwards.\r\n */\r\n API.clipEvenOdd = function() {\r\n return clip(\"evenodd\");\r\n };\r\n\r\n /**\r\n * Consumes the current path without any effect. Mainly used in combination with {@link clip} or\r\n * {@link clipEvenOdd}. The PDF \"n\" operator.\r\n * @name discardPath\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.__private__.discardPath = API.discardPath = function() {\r\n out(\"n\");\r\n return this;\r\n };\r\n\r\n var isValidStyle = (API.__private__.isValidStyle = function(style) {\r\n var validStyleVariants = [\r\n undefined,\r\n null,\r\n \"S\",\r\n \"D\",\r\n \"F\",\r\n \"DF\",\r\n \"FD\",\r\n \"f\",\r\n \"f*\",\r\n \"B\",\r\n \"B*\",\r\n \"n\"\r\n ];\r\n var result = false;\r\n if (validStyleVariants.indexOf(style) !== -1) {\r\n result = true;\r\n }\r\n return result;\r\n });\r\n\r\n API.__private__.setDefaultPathOperation = API.setDefaultPathOperation = function(\r\n operator\r\n ) {\r\n if (isValidStyle(operator)) {\r\n defaultPathOperation = operator;\r\n }\r\n return this;\r\n };\r\n\r\n var getStyle = (API.__private__.getStyle = API.getStyle = function(style) {\r\n // see path-painting operators in PDF spec\r\n var op = defaultPathOperation; // stroke\r\n\r\n switch (style) {\r\n case \"D\":\r\n case \"S\":\r\n op = \"S\"; // stroke\r\n break;\r\n case \"F\":\r\n op = \"f\"; // fill\r\n break;\r\n case \"FD\":\r\n case \"DF\":\r\n op = \"B\";\r\n break;\r\n case \"f\":\r\n case \"f*\":\r\n case \"B\":\r\n case \"B*\":\r\n /*\r\n Allow direct use of these PDF path-painting operators:\r\n - f fill using nonzero winding number rule\r\n - f* fill using even-odd rule\r\n - B fill then stroke with fill using non-zero winding number rule\r\n - B* fill then stroke with fill using even-odd rule\r\n */\r\n op = style;\r\n break;\r\n }\r\n return op;\r\n });\r\n\r\n /**\r\n * Close the current path. The PDF \"h\" operator.\r\n * @name close\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n var close = (API.close = function() {\r\n out(\"h\");\r\n return this;\r\n });\r\n\r\n /**\r\n * Stroke the path. The PDF \"S\" operator.\r\n * @name stroke\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.stroke = function() {\r\n out(\"S\");\r\n return this;\r\n };\r\n\r\n /**\r\n * Fill the current path using the nonzero winding number rule. If a pattern is provided, the path will be filled\r\n * with this pattern, otherwise with the current fill color. Equivalent to the PDF \"f\" operator.\r\n * @name fill\r\n * @function\r\n * @instance\r\n * @param {PatternData=} pattern If provided the path will be filled with this pattern\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.fill = function(pattern) {\r\n fillWithOptionalPattern(\"f\", pattern);\r\n return this;\r\n };\r\n\r\n /**\r\n * Fill the current path using the even-odd rule. The PDF f* operator.\r\n * @see API.fill\r\n * @name fillEvenOdd\r\n * @function\r\n * @instance\r\n * @param {PatternData=} pattern If provided the path will be filled with this pattern\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.fillEvenOdd = function(pattern) {\r\n fillWithOptionalPattern(\"f*\", pattern);\r\n return this;\r\n };\r\n\r\n /**\r\n * Fill using the nonzero winding number rule and then stroke the current Path. The PDF \"B\" operator.\r\n * @see API.fill\r\n * @name fillStroke\r\n * @function\r\n * @instance\r\n * @param {PatternData=} pattern If provided the path will be stroked with this pattern\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.fillStroke = function(pattern) {\r\n fillWithOptionalPattern(\"B\", pattern);\r\n return this;\r\n };\r\n\r\n /**\r\n * Fill using the even-odd rule and then stroke the current Path. The PDF \"B\" operator.\r\n * @see API.fill\r\n * @name fillStrokeEvenOdd\r\n * @function\r\n * @instance\r\n * @param {PatternData=} pattern If provided the path will be fill-stroked with this pattern\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.fillStrokeEvenOdd = function(pattern) {\r\n fillWithOptionalPattern(\"B*\", pattern);\r\n return this;\r\n };\r\n\r\n var fillWithOptionalPattern = function(style, pattern) {\r\n if (typeof pattern === \"object\") {\r\n fillWithPattern(pattern, style);\r\n } else {\r\n out(style);\r\n }\r\n };\r\n\r\n var putStyle = function(style) {\r\n if (\r\n style === null ||\r\n (apiMode === ApiMode.ADVANCED && style === undefined)\r\n ) {\r\n return;\r\n }\r\n\r\n style = getStyle(style);\r\n\r\n // stroking / filling / both the path\r\n out(style);\r\n };\r\n\r\n function cloneTilingPattern(patternKey, boundingBox, xStep, yStep, matrix) {\r\n var clone = new TilingPattern(\r\n boundingBox || this.boundingBox,\r\n xStep || this.xStep,\r\n yStep || this.yStep,\r\n this.gState,\r\n matrix || this.matrix\r\n );\r\n clone.stream = this.stream;\r\n var key = patternKey + \"$$\" + this.cloneIndex++ + \"$$\";\r\n addPattern(key, clone);\r\n return clone;\r\n }\r\n\r\n var fillWithPattern = function(patternData, style) {\r\n var patternId = patternMap[patternData.key];\r\n var pattern = patterns[patternId];\r\n\r\n if (pattern instanceof ShadingPattern) {\r\n out(\"q\");\r\n\r\n out(clipRuleFromStyle(style));\r\n\r\n if (pattern.gState) {\r\n API.setGState(pattern.gState);\r\n }\r\n out(patternData.matrix.toString() + \" cm\");\r\n out(\"/\" + patternId + \" sh\");\r\n out(\"Q\");\r\n } else if (pattern instanceof TilingPattern) {\r\n // pdf draws patterns starting at the bottom left corner and they are not affected by the global transformation,\r\n // so we must flip them\r\n var matrix = new Matrix(1, 0, 0, -1, 0, getPageHeight());\r\n\r\n if (patternData.matrix) {\r\n matrix = matrix.multiply(patternData.matrix || identityMatrix);\r\n // we cannot apply a matrix to the pattern on use so we must abuse the pattern matrix and create new instances\r\n // for each use\r\n patternId = cloneTilingPattern.call(\r\n pattern,\r\n patternData.key,\r\n patternData.boundingBox,\r\n patternData.xStep,\r\n patternData.yStep,\r\n matrix\r\n ).id;\r\n }\r\n\r\n out(\"q\");\r\n out(\"/Pattern cs\");\r\n out(\"/\" + patternId + \" scn\");\r\n\r\n if (pattern.gState) {\r\n API.setGState(pattern.gState);\r\n }\r\n\r\n out(style);\r\n out(\"Q\");\r\n }\r\n };\r\n\r\n var clipRuleFromStyle = function(style) {\r\n switch (style) {\r\n case \"f\":\r\n case \"F\":\r\n return \"W n\";\r\n case \"f*\":\r\n return \"W* n\";\r\n case \"B\":\r\n return \"W S\";\r\n case \"B*\":\r\n return \"W* S\";\r\n\r\n // these two are for compatibility reasons (in the past, calling any primitive method with a shading pattern\r\n // and \"n\"/\"S\" as style would still fill/fill and stroke the path)\r\n case \"S\":\r\n return \"W S\";\r\n case \"n\":\r\n return \"W n\";\r\n }\r\n };\r\n\r\n /**\r\n * Begin a new subpath by moving the current point to coordinates (x, y). The PDF \"m\" operator.\r\n * @param {number} x\r\n * @param {number} y\r\n * @name moveTo\r\n * @function\r\n * @instance\r\n * @memberof jsPDF#\r\n * @returns {jsPDF}\r\n */\r\n var moveTo = (API.moveTo = function(x, y) {\r\n out(hpf(scale(x)) + \" \" + hpf(transformScaleY(y)) + \" m\");\r\n return this;\r\n });\r\n\r\n /**\r\n * Append a straight line segment from the current point to the point (x, y). The PDF \"l\" operator.\r\n * @param {number} x\r\n * @param {number} y\r\n * @memberof jsPDF#\r\n * @name lineTo\r\n * @function\r\n * @instance\r\n * @memberof jsPDF#\r\n * @returns {jsPDF}\r\n */\r\n var lineTo = (API.lineTo = function(x, y) {\r\n out(hpf(scale(x)) + \" \" + hpf(transformScaleY(y)) + \" l\");\r\n return this;\r\n });\r\n\r\n /**\r\n * Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point\r\n * (x3, y3), using (x1, y1) and (x2, y2) as Bézier control points. The new current point shall be (x3, x3).\r\n * @param {number} x1\r\n * @param {number} y1\r\n * @param {number} x2\r\n * @param {number} y2\r\n * @param {number} x3\r\n * @param {number} y3\r\n * @memberof jsPDF#\r\n * @name curveTo\r\n * @function\r\n * @instance\r\n * @memberof jsPDF#\r\n * @returns {jsPDF}\r\n */\r\n var curveTo = (API.curveTo = function(x1, y1, x2, y2, x3, y3) {\r\n out(\r\n [\r\n hpf(scale(x1)),\r\n hpf(transformScaleY(y1)),\r\n hpf(scale(x2)),\r\n hpf(transformScaleY(y2)),\r\n hpf(scale(x3)),\r\n hpf(transformScaleY(y3)),\r\n \"c\"\r\n ].join(\" \")\r\n );\r\n return this;\r\n });\r\n\r\n /**\r\n * Draw a line on the current page.\r\n *\r\n * @name line\r\n * @function\r\n * @instance\r\n * @param {number} x1\r\n * @param {number} y1\r\n * @param {number} x2\r\n * @param {number} y2\r\n * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. default: 'S'\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n */\r\n API.__private__.line = API.line = function(x1, y1, x2, y2, style) {\r\n if (\r\n isNaN(x1) ||\r\n isNaN(y1) ||\r\n isNaN(x2) ||\r\n isNaN(y2) ||\r\n !isValidStyle(style)\r\n ) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.line\");\r\n }\r\n if (apiMode === ApiMode.COMPAT) {\r\n return this.lines([[x2 - x1, y2 - y1]], x1, y1, [1, 1], style || \"S\");\r\n } else {\r\n return this.lines([[x2 - x1, y2 - y1]], x1, y1, [1, 1]).stroke();\r\n }\r\n };\r\n\r\n /**\r\n * @typedef {Object} PatternData\r\n * {Matrix|undefined} matrix\r\n * {Number|undefined} xStep\r\n * {Number|undefined} yStep\r\n * {Array.|undefined} boundingBox\r\n */\r\n\r\n /**\r\n * Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates.\r\n * All data points in `lines` are relative to last line origin.\r\n * `x`, `y` become x1,y1 for first line / curve in the set.\r\n * For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point.\r\n * For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1.\r\n *\r\n * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line\r\n * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves).\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction.\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @param {Boolean=} closed If true, the path is closed with a straight line from the end of the last curve to the starting point.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name lines\r\n */\r\n API.__private__.lines = API.lines = function(\r\n lines,\r\n x,\r\n y,\r\n scale,\r\n style,\r\n closed\r\n ) {\r\n var scalex, scaley, i, l, leg, x2, y2, x3, y3, x4, y4, tmp;\r\n\r\n // Pre-August-2012 the order of arguments was function(x, y, lines, scale, style)\r\n // in effort to make all calls have similar signature like\r\n // function(content, coordinateX, coordinateY , miscellaneous)\r\n // this method had its args flipped.\r\n // code below allows backward compatibility with old arg order.\r\n if (typeof lines === \"number\") {\r\n tmp = y;\r\n y = x;\r\n x = lines;\r\n lines = tmp;\r\n }\r\n\r\n scale = scale || [1, 1];\r\n closed = closed || false;\r\n\r\n if (\r\n isNaN(x) ||\r\n isNaN(y) ||\r\n !Array.isArray(lines) ||\r\n !Array.isArray(scale) ||\r\n !isValidStyle(style) ||\r\n typeof closed !== \"boolean\"\r\n ) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.lines\");\r\n }\r\n\r\n // starting point\r\n moveTo(x, y);\r\n\r\n scalex = scale[0];\r\n scaley = scale[1];\r\n l = lines.length;\r\n //, x2, y2 // bezier only. In page default measurement \"units\", *after* scaling\r\n //, x3, y3 // bezier only. In page default measurement \"units\", *after* scaling\r\n // ending point for all, lines and bezier. . In page default measurement \"units\", *after* scaling\r\n x4 = x; // last / ending point = starting point for first item.\r\n y4 = y; // last / ending point = starting point for first item.\r\n\r\n for (i = 0; i < l; i++) {\r\n leg = lines[i];\r\n if (leg.length === 2) {\r\n // simple line\r\n x4 = leg[0] * scalex + x4; // here last x4 was prior ending point\r\n y4 = leg[1] * scaley + y4; // here last y4 was prior ending point\r\n lineTo(x4, y4);\r\n } else {\r\n // bezier curve\r\n x2 = leg[0] * scalex + x4; // here last x4 is prior ending point\r\n y2 = leg[1] * scaley + y4; // here last y4 is prior ending point\r\n x3 = leg[2] * scalex + x4; // here last x4 is prior ending point\r\n y3 = leg[3] * scaley + y4; // here last y4 is prior ending point\r\n x4 = leg[4] * scalex + x4; // here last x4 was prior ending point\r\n y4 = leg[5] * scaley + y4; // here last y4 was prior ending point\r\n curveTo(x2, y2, x3, y3, x4, y4);\r\n }\r\n }\r\n\r\n if (closed) {\r\n close();\r\n }\r\n\r\n putStyle(style);\r\n return this;\r\n };\r\n\r\n /**\r\n * Similar to {@link API.lines} but all coordinates are interpreted as absolute coordinates instead of relative.\r\n * @param {Array} lines An array of {op: operator, c: coordinates} object, where op is one of \"m\" (move to), \"l\" (line to)\r\n * \"c\" (cubic bezier curve) and \"h\" (close (sub)path)). c is an array of coordinates. \"m\" and \"l\" expect two, \"c\"\r\n * six and \"h\" an empty array (or undefined).\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name path\r\n */\r\n API.path = function(lines) {\r\n for (var i = 0; i < lines.length; i++) {\r\n var leg = lines[i];\r\n var coords = leg.c;\r\n switch (leg.op) {\r\n case \"m\":\r\n moveTo(coords[0], coords[1]);\r\n break;\r\n case \"l\":\r\n lineTo(coords[0], coords[1]);\r\n break;\r\n case \"c\":\r\n curveTo.apply(this, coords);\r\n break;\r\n case \"h\":\r\n close();\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds a rectangle to PDF.\r\n *\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} w Width (in units declared at inception of PDF document)\r\n * @param {number} h Height (in units declared at inception of PDF document)\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name rect\r\n */\r\n API.__private__.rect = API.rect = function(x, y, w, h, style) {\r\n if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h) || !isValidStyle(style)) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.rect\");\r\n }\r\n if (apiMode === ApiMode.COMPAT) {\r\n h = -h;\r\n }\r\n\r\n out(\r\n [\r\n hpf(scale(x)),\r\n hpf(transformScaleY(y)),\r\n hpf(scale(w)),\r\n hpf(scale(h)),\r\n \"re\"\r\n ].join(\" \")\r\n );\r\n\r\n putStyle(style);\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds a triangle to PDF.\r\n *\r\n * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name triangle\r\n */\r\n API.__private__.triangle = API.triangle = function(\r\n x1,\r\n y1,\r\n x2,\r\n y2,\r\n x3,\r\n y3,\r\n style\r\n ) {\r\n if (\r\n isNaN(x1) ||\r\n isNaN(y1) ||\r\n isNaN(x2) ||\r\n isNaN(y2) ||\r\n isNaN(x3) ||\r\n isNaN(y3) ||\r\n !isValidStyle(style)\r\n ) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.triangle\");\r\n }\r\n this.lines(\r\n [\r\n [x2 - x1, y2 - y1], // vector to point 2\r\n [x3 - x2, y3 - y2], // vector to point 3\r\n [x1 - x3, y1 - y3] // closing vector back to point 1\r\n ],\r\n x1,\r\n y1, // start of path\r\n [1, 1],\r\n style,\r\n true\r\n );\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds a rectangle with rounded corners to PDF.\r\n *\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} w Width (in units declared at inception of PDF document)\r\n * @param {number} h Height (in units declared at inception of PDF document)\r\n * @param {number} rx Radius along x axis (in units declared at inception of PDF document)\r\n * @param {number} ry Radius along y axis (in units declared at inception of PDF document)\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name roundedRect\r\n */\r\n API.__private__.roundedRect = API.roundedRect = function(\r\n x,\r\n y,\r\n w,\r\n h,\r\n rx,\r\n ry,\r\n style\r\n ) {\r\n if (\r\n isNaN(x) ||\r\n isNaN(y) ||\r\n isNaN(w) ||\r\n isNaN(h) ||\r\n isNaN(rx) ||\r\n isNaN(ry) ||\r\n !isValidStyle(style)\r\n ) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.roundedRect\");\r\n }\r\n var MyArc = (4 / 3) * (Math.SQRT2 - 1);\r\n\r\n rx = Math.min(rx, w * 0.5);\r\n ry = Math.min(ry, h * 0.5);\r\n\r\n this.lines(\r\n [\r\n [w - 2 * rx, 0],\r\n [rx * MyArc, 0, rx, ry - ry * MyArc, rx, ry],\r\n [0, h - 2 * ry],\r\n [0, ry * MyArc, -(rx * MyArc), ry, -rx, ry],\r\n [-w + 2 * rx, 0],\r\n [-(rx * MyArc), 0, -rx, -(ry * MyArc), -rx, -ry],\r\n [0, -h + 2 * ry],\r\n [0, -(ry * MyArc), rx * MyArc, -ry, rx, -ry]\r\n ],\r\n x + rx,\r\n y, // start of path\r\n [1, 1],\r\n style,\r\n true\r\n );\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds an ellipse to PDF.\r\n *\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} rx Radius along x axis (in units declared at inception of PDF document)\r\n * @param {number} ry Radius along y axis (in units declared at inception of PDF document)\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name ellipse\r\n */\r\n API.__private__.ellipse = API.ellipse = function(x, y, rx, ry, style) {\r\n if (\r\n isNaN(x) ||\r\n isNaN(y) ||\r\n isNaN(rx) ||\r\n isNaN(ry) ||\r\n !isValidStyle(style)\r\n ) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.ellipse\");\r\n }\r\n var lx = (4 / 3) * (Math.SQRT2 - 1) * rx,\r\n ly = (4 / 3) * (Math.SQRT2 - 1) * ry;\r\n\r\n moveTo(x + rx, y);\r\n curveTo(x + rx, y - ly, x + lx, y - ry, x, y - ry);\r\n curveTo(x - lx, y - ry, x - rx, y - ly, x - rx, y);\r\n curveTo(x - rx, y + ly, x - lx, y + ry, x, y + ry);\r\n curveTo(x + lx, y + ry, x + rx, y + ly, x + rx, y);\r\n\r\n putStyle(style);\r\n return this;\r\n };\r\n\r\n /**\r\n * Adds an circle to PDF.\r\n *\r\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n * @param {number} r Radius (in units declared at inception of PDF document)\r\n * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n * 'S' [default] - stroke,\r\n * 'F' - fill,\r\n * and 'DF' (or 'FD') - fill then stroke.\r\n * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n *\r\n * In \"advanced\" API mode this parameter is deprecated.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name circle\r\n */\r\n API.__private__.circle = API.circle = function(x, y, r, style) {\r\n if (isNaN(x) || isNaN(y) || isNaN(r) || !isValidStyle(style)) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.circle\");\r\n }\r\n return this.ellipse(x, y, r, r, style);\r\n };\r\n\r\n /**\r\n * Sets text font face, variant for upcoming text elements.\r\n * See output of jsPDF.getFontList() for possible font names, styles.\r\n *\r\n * @param {string} fontName Font name or family. Example: \"times\".\r\n * @param {string} fontStyle Font style or variant. Example: \"italic\".\r\n * @param {number | string} fontWeight Weight of the Font. Example: \"normal\" | 400\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setFont\r\n */\r\n API.setFont = function(fontName, fontStyle, fontWeight) {\r\n if (fontWeight) {\r\n fontStyle = combineFontStyleAndFontWeight(fontStyle, fontWeight);\r\n }\r\n activeFontKey = getFont(fontName, fontStyle, {\r\n disableWarning: false\r\n });\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets text font face, variant for upcoming text elements.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {Object}\r\n * @memberof jsPDF#\r\n * @name getFont\r\n */\r\n var getFontEntry = (API.__private__.getFont = API.getFont = function() {\r\n return fonts[getFont.apply(API, arguments)];\r\n });\r\n\r\n /**\r\n * Returns an object - a tree of fontName to fontStyle relationships available to\r\n * active PDF document.\r\n *\r\n * @public\r\n * @function\r\n * @instance\r\n * @returns {Object} Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... }\r\n * @memberof jsPDF#\r\n * @name getFontList\r\n */\r\n API.__private__.getFontList = API.getFontList = function() {\r\n var list = {},\r\n fontName,\r\n fontStyle;\r\n\r\n for (fontName in fontmap) {\r\n if (fontmap.hasOwnProperty(fontName)) {\r\n list[fontName] = [];\r\n for (fontStyle in fontmap[fontName]) {\r\n if (fontmap[fontName].hasOwnProperty(fontStyle)) {\r\n list[fontName].push(fontStyle);\r\n }\r\n }\r\n }\r\n }\r\n return list;\r\n };\r\n\r\n /**\r\n * Add a custom font to the current instance.\r\n *\r\n * @param {string} postScriptName PDF specification full name for the font.\r\n * @param {string} id PDF-document-instance-specific label assinged to the font.\r\n * @param {string} fontStyle Style of the Font.\r\n * @param {number | string} fontWeight Weight of the Font.\r\n * @param {Object} encoding Encoding_name-to-Font_metrics_object mapping.\r\n * @function\r\n * @instance\r\n * @memberof jsPDF#\r\n * @name addFont\r\n * @returns {string} fontId\r\n */\r\n API.addFont = function(\r\n postScriptName,\r\n fontName,\r\n fontStyle,\r\n fontWeight,\r\n encoding\r\n ) {\r\n var encodingOptions = [\r\n \"StandardEncoding\",\r\n \"MacRomanEncoding\",\r\n \"Identity-H\",\r\n \"WinAnsiEncoding\"\r\n ];\r\n if (arguments[3] && encodingOptions.indexOf(arguments[3]) !== -1) {\r\n //IE 11 fix\r\n encoding = arguments[3];\r\n } else if (arguments[3] && encodingOptions.indexOf(arguments[3]) == -1) {\r\n fontStyle = combineFontStyleAndFontWeight(fontStyle, fontWeight);\r\n }\r\n encoding = encoding || \"Identity-H\";\r\n return addFont.call(this, postScriptName, fontName, fontStyle, encoding);\r\n };\r\n\r\n var lineWidth = options.lineWidth || 0.200025; // 2mm\r\n /**\r\n * Gets the line width, default: 0.200025.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {number} lineWidth\r\n * @memberof jsPDF#\r\n * @name getLineWidth\r\n */\r\n var getLineWidth = (API.__private__.getLineWidth = API.getLineWidth = function() {\r\n return lineWidth;\r\n });\r\n\r\n /**\r\n * Sets line width for upcoming lines.\r\n *\r\n * @param {number} width Line width (in units declared at inception of PDF document).\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineWidth\r\n */\r\n var setLineWidth = (API.__private__.setLineWidth = API.setLineWidth = function(\r\n width\r\n ) {\r\n lineWidth = width;\r\n out(hpf(scale(width)) + \" w\");\r\n return this;\r\n });\r\n\r\n /**\r\n * Sets the dash pattern for upcoming lines.\r\n *\r\n * To reset the settings simply call the method without any parameters.\r\n * @param {Array} dashArray An array containing 0-2 numbers. The first number sets the length of the\r\n * dashes, the second number the length of the gaps. If the second number is missing, the gaps are considered\r\n * to be as long as the dashes. An empty array means solid, unbroken lines.\r\n * @param {number} dashPhase The phase lines start with.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineDashPattern\r\n */\r\n API.__private__.setLineDash = jsPDF.API.setLineDash = jsPDF.API.setLineDashPattern = function(\r\n dashArray,\r\n dashPhase\r\n ) {\r\n dashArray = dashArray || [];\r\n dashPhase = dashPhase || 0;\r\n\r\n if (isNaN(dashPhase) || !Array.isArray(dashArray)) {\r\n throw new Error(\"Invalid arguments passed to jsPDF.setLineDash\");\r\n }\r\n\r\n dashArray = dashArray\r\n .map(function(x) {\r\n return hpf(scale(x));\r\n })\r\n .join(\" \");\r\n dashPhase = hpf(scale(dashPhase));\r\n\r\n out(\"[\" + dashArray + \"] \" + dashPhase + \" d\");\r\n return this;\r\n };\r\n\r\n var lineHeightFactor;\r\n\r\n var getLineHeight = (API.__private__.getLineHeight = API.getLineHeight = function() {\r\n return activeFontSize * lineHeightFactor;\r\n });\r\n\r\n API.__private__.getLineHeight = API.getLineHeight = function() {\r\n return activeFontSize * lineHeightFactor;\r\n };\r\n\r\n /**\r\n * Sets the LineHeightFactor of proportion.\r\n *\r\n * @param {number} value LineHeightFactor value. Default: 1.15.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineHeightFactor\r\n */\r\n var setLineHeightFactor = (API.__private__.setLineHeightFactor = API.setLineHeightFactor = function(\r\n value\r\n ) {\r\n value = value || 1.15;\r\n if (typeof value === \"number\") {\r\n lineHeightFactor = value;\r\n }\r\n return this;\r\n });\r\n\r\n /**\r\n * Gets the LineHeightFactor, default: 1.15.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {number} lineHeightFactor\r\n * @memberof jsPDF#\r\n * @name getLineHeightFactor\r\n */\r\n var getLineHeightFactor = (API.__private__.getLineHeightFactor = API.getLineHeightFactor = function() {\r\n return lineHeightFactor;\r\n });\r\n\r\n setLineHeightFactor(options.lineHeight);\r\n\r\n var getHorizontalCoordinate = (API.__private__.getHorizontalCoordinate = function(\r\n value\r\n ) {\r\n return scale(value);\r\n });\r\n\r\n var getVerticalCoordinate = (API.__private__.getVerticalCoordinate = function(\r\n value\r\n ) {\r\n if (apiMode === ApiMode.ADVANCED) {\r\n return value;\r\n } else {\r\n var pageHeight =\r\n pagesContext[currentPage].mediaBox.topRightY -\r\n pagesContext[currentPage].mediaBox.bottomLeftY;\r\n return pageHeight - scale(value);\r\n }\r\n });\r\n\r\n var getHorizontalCoordinateString = (API.__private__.getHorizontalCoordinateString = API.getHorizontalCoordinateString = function(\r\n value\r\n ) {\r\n return hpf(getHorizontalCoordinate(value));\r\n });\r\n\r\n var getVerticalCoordinateString = (API.__private__.getVerticalCoordinateString = API.getVerticalCoordinateString = function(\r\n value\r\n ) {\r\n return hpf(getVerticalCoordinate(value));\r\n });\r\n\r\n var strokeColor = options.strokeColor || \"0 G\";\r\n\r\n /**\r\n * Gets the stroke color for upcoming elements.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {string} colorAsHex\r\n * @memberof jsPDF#\r\n * @name getDrawColor\r\n */\r\n API.__private__.getStrokeColor = API.getDrawColor = function() {\r\n return decodeColorString(strokeColor);\r\n };\r\n\r\n /**\r\n * Sets the stroke color for upcoming elements.\r\n *\r\n * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n * color space is implied.\r\n *\r\n * When only ch1 is given, \"Gray\" color space is implied and it\r\n * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n * if values are communicated as String types, or in range from 0 (black)\r\n * to 255 (white) if communicated as Number type.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n * (max intensity) if values are communicated as String types, or\r\n * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n * as Number types.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n * value must be a in the range from 0.00 (0% concentration) to to\r\n * 1.00 (100% concentration)\r\n *\r\n * Because JavaScript treats fixed point numbers badly (rounds to\r\n * floating point nearest to binary representation) it is highly advised to\r\n * communicate the fractional numbers as String types, not JavaScript Number type.\r\n *\r\n * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n * @param {Number} ch2 Color channel value.\r\n * @param {Number} ch3 Color channel value.\r\n * @param {Number} ch4 Color channel value.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setDrawColor\r\n */\r\n API.__private__.setStrokeColor = API.setDrawColor = function(\r\n ch1,\r\n ch2,\r\n ch3,\r\n ch4\r\n ) {\r\n var options = {\r\n ch1: ch1,\r\n ch2: ch2,\r\n ch3: ch3,\r\n ch4: ch4,\r\n pdfColorType: \"draw\",\r\n precision: 2\r\n };\r\n\r\n strokeColor = encodeColorString(options);\r\n out(strokeColor);\r\n return this;\r\n };\r\n\r\n var fillColor = options.fillColor || \"0 g\";\r\n\r\n /**\r\n * Gets the fill color for upcoming elements.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {string} colorAsHex\r\n * @memberof jsPDF#\r\n * @name getFillColor\r\n */\r\n API.__private__.getFillColor = API.getFillColor = function() {\r\n return decodeColorString(fillColor);\r\n };\r\n\r\n /**\r\n * Sets the fill color for upcoming elements.\r\n *\r\n * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n * color space is implied.\r\n *\r\n * When only ch1 is given, \"Gray\" color space is implied and it\r\n * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n * if values are communicated as String types, or in range from 0 (black)\r\n * to 255 (white) if communicated as Number type.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n * (max intensity) if values are communicated as String types, or\r\n * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n * as Number types.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n * value must be a in the range from 0.00 (0% concentration) to to\r\n * 1.00 (100% concentration)\r\n *\r\n * Because JavaScript treats fixed point numbers badly (rounds to\r\n * floating point nearest to binary representation) it is highly advised to\r\n * communicate the fractional numbers as String types, not JavaScript Number type.\r\n *\r\n * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n * @param {Number} ch2 Color channel value.\r\n * @param {Number} ch3 Color channel value.\r\n * @param {Number} ch4 Color channel value.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setFillColor\r\n */\r\n API.__private__.setFillColor = API.setFillColor = function(\r\n ch1,\r\n ch2,\r\n ch3,\r\n ch4\r\n ) {\r\n var options = {\r\n ch1: ch1,\r\n ch2: ch2,\r\n ch3: ch3,\r\n ch4: ch4,\r\n pdfColorType: \"fill\",\r\n precision: 2\r\n };\r\n\r\n fillColor = encodeColorString(options);\r\n out(fillColor);\r\n return this;\r\n };\r\n\r\n var textColor = options.textColor || \"0 g\";\r\n /**\r\n * Gets the text color for upcoming elements.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {string} colorAsHex\r\n * @memberof jsPDF#\r\n * @name getTextColor\r\n */\r\n var getTextColor = (API.__private__.getTextColor = API.getTextColor = function() {\r\n return decodeColorString(textColor);\r\n });\r\n /**\r\n * Sets the text color for upcoming elements.\r\n *\r\n * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n * color space is implied.\r\n *\r\n * When only ch1 is given, \"Gray\" color space is implied and it\r\n * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n * if values are communicated as String types, or in range from 0 (black)\r\n * to 255 (white) if communicated as Number type.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n * (max intensity) if values are communicated as String types, or\r\n * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n * as Number types.\r\n * The RGB-like 0-255 range is provided for backward compatibility.\r\n *\r\n * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n * value must be a in the range from 0.00 (0% concentration) to to\r\n * 1.00 (100% concentration)\r\n *\r\n * Because JavaScript treats fixed point numbers badly (rounds to\r\n * floating point nearest to binary representation) it is highly advised to\r\n * communicate the fractional numbers as String types, not JavaScript Number type.\r\n *\r\n * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n * @param {Number} ch2 Color channel value.\r\n * @param {Number} ch3 Color channel value.\r\n * @param {Number} ch4 Color channel value.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setTextColor\r\n */\r\n API.__private__.setTextColor = API.setTextColor = function(\r\n ch1,\r\n ch2,\r\n ch3,\r\n ch4\r\n ) {\r\n var options = {\r\n ch1: ch1,\r\n ch2: ch2,\r\n ch3: ch3,\r\n ch4: ch4,\r\n pdfColorType: \"text\",\r\n precision: 3\r\n };\r\n textColor = encodeColorString(options);\r\n\r\n return this;\r\n };\r\n\r\n var activeCharSpace = options.charSpace;\r\n\r\n /**\r\n * Get global value of CharSpace.\r\n *\r\n * @function\r\n * @instance\r\n * @returns {number} charSpace\r\n * @memberof jsPDF#\r\n * @name getCharSpace\r\n */\r\n var getCharSpace = (API.__private__.getCharSpace = API.getCharSpace = function() {\r\n return parseFloat(activeCharSpace || 0);\r\n });\r\n\r\n /**\r\n * Set global value of CharSpace.\r\n *\r\n * @param {number} charSpace\r\n * @function\r\n * @instance\r\n * @returns {jsPDF} jsPDF-instance\r\n * @memberof jsPDF#\r\n * @name setCharSpace\r\n */\r\n API.__private__.setCharSpace = API.setCharSpace = function(charSpace) {\r\n if (isNaN(charSpace)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.setCharSpace\");\r\n }\r\n activeCharSpace = charSpace;\r\n return this;\r\n };\r\n\r\n var lineCapID = 0;\r\n /**\r\n * Is an Object providing a mapping from human-readable to\r\n * integer flag values designating the varieties of line cap\r\n * and join styles.\r\n *\r\n * @memberof jsPDF#\r\n * @name CapJoinStyles\r\n */\r\n API.CapJoinStyles = {\r\n 0: 0,\r\n butt: 0,\r\n but: 0,\r\n miter: 0,\r\n 1: 1,\r\n round: 1,\r\n rounded: 1,\r\n circle: 1,\r\n 2: 2,\r\n projecting: 2,\r\n project: 2,\r\n square: 2,\r\n bevel: 2\r\n };\r\n\r\n /**\r\n * Sets the line cap styles.\r\n * See {jsPDF.CapJoinStyles} for variants.\r\n *\r\n * @param {String|Number} style A string or number identifying the type of line cap.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineCap\r\n */\r\n API.__private__.setLineCap = API.setLineCap = function(style) {\r\n var id = API.CapJoinStyles[style];\r\n if (id === undefined) {\r\n throw new Error(\r\n \"Line cap style of '\" +\r\n style +\r\n \"' is not recognized. See or extend .CapJoinStyles property for valid styles\"\r\n );\r\n }\r\n lineCapID = id;\r\n out(id + \" J\");\r\n\r\n return this;\r\n };\r\n\r\n var lineJoinID = 0;\r\n /**\r\n * Sets the line join styles.\r\n * See {jsPDF.CapJoinStyles} for variants.\r\n *\r\n * @param {String|Number} style A string or number identifying the type of line join.\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineJoin\r\n */\r\n API.__private__.setLineJoin = API.setLineJoin = function(style) {\r\n var id = API.CapJoinStyles[style];\r\n if (id === undefined) {\r\n throw new Error(\r\n \"Line join style of '\" +\r\n style +\r\n \"' is not recognized. See or extend .CapJoinStyles property for valid styles\"\r\n );\r\n }\r\n lineJoinID = id;\r\n out(id + \" j\");\r\n\r\n return this;\r\n };\r\n\r\n var miterLimit;\r\n /**\r\n * Sets the miterLimit property, which effects the maximum miter length.\r\n *\r\n * @param {number} length The length of the miter\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setLineMiterLimit\r\n */\r\n API.__private__.setLineMiterLimit = API.__private__.setMiterLimit = API.setLineMiterLimit = API.setMiterLimit = function(\r\n length\r\n ) {\r\n length = length || 0;\r\n if (isNaN(length)) {\r\n throw new Error(\"Invalid argument passed to jsPDF.setLineMiterLimit\");\r\n }\r\n out(hpf(scale(length)) + \" M\");\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * An object representing a pdf graphics state.\r\n * @class GState\r\n */\r\n\r\n /**\r\n *\r\n * @param parameters A parameter object that contains all properties this graphics state wants to set.\r\n * Supported are: opacity, stroke-opacity\r\n * @constructor\r\n */\r\n API.GState = GState;\r\n\r\n /**\r\n * Sets a either previously added {@link GState} (via {@link addGState}) or a new {@link GState}.\r\n * @param {String|GState} gState If type is string, a previously added GState is used, if type is GState\r\n * it will be added before use.\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setGState\r\n */\r\n API.setGState = function(gState) {\r\n if (typeof gState === \"string\") {\r\n gState = gStates[gStatesMap[gState]];\r\n } else {\r\n gState = addGState(null, gState);\r\n }\r\n\r\n if (!gState.equals(activeGState)) {\r\n out(\"/\" + gState.id + \" gs\");\r\n activeGState = gState;\r\n }\r\n };\r\n\r\n /**\r\n * Adds a new Graphics State. Duplicates are automatically eliminated.\r\n * @param {String} key Might also be null, if no later reference to this gState is needed\r\n * @param {Object} gState The gState object\r\n */\r\n var addGState = function(key, gState) {\r\n // only add it if it is not already present (the keys provided by the user must be unique!)\r\n if (key && gStatesMap[key]) return;\r\n var duplicate = false;\r\n for (var s in gStates) {\r\n if (gStates.hasOwnProperty(s)) {\r\n if (gStates[s].equals(gState)) {\r\n duplicate = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (duplicate) {\r\n gState = gStates[s];\r\n } else {\r\n var gStateKey = \"GS\" + (Object.keys(gStates).length + 1).toString(10);\r\n gStates[gStateKey] = gState;\r\n gState.id = gStateKey;\r\n }\r\n\r\n // several user keys may point to the same GState object\r\n key && (gStatesMap[key] = gState.id);\r\n\r\n events.publish(\"addGState\", gState);\r\n\r\n return gState;\r\n };\r\n\r\n /**\r\n * Adds a new {@link GState} for later use. See {@link setGState}.\r\n * @param {String} key\r\n * @param {GState} gState\r\n * @function\r\n * @instance\r\n * @returns {jsPDF}\r\n *\r\n * @memberof jsPDF#\r\n * @name addGState\r\n */\r\n API.addGState = function(key, gState) {\r\n addGState(key, gState);\r\n return this;\r\n };\r\n\r\n /**\r\n * Saves the current graphics state (\"pushes it on the stack\"). It can be restored by {@link restoreGraphicsState}\r\n * later. Here, the general pdf graphics state is meant, also including the current transformation matrix,\r\n * fill and stroke colors etc.\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name saveGraphicsState\r\n */\r\n API.saveGraphicsState = function() {\r\n out(\"q\");\r\n // as we cannot set font key and size independently we must keep track of both\r\n fontStateStack.push({\r\n key: activeFontKey,\r\n size: activeFontSize,\r\n color: textColor\r\n });\r\n return this;\r\n };\r\n\r\n /**\r\n * Restores a previously saved graphics state saved by {@link saveGraphicsState} (\"pops the stack\").\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name restoreGraphicsState\r\n */\r\n API.restoreGraphicsState = function() {\r\n out(\"Q\");\r\n\r\n // restore previous font state\r\n var fontState = fontStateStack.pop();\r\n activeFontKey = fontState.key;\r\n activeFontSize = fontState.size;\r\n textColor = fontState.color;\r\n\r\n activeGState = null;\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Appends this matrix to the left of all previously applied matrices.\r\n *\r\n * @param {Matrix} matrix\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name setCurrentTransformationMatrix\r\n */\r\n API.setCurrentTransformationMatrix = function(matrix) {\r\n out(matrix.toString() + \" cm\");\r\n return this;\r\n };\r\n\r\n /**\r\n * Inserts a debug comment into the generated pdf.\r\n * @function\r\n * @instance\r\n * @param {String} text\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name comment\r\n */\r\n API.comment = function(text) {\r\n out(\"#\" + text);\r\n return this;\r\n };\r\n\r\n /**\r\n * Point\r\n */\r\n var Point = function(x, y) {\r\n var _x = x || 0;\r\n Object.defineProperty(this, \"x\", {\r\n enumerable: true,\r\n get: function() {\r\n return _x;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _x = parseFloat(value);\r\n }\r\n }\r\n });\r\n\r\n var _y = y || 0;\r\n Object.defineProperty(this, \"y\", {\r\n enumerable: true,\r\n get: function() {\r\n return _y;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _y = parseFloat(value);\r\n }\r\n }\r\n });\r\n\r\n var _type = \"pt\";\r\n Object.defineProperty(this, \"type\", {\r\n enumerable: true,\r\n get: function() {\r\n return _type;\r\n },\r\n set: function(value) {\r\n _type = value.toString();\r\n }\r\n });\r\n return this;\r\n };\r\n\r\n /**\r\n * Rectangle\r\n */\r\n var Rectangle = function(x, y, w, h) {\r\n Point.call(this, x, y);\r\n this.type = \"rect\";\r\n\r\n var _w = w || 0;\r\n Object.defineProperty(this, \"w\", {\r\n enumerable: true,\r\n get: function() {\r\n return _w;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _w = parseFloat(value);\r\n }\r\n }\r\n });\r\n\r\n var _h = h || 0;\r\n Object.defineProperty(this, \"h\", {\r\n enumerable: true,\r\n get: function() {\r\n return _h;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _h = parseFloat(value);\r\n }\r\n }\r\n });\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * FormObject/RenderTarget\r\n */\r\n\r\n var RenderTarget = function() {\r\n this.page = page;\r\n this.currentPage = currentPage;\r\n this.pages = pages.slice(0);\r\n this.pagesContext = pagesContext.slice(0);\r\n this.x = pageX;\r\n this.y = pageY;\r\n this.matrix = pageMatrix;\r\n this.width = getPageWidth(currentPage);\r\n this.height = getPageHeight(currentPage);\r\n this.outputDestination = outputDestination;\r\n\r\n this.id = \"\"; // set by endFormObject()\r\n this.objectNumber = -1; // will be set by putXObject()\r\n };\r\n\r\n RenderTarget.prototype.restore = function() {\r\n page = this.page;\r\n currentPage = this.currentPage;\r\n pagesContext = this.pagesContext;\r\n pages = this.pages;\r\n pageX = this.x;\r\n pageY = this.y;\r\n pageMatrix = this.matrix;\r\n setPageWidth(currentPage, this.width);\r\n setPageHeight(currentPage, this.height);\r\n outputDestination = this.outputDestination;\r\n };\r\n\r\n var beginNewRenderTarget = function(x, y, width, height, matrix) {\r\n // save current state\r\n renderTargetStack.push(new RenderTarget());\r\n\r\n // clear pages\r\n page = currentPage = 0;\r\n pages = [];\r\n pageX = x;\r\n pageY = y;\r\n\r\n pageMatrix = matrix;\r\n\r\n beginPage([width, height]);\r\n };\r\n\r\n var endFormObject = function(key) {\r\n // only add it if it is not already present (the keys provided by the user must be unique!)\r\n if (renderTargetMap[key]) {\r\n renderTargetStack.pop().restore();\r\n return;\r\n }\r\n\r\n // save the created xObject\r\n var newXObject = new RenderTarget();\r\n\r\n var xObjectId = \"Xo\" + (Object.keys(renderTargets).length + 1).toString(10);\r\n newXObject.id = xObjectId;\r\n\r\n renderTargetMap[key] = xObjectId;\r\n renderTargets[xObjectId] = newXObject;\r\n\r\n events.publish(\"addFormObject\", newXObject);\r\n\r\n // restore state from stack\r\n renderTargetStack.pop().restore();\r\n };\r\n\r\n /**\r\n * Starts a new pdf form object, which means that all consequent draw calls target a new independent object\r\n * until {@link endFormObject} is called. The created object can be referenced and drawn later using\r\n * {@link doFormObject}. Nested form objects are possible.\r\n * x, y, width, height set the bounding box that is used to clip the content.\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {Matrix} matrix The matrix that will be applied to convert the form objects coordinate system to\r\n * the parent's.\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name beginFormObject\r\n */\r\n API.beginFormObject = function(x, y, width, height, matrix) {\r\n // The user can set the output target to a new form object. Nested form objects are possible.\r\n // Currently, they use the resource dictionary of the surrounding stream. This should be changed, as\r\n // the PDF-Spec states:\r\n // \"In PDF 1.2 and later versions, form XObjects may be independent of the content streams in which\r\n // they appear, and this is strongly recommended although not requiredIn PDF 1.2 and later versions,\r\n // form XObjects may be independent of the content streams in which they appear, and this is strongly\r\n // recommended although not required\"\r\n beginNewRenderTarget(x, y, width, height, matrix);\r\n return this;\r\n };\r\n\r\n /**\r\n * Completes and saves the form object.\r\n * @param {String} key The key by which this form object can be referenced.\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name endFormObject\r\n */\r\n API.endFormObject = function(key) {\r\n endFormObject(key);\r\n return this;\r\n };\r\n\r\n /**\r\n * Draws the specified form object by referencing to the respective pdf XObject created with\r\n * {@link API.beginFormObject} and {@link endFormObject}.\r\n * The location is determined by matrix.\r\n *\r\n * @param {String} key The key to the form object.\r\n * @param {Matrix} matrix The matrix applied before drawing the form object.\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name doFormObject\r\n */\r\n API.doFormObject = function(key, matrix) {\r\n var xObject = renderTargets[renderTargetMap[key]];\r\n out(\"q\");\r\n out(matrix.toString() + \" cm\");\r\n out(\"/\" + xObject.id + \" Do\");\r\n out(\"Q\");\r\n return this;\r\n };\r\n\r\n /**\r\n * Returns the form object specified by key.\r\n * @param key {String}\r\n * @returns {{x: number, y: number, width: number, height: number, matrix: Matrix}}\r\n * @function\r\n * @returns {jsPDF}\r\n * @memberof jsPDF#\r\n * @name getFormObject\r\n */\r\n API.getFormObject = function(key) {\r\n var xObject = renderTargets[renderTargetMap[key]];\r\n return {\r\n x: xObject.x,\r\n y: xObject.y,\r\n width: xObject.width,\r\n height: xObject.height,\r\n matrix: xObject.matrix\r\n };\r\n };\r\n\r\n /**\r\n * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf').\r\n * Uses FileSaver.js-method saveAs.\r\n *\r\n * @memberof jsPDF#\r\n * @name save\r\n * @function\r\n * @instance\r\n * @param {string} filename The filename including extension.\r\n * @param {Object} options An Object with additional options, possible options: 'returnPromise'.\r\n * @returns {jsPDF|Promise} jsPDF-instance */\r\n API.save = function(filename, options) {\r\n filename = filename || \"generated.pdf\";\r\n\r\n options = options || {};\r\n options.returnPromise = options.returnPromise || false;\r\n\r\n if (options.returnPromise === false) {\r\n saveAs(getBlob(buildDocument()), filename);\r\n if (typeof saveAs.unload === \"function\") {\r\n if (globalObject.setTimeout) {\r\n setTimeout(saveAs.unload, 911);\r\n }\r\n }\r\n return this;\r\n } else {\r\n return new Promise(function(resolve, reject) {\r\n try {\r\n var result = saveAs(getBlob(buildDocument()), filename);\r\n if (typeof saveAs.unload === \"function\") {\r\n if (globalObject.setTimeout) {\r\n setTimeout(saveAs.unload, 911);\r\n }\r\n }\r\n resolve(result);\r\n } catch (e) {\r\n reject(e.message);\r\n }\r\n });\r\n }\r\n\r\n };\r\n\r\n // applying plugins (more methods) ON TOP of built-in API.\r\n // this is intentional as we allow plugins to override\r\n // built-ins\r\n for (var plugin in jsPDF.API) {\r\n if (jsPDF.API.hasOwnProperty(plugin)) {\r\n if (plugin === \"events\" && jsPDF.API.events.length) {\r\n (function(events, newEvents) {\r\n // jsPDF.API.events is a JS Array of Arrays\r\n // where each Array is a pair of event name, handler\r\n // Events were added by plugins to the jsPDF instantiator.\r\n // These are always added to the new instance and some ran\r\n // during instantiation.\r\n var eventname, handler_and_args, i;\r\n\r\n for (i = newEvents.length - 1; i !== -1; i--) {\r\n // subscribe takes 3 args: 'topic', function, runonce_flag\r\n // if undefined, runonce is false.\r\n // users can attach callback directly,\r\n // or they can attach an array with [callback, runonce_flag]\r\n // that's what the \"apply\" magic is for below.\r\n eventname = newEvents[i][0];\r\n handler_and_args = newEvents[i][1];\r\n events.subscribe.apply(\r\n events,\r\n [eventname].concat(\r\n typeof handler_and_args === \"function\"\r\n ? [handler_and_args]\r\n : handler_and_args\r\n )\r\n );\r\n }\r\n })(events, jsPDF.API.events);\r\n } else {\r\n API[plugin] = jsPDF.API[plugin];\r\n }\r\n }\r\n }\r\n\r\n var getPageWidth = (API.getPageWidth = function(pageNumber) {\r\n pageNumber = pageNumber || currentPage;\r\n return (\r\n (pagesContext[pageNumber].mediaBox.topRightX -\r\n pagesContext[pageNumber].mediaBox.bottomLeftX) /\r\n scaleFactor\r\n );\r\n });\r\n\r\n var setPageWidth = (API.setPageWidth = function(pageNumber, value) {\r\n pagesContext[pageNumber].mediaBox.topRightX =\r\n value * scaleFactor + pagesContext[pageNumber].mediaBox.bottomLeftX;\r\n });\r\n\r\n var getPageHeight = (API.getPageHeight = function(pageNumber) {\r\n pageNumber = pageNumber || currentPage;\r\n return (\r\n (pagesContext[pageNumber].mediaBox.topRightY -\r\n pagesContext[pageNumber].mediaBox.bottomLeftY) /\r\n scaleFactor\r\n );\r\n });\r\n\r\n var setPageHeight = (API.setPageHeight = function(pageNumber, value) {\r\n pagesContext[pageNumber].mediaBox.topRightY =\r\n value * scaleFactor + pagesContext[pageNumber].mediaBox.bottomLeftY;\r\n });\r\n\r\n /**\r\n * Object exposing internal API to plugins\r\n * @public\r\n * @ignore\r\n */\r\n API.internal = {\r\n pdfEscape: pdfEscape,\r\n getStyle: getStyle,\r\n getFont: getFontEntry,\r\n getFontSize: getFontSize,\r\n getCharSpace: getCharSpace,\r\n getTextColor: getTextColor,\r\n getLineHeight: getLineHeight,\r\n getLineHeightFactor: getLineHeightFactor,\r\n getLineWidth: getLineWidth,\r\n write: write,\r\n getHorizontalCoordinate: getHorizontalCoordinate,\r\n getVerticalCoordinate: getVerticalCoordinate,\r\n getCoordinateString: getHorizontalCoordinateString,\r\n getVerticalCoordinateString: getVerticalCoordinateString,\r\n collections: {},\r\n newObject: newObject,\r\n newAdditionalObject: newAdditionalObject,\r\n newObjectDeferred: newObjectDeferred,\r\n newObjectDeferredBegin: newObjectDeferredBegin,\r\n getFilters: getFilters,\r\n putStream: putStream,\r\n events: events,\r\n scaleFactor: scaleFactor,\r\n pageSize: {\r\n getWidth: function() {\r\n return getPageWidth(currentPage);\r\n },\r\n setWidth: function(value) {\r\n setPageWidth(currentPage, value);\r\n },\r\n getHeight: function() {\r\n return getPageHeight(currentPage);\r\n },\r\n setHeight: function(value) {\r\n setPageHeight(currentPage, value);\r\n }\r\n },\r\n encryptionOptions: encryptionOptions,\r\n encryption: encryption,\r\n getEncryptor: getEncryptor,\r\n output: output,\r\n getNumberOfPages: getNumberOfPages,\r\n pages: pages,\r\n out: out,\r\n f2: f2,\r\n f3: f3,\r\n getPageInfo: getPageInfo,\r\n getPageInfoByObjId: getPageInfoByObjId,\r\n getCurrentPageInfo: getCurrentPageInfo,\r\n getPDFVersion: getPdfVersion,\r\n Point: Point,\r\n Rectangle: Rectangle,\r\n Matrix: Matrix,\r\n hasHotfix: hasHotfix //Expose the hasHotfix check so plugins can also check them.\r\n };\r\n\r\n Object.defineProperty(API.internal.pageSize, \"width\", {\r\n get: function() {\r\n return getPageWidth(currentPage);\r\n },\r\n set: function(value) {\r\n setPageWidth(currentPage, value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(API.internal.pageSize, \"height\", {\r\n get: function() {\r\n return getPageHeight(currentPage);\r\n },\r\n set: function(value) {\r\n setPageHeight(currentPage, value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n\r\n //////////////////////////////////////////////////////\r\n // continuing initialization of jsPDF Document object\r\n //////////////////////////////////////////////////////\r\n // Add the first page automatically\r\n addFonts.call(API, standardFonts);\r\n activeFontKey = \"F1\";\r\n _addPage(format, orientation);\r\n\r\n events.publish(\"initialized\");\r\n return API;\r\n}\r\n\r\n/**\r\n * jsPDF.API is a STATIC property of jsPDF class.\r\n * jsPDF.API is an object you can add methods and properties to.\r\n * The methods / properties you add will show up in new jsPDF objects.\r\n *\r\n * One property is prepopulated. It is the 'events' Object. Plugin authors can add topics,\r\n * callbacks to this object. These will be reassigned to all new instances of jsPDF.\r\n *\r\n * @static\r\n * @public\r\n * @memberof jsPDF#\r\n * @name API\r\n *\r\n * @example\r\n * jsPDF.API.mymethod = function(){\r\n * // 'this' will be ref to internal API object. see jsPDF source\r\n * // , so you can refer to built-in methods like so:\r\n * // this.line(....)\r\n * // this.text(....)\r\n * }\r\n * var pdfdoc = new jsPDF()\r\n * pdfdoc.mymethod() // <- !!!!!!\r\n */\r\njsPDF.API = {\r\n events: []\r\n};\r\n/**\r\n * The version of jsPDF.\r\n * @name version\r\n * @type {string}\r\n * @memberof jsPDF#\r\n */\r\njsPDF.version = \"0.0.0\";\r\n\r\nexport { jsPDF, ShadingPattern, TilingPattern, GState };\r\nexport default jsPDF;\r\n","/* global jsPDF */\n/**\n * @license\n * Copyright (c) 2016 Alexander Weidt,\n * https://github.com/BiggA94\n *\n * Licensed under the MIT License. http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF AcroForm Plugin\n * @module AcroForm\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\nvar jsPDFAPI = jsPDF.API;\nvar scaleFactor = 1;\n\nvar pdfEscape = function(value) {\n return value\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\(/g, \"\\\\(\")\n .replace(/\\)/g, \"\\\\)\");\n};\nvar pdfUnescape = function(value) {\n return value\n .replace(/\\\\\\\\/g, \"\\\\\")\n .replace(/\\\\\\(/g, \"(\")\n .replace(/\\\\\\)/g, \")\");\n};\n\nvar f2 = function(number) {\n return number.toFixed(2); // Ie, %.2f\n};\n\nvar f5 = function(number) {\n return number.toFixed(5); // Ie, %.2f\n};\n\njsPDFAPI.__acroform__ = {};\nvar inherit = function(child, parent) {\n child.prototype = Object.create(parent.prototype);\n child.prototype.constructor = child;\n};\n\nvar scale = function(x) {\n return x * scaleFactor;\n};\n\nvar createFormXObject = function(formObject) {\n var xobj = new AcroFormXObject();\n var height = AcroFormAppearance.internal.getHeight(formObject) || 0;\n var width = AcroFormAppearance.internal.getWidth(formObject) || 0;\n xobj.BBox = [0, 0, Number(f2(width)), Number(f2(height))];\n return xobj;\n};\n\n/**\n * Bit-Operations\n */\nvar setBit = (jsPDFAPI.__acroform__.setBit = function(number, bitPosition) {\n number = number || 0;\n bitPosition = bitPosition || 0;\n\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.setBit\"\n );\n }\n var bitMask = 1 << bitPosition;\n\n number |= bitMask;\n\n return number;\n});\n\nvar clearBit = (jsPDFAPI.__acroform__.clearBit = function(number, bitPosition) {\n number = number || 0;\n bitPosition = bitPosition || 0;\n\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.clearBit\"\n );\n }\n var bitMask = 1 << bitPosition;\n\n number &= ~bitMask;\n\n return number;\n});\n\nvar getBit = (jsPDFAPI.__acroform__.getBit = function(number, bitPosition) {\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.getBit\"\n );\n }\n return (number & (1 << bitPosition)) === 0 ? 0 : 1;\n});\n\n/*\n * Ff starts counting the bit position at 1 and not like javascript at 0\n */\nvar getBitForPdf = (jsPDFAPI.__acroform__.getBitForPdf = function(\n number,\n bitPosition\n) {\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf\"\n );\n }\n return getBit(number, bitPosition - 1);\n});\n\nvar setBitForPdf = (jsPDFAPI.__acroform__.setBitForPdf = function(\n number,\n bitPosition\n) {\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf\"\n );\n }\n return setBit(number, bitPosition - 1);\n});\n\nvar clearBitForPdf = (jsPDFAPI.__acroform__.clearBitForPdf = function(\n number,\n bitPosition\n) {\n if (isNaN(number) || isNaN(bitPosition)) {\n throw new Error(\n \"Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf\"\n );\n }\n return clearBit(number, bitPosition - 1);\n});\n\nvar calculateCoordinates = (jsPDFAPI.__acroform__.calculateCoordinates = function(\n args,\n scope\n) {\n var getHorizontalCoordinate = scope.internal.getHorizontalCoordinate;\n var getVerticalCoordinate = scope.internal.getVerticalCoordinate;\n var x = args[0];\n var y = args[1];\n var w = args[2];\n var h = args[3];\n\n var coordinates = {};\n\n coordinates.lowerLeft_X = getHorizontalCoordinate(x) || 0;\n coordinates.lowerLeft_Y = getVerticalCoordinate(y + h) || 0;\n coordinates.upperRight_X = getHorizontalCoordinate(x + w) || 0;\n coordinates.upperRight_Y = getVerticalCoordinate(y) || 0;\n\n return [\n Number(f2(coordinates.lowerLeft_X)),\n Number(f2(coordinates.lowerLeft_Y)),\n Number(f2(coordinates.upperRight_X)),\n Number(f2(coordinates.upperRight_Y))\n ];\n});\n\nvar calculateAppearanceStream = function(formObject) {\n if (formObject.appearanceStreamContent) {\n return formObject.appearanceStreamContent;\n }\n\n if (!formObject.V && !formObject.DV) {\n return;\n }\n\n // else calculate it\n\n var stream = [];\n var text = formObject._V || formObject.DV;\n var calcRes = calculateX(formObject, text);\n var fontKey = formObject.scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n\n //PDF 32000-1:2008, page 444\n stream.push(\"/Tx BMC\");\n stream.push(\"q\");\n stream.push(\"BT\"); // Begin Text\n stream.push(formObject.scope.__private__.encodeColorString(formObject.color));\n stream.push(\"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf\");\n stream.push(\"1 0 0 1 0 0 Tm\"); // Transformation Matrix\n stream.push(calcRes.text);\n stream.push(\"ET\"); // End Text\n stream.push(\"Q\");\n stream.push(\"EMC\");\n\n var appearanceStreamContent = createFormXObject(formObject);\n appearanceStreamContent.scope = formObject.scope;\n appearanceStreamContent.stream = stream.join(\"\\n\");\n return appearanceStreamContent;\n};\n\nvar calculateX = function(formObject, text) {\n var maxFontSize =\n formObject.fontSize === 0 ? formObject.maxFontSize : formObject.fontSize;\n var returnValue = {\n text: \"\",\n fontSize: \"\"\n };\n // Remove Brackets\n text = text.substr(0, 1) == \"(\" ? text.substr(1) : text;\n text =\n text.substr(text.length - 1) == \")\"\n ? text.substr(0, text.length - 1)\n : text;\n // split into array of words\n var textSplit = text.split(\" \");\n if (formObject.multiline) {\n textSplit = textSplit.map(word => word.split(\"\\n\"));\n } else {\n textSplit = textSplit.map(word => [word]);\n }\n\n var fontSize = maxFontSize; // The Starting fontSize (The Maximum)\n var lineSpacing = 2;\n var borderPadding = 2;\n\n var height = AcroFormAppearance.internal.getHeight(formObject) || 0;\n height = height < 0 ? -height : height;\n var width = AcroFormAppearance.internal.getWidth(formObject) || 0;\n width = width < 0 ? -width : width;\n\n var isSmallerThanWidth = function(i, lastLine, fontSize) {\n if (i + 1 < textSplit.length) {\n var tmp = lastLine + \" \" + textSplit[i + 1][0];\n var TextWidth = calculateFontSpace(tmp, formObject, fontSize).width;\n var FieldWidth = width - 2 * borderPadding;\n return TextWidth <= FieldWidth;\n } else {\n return false;\n }\n };\n\n fontSize++;\n FontSize: while (fontSize > 0) {\n text = \"\";\n fontSize--;\n var textHeight = calculateFontSpace(\"3\", formObject, fontSize).height;\n var startY = formObject.multiline\n ? height - fontSize\n : (height - textHeight) / 2;\n startY += lineSpacing;\n var startX;\n\n var lastY = startY;\n var firstWordInLine = 0,\n lastWordInLine = 0;\n var lastLength;\n var currWord = 0;\n\n if (fontSize <= 0) {\n // In case, the Text doesn't fit at all\n fontSize = 12;\n text = \"(...) Tj\\n\";\n text +=\n \"% Width of Text: \" +\n calculateFontSpace(text, formObject, fontSize).width +\n \", FieldWidth:\" +\n width +\n \"\\n\";\n break;\n }\n\n var lastLine = \"\";\n var lineCount = 0;\n Line: for (var i = 0; i < textSplit.length; i++) {\n if (textSplit.hasOwnProperty(i)) {\n let isWithNewLine = false;\n if (textSplit[i].length !== 1 && currWord !== textSplit[i].length - 1) {\n if (\n (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n height\n ) {\n continue FontSize;\n }\n\n lastLine += textSplit[i][currWord];\n isWithNewLine = true;\n lastWordInLine = i;\n i--;\n } else {\n lastLine += textSplit[i][currWord] + \" \";\n lastLine =\n lastLine.substr(lastLine.length - 1) == \" \"\n ? lastLine.substr(0, lastLine.length - 1)\n : lastLine;\n var key = parseInt(i);\n var nextLineIsSmaller = isSmallerThanWidth(key, lastLine, fontSize);\n var isLastWord = i >= textSplit.length - 1;\n\n if (nextLineIsSmaller && !isLastWord) {\n lastLine += \" \";\n currWord = 0;\n continue; // Line\n } else if (!nextLineIsSmaller && !isLastWord) {\n if (!formObject.multiline) {\n continue FontSize;\n } else {\n if (\n (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n height\n ) {\n // If the Text is higher than the\n // FieldObject\n continue FontSize;\n }\n lastWordInLine = key;\n // go on\n }\n } else if (isLastWord) {\n lastWordInLine = key;\n } else {\n if (\n formObject.multiline &&\n (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n height\n ) {\n // If the Text is higher than the FieldObject\n continue FontSize;\n }\n }\n }\n // Remove last blank\n\n var line = \"\";\n\n for (var x = firstWordInLine; x <= lastWordInLine; x++) {\n var currLine = textSplit[x];\n if (formObject.multiline) {\n if (x === lastWordInLine) {\n line += currLine[currWord] + \" \";\n currWord = (currWord + 1) % currLine.length;\n continue;\n }\n if (x === firstWordInLine) {\n line += currLine[currLine.length - 1] + \" \";\n continue;\n }\n }\n line += currLine[0] + \" \";\n }\n\n // Remove last blank\n line =\n line.substr(line.length - 1) == \" \"\n ? line.substr(0, line.length - 1)\n : line;\n // lastLength -= blankSpace.width;\n lastLength = calculateFontSpace(line, formObject, fontSize).width;\n\n // Calculate startX\n switch (formObject.textAlign) {\n case \"right\":\n startX = width - lastLength - borderPadding;\n break;\n case \"center\":\n startX = (width - lastLength) / 2;\n break;\n case \"left\":\n default:\n startX = borderPadding;\n break;\n }\n text += f2(startX) + \" \" + f2(lastY) + \" Td\\n\";\n text += \"(\" + pdfEscape(line) + \") Tj\\n\";\n // reset X in PDF\n text += -f2(startX) + \" 0 Td\\n\";\n\n // After a Line, adjust y position\n lastY = -(fontSize + lineSpacing);\n\n // Reset for next iteration step\n lastLength = 0;\n firstWordInLine = isWithNewLine ? lastWordInLine : lastWordInLine + 1;\n lineCount++;\n\n lastLine = \"\";\n continue Line;\n }\n }\n break;\n }\n\n returnValue.text = text;\n returnValue.fontSize = fontSize;\n\n return returnValue;\n};\n\n/**\n * Small workaround for calculating the TextMetric approximately.\n *\n * @param text\n * @param fontsize\n * @returns {TextMetrics} (Has Height and Width)\n */\nvar calculateFontSpace = function(text, formObject, fontSize) {\n var font = formObject.scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n );\n var width =\n formObject.scope.getStringUnitWidth(text, {\n font: font,\n fontSize: parseFloat(fontSize),\n charSpace: 0\n }) * parseFloat(fontSize);\n var height =\n formObject.scope.getStringUnitWidth(\"3\", {\n font: font,\n fontSize: parseFloat(fontSize),\n charSpace: 0\n }) *\n parseFloat(fontSize) *\n 1.5;\n return { height: height, width: width };\n};\n\nvar acroformPluginTemplate = {\n fields: [],\n xForms: [],\n /**\n * acroFormDictionaryRoot contains information about the AcroForm\n * Dictionary 0: The Event-Token, the AcroFormDictionaryCallback has\n * 1: The Object ID of the Root\n */\n acroFormDictionaryRoot: null,\n /**\n * After the PDF gets evaluated, the reference to the root has to be\n * reset, this indicates, whether the root has already been printed\n * out\n */\n printedOut: false,\n internal: null,\n isInitialized: false\n};\n\nvar annotReferenceCallback = function(scope) {\n //set objId to undefined and force it to get a new objId on buildDocument\n scope.internal.acroformPlugin.acroFormDictionaryRoot.objId = undefined;\n var fields = scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields;\n for (var i in fields) {\n if (fields.hasOwnProperty(i)) {\n var formObject = fields[i];\n //set objId to undefined and force it to get a new objId on buildDocument\n formObject.objId = undefined;\n // add Annot Reference!\n if (formObject.hasAnnotation) {\n // If theres an Annotation Widget in the Form Object, put the\n // Reference in the /Annot array\n createAnnotationReference(formObject, scope);\n }\n }\n }\n};\n\nvar putForm = function(formObject) {\n if (formObject.scope.internal.acroformPlugin.printedOut) {\n formObject.scope.internal.acroformPlugin.printedOut = false;\n formObject.scope.internal.acroformPlugin.acroFormDictionaryRoot = null;\n }\n formObject.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(\n formObject\n );\n};\n/**\n * Create the Reference to the widgetAnnotation, so that it gets referenced\n * in the Annot[] int the+ (Requires the Annotation Plugin)\n */\nvar createAnnotationReference = function(object, scope) {\n var options = {\n type: \"reference\",\n object: object\n };\n var findEntry = function(entry) {\n return entry.type === options.type && entry.object === options.object;\n };\n if (\n scope.internal\n .getPageInfo(object.page)\n .pageContext.annotations.find(findEntry) === undefined\n ) {\n scope.internal\n .getPageInfo(object.page)\n .pageContext.annotations.push(options);\n }\n};\n\n// Callbacks\n\nvar putCatalogCallback = function(scope) {\n // Put reference to AcroForm to DocumentCatalog\n if (\n typeof scope.internal.acroformPlugin.acroFormDictionaryRoot !== \"undefined\"\n ) {\n // for safety, shouldn't normally be the case\n scope.internal.write(\n \"/AcroForm \" +\n scope.internal.acroformPlugin.acroFormDictionaryRoot.objId +\n \" \" +\n 0 +\n \" R\"\n );\n } else {\n throw new Error(\"putCatalogCallback: Root missing.\");\n }\n};\n\n/**\n * Adds /Acroform X 0 R to Document Catalog, and creates the AcroForm\n * Dictionary\n */\nvar AcroFormDictionaryCallback = function(scope) {\n // Remove event\n scope.internal.events.unsubscribe(\n scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID\n );\n delete scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID;\n scope.internal.acroformPlugin.printedOut = true;\n};\n\n/**\n * Creates the single Fields and writes them into the Document\n *\n * If fieldArray is set, use the fields that are inside it instead of the\n * fields from the AcroRoot (for the FormXObjects...)\n */\nvar createFieldCallback = function(fieldArray, scope) {\n var standardFields = !fieldArray;\n\n if (!fieldArray) {\n // in case there is no fieldArray specified, we want to print out\n // the Fields of the AcroForm\n // Print out Root\n scope.internal.newObjectDeferredBegin(\n scope.internal.acroformPlugin.acroFormDictionaryRoot.objId,\n true\n );\n scope.internal.acroformPlugin.acroFormDictionaryRoot.putStream();\n }\n\n fieldArray =\n fieldArray || scope.internal.acroformPlugin.acroFormDictionaryRoot.Kids;\n\n for (var i in fieldArray) {\n if (fieldArray.hasOwnProperty(i)) {\n var fieldObject = fieldArray[i];\n var keyValueList = [];\n var oldRect = fieldObject.Rect;\n\n if (fieldObject.Rect) {\n fieldObject.Rect = calculateCoordinates(fieldObject.Rect, scope);\n }\n\n // Start Writing the Object\n scope.internal.newObjectDeferredBegin(fieldObject.objId, true);\n\n fieldObject.DA = AcroFormAppearance.createDefaultAppearanceStream(\n fieldObject\n );\n\n if (\n typeof fieldObject === \"object\" &&\n typeof fieldObject.getKeyValueListForStream === \"function\"\n ) {\n keyValueList = fieldObject.getKeyValueListForStream();\n }\n\n fieldObject.Rect = oldRect;\n\n if (\n fieldObject.hasAppearanceStream &&\n !fieldObject.appearanceStreamContent\n ) {\n // Calculate Appearance\n var appearance = calculateAppearanceStream(fieldObject);\n keyValueList.push({ key: \"AP\", value: \"<>\" });\n\n scope.internal.acroformPlugin.xForms.push(appearance);\n }\n\n // Assume AppearanceStreamContent is a Array with N,R,D (at least\n // one of them!)\n if (fieldObject.appearanceStreamContent) {\n var appearanceStreamString = \"\";\n // Iterate over N,R and D\n for (var k in fieldObject.appearanceStreamContent) {\n if (fieldObject.appearanceStreamContent.hasOwnProperty(k)) {\n var value = fieldObject.appearanceStreamContent[k];\n appearanceStreamString += \"/\" + k + \" \";\n appearanceStreamString += \"<<\";\n if (Object.keys(value).length >= 1 || Array.isArray(value)) {\n // appearanceStream is an Array or Object!\n for (var i in value) {\n if (value.hasOwnProperty(i)) {\n var obj = value[i];\n if (typeof obj === \"function\") {\n // if Function is referenced, call it in order\n // to get the FormXObject\n obj = obj.call(scope, fieldObject);\n }\n appearanceStreamString += \"/\" + i + \" \" + obj + \" \";\n\n // In case the XForm is already used, e.g. OffState\n // of CheckBoxes, don't add it\n if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n scope.internal.acroformPlugin.xForms.push(obj);\n }\n }\n } else {\n obj = value;\n if (typeof obj === \"function\") {\n // if Function is referenced, call it in order to\n // get the FormXObject\n obj = obj.call(scope, fieldObject);\n }\n appearanceStreamString += \"/\" + i + \" \" + obj;\n if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n scope.internal.acroformPlugin.xForms.push(obj);\n }\n appearanceStreamString += \">>\";\n }\n }\n\n // appearance stream is a normal Object..\n keyValueList.push({\n key: \"AP\",\n value: \"<<\\n\" + appearanceStreamString + \">>\"\n });\n }\n\n scope.internal.putStream({\n additionalKeyValues: keyValueList,\n objectId: fieldObject.objId\n });\n\n scope.internal.out(\"endobj\");\n }\n }\n if (standardFields) {\n createXFormObjectCallback(scope.internal.acroformPlugin.xForms, scope);\n }\n};\n\nvar createXFormObjectCallback = function(fieldArray, scope) {\n for (var i in fieldArray) {\n if (fieldArray.hasOwnProperty(i)) {\n var key = i;\n var fieldObject = fieldArray[i];\n // Start Writing the Object\n scope.internal.newObjectDeferredBegin(fieldObject.objId, true);\n\n if (\n typeof fieldObject === \"object\" &&\n typeof fieldObject.putStream === \"function\"\n ) {\n fieldObject.putStream();\n }\n delete fieldArray[key];\n }\n }\n};\n\nvar initializeAcroForm = function(scope, formObject) {\n formObject.scope = scope;\n if (\n scope.internal !== undefined &&\n (scope.internal.acroformPlugin === undefined ||\n scope.internal.acroformPlugin.isInitialized === false)\n ) {\n AcroFormField.FieldNum = 0;\n scope.internal.acroformPlugin = JSON.parse(\n JSON.stringify(acroformPluginTemplate)\n );\n if (scope.internal.acroformPlugin.acroFormDictionaryRoot) {\n throw new Error(\"Exception while creating AcroformDictionary\");\n }\n scaleFactor = scope.internal.scaleFactor;\n // The Object Number of the AcroForm Dictionary\n scope.internal.acroformPlugin.acroFormDictionaryRoot = new AcroFormDictionary();\n scope.internal.acroformPlugin.acroFormDictionaryRoot.scope = scope;\n\n // add Callback for creating the AcroForm Dictionary\n scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID = scope.internal.events.subscribe(\n \"postPutResources\",\n function() {\n AcroFormDictionaryCallback(scope);\n }\n );\n\n scope.internal.events.subscribe(\"buildDocument\", function() {\n annotReferenceCallback(scope);\n }); // buildDocument\n\n // Register event, that is triggered when the DocumentCatalog is\n // written, in order to add /AcroForm\n\n scope.internal.events.subscribe(\"putCatalog\", function() {\n putCatalogCallback(scope);\n });\n\n // Register event, that creates all Fields\n scope.internal.events.subscribe(\"postPutPages\", function(fieldArray) {\n createFieldCallback(fieldArray, scope);\n });\n\n scope.internal.acroformPlugin.isInitialized = true;\n }\n};\n\n//PDF 32000-1:2008, page 26, 7.3.6\nvar arrayToPdfArray = (jsPDFAPI.__acroform__.arrayToPdfArray = function(\n array,\n objId,\n scope\n) {\n var encryptor = function(data) {\n return data;\n };\n if (Array.isArray(array)) {\n var content = \"[\";\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n content += \" \";\n }\n switch (typeof array[i]) {\n case \"boolean\":\n case \"number\":\n case \"object\":\n content += array[i].toString();\n break;\n case \"string\":\n if (array[i].substr(0, 1) !== \"/\") {\n if (typeof objId !== \"undefined\" && scope)\n encryptor = scope.internal.getEncryptor(objId);\n content += \"(\" + pdfEscape(encryptor(array[i].toString())) + \")\";\n } else {\n content += array[i].toString();\n }\n break;\n }\n }\n content += \"]\";\n return content;\n }\n throw new Error(\n \"Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray\"\n );\n});\nfunction getMatches(string, regex, index) {\n index || (index = 1); // default to the first capturing group\n var matches = [];\n var match;\n while ((match = regex.exec(string))) {\n matches.push(match[index]);\n }\n return matches;\n}\nvar pdfArrayToStringArray = function(array) {\n var result = [];\n if (typeof array === \"string\") {\n result = getMatches(array, /\\((.*?)\\)/g);\n }\n return result;\n};\n\nvar toPdfString = function(string, objId, scope) {\n var encryptor = function(data) {\n return data;\n };\n if (typeof objId !== \"undefined\" && scope)\n encryptor = scope.internal.getEncryptor(objId);\n string = string || \"\";\n string.toString();\n string = \"(\" + pdfEscape(encryptor(string)) + \")\";\n return string;\n};\n\n// ##########################\n// Classes\n// ##########################\n\n/**\n * @class AcroFormPDFObject\n * @classdesc A AcroFormPDFObject\n */\nvar AcroFormPDFObject = function() {\n this._objId = undefined;\n this._scope = undefined;\n\n /**\n * @name AcroFormPDFObject#objId\n * @type {any}\n */\n Object.defineProperty(this, \"objId\", {\n get: function() {\n if (typeof this._objId === \"undefined\") {\n if (typeof this.scope === \"undefined\") {\n return undefined;\n }\n this._objId = this.scope.internal.newObjectDeferred();\n }\n return this._objId;\n },\n set: function(value) {\n this._objId = value;\n }\n });\n Object.defineProperty(this, \"scope\", {\n value: this._scope,\n writable: true\n });\n};\n\n/**\n * @function AcroFormPDFObject.toString\n */\nAcroFormPDFObject.prototype.toString = function() {\n return this.objId + \" 0 R\";\n};\n\nAcroFormPDFObject.prototype.putStream = function() {\n var keyValueList = this.getKeyValueListForStream();\n this.scope.internal.putStream({\n data: this.stream,\n additionalKeyValues: keyValueList,\n objectId: this.objId\n });\n this.scope.internal.out(\"endobj\");\n};\n\n/**\n * Returns an key-value-List of all non-configurable Variables from the Object\n *\n * @name getKeyValueListForStream\n * @returns {string}\n */\nAcroFormPDFObject.prototype.getKeyValueListForStream = function() {\n var keyValueList = [];\n var keys = Object.getOwnPropertyNames(this).filter(function(key) {\n return (\n key != \"content\" &&\n key != \"appearanceStreamContent\" &&\n key != \"scope\" &&\n key != \"objId\" &&\n key.substring(0, 1) != \"_\"\n );\n });\n\n for (var i in keys) {\n if (Object.getOwnPropertyDescriptor(this, keys[i]).configurable === false) {\n var key = keys[i];\n var value = this[key];\n\n if (value) {\n if (Array.isArray(value)) {\n keyValueList.push({\n key: key,\n value: arrayToPdfArray(value, this.objId, this.scope)\n });\n } else if (value instanceof AcroFormPDFObject) {\n // In case it is a reference to another PDFObject,\n // take the reference number\n value.scope = this.scope;\n keyValueList.push({ key: key, value: value.objId + \" 0 R\" });\n } else if (typeof value !== \"function\") {\n keyValueList.push({ key: key, value: value });\n }\n }\n }\n }\n return keyValueList;\n};\n\nvar AcroFormXObject = function() {\n AcroFormPDFObject.call(this);\n\n Object.defineProperty(this, \"Type\", {\n value: \"/XObject\",\n configurable: false,\n writable: true\n });\n\n Object.defineProperty(this, \"Subtype\", {\n value: \"/Form\",\n configurable: false,\n writable: true\n });\n\n Object.defineProperty(this, \"FormType\", {\n value: 1,\n configurable: false,\n writable: true\n });\n\n var _BBox = [];\n Object.defineProperty(this, \"BBox\", {\n configurable: false,\n get: function() {\n return _BBox;\n },\n set: function(value) {\n _BBox = value;\n }\n });\n\n Object.defineProperty(this, \"Resources\", {\n value: \"2 0 R\",\n configurable: false,\n writable: true\n });\n\n var _stream;\n Object.defineProperty(this, \"stream\", {\n enumerable: false,\n configurable: true,\n set: function(value) {\n _stream = value.trim();\n },\n get: function() {\n if (_stream) {\n return _stream;\n } else {\n return null;\n }\n }\n });\n};\n\ninherit(AcroFormXObject, AcroFormPDFObject);\n\nvar AcroFormDictionary = function() {\n AcroFormPDFObject.call(this);\n\n var _Kids = [];\n\n Object.defineProperty(this, \"Kids\", {\n enumerable: false,\n configurable: true,\n get: function() {\n if (_Kids.length > 0) {\n return _Kids;\n } else {\n return undefined;\n }\n }\n });\n Object.defineProperty(this, \"Fields\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _Kids;\n }\n });\n\n // Default Appearance\n var _DA;\n Object.defineProperty(this, \"DA\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_DA) {\n return undefined;\n }\n var encryptor = function(data) {\n return data;\n };\n if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n return \"(\" + pdfEscape(encryptor(_DA)) + \")\";\n },\n set: function(value) {\n _DA = value;\n }\n });\n};\n\ninherit(AcroFormDictionary, AcroFormPDFObject);\n\n/**\n * The Field Object contains the Variables, that every Field needs\n *\n * @class AcroFormField\n * @classdesc An AcroForm FieldObject\n */\nvar AcroFormField = function() {\n AcroFormPDFObject.call(this);\n\n //Annotation-Flag See Table 165\n var _F = 4;\n Object.defineProperty(this, \"F\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _F;\n },\n set: function(value) {\n if (!isNaN(value)) {\n _F = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute F supplied.'\n );\n }\n }\n });\n\n /**\n * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen.\n * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page.\n *\n * @name AcroFormField#showWhenPrinted\n * @default true\n * @type {boolean}\n */\n Object.defineProperty(this, \"showWhenPrinted\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(_F, 3));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.F = setBitForPdf(_F, 3);\n } else {\n this.F = clearBitForPdf(_F, 3);\n }\n }\n });\n\n var _Ff = 0;\n Object.defineProperty(this, \"Ff\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _Ff;\n },\n set: function(value) {\n if (!isNaN(value)) {\n _Ff = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute Ff supplied.'\n );\n }\n }\n });\n\n var _Rect = [];\n Object.defineProperty(this, \"Rect\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (_Rect.length === 0) {\n return undefined;\n }\n return _Rect;\n },\n set: function(value) {\n if (typeof value !== \"undefined\") {\n _Rect = value;\n } else {\n _Rect = [];\n }\n }\n });\n\n /**\n * The x-position of the field.\n *\n * @name AcroFormField#x\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"x\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[0])) {\n return 0;\n }\n return _Rect[0];\n },\n set: function(value) {\n _Rect[0] = value;\n }\n });\n\n /**\n * The y-position of the field.\n *\n * @name AcroFormField#y\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"y\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[1])) {\n return 0;\n }\n return _Rect[1];\n },\n set: function(value) {\n _Rect[1] = value;\n }\n });\n\n /**\n * The width of the field.\n *\n * @name AcroFormField#width\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"width\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[2])) {\n return 0;\n }\n return _Rect[2];\n },\n set: function(value) {\n _Rect[2] = value;\n }\n });\n\n /**\n * The height of the field.\n *\n * @name AcroFormField#height\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"height\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[3])) {\n return 0;\n }\n return _Rect[3];\n },\n set: function(value) {\n _Rect[3] = value;\n }\n });\n\n var _FT = \"\";\n Object.defineProperty(this, \"FT\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _FT;\n },\n set: function(value) {\n switch (value) {\n case \"/Btn\":\n case \"/Tx\":\n case \"/Ch\":\n case \"/Sig\":\n _FT = value;\n break;\n default:\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute FT supplied.'\n );\n }\n }\n });\n\n var _T = null;\n\n Object.defineProperty(this, \"T\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (!_T || _T.length < 1) {\n // In case of a Child from a Radio´Group, you don't need a FieldName\n if (this instanceof AcroFormChildClass) {\n return undefined;\n }\n _T = \"FieldObject\" + AcroFormField.FieldNum++;\n }\n var encryptor = function(data) {\n return data;\n };\n if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n return \"(\" + pdfEscape(encryptor(_T)) + \")\";\n },\n set: function(value) {\n _T = value.toString();\n }\n });\n\n /**\n * (Optional) The partial field name (see 12.7.3.2, “Field Names”).\n *\n * @name AcroFormField#fieldName\n * @default null\n * @type {string}\n */\n Object.defineProperty(this, \"fieldName\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return _T;\n },\n set: function(value) {\n _T = value;\n }\n });\n\n var _fontName = \"helvetica\";\n /**\n * The fontName of the font to be used.\n *\n * @name AcroFormField#fontName\n * @default 'helvetica'\n * @type {string}\n */\n Object.defineProperty(this, \"fontName\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontName;\n },\n set: function(value) {\n _fontName = value;\n }\n });\n\n var _fontStyle = \"normal\";\n /**\n * The fontStyle of the font to be used.\n *\n * @name AcroFormField#fontStyle\n * @default 'normal'\n * @type {string}\n */\n Object.defineProperty(this, \"fontStyle\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontStyle;\n },\n set: function(value) {\n _fontStyle = value;\n }\n });\n\n var _fontSize = 0;\n /**\n * The fontSize of the font to be used.\n *\n * @name AcroFormField#fontSize\n * @default 0 (for auto)\n * @type {number}\n */\n Object.defineProperty(this, \"fontSize\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontSize;\n },\n set: function(value) {\n _fontSize = value;\n }\n });\n\n var _maxFontSize = undefined;\n /**\n * The maximum fontSize of the font to be used.\n *\n * @name AcroFormField#maxFontSize\n * @default 0 (for auto)\n * @type {number}\n */\n Object.defineProperty(this, \"maxFontSize\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (_maxFontSize === undefined) {\n // use the old default value here - the value is some kind of random as it depends on the scaleFactor (user unit)\n // (\"50\" is transformed to the \"user space\" but then used in \"pdf space\")\n return 50 / scaleFactor;\n } else {\n return _maxFontSize;\n }\n },\n set: function(value) {\n _maxFontSize = value;\n }\n });\n\n var _color = \"black\";\n /**\n * The color of the text\n *\n * @name AcroFormField#color\n * @default 'black'\n * @type {string|rgba}\n */\n Object.defineProperty(this, \"color\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _color;\n },\n set: function(value) {\n _color = value;\n }\n });\n\n var _DA = \"/F1 0 Tf 0 g\";\n // Defines the default appearance (Needed for variable Text)\n Object.defineProperty(this, \"DA\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (\n !_DA ||\n this instanceof AcroFormChildClass ||\n this instanceof AcroFormTextField\n ) {\n return undefined;\n }\n return toPdfString(_DA, this.objId, this.scope);\n },\n set: function(value) {\n value = value.toString();\n _DA = value;\n }\n });\n\n var _DV = null;\n Object.defineProperty(this, \"DV\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_DV) {\n return undefined;\n }\n if (this instanceof AcroFormButton === false) {\n return toPdfString(_DV, this.objId, this.scope);\n }\n return _DV;\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === false) {\n if (value.substr(0, 1) === \"(\") {\n _DV = pdfUnescape(value.substr(1, value.length - 2));\n } else {\n _DV = pdfUnescape(value);\n }\n } else {\n _DV = value;\n }\n }\n });\n\n /**\n * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value.\n *\n * @name AcroFormField#defaultValue\n * @default null\n * @type {any}\n */\n Object.defineProperty(this, \"defaultValue\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (this instanceof AcroFormButton === true) {\n return pdfUnescape(_DV.substr(1, _DV.length - 1));\n } else {\n return _DV;\n }\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === true) {\n _DV = \"/\" + value;\n } else {\n _DV = value;\n }\n }\n });\n\n var _V = null;\n Object.defineProperty(this, \"_V\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_V) {\n return undefined;\n }\n return _V;\n },\n set: function(value) {\n this.V = value;\n }\n });\n Object.defineProperty(this, \"V\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_V) {\n return undefined;\n }\n if (this instanceof AcroFormButton === false) {\n return toPdfString(_V, this.objId, this.scope);\n }\n return _V;\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === false) {\n if (value.substr(0, 1) === \"(\") {\n _V = pdfUnescape(value.substr(1, value.length - 2));\n } else {\n _V = pdfUnescape(value);\n }\n } else {\n _V = value;\n }\n }\n });\n\n /**\n * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information.\n *\n * @name AcroFormField#value\n * @default null\n * @type {any}\n */\n Object.defineProperty(this, \"value\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (this instanceof AcroFormButton === true) {\n return pdfUnescape(_V.substr(1, _V.length - 1));\n } else {\n return _V;\n }\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === true) {\n _V = \"/\" + value;\n } else {\n _V = value;\n }\n }\n });\n\n /**\n * Check if field has annotations\n *\n * @name AcroFormField#hasAnnotation\n * @readonly\n * @type {boolean}\n */\n Object.defineProperty(this, \"hasAnnotation\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.Rect;\n }\n });\n\n Object.defineProperty(this, \"Type\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return this.hasAnnotation ? \"/Annot\" : null;\n }\n });\n\n Object.defineProperty(this, \"Subtype\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return this.hasAnnotation ? \"/Widget\" : null;\n }\n });\n\n var _hasAppearanceStream = false;\n /**\n * true if field has an appearanceStream\n *\n * @name AcroFormField#hasAppearanceStream\n * @readonly\n * @type {boolean}\n */\n Object.defineProperty(this, \"hasAppearanceStream\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _hasAppearanceStream;\n },\n set: function(value) {\n value = Boolean(value);\n _hasAppearanceStream = value;\n }\n });\n\n /**\n * The page on which the AcroFormField is placed\n *\n * @name AcroFormField#page\n * @type {number}\n */\n var _page;\n Object.defineProperty(this, \"page\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_page) {\n return undefined;\n }\n return _page;\n },\n set: function(value) {\n _page = value;\n }\n });\n\n /**\n * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database.\n *\n * @name AcroFormField#readOnly\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"readOnly\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 1));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 1);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 1);\n }\n }\n });\n\n /**\n * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”).\n *\n * @name AcroFormField#required\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"required\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 2));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 2);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 2);\n }\n }\n });\n\n /**\n * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”)\n *\n * @name AcroFormField#noExport\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"noExport\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 3));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 3);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 3);\n }\n }\n });\n\n var _Q = null;\n Object.defineProperty(this, \"Q\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (_Q === null) {\n return undefined;\n }\n return _Q;\n },\n set: function(value) {\n if ([0, 1, 2].indexOf(value) !== -1) {\n _Q = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute Q supplied.'\n );\n }\n }\n });\n\n /**\n * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text:\n * 'left', 'center', 'right'\n *\n * @name AcroFormField#textAlign\n * @default 'left'\n * @type {string}\n */\n Object.defineProperty(this, \"textAlign\", {\n get: function() {\n var result;\n switch (_Q) {\n case 0:\n default:\n result = \"left\";\n break;\n case 1:\n result = \"center\";\n break;\n case 2:\n result = \"right\";\n break;\n }\n return result;\n },\n configurable: true,\n enumerable: true,\n set: function(value) {\n switch (value) {\n case \"right\":\n case 2:\n _Q = 2;\n break;\n case \"center\":\n case 1:\n _Q = 1;\n break;\n case \"left\":\n case 0:\n default:\n _Q = 0;\n }\n }\n });\n};\n\ninherit(AcroFormField, AcroFormPDFObject);\n\n/**\n * @class AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormChoiceField = function() {\n AcroFormField.call(this);\n // Field Type = Choice Field\n this.FT = \"/Ch\";\n // options\n this.V = \"()\";\n\n this.fontName = \"zapfdingbats\";\n // Top Index\n var _TI = 0;\n\n Object.defineProperty(this, \"TI\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _TI;\n },\n set: function(value) {\n _TI = value;\n }\n });\n\n /**\n * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0.\n *\n * @name AcroFormChoiceField#topIndex\n * @default 0\n * @type {number}\n */\n Object.defineProperty(this, \"topIndex\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _TI;\n },\n set: function(value) {\n _TI = value;\n }\n });\n\n var _Opt = [];\n Object.defineProperty(this, \"Opt\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return arrayToPdfArray(_Opt, this.objId, this.scope);\n },\n set: function(value) {\n _Opt = pdfArrayToStringArray(value);\n }\n });\n\n /**\n * @memberof AcroFormChoiceField\n * @name getOptions\n * @function\n * @instance\n * @returns {array} array of Options\n */\n this.getOptions = function() {\n return _Opt;\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name setOptions\n * @function\n * @instance\n * @param {array} value\n */\n this.setOptions = function(value) {\n _Opt = value;\n if (this.sort) {\n _Opt.sort();\n }\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name addOption\n * @function\n * @instance\n * @param {string} value\n */\n this.addOption = function(value) {\n value = value || \"\";\n value = value.toString();\n _Opt.push(value);\n if (this.sort) {\n _Opt.sort();\n }\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name removeOption\n * @function\n * @instance\n * @param {string} value\n * @param {boolean} allEntries (default: false)\n */\n this.removeOption = function(value, allEntries) {\n allEntries = allEntries || false;\n value = value || \"\";\n value = value.toString();\n\n while (_Opt.indexOf(value) !== -1) {\n _Opt.splice(_Opt.indexOf(value), 1);\n if (allEntries === false) {\n break;\n }\n }\n };\n\n /**\n * If set, the field is a combo box; if clear, the field is a list box.\n *\n * @name AcroFormChoiceField#combo\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"combo\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 18));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 18);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 18);\n }\n }\n });\n\n /**\n * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set.\n *\n * @name AcroFormChoiceField#edit\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"edit\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 19));\n },\n set: function(value) {\n //PDF 32000-1:2008, page 444\n if (this.combo === true) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 19);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 19);\n }\n }\n }\n });\n\n /**\n * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231).\n *\n * @name AcroFormChoiceField#sort\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"sort\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 20));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 20);\n _Opt.sort();\n } else {\n this.Ff = clearBitForPdf(this.Ff, 20);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected\n *\n * @name AcroFormChoiceField#multiSelect\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"multiSelect\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 22));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 22);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 22);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set.\n *\n * @name AcroFormChoiceField#doNotSpellCheck\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotSpellCheck\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 23));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 23);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 23);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step.\n * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.\n *\n * @name AcroFormChoiceField#commitOnSelChange\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"commitOnSelChange\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 27));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 27);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 27);\n }\n }\n });\n\n this.hasAppearanceStream = false;\n};\ninherit(AcroFormChoiceField, AcroFormField);\n\n/**\n * @class AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormListBox = function() {\n AcroFormChoiceField.call(this);\n this.fontName = \"helvetica\";\n\n //PDF 32000-1:2008, page 444\n this.combo = false;\n};\ninherit(AcroFormListBox, AcroFormChoiceField);\n\n/**\n * @class AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormComboBox = function() {\n AcroFormListBox.call(this);\n this.combo = true;\n};\ninherit(AcroFormComboBox, AcroFormListBox);\n\n/**\n * @class AcroFormEditBox\n * @extends AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormEditBox = function() {\n AcroFormComboBox.call(this);\n this.edit = true;\n};\ninherit(AcroFormEditBox, AcroFormComboBox);\n\n/**\n * @class AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormButton = function() {\n AcroFormField.call(this);\n this.FT = \"/Btn\";\n\n /**\n * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected.\n *\n * @name AcroFormButton#noToggleToOff\n * @type {boolean}\n */\n Object.defineProperty(this, \"noToggleToOff\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 15));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 15);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 15);\n }\n }\n });\n\n /**\n * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear.\n *\n * @name AcroFormButton#radio\n * @type {boolean}\n */\n Object.defineProperty(this, \"radio\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 16));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 16);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 16);\n }\n }\n });\n\n /**\n * If set, the field is a pushbutton that does not retain a permanent value.\n *\n * @name AcroFormButton#pushButton\n * @type {boolean}\n */\n Object.defineProperty(this, \"pushButton\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 17));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 17);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 17);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons).\n *\n * @name AcroFormButton#radioIsUnison\n * @type {boolean}\n */\n Object.defineProperty(this, \"radioIsUnison\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 26));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 26);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 26);\n }\n }\n });\n\n var _MK = {};\n Object.defineProperty(this, \"MK\", {\n enumerable: false,\n configurable: false,\n get: function() {\n var encryptor = function(data) {\n return data;\n };\n if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n if (Object.keys(_MK).length !== 0) {\n var result = [];\n result.push(\"<<\");\n var key;\n for (key in _MK) {\n result.push(\"/\" + key + \" (\" + pdfEscape(encryptor(_MK[key])) + \")\");\n }\n result.push(\">>\");\n return result.join(\"\\n\");\n }\n return undefined;\n },\n set: function(value) {\n if (typeof value === \"object\") {\n _MK = value;\n }\n }\n });\n\n /**\n * From the PDF reference:\n * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n *\n * - '8' = Cross,\n * - 'l' = Circle,\n * - '' = nothing\n * @name AcroFormButton#caption\n * @type {string}\n */\n Object.defineProperty(this, \"caption\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MK.CA || \"\";\n },\n set: function(value) {\n if (typeof value === \"string\") {\n _MK.CA = value;\n }\n }\n });\n\n var _AS;\n Object.defineProperty(this, \"AS\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _AS;\n },\n set: function(value) {\n _AS = value;\n }\n });\n\n /**\n * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n *\n * @name AcroFormButton#appearanceState\n * @type {any}\n */\n Object.defineProperty(this, \"appearanceState\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _AS.substr(1, _AS.length - 1);\n },\n set: function(value) {\n _AS = \"/\" + value;\n }\n });\n};\ninherit(AcroFormButton, AcroFormField);\n\n/**\n * @class AcroFormPushButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormPushButton = function() {\n AcroFormButton.call(this);\n this.pushButton = true;\n};\ninherit(AcroFormPushButton, AcroFormButton);\n\n/**\n * @class AcroFormRadioButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormRadioButton = function() {\n AcroFormButton.call(this);\n this.radio = true;\n this.pushButton = false;\n\n var _Kids = [];\n Object.defineProperty(this, \"Kids\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _Kids;\n },\n set: function(value) {\n if (typeof value !== \"undefined\") {\n _Kids = value;\n } else {\n _Kids = [];\n }\n }\n });\n};\ninherit(AcroFormRadioButton, AcroFormButton);\n\n/**\n * The Child class of a RadioButton (the radioGroup) -> The single Buttons\n *\n * @class AcroFormChildClass\n * @extends AcroFormField\n * @ignore\n */\nvar AcroFormChildClass = function() {\n AcroFormField.call(this);\n\n var _parent;\n Object.defineProperty(this, \"Parent\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _parent;\n },\n set: function(value) {\n _parent = value;\n }\n });\n\n var _optionName;\n Object.defineProperty(this, \"optionName\", {\n enumerable: false,\n configurable: true,\n get: function() {\n return _optionName;\n },\n set: function(value) {\n _optionName = value;\n }\n });\n\n var _MK = {};\n Object.defineProperty(this, \"MK\", {\n enumerable: false,\n configurable: false,\n get: function() {\n var encryptor = function(data) {\n return data;\n };\n if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n var result = [];\n result.push(\"<<\");\n var key;\n for (key in _MK) {\n result.push(\"/\" + key + \" (\" + pdfEscape(encryptor(_MK[key])) + \")\");\n }\n result.push(\">>\");\n return result.join(\"\\n\");\n },\n set: function(value) {\n if (typeof value === \"object\") {\n _MK = value;\n }\n }\n });\n\n /**\n * From the PDF reference:\n * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n *\n * - '8' = Cross,\n * - 'l' = Circle,\n * - '' = nothing\n * @name AcroFormButton#caption\n * @type {string}\n */\n Object.defineProperty(this, \"caption\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MK.CA || \"\";\n },\n set: function(value) {\n if (typeof value === \"string\") {\n _MK.CA = value;\n }\n }\n });\n\n var _AS;\n Object.defineProperty(this, \"AS\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _AS;\n },\n set: function(value) {\n _AS = value;\n }\n });\n\n /**\n * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n *\n * @name AcroFormButton#appearanceState\n * @type {any}\n */\n Object.defineProperty(this, \"appearanceState\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _AS.substr(1, _AS.length - 1);\n },\n set: function(value) {\n _AS = \"/\" + value;\n }\n });\n this.caption = \"l\";\n this.appearanceState = \"Off\";\n // todo: set AppearanceType as variable that can be set from the\n // outside...\n this._AppearanceType = AcroFormAppearance.RadioButton.Circle;\n // The Default appearanceType is the Circle\n this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(\n this.optionName\n );\n};\ninherit(AcroFormChildClass, AcroFormField);\n\nAcroFormRadioButton.prototype.setAppearance = function(appearance) {\n if (!(\"createAppearanceStream\" in appearance && \"getCA\" in appearance)) {\n throw new Error(\n \"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\"\n );\n }\n for (var objId in this.Kids) {\n if (this.Kids.hasOwnProperty(objId)) {\n var child = this.Kids[objId];\n child.appearanceStreamContent = appearance.createAppearanceStream(\n child.optionName\n );\n child.caption = appearance.getCA();\n }\n }\n};\n\nAcroFormRadioButton.prototype.createOption = function(name) {\n // Create new Child for RadioGroup\n var child = new AcroFormChildClass();\n child.Parent = this;\n child.optionName = name;\n // Add to Parent\n this.Kids.push(child);\n\n addField.call(this.scope, child);\n\n return child;\n};\n\n/**\n * @class AcroFormCheckBox\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormCheckBox = function() {\n AcroFormButton.call(this);\n\n this.fontName = \"zapfdingbats\";\n this.caption = \"3\";\n this.appearanceState = \"On\";\n this.value = \"On\";\n this.textAlign = \"center\";\n this.appearanceStreamContent = AcroFormAppearance.CheckBox.createAppearanceStream();\n};\ninherit(AcroFormCheckBox, AcroFormButton);\n\n/**\n * @class AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormTextField = function() {\n AcroFormField.call(this);\n this.FT = \"/Tx\";\n\n /**\n * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line.\n *\n * @name AcroFormTextField#multiline\n * @type {boolean}\n */\n Object.defineProperty(this, \"multiline\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 13));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 13);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 13);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.\n *\n * @name AcroFormTextField#fileSelect\n * @type {boolean}\n */\n Object.defineProperty(this, \"fileSelect\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 21));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 21);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 21);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, text entered in the field shall not be spell-checked.\n *\n * @name AcroFormTextField#doNotSpellCheck\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotSpellCheck\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 23));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 23);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 23);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area.\n *\n * @name AcroFormTextField#doNotScroll\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotScroll\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 24));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 24);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 24);\n }\n }\n });\n\n /**\n * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.\n *\n * @name AcroFormTextField#comb\n * @type {boolean}\n */\n Object.defineProperty(this, \"comb\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 25));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 25);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 25);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string.\n *\n * @name AcroFormTextField#richText\n * @type {boolean}\n */\n Object.defineProperty(this, \"richText\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 26));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 26);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 26);\n }\n }\n });\n\n var _MaxLen = null;\n Object.defineProperty(this, \"MaxLen\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _MaxLen;\n },\n set: function(value) {\n _MaxLen = value;\n }\n });\n\n /**\n * (Optional; inheritable) The maximum length of the field’s text, in characters.\n *\n * @name AcroFormTextField#maxLength\n * @type {number}\n */\n Object.defineProperty(this, \"maxLength\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MaxLen;\n },\n set: function(value) {\n if (Number.isInteger(value)) {\n _MaxLen = value;\n }\n }\n });\n\n Object.defineProperty(this, \"hasAppearanceStream\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.V || this.DV;\n }\n });\n};\ninherit(AcroFormTextField, AcroFormField);\n\n/**\n * @class AcroFormPasswordField\n * @extends AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormPasswordField = function() {\n AcroFormTextField.call(this);\n\n /**\n * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters.\n * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set.\n *\n * @name AcroFormTextField#password\n * @type {boolean}\n */\n Object.defineProperty(this, \"password\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 14));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 14);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 14);\n }\n }\n });\n this.password = true;\n};\ninherit(AcroFormPasswordField, AcroFormTextField);\n\n// Contains Methods for creating standard appearances\nvar AcroFormAppearance = {\n CheckBox: {\n createAppearanceStream: function() {\n var appearance = {\n N: {\n On: AcroFormAppearance.CheckBox.YesNormal\n },\n D: {\n On: AcroFormAppearance.CheckBox.YesPushDown,\n Off: AcroFormAppearance.CheckBox.OffPushDown\n }\n };\n\n return appearance;\n },\n /**\n * Returns the standard On Appearance for a CheckBox\n *\n * @returns {AcroFormXObject}\n */\n YesPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n var fontKey = formObject.scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = formObject.scope.__private__.encodeColorString(\n formObject.color\n );\n var calcRes = calculateX(formObject, formObject.caption);\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n stream.push(\"BMC\");\n stream.push(\"q\");\n stream.push(\"0 0 1 rg\");\n stream.push(\n \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n );\n stream.push(\"BT\");\n stream.push(calcRes.text);\n stream.push(\"ET\");\n stream.push(\"Q\");\n stream.push(\"EMC\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n\n YesNormal: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var fontKey = formObject.scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = formObject.scope.__private__.encodeColorString(\n formObject.color\n );\n var stream = [];\n var height = AcroFormAppearance.internal.getHeight(formObject);\n var width = AcroFormAppearance.internal.getWidth(formObject);\n var calcRes = calculateX(formObject, formObject.caption);\n stream.push(\"1 g\");\n stream.push(\"0 0 \" + f2(width) + \" \" + f2(height) + \" re\");\n stream.push(\"f\");\n stream.push(\"q\");\n stream.push(\"0 0 1 rg\");\n stream.push(\"0 0 \" + f2(width - 1) + \" \" + f2(height - 1) + \" re\");\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(\"0 g\");\n stream.push(\"BT\");\n stream.push(\n \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n );\n stream.push(calcRes.text);\n stream.push(\"ET\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n\n /**\n * Returns the standard Off Appearance for a CheckBox\n *\n * @returns {AcroFormXObject}\n */\n OffPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n },\n\n RadioButton: {\n Circle: {\n createAppearanceStream: function(name) {\n var appearanceStreamContent = {\n D: {\n Off: AcroFormAppearance.RadioButton.Circle.OffPushDown\n },\n N: {}\n };\n appearanceStreamContent.N[name] =\n AcroFormAppearance.RadioButton.Circle.YesNormal;\n appearanceStreamContent.D[name] =\n AcroFormAppearance.RadioButton.Circle.YesPushDown;\n return appearanceStreamContent;\n },\n getCA: function() {\n return \"l\";\n },\n\n YesNormal: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n // Make the Radius of the Circle relative to min(height, width) of formObject\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n DotRadius = Number((DotRadius * 0.9).toFixed(5));\n var c = AcroFormAppearance.internal.Bezier_C;\n var DotRadiusBezier = Number((DotRadius * c).toFixed(5));\n /*\n * The Following is a Circle created with Bezier-Curves.\n */\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(DotRadius + \" 0 m\");\n stream.push(\n DotRadius +\n \" \" +\n DotRadiusBezier +\n \" \" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" 0 \" +\n DotRadius +\n \" c\"\n );\n stream.push(\n \"-\" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\n \"-\" +\n DotRadius +\n \" -\" +\n DotRadiusBezier +\n \" -\" +\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" 0 -\" +\n DotRadius +\n \" c\"\n );\n stream.push(\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n YesPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n DotRadius = Number((DotRadius * 0.9).toFixed(5));\n // Save results for later use; no need to waste\n // processor ticks on doing math\n var k = Number((DotRadius * 2).toFixed(5));\n var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n var dc = Number(\n (DotRadius * AcroFormAppearance.internal.Bezier_C).toFixed(5)\n );\n\n stream.push(\"0.749023 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(k + \" 0 m\");\n stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n stream.push(\n \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n );\n stream.push(\n \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n );\n stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n stream.push(\"f\");\n stream.push(\"Q\");\n stream.push(\"0 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(DotRadius + \" 0 m\");\n stream.push(\n \"\" +\n DotRadius +\n \" \" +\n dc +\n \" \" +\n dc +\n \" \" +\n DotRadius +\n \" 0 \" +\n DotRadius +\n \" c\"\n );\n stream.push(\n \"-\" +\n dc +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadius +\n \" \" +\n dc +\n \" -\" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\n \"-\" +\n DotRadius +\n \" -\" +\n dc +\n \" -\" +\n dc +\n \" -\" +\n DotRadius +\n \" 0 -\" +\n DotRadius +\n \" c\"\n );\n stream.push(\n dc +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadius +\n \" -\" +\n dc +\n \" \" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n OffPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n DotRadius = Number((DotRadius * 0.9).toFixed(5));\n // Save results for later use; no need to waste\n // processor ticks on doing math\n var k = Number((DotRadius * 2).toFixed(5));\n var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n\n stream.push(\"0.749023 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(k + \" 0 m\");\n stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n stream.push(\n \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n );\n stream.push(\n \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n );\n stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n },\n\n Cross: {\n /**\n * Creates the Actual AppearanceDictionary-References\n *\n * @param {string} name\n * @returns {Object}\n * @ignore\n */\n createAppearanceStream: function(name) {\n var appearanceStreamContent = {\n D: {\n Off: AcroFormAppearance.RadioButton.Cross.OffPushDown\n },\n N: {}\n };\n appearanceStreamContent.N[name] =\n AcroFormAppearance.RadioButton.Cross.YesNormal;\n appearanceStreamContent.D[name] =\n AcroFormAppearance.RadioButton.Cross.YesPushDown;\n return appearanceStreamContent;\n },\n getCA: function() {\n return \"8\";\n },\n\n YesNormal: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n var cross = AcroFormAppearance.internal.calculateCross(formObject);\n stream.push(\"q\");\n stream.push(\n \"1 1 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n \" re\"\n );\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n stream.push(\"s\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n YesPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var cross = AcroFormAppearance.internal.calculateCross(formObject);\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n stream.push(\"q\");\n stream.push(\n \"1 1 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n \" re\"\n );\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n stream.push(\"s\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n OffPushDown: function(formObject) {\n var xobj = createFormXObject(formObject);\n xobj.scope = formObject.scope;\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n }\n },\n\n /**\n * Returns the standard Appearance\n *\n * @returns {AcroFormXObject}\n */\n createDefaultAppearanceStream: function(formObject) {\n // Set Helvetica to Standard Font (size: auto)\n // Color: Black\n var fontKey = formObject.scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = formObject.scope.__private__.encodeColorString(\n formObject.color\n );\n var fontSize = formObject.fontSize;\n var result = \"/\" + fontKey + \" \" + fontSize + \" Tf \" + encodedColor;\n return result;\n }\n};\n\nAcroFormAppearance.internal = {\n Bezier_C: 0.551915024494,\n\n calculateCross: function(formObject) {\n var width = AcroFormAppearance.internal.getWidth(formObject);\n var height = AcroFormAppearance.internal.getHeight(formObject);\n var a = Math.min(width, height);\n\n var cross = {\n x1: {\n // upperLeft\n x: (width - a) / 2,\n y: (height - a) / 2 + a // height - borderPadding\n },\n x2: {\n // lowerRight\n x: (width - a) / 2 + a,\n y: (height - a) / 2 // borderPadding\n },\n x3: {\n // lowerLeft\n x: (width - a) / 2,\n y: (height - a) / 2 // borderPadding\n },\n x4: {\n // upperRight\n x: (width - a) / 2 + a,\n y: (height - a) / 2 + a // height - borderPadding\n }\n };\n\n return cross;\n }\n};\nAcroFormAppearance.internal.getWidth = function(formObject) {\n var result = 0;\n if (typeof formObject === \"object\") {\n result = scale(formObject.Rect[2]);\n }\n return result;\n};\nAcroFormAppearance.internal.getHeight = function(formObject) {\n var result = 0;\n if (typeof formObject === \"object\") {\n result = scale(formObject.Rect[3]);\n }\n return result;\n};\n\n// Public:\n\n/**\n * Add an AcroForm-Field to the jsPDF-instance\n *\n * @name addField\n * @function\n * @instance\n * @param {Object} fieldObject\n * @returns {jsPDF}\n */\nvar addField = (jsPDFAPI.addField = function(fieldObject) {\n initializeAcroForm(this, fieldObject);\n\n if (fieldObject instanceof AcroFormField) {\n putForm(fieldObject);\n } else {\n throw new Error(\"Invalid argument passed to jsPDF.addField.\");\n }\n fieldObject.page = fieldObject.scope.internal.getCurrentPageInfo().pageNumber;\n return this;\n});\n\njsPDFAPI.AcroFormChoiceField = AcroFormChoiceField;\njsPDFAPI.AcroFormListBox = AcroFormListBox;\njsPDFAPI.AcroFormComboBox = AcroFormComboBox;\njsPDFAPI.AcroFormEditBox = AcroFormEditBox;\njsPDFAPI.AcroFormButton = AcroFormButton;\njsPDFAPI.AcroFormPushButton = AcroFormPushButton;\njsPDFAPI.AcroFormRadioButton = AcroFormRadioButton;\njsPDFAPI.AcroFormCheckBox = AcroFormCheckBox;\njsPDFAPI.AcroFormTextField = AcroFormTextField;\njsPDFAPI.AcroFormPasswordField = AcroFormPasswordField;\njsPDFAPI.AcroFormAppearance = AcroFormAppearance;\n\njsPDFAPI.AcroForm = {\n ChoiceField: AcroFormChoiceField,\n ListBox: AcroFormListBox,\n ComboBox: AcroFormComboBox,\n EditBox: AcroFormEditBox,\n Button: AcroFormButton,\n PushButton: AcroFormPushButton,\n RadioButton: AcroFormRadioButton,\n CheckBox: AcroFormCheckBox,\n TextField: AcroFormTextField,\n PasswordField: AcroFormPasswordField,\n Appearance: AcroFormAppearance\n};\n\njsPDF.AcroForm = {\n ChoiceField: AcroFormChoiceField,\n ListBox: AcroFormListBox,\n ComboBox: AcroFormComboBox,\n EditBox: AcroFormEditBox,\n Button: AcroFormButton,\n PushButton: AcroFormPushButton,\n RadioButton: AcroFormRadioButton,\n CheckBox: AcroFormCheckBox,\n TextField: AcroFormTextField,\n PasswordField: AcroFormPasswordField,\n Appearance: AcroFormAppearance\n};\n\nvar AcroForm = jsPDF.AcroForm;\n\nexport {\n AcroForm,\n AcroFormChoiceField,\n AcroFormListBox,\n AcroFormComboBox,\n AcroFormEditBox,\n AcroFormButton,\n AcroFormPushButton,\n AcroFormRadioButton,\n AcroFormCheckBox,\n AcroFormTextField,\n AcroFormPasswordField,\n AcroFormAppearance\n};\n","function toLookup(arr) {\n return arr.reduce(function(lookup, name, index) {\n lookup[name] = index;\n\n return lookup;\n }, {});\n}\n\nvar fontStyleOrder = {\n italic: [\"italic\", \"oblique\", \"normal\"],\n oblique: [\"oblique\", \"italic\", \"normal\"],\n normal: [\"normal\", \"oblique\", \"italic\"]\n};\n\nvar fontStretchOrder = [\n \"ultra-condensed\",\n \"extra-condensed\",\n \"condensed\",\n \"semi-condensed\",\n \"normal\",\n \"semi-expanded\",\n \"expanded\",\n \"extra-expanded\",\n \"ultra-expanded\"\n];\n\n// For a given font-stretch value, we need to know where to start our search\n// from in the fontStretchOrder list.\nvar fontStretchLookup = toLookup(fontStretchOrder);\n\nvar fontWeights = [100, 200, 300, 400, 500, 600, 700, 800, 900];\nvar fontWeightsLookup = toLookup(fontWeights);\n\nfunction normalizeFontStretch(stretch) {\n stretch = stretch || \"normal\";\n\n return typeof fontStretchLookup[stretch] === \"number\" ? stretch : \"normal\";\n}\n\nfunction normalizeFontStyle(style) {\n style = style || \"normal\";\n\n return fontStyleOrder[style] ? style : \"normal\";\n}\n\nfunction normalizeFontWeight(weight) {\n if (!weight) {\n return 400;\n }\n\n if (typeof weight === \"number\") {\n // Ignore values which aren't valid font-weights.\n return weight >= 100 && weight <= 900 && weight % 100 === 0 ? weight : 400;\n }\n\n if (/^\\d00$/.test(weight)) {\n return parseInt(weight);\n }\n\n switch (weight) {\n case \"bold\":\n return 700;\n\n case \"normal\":\n default:\n return 400;\n }\n}\n\nexport function normalizeFontFace(fontFace) {\n var family = fontFace.family.replace(/\"|'/g, \"\").toLowerCase();\n\n var style = normalizeFontStyle(fontFace.style);\n var weight = normalizeFontWeight(fontFace.weight);\n var stretch = normalizeFontStretch(fontFace.stretch);\n\n return {\n family: family,\n style: style,\n weight: weight,\n stretch: stretch,\n src: fontFace.src || [],\n\n // The ref property maps this font-face to the font\n // added by the .addFont() method.\n ref: fontFace.ref || {\n name: family,\n style: [stretch, style, weight].join(\" \")\n }\n };\n}\n\n/**\n * Turns a list of font-faces into a map, for easier lookup when resolving\n * fonts.\n * @private\n */\nexport function buildFontFaceMap(fontFaces) {\n var map = {};\n\n for (var i = 0; i < fontFaces.length; ++i) {\n var normalized = normalizeFontFace(fontFaces[i]);\n\n var name = normalized.family;\n var stretch = normalized.stretch;\n var style = normalized.style;\n var weight = normalized.weight;\n\n map[name] = map[name] || {};\n\n map[name][stretch] = map[name][stretch] || {};\n map[name][stretch][style] = map[name][stretch][style] || {};\n map[name][stretch][style][weight] = normalized;\n }\n\n return map;\n}\n\n/**\n * Searches a map of stretches, weights, etc. in the given direction and\n * then, if no match has been found, in the opposite directions.\n *\n * @param {Object.} matchingSet A map of the various font variations.\n * @param {any[]} order The order of the different variations\n * @param {number} pivot The starting point of the search in the order list.\n * @param {number} dir The initial direction of the search (desc = -1, asc = 1)\n * @private\n */\n\nfunction searchFromPivot(matchingSet, order, pivot, dir) {\n var i;\n\n for (i = pivot; i >= 0 && i < order.length; i += dir) {\n if (matchingSet[order[i]]) {\n return matchingSet[order[i]];\n }\n }\n\n for (i = pivot; i >= 0 && i < order.length; i -= dir) {\n if (matchingSet[order[i]]) {\n return matchingSet[order[i]];\n }\n }\n}\n\nfunction resolveFontStretch(stretch, matchingSet) {\n if (matchingSet[stretch]) {\n return matchingSet[stretch];\n }\n\n var pivot = fontStretchLookup[stretch];\n\n // If the font-stretch value is normal or more condensed, we want to\n // start with a descending search, otherwise we should do ascending.\n var dir = pivot <= fontStretchLookup[\"normal\"] ? -1 : 1;\n var match = searchFromPivot(matchingSet, fontStretchOrder, pivot, dir);\n\n if (!match) {\n // Since a font-family cannot exist without having at least one stretch value\n // we should never reach this point.\n throw new Error(\n \"Could not find a matching font-stretch value for \" + stretch\n );\n }\n\n return match;\n}\n\nfunction resolveFontStyle(fontStyle, matchingSet) {\n if (matchingSet[fontStyle]) {\n return matchingSet[fontStyle];\n }\n\n var ordering = fontStyleOrder[fontStyle];\n\n for (var i = 0; i < ordering.length; ++i) {\n if (matchingSet[ordering[i]]) {\n return matchingSet[ordering[i]];\n }\n }\n\n // Since a font-family cannot exist without having at least one style value\n // we should never reach this point.\n throw new Error(\"Could not find a matching font-style for \" + fontStyle);\n}\n\nfunction resolveFontWeight(weight, matchingSet) {\n if (matchingSet[weight]) {\n return matchingSet[weight];\n }\n\n if (weight === 400 && matchingSet[500]) {\n return matchingSet[500];\n }\n\n if (weight === 500 && matchingSet[400]) {\n return matchingSet[400];\n }\n\n var pivot = fontWeightsLookup[weight];\n\n // If the font-stretch value is normal or more condensed, we want to\n // start with a descending search, otherwise we should do ascending.\n var dir = weight < 400 ? -1 : 1;\n var match = searchFromPivot(matchingSet, fontWeights, pivot, dir);\n\n if (!match) {\n // Since a font-family cannot exist without having at least one stretch value\n // we should never reach this point.\n throw new Error(\n \"Could not find a matching font-weight for value \" + weight\n );\n }\n\n return match;\n}\n\nvar defaultGenericFontFamilies = {\n \"sans-serif\": \"helvetica\",\n fixed: \"courier\",\n monospace: \"courier\",\n terminal: \"courier\",\n cursive: \"times\",\n fantasy: \"times\",\n serif: \"times\"\n};\n\nvar systemFonts = {\n caption: \"times\",\n icon: \"times\",\n menu: \"times\",\n \"message-box\": \"times\",\n \"small-caption\": \"times\",\n \"status-bar\": \"times\"\n};\n\nfunction ruleToString(rule) {\n return [rule.stretch, rule.style, rule.weight, rule.family].join(\" \");\n}\n\nexport function resolveFontFace(fontFaceMap, rules, opts) {\n opts = opts || {};\n\n var defaultFontFamily = opts.defaultFontFamily || \"times\";\n var genericFontFamilies = Object.assign(\n {},\n defaultGenericFontFamilies,\n opts.genericFontFamilies || {}\n );\n\n var rule = null;\n var matches = null;\n\n for (var i = 0; i < rules.length; ++i) {\n rule = normalizeFontFace(rules[i]);\n\n if (genericFontFamilies[rule.family]) {\n rule.family = genericFontFamilies[rule.family];\n }\n\n if (fontFaceMap.hasOwnProperty(rule.family)) {\n matches = fontFaceMap[rule.family];\n\n break;\n }\n }\n\n // Always fallback to a known font family.\n matches = matches || fontFaceMap[defaultFontFamily];\n\n if (!matches) {\n // At this point we should definitiely have a font family, but if we\n // don't there is something wrong with our configuration\n throw new Error(\n \"Could not find a font-family for the rule '\" +\n ruleToString(rule) +\n \"' and default family '\" +\n defaultFontFamily +\n \"'.\"\n );\n }\n\n matches = resolveFontStretch(rule.stretch, matches);\n matches = resolveFontStyle(rule.style, matches);\n matches = resolveFontWeight(rule.weight, matches);\n\n if (!matches) {\n // We should've fount\n throw new Error(\n \"Failed to resolve a font for the rule '\" + ruleToString(rule) + \"'.\"\n );\n }\n\n return matches;\n}\n\n/**\n * Builds a style id for use with the addFont() method.\n * @param {FontFace} font\n * @private\n */\nexport function toStyleName(font) {\n return [font.weight, font.style, font.stretch].join(\" \");\n}\n\nfunction eatWhiteSpace(input) {\n return input.trimLeft();\n}\n\nfunction parseQuotedFontFamily(input, quote) {\n var index = 0;\n\n while (index < input.length) {\n var current = input.charAt(index);\n\n if (current === quote) {\n return [input.substring(0, index), input.substring(index + 1)];\n }\n\n index += 1;\n }\n\n // Unexpected end of input\n return null;\n}\n\nfunction parseNonQuotedFontFamily(input) {\n // It implements part of the identifier parser here: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n //\n // NOTE: This parser pretty much ignores escaped identifiers and that there is a thing called unicode.\n //\n // Breakdown of regexp:\n // -[a-z_] - when identifier starts with a hyphen, you're not allowed to have another hyphen or a digit\n // [a-z_] - allow a-z and underscore at beginning of input\n // [a-z0-9_-]* - after that, anything goes\n var match = input.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);\n\n // non quoted value contains illegal characters\n if (match === null) {\n return null;\n }\n\n return [match[0], input.substring(match[0].length)];\n}\n\nvar defaultFont = [\"times\"];\n\nexport function parseFontFamily(input) {\n var result = [];\n var ch, parsed;\n var remaining = input.trim();\n\n if (remaining === \"\") {\n return defaultFont;\n }\n\n if (remaining in systemFonts) {\n return [systemFonts[remaining]];\n }\n\n while (remaining !== \"\") {\n parsed = null;\n remaining = eatWhiteSpace(remaining);\n ch = remaining.charAt(0);\n\n switch (ch) {\n case '\"':\n case \"'\":\n parsed = parseQuotedFontFamily(remaining.substring(1), ch);\n break;\n\n default:\n parsed = parseNonQuotedFontFamily(remaining);\n break;\n }\n\n if (parsed === null) {\n return defaultFont;\n }\n\n result.push(parsed[0]);\n\n remaining = eatWhiteSpace(parsed[1]);\n\n // We expect end of input or a comma separator here\n if (remaining !== \"\" && remaining.charAt(0) !== \",\") {\n return defaultFont;\n }\n\n remaining = remaining.replace(/^,/, \"\");\n }\n\n return result;\n}\n","/** @license\n * jsPDF addImage plugin\n * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/\n * 2013 Chris Dowling, https://github.com/gingerchris\n * 2013 Trinh Ho, https://github.com/ineedfat\n * 2013 Edwin Alejandro Perez, https://github.com/eaparango\n * 2013 Norah Smith, https://github.com/burnburnrocket\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 James Robb, https://github.com/jamesbrobb\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * @name addImage\n * @module\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { atob, btoa } from \"../libs/AtobBtoa.js\";\n\n(function(jsPDFAPI) {\n \"use strict\";\n\n var namespace = \"addImage_\";\n jsPDFAPI.__addimage__ = {};\n\n var UNKNOWN = \"UNKNOWN\";\n\n // Heuristic selection of a good batch for large array .apply. Not limiting make the call overflow.\n // With too small batch iteration will be slow as more calls are made,\n // higher values cause larger and slower garbage collection.\n var ARRAY_APPLY_BATCH = 8192;\n\n var imageFileTypeHeaders = {\n PNG: [[0x89, 0x50, 0x4e, 0x47]],\n TIFF: [\n [0x4d, 0x4d, 0x00, 0x2a], //Motorola\n [0x49, 0x49, 0x2a, 0x00] //Intel\n ],\n JPEG: [\n [\n 0xff,\n 0xd8,\n 0xff,\n 0xe0,\n undefined,\n undefined,\n 0x4a,\n 0x46,\n 0x49,\n 0x46,\n 0x00\n ], //JFIF\n [\n 0xff,\n 0xd8,\n 0xff,\n 0xe1,\n undefined,\n undefined,\n 0x45,\n 0x78,\n 0x69,\n 0x66,\n 0x00,\n 0x00\n ], //Exif\n [0xff, 0xd8, 0xff, 0xdb], //JPEG RAW\n [0xff, 0xd8, 0xff, 0xee] //EXIF RAW\n ],\n JPEG2000: [[0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20]],\n GIF87a: [[0x47, 0x49, 0x46, 0x38, 0x37, 0x61]],\n GIF89a: [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61]],\n WEBP: [\n [\n 0x52,\n 0x49,\n 0x46,\n 0x46,\n undefined,\n undefined,\n undefined,\n undefined,\n 0x57,\n 0x45,\n 0x42,\n 0x50\n ]\n ],\n BMP: [\n [0x42, 0x4d], //BM - Windows 3.1x, 95, NT, ... etc.\n [0x42, 0x41], //BA - OS/2 struct bitmap array\n [0x43, 0x49], //CI - OS/2 struct color icon\n [0x43, 0x50], //CP - OS/2 const color pointer\n [0x49, 0x43], //IC - OS/2 struct icon\n [0x50, 0x54] //PT - OS/2 pointer\n ]\n };\n\n /**\n * Recognize filetype of Image by magic-bytes\n *\n * https://en.wikipedia.org/wiki/List_of_file_signatures\n *\n * @name getImageFileTypeByImageData\n * @public\n * @function\n * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer\n * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG'\n *\n * @returns {string} filetype of Image\n */\n var getImageFileTypeByImageData = (jsPDFAPI.__addimage__.getImageFileTypeByImageData = function(\n imageData,\n fallbackFormat\n ) {\n fallbackFormat = fallbackFormat || UNKNOWN;\n var i;\n var j;\n var result = UNKNOWN;\n var headerSchemata;\n var compareResult;\n var fileType;\n\n if (\n fallbackFormat === \"RGBA\" ||\n (imageData.data !== undefined &&\n imageData.data instanceof Uint8ClampedArray &&\n \"height\" in imageData &&\n \"width\" in imageData)\n ) {\n return \"RGBA\";\n }\n\n if (isArrayBufferView(imageData)) {\n for (fileType in imageFileTypeHeaders) {\n headerSchemata = imageFileTypeHeaders[fileType];\n for (i = 0; i < headerSchemata.length; i += 1) {\n compareResult = true;\n for (j = 0; j < headerSchemata[i].length; j += 1) {\n if (headerSchemata[i][j] === undefined) {\n continue;\n }\n if (headerSchemata[i][j] !== imageData[j]) {\n compareResult = false;\n break;\n }\n }\n if (compareResult === true) {\n result = fileType;\n break;\n }\n }\n }\n } else {\n for (fileType in imageFileTypeHeaders) {\n headerSchemata = imageFileTypeHeaders[fileType];\n for (i = 0; i < headerSchemata.length; i += 1) {\n compareResult = true;\n for (j = 0; j < headerSchemata[i].length; j += 1) {\n if (headerSchemata[i][j] === undefined) {\n continue;\n }\n if (headerSchemata[i][j] !== imageData.charCodeAt(j)) {\n compareResult = false;\n break;\n }\n }\n if (compareResult === true) {\n result = fileType;\n break;\n }\n }\n }\n }\n\n if (result === UNKNOWN && fallbackFormat !== UNKNOWN) {\n result = fallbackFormat;\n }\n return result;\n });\n\n // Image functionality ported from pdf.js\n var putImage = function(image) {\n var out = this.internal.write;\n var putStream = this.internal.putStream;\n var getFilters = this.internal.getFilters;\n\n var filter = getFilters();\n while (filter.indexOf(\"FlateEncode\") !== -1) {\n filter.splice(filter.indexOf(\"FlateEncode\"), 1);\n }\n\n image.objectId = this.internal.newObject();\n\n var additionalKeyValues = [];\n additionalKeyValues.push({ key: \"Type\", value: \"/XObject\" });\n additionalKeyValues.push({ key: \"Subtype\", value: \"/Image\" });\n additionalKeyValues.push({ key: \"Width\", value: image.width });\n additionalKeyValues.push({ key: \"Height\", value: image.height });\n\n if (image.colorSpace === color_spaces.INDEXED) {\n additionalKeyValues.push({\n key: \"ColorSpace\",\n value:\n \"[/Indexed /DeviceRGB \" +\n // if an indexed png defines more than one colour with transparency, we've created a sMask\n (image.palette.length / 3 - 1) +\n \" \" +\n (\"sMask\" in image && typeof image.sMask !== \"undefined\"\n ? image.objectId + 2\n : image.objectId + 1) +\n \" 0 R]\"\n });\n } else {\n additionalKeyValues.push({\n key: \"ColorSpace\",\n value: \"/\" + image.colorSpace\n });\n if (image.colorSpace === color_spaces.DEVICE_CMYK) {\n additionalKeyValues.push({ key: \"Decode\", value: \"[1 0 1 0 1 0 1 0]\" });\n }\n }\n additionalKeyValues.push({\n key: \"BitsPerComponent\",\n value: image.bitsPerComponent\n });\n if (\n \"decodeParameters\" in image &&\n typeof image.decodeParameters !== \"undefined\"\n ) {\n additionalKeyValues.push({\n key: \"DecodeParms\",\n value: \"<<\" + image.decodeParameters + \">>\"\n });\n }\n if (\"transparency\" in image && Array.isArray(image.transparency)) {\n var transparency = \"\",\n i = 0,\n len = image.transparency.length;\n for (; i < len; i++)\n transparency +=\n image.transparency[i] + \" \" + image.transparency[i] + \" \";\n\n additionalKeyValues.push({\n key: \"Mask\",\n value: \"[\" + transparency + \"]\"\n });\n }\n if (typeof image.sMask !== \"undefined\") {\n additionalKeyValues.push({\n key: \"SMask\",\n value: image.objectId + 1 + \" 0 R\"\n });\n }\n\n var alreadyAppliedFilters =\n typeof image.filter !== \"undefined\" ? [\"/\" + image.filter] : undefined;\n\n putStream({\n data: image.data,\n additionalKeyValues: additionalKeyValues,\n alreadyAppliedFilters: alreadyAppliedFilters,\n objectId: image.objectId\n });\n\n out(\"endobj\");\n\n // Soft mask\n if (\"sMask\" in image && typeof image.sMask !== \"undefined\") {\n var decodeParameters =\n \"/Predictor \" +\n image.predictor +\n \" /Colors 1 /BitsPerComponent \" +\n image.bitsPerComponent +\n \" /Columns \" +\n image.width;\n var sMask = {\n width: image.width,\n height: image.height,\n colorSpace: \"DeviceGray\",\n bitsPerComponent: image.bitsPerComponent,\n decodeParameters: decodeParameters,\n data: image.sMask\n };\n if (\"filter\" in image) {\n sMask.filter = image.filter;\n }\n putImage.call(this, sMask);\n }\n\n //Palette\n if (image.colorSpace === color_spaces.INDEXED) {\n var objId = this.internal.newObject();\n //out('<< /Filter / ' + img['f'] +' /Length ' + img['pal'].length + '>>');\n //putStream(zlib.compress(img['pal']));\n putStream({\n data: arrayBufferToBinaryString(new Uint8Array(image.palette)),\n objectId: objId\n });\n out(\"endobj\");\n }\n };\n var putResourcesCallback = function() {\n var images = this.internal.collections[namespace + \"images\"];\n for (var i in images) {\n putImage.call(this, images[i]);\n }\n };\n var putXObjectsDictCallback = function() {\n var images = this.internal.collections[namespace + \"images\"],\n out = this.internal.write,\n image;\n for (var i in images) {\n image = images[i];\n out(\"/I\" + image.index, image.objectId, \"0\", \"R\");\n }\n };\n\n var checkCompressValue = function(value) {\n if (value && typeof value === \"string\") value = value.toUpperCase();\n return value in jsPDFAPI.image_compression ? value : image_compression.NONE;\n };\n\n var initialize = function() {\n if (!this.internal.collections[namespace + \"images\"]) {\n this.internal.collections[namespace + \"images\"] = {};\n this.internal.events.subscribe(\"putResources\", putResourcesCallback);\n this.internal.events.subscribe(\"putXobjectDict\", putXObjectsDictCallback);\n }\n };\n\n var getImages = function() {\n var images = this.internal.collections[namespace + \"images\"];\n initialize.call(this);\n return images;\n };\n var getImageIndex = function() {\n return Object.keys(this.internal.collections[namespace + \"images\"]).length;\n };\n var notDefined = function(value) {\n return typeof value === \"undefined\" || value === null || value.length === 0;\n };\n var generateAliasFromImageData = function(imageData) {\n if (typeof imageData === \"string\" || isArrayBufferView(imageData)) {\n return sHashCode(imageData);\n } else if (isArrayBufferView(imageData.data)) {\n return sHashCode(imageData.data);\n }\n\n return null;\n };\n\n var isImageTypeSupported = function(type) {\n return typeof jsPDFAPI[\"process\" + type.toUpperCase()] === \"function\";\n };\n\n var isDOMElement = function(object) {\n return typeof object === \"object\" && object.nodeType === 1;\n };\n\n var getImageDataFromElement = function(element, format) {\n //if element is an image which uses data url definition, just return the dataurl\n if (element.nodeName === \"IMG\" && element.hasAttribute(\"src\")) {\n var src = \"\" + element.getAttribute(\"src\");\n\n //is base64 encoded dataUrl, directly process it\n if (src.indexOf(\"data:image/\") === 0) {\n return atob(\n unescape(src)\n .split(\"base64,\")\n .pop()\n );\n }\n\n //it is probably an url, try to load it\n var tmpImageData = jsPDFAPI.loadFile(src, true);\n if (tmpImageData !== undefined) {\n return tmpImageData;\n }\n }\n\n if (element.nodeName === \"CANVAS\") {\n if (element.width === 0 || element.height === 0) {\n throw new Error(\n \"Given canvas must have data. Canvas width: \" +\n element.width +\n \", height: \" +\n element.height\n );\n }\n var mimeType;\n switch (format) {\n case \"PNG\":\n mimeType = \"image/png\";\n break;\n case \"WEBP\":\n mimeType = \"image/webp\";\n break;\n case \"JPEG\":\n case \"JPG\":\n default:\n mimeType = \"image/jpeg\";\n break;\n }\n return atob(\n element\n .toDataURL(mimeType, 1.0)\n .split(\"base64,\")\n .pop()\n );\n }\n };\n\n var checkImagesForAlias = function(alias) {\n var images = this.internal.collections[namespace + \"images\"];\n if (images) {\n for (var e in images) {\n if (alias === images[e].alias) {\n return images[e];\n }\n }\n }\n };\n\n var determineWidthAndHeight = function(width, height, image) {\n if (!width && !height) {\n width = -96;\n height = -96;\n }\n if (width < 0) {\n width = (-1 * image.width * 72) / width / this.internal.scaleFactor;\n }\n if (height < 0) {\n height = (-1 * image.height * 72) / height / this.internal.scaleFactor;\n }\n if (width === 0) {\n width = (height * image.width) / image.height;\n }\n if (height === 0) {\n height = (width * image.height) / image.width;\n }\n\n return [width, height];\n };\n\n var writeImageToPDF = function(x, y, width, height, image, rotation) {\n var dims = determineWidthAndHeight.call(this, width, height, image),\n coord = this.internal.getCoordinateString,\n vcoord = this.internal.getVerticalCoordinateString;\n\n var images = getImages.call(this);\n\n width = dims[0];\n height = dims[1];\n images[image.index] = image;\n\n if (rotation) {\n rotation *= Math.PI / 180;\n var c = Math.cos(rotation);\n var s = Math.sin(rotation);\n //like in pdf Reference do it 4 digits instead of 2\n var f4 = function(number) {\n return number.toFixed(4);\n };\n var rotationTransformationMatrix = [\n f4(c),\n f4(s),\n f4(s * -1),\n f4(c),\n 0,\n 0,\n \"cm\"\n ];\n }\n this.internal.write(\"q\"); //Save graphics state\n if (rotation) {\n this.internal.write(\n [1, \"0\", \"0\", 1, coord(x), vcoord(y + height), \"cm\"].join(\" \")\n ); //Translate\n this.internal.write(rotationTransformationMatrix.join(\" \")); //Rotate\n this.internal.write(\n [coord(width), \"0\", \"0\", coord(height), \"0\", \"0\", \"cm\"].join(\" \")\n ); //Scale\n } else {\n this.internal.write(\n [\n coord(width),\n \"0\",\n \"0\",\n coord(height),\n coord(x),\n vcoord(y + height),\n \"cm\"\n ].join(\" \")\n ); //Translate and Scale\n }\n\n if (this.isAdvancedAPI()) {\n // draw image bottom up when in \"advanced\" API mode\n this.internal.write([1, 0, 0, -1, 0, 0, \"cm\"].join(\" \"));\n }\n\n this.internal.write(\"/I\" + image.index + \" Do\"); //Paint Image\n this.internal.write(\"Q\"); //Restore graphics state\n };\n\n /**\n * COLOR SPACES\n */\n var color_spaces = (jsPDFAPI.color_spaces = {\n DEVICE_RGB: \"DeviceRGB\",\n DEVICE_GRAY: \"DeviceGray\",\n DEVICE_CMYK: \"DeviceCMYK\",\n CAL_GREY: \"CalGray\",\n CAL_RGB: \"CalRGB\",\n LAB: \"Lab\",\n ICC_BASED: \"ICCBased\",\n INDEXED: \"Indexed\",\n PATTERN: \"Pattern\",\n SEPARATION: \"Separation\",\n DEVICE_N: \"DeviceN\"\n });\n\n /**\n * DECODE METHODS\n */\n jsPDFAPI.decode = {\n DCT_DECODE: \"DCTDecode\",\n FLATE_DECODE: \"FlateDecode\",\n LZW_DECODE: \"LZWDecode\",\n JPX_DECODE: \"JPXDecode\",\n JBIG2_DECODE: \"JBIG2Decode\",\n ASCII85_DECODE: \"ASCII85Decode\",\n ASCII_HEX_DECODE: \"ASCIIHexDecode\",\n RUN_LENGTH_DECODE: \"RunLengthDecode\",\n CCITT_FAX_DECODE: \"CCITTFaxDecode\"\n };\n\n /**\n * IMAGE COMPRESSION TYPES\n */\n var image_compression = (jsPDFAPI.image_compression = {\n NONE: \"NONE\",\n FAST: \"FAST\",\n MEDIUM: \"MEDIUM\",\n SLOW: \"SLOW\"\n });\n\n /**\n * @name sHashCode\n * @function\n * @param {string} data\n * @returns {string}\n */\n var sHashCode = (jsPDFAPI.__addimage__.sHashCode = function(data) {\n var hash = 0,\n i,\n len;\n\n if (typeof data === \"string\") {\n len = data.length;\n for (i = 0; i < len; i++) {\n hash = (hash << 5) - hash + data.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n } else if (isArrayBufferView(data)) {\n len = data.byteLength / 2;\n for (i = 0; i < len; i++) {\n hash = (hash << 5) - hash + data[i];\n hash |= 0; // Convert to 32bit integer\n }\n }\n return hash;\n });\n\n /**\n * Validates if given String is a valid Base64-String\n *\n * @name validateStringAsBase64\n * @public\n * @function\n * @param {String} possible Base64-String\n *\n * @returns {boolean}\n */\n var validateStringAsBase64 = (jsPDFAPI.__addimage__.validateStringAsBase64 = function(\n possibleBase64String\n ) {\n possibleBase64String = possibleBase64String || \"\";\n possibleBase64String.toString().trim();\n\n var result = true;\n\n if (possibleBase64String.length === 0) {\n result = false;\n }\n\n if (possibleBase64String.length % 4 !== 0) {\n result = false;\n }\n\n if (\n /^[A-Za-z0-9+/]+$/.test(\n possibleBase64String.substr(0, possibleBase64String.length - 2)\n ) === false\n ) {\n result = false;\n }\n\n if (\n /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(\n possibleBase64String.substr(-2)\n ) === false\n ) {\n result = false;\n }\n return result;\n });\n\n /**\n * Strips out and returns info from a valid base64 data URI\n *\n * @name extractImageFromDataUrl\n * @function\n * @param {string} dataUrl a valid data URI of format 'data:[][;base64],'\n * @returns {Array}an Array containing the following\n * [0] the complete data URI\n * [1] \n * [2] format - the second part of the mime-type i.e 'png' in 'image/png'\n * [4] \n */\n var extractImageFromDataUrl = (jsPDFAPI.__addimage__.extractImageFromDataUrl = function(\n dataUrl\n ) {\n dataUrl = dataUrl || \"\";\n var dataUrlParts = dataUrl.split(\"base64,\");\n var result = null;\n\n if (dataUrlParts.length === 2) {\n var extractedInfo = /^data:(\\w*\\/\\w*);*(charset=(?!charset=)[\\w=-]*)*;*$/.exec(\n dataUrlParts[0]\n );\n if (Array.isArray(extractedInfo)) {\n result = {\n mimeType: extractedInfo[1],\n charset: extractedInfo[2],\n data: dataUrlParts[1]\n };\n }\n }\n return result;\n });\n\n /**\n * Check to see if ArrayBuffer is supported\n *\n * @name supportsArrayBuffer\n * @function\n * @returns {boolean}\n */\n var supportsArrayBuffer = (jsPDFAPI.__addimage__.supportsArrayBuffer = function() {\n return (\n typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\"\n );\n });\n\n /**\n * Tests supplied object to determine if ArrayBuffer\n *\n * @name isArrayBuffer\n * @function\n * @param {Object} object an Object\n *\n * @returns {boolean}\n */\n jsPDFAPI.__addimage__.isArrayBuffer = function(object) {\n return supportsArrayBuffer() && object instanceof ArrayBuffer;\n };\n\n /**\n * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface\n *\n * @name isArrayBufferView\n * @function\n * @param {Object} object an Object\n * @returns {boolean}\n */\n var isArrayBufferView = (jsPDFAPI.__addimage__.isArrayBufferView = function(\n object\n ) {\n return (\n supportsArrayBuffer() &&\n typeof Uint32Array !== \"undefined\" &&\n (object instanceof Int8Array ||\n object instanceof Uint8Array ||\n (typeof Uint8ClampedArray !== \"undefined\" &&\n object instanceof Uint8ClampedArray) ||\n object instanceof Int16Array ||\n object instanceof Uint16Array ||\n object instanceof Int32Array ||\n object instanceof Uint32Array ||\n object instanceof Float32Array ||\n object instanceof Float64Array)\n );\n });\n\n /**\n * Convert Binary String to ArrayBuffer\n *\n * @name binaryStringToUint8Array\n * @public\n * @function\n * @param {string} BinaryString with ImageData\n * @returns {Uint8Array}\n */\n var binaryStringToUint8Array = (jsPDFAPI.__addimage__.binaryStringToUint8Array = function(\n binary_string\n ) {\n var len = binary_string.length;\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes;\n });\n\n /**\n * Convert the Buffer to a Binary String\n *\n * @name arrayBufferToBinaryString\n * @public\n * @function\n * @param {ArrayBuffer|ArrayBufferView} ArrayBuffer buffer or bufferView with ImageData\n *\n * @returns {String}\n */\n var arrayBufferToBinaryString = (jsPDFAPI.__addimage__.arrayBufferToBinaryString = function(\n buffer\n ) {\n var out = \"\";\n // There are calls with both ArrayBuffer and already converted Uint8Array or other BufferView.\n // Do not copy the array if input is already an array.\n var buf = isArrayBufferView(buffer) ? buffer : new Uint8Array(buffer);\n for (var i = 0; i < buf.length; i += ARRAY_APPLY_BATCH) {\n // Limit the amount of characters being parsed to prevent overflow.\n // Note that while TextDecoder would be faster, it does not have the same\n // functionality as fromCharCode with any provided encodings as of 3/2021.\n out += String.fromCharCode.apply(\n null,\n buf.subarray(i, i + ARRAY_APPLY_BATCH)\n );\n }\n return out;\n });\n\n /**\n * Possible parameter for addImage, an RGBA buffer with size.\n *\n * @typedef {Object} RGBAData\n * @property {Uint8ClampedArray} data - Single dimensional array of RGBA values. For example from canvas getImageData.\n * @property {number} width - Image width as the data does not carry this information in itself.\n * @property {number} height - Image height as the data does not carry this information in itself.\n */\n\n /**\n * Adds an Image to the PDF.\n *\n * @name addImage\n * @public\n * @function\n * @param {string|HTMLImageElement|HTMLCanvasElement|Uint8Array|RGBAData} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement or object containing RGBA array (like output from canvas.getImageData).\n * @param {string} format format of file if filetype-recognition fails or in case of a Canvas-Element needs to be specified (default for Canvas is JPEG), e.g. 'JPEG', 'PNG', 'WEBP'\n * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page\n * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page\n * @param {number} width width of the image (in units declared at inception of PDF document)\n * @param {number} height height of the Image (in units declared at inception of PDF document)\n * @param {string} alias alias of the image (if used multiple times)\n * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'\n * @param {number} rotation rotation of the image in degrees (0-359)\n *\n * @returns jsPDF\n */\n jsPDFAPI.addImage = function() {\n var imageData, format, x, y, w, h, alias, compression, rotation;\n\n imageData = arguments[0];\n if (typeof arguments[1] === \"number\") {\n format = UNKNOWN;\n x = arguments[1];\n y = arguments[2];\n w = arguments[3];\n h = arguments[4];\n alias = arguments[5];\n compression = arguments[6];\n rotation = arguments[7];\n } else {\n format = arguments[1];\n x = arguments[2];\n y = arguments[3];\n w = arguments[4];\n h = arguments[5];\n alias = arguments[6];\n compression = arguments[7];\n rotation = arguments[8];\n }\n\n if (\n typeof imageData === \"object\" &&\n !isDOMElement(imageData) &&\n \"imageData\" in imageData\n ) {\n var options = imageData;\n\n imageData = options.imageData;\n format = options.format || format || UNKNOWN;\n x = options.x || x || 0;\n y = options.y || y || 0;\n w = options.w || options.width || w;\n h = options.h || options.height || h;\n alias = options.alias || alias;\n compression = options.compression || compression;\n rotation = options.rotation || options.angle || rotation;\n }\n\n //If compression is not explicitly set, determine if we should use compression\n var filter = this.internal.getFilters();\n if (compression === undefined && filter.indexOf(\"FlateEncode\") !== -1) {\n compression = \"SLOW\";\n }\n\n if (isNaN(x) || isNaN(y)) {\n throw new Error(\"Invalid coordinates passed to jsPDF.addImage\");\n }\n\n initialize.call(this);\n\n var image = processImageData.call(\n this,\n imageData,\n format,\n alias,\n compression\n );\n\n writeImageToPDF.call(this, x, y, w, h, image, rotation);\n\n return this;\n };\n\n var processImageData = function(imageData, format, alias, compression) {\n var result, dataAsBinaryString;\n\n if (\n typeof imageData === \"string\" &&\n getImageFileTypeByImageData(imageData) === UNKNOWN\n ) {\n imageData = unescape(imageData);\n var tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n if (tmpImageData !== \"\") {\n imageData = tmpImageData;\n } else {\n tmpImageData = jsPDFAPI.loadFile(imageData, true);\n if (tmpImageData !== undefined) {\n imageData = tmpImageData;\n }\n }\n }\n\n if (isDOMElement(imageData)) {\n imageData = getImageDataFromElement(imageData, format);\n }\n\n format = getImageFileTypeByImageData(imageData, format);\n if (!isImageTypeSupported(format)) {\n throw new Error(\n \"addImage does not support files of type '\" +\n format +\n \"', please ensure that a plugin for '\" +\n format +\n \"' support is added.\"\n );\n }\n\n // now do the heavy lifting\n\n if (notDefined(alias)) {\n alias = generateAliasFromImageData(imageData);\n }\n result = checkImagesForAlias.call(this, alias);\n\n if (!result) {\n if (supportsArrayBuffer()) {\n // no need to convert if imageData is already uint8array\n if (!(imageData instanceof Uint8Array) && format !== \"RGBA\") {\n dataAsBinaryString = imageData;\n imageData = binaryStringToUint8Array(imageData);\n }\n }\n\n result = this[\"process\" + format.toUpperCase()](\n imageData,\n getImageIndex.call(this),\n alias,\n checkCompressValue(compression),\n dataAsBinaryString\n );\n }\n\n if (!result) {\n throw new Error(\"An unknown error occurred whilst processing the image.\");\n }\n return result;\n };\n\n /**\n * @name convertBase64ToBinaryString\n * @function\n * @param {string} stringData\n * @returns {string} binary string\n */\n var convertBase64ToBinaryString = (jsPDFAPI.__addimage__.convertBase64ToBinaryString = function(\n stringData,\n throwError\n ) {\n throwError = typeof throwError === \"boolean\" ? throwError : true;\n var base64Info;\n var imageData = \"\";\n var rawData;\n\n if (typeof stringData === \"string\") {\n base64Info = extractImageFromDataUrl(stringData);\n rawData = base64Info !== null ? base64Info.data : stringData;\n\n try {\n imageData = atob(rawData);\n } catch (e) {\n if (throwError) {\n if (!validateStringAsBase64(rawData)) {\n throw new Error(\n \"Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString \"\n );\n } else {\n throw new Error(\n \"atob-Error in jsPDF.convertBase64ToBinaryString \" + e.message\n );\n }\n }\n }\n }\n return imageData;\n });\n\n /**\n * @name getImageProperties\n * @function\n * @param {Object} imageData\n * @returns {Object}\n */\n jsPDFAPI.getImageProperties = function(imageData) {\n var image;\n var tmpImageData = \"\";\n var format;\n\n if (isDOMElement(imageData)) {\n imageData = getImageDataFromElement(imageData);\n }\n\n if (\n typeof imageData === \"string\" &&\n getImageFileTypeByImageData(imageData) === UNKNOWN\n ) {\n tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n if (tmpImageData === \"\") {\n tmpImageData = jsPDFAPI.loadFile(imageData) || \"\";\n }\n imageData = tmpImageData;\n }\n\n format = getImageFileTypeByImageData(imageData);\n if (!isImageTypeSupported(format)) {\n throw new Error(\n \"addImage does not support files of type '\" +\n format +\n \"', please ensure that a plugin for '\" +\n format +\n \"' support is added.\"\n );\n }\n\n if (supportsArrayBuffer() && !(imageData instanceof Uint8Array)) {\n imageData = binaryStringToUint8Array(imageData);\n }\n\n image = this[\"process\" + format.toUpperCase()](imageData);\n\n if (!image) {\n throw new Error(\"An unknown error occurred whilst processing the image\");\n }\n\n image.fileType = format;\n\n return image;\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF Annotations PlugIn\n *\n * There are many types of annotations in a PDF document. Annotations are placed\n * on a page at a particular location. They are not 'attached' to an object.\n *
    \n * This plugin current supports
    \n *
  • Goto Page (set pageNumber and top in options)\n *
  • Goto Name (set name and top in options)\n *
  • Goto URL (set url in options)\n *

    \n * \tThe destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below)\n * (set magFactor in options). XYZ is the default.\n *

    \n *

    \n * Links, Text, Popup, and FreeText are supported.\n *

    \n *

    \n * Options In PDF spec Not Implemented Yet\n *

  • link border\n *
  • named target\n *
  • page coordinates\n *
  • destination page scaling and layout\n *
  • actions other than URL and GotoPage\n *
  • background / hover actions\n *

    \n * @name annotations\n * @module\n */\n\n/*\n Destination Magnification Factors\n See PDF 1.3 Page 386 for meanings and options\n\n [supported]\n\tXYZ (options; left top zoom)\n\tFit (no options)\n\tFitH (options: top)\n\tFitV (options: left)\n\n\t[not supported]\n\tFitR\n\tFitB\n\tFitBH\n\tFitBV\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n(function(jsPDFAPI) {\n \"use strict\";\n\n var notEmpty = function(obj) {\n if (typeof obj != \"undefined\") {\n if (obj != \"\") {\n return true;\n }\n }\n };\n\n jsPDF.API.events.push([\n \"addPage\",\n function(addPageData) {\n var pageInfo = this.internal.getPageInfo(addPageData.pageNumber);\n pageInfo.pageContext.annotations = [];\n }\n ]);\n\n jsPDFAPI.events.push([\n \"putPage\",\n function(putPageData) {\n var getHorizontalCoordinateString = this.internal.getCoordinateString;\n var getVerticalCoordinateString = this.internal\n .getVerticalCoordinateString;\n var pageInfo = this.internal.getPageInfoByObjId(putPageData.objId);\n var pageAnnos = putPageData.pageContext.annotations;\n\n var anno, rect, line;\n var found = false;\n for (var a = 0; a < pageAnnos.length && !found; a++) {\n anno = pageAnnos[a];\n switch (anno.type) {\n case \"link\":\n if (\n notEmpty(anno.options.url) ||\n notEmpty(anno.options.pageNumber)\n ) {\n found = true;\n }\n break;\n case \"reference\":\n case \"text\":\n case \"freetext\":\n found = true;\n break;\n }\n }\n if (found == false) {\n return;\n }\n\n this.internal.write(\"/Annots [\");\n for (var i = 0; i < pageAnnos.length; i++) {\n anno = pageAnnos[i];\n var escape = this.internal.pdfEscape;\n var encryptor = this.internal.getEncryptor(putPageData.objId);\n\n switch (anno.type) {\n case \"reference\":\n // References to Widget Annotations (for AcroForm Fields)\n this.internal.write(\" \" + anno.object.objId + \" 0 R \");\n break;\n case \"text\":\n // Create a an object for both the text and the popup\n var objText = this.internal.newAdditionalObject();\n var objPopup = this.internal.newAdditionalObject();\n var encryptorText = this.internal.getEncryptor(objText.objId);\n\n var title = anno.title || \"Note\";\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \" \" +\n getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \"] \";\n\n line =\n \"<>\";\n objText.content = line;\n\n var parent = objText.objId + \" 0 R\";\n var popoff = 30;\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x + popoff) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \" \" +\n getHorizontalCoordinateString(\n anno.bounds.x + anno.bounds.w + popoff\n ) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \"] \";\n line =\n \"<>\";\n objPopup.content = line;\n\n this.internal.write(objText.objId, \"0 R\", objPopup.objId, \"0 R\");\n\n break;\n case \"freetext\":\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \" \" +\n getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \"] \";\n var color = anno.color || \"#000000\";\n line =\n \"<>\";\n this.internal.write(line);\n break;\n case \"link\":\n if (anno.options.name) {\n var loc = this.annotations._nameMap[anno.options.name];\n anno.options.pageNumber = loc.page;\n anno.options.top = loc.y;\n } else {\n if (!anno.options.top) {\n anno.options.top = 0;\n }\n }\n\n rect =\n \"/Rect [\" +\n anno.finalBounds.x +\n \" \" +\n anno.finalBounds.y +\n \" \" +\n anno.finalBounds.w +\n \" \" +\n anno.finalBounds.h +\n \"] \";\n\n line = \"\";\n if (anno.options.url) {\n line =\n \"<>\";\n } else if (anno.options.pageNumber) {\n // first page is 0\n var info = this.internal.getPageInfo(anno.options.pageNumber);\n line =\n \"<>\";\n this.internal.write(line);\n }\n break;\n }\n }\n this.internal.write(\"]\");\n }\n ]);\n\n /**\n * @name createAnnotation\n * @function\n * @param {Object} options\n */\n jsPDFAPI.createAnnotation = function(options) {\n var pageInfo = this.internal.getCurrentPageInfo();\n switch (options.type) {\n case \"link\":\n this.link(\n options.bounds.x,\n options.bounds.y,\n options.bounds.w,\n options.bounds.h,\n options\n );\n break;\n case \"text\":\n case \"freetext\":\n pageInfo.pageContext.annotations.push(options);\n break;\n }\n };\n\n /**\n * Create a link\n *\n * valid options\n *
  • pageNumber or url [required]\n *

    If pageNumber is specified, top and zoom may also be specified

    \n * @name link\n * @function\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {Object} options\n */\n jsPDFAPI.link = function(x, y, w, h, options) {\n var pageInfo = this.internal.getCurrentPageInfo();\n var getHorizontalCoordinateString = this.internal.getCoordinateString;\n var getVerticalCoordinateString = this.internal.getVerticalCoordinateString;\n\n pageInfo.pageContext.annotations.push({\n finalBounds: {\n x: getHorizontalCoordinateString(x),\n y: getVerticalCoordinateString(y),\n w: getHorizontalCoordinateString(x + w),\n h: getVerticalCoordinateString(y + h)\n },\n options: options,\n type: \"link\"\n });\n };\n\n /**\n * Currently only supports single line text.\n * Returns the width of the text/link\n *\n * @name textWithLink\n * @function\n * @param {string} text\n * @param {number} x\n * @param {number} y\n * @param {Object} options\n * @returns {number} width the width of the text/link\n */\n jsPDFAPI.textWithLink = function(text, x, y, options) {\n var totalLineWidth = this.getTextWidth(text);\n var lineHeight = this.internal.getLineHeight() / this.internal.scaleFactor;\n var linkHeight, linkWidth;\n\n // Checking if maxWidth option is passed to determine lineWidth and number of lines for each line\n if (options.maxWidth !== undefined) {\n var { maxWidth } = options;\n linkWidth = maxWidth;\n var numOfLines = this.splitTextToSize(text, linkWidth).length;\n linkHeight = Math.ceil(lineHeight * numOfLines);\n } else {\n linkWidth = totalLineWidth;\n linkHeight = lineHeight;\n }\n\n this.text(text, x, y, options);\n\n //TODO We really need the text baseline height to do this correctly.\n // Or ability to draw text on top, bottom, center, or baseline.\n y += lineHeight * 0.2;\n //handle x position based on the align option\n if (options.align === \"center\") {\n x = x - totalLineWidth / 2; //since starting from center move the x position by half of text width\n }\n if (options.align === \"right\") {\n x = x - totalLineWidth;\n }\n this.link(x, y - lineHeight, linkWidth, linkHeight, options);\n return totalLineWidth;\n };\n\n //TODO move into external library\n /**\n * @name getTextWidth\n * @function\n * @param {string} text\n * @returns {number} txtWidth\n */\n jsPDFAPI.getTextWidth = function(text) {\n var fontSize = this.internal.getFontSize();\n var txtWidth =\n (this.getStringUnitWidth(text) * fontSize) / this.internal.scaleFactor;\n return txtWidth;\n };\n\n return this;\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2017 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF arabic parser PlugIn\n *\n * @name arabic\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * Arabic shape substitutions: char code => (isolated, final, initial, medial).\n * Arabic Substition A\n */\n var arabicSubstitionA = {\n 0x0621: [0xfe80], // ARABIC LETTER HAMZA\n 0x0622: [0xfe81, 0xfe82], // ARABIC LETTER ALEF WITH MADDA ABOVE\n 0x0623: [0xfe83, 0xfe84], // ARABIC LETTER ALEF WITH HAMZA ABOVE\n 0x0624: [0xfe85, 0xfe86], // ARABIC LETTER WAW WITH HAMZA ABOVE\n 0x0625: [0xfe87, 0xfe88], // ARABIC LETTER ALEF WITH HAMZA BELOW\n 0x0626: [0xfe89, 0xfe8a, 0xfe8b, 0xfe8c], // ARABIC LETTER YEH WITH HAMZA ABOVE\n 0x0627: [0xfe8d, 0xfe8e], // ARABIC LETTER ALEF\n 0x0628: [0xfe8f, 0xfe90, 0xfe91, 0xfe92], // ARABIC LETTER BEH\n 0x0629: [0xfe93, 0xfe94], // ARABIC LETTER TEH MARBUTA\n 0x062a: [0xfe95, 0xfe96, 0xfe97, 0xfe98], // ARABIC LETTER TEH\n 0x062b: [0xfe99, 0xfe9a, 0xfe9b, 0xfe9c], // ARABIC LETTER THEH\n 0x062c: [0xfe9d, 0xfe9e, 0xfe9f, 0xfea0], // ARABIC LETTER JEEM\n 0x062d: [0xfea1, 0xfea2, 0xfea3, 0xfea4], // ARABIC LETTER HAH\n 0x062e: [0xfea5, 0xfea6, 0xfea7, 0xfea8], // ARABIC LETTER KHAH\n 0x062f: [0xfea9, 0xfeaa], // ARABIC LETTER DAL\n 0x0630: [0xfeab, 0xfeac], // ARABIC LETTER THAL\n 0x0631: [0xfead, 0xfeae], // ARABIC LETTER REH\n 0x0632: [0xfeaf, 0xfeb0], // ARABIC LETTER ZAIN\n 0x0633: [0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4], // ARABIC LETTER SEEN\n 0x0634: [0xfeb5, 0xfeb6, 0xfeb7, 0xfeb8], // ARABIC LETTER SHEEN\n 0x0635: [0xfeb9, 0xfeba, 0xfebb, 0xfebc], // ARABIC LETTER SAD\n 0x0636: [0xfebd, 0xfebe, 0xfebf, 0xfec0], // ARABIC LETTER DAD\n 0x0637: [0xfec1, 0xfec2, 0xfec3, 0xfec4], // ARABIC LETTER TAH\n 0x0638: [0xfec5, 0xfec6, 0xfec7, 0xfec8], // ARABIC LETTER ZAH\n 0x0639: [0xfec9, 0xfeca, 0xfecb, 0xfecc], // ARABIC LETTER AIN\n 0x063a: [0xfecd, 0xfece, 0xfecf, 0xfed0], // ARABIC LETTER GHAIN\n 0x0641: [0xfed1, 0xfed2, 0xfed3, 0xfed4], // ARABIC LETTER FEH\n 0x0642: [0xfed5, 0xfed6, 0xfed7, 0xfed8], // ARABIC LETTER QAF\n 0x0643: [0xfed9, 0xfeda, 0xfedb, 0xfedc], // ARABIC LETTER KAF\n 0x0644: [0xfedd, 0xfede, 0xfedf, 0xfee0], // ARABIC LETTER LAM\n 0x0645: [0xfee1, 0xfee2, 0xfee3, 0xfee4], // ARABIC LETTER MEEM\n 0x0646: [0xfee5, 0xfee6, 0xfee7, 0xfee8], // ARABIC LETTER NOON\n 0x0647: [0xfee9, 0xfeea, 0xfeeb, 0xfeec], // ARABIC LETTER HEH\n 0x0648: [0xfeed, 0xfeee], // ARABIC LETTER WAW\n 0x0649: [0xfeef, 0xfef0, 64488, 64489], // ARABIC LETTER ALEF MAKSURA\n 0x064a: [0xfef1, 0xfef2, 0xfef3, 0xfef4], // ARABIC LETTER YEH\n 0x0671: [0xfb50, 0xfb51], // ARABIC LETTER ALEF WASLA\n 0x0677: [0xfbdd], // ARABIC LETTER U WITH HAMZA ABOVE\n 0x0679: [0xfb66, 0xfb67, 0xfb68, 0xfb69], // ARABIC LETTER TTEH\n 0x067a: [0xfb5e, 0xfb5f, 0xfb60, 0xfb61], // ARABIC LETTER TTEHEH\n 0x067b: [0xfb52, 0xfb53, 0xfb54, 0xfb55], // ARABIC LETTER BEEH\n 0x067e: [0xfb56, 0xfb57, 0xfb58, 0xfb59], // ARABIC LETTER PEH\n 0x067f: [0xfb62, 0xfb63, 0xfb64, 0xfb65], // ARABIC LETTER TEHEH\n 0x0680: [0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d], // ARABIC LETTER BEHEH\n 0x0683: [0xfb76, 0xfb77, 0xfb78, 0xfb79], // ARABIC LETTER NYEH\n 0x0684: [0xfb72, 0xfb73, 0xfb74, 0xfb75], // ARABIC LETTER DYEH\n 0x0686: [0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d], // ARABIC LETTER TCHEH\n 0x0687: [0xfb7e, 0xfb7f, 0xfb80, 0xfb81], // ARABIC LETTER TCHEHEH\n 0x0688: [0xfb88, 0xfb89], // ARABIC LETTER DDAL\n 0x068c: [0xfb84, 0xfb85], // ARABIC LETTER DAHAL\n 0x068d: [0xfb82, 0xfb83], // ARABIC LETTER DDAHAL\n 0x068e: [0xfb86, 0xfb87], // ARABIC LETTER DUL\n 0x0691: [0xfb8c, 0xfb8d], // ARABIC LETTER RREH\n 0x0698: [0xfb8a, 0xfb8b], // ARABIC LETTER JEH\n 0x06a4: [0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d], // ARABIC LETTER VEH\n 0x06a6: [0xfb6e, 0xfb6f, 0xfb70, 0xfb71], // ARABIC LETTER PEHEH\n 0x06a9: [0xfb8e, 0xfb8f, 0xfb90, 0xfb91], // ARABIC LETTER KEHEH\n 0x06ad: [0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6], // ARABIC LETTER NG\n 0x06af: [0xfb92, 0xfb93, 0xfb94, 0xfb95], // ARABIC LETTER GAF\n 0x06b1: [0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d], // ARABIC LETTER NGOEH\n 0x06b3: [0xfb96, 0xfb97, 0xfb98, 0xfb99], // ARABIC LETTER GUEH\n 0x06ba: [0xfb9e, 0xfb9f], // ARABIC LETTER NOON GHUNNA\n 0x06bb: [0xfba0, 0xfba1, 0xfba2, 0xfba3], // ARABIC LETTER RNOON\n 0x06be: [0xfbaa, 0xfbab, 0xfbac, 0xfbad], // ARABIC LETTER HEH DOACHASHMEE\n 0x06c0: [0xfba4, 0xfba5], // ARABIC LETTER HEH WITH YEH ABOVE\n 0x06c1: [0xfba6, 0xfba7, 0xfba8, 0xfba9], // ARABIC LETTER HEH GOAL\n 0x06c5: [0xfbe0, 0xfbe1], // ARABIC LETTER KIRGHIZ OE\n 0x06c6: [0xfbd9, 0xfbda], // ARABIC LETTER OE\n 0x06c7: [0xfbd7, 0xfbd8], // ARABIC LETTER U\n 0x06c8: [0xfbdb, 0xfbdc], // ARABIC LETTER YU\n 0x06c9: [0xfbe2, 0xfbe3], // ARABIC LETTER KIRGHIZ YU\n 0x06cb: [0xfbde, 0xfbdf], // ARABIC LETTER VE\n 0x06cc: [0xfbfc, 0xfbfd, 0xfbfe, 0xfbff], // ARABIC LETTER FARSI YEH\n 0x06d0: [0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7], //ARABIC LETTER E\n 0x06d2: [0xfbae, 0xfbaf], // ARABIC LETTER YEH BARREE\n 0x06d3: [0xfbb0, 0xfbb1] // ARABIC LETTER YEH BARREE WITH HAMZA ABOVE\n };\n\n /*\n var ligaturesSubstitutionA = {\n 0xFBEA: []// ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF ISOLATED FORM\n };\n */\n\n var ligatures = {\n 0xfedf: {\n 0xfe82: 0xfef5, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM\n 0xfe84: 0xfef7, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM\n 0xfe88: 0xfef9, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM\n 0xfe8e: 0xfefb // ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM\n },\n 0xfee0: {\n 0xfe82: 0xfef6, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM\n 0xfe84: 0xfef8, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM\n 0xfe88: 0xfefa, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM\n 0xfe8e: 0xfefc // ARABIC LIGATURE LAM WITH ALEF FINAL FORM\n },\n 0xfe8d: { 0xfedf: { 0xfee0: { 0xfeea: 0xfdf2 } } }, // ALLAH\n 0x0651: {\n 0x064c: 0xfc5e, // Shadda + Dammatan\n 0x064d: 0xfc5f, // Shadda + Kasratan\n 0x064e: 0xfc60, // Shadda + Fatha\n 0x064f: 0xfc61, // Shadda + Damma\n 0x0650: 0xfc62 // Shadda + Kasra\n }\n };\n\n var arabic_diacritics = {\n 1612: 64606, // Shadda + Dammatan\n 1613: 64607, // Shadda + Kasratan\n 1614: 64608, // Shadda + Fatha\n 1615: 64609, // Shadda + Damma\n 1616: 64610 // Shadda + Kasra\n };\n\n var alfletter = [1570, 1571, 1573, 1575];\n\n var noChangeInForm = -1;\n var isolatedForm = 0;\n var finalForm = 1;\n var initialForm = 2;\n var medialForm = 3;\n\n jsPDFAPI.__arabicParser__ = {};\n\n //private\n var isInArabicSubstitutionA = (jsPDFAPI.__arabicParser__.isInArabicSubstitutionA = function(\n letter\n ) {\n return typeof arabicSubstitionA[letter.charCodeAt(0)] !== \"undefined\";\n });\n\n var isArabicLetter = (jsPDFAPI.__arabicParser__.isArabicLetter = function(\n letter\n ) {\n return (\n typeof letter === \"string\" &&\n /^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(\n letter\n )\n );\n });\n\n var isArabicEndLetter = (jsPDFAPI.__arabicParser__.isArabicEndLetter = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length <= 2\n );\n });\n\n var isArabicAlfLetter = (jsPDFAPI.__arabicParser__.isArabicAlfLetter = function(\n letter\n ) {\n return (\n isArabicLetter(letter) && alfletter.indexOf(letter.charCodeAt(0)) >= 0\n );\n });\n\n jsPDFAPI.__arabicParser__.arabicLetterHasIsolatedForm = function(letter) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 1\n );\n };\n\n var arabicLetterHasFinalForm = (jsPDFAPI.__arabicParser__.arabicLetterHasFinalForm = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 2\n );\n });\n\n jsPDFAPI.__arabicParser__.arabicLetterHasInitialForm = function(letter) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 3\n );\n };\n\n var arabicLetterHasMedialForm = (jsPDFAPI.__arabicParser__.arabicLetterHasMedialForm = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length == 4\n );\n });\n\n var resolveLigatures = (jsPDFAPI.__arabicParser__.resolveLigatures = function(\n letters\n ) {\n var i = 0;\n var tmpLigatures = ligatures;\n var result = \"\";\n var effectedLetters = 0;\n\n for (i = 0; i < letters.length; i += 1) {\n if (typeof tmpLigatures[letters.charCodeAt(i)] !== \"undefined\") {\n effectedLetters++;\n tmpLigatures = tmpLigatures[letters.charCodeAt(i)];\n\n if (typeof tmpLigatures === \"number\") {\n result += String.fromCharCode(tmpLigatures);\n tmpLigatures = ligatures;\n effectedLetters = 0;\n }\n if (i === letters.length - 1) {\n tmpLigatures = ligatures;\n result += letters.charAt(i - (effectedLetters - 1));\n i = i - (effectedLetters - 1);\n effectedLetters = 0;\n }\n } else {\n tmpLigatures = ligatures;\n result += letters.charAt(i - effectedLetters);\n i = i - effectedLetters;\n effectedLetters = 0;\n }\n }\n\n return result;\n });\n\n jsPDFAPI.__arabicParser__.isArabicDiacritic = function(letter) {\n return (\n letter !== undefined &&\n arabic_diacritics[letter.charCodeAt(0)] !== undefined\n );\n };\n\n var getCorrectForm = (jsPDFAPI.__arabicParser__.getCorrectForm = function(\n currentChar,\n beforeChar,\n nextChar\n ) {\n if (!isArabicLetter(currentChar)) {\n return -1;\n }\n\n if (isInArabicSubstitutionA(currentChar) === false) {\n return noChangeInForm;\n }\n if (\n !arabicLetterHasFinalForm(currentChar) ||\n (!isArabicLetter(beforeChar) && !isArabicLetter(nextChar)) ||\n (!isArabicLetter(nextChar) && isArabicEndLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && !isArabicLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && isArabicAlfLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && isArabicEndLetter(beforeChar))\n ) {\n return isolatedForm;\n }\n\n if (\n arabicLetterHasMedialForm(currentChar) &&\n isArabicLetter(beforeChar) &&\n !isArabicEndLetter(beforeChar) &&\n isArabicLetter(nextChar) &&\n arabicLetterHasFinalForm(nextChar)\n ) {\n return medialForm;\n }\n\n if (isArabicEndLetter(currentChar) || !isArabicLetter(nextChar)) {\n return finalForm;\n }\n return initialForm;\n });\n\n /**\n * @name processArabic\n * @function\n * @param {string} text\n * @returns {string}\n */\n var parseArabic = function(text) {\n text = text || \"\";\n\n var result = \"\";\n var i = 0;\n var j = 0;\n var position = 0;\n var currentLetter = \"\";\n var prevLetter = \"\";\n var nextLetter = \"\";\n\n var words = text.split(\"\\\\s+\");\n var newWords = [];\n for (i = 0; i < words.length; i += 1) {\n newWords.push(\"\");\n for (j = 0; j < words[i].length; j += 1) {\n currentLetter = words[i][j];\n prevLetter = words[i][j - 1];\n nextLetter = words[i][j + 1];\n if (isArabicLetter(currentLetter)) {\n position = getCorrectForm(currentLetter, prevLetter, nextLetter);\n if (position !== -1) {\n newWords[i] += String.fromCharCode(\n arabicSubstitionA[currentLetter.charCodeAt(0)][position]\n );\n } else {\n newWords[i] += currentLetter;\n }\n } else {\n newWords[i] += currentLetter;\n }\n }\n\n newWords[i] = resolveLigatures(newWords[i]);\n }\n result = newWords.join(\" \");\n\n return result;\n };\n\n var processArabic = (jsPDFAPI.__arabicParser__.processArabic = jsPDFAPI.processArabic = function() {\n var text =\n typeof arguments[0] === \"string\" ? arguments[0] : arguments[0].text;\n var tmpText = [];\n var result;\n\n if (Array.isArray(text)) {\n var i = 0;\n tmpText = [];\n for (i = 0; i < text.length; i += 1) {\n if (Array.isArray(text[i])) {\n tmpText.push([parseArabic(text[i][0]), text[i][1], text[i][2]]);\n } else {\n tmpText.push([parseArabic(text[i])]);\n }\n }\n result = tmpText;\n } else {\n result = parseArabic(text);\n }\n if (typeof arguments[0] === \"string\") {\n return result;\n } else {\n arguments[0].text = result;\n return arguments[0];\n }\n });\n\n jsPDFAPI.events.push([\"preProcessText\", processArabic]);\n})(jsPDF.API);\n","/** @license\n * jsPDF Autoprint Plugin\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name autoprint\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * Makes the PDF automatically open the print-Dialog when opened in a PDF-viewer.\n *\n * @name autoPrint\n * @function\n * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer .\n * @returns {jsPDF}\n * @example\n * var doc = new jsPDF();\n * doc.text(10, 10, 'This is a test');\n * doc.autoPrint({variant: 'non-conform'});\n * doc.save('autoprint.pdf');\n */\n jsPDFAPI.autoPrint = function(options) {\n \"use strict\";\n var refAutoPrintTag;\n options = options || {};\n options.variant = options.variant || \"non-conform\";\n\n switch (options.variant) {\n case \"javascript\":\n //https://github.com/Rob--W/pdf.js/commit/c676ecb5a0f54677b9f3340c3ef2cf42225453bb\n this.addJS(\"print({});\");\n break;\n case \"non-conform\":\n default:\n this.internal.events.subscribe(\"postPutResources\", function() {\n refAutoPrintTag = this.internal.newObject();\n this.internal.out(\"<<\");\n this.internal.out(\"/S /Named\");\n this.internal.out(\"/Type /Action\");\n this.internal.out(\"/N /Print\");\n this.internal.out(\">>\");\n this.internal.out(\"endobj\");\n });\n\n this.internal.events.subscribe(\"putCatalog\", function() {\n this.internal.out(\"/OpenAction \" + refAutoPrintTag + \" 0 R\");\n });\n break;\n }\n return this;\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF Canvas PlugIn\n * This plugin mimics the HTML5 Canvas\n *\n * The goal is to provide a way for current canvas users to print directly to a PDF.\n * @name canvas\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * @class Canvas\n * @classdesc A Canvas Wrapper for jsPDF\n */\n var Canvas = function() {\n var jsPdfInstance = undefined;\n Object.defineProperty(this, \"pdf\", {\n get: function() {\n return jsPdfInstance;\n },\n set: function(value) {\n jsPdfInstance = value;\n }\n });\n\n var _width = 150;\n /**\n * The height property is a positive integer reflecting the height HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.\n * This is one of the two properties, the other being width, that controls the size of the canvas.\n *\n * @name width\n */\n Object.defineProperty(this, \"width\", {\n get: function() {\n return _width;\n },\n set: function(value) {\n if (isNaN(value) || Number.isInteger(value) === false || value < 0) {\n _width = 150;\n } else {\n _width = value;\n }\n if (this.getContext(\"2d\").pageWrapXEnabled) {\n this.getContext(\"2d\").pageWrapX = _width + 1;\n }\n }\n });\n\n var _height = 300;\n /**\n * The width property is a positive integer reflecting the width HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.\n * This is one of the two properties, the other being height, that controls the size of the canvas.\n *\n * @name height\n */\n Object.defineProperty(this, \"height\", {\n get: function() {\n return _height;\n },\n set: function(value) {\n if (isNaN(value) || Number.isInteger(value) === false || value < 0) {\n _height = 300;\n } else {\n _height = value;\n }\n if (this.getContext(\"2d\").pageWrapYEnabled) {\n this.getContext(\"2d\").pageWrapY = _height + 1;\n }\n }\n });\n\n var _childNodes = [];\n Object.defineProperty(this, \"childNodes\", {\n get: function() {\n return _childNodes;\n },\n set: function(value) {\n _childNodes = value;\n }\n });\n\n var _style = {};\n Object.defineProperty(this, \"style\", {\n get: function() {\n return _style;\n },\n set: function(value) {\n _style = value;\n }\n });\n\n Object.defineProperty(this, \"parentNode\", {});\n };\n\n /**\n * The getContext() method returns a drawing context on the canvas, or null if the context identifier is not supported.\n *\n * @name getContext\n * @function\n * @param {string} contextType Is a String containing the context identifier defining the drawing context associated to the canvas. Possible value is \"2d\", leading to the creation of a Context2D object representing a two-dimensional rendering context.\n * @param {object} contextAttributes\n */\n Canvas.prototype.getContext = function(contextType, contextAttributes) {\n contextType = contextType || \"2d\";\n var key;\n\n if (contextType !== \"2d\") {\n return null;\n }\n for (key in contextAttributes) {\n if (this.pdf.context2d.hasOwnProperty(key)) {\n this.pdf.context2d[key] = contextAttributes[key];\n }\n }\n this.pdf.context2d._canvas = this;\n return this.pdf.context2d;\n };\n\n /**\n * The toDataURL() method is just a stub to throw an error if accidently called.\n *\n * @name toDataURL\n * @function\n */\n Canvas.prototype.toDataURL = function() {\n throw new Error(\"toDataURL is not implemented.\");\n };\n\n jsPDFAPI.events.push([\n \"initialized\",\n function() {\n this.canvas = new Canvas();\n this.canvas.pdf = this;\n }\n ]);\n\n return this;\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n * 2013 Lee Driscoll, https://github.com/lsdriscoll\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 James Hall, james@parall.ax\n * 2014 Diego Casorran, https://github.com/diegocr\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name cell\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n var NO_MARGINS = { left: 0, top: 0, bottom: 0, right: 0 };\n\n var px2pt = (0.264583 * 72) / 25.4;\n var printingHeaderRow = false;\n\n var _initialize = function() {\n if (typeof this.internal.__cell__ === \"undefined\") {\n this.internal.__cell__ = {};\n this.internal.__cell__.padding = 3;\n this.internal.__cell__.headerFunction = undefined;\n this.internal.__cell__.margins = Object.assign({}, NO_MARGINS);\n this.internal.__cell__.margins.width = this.getPageWidth();\n _reset.call(this);\n }\n };\n\n var _reset = function() {\n this.internal.__cell__.lastCell = new Cell();\n this.internal.__cell__.pages = 1;\n };\n\n var Cell = function() {\n var _x = arguments[0];\n Object.defineProperty(this, \"x\", {\n enumerable: true,\n get: function() {\n return _x;\n },\n set: function(value) {\n _x = value;\n }\n });\n var _y = arguments[1];\n Object.defineProperty(this, \"y\", {\n enumerable: true,\n get: function() {\n return _y;\n },\n set: function(value) {\n _y = value;\n }\n });\n var _width = arguments[2];\n Object.defineProperty(this, \"width\", {\n enumerable: true,\n get: function() {\n return _width;\n },\n set: function(value) {\n _width = value;\n }\n });\n var _height = arguments[3];\n Object.defineProperty(this, \"height\", {\n enumerable: true,\n get: function() {\n return _height;\n },\n set: function(value) {\n _height = value;\n }\n });\n var _text = arguments[4];\n Object.defineProperty(this, \"text\", {\n enumerable: true,\n get: function() {\n return _text;\n },\n set: function(value) {\n _text = value;\n }\n });\n var _lineNumber = arguments[5];\n Object.defineProperty(this, \"lineNumber\", {\n enumerable: true,\n get: function() {\n return _lineNumber;\n },\n set: function(value) {\n _lineNumber = value;\n }\n });\n var _align = arguments[6];\n Object.defineProperty(this, \"align\", {\n enumerable: true,\n get: function() {\n return _align;\n },\n set: function(value) {\n _align = value;\n }\n });\n\n return this;\n };\n\n Cell.prototype.clone = function() {\n return new Cell(\n this.x,\n this.y,\n this.width,\n this.height,\n this.text,\n this.lineNumber,\n this.align\n );\n };\n\n Cell.prototype.toArray = function() {\n return [\n this.x,\n this.y,\n this.width,\n this.height,\n this.text,\n this.lineNumber,\n this.align\n ];\n };\n\n /**\n * @name setHeaderFunction\n * @function\n * @param {function} func\n */\n jsPDFAPI.setHeaderFunction = function(func) {\n _initialize.call(this);\n this.internal.__cell__.headerFunction =\n typeof func === \"function\" ? func : undefined;\n return this;\n };\n\n /**\n * @name getTextDimensions\n * @function\n * @param {string} txt\n * @returns {Object} dimensions\n */\n jsPDFAPI.getTextDimensions = function(text, options) {\n _initialize.call(this);\n options = options || {};\n var fontSize = options.fontSize || this.getFontSize();\n var font = options.font || this.getFont();\n var scaleFactor = options.scaleFactor || this.internal.scaleFactor;\n var width = 0;\n var amountOfLines = 0;\n var height = 0;\n var tempWidth = 0;\n var scope = this;\n\n if (!Array.isArray(text) && typeof text !== \"string\") {\n if (typeof text === \"number\") {\n text = String(text);\n } else {\n throw new Error(\n \"getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.\"\n );\n }\n }\n\n const maxWidth = options.maxWidth;\n if (maxWidth > 0) {\n if (typeof text === \"string\") {\n text = this.splitTextToSize(text, maxWidth);\n } else if (Object.prototype.toString.call(text) === \"[object Array]\") {\n text = text.reduce(function(acc, textLine) {\n return acc.concat(scope.splitTextToSize(textLine, maxWidth));\n }, []);\n }\n } else {\n // Without the else clause, it will not work if you do not pass along maxWidth\n text = Array.isArray(text) ? text : [text];\n }\n\n for (var i = 0; i < text.length; i++) {\n tempWidth = this.getStringUnitWidth(text[i], { font: font }) * fontSize;\n if (width < tempWidth) {\n width = tempWidth;\n }\n }\n\n if (width !== 0) {\n amountOfLines = text.length;\n }\n\n width = width / scaleFactor;\n height = Math.max(\n (amountOfLines * fontSize * this.getLineHeightFactor() -\n fontSize * (this.getLineHeightFactor() - 1)) /\n scaleFactor,\n 0\n );\n return { w: width, h: height };\n };\n\n /**\n * @name cellAddPage\n * @function\n */\n jsPDFAPI.cellAddPage = function() {\n _initialize.call(this);\n\n this.addPage();\n\n var margins = this.internal.__cell__.margins || NO_MARGINS;\n this.internal.__cell__.lastCell = new Cell(\n margins.left,\n margins.top,\n undefined,\n undefined\n );\n this.internal.__cell__.pages += 1;\n\n return this;\n };\n\n /**\n * @name cell\n * @function\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {string} text\n * @param {number} lineNumber lineNumber\n * @param {string} align\n * @return {jsPDF} jsPDF-instance\n */\n var cell = (jsPDFAPI.cell = function() {\n var currentCell;\n\n if (arguments[0] instanceof Cell) {\n currentCell = arguments[0];\n } else {\n currentCell = new Cell(\n arguments[0],\n arguments[1],\n arguments[2],\n arguments[3],\n arguments[4],\n arguments[5]\n );\n }\n _initialize.call(this);\n var lastCell = this.internal.__cell__.lastCell;\n var padding = this.internal.__cell__.padding;\n var margins = this.internal.__cell__.margins || NO_MARGINS;\n var tableHeaderRow = this.internal.__cell__.tableHeaderRow;\n var printHeaders = this.internal.__cell__.printHeaders;\n // If this is not the first cell, we must change its position\n if (typeof lastCell.lineNumber !== \"undefined\") {\n if (lastCell.lineNumber === currentCell.lineNumber) {\n //Same line\n currentCell.x = (lastCell.x || 0) + (lastCell.width || 0);\n currentCell.y = lastCell.y || 0;\n } else {\n //New line\n if (\n lastCell.y + lastCell.height + currentCell.height + margins.bottom >\n this.getPageHeight()\n ) {\n this.cellAddPage();\n currentCell.y = margins.top;\n if (printHeaders && tableHeaderRow) {\n this.printHeaderRow(currentCell.lineNumber, true);\n currentCell.y += tableHeaderRow[0].height;\n }\n } else {\n currentCell.y = lastCell.y + lastCell.height || currentCell.y;\n }\n }\n }\n\n if (typeof currentCell.text[0] !== \"undefined\") {\n this.rect(\n currentCell.x,\n currentCell.y,\n currentCell.width,\n currentCell.height,\n printingHeaderRow === true ? \"FD\" : undefined\n );\n if (currentCell.align === \"right\") {\n this.text(\n currentCell.text,\n currentCell.x + currentCell.width - padding,\n currentCell.y + padding,\n { align: \"right\", baseline: \"top\" }\n );\n } else if (currentCell.align === \"center\") {\n this.text(\n currentCell.text,\n currentCell.x + currentCell.width / 2,\n currentCell.y + padding,\n {\n align: \"center\",\n baseline: \"top\",\n maxWidth: currentCell.width - padding - padding\n }\n );\n } else {\n this.text(\n currentCell.text,\n currentCell.x + padding,\n currentCell.y + padding,\n {\n align: \"left\",\n baseline: \"top\",\n maxWidth: currentCell.width - padding - padding\n }\n );\n }\n }\n this.internal.__cell__.lastCell = currentCell;\n return this;\n });\n\n /**\n * Create a table from a set of data.\n * @name table\n * @function\n * @param {Integer} [x] : left-position for top-left corner of table\n * @param {Integer} [y] top-position for top-left corner of table\n * @param {Object[]} [data] An array of objects containing key-value pairs corresponding to a row of data.\n * @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost\n\n * @param {Object} [config.printHeaders] True to print column headers at the top of every page\n * @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value\n * @param {Object} [config.margins] margin values for left, top, bottom, and width\n * @param {Object} [config.fontSize] Integer fontSize to use (optional)\n * @param {Object} [config.padding] cell-padding in pt to use (optional)\n * @param {Object} [config.headerBackgroundColor] default is #c8c8c8 (optional)\n * @param {Object} [config.headerTextColor] default is #000 (optional)\n * @param {Object} [config.rowStart] callback to handle before print each row (optional)\n * @param {Object} [config.cellStart] callback to handle before print each cell (optional)\n * @returns {jsPDF} jsPDF-instance\n */\n\n jsPDFAPI.table = function(x, y, data, headers, config) {\n _initialize.call(this);\n if (!data) {\n throw new Error(\"No data for PDF table.\");\n }\n\n config = config || {};\n\n var headerNames = [],\n headerLabels = [],\n headerAligns = [],\n i,\n columnMatrix = {},\n columnWidths = {},\n column,\n columnMinWidths = [],\n j,\n tableHeaderConfigs = [],\n //set up defaults. If a value is provided in config, defaults will be overwritten:\n autoSize = config.autoSize || false,\n printHeaders = config.printHeaders === false ? false : true,\n fontSize =\n config.css && typeof config.css[\"font-size\"] !== \"undefined\"\n ? config.css[\"font-size\"] * 16\n : config.fontSize || 12,\n margins =\n config.margins ||\n Object.assign({ width: this.getPageWidth() }, NO_MARGINS),\n padding = typeof config.padding === \"number\" ? config.padding : 3,\n headerBackgroundColor = config.headerBackgroundColor || \"#c8c8c8\",\n headerTextColor = config.headerTextColor || \"#000\";\n\n _reset.call(this);\n\n this.internal.__cell__.printHeaders = printHeaders;\n this.internal.__cell__.margins = margins;\n this.internal.__cell__.table_font_size = fontSize;\n this.internal.__cell__.padding = padding;\n this.internal.__cell__.headerBackgroundColor = headerBackgroundColor;\n this.internal.__cell__.headerTextColor = headerTextColor;\n this.setFontSize(fontSize);\n\n // Set header values\n if (headers === undefined || headers === null) {\n // No headers defined so we derive from data\n headerNames = Object.keys(data[0]);\n headerLabels = headerNames;\n headerAligns = headerNames.map(function() {\n return \"left\";\n });\n } else if (Array.isArray(headers) && typeof headers[0] === \"object\") {\n headerNames = headers.map(function(header) {\n return header.name;\n });\n headerLabels = headers.map(function(header) {\n return header.prompt || header.name || \"\";\n });\n headerAligns = headers.map(function(header) {\n return header.align || \"left\";\n });\n // Split header configs into names and prompts\n for (i = 0; i < headers.length; i += 1) {\n columnWidths[headers[i].name] = headers[i].width * px2pt;\n }\n } else if (Array.isArray(headers) && typeof headers[0] === \"string\") {\n headerNames = headers;\n headerLabels = headerNames;\n headerAligns = headerNames.map(function() {\n return \"left\";\n });\n }\n\n if (\n autoSize ||\n (Array.isArray(headers) && typeof headers[0] === \"string\")\n ) {\n var headerName;\n for (i = 0; i < headerNames.length; i += 1) {\n headerName = headerNames[i];\n\n // Create a matrix of columns e.g., {column_title: [row1_Record, row2_Record]}\n\n columnMatrix[headerName] = data.map(function(rec) {\n return rec[headerName];\n });\n\n // get header width\n this.setFont(undefined, \"bold\");\n columnMinWidths.push(\n this.getTextDimensions(headerLabels[i], {\n fontSize: this.internal.__cell__.table_font_size,\n scaleFactor: this.internal.scaleFactor\n }).w\n );\n column = columnMatrix[headerName];\n\n // get cell widths\n this.setFont(undefined, \"normal\");\n for (j = 0; j < column.length; j += 1) {\n columnMinWidths.push(\n this.getTextDimensions(column[j], {\n fontSize: this.internal.__cell__.table_font_size,\n scaleFactor: this.internal.scaleFactor\n }).w\n );\n }\n\n // get final column width\n columnWidths[headerName] =\n Math.max.apply(null, columnMinWidths) + padding + padding;\n\n //have to reset\n columnMinWidths = [];\n }\n }\n\n // -- Construct the table\n\n if (printHeaders) {\n var row = {};\n for (i = 0; i < headerNames.length; i += 1) {\n row[headerNames[i]] = {};\n row[headerNames[i]].text = headerLabels[i];\n row[headerNames[i]].align = headerAligns[i];\n }\n\n var rowHeight = calculateLineHeight.call(this, row, columnWidths);\n\n // Construct the header row\n tableHeaderConfigs = headerNames.map(function(value) {\n return new Cell(\n x,\n y,\n columnWidths[value],\n rowHeight,\n row[value].text,\n undefined,\n row[value].align\n );\n });\n\n // Store the table header config\n this.setTableHeaderRow(tableHeaderConfigs);\n\n // Print the header for the start of the table\n this.printHeaderRow(1, false);\n }\n\n // Construct the data rows\n\n var align = headers.reduce(function(pv, cv) {\n pv[cv.name] = cv.align;\n return pv;\n }, {});\n for (i = 0; i < data.length; i += 1) {\n if (\"rowStart\" in config && config.rowStart instanceof Function) {\n config.rowStart(\n {\n row: i,\n data: data[i]\n },\n this\n );\n }\n var lineHeight = calculateLineHeight.call(this, data[i], columnWidths);\n\n for (j = 0; j < headerNames.length; j += 1) {\n var cellData = data[i][headerNames[j]];\n if (\"cellStart\" in config && config.cellStart instanceof Function) {\n config.cellStart(\n {\n row: i,\n col: j,\n data: cellData\n },\n this\n );\n }\n cell.call(\n this,\n new Cell(\n x,\n y,\n columnWidths[headerNames[j]],\n lineHeight,\n cellData,\n i + 2,\n align[headerNames[j]]\n )\n );\n }\n }\n this.internal.__cell__.table_x = x;\n this.internal.__cell__.table_y = y;\n return this;\n };\n\n /**\n * Calculate the height for containing the highest column\n *\n * @name calculateLineHeight\n * @function\n * @param {Object[]} model is the line of data we want to calculate the height of\n * @param {Integer[]} columnWidths is size of each column\n * @returns {number} lineHeight\n * @private\n */\n var calculateLineHeight = function calculateLineHeight(model, columnWidths) {\n var padding = this.internal.__cell__.padding;\n var fontSize = this.internal.__cell__.table_font_size;\n var scaleFactor = this.internal.scaleFactor;\n\n return Object.keys(model)\n .map(function(key) {\n var value = model[key];\n return this.splitTextToSize(\n value.hasOwnProperty(\"text\") ? value.text : value,\n columnWidths[key] - padding - padding\n );\n }, this)\n .map(function(value) {\n return (\n (this.getLineHeightFactor() * value.length * fontSize) / scaleFactor +\n padding +\n padding\n );\n }, this)\n .reduce(function(pv, cv) {\n return Math.max(pv, cv);\n }, 0);\n };\n\n /**\n * Store the config for outputting a table header\n *\n * @name setTableHeaderRow\n * @function\n * @param {Object[]} config\n * An array of cell configs that would define a header row: Each config matches the config used by jsPDFAPI.cell\n * except the lineNumber parameter is excluded\n */\n jsPDFAPI.setTableHeaderRow = function(config) {\n _initialize.call(this);\n this.internal.__cell__.tableHeaderRow = config;\n };\n\n /**\n * Output the store header row\n *\n * @name printHeaderRow\n * @function\n * @param {number} lineNumber The line number to output the header at\n * @param {boolean} new_page\n */\n jsPDFAPI.printHeaderRow = function(lineNumber, new_page) {\n _initialize.call(this);\n if (!this.internal.__cell__.tableHeaderRow) {\n throw new Error(\"Property tableHeaderRow does not exist.\");\n }\n\n var tableHeaderCell;\n\n printingHeaderRow = true;\n if (typeof this.internal.__cell__.headerFunction === \"function\") {\n var position = this.internal.__cell__.headerFunction(\n this,\n this.internal.__cell__.pages\n );\n this.internal.__cell__.lastCell = new Cell(\n position[0],\n position[1],\n position[2],\n position[3],\n undefined,\n -1\n );\n }\n this.setFont(undefined, \"bold\");\n\n var tempHeaderConf = [];\n for (var i = 0; i < this.internal.__cell__.tableHeaderRow.length; i += 1) {\n tableHeaderCell = this.internal.__cell__.tableHeaderRow[i].clone();\n if (new_page) {\n tableHeaderCell.y = this.internal.__cell__.margins.top || 0;\n tempHeaderConf.push(tableHeaderCell);\n }\n tableHeaderCell.lineNumber = lineNumber;\n var currentTextColor = this.getTextColor();\n this.setTextColor(this.internal.__cell__.headerTextColor);\n this.setFillColor(this.internal.__cell__.headerBackgroundColor);\n cell.call(this, tableHeaderCell);\n this.setTextColor(currentTextColor);\n }\n if (tempHeaderConf.length > 0) {\n this.setTableHeaderRow(tempHeaderConf);\n }\n this.setFont(undefined, \"normal\");\n printingHeaderRow = false;\n };\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF JavaScript plugin\n *\n * @name javascript\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n var jsNamesObj, jsJsObj, text;\n /**\n * @name addJS\n * @function\n * @param {string} javascript The javascript to be embedded into the PDF-file.\n * @returns {jsPDF}\n */\n jsPDFAPI.addJS = function(javascript) {\n text = javascript;\n this.internal.events.subscribe(\"postPutResources\", function() {\n jsNamesObj = this.internal.newObject();\n this.internal.out(\"<<\");\n this.internal.out(\"/Names [(EmbeddedJS) \" + (jsNamesObj + 1) + \" 0 R]\");\n this.internal.out(\">>\");\n this.internal.out(\"endobj\");\n\n jsJsObj = this.internal.newObject();\n this.internal.out(\"<<\");\n this.internal.out(\"/S /JavaScript\");\n this.internal.out(\"/JS (\" + text + \")\");\n this.internal.out(\">>\");\n this.internal.out(\"endobj\");\n });\n this.internal.events.subscribe(\"putCatalog\", function() {\n if (jsNamesObj !== undefined && jsJsObj !== undefined) {\n this.internal.out(\"/Names <>\");\n }\n });\n return this;\n };\n})(jsPDF.API);\n","/**\n * @license\n * jsPDF fileloading PlugIn\n * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name fileloading\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * @name loadFile\n * @function\n * @param {string} url\n * @param {boolean} sync\n * @param {function} callback\n * @returns {string|undefined} result\n */\n jsPDFAPI.loadFile = function(url, sync, callback) {\n return browserRequest(url, sync, callback);\n\n };\n\n /**\n * @name loadImageFile\n * @function\n * @param {string} path\n * @param {boolean} sync\n * @param {function} callback\n */\n jsPDFAPI.loadImageFile = jsPDFAPI.loadFile;\n\n function browserRequest(url, sync, callback) {\n sync = sync === false ? false : true;\n callback = typeof callback === \"function\" ? callback : function() {};\n var result = undefined;\n\n var xhr = function(url, sync, callback) {\n var request = new XMLHttpRequest();\n var i = 0;\n\n var sanitizeUnicode = function(data) {\n var dataLength = data.length;\n var charArray = [];\n var StringFromCharCode = String.fromCharCode;\n\n //Transform Unicode to ASCII\n for (i = 0; i < dataLength; i += 1) {\n charArray.push(StringFromCharCode(data.charCodeAt(i) & 0xff));\n }\n return charArray.join(\"\");\n };\n\n request.open(\"GET\", url, !sync);\n // XHR binary charset opt by Marcus Granado 2006 [http://mgran.blogspot.com]\n request.overrideMimeType(\"text/plain; charset=x-user-defined\");\n\n if (sync === false) {\n request.onload = function() {\n if (request.status === 200) {\n callback(sanitizeUnicode(this.responseText));\n } else {\n callback(undefined);\n }\n };\n }\n request.send(null);\n\n if (sync && request.status === 200) {\n return sanitizeUnicode(request.responseText);\n }\n };\n try {\n result = xhr(url, sync, callback);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n return result;\n }\n\n function nodeReadFile(url, sync, callback) {\n sync = sync === false ? false : true;\n var result = undefined;\n\n var fs = require(\"fs\");\n var path = require(\"path\");\n\n url = path.resolve(url);\n if (sync) {\n try {\n result = fs.readFileSync(url, { encoding: \"latin1\" });\n } catch (e) {\n return undefined;\n }\n } else {\n fs.readFile(url, { encoding: \"latin1\" }, function(err, data) {\n if (!callback) {\n return;\n }\n if (err) {\n callback(undefined);\n }\n callback(data);\n });\n }\n\n return result;\n }\n})(jsPDF.API);\n","/* eslint-disable no-fallthrough */\r\n/* eslint-disable no-console */\r\n/**\r\n * @license\r\n * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\r\n *\r\n * Licensed under the MIT License. http://opensource.org/licenses/mit-license\r\n */\r\n\r\nimport { jsPDF } from \"../jspdf.js\";\r\nimport { RGBColor } from \"../libs/rgbcolor.js\";\r\nimport { console } from \"../libs/console.js\";\r\nimport {\r\n buildFontFaceMap,\r\n parseFontFamily,\r\n resolveFontFace\r\n} from \"../libs/fontFace.js\";\r\n\r\n/**\r\n * This plugin mimics the HTML5 CanvasRenderingContext2D.\r\n *\r\n * The goal is to provide a way for current canvas implementations to print directly to a PDF.\r\n *\r\n * @name context2d\r\n * @module\r\n */\r\n(function(jsPDFAPI) {\r\n \"use strict\";\r\n var ContextLayer = function(ctx) {\r\n ctx = ctx || {};\r\n this.isStrokeTransparent = ctx.isStrokeTransparent || false;\r\n this.strokeOpacity = ctx.strokeOpacity || 1;\r\n this.strokeStyle = ctx.strokeStyle || \"#000000\";\r\n this.fillStyle = ctx.fillStyle || \"#000000\";\r\n this.isFillTransparent = ctx.isFillTransparent || false;\r\n this.fillOpacity = ctx.fillOpacity || 1;\r\n this.font = ctx.font || \"10px sans-serif\";\r\n this.textBaseline = ctx.textBaseline || \"alphabetic\";\r\n this.textAlign = ctx.textAlign || \"left\";\r\n this.lineWidth = ctx.lineWidth || 1;\r\n this.lineJoin = ctx.lineJoin || \"miter\";\r\n this.lineCap = ctx.lineCap || \"butt\";\r\n this.path = ctx.path || [];\r\n this.transform =\r\n typeof ctx.transform !== \"undefined\"\r\n ? ctx.transform.clone()\r\n : new Matrix();\r\n this.globalCompositeOperation = ctx.globalCompositeOperation || \"normal\";\r\n this.globalAlpha = ctx.globalAlpha || 1.0;\r\n this.clip_path = ctx.clip_path || [];\r\n this.currentPoint = ctx.currentPoint || new Point();\r\n this.miterLimit = ctx.miterLimit || 10.0;\r\n this.lastPoint = ctx.lastPoint || new Point();\r\n this.lineDashOffset = ctx.lineDashOffset || 0.0;\r\n this.lineDash = ctx.lineDash || [];\r\n this.margin = ctx.margin || [0, 0, 0, 0];\r\n this.prevPageLastElemOffset = ctx.prevPageLastElemOffset || 0;\r\n\r\n this.ignoreClearRect =\r\n typeof ctx.ignoreClearRect === \"boolean\" ? ctx.ignoreClearRect : true;\r\n return this;\r\n };\r\n\r\n //stub\r\n var f2,\r\n getHorizontalCoordinateString,\r\n getVerticalCoordinateString,\r\n getHorizontalCoordinate,\r\n getVerticalCoordinate,\r\n Point,\r\n Rectangle,\r\n Matrix,\r\n _ctx;\r\n jsPDFAPI.events.push([\r\n \"initialized\",\r\n function() {\r\n this.context2d = new Context2D(this);\r\n\r\n f2 = this.internal.f2;\r\n getHorizontalCoordinateString = this.internal.getCoordinateString;\r\n getVerticalCoordinateString = this.internal.getVerticalCoordinateString;\r\n getHorizontalCoordinate = this.internal.getHorizontalCoordinate;\r\n getVerticalCoordinate = this.internal.getVerticalCoordinate;\r\n Point = this.internal.Point;\r\n Rectangle = this.internal.Rectangle;\r\n Matrix = this.internal.Matrix;\r\n _ctx = new ContextLayer();\r\n }\r\n ]);\r\n\r\n var Context2D = function(pdf) {\r\n Object.defineProperty(this, \"canvas\", {\r\n get: function() {\r\n return { parentNode: false, style: false };\r\n }\r\n });\r\n\r\n var _pdf = pdf;\r\n Object.defineProperty(this, \"pdf\", {\r\n get: function() {\r\n return _pdf;\r\n }\r\n });\r\n\r\n var _pageWrapXEnabled = false;\r\n /**\r\n * @name pageWrapXEnabled\r\n * @type {boolean}\r\n * @default false\r\n */\r\n Object.defineProperty(this, \"pageWrapXEnabled\", {\r\n get: function() {\r\n return _pageWrapXEnabled;\r\n },\r\n set: function(value) {\r\n _pageWrapXEnabled = Boolean(value);\r\n }\r\n });\r\n\r\n var _pageWrapYEnabled = false;\r\n /**\r\n * @name pageWrapYEnabled\r\n * @type {boolean}\r\n * @default true\r\n */\r\n Object.defineProperty(this, \"pageWrapYEnabled\", {\r\n get: function() {\r\n return _pageWrapYEnabled;\r\n },\r\n set: function(value) {\r\n _pageWrapYEnabled = Boolean(value);\r\n }\r\n });\r\n\r\n var _posX = 0;\r\n /**\r\n * @name posX\r\n * @type {number}\r\n * @default 0\r\n */\r\n Object.defineProperty(this, \"posX\", {\r\n get: function() {\r\n return _posX;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _posX = value;\r\n }\r\n }\r\n });\r\n\r\n var _posY = 0;\r\n /**\r\n * @name posY\r\n * @type {number}\r\n * @default 0\r\n */\r\n Object.defineProperty(this, \"posY\", {\r\n get: function() {\r\n return _posY;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n _posY = value;\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Gets or sets the page margin when using auto paging. Has no effect when {@link autoPaging} is off.\r\n * @name margin\r\n * @type {number|number[]}\r\n * @default [0, 0, 0, 0]\r\n */\r\n Object.defineProperty(this, \"margin\", {\r\n get: function() {\r\n return _ctx.margin;\r\n },\r\n set: function(value) {\r\n var margin;\r\n if (typeof value === \"number\") {\r\n margin = [value, value, value, value];\r\n } else {\r\n margin = new Array(4);\r\n margin[0] = value[0];\r\n margin[1] = value.length >= 2 ? value[1] : margin[0];\r\n margin[2] = value.length >= 3 ? value[2] : margin[0];\r\n margin[3] = value.length >= 4 ? value[3] : margin[1];\r\n }\r\n _ctx.margin = margin;\r\n }\r\n });\r\n\r\n var _autoPaging = false;\r\n /**\r\n * Gets or sets the auto paging mode. When auto paging is enabled, the context2d will automatically draw on the\r\n * next page if a shape or text chunk doesn't fit entirely on the current page. The context2d will create new\r\n * pages if required.\r\n *\r\n * Context2d supports different modes:\r\n *
      \r\n *
    • \r\n * false: Auto paging is disabled.\r\n *
    • \r\n *
    • \r\n * true or 'slice': Will cut shapes or text chunks across page breaks. Will possibly\r\n * slice text in half, making it difficult to read.\r\n *
    • \r\n *
    • \r\n * 'text': Trys not to cut text in half across page breaks. Works best for documents consisting\r\n * mostly of a single column of text.\r\n *
    • \r\n *
    \r\n * @name Context2D#autoPaging\r\n * @type {boolean|\"slice\"|\"text\"}\r\n * @default false\r\n */\r\n Object.defineProperty(this, \"autoPaging\", {\r\n get: function() {\r\n return _autoPaging;\r\n },\r\n set: function(value) {\r\n _autoPaging = value;\r\n }\r\n });\r\n\r\n var lastBreak = 0;\r\n /**\r\n * @name lastBreak\r\n * @type {number}\r\n * @default 0\r\n */\r\n Object.defineProperty(this, \"lastBreak\", {\r\n get: function() {\r\n return lastBreak;\r\n },\r\n set: function(value) {\r\n lastBreak = value;\r\n }\r\n });\r\n\r\n var pageBreaks = [];\r\n /**\r\n * Y Position of page breaks.\r\n * @name pageBreaks\r\n * @type {number}\r\n * @default 0\r\n */\r\n Object.defineProperty(this, \"pageBreaks\", {\r\n get: function() {\r\n return pageBreaks;\r\n },\r\n set: function(value) {\r\n pageBreaks = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name ctx\r\n * @type {object}\r\n * @default {}\r\n */\r\n Object.defineProperty(this, \"ctx\", {\r\n get: function() {\r\n return _ctx;\r\n },\r\n set: function(value) {\r\n if (value instanceof ContextLayer) {\r\n _ctx = value;\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * @name path\r\n * @type {array}\r\n * @default []\r\n */\r\n Object.defineProperty(this, \"path\", {\r\n get: function() {\r\n return _ctx.path;\r\n },\r\n set: function(value) {\r\n _ctx.path = value;\r\n }\r\n });\r\n\r\n /**\r\n * @name ctxStack\r\n * @type {array}\r\n * @default []\r\n */\r\n var _ctxStack = [];\r\n Object.defineProperty(this, \"ctxStack\", {\r\n get: function() {\r\n return _ctxStack;\r\n },\r\n set: function(value) {\r\n _ctxStack = value;\r\n }\r\n });\r\n\r\n /**\r\n * Sets or returns the color, gradient, or pattern used to fill the drawing\r\n *\r\n * @name fillStyle\r\n * @default #000000\r\n * @property {(color|gradient|pattern)} value The color of the drawing. Default value is #000000
    \r\n * A gradient object (linear or radial) used to fill the drawing (not supported by context2d)
    \r\n * A pattern object to use to fill the drawing (not supported by context2d)\r\n */\r\n Object.defineProperty(this, \"fillStyle\", {\r\n get: function() {\r\n return this.ctx.fillStyle;\r\n },\r\n set: function(value) {\r\n var rgba;\r\n rgba = getRGBA(value);\r\n\r\n this.ctx.fillStyle = rgba.style;\r\n this.ctx.isFillTransparent = rgba.a === 0;\r\n this.ctx.fillOpacity = rgba.a;\r\n\r\n this.pdf.setFillColor(rgba.r, rgba.g, rgba.b, { a: rgba.a });\r\n this.pdf.setTextColor(rgba.r, rgba.g, rgba.b, { a: rgba.a });\r\n }\r\n });\r\n\r\n /**\r\n * Sets or returns the color, gradient, or pattern used for strokes\r\n *\r\n * @name strokeStyle\r\n * @default #000000\r\n * @property {color} color A CSS color value that indicates the stroke color of the drawing. Default value is #000000 (not supported by context2d)\r\n * @property {gradient} gradient A gradient object (linear or radial) used to create a gradient stroke (not supported by context2d)\r\n * @property {pattern} pattern A pattern object used to create a pattern stroke (not supported by context2d)\r\n */\r\n Object.defineProperty(this, \"strokeStyle\", {\r\n get: function() {\r\n return this.ctx.strokeStyle;\r\n },\r\n set: function(value) {\r\n var rgba = getRGBA(value);\r\n\r\n this.ctx.strokeStyle = rgba.style;\r\n this.ctx.isStrokeTransparent = rgba.a === 0;\r\n this.ctx.strokeOpacity = rgba.a;\r\n\r\n if (rgba.a === 0) {\r\n this.pdf.setDrawColor(255, 255, 255);\r\n } else if (rgba.a === 1) {\r\n this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);\r\n } else {\r\n this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Sets or returns the style of the end caps for a line\r\n *\r\n * @name lineCap\r\n * @default butt\r\n * @property {(butt|round|square)} lineCap butt A flat edge is added to each end of the line
    \r\n * round A rounded end cap is added to each end of the line
    \r\n * square A square end cap is added to each end of the line
    \r\n */\r\n Object.defineProperty(this, \"lineCap\", {\r\n get: function() {\r\n return this.ctx.lineCap;\r\n },\r\n set: function(value) {\r\n if ([\"butt\", \"round\", \"square\"].indexOf(value) !== -1) {\r\n this.ctx.lineCap = value;\r\n this.pdf.setLineCap(value);\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Sets or returns the current line width\r\n *\r\n * @name lineWidth\r\n * @default 1\r\n * @property {number} lineWidth The current line width, in pixels\r\n */\r\n Object.defineProperty(this, \"lineWidth\", {\r\n get: function() {\r\n return this.ctx.lineWidth;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n this.ctx.lineWidth = value;\r\n this.pdf.setLineWidth(value);\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Sets or returns the type of corner created, when two lines meet\r\n */\r\n Object.defineProperty(this, \"lineJoin\", {\r\n get: function() {\r\n return this.ctx.lineJoin;\r\n },\r\n set: function(value) {\r\n if ([\"bevel\", \"round\", \"miter\"].indexOf(value) !== -1) {\r\n this.ctx.lineJoin = value;\r\n this.pdf.setLineJoin(value);\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * A number specifying the miter limit ratio in coordinate space units. Zero, negative, Infinity, and NaN values are ignored. The default value is 10.0.\r\n *\r\n * @name miterLimit\r\n * @default 10\r\n */\r\n Object.defineProperty(this, \"miterLimit\", {\r\n get: function() {\r\n return this.ctx.miterLimit;\r\n },\r\n set: function(value) {\r\n if (!isNaN(value)) {\r\n this.ctx.miterLimit = value;\r\n this.pdf.setMiterLimit(value);\r\n }\r\n }\r\n });\r\n\r\n Object.defineProperty(this, \"textBaseline\", {\r\n get: function() {\r\n return this.ctx.textBaseline;\r\n },\r\n set: function(value) {\r\n this.ctx.textBaseline = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(this, \"textAlign\", {\r\n get: function() {\r\n return this.ctx.textAlign;\r\n },\r\n set: function(value) {\r\n if ([\"right\", \"end\", \"center\", \"left\", \"start\"].indexOf(value) !== -1) {\r\n this.ctx.textAlign = value;\r\n }\r\n }\r\n });\r\n\r\n var _fontFaceMap = null;\r\n\r\n function getFontFaceMap(pdf, fontFaces) {\r\n if (_fontFaceMap === null) {\r\n var fontMap = pdf.getFontList();\r\n\r\n var convertedFontFaces = convertToFontFaces(fontMap);\r\n\r\n _fontFaceMap = buildFontFaceMap(convertedFontFaces.concat(fontFaces));\r\n }\r\n\r\n return _fontFaceMap;\r\n }\r\n\r\n function convertToFontFaces(fontMap) {\r\n var fontFaces = [];\r\n\r\n Object.keys(fontMap).forEach(function(family) {\r\n var styles = fontMap[family];\r\n\r\n styles.forEach(function(style) {\r\n var fontFace = null;\r\n\r\n switch (style) {\r\n case \"bold\":\r\n fontFace = {\r\n family: family,\r\n weight: \"bold\"\r\n };\r\n break;\r\n\r\n case \"italic\":\r\n fontFace = {\r\n family: family,\r\n style: \"italic\"\r\n };\r\n break;\r\n\r\n case \"bolditalic\":\r\n fontFace = {\r\n family: family,\r\n weight: \"bold\",\r\n style: \"italic\"\r\n };\r\n break;\r\n\r\n case \"\":\r\n case \"normal\":\r\n fontFace = {\r\n family: family\r\n };\r\n break;\r\n }\r\n\r\n // If font-face is still null here, it is a font with some styling we don't recognize and\r\n // cannot map or it is a font added via the fontFaces option of .html().\r\n if (fontFace !== null) {\r\n fontFace.ref = {\r\n name: family,\r\n style: style\r\n };\r\n\r\n fontFaces.push(fontFace);\r\n }\r\n });\r\n });\r\n\r\n return fontFaces;\r\n }\r\n\r\n var _fontFaces = null;\r\n /**\r\n * A map of available font-faces, as passed in the options of\r\n * .html(). If set a limited implementation of the font style matching\r\n * algorithm defined by https://www.w3.org/TR/css-fonts-3/#font-matching-algorithm\r\n * will be used. If not set it will fallback to previous behavior.\r\n */\r\n\r\n Object.defineProperty(this, \"fontFaces\", {\r\n get: function() {\r\n return _fontFaces;\r\n },\r\n set: function(value) {\r\n _fontFaceMap = null;\r\n _fontFaces = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(this, \"font\", {\r\n get: function() {\r\n return this.ctx.font;\r\n },\r\n set: function(value) {\r\n this.ctx.font = value;\r\n var rx, matches;\r\n\r\n //source: https://stackoverflow.com/a/10136041\r\n // eslint-disable-next-line no-useless-escape\r\n rx = /^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-_,\\\"\\'\\sa-z]+?)\\s*$/i;\r\n matches = rx.exec(value);\r\n if (matches !== null) {\r\n var fontStyle = matches[1];\r\n var fontVariant = matches[2];\r\n var fontWeight = matches[3];\r\n var fontSize = matches[4];\r\n var lineHeight = matches[5];\r\n var fontFamily = matches[6];\r\n } else {\r\n return;\r\n }\r\n var rxFontSize = /^([.\\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i;\r\n var fontSizeUnit = rxFontSize.exec(fontSize)[2];\r\n\r\n if (\"px\" === fontSizeUnit) {\r\n fontSize = Math.floor(\r\n parseFloat(fontSize) * this.pdf.internal.scaleFactor\r\n );\r\n } else if (\"em\" === fontSizeUnit) {\r\n fontSize = Math.floor(parseFloat(fontSize) * this.pdf.getFontSize());\r\n } else {\r\n fontSize = Math.floor(\r\n parseFloat(fontSize) * this.pdf.internal.scaleFactor\r\n );\r\n }\r\n\r\n this.pdf.setFontSize(fontSize);\r\n var parts = parseFontFamily(fontFamily);\r\n\r\n if (this.fontFaces) {\r\n var fontFaceMap = getFontFaceMap(this.pdf, this.fontFaces);\r\n\r\n var rules = parts.map(function(ff) {\r\n return {\r\n family: ff,\r\n stretch: \"normal\", // TODO: Extract font-stretch from font rule (perhaps write proper parser for it?)\r\n weight: fontWeight,\r\n style: fontStyle\r\n };\r\n });\r\n\r\n var font = resolveFontFace(fontFaceMap, rules);\r\n this.pdf.setFont(font.ref.name, font.ref.style);\r\n return;\r\n }\r\n\r\n var style = \"\";\r\n if (\r\n fontWeight === \"bold\" ||\r\n parseInt(fontWeight, 10) >= 700 ||\r\n fontStyle === \"bold\"\r\n ) {\r\n style = \"bold\";\r\n }\r\n\r\n if (fontStyle === \"italic\") {\r\n style += \"italic\";\r\n }\r\n\r\n if (style.length === 0) {\r\n style = \"normal\";\r\n }\r\n var jsPdfFontName = \"\";\r\n\r\n var fallbackFonts = {\r\n arial: \"Helvetica\",\r\n Arial: \"Helvetica\",\r\n verdana: \"Helvetica\",\r\n Verdana: \"Helvetica\",\r\n helvetica: \"Helvetica\",\r\n Helvetica: \"Helvetica\",\r\n \"sans-serif\": \"Helvetica\",\r\n fixed: \"Courier\",\r\n monospace: \"Courier\",\r\n terminal: \"Courier\",\r\n cursive: \"Times\",\r\n fantasy: \"Times\",\r\n serif: \"Times\"\r\n };\r\n\r\n for (var i = 0; i < parts.length; i++) {\r\n if (\r\n this.pdf.internal.getFont(parts[i], style, {\r\n noFallback: true,\r\n disableWarning: true\r\n }) !== undefined\r\n ) {\r\n jsPdfFontName = parts[i];\r\n break;\r\n } else if (\r\n style === \"bolditalic\" &&\r\n this.pdf.internal.getFont(parts[i], \"bold\", {\r\n noFallback: true,\r\n disableWarning: true\r\n }) !== undefined\r\n ) {\r\n jsPdfFontName = parts[i];\r\n style = \"bold\";\r\n } else if (\r\n this.pdf.internal.getFont(parts[i], \"normal\", {\r\n noFallback: true,\r\n disableWarning: true\r\n }) !== undefined\r\n ) {\r\n jsPdfFontName = parts[i];\r\n style = \"normal\";\r\n break;\r\n }\r\n }\r\n if (jsPdfFontName === \"\") {\r\n for (var j = 0; j < parts.length; j++) {\r\n if (fallbackFonts[parts[j]]) {\r\n jsPdfFontName = fallbackFonts[parts[j]];\r\n break;\r\n }\r\n }\r\n }\r\n jsPdfFontName = jsPdfFontName === \"\" ? \"Times\" : jsPdfFontName;\r\n this.pdf.setFont(jsPdfFontName, style);\r\n }\r\n });\r\n\r\n Object.defineProperty(this, \"globalCompositeOperation\", {\r\n get: function() {\r\n return this.ctx.globalCompositeOperation;\r\n },\r\n set: function(value) {\r\n this.ctx.globalCompositeOperation = value;\r\n }\r\n });\r\n\r\n Object.defineProperty(this, \"globalAlpha\", {\r\n get: function() {\r\n return this.ctx.globalAlpha;\r\n },\r\n set: function(value) {\r\n this.ctx.globalAlpha = value;\r\n }\r\n });\r\n\r\n /**\r\n * A float specifying the amount of the line dash offset. The default value is 0.0.\r\n *\r\n * @name lineDashOffset\r\n * @default 0.0\r\n */\r\n Object.defineProperty(this, \"lineDashOffset\", {\r\n get: function() {\r\n return this.ctx.lineDashOffset;\r\n },\r\n set: function(value) {\r\n this.ctx.lineDashOffset = value;\r\n setLineDash.call(this);\r\n }\r\n });\r\n\r\n // Not HTML API\r\n Object.defineProperty(this, \"lineDash\", {\r\n get: function() {\r\n return this.ctx.lineDash;\r\n },\r\n set: function(value) {\r\n this.ctx.lineDash = value;\r\n setLineDash.call(this);\r\n }\r\n });\r\n\r\n // Not HTML API\r\n Object.defineProperty(this, \"ignoreClearRect\", {\r\n get: function() {\r\n return this.ctx.ignoreClearRect;\r\n },\r\n set: function(value) {\r\n this.ctx.ignoreClearRect = Boolean(value);\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Sets the line dash pattern used when stroking lines.\r\n * @name setLineDash\r\n * @function\r\n * @description It uses an array of values that specify alternating lengths of lines and gaps which describe the pattern.\r\n */\r\n Context2D.prototype.setLineDash = function(dashArray) {\r\n this.lineDash = dashArray;\r\n };\r\n\r\n /**\r\n * gets the current line dash pattern.\r\n * @name getLineDash\r\n * @function\r\n * @returns {Array} An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units). If the number, when setting the elements, is odd, the elements of the array get copied and concatenated. For example, setting the line dash to [5, 15, 25] will result in getting back [5, 15, 25, 5, 15, 25].\r\n */\r\n Context2D.prototype.getLineDash = function() {\r\n if (this.lineDash.length % 2) {\r\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash#return_value\r\n return this.lineDash.concat(this.lineDash);\r\n } else {\r\n // The copied value is returned to prevent contamination from outside.\r\n return this.lineDash.slice();\r\n }\r\n };\r\n\r\n Context2D.prototype.fill = function() {\r\n pathPreProcess.call(this, \"fill\", false);\r\n };\r\n\r\n /**\r\n * Actually draws the path you have defined\r\n *\r\n * @name stroke\r\n * @function\r\n * @description The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods. The default color is black.\r\n */\r\n Context2D.prototype.stroke = function() {\r\n pathPreProcess.call(this, \"stroke\", false);\r\n };\r\n\r\n /**\r\n * Begins a path, or resets the current\r\n *\r\n * @name beginPath\r\n * @function\r\n * @description The beginPath() method begins a path, or resets the current path.\r\n */\r\n Context2D.prototype.beginPath = function() {\r\n this.path = [\r\n {\r\n type: \"begin\"\r\n }\r\n ];\r\n };\r\n\r\n /**\r\n * Moves the path to the specified point in the canvas, without creating a line\r\n *\r\n * @name moveTo\r\n * @function\r\n * @param x {Number} The x-coordinate of where to move the path to\r\n * @param y {Number} The y-coordinate of where to move the path to\r\n */\r\n Context2D.prototype.moveTo = function(x, y) {\r\n if (isNaN(x) || isNaN(y)) {\r\n console.error(\"jsPDF.context2d.moveTo: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.moveTo\");\r\n }\r\n\r\n var pt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n\r\n this.path.push({\r\n type: \"mt\",\r\n x: pt.x,\r\n y: pt.y\r\n });\r\n this.ctx.lastPoint = new Point(x, y);\r\n };\r\n\r\n /**\r\n * Creates a path from the current point back to the starting point\r\n *\r\n * @name closePath\r\n * @function\r\n * @description The closePath() method creates a path from the current point back to the starting point.\r\n */\r\n Context2D.prototype.closePath = function() {\r\n var pathBegin = new Point(0, 0);\r\n var i = 0;\r\n for (i = this.path.length - 1; i !== -1; i--) {\r\n if (this.path[i].type === \"begin\") {\r\n if (\r\n typeof this.path[i + 1] === \"object\" &&\r\n typeof this.path[i + 1].x === \"number\"\r\n ) {\r\n pathBegin = new Point(this.path[i + 1].x, this.path[i + 1].y);\r\n break;\r\n }\r\n }\r\n }\r\n this.path.push({\r\n type: \"close\"\r\n });\r\n this.ctx.lastPoint = new Point(pathBegin.x, pathBegin.y);\r\n };\r\n\r\n /**\r\n * Adds a new point and creates a line to that point from the last specified point in the canvas\r\n *\r\n * @name lineTo\r\n * @function\r\n * @param x The x-coordinate of where to create the line to\r\n * @param y The y-coordinate of where to create the line to\r\n * @description The lineTo() method adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).\r\n */\r\n Context2D.prototype.lineTo = function(x, y) {\r\n if (isNaN(x) || isNaN(y)) {\r\n console.error(\"jsPDF.context2d.lineTo: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.lineTo\");\r\n }\r\n\r\n var pt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n\r\n this.path.push({\r\n type: \"lt\",\r\n x: pt.x,\r\n y: pt.y\r\n });\r\n this.ctx.lastPoint = new Point(pt.x, pt.y);\r\n };\r\n\r\n /**\r\n * Clips a region of any shape and size from the original canvas\r\n *\r\n * @name clip\r\n * @function\r\n * @description The clip() method clips a region of any shape and size from the original canvas.\r\n */\r\n Context2D.prototype.clip = function() {\r\n this.ctx.clip_path = JSON.parse(JSON.stringify(this.path));\r\n pathPreProcess.call(this, null, true);\r\n };\r\n\r\n /**\r\n * Creates a cubic Bézier curve\r\n *\r\n * @name quadraticCurveTo\r\n * @function\r\n * @param cpx {Number} The x-coordinate of the Bézier control point\r\n * @param cpy {Number} The y-coordinate of the Bézier control point\r\n * @param x {Number} The x-coordinate of the ending point\r\n * @param y {Number} The y-coordinate of the ending point\r\n * @description The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.

    A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.\r\n */\r\n Context2D.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {\r\n if (isNaN(x) || isNaN(y) || isNaN(cpx) || isNaN(cpy)) {\r\n console.error(\r\n \"jsPDF.context2d.quadraticCurveTo: Invalid arguments\",\r\n arguments\r\n );\r\n throw new Error(\r\n \"Invalid arguments passed to jsPDF.context2d.quadraticCurveTo\"\r\n );\r\n }\r\n\r\n var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));\r\n var pt1 = this.ctx.transform.applyToPoint(new Point(cpx, cpy));\r\n\r\n this.path.push({\r\n type: \"qct\",\r\n x1: pt1.x,\r\n y1: pt1.y,\r\n x: pt0.x,\r\n y: pt0.y\r\n });\r\n this.ctx.lastPoint = new Point(pt0.x, pt0.y);\r\n };\r\n\r\n /**\r\n * Creates a cubic Bézier curve\r\n *\r\n * @name bezierCurveTo\r\n * @function\r\n * @param cp1x {Number} The x-coordinate of the first Bézier control point\r\n * @param cp1y {Number} The y-coordinate of the first Bézier control point\r\n * @param cp2x {Number} The x-coordinate of the second Bézier control point\r\n * @param cp2y {Number} The y-coordinate of the second Bézier control point\r\n * @param x {Number} The x-coordinate of the ending point\r\n * @param y {Number} The y-coordinate of the ending point\r\n * @description The bezierCurveTo() method adds a point to the current path by using the specified control points that represent a cubic Bézier curve.

    A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.\r\n */\r\n Context2D.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {\r\n if (\r\n isNaN(x) ||\r\n isNaN(y) ||\r\n isNaN(cp1x) ||\r\n isNaN(cp1y) ||\r\n isNaN(cp2x) ||\r\n isNaN(cp2y)\r\n ) {\r\n console.error(\r\n \"jsPDF.context2d.bezierCurveTo: Invalid arguments\",\r\n arguments\r\n );\r\n throw new Error(\r\n \"Invalid arguments passed to jsPDF.context2d.bezierCurveTo\"\r\n );\r\n }\r\n var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));\r\n var pt1 = this.ctx.transform.applyToPoint(new Point(cp1x, cp1y));\r\n var pt2 = this.ctx.transform.applyToPoint(new Point(cp2x, cp2y));\r\n\r\n this.path.push({\r\n type: \"bct\",\r\n x1: pt1.x,\r\n y1: pt1.y,\r\n x2: pt2.x,\r\n y2: pt2.y,\r\n x: pt0.x,\r\n y: pt0.y\r\n });\r\n this.ctx.lastPoint = new Point(pt0.x, pt0.y);\r\n };\r\n\r\n /**\r\n * Creates an arc/curve (used to create circles, or parts of circles)\r\n *\r\n * @name arc\r\n * @function\r\n * @param x {Number} The x-coordinate of the center of the circle\r\n * @param y {Number} The y-coordinate of the center of the circle\r\n * @param radius {Number} The radius of the circle\r\n * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)\r\n * @param endAngle {Number} The ending angle, in radians\r\n * @param counterclockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.\r\n * @description The arc() method creates an arc/curve (used to create circles, or parts of circles).\r\n */\r\n Context2D.prototype.arc = function(\r\n x,\r\n y,\r\n radius,\r\n startAngle,\r\n endAngle,\r\n counterclockwise\r\n ) {\r\n if (\r\n isNaN(x) ||\r\n isNaN(y) ||\r\n isNaN(radius) ||\r\n isNaN(startAngle) ||\r\n isNaN(endAngle)\r\n ) {\r\n console.error(\"jsPDF.context2d.arc: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.arc\");\r\n }\r\n counterclockwise = Boolean(counterclockwise);\r\n\r\n if (!this.ctx.transform.isIdentity) {\r\n var xpt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n x = xpt.x;\r\n y = xpt.y;\r\n\r\n var x_radPt = this.ctx.transform.applyToPoint(new Point(0, radius));\r\n var x_radPt0 = this.ctx.transform.applyToPoint(new Point(0, 0));\r\n radius = Math.sqrt(\r\n Math.pow(x_radPt.x - x_radPt0.x, 2) +\r\n Math.pow(x_radPt.y - x_radPt0.y, 2)\r\n );\r\n }\r\n if (Math.abs(endAngle - startAngle) >= 2 * Math.PI) {\r\n startAngle = 0;\r\n endAngle = 2 * Math.PI;\r\n }\r\n\r\n this.path.push({\r\n type: \"arc\",\r\n x: x,\r\n y: y,\r\n radius: radius,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n counterclockwise: counterclockwise\r\n });\r\n // this.ctx.lastPoint(new Point(pt.x,pt.y));\r\n };\r\n\r\n /**\r\n * Creates an arc/curve between two tangents\r\n *\r\n * @name arcTo\r\n * @function\r\n * @param x1 {Number} The x-coordinate of the first tangent\r\n * @param y1 {Number} The y-coordinate of the first tangent\r\n * @param x2 {Number} The x-coordinate of the second tangent\r\n * @param y2 {Number} The y-coordinate of the second tangent\r\n * @param radius The radius of the arc\r\n * @description The arcTo() method creates an arc/curve between two tangents on the canvas.\r\n */\r\n // eslint-disable-next-line no-unused-vars\r\n Context2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {\r\n throw new Error(\"arcTo not implemented.\");\r\n };\r\n\r\n /**\r\n * Creates a rectangle\r\n *\r\n * @name rect\r\n * @function\r\n * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n * @param w {Number} The width of the rectangle, in pixels\r\n * @param h {Number} The height of the rectangle, in pixels\r\n * @description The rect() method creates a rectangle.\r\n */\r\n Context2D.prototype.rect = function(x, y, w, h) {\r\n if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n console.error(\"jsPDF.context2d.rect: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.rect\");\r\n }\r\n this.moveTo(x, y);\r\n this.lineTo(x + w, y);\r\n this.lineTo(x + w, y + h);\r\n this.lineTo(x, y + h);\r\n this.lineTo(x, y);\r\n this.lineTo(x + w, y);\r\n this.lineTo(x, y);\r\n };\r\n\r\n /**\r\n * Draws a \"filled\" rectangle\r\n *\r\n * @name fillRect\r\n * @function\r\n * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n * @param w {Number} The width of the rectangle, in pixels\r\n * @param h {Number} The height of the rectangle, in pixels\r\n * @description The fillRect() method draws a \"filled\" rectangle. The default color of the fill is black.\r\n */\r\n Context2D.prototype.fillRect = function(x, y, w, h) {\r\n if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n console.error(\"jsPDF.context2d.fillRect: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.fillRect\");\r\n }\r\n if (isFillTransparent.call(this)) {\r\n return;\r\n }\r\n var tmp = {};\r\n if (this.lineCap !== \"butt\") {\r\n tmp.lineCap = this.lineCap;\r\n this.lineCap = \"butt\";\r\n }\r\n if (this.lineJoin !== \"miter\") {\r\n tmp.lineJoin = this.lineJoin;\r\n this.lineJoin = \"miter\";\r\n }\r\n\r\n this.beginPath();\r\n this.rect(x, y, w, h);\r\n this.fill();\r\n\r\n if (tmp.hasOwnProperty(\"lineCap\")) {\r\n this.lineCap = tmp.lineCap;\r\n }\r\n if (tmp.hasOwnProperty(\"lineJoin\")) {\r\n this.lineJoin = tmp.lineJoin;\r\n }\r\n };\r\n\r\n /**\r\n * Draws a rectangle (no fill)\r\n *\r\n * @name strokeRect\r\n * @function\r\n * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n * @param w {Number} The width of the rectangle, in pixels\r\n * @param h {Number} The height of the rectangle, in pixels\r\n * @description The strokeRect() method draws a rectangle (no fill). The default color of the stroke is black.\r\n */\r\n Context2D.prototype.strokeRect = function strokeRect(x, y, w, h) {\r\n if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n console.error(\"jsPDF.context2d.strokeRect: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.strokeRect\");\r\n }\r\n if (isStrokeTransparent.call(this)) {\r\n return;\r\n }\r\n this.beginPath();\r\n this.rect(x, y, w, h);\r\n this.stroke();\r\n };\r\n\r\n /**\r\n * Clears the specified pixels within a given rectangle\r\n *\r\n * @name clearRect\r\n * @function\r\n * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n * @param w {Number} The width of the rectangle to clear, in pixels\r\n * @param h {Number} The height of the rectangle to clear, in pixels\r\n * @description We cannot clear PDF commands that were already written to PDF, so we use white instead.
    \r\n * As a special case, read a special flag (ignoreClearRect) and do nothing if it is set.\r\n * This results in all calls to clearRect() to do nothing, and keep the canvas transparent.\r\n * This flag is stored in the save/restore context and is managed the same way as other drawing states.\r\n *\r\n */\r\n Context2D.prototype.clearRect = function(x, y, w, h) {\r\n if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n console.error(\"jsPDF.context2d.clearRect: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.clearRect\");\r\n }\r\n if (this.ignoreClearRect) {\r\n return;\r\n }\r\n\r\n this.fillStyle = \"#ffffff\";\r\n this.fillRect(x, y, w, h);\r\n };\r\n\r\n /**\r\n * Saves the state of the current context\r\n *\r\n * @name save\r\n * @function\r\n */\r\n Context2D.prototype.save = function(doStackPush) {\r\n doStackPush = typeof doStackPush === \"boolean\" ? doStackPush : true;\r\n var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {\r\n this.pdf.setPage(i + 1);\r\n this.pdf.internal.out(\"q\");\r\n }\r\n this.pdf.setPage(tmpPageNumber);\r\n\r\n if (doStackPush) {\r\n this.ctx.fontSize = this.pdf.internal.getFontSize();\r\n var ctx = new ContextLayer(this.ctx);\r\n this.ctxStack.push(this.ctx);\r\n this.ctx = ctx;\r\n }\r\n };\r\n\r\n /**\r\n * Returns previously saved path state and attributes\r\n *\r\n * @name restore\r\n * @function\r\n */\r\n Context2D.prototype.restore = function(doStackPop) {\r\n doStackPop = typeof doStackPop === \"boolean\" ? doStackPop : true;\r\n var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {\r\n this.pdf.setPage(i + 1);\r\n this.pdf.internal.out(\"Q\");\r\n }\r\n this.pdf.setPage(tmpPageNumber);\r\n\r\n if (doStackPop && this.ctxStack.length !== 0) {\r\n this.ctx = this.ctxStack.pop();\r\n this.fillStyle = this.ctx.fillStyle;\r\n this.strokeStyle = this.ctx.strokeStyle;\r\n this.font = this.ctx.font;\r\n this.lineCap = this.ctx.lineCap;\r\n this.lineWidth = this.ctx.lineWidth;\r\n this.lineJoin = this.ctx.lineJoin;\r\n this.lineDash = this.ctx.lineDash;\r\n this.lineDashOffset = this.ctx.lineDashOffset;\r\n }\r\n };\r\n\r\n /**\r\n * @name toDataURL\r\n * @function\r\n */\r\n Context2D.prototype.toDataURL = function() {\r\n throw new Error(\"toDataUrl not implemented.\");\r\n };\r\n\r\n //helper functions\r\n\r\n /**\r\n * Get the decimal values of r, g, b and a\r\n *\r\n * @name getRGBA\r\n * @function\r\n * @private\r\n * @ignore\r\n */\r\n var getRGBA = function(style) {\r\n var rxRgb = /rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/;\r\n var rxRgba = /rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*([\\d.]+)\\s*\\)/;\r\n var rxTransparent = /transparent|rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*0+\\s*\\)/;\r\n\r\n var r, g, b, a;\r\n\r\n if (style.isCanvasGradient === true) {\r\n style = style.getColor();\r\n }\r\n\r\n if (!style) {\r\n return { r: 0, g: 0, b: 0, a: 0, style: style };\r\n }\r\n\r\n if (rxTransparent.test(style)) {\r\n r = 0;\r\n g = 0;\r\n b = 0;\r\n a = 0;\r\n } else {\r\n var matches = rxRgb.exec(style);\r\n if (matches !== null) {\r\n r = parseInt(matches[1]);\r\n g = parseInt(matches[2]);\r\n b = parseInt(matches[3]);\r\n a = 1;\r\n } else {\r\n matches = rxRgba.exec(style);\r\n if (matches !== null) {\r\n r = parseInt(matches[1]);\r\n g = parseInt(matches[2]);\r\n b = parseInt(matches[3]);\r\n a = parseFloat(matches[4]);\r\n } else {\r\n a = 1;\r\n\r\n if (typeof style === \"string\" && style.charAt(0) !== \"#\") {\r\n var rgbColor = new RGBColor(style);\r\n if (rgbColor.ok) {\r\n style = rgbColor.toHex();\r\n } else {\r\n style = \"#000000\";\r\n }\r\n }\r\n\r\n if (style.length === 4) {\r\n r = style.substring(1, 2);\r\n r += r;\r\n g = style.substring(2, 3);\r\n g += g;\r\n b = style.substring(3, 4);\r\n b += b;\r\n } else {\r\n r = style.substring(1, 3);\r\n g = style.substring(3, 5);\r\n b = style.substring(5, 7);\r\n }\r\n r = parseInt(r, 16);\r\n g = parseInt(g, 16);\r\n b = parseInt(b, 16);\r\n }\r\n }\r\n }\r\n return { r: r, g: g, b: b, a: a, style: style };\r\n };\r\n\r\n /**\r\n * @name isFillTransparent\r\n * @function\r\n * @private\r\n * @ignore\r\n * @returns {Boolean}\r\n */\r\n var isFillTransparent = function() {\r\n return this.ctx.isFillTransparent || this.globalAlpha == 0;\r\n };\r\n\r\n /**\r\n * @name isStrokeTransparent\r\n * @function\r\n * @private\r\n * @ignore\r\n * @returns {Boolean}\r\n */\r\n var isStrokeTransparent = function() {\r\n return Boolean(this.ctx.isStrokeTransparent || this.globalAlpha == 0);\r\n };\r\n\r\n /**\r\n * Draws \"filled\" text on the canvas\r\n *\r\n * @name fillText\r\n * @function\r\n * @param text {String} Specifies the text that will be written on the canvas\r\n * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)\r\n * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)\r\n * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels\r\n * @description The fillText() method draws filled text on the canvas. The default color of the text is black.\r\n */\r\n Context2D.prototype.fillText = function(text, x, y, maxWidth) {\r\n if (isNaN(x) || isNaN(y) || typeof text !== \"string\") {\r\n console.error(\"jsPDF.context2d.fillText: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.fillText\");\r\n }\r\n maxWidth = isNaN(maxWidth) ? undefined : maxWidth;\r\n if (isFillTransparent.call(this)) {\r\n return;\r\n }\r\n\r\n var degs = rad2deg(this.ctx.transform.rotation);\r\n\r\n // We only use X axis as scale hint\r\n var scale = this.ctx.transform.scaleX;\r\n\r\n putText.call(this, {\r\n text: text,\r\n x: x,\r\n y: y,\r\n scale: scale,\r\n angle: degs,\r\n align: this.textAlign,\r\n maxWidth: maxWidth\r\n });\r\n };\r\n\r\n /**\r\n * Draws text on the canvas (no fill)\r\n *\r\n * @name strokeText\r\n * @function\r\n * @param text {String} Specifies the text that will be written on the canvas\r\n * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)\r\n * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)\r\n * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels\r\n * @description The strokeText() method draws text (with no fill) on the canvas. The default color of the text is black.\r\n */\r\n Context2D.prototype.strokeText = function(text, x, y, maxWidth) {\r\n if (isNaN(x) || isNaN(y) || typeof text !== \"string\") {\r\n console.error(\"jsPDF.context2d.strokeText: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.strokeText\");\r\n }\r\n if (isStrokeTransparent.call(this)) {\r\n return;\r\n }\r\n\r\n maxWidth = isNaN(maxWidth) ? undefined : maxWidth;\r\n\r\n var degs = rad2deg(this.ctx.transform.rotation);\r\n var scale = this.ctx.transform.scaleX;\r\n\r\n putText.call(this, {\r\n text: text,\r\n x: x,\r\n y: y,\r\n scale: scale,\r\n renderingMode: \"stroke\",\r\n angle: degs,\r\n align: this.textAlign,\r\n maxWidth: maxWidth\r\n });\r\n };\r\n\r\n /**\r\n * Returns an object that contains the width of the specified text\r\n *\r\n * @name measureText\r\n * @function\r\n * @param text {String} The text to be measured\r\n * @description The measureText() method returns an object that contains the width of the specified text, in pixels.\r\n * @returns {Number}\r\n */\r\n Context2D.prototype.measureText = function(text) {\r\n if (typeof text !== \"string\") {\r\n console.error(\r\n \"jsPDF.context2d.measureText: Invalid arguments\",\r\n arguments\r\n );\r\n throw new Error(\r\n \"Invalid arguments passed to jsPDF.context2d.measureText\"\r\n );\r\n }\r\n var pdf = this.pdf;\r\n var k = this.pdf.internal.scaleFactor;\r\n\r\n var fontSize = pdf.internal.getFontSize();\r\n var txtWidth =\r\n (pdf.getStringUnitWidth(text) * fontSize) / pdf.internal.scaleFactor;\r\n txtWidth *= Math.round(((k * 96) / 72) * 10000) / 10000;\r\n\r\n var TextMetrics = function(options) {\r\n options = options || {};\r\n var _width = options.width || 0;\r\n Object.defineProperty(this, \"width\", {\r\n get: function() {\r\n return _width;\r\n }\r\n });\r\n return this;\r\n };\r\n return new TextMetrics({ width: txtWidth });\r\n };\r\n\r\n //Transformations\r\n\r\n /**\r\n * Scales the current drawing bigger or smaller\r\n *\r\n * @name scale\r\n * @function\r\n * @param scalewidth {Number} Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)\r\n * @param scaleheight {Number} Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)\r\n * @description The scale() method scales the current drawing, bigger or smaller.\r\n */\r\n Context2D.prototype.scale = function(scalewidth, scaleheight) {\r\n if (isNaN(scalewidth) || isNaN(scaleheight)) {\r\n console.error(\"jsPDF.context2d.scale: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.scale\");\r\n }\r\n var matrix = new Matrix(scalewidth, 0.0, 0.0, scaleheight, 0.0, 0.0);\r\n this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n };\r\n\r\n /**\r\n * Rotates the current drawing\r\n *\r\n * @name rotate\r\n * @function\r\n * @param angle {Number} The rotation angle, in radians.\r\n * @description To calculate from degrees to radians: degrees*Math.PI/180.
    \r\n * Example: to rotate 5 degrees, specify the following: 5*Math.PI/180\r\n */\r\n Context2D.prototype.rotate = function(angle) {\r\n if (isNaN(angle)) {\r\n console.error(\"jsPDF.context2d.rotate: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.rotate\");\r\n }\r\n var matrix = new Matrix(\r\n Math.cos(angle),\r\n Math.sin(angle),\r\n -Math.sin(angle),\r\n Math.cos(angle),\r\n 0.0,\r\n 0.0\r\n );\r\n this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n };\r\n\r\n /**\r\n * Remaps the (0,0) position on the canvas\r\n *\r\n * @name translate\r\n * @function\r\n * @param x {Number} The value to add to horizontal (x) coordinates\r\n * @param y {Number} The value to add to vertical (y) coordinates\r\n * @description The translate() method remaps the (0,0) position on the canvas.\r\n */\r\n Context2D.prototype.translate = function(x, y) {\r\n if (isNaN(x) || isNaN(y)) {\r\n console.error(\"jsPDF.context2d.translate: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.translate\");\r\n }\r\n var matrix = new Matrix(1.0, 0.0, 0.0, 1.0, x, y);\r\n this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n };\r\n\r\n /**\r\n * Replaces the current transformation matrix for the drawing\r\n *\r\n * @name transform\r\n * @function\r\n * @param a {Number} Horizontal scaling\r\n * @param b {Number} Horizontal skewing\r\n * @param c {Number} Vertical skewing\r\n * @param d {Number} Vertical scaling\r\n * @param e {Number} Horizontal moving\r\n * @param f {Number} Vertical moving\r\n * @description Each object on the canvas has a current transformation matrix.

    The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:



    a c e

    b d f

    0 0 1

    In other words, the transform() method lets you scale, rotate, move, and skew the current context.\r\n */\r\n Context2D.prototype.transform = function(a, b, c, d, e, f) {\r\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d) || isNaN(e) || isNaN(f)) {\r\n console.error(\"jsPDF.context2d.transform: Invalid arguments\", arguments);\r\n throw new Error(\"Invalid arguments passed to jsPDF.context2d.transform\");\r\n }\r\n var matrix = new Matrix(a, b, c, d, e, f);\r\n this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n };\r\n\r\n /**\r\n * Resets the current transform to the identity matrix. Then runs transform()\r\n *\r\n * @name setTransform\r\n * @function\r\n * @param a {Number} Horizontal scaling\r\n * @param b {Number} Horizontal skewing\r\n * @param c {Number} Vertical skewing\r\n * @param d {Number} Vertical scaling\r\n * @param e {Number} Horizontal moving\r\n * @param f {Number} Vertical moving\r\n * @description Each object on the canvas has a current transformation matrix.

    The setTransform() method resets the current transform to the identity matrix, and then runs transform() with the same arguments.

    In other words, the setTransform() method lets you scale, rotate, move, and skew the current context.\r\n */\r\n Context2D.prototype.setTransform = function(a, b, c, d, e, f) {\r\n a = isNaN(a) ? 1 : a;\r\n b = isNaN(b) ? 0 : b;\r\n c = isNaN(c) ? 0 : c;\r\n d = isNaN(d) ? 1 : d;\r\n e = isNaN(e) ? 0 : e;\r\n f = isNaN(f) ? 0 : f;\r\n this.ctx.transform = new Matrix(a, b, c, d, e, f);\r\n };\r\n\r\n /**\r\n * Should only be used if pageWrapYEnabled is true\r\n *\r\n * @name setPageByYPosition\r\n * @function\r\n * @private\r\n * @ignore\r\n * @returns One-based Page Number\r\n */\r\n var setPageByYPosition = function(y) {\r\n if (this.pageWrapYEnabled) {\r\n this.lastBreak = 0;\r\n var manualBreaks = 0;\r\n var autoBreaks = 0;\r\n for (var i = 0; i < this.pageBreaks.length; i++) {\r\n if (y >= this.pageBreaks[i]) {\r\n manualBreaks++;\r\n if (this.lastBreak === 0) {\r\n autoBreaks++;\r\n }\r\n var spaceBetweenLastBreak = this.pageBreaks[i] - this.lastBreak;\r\n this.lastBreak = this.pageBreaks[i];\r\n var pagesSinceLastBreak = Math.floor(\r\n spaceBetweenLastBreak / this.pageWrapY\r\n );\r\n autoBreaks += pagesSinceLastBreak;\r\n }\r\n }\r\n if (this.lastBreak === 0) {\r\n var pagesSinceLastBreak = Math.floor(y / this.pageWrapY) + 1;\r\n autoBreaks += pagesSinceLastBreak;\r\n }\r\n return autoBreaks + manualBreaks;\r\n } else {\r\n return this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n }\r\n };\r\n\r\n var hasMargins = function() {\r\n return (\r\n this.margin[0] > 0 ||\r\n this.margin[1] > 0 ||\r\n this.margin[2] > 0 ||\r\n this.margin[3] > 0\r\n );\r\n };\r\n\r\n /**\r\n * Draws an image, canvas, or video onto the canvas\r\n *\r\n * @function\r\n * @param img {} Specifies the image, canvas, or video element to use\r\n * @param sx {Number} Optional. The x coordinate where to start clipping\r\n * @param sy {Number} Optional. The y coordinate where to start clipping\r\n * @param swidth {Number} Optional. The width of the clipped image\r\n * @param sheight {Number} Optional. The height of the clipped image\r\n * @param x {Number} The x coordinate where to place the image on the canvas\r\n * @param y {Number} The y coordinate where to place the image on the canvas\r\n * @param width {Number} Optional. The width of the image to use (stretch or reduce the image)\r\n * @param height {Number} Optional. The height of the image to use (stretch or reduce the image)\r\n */\r\n Context2D.prototype.drawImage = function(\r\n img,\r\n sx,\r\n sy,\r\n swidth,\r\n sheight,\r\n x,\r\n y,\r\n width,\r\n height\r\n ) {\r\n var imageProperties = this.pdf.getImageProperties(img);\r\n var factorX = 1;\r\n var factorY = 1;\r\n var isClip;\r\n\r\n var clipFactorX = 1;\r\n var clipFactorY = 1;\r\n\r\n if (typeof swidth !== \"undefined\" && typeof width !== \"undefined\") {\r\n isClip = true;\r\n clipFactorX = width / swidth;\r\n clipFactorY = height / sheight;\r\n factorX = ((imageProperties.width / swidth) * width) / swidth;\r\n factorY = ((imageProperties.height / sheight) * height) / sheight;\r\n }\r\n\r\n //is sx and sy are set and x and y not, set x and y with values of sx and sy\r\n if (typeof x === \"undefined\") {\r\n x = sx;\r\n y = sy;\r\n sx = 0;\r\n sy = 0;\r\n }\r\n\r\n if (typeof swidth !== \"undefined\" && typeof width === \"undefined\") {\r\n width = swidth;\r\n height = sheight;\r\n }\r\n if (typeof swidth === \"undefined\" && typeof width === \"undefined\") {\r\n width = imageProperties.width;\r\n height = imageProperties.height;\r\n }\r\n\r\n var decomposedTransformationMatrix = this.ctx.transform.decompose();\r\n var angle = rad2deg(decomposedTransformationMatrix.rotate.shx);\r\n var matrix = new Matrix();\r\n matrix = matrix.multiply(decomposedTransformationMatrix.translate);\r\n matrix = matrix.multiply(decomposedTransformationMatrix.skew);\r\n matrix = matrix.multiply(decomposedTransformationMatrix.scale);\r\n var xRect = matrix.applyToRectangle(\r\n new Rectangle(\r\n x - sx * clipFactorX,\r\n y - sy * clipFactorY,\r\n swidth * factorX,\r\n sheight * factorY\r\n )\r\n );\r\n var pageArray = getPagesByPath.call(this, xRect);\r\n var pages = [];\r\n for (var ii = 0; ii < pageArray.length; ii += 1) {\r\n if (pages.indexOf(pageArray[ii]) === -1) {\r\n pages.push(pageArray[ii]);\r\n }\r\n }\r\n\r\n sortPages(pages);\r\n\r\n var clipPath;\r\n if (this.autoPaging) {\r\n var min = pages[0];\r\n var max = pages[pages.length - 1];\r\n for (var i = min; i < max + 1; i++) {\r\n this.pdf.setPage(i);\r\n\r\n var pageWidthMinusMargins =\r\n this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1];\r\n var topMargin = i === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n var firstPageHeight =\r\n this.pdf.internal.pageSize.height -\r\n this.posY -\r\n this.margin[0] -\r\n this.margin[2];\r\n var pageHeightMinusMargins =\r\n this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n var previousPageHeightSum =\r\n i === 1 ? 0 : firstPageHeight + (i - 2) * pageHeightMinusMargins;\r\n\r\n if (this.ctx.clip_path.length !== 0) {\r\n var tmpPaths = this.path;\r\n clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n this.path = pathPositionRedo(\r\n clipPath,\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n );\r\n drawPaths.call(this, \"fill\", true);\r\n this.path = tmpPaths;\r\n }\r\n var tmpRect = JSON.parse(JSON.stringify(xRect));\r\n tmpRect = pathPositionRedo(\r\n [tmpRect],\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n )[0];\r\n\r\n const needsClipping = (i > min || i < max) && hasMargins.call(this);\r\n\r\n if (needsClipping) {\r\n this.pdf.saveGraphicsState();\r\n this.pdf\r\n .rect(\r\n this.margin[3],\r\n this.margin[0],\r\n pageWidthMinusMargins,\r\n pageHeightMinusMargins,\r\n null\r\n )\r\n .clip()\r\n .discardPath();\r\n }\r\n this.pdf.addImage(\r\n img,\r\n \"JPEG\",\r\n tmpRect.x,\r\n tmpRect.y,\r\n tmpRect.w,\r\n tmpRect.h,\r\n null,\r\n null,\r\n angle\r\n );\r\n if (needsClipping) {\r\n this.pdf.restoreGraphicsState();\r\n }\r\n }\r\n } else {\r\n this.pdf.addImage(\r\n img,\r\n \"JPEG\",\r\n xRect.x,\r\n xRect.y,\r\n xRect.w,\r\n xRect.h,\r\n null,\r\n null,\r\n angle\r\n );\r\n }\r\n };\r\n\r\n var getPagesByPath = function(path, pageWrapX, pageWrapY) {\r\n var result = [];\r\n pageWrapX = pageWrapX || this.pdf.internal.pageSize.width;\r\n pageWrapY =\r\n pageWrapY ||\r\n this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n var yOffset = this.posY + this.ctx.prevPageLastElemOffset;\r\n\r\n switch (path.type) {\r\n default:\r\n case \"mt\":\r\n case \"lt\":\r\n result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);\r\n break;\r\n case \"arc\":\r\n result.push(\r\n Math.floor((path.y + yOffset - path.radius) / pageWrapY) + 1\r\n );\r\n result.push(\r\n Math.floor((path.y + yOffset + path.radius) / pageWrapY) + 1\r\n );\r\n break;\r\n case \"qct\":\r\n var rectOfQuadraticCurve = getQuadraticCurveBoundary(\r\n this.ctx.lastPoint.x,\r\n this.ctx.lastPoint.y,\r\n path.x1,\r\n path.y1,\r\n path.x,\r\n path.y\r\n );\r\n result.push(\r\n Math.floor((rectOfQuadraticCurve.y + yOffset) / pageWrapY) + 1\r\n );\r\n result.push(\r\n Math.floor(\r\n (rectOfQuadraticCurve.y + rectOfQuadraticCurve.h + yOffset) /\r\n pageWrapY\r\n ) + 1\r\n );\r\n break;\r\n case \"bct\":\r\n var rectOfBezierCurve = getBezierCurveBoundary(\r\n this.ctx.lastPoint.x,\r\n this.ctx.lastPoint.y,\r\n path.x1,\r\n path.y1,\r\n path.x2,\r\n path.y2,\r\n path.x,\r\n path.y\r\n );\r\n result.push(\r\n Math.floor((rectOfBezierCurve.y + yOffset) / pageWrapY) + 1\r\n );\r\n result.push(\r\n Math.floor(\r\n (rectOfBezierCurve.y + rectOfBezierCurve.h + yOffset) / pageWrapY\r\n ) + 1\r\n );\r\n break;\r\n case \"rect\":\r\n result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);\r\n result.push(Math.floor((path.y + path.h + yOffset) / pageWrapY) + 1);\r\n }\r\n\r\n for (var i = 0; i < result.length; i += 1) {\r\n while (this.pdf.internal.getNumberOfPages() < result[i]) {\r\n addPage.call(this);\r\n }\r\n }\r\n return result;\r\n };\r\n\r\n var addPage = function() {\r\n var fillStyle = this.fillStyle;\r\n var strokeStyle = this.strokeStyle;\r\n var font = this.font;\r\n var lineCap = this.lineCap;\r\n var lineWidth = this.lineWidth;\r\n var lineJoin = this.lineJoin;\r\n this.pdf.addPage();\r\n this.fillStyle = fillStyle;\r\n this.strokeStyle = strokeStyle;\r\n this.font = font;\r\n this.lineCap = lineCap;\r\n this.lineWidth = lineWidth;\r\n this.lineJoin = lineJoin;\r\n };\r\n\r\n var pathPositionRedo = function(paths, x, y) {\r\n for (var i = 0; i < paths.length; i++) {\r\n switch (paths[i].type) {\r\n case \"bct\":\r\n paths[i].x2 += x;\r\n paths[i].y2 += y;\r\n case \"qct\":\r\n paths[i].x1 += x;\r\n paths[i].y1 += y;\r\n case \"mt\":\r\n case \"lt\":\r\n case \"arc\":\r\n default:\r\n paths[i].x += x;\r\n paths[i].y += y;\r\n }\r\n }\r\n return paths;\r\n };\r\n\r\n var sortPages = function(pages) {\r\n return pages.sort(function(a, b) {\r\n return a - b;\r\n });\r\n };\r\n\r\n var pathPreProcess = function(rule, isClip) {\r\n var fillStyle = this.fillStyle;\r\n var strokeStyle = this.strokeStyle;\r\n var lineCap = this.lineCap;\r\n var oldLineWidth = this.lineWidth;\r\n var lineWidth = Math.abs(oldLineWidth * this.ctx.transform.scaleX);\r\n var lineJoin = this.lineJoin;\r\n\r\n var origPath = JSON.parse(JSON.stringify(this.path));\r\n var xPath = JSON.parse(JSON.stringify(this.path));\r\n var clipPath;\r\n var tmpPath;\r\n var pages = [];\r\n\r\n for (var i = 0; i < xPath.length; i++) {\r\n if (typeof xPath[i].x !== \"undefined\") {\r\n var page = getPagesByPath.call(this, xPath[i]);\r\n\r\n for (var ii = 0; ii < page.length; ii += 1) {\r\n if (pages.indexOf(page[ii]) === -1) {\r\n pages.push(page[ii]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (var j = 0; j < pages.length; j++) {\r\n while (this.pdf.internal.getNumberOfPages() < pages[j]) {\r\n addPage.call(this);\r\n }\r\n }\r\n sortPages(pages);\r\n\r\n if (this.autoPaging) {\r\n var min = pages[0];\r\n var max = pages[pages.length - 1];\r\n for (var k = min; k < max + 1; k++) {\r\n this.pdf.setPage(k);\r\n\r\n this.fillStyle = fillStyle;\r\n this.strokeStyle = strokeStyle;\r\n this.lineCap = lineCap;\r\n this.lineWidth = lineWidth;\r\n this.lineJoin = lineJoin;\r\n\r\n var pageWidthMinusMargins =\r\n this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1];\r\n var topMargin = k === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n var firstPageHeight =\r\n this.pdf.internal.pageSize.height -\r\n this.posY -\r\n this.margin[0] -\r\n this.margin[2];\r\n var pageHeightMinusMargins =\r\n this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n var previousPageHeightSum =\r\n k === 1 ? 0 : firstPageHeight + (k - 2) * pageHeightMinusMargins;\r\n\r\n if (this.ctx.clip_path.length !== 0) {\r\n var tmpPaths = this.path;\r\n clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n this.path = pathPositionRedo(\r\n clipPath,\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n );\r\n drawPaths.call(this, rule, true);\r\n this.path = tmpPaths;\r\n }\r\n tmpPath = JSON.parse(JSON.stringify(origPath));\r\n this.path = pathPositionRedo(\r\n tmpPath,\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n );\r\n if (isClip === false || k === 0) {\r\n const needsClipping = (k > min || k < max) && hasMargins.call(this);\r\n if (needsClipping) {\r\n this.pdf.saveGraphicsState();\r\n this.pdf\r\n .rect(\r\n this.margin[3],\r\n this.margin[0],\r\n pageWidthMinusMargins,\r\n pageHeightMinusMargins,\r\n null\r\n )\r\n .clip()\r\n .discardPath();\r\n }\r\n drawPaths.call(this, rule, isClip);\r\n if (needsClipping) {\r\n this.pdf.restoreGraphicsState();\r\n }\r\n }\r\n this.lineWidth = oldLineWidth;\r\n }\r\n } else {\r\n this.lineWidth = lineWidth;\r\n drawPaths.call(this, rule, isClip);\r\n this.lineWidth = oldLineWidth;\r\n }\r\n this.path = origPath;\r\n };\r\n\r\n /**\r\n * Processes the paths\r\n *\r\n * @function\r\n * @param rule {String}\r\n * @param isClip {Boolean}\r\n * @private\r\n * @ignore\r\n */\r\n var drawPaths = function(rule, isClip) {\r\n if (rule === \"stroke\" && !isClip && isStrokeTransparent.call(this)) {\r\n return;\r\n }\r\n\r\n if (rule !== \"stroke\" && !isClip && isFillTransparent.call(this)) {\r\n return;\r\n }\r\n\r\n var moves = [];\r\n\r\n //var alpha = (this.ctx.fillOpacity < 1) ? this.ctx.fillOpacity : this.ctx.globalAlpha;\r\n var delta;\r\n var xPath = this.path;\r\n for (var i = 0; i < xPath.length; i++) {\r\n var pt = xPath[i];\r\n\r\n switch (pt.type) {\r\n case \"begin\":\r\n moves.push({\r\n begin: true\r\n });\r\n break;\r\n\r\n case \"close\":\r\n moves.push({\r\n close: true\r\n });\r\n break;\r\n\r\n case \"mt\":\r\n moves.push({\r\n start: pt,\r\n deltas: [],\r\n abs: []\r\n });\r\n break;\r\n\r\n case \"lt\":\r\n var iii = moves.length;\r\n if (xPath[i - 1] && !isNaN(xPath[i - 1].x)) {\r\n delta = [pt.x - xPath[i - 1].x, pt.y - xPath[i - 1].y];\r\n if (iii > 0) {\r\n for (iii; iii >= 0; iii--) {\r\n if (\r\n moves[iii - 1].close !== true &&\r\n moves[iii - 1].begin !== true\r\n ) {\r\n moves[iii - 1].deltas.push(delta);\r\n moves[iii - 1].abs.push(pt);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case \"bct\":\r\n delta = [\r\n pt.x1 - xPath[i - 1].x,\r\n pt.y1 - xPath[i - 1].y,\r\n pt.x2 - xPath[i - 1].x,\r\n pt.y2 - xPath[i - 1].y,\r\n pt.x - xPath[i - 1].x,\r\n pt.y - xPath[i - 1].y\r\n ];\r\n moves[moves.length - 1].deltas.push(delta);\r\n break;\r\n\r\n case \"qct\":\r\n var x1 = xPath[i - 1].x + (2.0 / 3.0) * (pt.x1 - xPath[i - 1].x);\r\n var y1 = xPath[i - 1].y + (2.0 / 3.0) * (pt.y1 - xPath[i - 1].y);\r\n var x2 = pt.x + (2.0 / 3.0) * (pt.x1 - pt.x);\r\n var y2 = pt.y + (2.0 / 3.0) * (pt.y1 - pt.y);\r\n var x3 = pt.x;\r\n var y3 = pt.y;\r\n delta = [\r\n x1 - xPath[i - 1].x,\r\n y1 - xPath[i - 1].y,\r\n x2 - xPath[i - 1].x,\r\n y2 - xPath[i - 1].y,\r\n x3 - xPath[i - 1].x,\r\n y3 - xPath[i - 1].y\r\n ];\r\n moves[moves.length - 1].deltas.push(delta);\r\n break;\r\n\r\n case \"arc\":\r\n moves.push({\r\n deltas: [],\r\n abs: [],\r\n arc: true\r\n });\r\n\r\n if (Array.isArray(moves[moves.length - 1].abs)) {\r\n moves[moves.length - 1].abs.push(pt);\r\n }\r\n break;\r\n }\r\n }\r\n var style;\r\n if (!isClip) {\r\n if (rule === \"stroke\") {\r\n style = \"stroke\";\r\n } else {\r\n style = \"fill\";\r\n }\r\n } else {\r\n style = null;\r\n }\r\n\r\n var began = false;\r\n for (var k = 0; k < moves.length; k++) {\r\n if (moves[k].arc) {\r\n var arcs = moves[k].abs;\r\n\r\n for (var ii = 0; ii < arcs.length; ii++) {\r\n var arc = arcs[ii];\r\n\r\n if (arc.type === \"arc\") {\r\n drawArc.call(\r\n this,\r\n arc.x,\r\n arc.y,\r\n arc.radius,\r\n arc.startAngle,\r\n arc.endAngle,\r\n arc.counterclockwise,\r\n undefined,\r\n isClip,\r\n !began\r\n );\r\n } else {\r\n drawLine.call(this, arc.x, arc.y);\r\n }\r\n began = true;\r\n }\r\n } else if (moves[k].close === true) {\r\n this.pdf.internal.out(\"h\");\r\n began = false;\r\n } else if (moves[k].begin !== true) {\r\n var x = moves[k].start.x;\r\n var y = moves[k].start.y;\r\n drawLines.call(this, moves[k].deltas, x, y);\r\n began = true;\r\n }\r\n }\r\n\r\n if (style) {\r\n putStyle.call(this, style);\r\n }\r\n if (isClip) {\r\n doClip.call(this);\r\n }\r\n };\r\n\r\n var getBaseline = function(y) {\r\n var height =\r\n this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor;\r\n var descent = height * (this.pdf.internal.getLineHeightFactor() - 1);\r\n switch (this.ctx.textBaseline) {\r\n case \"bottom\":\r\n return y - descent;\r\n case \"top\":\r\n return y + height - descent;\r\n case \"hanging\":\r\n return y + height - 2 * descent;\r\n case \"middle\":\r\n return y + height / 2 - descent;\r\n case \"ideographic\":\r\n // TODO not implemented\r\n return y;\r\n case \"alphabetic\":\r\n default:\r\n return y;\r\n }\r\n };\r\n\r\n var getTextBottom = function(yBaseLine) {\r\n var height =\r\n this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor;\r\n var descent = height * (this.pdf.internal.getLineHeightFactor() - 1);\r\n return yBaseLine + descent;\r\n };\r\n\r\n Context2D.prototype.createLinearGradient = function createLinearGradient() {\r\n var canvasGradient = function canvasGradient() {};\r\n\r\n canvasGradient.colorStops = [];\r\n canvasGradient.addColorStop = function(offset, color) {\r\n this.colorStops.push([offset, color]);\r\n };\r\n\r\n canvasGradient.getColor = function() {\r\n if (this.colorStops.length === 0) {\r\n return \"#000000\";\r\n }\r\n\r\n return this.colorStops[0][1];\r\n };\r\n\r\n canvasGradient.isCanvasGradient = true;\r\n return canvasGradient;\r\n };\r\n Context2D.prototype.createPattern = function createPattern() {\r\n return this.createLinearGradient();\r\n };\r\n Context2D.prototype.createRadialGradient = function createRadialGradient() {\r\n return this.createLinearGradient();\r\n };\r\n\r\n /**\r\n *\r\n * @param x Edge point X\r\n * @param y Edge point Y\r\n * @param r Radius\r\n * @param a1 start angle\r\n * @param a2 end angle\r\n * @param counterclockwise\r\n * @param style\r\n * @param isClip\r\n */\r\n var drawArc = function(\r\n x,\r\n y,\r\n r,\r\n a1,\r\n a2,\r\n counterclockwise,\r\n style,\r\n isClip,\r\n includeMove\r\n ) {\r\n // http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html\r\n var curves = createArc.call(this, r, a1, a2, counterclockwise);\r\n\r\n for (var i = 0; i < curves.length; i++) {\r\n var curve = curves[i];\r\n if (i === 0) {\r\n if (includeMove) {\r\n doMove.call(this, curve.x1 + x, curve.y1 + y);\r\n } else {\r\n drawLine.call(this, curve.x1 + x, curve.y1 + y);\r\n }\r\n }\r\n drawCurve.call(\r\n this,\r\n x,\r\n y,\r\n curve.x2,\r\n curve.y2,\r\n curve.x3,\r\n curve.y3,\r\n curve.x4,\r\n curve.y4\r\n );\r\n }\r\n\r\n if (!isClip) {\r\n putStyle.call(this, style);\r\n } else {\r\n doClip.call(this);\r\n }\r\n };\r\n\r\n var putStyle = function(style) {\r\n switch (style) {\r\n case \"stroke\":\r\n this.pdf.internal.out(\"S\");\r\n break;\r\n case \"fill\":\r\n this.pdf.internal.out(\"f\");\r\n break;\r\n }\r\n };\r\n\r\n var doClip = function() {\r\n this.pdf.clip();\r\n this.pdf.discardPath();\r\n };\r\n\r\n var doMove = function(x, y) {\r\n this.pdf.internal.out(\r\n getHorizontalCoordinateString(x) +\r\n \" \" +\r\n getVerticalCoordinateString(y) +\r\n \" m\"\r\n );\r\n };\r\n\r\n var putText = function(options) {\r\n var textAlign;\r\n switch (options.align) {\r\n case \"right\":\r\n case \"end\":\r\n textAlign = \"right\";\r\n break;\r\n case \"center\":\r\n textAlign = \"center\";\r\n break;\r\n case \"left\":\r\n case \"start\":\r\n default:\r\n textAlign = \"left\";\r\n break;\r\n }\r\n\r\n var textDimensions = this.pdf.getTextDimensions(options.text);\r\n var yBaseLine = getBaseline.call(this, options.y);\r\n var yBottom = getTextBottom.call(this, yBaseLine);\r\n var yTop = yBottom - textDimensions.h;\r\n\r\n var pt = this.ctx.transform.applyToPoint(new Point(options.x, yBaseLine));\r\n var decomposedTransformationMatrix = this.ctx.transform.decompose();\r\n var matrix = new Matrix();\r\n matrix = matrix.multiply(decomposedTransformationMatrix.translate);\r\n matrix = matrix.multiply(decomposedTransformationMatrix.skew);\r\n matrix = matrix.multiply(decomposedTransformationMatrix.scale);\r\n\r\n var baselineRect = this.ctx.transform.applyToRectangle(\r\n new Rectangle(options.x, yBaseLine, textDimensions.w, textDimensions.h)\r\n );\r\n var textBounds = matrix.applyToRectangle(\r\n new Rectangle(options.x, yTop, textDimensions.w, textDimensions.h)\r\n );\r\n var pageArray = getPagesByPath.call(this, textBounds);\r\n var pages = [];\r\n for (var ii = 0; ii < pageArray.length; ii += 1) {\r\n if (pages.indexOf(pageArray[ii]) === -1) {\r\n pages.push(pageArray[ii]);\r\n }\r\n }\r\n\r\n sortPages(pages);\r\n\r\n var clipPath, oldSize, oldLineWidth;\r\n if (this.autoPaging) {\r\n var min = pages[0];\r\n var max = pages[pages.length - 1];\r\n for (var i = min; i < max + 1; i++) {\r\n this.pdf.setPage(i);\r\n\r\n var topMargin = i === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n var firstPageHeight =\r\n this.pdf.internal.pageSize.height -\r\n this.posY -\r\n this.margin[0] -\r\n this.margin[2];\r\n var pageHeightMinusBottomMargin =\r\n this.pdf.internal.pageSize.height - this.margin[2];\r\n var pageHeightMinusMargins =\r\n pageHeightMinusBottomMargin - this.margin[0];\r\n var pageWidthMinusRightMargin =\r\n this.pdf.internal.pageSize.width - this.margin[1];\r\n var pageWidthMinusMargins = pageWidthMinusRightMargin - this.margin[3];\r\n var previousPageHeightSum =\r\n i === 1 ? 0 : firstPageHeight + (i - 2) * pageHeightMinusMargins;\r\n\r\n if (this.ctx.clip_path.length !== 0) {\r\n var tmpPaths = this.path;\r\n clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n this.path = pathPositionRedo(\r\n clipPath,\r\n this.posX + this.margin[3],\r\n -1 * previousPageHeightSum + topMargin\r\n );\r\n drawPaths.call(this, \"fill\", true);\r\n this.path = tmpPaths;\r\n }\r\n var textBoundsOnPage = pathPositionRedo(\r\n [JSON.parse(JSON.stringify(textBounds))],\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n )[0];\r\n\r\n if (options.scale >= 0.01) {\r\n oldSize = this.pdf.internal.getFontSize();\r\n this.pdf.setFontSize(oldSize * options.scale);\r\n oldLineWidth = this.lineWidth;\r\n this.lineWidth = oldLineWidth * options.scale;\r\n }\r\n\r\n var doSlice = this.autoPaging !== \"text\";\r\n\r\n if (\r\n doSlice ||\r\n textBoundsOnPage.y + textBoundsOnPage.h <= pageHeightMinusBottomMargin\r\n ) {\r\n if (\r\n doSlice ||\r\n (textBoundsOnPage.y >= topMargin &&\r\n textBoundsOnPage.x <= pageWidthMinusRightMargin)\r\n ) {\r\n var croppedText = doSlice\r\n ? options.text\r\n : this.pdf.splitTextToSize(\r\n options.text,\r\n options.maxWidth ||\r\n pageWidthMinusRightMargin - textBoundsOnPage.x\r\n )[0];\r\n var baseLineRectOnPage = pathPositionRedo(\r\n [JSON.parse(JSON.stringify(baselineRect))],\r\n this.posX + this.margin[3],\r\n -previousPageHeightSum +\r\n topMargin +\r\n this.ctx.prevPageLastElemOffset\r\n )[0];\r\n\r\n const needsClipping =\r\n doSlice && (i > min || i < max) && hasMargins.call(this);\r\n\r\n if (needsClipping) {\r\n this.pdf.saveGraphicsState();\r\n this.pdf\r\n .rect(\r\n this.margin[3],\r\n this.margin[0],\r\n pageWidthMinusMargins,\r\n pageHeightMinusMargins,\r\n null\r\n )\r\n .clip()\r\n .discardPath();\r\n }\r\n\r\n this.pdf.text(\r\n croppedText,\r\n baseLineRectOnPage.x,\r\n baseLineRectOnPage.y,\r\n {\r\n angle: options.angle,\r\n align: textAlign,\r\n renderingMode: options.renderingMode\r\n }\r\n );\r\n\r\n if (needsClipping) {\r\n this.pdf.restoreGraphicsState();\r\n }\r\n }\r\n } else {\r\n // This text is the last element of the page, but it got cut off due to the margin\r\n // so we render it in the next page\r\n\r\n if (textBoundsOnPage.y < pageHeightMinusBottomMargin) {\r\n // As a result, all other elements have their y offset increased\r\n this.ctx.prevPageLastElemOffset +=\r\n pageHeightMinusBottomMargin - textBoundsOnPage.y;\r\n }\r\n }\r\n\r\n if (options.scale >= 0.01) {\r\n this.pdf.setFontSize(oldSize);\r\n this.lineWidth = oldLineWidth;\r\n }\r\n }\r\n } else {\r\n if (options.scale >= 0.01) {\r\n oldSize = this.pdf.internal.getFontSize();\r\n this.pdf.setFontSize(oldSize * options.scale);\r\n oldLineWidth = this.lineWidth;\r\n this.lineWidth = oldLineWidth * options.scale;\r\n }\r\n this.pdf.text(options.text, pt.x + this.posX, pt.y + this.posY, {\r\n angle: options.angle,\r\n align: textAlign,\r\n renderingMode: options.renderingMode,\r\n maxWidth: options.maxWidth\r\n });\r\n\r\n if (options.scale >= 0.01) {\r\n this.pdf.setFontSize(oldSize);\r\n this.lineWidth = oldLineWidth;\r\n }\r\n }\r\n };\r\n\r\n var drawLine = function(x, y, prevX, prevY) {\r\n prevX = prevX || 0;\r\n prevY = prevY || 0;\r\n\r\n this.pdf.internal.out(\r\n getHorizontalCoordinateString(x + prevX) +\r\n \" \" +\r\n getVerticalCoordinateString(y + prevY) +\r\n \" l\"\r\n );\r\n };\r\n\r\n var drawLines = function(lines, x, y) {\r\n return this.pdf.lines(lines, x, y, null, null);\r\n };\r\n\r\n var drawCurve = function(x, y, x1, y1, x2, y2, x3, y3) {\r\n this.pdf.internal.out(\r\n [\r\n f2(getHorizontalCoordinate(x1 + x)),\r\n f2(getVerticalCoordinate(y1 + y)),\r\n f2(getHorizontalCoordinate(x2 + x)),\r\n f2(getVerticalCoordinate(y2 + y)),\r\n f2(getHorizontalCoordinate(x3 + x)),\r\n f2(getVerticalCoordinate(y3 + y)),\r\n \"c\"\r\n ].join(\" \")\r\n );\r\n };\r\n\r\n /**\r\n * Return a array of objects that represent bezier curves which approximate the circular arc centered at the origin, from startAngle to endAngle (radians) with the specified radius.\r\n *\r\n * Each bezier curve is an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.\r\n * @function createArc\r\n */\r\n var createArc = function(radius, startAngle, endAngle, anticlockwise) {\r\n var EPSILON = 0.00001; // Roughly 1/1000th of a degree, see below\r\n var twoPi = Math.PI * 2;\r\n var halfPi = Math.PI / 2.0;\r\n\r\n while (startAngle > endAngle) {\r\n startAngle = startAngle - twoPi;\r\n }\r\n var totalAngle = Math.abs(endAngle - startAngle);\r\n if (totalAngle < twoPi) {\r\n if (anticlockwise) {\r\n totalAngle = twoPi - totalAngle;\r\n }\r\n }\r\n\r\n // Compute the sequence of arc curves, up to PI/2 at a time.\r\n var curves = [];\r\n\r\n // clockwise or counterclockwise\r\n var sgn = anticlockwise ? -1 : +1;\r\n\r\n var a1 = startAngle;\r\n for (; totalAngle > EPSILON; ) {\r\n var remain = sgn * Math.min(totalAngle, halfPi);\r\n var a2 = a1 + remain;\r\n curves.push(createSmallArc.call(this, radius, a1, a2));\r\n totalAngle -= Math.abs(a2 - a1);\r\n a1 = a2;\r\n }\r\n\r\n return curves;\r\n };\r\n\r\n /**\r\n * Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. The arc's radius is r.\r\n *\r\n * Returns an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.\r\n *\r\n * This algorithm is based on the approach described in: A. Riškus, \"Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa,\" Information Technology and Control, 35(4), 2006 pp. 371-378.\r\n */\r\n var createSmallArc = function(r, a1, a2) {\r\n var a = (a2 - a1) / 2.0;\r\n\r\n var x4 = r * Math.cos(a);\r\n var y4 = r * Math.sin(a);\r\n var x1 = x4;\r\n var y1 = -y4;\r\n\r\n var q1 = x1 * x1 + y1 * y1;\r\n var q2 = q1 + x1 * x4 + y1 * y4;\r\n var k2 = ((4 / 3) * (Math.sqrt(2 * q1 * q2) - q2)) / (x1 * y4 - y1 * x4);\r\n\r\n var x2 = x1 - k2 * y1;\r\n var y2 = y1 + k2 * x1;\r\n var x3 = x2;\r\n var y3 = -y2;\r\n\r\n var ar = a + a1;\r\n var cos_ar = Math.cos(ar);\r\n var sin_ar = Math.sin(ar);\r\n\r\n return {\r\n x1: r * Math.cos(a1),\r\n y1: r * Math.sin(a1),\r\n x2: x2 * cos_ar - y2 * sin_ar,\r\n y2: x2 * sin_ar + y2 * cos_ar,\r\n x3: x3 * cos_ar - y3 * sin_ar,\r\n y3: x3 * sin_ar + y3 * cos_ar,\r\n x4: r * Math.cos(a2),\r\n y4: r * Math.sin(a2)\r\n };\r\n };\r\n\r\n var rad2deg = function(value) {\r\n return (value * 180) / Math.PI;\r\n };\r\n\r\n var getQuadraticCurveBoundary = function(sx, sy, cpx, cpy, ex, ey) {\r\n var midX1 = sx + (cpx - sx) * 0.5;\r\n var midY1 = sy + (cpy - sy) * 0.5;\r\n var midX2 = ex + (cpx - ex) * 0.5;\r\n var midY2 = ey + (cpy - ey) * 0.5;\r\n var resultX1 = Math.min(sx, ex, midX1, midX2);\r\n var resultX2 = Math.max(sx, ex, midX1, midX2);\r\n var resultY1 = Math.min(sy, ey, midY1, midY2);\r\n var resultY2 = Math.max(sy, ey, midY1, midY2);\r\n return new Rectangle(\r\n resultX1,\r\n resultY1,\r\n resultX2 - resultX1,\r\n resultY2 - resultY1\r\n );\r\n };\r\n\r\n //De Casteljau algorithm\r\n var getBezierCurveBoundary = function(ax, ay, bx, by, cx, cy, dx, dy) {\r\n var tobx = bx - ax;\r\n var toby = by - ay;\r\n var tocx = cx - bx;\r\n var tocy = cy - by;\r\n var todx = dx - cx;\r\n var tody = dy - cy;\r\n var precision = 40;\r\n var d,\r\n i,\r\n px,\r\n py,\r\n qx,\r\n qy,\r\n rx,\r\n ry,\r\n tx,\r\n ty,\r\n sx,\r\n sy,\r\n x,\r\n y,\r\n minx,\r\n miny,\r\n maxx,\r\n maxy,\r\n toqx,\r\n toqy,\r\n torx,\r\n tory,\r\n totx,\r\n toty;\r\n for (i = 0; i < precision + 1; i++) {\r\n d = i / precision;\r\n px = ax + d * tobx;\r\n py = ay + d * toby;\r\n qx = bx + d * tocx;\r\n qy = by + d * tocy;\r\n rx = cx + d * todx;\r\n ry = cy + d * tody;\r\n toqx = qx - px;\r\n toqy = qy - py;\r\n torx = rx - qx;\r\n tory = ry - qy;\r\n\r\n sx = px + d * toqx;\r\n sy = py + d * toqy;\r\n tx = qx + d * torx;\r\n ty = qy + d * tory;\r\n totx = tx - sx;\r\n toty = ty - sy;\r\n\r\n x = sx + d * totx;\r\n y = sy + d * toty;\r\n if (i == 0) {\r\n minx = x;\r\n miny = y;\r\n maxx = x;\r\n maxy = y;\r\n } else {\r\n minx = Math.min(minx, x);\r\n miny = Math.min(miny, y);\r\n maxx = Math.max(maxx, x);\r\n maxy = Math.max(maxy, y);\r\n }\r\n }\r\n return new Rectangle(\r\n Math.round(minx),\r\n Math.round(miny),\r\n Math.round(maxx - minx),\r\n Math.round(maxy - miny)\r\n );\r\n };\r\n\r\n var getPrevLineDashValue = function(lineDash, lineDashOffset) {\r\n return JSON.stringify({\r\n lineDash: lineDash,\r\n lineDashOffset: lineDashOffset\r\n });\r\n };\r\n\r\n var setLineDash = function() {\r\n // Avoid unnecessary line dash declarations.\r\n if (\r\n !this.prevLineDash &&\r\n !this.ctx.lineDash.length &&\r\n !this.ctx.lineDashOffset\r\n ) {\r\n return;\r\n }\r\n\r\n // Avoid unnecessary line dash declarations.\r\n const nextLineDash = getPrevLineDashValue(\r\n this.ctx.lineDash,\r\n this.ctx.lineDashOffset\r\n );\r\n if (this.prevLineDash !== nextLineDash) {\r\n this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset);\r\n this.prevLineDash = nextLineDash;\r\n }\r\n };\r\n})(jsPDF.API);\r\n","/**\n * @license\n * jsPDF filters PlugIn\n * Copyright (c) 2014 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { zlibSync } from \"../libs/fflate.js\";\n\n(function(jsPDFAPI) {\n \"use strict\";\n\n var ASCII85Encode = function(a) {\n var b, c, d, e, f, g, h, i, j, k;\n // eslint-disable-next-line no-control-regex\n for (\n !/[^\\x00-\\xFF]/.test(a),\n b = \"\\x00\\x00\\x00\\x00\".slice(a.length % 4 || 4),\n a += b,\n c = [],\n d = 0,\n e = a.length;\n e > d;\n d += 4\n )\n (f =\n (a.charCodeAt(d) << 24) +\n (a.charCodeAt(d + 1) << 16) +\n (a.charCodeAt(d + 2) << 8) +\n a.charCodeAt(d + 3)),\n 0 !== f\n ? ((k = f % 85),\n (f = (f - k) / 85),\n (j = f % 85),\n (f = (f - j) / 85),\n (i = f % 85),\n (f = (f - i) / 85),\n (h = f % 85),\n (f = (f - h) / 85),\n (g = f % 85),\n c.push(g + 33, h + 33, i + 33, j + 33, k + 33))\n : c.push(122);\n return (\n (function(a, b) {\n for (var c = b; c > 0; c--) a.pop();\n })(c, b.length),\n String.fromCharCode.apply(String, c) + \"~>\"\n );\n };\n\n var ASCII85Decode = function(a) {\n var c,\n d,\n e,\n f,\n g,\n h = String,\n l = \"length\",\n w = 255,\n x = \"charCodeAt\",\n y = \"slice\",\n z = \"replace\";\n for (\n \"~>\" === a[y](-2),\n a = a[y](0, -2)\n [z](/\\s/g, \"\")\n [z](\"z\", \"!!!!!\"),\n c = \"uuuuu\"[y](a[l] % 5 || 5),\n a += c,\n e = [],\n f = 0,\n g = a[l];\n g > f;\n f += 5\n )\n (d =\n 52200625 * (a[x](f) - 33) +\n 614125 * (a[x](f + 1) - 33) +\n 7225 * (a[x](f + 2) - 33) +\n 85 * (a[x](f + 3) - 33) +\n (a[x](f + 4) - 33)),\n e.push(w & (d >> 24), w & (d >> 16), w & (d >> 8), w & d);\n return (\n (function(a, b) {\n for (var c = b; c > 0; c--) a.pop();\n })(e, c[l]),\n h.fromCharCode.apply(h, e)\n );\n };\n\n var ASCIIHexEncode = function(value) {\n return (\n value\n .split(\"\")\n .map(function(value) {\n return (\"0\" + value.charCodeAt().toString(16)).slice(-2);\n })\n .join(\"\") + \">\"\n );\n };\n\n var ASCIIHexDecode = function(value) {\n var regexCheckIfHex = new RegExp(/^([0-9A-Fa-f]{2})+$/);\n value = value.replace(/\\s/g, \"\");\n if (value.indexOf(\">\") !== -1) {\n value = value.substr(0, value.indexOf(\">\"));\n }\n if (value.length % 2) {\n value += \"0\";\n }\n if (regexCheckIfHex.test(value) === false) {\n return \"\";\n }\n var result = \"\";\n for (var i = 0; i < value.length; i += 2) {\n result += String.fromCharCode(\"0x\" + (value[i] + value[i + 1]));\n }\n return result;\n };\n /*\n var FlatePredictors = {\n None: 1,\n TIFF: 2,\n PNG_None: 10,\n PNG_Sub: 11,\n PNG_Up: 12,\n PNG_Average: 13,\n PNG_Paeth: 14,\n PNG_Optimum: 15\n };\n */\n\n var FlateEncode = function(data) {\n var arr = new Uint8Array(data.length);\n var i = data.length;\n while (i--) {\n arr[i] = data.charCodeAt(i);\n }\n arr = zlibSync(arr);\n data = arr.reduce(function(data, byte) {\n return data + String.fromCharCode(byte);\n }, \"\");\n return data;\n };\n\n jsPDFAPI.processDataByFilters = function(origData, filterChain) {\n \"use strict\";\n var i = 0;\n var data = origData || \"\";\n var reverseChain = [];\n filterChain = filterChain || [];\n\n if (typeof filterChain === \"string\") {\n filterChain = [filterChain];\n }\n\n for (i = 0; i < filterChain.length; i += 1) {\n switch (filterChain[i]) {\n case \"ASCII85Decode\":\n case \"/ASCII85Decode\":\n data = ASCII85Decode(data);\n reverseChain.push(\"/ASCII85Encode\");\n break;\n case \"ASCII85Encode\":\n case \"/ASCII85Encode\":\n data = ASCII85Encode(data);\n reverseChain.push(\"/ASCII85Decode\");\n break;\n case \"ASCIIHexDecode\":\n case \"/ASCIIHexDecode\":\n data = ASCIIHexDecode(data);\n reverseChain.push(\"/ASCIIHexEncode\");\n break;\n case \"ASCIIHexEncode\":\n case \"/ASCIIHexEncode\":\n data = ASCIIHexEncode(data);\n reverseChain.push(\"/ASCIIHexDecode\");\n break;\n case \"FlateEncode\":\n case \"/FlateEncode\":\n data = FlateEncode(data);\n reverseChain.push(\"/FlateDecode\");\n break;\n default:\n throw new Error(\n 'The filter: \"' + filterChain[i] + '\" is not implemented'\n );\n }\n }\n\n return { data: data, reverseChain: reverseChain.reverse().join(\" \") };\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2018 Erik Koopmans\n * Released under the MIT License.\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { normalizeFontFace } from \"../libs/fontFace.js\";\nimport { globalObject } from \"../libs/globalObject.js\";\n\n/**\n * jsPDF html PlugIn\n *\n * @name html\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n function loadHtml2Canvas() {\n return (function() {\n if (globalObject[\"html2canvas\"]) {\n return Promise.resolve(globalObject[\"html2canvas\"]);\n }\n\n return import(\"html2canvas\");\n\n })()\n .catch(function(e) {\n return Promise.reject(new Error(\"Could not load html2canvas: \" + e));\n })\n .then(function(html2canvas) {\n return html2canvas.default ? html2canvas.default : html2canvas;\n });\n }\n\n function loadDomPurify() {\n return (function() {\n if (globalObject[\"DOMPurify\"]) {\n return Promise.resolve(globalObject[\"DOMPurify\"]);\n }\n\n return import(\"dompurify\");\n\n })()\n .catch(function(e) {\n return Promise.reject(new Error(\"Could not load dompurify: \" + e));\n })\n .then(function(dompurify) {\n return dompurify.default ? dompurify.default : dompurify;\n });\n }\n\n /**\n * Determine the type of a variable/object.\n *\n * @private\n * @ignore\n */\n var objType = function(obj) {\n var type = typeof obj;\n if (type === \"undefined\") return \"undefined\";\n else if (type === \"string\" || obj instanceof String) return \"string\";\n else if (type === \"number\" || obj instanceof Number) return \"number\";\n else if (type === \"function\" || obj instanceof Function) return \"function\";\n else if (!!obj && obj.constructor === Array) return \"array\";\n else if (obj && obj.nodeType === 1) return \"element\";\n else if (type === \"object\") return \"object\";\n else return \"unknown\";\n };\n\n /**\n * Create an HTML element with optional className, innerHTML, and style.\n *\n * @private\n * @ignore\n */\n var createElement = function(tagName, opt) {\n var el = document.createElement(tagName);\n if (opt.className) el.className = opt.className;\n if (opt.innerHTML && opt.dompurify) {\n el.innerHTML = opt.dompurify.sanitize(opt.innerHTML);\n }\n for (var key in opt.style) {\n el.style[key] = opt.style[key];\n }\n return el;\n };\n\n /**\n * Deep-clone a node and preserve contents/properties.\n *\n * @private\n * @ignore\n */\n var cloneNode = function(node, javascriptEnabled) {\n // Recursively clone the node.\n var clone =\n node.nodeType === 3\n ? document.createTextNode(node.nodeValue)\n : node.cloneNode(false);\n for (var child = node.firstChild; child; child = child.nextSibling) {\n if (\n javascriptEnabled === true ||\n child.nodeType !== 1 ||\n child.nodeName !== \"SCRIPT\"\n ) {\n clone.appendChild(cloneNode(child, javascriptEnabled));\n }\n }\n\n if (node.nodeType === 1) {\n // Preserve contents/properties of special nodes.\n if (node.nodeName === \"CANVAS\") {\n clone.width = node.width;\n clone.height = node.height;\n clone.getContext(\"2d\").drawImage(node, 0, 0);\n } else if (node.nodeName === \"TEXTAREA\" || node.nodeName === \"SELECT\") {\n clone.value = node.value;\n }\n\n // Preserve the node's scroll position when it loads.\n clone.addEventListener(\n \"load\",\n function() {\n clone.scrollTop = node.scrollTop;\n clone.scrollLeft = node.scrollLeft;\n },\n true\n );\n }\n\n // Return the cloned node.\n return clone;\n };\n\n /* ----- CONSTRUCTOR ----- */\n\n var Worker = function Worker(opt) {\n // Create the root parent for the proto chain, and the starting Worker.\n var root = Object.assign(\n Worker.convert(Promise.resolve()),\n JSON.parse(JSON.stringify(Worker.template))\n );\n var self = Worker.convert(Promise.resolve(), root);\n\n // Set progress, optional settings, and return.\n self = self.setProgress(1, Worker, 1, [Worker]);\n self = self.set(opt);\n return self;\n };\n\n // Boilerplate for subclassing Promise.\n Worker.prototype = Object.create(Promise.prototype);\n Worker.prototype.constructor = Worker;\n\n // Converts/casts promises into Workers.\n Worker.convert = function convert(promise, inherit) {\n // Uses prototypal inheritance to receive changes made to ancestors' properties.\n promise.__proto__ = inherit || Worker.prototype;\n return promise;\n };\n\n Worker.template = {\n prop: {\n src: null,\n container: null,\n overlay: null,\n canvas: null,\n img: null,\n pdf: null,\n pageSize: null,\n callback: function() {}\n },\n progress: {\n val: 0,\n state: null,\n n: 0,\n stack: []\n },\n opt: {\n filename: \"file.pdf\",\n margin: [0, 0, 0, 0],\n enableLinks: true,\n x: 0,\n y: 0,\n html2canvas: {},\n jsPDF: {},\n backgroundColor: \"transparent\"\n }\n };\n\n /* ----- FROM / TO ----- */\n\n Worker.prototype.from = function from(src, type) {\n function getType(src) {\n switch (objType(src)) {\n case \"string\":\n return \"string\";\n case \"element\":\n return src.nodeName.toLowerCase() === \"canvas\" ? \"canvas\" : \"element\";\n default:\n return \"unknown\";\n }\n }\n\n return this.then(function from_main() {\n type = type || getType(src);\n switch (type) {\n case \"string\":\n return this.then(loadDomPurify).then(function(dompurify) {\n return this.set({\n src: createElement(\"div\", {\n innerHTML: src,\n dompurify: dompurify\n })\n });\n });\n case \"element\":\n return this.set({ src: src });\n case \"canvas\":\n return this.set({ canvas: src });\n case \"img\":\n return this.set({ img: src });\n default:\n return this.error(\"Unknown source type.\");\n }\n });\n };\n\n Worker.prototype.to = function to(target) {\n // Route the 'to' request to the appropriate method.\n switch (target) {\n case \"container\":\n return this.toContainer();\n case \"canvas\":\n return this.toCanvas();\n case \"img\":\n return this.toImg();\n case \"pdf\":\n return this.toPdf();\n default:\n return this.error(\"Invalid target.\");\n }\n };\n\n Worker.prototype.toContainer = function toContainer() {\n // Set up function prerequisites.\n var prereqs = [\n function checkSrc() {\n return (\n this.prop.src || this.error(\"Cannot duplicate - no source HTML.\")\n );\n },\n function checkPageSize() {\n return this.prop.pageSize || this.setPageSize();\n }\n ];\n return this.thenList(prereqs).then(function toContainer_main() {\n // Define the CSS styles for the container and its overlay parent.\n var overlayCSS = {\n position: \"fixed\",\n overflow: \"hidden\",\n zIndex: 1000,\n left: \"-100000px\",\n right: 0,\n bottom: 0,\n top: 0\n };\n var containerCSS = {\n position: \"relative\",\n display: \"inline-block\",\n width:\n (typeof this.opt.width === \"number\" &&\n !isNaN(this.opt.width) &&\n typeof this.opt.windowWidth === \"number\" &&\n !isNaN(this.opt.windowWidth)\n ? this.opt.windowWidth\n : Math.max(\n this.prop.src.clientWidth,\n this.prop.src.scrollWidth,\n this.prop.src.offsetWidth\n )) + \"px\",\n left: 0,\n right: 0,\n top: 0,\n margin: \"auto\",\n backgroundColor: this.opt.backgroundColor\n }; // Set the overlay to hidden (could be changed in the future to provide a print preview).\n\n var source = cloneNode(\n this.prop.src,\n this.opt.html2canvas.javascriptEnabled\n );\n\n if (source.tagName === \"BODY\") {\n containerCSS.height =\n Math.max(\n document.body.scrollHeight,\n document.body.offsetHeight,\n document.documentElement.clientHeight,\n document.documentElement.scrollHeight,\n document.documentElement.offsetHeight\n ) + \"px\";\n }\n\n this.prop.overlay = createElement(\"div\", {\n className: \"html2pdf__overlay\",\n style: overlayCSS\n });\n this.prop.container = createElement(\"div\", {\n className: \"html2pdf__container\",\n style: containerCSS\n });\n this.prop.container.appendChild(source);\n this.prop.container.firstChild.appendChild(\n createElement(\"div\", {\n style: {\n clear: \"both\",\n border: \"0 none transparent\",\n margin: 0,\n padding: 0,\n height: 0\n }\n })\n );\n this.prop.container.style.float = \"none\";\n this.prop.overlay.appendChild(this.prop.container);\n document.body.appendChild(this.prop.overlay);\n this.prop.container.firstChild.style.position = \"relative\";\n this.prop.container.height =\n Math.max(\n this.prop.container.firstChild.clientHeight,\n this.prop.container.firstChild.scrollHeight,\n this.prop.container.firstChild.offsetHeight\n ) + \"px\";\n });\n };\n\n Worker.prototype.toCanvas = function toCanvas() {\n // Set up function prerequisites.\n var prereqs = [\n function checkContainer() {\n return (\n document.body.contains(this.prop.container) || this.toContainer()\n );\n }\n ];\n\n // Fulfill prereqs then create the canvas.\n return this.thenList(prereqs)\n .then(loadHtml2Canvas)\n .then(function toCanvas_main(html2canvas) {\n // Handle old-fashioned 'onrendered' argument.\n var options = Object.assign({}, this.opt.html2canvas);\n delete options.onrendered;\n\n return html2canvas(this.prop.container, options);\n })\n .then(function toCanvas_post(canvas) {\n // Handle old-fashioned 'onrendered' argument.\n var onRendered = this.opt.html2canvas.onrendered || function() {};\n onRendered(canvas);\n\n this.prop.canvas = canvas;\n document.body.removeChild(this.prop.overlay);\n });\n };\n\n Worker.prototype.toContext2d = function toContext2d() {\n // Set up function prerequisites.\n var prereqs = [\n function checkContainer() {\n return (\n document.body.contains(this.prop.container) || this.toContainer()\n );\n }\n ];\n\n // Fulfill prereqs then create the canvas.\n return this.thenList(prereqs)\n .then(loadHtml2Canvas)\n .then(function toContext2d_main(html2canvas) {\n // Handle old-fashioned 'onrendered' argument.\n\n var pdf = this.opt.jsPDF;\n var fontFaces = this.opt.fontFaces;\n\n var scale =\n typeof this.opt.width === \"number\" &&\n !isNaN(this.opt.width) &&\n typeof this.opt.windowWidth === \"number\" &&\n !isNaN(this.opt.windowWidth)\n ? this.opt.width / this.opt.windowWidth\n : 1;\n\n var options = Object.assign(\n {\n async: true,\n allowTaint: true,\n scale: scale,\n scrollX: this.opt.scrollX || 0,\n scrollY: this.opt.scrollY || 0,\n backgroundColor: \"#ffffff\",\n imageTimeout: 15000,\n logging: true,\n proxy: null,\n removeContainer: true,\n foreignObjectRendering: false,\n useCORS: false\n },\n this.opt.html2canvas\n );\n delete options.onrendered;\n\n pdf.context2d.autoPaging =\n typeof this.opt.autoPaging === \"undefined\"\n ? true\n : this.opt.autoPaging;\n pdf.context2d.posX = this.opt.x;\n pdf.context2d.posY = this.opt.y;\n pdf.context2d.margin = this.opt.margin;\n pdf.context2d.fontFaces = fontFaces;\n\n if (fontFaces) {\n for (var i = 0; i < fontFaces.length; ++i) {\n var font = fontFaces[i];\n var src = font.src.find(function(src) {\n return src.format === \"truetype\";\n });\n\n if (src) {\n pdf.addFont(src.url, font.ref.name, font.ref.style);\n }\n }\n }\n\n options.windowHeight = options.windowHeight || 0;\n options.windowHeight =\n options.windowHeight == 0\n ? Math.max(\n this.prop.container.clientHeight,\n this.prop.container.scrollHeight,\n this.prop.container.offsetHeight\n )\n : options.windowHeight;\n\n pdf.context2d.save(true);\n return html2canvas(this.prop.container, options);\n })\n .then(function toContext2d_post(canvas) {\n this.opt.jsPDF.context2d.restore(true);\n\n // Handle old-fashioned 'onrendered' argument.\n var onRendered = this.opt.html2canvas.onrendered || function() {};\n onRendered(canvas);\n\n this.prop.canvas = canvas;\n document.body.removeChild(this.prop.overlay);\n });\n };\n\n Worker.prototype.toImg = function toImg() {\n // Set up function prerequisites.\n var prereqs = [\n function checkCanvas() {\n return this.prop.canvas || this.toCanvas();\n }\n ];\n\n // Fulfill prereqs then create the image.\n return this.thenList(prereqs).then(function toImg_main() {\n var imgData = this.prop.canvas.toDataURL(\n \"image/\" + this.opt.image.type,\n this.opt.image.quality\n );\n this.prop.img = document.createElement(\"img\");\n this.prop.img.src = imgData;\n });\n };\n\n Worker.prototype.toPdf = function toPdf() {\n // Set up function prerequisites.\n var prereqs = [\n function checkContext2d() {\n return this.toContext2d();\n }\n //function checkCanvas() { return this.prop.canvas || this.toCanvas(); }\n ];\n\n // Fulfill prereqs then create the image.\n return this.thenList(prereqs).then(function toPdf_main() {\n // Create local copies of frequently used properties.\n this.prop.pdf = this.prop.pdf || this.opt.jsPDF;\n });\n };\n\n /* ----- OUTPUT / SAVE ----- */\n\n Worker.prototype.output = function output(type, options, src) {\n // Redirect requests to the correct function (outputPdf / outputImg).\n src = src || \"pdf\";\n if (src.toLowerCase() === \"img\" || src.toLowerCase() === \"image\") {\n return this.outputImg(type, options);\n } else {\n return this.outputPdf(type, options);\n }\n };\n\n Worker.prototype.outputPdf = function outputPdf(type, options) {\n // Set up function prerequisites.\n var prereqs = [\n function checkPdf() {\n return this.prop.pdf || this.toPdf();\n }\n ];\n\n // Fulfill prereqs then perform the appropriate output.\n return this.thenList(prereqs).then(function outputPdf_main() {\n /* Currently implemented output types:\n * https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992\n * save(options), arraybuffer, blob, bloburi/bloburl,\n * datauristring/dataurlstring, dataurlnewwindow, datauri/dataurl\n */\n return this.prop.pdf.output(type, options);\n });\n };\n\n Worker.prototype.outputImg = function outputImg(type) {\n // Set up function prerequisites.\n var prereqs = [\n function checkImg() {\n return this.prop.img || this.toImg();\n }\n ];\n\n // Fulfill prereqs then perform the appropriate output.\n return this.thenList(prereqs).then(function outputImg_main() {\n switch (type) {\n case undefined:\n case \"img\":\n return this.prop.img;\n case \"datauristring\":\n case \"dataurlstring\":\n return this.prop.img.src;\n case \"datauri\":\n case \"dataurl\":\n return (document.location.href = this.prop.img.src);\n default:\n throw 'Image output type \"' + type + '\" is not supported.';\n }\n });\n };\n\n Worker.prototype.save = function save(filename) {\n // Set up function prerequisites.\n var prereqs = [\n function checkPdf() {\n return this.prop.pdf || this.toPdf();\n }\n ];\n\n // Fulfill prereqs, update the filename (if provided), and save the PDF.\n return this.thenList(prereqs)\n .set(filename ? { filename: filename } : null)\n .then(function save_main() {\n this.prop.pdf.save(this.opt.filename);\n });\n };\n\n Worker.prototype.doCallback = function doCallback() {\n // Set up function prerequisites.\n var prereqs = [\n function checkPdf() {\n return this.prop.pdf || this.toPdf();\n }\n ];\n\n // Fulfill prereqs, update the filename (if provided), and save the PDF.\n return this.thenList(prereqs).then(function doCallback_main() {\n this.prop.callback(this.prop.pdf);\n });\n };\n\n /* ----- SET / GET ----- */\n\n Worker.prototype.set = function set(opt) {\n // TODO: Implement ordered pairs?\n\n // Silently ignore invalid or empty input.\n if (objType(opt) !== \"object\") {\n return this;\n }\n\n // Build an array of setter functions to queue.\n var fns = Object.keys(opt || {}).map(function(key) {\n if (key in Worker.template.prop) {\n // Set pre-defined properties.\n return function set_prop() {\n this.prop[key] = opt[key];\n };\n } else {\n switch (key) {\n case \"margin\":\n return this.setMargin.bind(this, opt.margin);\n case \"jsPDF\":\n return function set_jsPDF() {\n this.opt.jsPDF = opt.jsPDF;\n return this.setPageSize();\n };\n case \"pageSize\":\n return this.setPageSize.bind(this, opt.pageSize);\n default:\n // Set any other properties in opt.\n return function set_opt() {\n this.opt[key] = opt[key];\n };\n }\n }\n }, this);\n\n // Set properties within the promise chain.\n return this.then(function set_main() {\n return this.thenList(fns);\n });\n };\n\n Worker.prototype.get = function get(key, cbk) {\n return this.then(function get_main() {\n // Fetch the requested property, either as a predefined prop or in opt.\n var val = key in Worker.template.prop ? this.prop[key] : this.opt[key];\n return cbk ? cbk(val) : val;\n });\n };\n\n Worker.prototype.setMargin = function setMargin(margin) {\n return this.then(function setMargin_main() {\n // Parse the margin property.\n switch (objType(margin)) {\n case \"number\":\n margin = [margin, margin, margin, margin];\n // eslint-disable-next-line no-fallthrough\n case \"array\":\n if (margin.length === 2) {\n margin = [margin[0], margin[1], margin[0], margin[1]];\n }\n if (margin.length === 4) {\n break;\n }\n // eslint-disable-next-line no-fallthrough\n default:\n return this.error(\"Invalid margin array.\");\n }\n\n // Set the margin property, then update pageSize.\n this.opt.margin = margin;\n }).then(this.setPageSize);\n };\n\n Worker.prototype.setPageSize = function setPageSize(pageSize) {\n function toPx(val, k) {\n return Math.floor(((val * k) / 72) * 96);\n }\n\n return this.then(function setPageSize_main() {\n // Retrieve page-size based on jsPDF settings, if not explicitly provided.\n pageSize = pageSize || jsPDF.getPageSize(this.opt.jsPDF);\n\n // Add 'inner' field if not present.\n if (!pageSize.hasOwnProperty(\"inner\")) {\n pageSize.inner = {\n width: pageSize.width - this.opt.margin[1] - this.opt.margin[3],\n height: pageSize.height - this.opt.margin[0] - this.opt.margin[2]\n };\n pageSize.inner.px = {\n width: toPx(pageSize.inner.width, pageSize.k),\n height: toPx(pageSize.inner.height, pageSize.k)\n };\n pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width;\n }\n\n // Attach pageSize to this.\n this.prop.pageSize = pageSize;\n });\n };\n\n Worker.prototype.setProgress = function setProgress(val, state, n, stack) {\n // Immediately update all progress values.\n if (val != null) this.progress.val = val;\n if (state != null) this.progress.state = state;\n if (n != null) this.progress.n = n;\n if (stack != null) this.progress.stack = stack;\n this.progress.ratio = this.progress.val / this.progress.state;\n\n // Return this for command chaining.\n return this;\n };\n\n Worker.prototype.updateProgress = function updateProgress(\n val,\n state,\n n,\n stack\n ) {\n // Immediately update all progress values, using setProgress.\n return this.setProgress(\n val ? this.progress.val + val : null,\n state ? state : null,\n n ? this.progress.n + n : null,\n stack ? this.progress.stack.concat(stack) : null\n );\n };\n\n /* ----- PROMISE MAPPING ----- */\n\n Worker.prototype.then = function then(onFulfilled, onRejected) {\n // Wrap `this` for encapsulation.\n var self = this;\n\n return this.thenCore(onFulfilled, onRejected, function then_main(\n onFulfilled,\n onRejected\n ) {\n // Update progress while queuing, calling, and resolving `then`.\n self.updateProgress(null, null, 1, [onFulfilled]);\n return Promise.prototype.then\n .call(this, function then_pre(val) {\n self.updateProgress(null, onFulfilled);\n return val;\n })\n .then(onFulfilled, onRejected)\n .then(function then_post(val) {\n self.updateProgress(1);\n return val;\n });\n });\n };\n\n Worker.prototype.thenCore = function thenCore(\n onFulfilled,\n onRejected,\n thenBase\n ) {\n // Handle optional thenBase parameter.\n thenBase = thenBase || Promise.prototype.then;\n\n // Wrap `this` for encapsulation and bind it to the promise handlers.\n var self = this;\n if (onFulfilled) {\n onFulfilled = onFulfilled.bind(self);\n }\n if (onRejected) {\n onRejected = onRejected.bind(self);\n }\n\n // Cast self into a Promise to avoid polyfills recursively defining `then`.\n var isNative =\n Promise.toString().indexOf(\"[native code]\") !== -1 &&\n Promise.name === \"Promise\";\n var selfPromise = isNative\n ? self\n : Worker.convert(Object.assign({}, self), Promise.prototype);\n\n // Return the promise, after casting it into a Worker and preserving props.\n var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);\n return Worker.convert(returnVal, self.__proto__);\n };\n\n Worker.prototype.thenExternal = function thenExternal(\n onFulfilled,\n onRejected\n ) {\n // Call `then` and return a standard promise (exits the Worker chain).\n return Promise.prototype.then.call(this, onFulfilled, onRejected);\n };\n\n Worker.prototype.thenList = function thenList(fns) {\n // Queue a series of promise 'factories' into the promise chain.\n var self = this;\n fns.forEach(function thenList_forEach(fn) {\n self = self.thenCore(fn);\n });\n return self;\n };\n\n Worker.prototype[\"catch\"] = function(onRejected) {\n // Bind `this` to the promise handler, call `catch`, and return a Worker.\n if (onRejected) {\n onRejected = onRejected.bind(this);\n }\n var returnVal = Promise.prototype[\"catch\"].call(this, onRejected);\n return Worker.convert(returnVal, this);\n };\n\n Worker.prototype.catchExternal = function catchExternal(onRejected) {\n // Call `catch` and return a standard promise (exits the Worker chain).\n return Promise.prototype[\"catch\"].call(this, onRejected);\n };\n\n Worker.prototype.error = function error(msg) {\n // Throw the error in the Promise chain.\n return this.then(function error_main() {\n throw new Error(msg);\n });\n };\n\n /* ----- ALIASES ----- */\n\n Worker.prototype.using = Worker.prototype.set;\n Worker.prototype.saveAs = Worker.prototype.save;\n Worker.prototype.export = Worker.prototype.output;\n Worker.prototype.run = Worker.prototype.then;\n\n // Get dimensions of a PDF page, as determined by jsPDF.\n jsPDF.getPageSize = function(orientation, unit, format) {\n // Decode options object\n if (typeof orientation === \"object\") {\n var options = orientation;\n orientation = options.orientation;\n unit = options.unit || unit;\n format = options.format || format;\n }\n\n // Default options\n unit = unit || \"mm\";\n format = format || \"a4\";\n orientation = (\"\" + (orientation || \"P\")).toLowerCase();\n var format_as_string = (\"\" + format).toLowerCase();\n\n // Size in pt of various paper formats\n var pageFormats = {\n a0: [2383.94, 3370.39],\n a1: [1683.78, 2383.94],\n a2: [1190.55, 1683.78],\n a3: [841.89, 1190.55],\n a4: [595.28, 841.89],\n a5: [419.53, 595.28],\n a6: [297.64, 419.53],\n a7: [209.76, 297.64],\n a8: [147.4, 209.76],\n a9: [104.88, 147.4],\n a10: [73.7, 104.88],\n b0: [2834.65, 4008.19],\n b1: [2004.09, 2834.65],\n b2: [1417.32, 2004.09],\n b3: [1000.63, 1417.32],\n b4: [708.66, 1000.63],\n b5: [498.9, 708.66],\n b6: [354.33, 498.9],\n b7: [249.45, 354.33],\n b8: [175.75, 249.45],\n b9: [124.72, 175.75],\n b10: [87.87, 124.72],\n c0: [2599.37, 3676.54],\n c1: [1836.85, 2599.37],\n c2: [1298.27, 1836.85],\n c3: [918.43, 1298.27],\n c4: [649.13, 918.43],\n c5: [459.21, 649.13],\n c6: [323.15, 459.21],\n c7: [229.61, 323.15],\n c8: [161.57, 229.61],\n c9: [113.39, 161.57],\n c10: [79.37, 113.39],\n dl: [311.81, 623.62],\n letter: [612, 792],\n \"government-letter\": [576, 756],\n legal: [612, 1008],\n \"junior-legal\": [576, 360],\n ledger: [1224, 792],\n tabloid: [792, 1224],\n \"credit-card\": [153, 243]\n };\n\n var k;\n // Unit conversion\n switch (unit) {\n case \"pt\":\n k = 1;\n break;\n case \"mm\":\n k = 72 / 25.4;\n break;\n case \"cm\":\n k = 72 / 2.54;\n break;\n case \"in\":\n k = 72;\n break;\n case \"px\":\n k = 72 / 96;\n break;\n case \"pc\":\n k = 12;\n break;\n case \"em\":\n k = 12;\n break;\n case \"ex\":\n k = 6;\n break;\n default:\n throw \"Invalid unit: \" + unit;\n }\n var pageHeight = 0;\n var pageWidth = 0;\n\n // Dimensions are stored as user units and converted to points on output\n if (pageFormats.hasOwnProperty(format_as_string)) {\n pageHeight = pageFormats[format_as_string][1] / k;\n pageWidth = pageFormats[format_as_string][0] / k;\n } else {\n try {\n pageHeight = format[1];\n pageWidth = format[0];\n } catch (err) {\n throw new Error(\"Invalid format: \" + format);\n }\n }\n\n var tmp;\n // Handle page orientation\n if (orientation === \"p\" || orientation === \"portrait\") {\n orientation = \"p\";\n if (pageWidth > pageHeight) {\n tmp = pageWidth;\n pageWidth = pageHeight;\n pageHeight = tmp;\n }\n } else if (orientation === \"l\" || orientation === \"landscape\") {\n orientation = \"l\";\n if (pageHeight > pageWidth) {\n tmp = pageWidth;\n pageWidth = pageHeight;\n pageHeight = tmp;\n }\n } else {\n throw \"Invalid orientation: \" + orientation;\n }\n\n // Return information (k is the unit conversion ratio from pts)\n var info = {\n width: pageWidth,\n height: pageHeight,\n unit: unit,\n k: k,\n orientation: orientation\n };\n return info;\n };\n\n /**\n * @typedef FontFace\n *\n * The font-face type implements an interface similar to that of the font-face CSS rule,\n * and is used by jsPDF to match fonts when the font property of CanvasRenderingContext2D\n * is updated.\n *\n * All properties expect values similar to those in the font-face CSS rule. A difference\n * is the font-family, which do not need to be enclosed in double-quotes when containing\n * spaces like in CSS.\n *\n * @property {string} family The name of the font-family.\n * @property {string|undefined} style The style that this font-face defines, e.g. 'italic'.\n * @property {string|number|undefined} weight The weight of the font, either as a string or a number (400, 500, 600, e.g.)\n * @property {string|undefined} stretch The stretch of the font, e.g. condensed, normal, expanded.\n * @property {Object[]} src A list of URLs from where fonts of various formats can be fetched.\n * @property {string} [src] url A URL to a font of a specific format.\n * @property {string} [src] format Format of the font referenced by the URL.\n */\n\n /**\n * Generate a PDF from an HTML element or string using.\n *\n * @name html\n * @function\n * @param {HTMLElement|string} source The source HTMLElement or a string containing HTML.\n * @param {Object} [options] Collection of settings\n * @param {function} [options.callback] The mandatory callback-function gets as first parameter the current jsPDF instance\n * @param {(number|number[])=} [options.margin] Page margins [top, right, bottom, left]. Default is 0.\n * @param {(boolean|'slice'|'text')=} [options.autoPaging] The auto paging mode.\n *
      \n *
    • \n * false: Auto paging is disabled.\n *
    • \n *
    • \n * true or 'slice': Will cut shapes or text chunks across page breaks. Will possibly\n * slice text in half, making it difficult to read.\n *
    • \n *
    • \n * 'text': Trys not to cut text in half across page breaks. Works best for documents consisting\n * mostly of a single column of text.\n *
    • \n *
    \n * Default is true.\n * @param {string} [options.filename] name of the file\n * @param {HTMLOptionImage} [options.image] image settings when converting HTML to image\n * @param {Html2CanvasOptions} [options.html2canvas] html2canvas options\n * @param {FontFace[]} [options.fontFaces] A list of font-faces to match when resolving fonts. Fonts will be added to the PDF based on the specified URL. If omitted, the font match algorithm falls back to old algorithm.\n * @param {jsPDF} [options.jsPDF] jsPDF instance\n * @param {number=} [options.x] x position on the PDF document in jsPDF units.\n * @param {number=} [options.y] y position on the PDF document in jsPDF units.\n * @param {number=} [options.width] The target width in the PDF document in jsPDF units. The rendered element will be\n * scaled such that it fits into the specified width. Has no effect if either the html2canvas.scale is\n * specified or the windowWidth option is NOT specified.\n * @param {number=} [options.windowWidth] The window width in CSS pixels. In contrast to the\n * html2canvas.windowWidth option, this option affects the actual container size while rendering and\n * does NOT affect CSS media queries. This option only has an effect, if the width option is also specified.\n *\n * @example\n * var doc = new jsPDF();\n *\n * doc.html(document.body, {\n * callback: function (doc) {\n * doc.save();\n * },\n * x: 10,\n * y: 10\n * });\n */\n jsPDFAPI.html = function(src, options) {\n \"use strict\";\n\n options = options || {};\n options.callback = options.callback || function() {};\n options.html2canvas = options.html2canvas || {};\n options.html2canvas.canvas = options.html2canvas.canvas || this.canvas;\n options.jsPDF = options.jsPDF || this;\n options.fontFaces = options.fontFaces\n ? options.fontFaces.map(normalizeFontFace)\n : null;\n\n // Create a new worker with the given options.\n var worker = new Worker(options);\n\n if (!options.worker) {\n // If worker is not set to true, perform the traditional 'simple' operation.\n return worker.from(src).doCallback();\n } else {\n // Otherwise, return the worker for new Promise-based operation.\n return worker;\n }\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF Outline PlugIn\n *\n * Generates a PDF Outline\n * @name outline\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n var namesOid;\n //var destsGoto = [];\n\n jsPDFAPI.events.push([\n \"postPutResources\",\n function() {\n var pdf = this;\n var rx = /^(\\d+) 0 obj$/;\n\n // Write action goto objects for each page\n // this.outline.destsGoto = [];\n // for (var i = 0; i < totalPages; i++) {\n // var id = pdf.internal.newObject();\n // this.outline.destsGoto.push(id);\n // pdf.internal.write(\"<> endobj\");\n // }\n //\n // for (var i = 0; i < dests.length; i++) {\n // pdf.internal.write(\"(page_\" + (i + 1) + \")\" + dests[i] + \" 0\n // R\");\n // }\n //\n if (this.outline.root.children.length > 0) {\n var lines = pdf.outline.render().split(/\\r\\n/);\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var m = rx.exec(line);\n if (m != null) {\n var oid = m[1];\n pdf.internal.newObjectDeferredBegin(oid, false);\n }\n pdf.internal.write(line);\n }\n }\n\n // This code will write named destination for each page reference\n // (page_1, etc)\n if (this.outline.createNamedDestinations) {\n var totalPages = this.internal.pages.length;\n // WARNING: this assumes jsPDF starts on page 3 and pageIDs\n // follow 5, 7, 9, etc\n // Write destination objects for each page\n var dests = [];\n for (var i = 0; i < totalPages; i++) {\n var id = pdf.internal.newObject();\n dests.push(id);\n var info = pdf.internal.getPageInfo(i + 1);\n pdf.internal.write(\n \"<< /D[\" + info.objId + \" 0 R /XYZ null null null]>> endobj\"\n );\n }\n\n // assign a name for each destination\n var names2Oid = pdf.internal.newObject();\n pdf.internal.write(\"<< /Names [ \");\n for (var i = 0; i < dests.length; i++) {\n pdf.internal.write(\"(page_\" + (i + 1) + \")\" + dests[i] + \" 0 R\");\n }\n pdf.internal.write(\" ] >>\", \"endobj\");\n\n // var kids = pdf.internal.newObject();\n // pdf.internal.write('<< /Kids [ ' + names2Oid + ' 0 R');\n // pdf.internal.write(' ] >>', 'endobj');\n\n namesOid = pdf.internal.newObject();\n pdf.internal.write(\"<< /Dests \" + names2Oid + \" 0 R\");\n pdf.internal.write(\">>\", \"endobj\");\n }\n }\n ]);\n\n jsPDFAPI.events.push([\n \"putCatalog\",\n function() {\n var pdf = this;\n if (pdf.outline.root.children.length > 0) {\n pdf.internal.write(\n \"/Outlines\",\n this.outline.makeRef(this.outline.root)\n );\n if (this.outline.createNamedDestinations) {\n pdf.internal.write(\"/Names \" + namesOid + \" 0 R\");\n }\n // Open with Bookmarks showing\n // pdf.internal.write(\"/PageMode /UseOutlines\");\n }\n }\n ]);\n\n jsPDFAPI.events.push([\n \"initialized\",\n function() {\n var pdf = this;\n\n pdf.outline = {\n createNamedDestinations: false,\n root: {\n children: []\n }\n };\n\n /**\n * Options: pageNumber\n */\n pdf.outline.add = function(parent, title, options) {\n var item = {\n title: title,\n options: options,\n children: []\n };\n if (parent == null) {\n parent = this.root;\n }\n parent.children.push(item);\n return item;\n };\n\n pdf.outline.render = function() {\n this.ctx = {};\n this.ctx.val = \"\";\n this.ctx.pdf = pdf;\n\n this.genIds_r(this.root);\n this.renderRoot(this.root);\n this.renderItems(this.root);\n\n return this.ctx.val;\n };\n\n pdf.outline.genIds_r = function(node) {\n node.id = pdf.internal.newObjectDeferred();\n for (var i = 0; i < node.children.length; i++) {\n this.genIds_r(node.children[i]);\n }\n };\n\n pdf.outline.renderRoot = function(node) {\n this.objStart(node);\n this.line(\"/Type /Outlines\");\n if (node.children.length > 0) {\n this.line(\"/First \" + this.makeRef(node.children[0]));\n this.line(\n \"/Last \" + this.makeRef(node.children[node.children.length - 1])\n );\n }\n this.line(\n \"/Count \" +\n this.count_r(\n {\n count: 0\n },\n node\n )\n );\n this.objEnd();\n };\n\n pdf.outline.renderItems = function(node) {\n var getVerticalCoordinateString = this.ctx.pdf.internal\n .getVerticalCoordinateString;\n for (var i = 0; i < node.children.length; i++) {\n var item = node.children[i];\n this.objStart(item);\n\n this.line(\"/Title \" + this.makeString(item.title));\n\n this.line(\"/Parent \" + this.makeRef(node));\n if (i > 0) {\n this.line(\"/Prev \" + this.makeRef(node.children[i - 1]));\n }\n if (i < node.children.length - 1) {\n this.line(\"/Next \" + this.makeRef(node.children[i + 1]));\n }\n if (item.children.length > 0) {\n this.line(\"/First \" + this.makeRef(item.children[0]));\n this.line(\n \"/Last \" + this.makeRef(item.children[item.children.length - 1])\n );\n }\n\n var count = (this.count = this.count_r(\n {\n count: 0\n },\n item\n ));\n if (count > 0) {\n this.line(\"/Count \" + count);\n }\n\n if (item.options) {\n if (item.options.pageNumber) {\n // Explicit Destination\n //WARNING this assumes page ids are 3,5,7, etc.\n var info = pdf.internal.getPageInfo(item.options.pageNumber);\n this.line(\n \"/Dest \" +\n \"[\" +\n info.objId +\n \" 0 R /XYZ 0 \" +\n getVerticalCoordinateString(0) +\n \" 0]\"\n );\n // this line does not work on all clients (pageNumber instead of page ref)\n //this.line('/Dest ' + '[' + (item.options.pageNumber - 1) + ' /XYZ 0 ' + this.ctx.pdf.internal.pageSize.getHeight() + ' 0]');\n\n // Named Destination\n // this.line('/Dest (page_' + (item.options.pageNumber) + ')');\n\n // Action Destination\n // var id = pdf.internal.newObject();\n // pdf.internal.write('<> endobj');\n // this.line('/A ' + id + ' 0 R' );\n }\n }\n this.objEnd();\n }\n for (var z = 0; z < node.children.length; z++) {\n this.renderItems(node.children[z]);\n }\n };\n\n pdf.outline.line = function(text) {\n this.ctx.val += text + \"\\r\\n\";\n };\n\n pdf.outline.makeRef = function(node) {\n return node.id + \" 0 R\";\n };\n\n pdf.outline.makeString = function(val) {\n return \"(\" + pdf.internal.pdfEscape(val) + \")\";\n };\n\n pdf.outline.objStart = function(node) {\n this.ctx.val += \"\\r\\n\" + node.id + \" 0 obj\" + \"\\r\\n<<\\r\\n\";\n };\n\n pdf.outline.objEnd = function() {\n this.ctx.val += \">> \\r\\n\" + \"endobj\" + \"\\r\\n\";\n };\n\n pdf.outline.count_r = function(ctx, node) {\n for (var i = 0; i < node.children.length; i++) {\n ctx.count++;\n this.count_r(ctx, node.children[i]);\n }\n return ctx.count;\n };\n }\n ]);\n\n return this;\n})(jsPDF.API);\n","/**\n * @license\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF jpeg Support PlugIn\n *\n * @name jpeg_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * 0xc0 (SOF) Huffman - Baseline DCT\n * 0xc1 (SOF) Huffman - Extended sequential DCT\n * 0xc2 Progressive DCT (SOF2)\n * 0xc3 Spatial (sequential) lossless (SOF3)\n * 0xc4 Differential sequential DCT (SOF5)\n * 0xc5 Differential progressive DCT (SOF6)\n * 0xc6 Differential spatial (SOF7)\n * 0xc7\n */\n var markers = [0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7];\n\n //takes a string imgData containing the raw bytes of\n //a jpeg image and returns [width, height]\n //Algorithm from: http://www.64lines.com/jpeg-width-height\n var getJpegInfo = function(imgData) {\n var width, height, numcomponents;\n var blockLength = imgData.charCodeAt(4) * 256 + imgData.charCodeAt(5);\n var len = imgData.length;\n var result = { width: 0, height: 0, numcomponents: 1 };\n for (var i = 4; i < len; i += 2) {\n i += blockLength;\n if (markers.indexOf(imgData.charCodeAt(i + 1)) !== -1) {\n height = imgData.charCodeAt(i + 5) * 256 + imgData.charCodeAt(i + 6);\n width = imgData.charCodeAt(i + 7) * 256 + imgData.charCodeAt(i + 8);\n numcomponents = imgData.charCodeAt(i + 9);\n result = { width: width, height: height, numcomponents: numcomponents };\n break;\n } else {\n blockLength =\n imgData.charCodeAt(i + 2) * 256 + imgData.charCodeAt(i + 3);\n }\n }\n return result;\n };\n\n /**\n * @ignore\n */\n jsPDFAPI.processJPEG = function(\n data,\n index,\n alias,\n compression,\n dataAsBinaryString,\n colorSpace\n ) {\n var filter = this.decode.DCT_DECODE,\n bpc = 8,\n dims,\n result = null;\n\n if (\n typeof data === \"string\" ||\n this.__addimage__.isArrayBuffer(data) ||\n this.__addimage__.isArrayBufferView(data)\n ) {\n // if we already have a stored binary string rep use that\n data = dataAsBinaryString || data;\n data = this.__addimage__.isArrayBuffer(data)\n ? new Uint8Array(data)\n : data;\n data = this.__addimage__.isArrayBufferView(data)\n ? this.__addimage__.arrayBufferToBinaryString(data)\n : data;\n\n dims = getJpegInfo(data);\n switch (dims.numcomponents) {\n case 1:\n colorSpace = this.color_spaces.DEVICE_GRAY;\n break;\n case 4:\n colorSpace = this.color_spaces.DEVICE_CMYK;\n break;\n case 3:\n colorSpace = this.color_spaces.DEVICE_RGB;\n break;\n }\n\n result = {\n data: data,\n width: dims.width,\n height: dims.height,\n colorSpace: colorSpace,\n bitsPerComponent: bpc,\n filter: filter,\n index: index,\n alias: alias\n };\n }\n return result;\n };\n})(jsPDF.API);\n","// Generated by CoffeeScript 1.4.0\n\n/**\n * @license\n * PNG.js\n * Copyright (c) 2011 Devon Govett\n * MIT LICENSE\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\n * software and associated documentation files (the \"Software\"), to deal in the Software\n * without restriction, including without limitation the rights to use, copy, modify, merge,\n * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n * to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or\n * substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING\n * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport { unzlibSync } from \"./fflate.js\";\nimport { globalObject } from \"./globalObject.js\";\n\nvar PNG = (function() {\n var APNG_BLEND_OP_OVER,\n APNG_BLEND_OP_SOURCE,\n APNG_DISPOSE_OP_BACKGROUND,\n APNG_DISPOSE_OP_NONE,\n APNG_DISPOSE_OP_PREVIOUS,\n makeImage,\n scratchCanvas,\n scratchCtx;\n\n APNG_DISPOSE_OP_NONE = 0;\n\n APNG_DISPOSE_OP_BACKGROUND = 1;\n\n APNG_DISPOSE_OP_PREVIOUS = 2;\n\n APNG_BLEND_OP_SOURCE = 0;\n\n APNG_BLEND_OP_OVER = 1;\n\n function PNG(data) {\n var chunkSize,\n colors,\n palLen,\n delayDen,\n delayNum,\n frame,\n i,\n index,\n key,\n section,\n palShort,\n text,\n _i,\n _j,\n _ref;\n this.data = data;\n this.pos = 8;\n this.palette = [];\n this.imgData = [];\n this.transparency = {};\n this.animation = null;\n this.text = {};\n frame = null;\n while (true) {\n chunkSize = this.readUInt32();\n section = function() {\n var _i, _results;\n _results = [];\n for (i = _i = 0; _i < 4; i = ++_i) {\n _results.push(String.fromCharCode(this.data[this.pos++]));\n }\n return _results;\n }\n .call(this)\n .join(\"\");\n switch (section) {\n case \"IHDR\":\n this.width = this.readUInt32();\n this.height = this.readUInt32();\n this.bits = this.data[this.pos++];\n this.colorType = this.data[this.pos++];\n this.compressionMethod = this.data[this.pos++];\n this.filterMethod = this.data[this.pos++];\n this.interlaceMethod = this.data[this.pos++];\n break;\n case \"acTL\":\n this.animation = {\n numFrames: this.readUInt32(),\n numPlays: this.readUInt32() || Infinity,\n frames: []\n };\n break;\n case \"PLTE\":\n this.palette = this.read(chunkSize);\n break;\n case \"fcTL\":\n if (frame) {\n this.animation.frames.push(frame);\n }\n this.pos += 4;\n frame = {\n width: this.readUInt32(),\n height: this.readUInt32(),\n xOffset: this.readUInt32(),\n yOffset: this.readUInt32()\n };\n delayNum = this.readUInt16();\n delayDen = this.readUInt16() || 100;\n frame.delay = (1000 * delayNum) / delayDen;\n frame.disposeOp = this.data[this.pos++];\n frame.blendOp = this.data[this.pos++];\n frame.data = [];\n break;\n case \"IDAT\":\n case \"fdAT\":\n if (section === \"fdAT\") {\n this.pos += 4;\n chunkSize -= 4;\n }\n data = (frame != null ? frame.data : void 0) || this.imgData;\n for (\n i = _i = 0;\n 0 <= chunkSize ? _i < chunkSize : _i > chunkSize;\n i = 0 <= chunkSize ? ++_i : --_i\n ) {\n data.push(this.data[this.pos++]);\n }\n break;\n case \"tRNS\":\n this.transparency = {};\n switch (this.colorType) {\n case 3:\n palLen = this.palette.length / 3;\n this.transparency.indexed = this.read(chunkSize);\n if (this.transparency.indexed.length > palLen)\n throw new Error(\"More transparent colors than palette size\");\n /*\n * According to the PNG spec trns should be increased to the same size as palette if shorter\n */\n //palShort = 255 - this.transparency.indexed.length;\n palShort = palLen - this.transparency.indexed.length;\n if (palShort > 0) {\n for (\n i = _j = 0;\n 0 <= palShort ? _j < palShort : _j > palShort;\n i = 0 <= palShort ? ++_j : --_j\n ) {\n this.transparency.indexed.push(255);\n }\n }\n break;\n case 0:\n this.transparency.grayscale = this.read(chunkSize)[0];\n break;\n case 2:\n this.transparency.rgb = this.read(chunkSize);\n }\n break;\n case \"tEXt\":\n text = this.read(chunkSize);\n index = text.indexOf(0);\n key = String.fromCharCode.apply(String, text.slice(0, index));\n this.text[key] = String.fromCharCode.apply(\n String,\n text.slice(index + 1)\n );\n break;\n case \"IEND\":\n if (frame) {\n this.animation.frames.push(frame);\n }\n this.colors = function() {\n switch (this.colorType) {\n case 0:\n case 3:\n case 4:\n return 1;\n case 2:\n case 6:\n return 3;\n }\n }.call(this);\n this.hasAlphaChannel = (_ref = this.colorType) === 4 || _ref === 6;\n colors = this.colors + (this.hasAlphaChannel ? 1 : 0);\n this.pixelBitlength = this.bits * colors;\n this.colorSpace = function() {\n switch (this.colors) {\n case 1:\n return \"DeviceGray\";\n case 3:\n return \"DeviceRGB\";\n }\n }.call(this);\n this.imgData = new Uint8Array(this.imgData);\n return;\n default:\n this.pos += chunkSize;\n }\n this.pos += 4;\n if (this.pos > this.data.length) {\n throw new Error(\"Incomplete or corrupt PNG file\");\n }\n }\n }\n\n PNG.prototype.read = function(bytes) {\n var i, _i, _results;\n _results = [];\n for (\n i = _i = 0;\n 0 <= bytes ? _i < bytes : _i > bytes;\n i = 0 <= bytes ? ++_i : --_i\n ) {\n _results.push(this.data[this.pos++]);\n }\n return _results;\n };\n\n PNG.prototype.readUInt32 = function() {\n var b1, b2, b3, b4;\n b1 = this.data[this.pos++] << 24;\n b2 = this.data[this.pos++] << 16;\n b3 = this.data[this.pos++] << 8;\n b4 = this.data[this.pos++];\n return b1 | b2 | b3 | b4;\n };\n\n PNG.prototype.readUInt16 = function() {\n var b1, b2;\n b1 = this.data[this.pos++] << 8;\n b2 = this.data[this.pos++];\n return b1 | b2;\n };\n\n PNG.prototype.decodePixels = function(data) {\n var pixelBytes = this.pixelBitlength / 8;\n var fullPixels = new Uint8Array(this.width * this.height * pixelBytes);\n var pos = 0;\n var _this = this;\n\n if (data == null) {\n data = this.imgData;\n }\n if (data.length === 0) {\n return new Uint8Array(0);\n }\n\n data = unzlibSync(data);\n function pass(x0, y0, dx, dy) {\n var abyte,\n c,\n col,\n i,\n left,\n length,\n p,\n pa,\n paeth,\n pb,\n pc,\n pixels,\n row,\n scanlineLength,\n upper,\n upperLeft,\n _i,\n _j,\n _k,\n _l,\n _m;\n var w = Math.ceil((_this.width - x0) / dx),\n h = Math.ceil((_this.height - y0) / dy);\n var isFull = _this.width == w && _this.height == h;\n scanlineLength = pixelBytes * w;\n pixels = isFull ? fullPixels : new Uint8Array(scanlineLength * h);\n length = data.length;\n row = 0;\n c = 0;\n while (row < h && pos < length) {\n switch (data[pos++]) {\n case 0:\n for (i = _i = 0; _i < scanlineLength; i = _i += 1) {\n pixels[c++] = data[pos++];\n }\n break;\n case 1:\n for (i = _j = 0; _j < scanlineLength; i = _j += 1) {\n abyte = data[pos++];\n left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n pixels[c++] = (abyte + left) % 256;\n }\n break;\n case 2:\n for (i = _k = 0; _k < scanlineLength; i = _k += 1) {\n abyte = data[pos++];\n col = (i - (i % pixelBytes)) / pixelBytes;\n upper =\n row &&\n pixels[\n (row - 1) * scanlineLength +\n col * pixelBytes +\n (i % pixelBytes)\n ];\n pixels[c++] = (upper + abyte) % 256;\n }\n break;\n case 3:\n for (i = _l = 0; _l < scanlineLength; i = _l += 1) {\n abyte = data[pos++];\n col = (i - (i % pixelBytes)) / pixelBytes;\n left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n upper =\n row &&\n pixels[\n (row - 1) * scanlineLength +\n col * pixelBytes +\n (i % pixelBytes)\n ];\n pixels[c++] = (abyte + Math.floor((left + upper) / 2)) % 256;\n }\n break;\n case 4:\n for (i = _m = 0; _m < scanlineLength; i = _m += 1) {\n abyte = data[pos++];\n col = (i - (i % pixelBytes)) / pixelBytes;\n left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n if (row === 0) {\n upper = upperLeft = 0;\n } else {\n upper =\n pixels[\n (row - 1) * scanlineLength +\n col * pixelBytes +\n (i % pixelBytes)\n ];\n upperLeft =\n col &&\n pixels[\n (row - 1) * scanlineLength +\n (col - 1) * pixelBytes +\n (i % pixelBytes)\n ];\n }\n p = left + upper - upperLeft;\n pa = Math.abs(p - left);\n pb = Math.abs(p - upper);\n pc = Math.abs(p - upperLeft);\n if (pa <= pb && pa <= pc) {\n paeth = left;\n } else if (pb <= pc) {\n paeth = upper;\n } else {\n paeth = upperLeft;\n }\n pixels[c++] = (abyte + paeth) % 256;\n }\n break;\n default:\n throw new Error(\"Invalid filter algorithm: \" + data[pos - 1]);\n }\n if (!isFull) {\n var fullPos = ((y0 + row * dy) * _this.width + x0) * pixelBytes;\n var partPos = row * scanlineLength;\n for (i = 0; i < w; i += 1) {\n for (var j = 0; j < pixelBytes; j += 1)\n fullPixels[fullPos++] = pixels[partPos++];\n fullPos += (dx - 1) * pixelBytes;\n }\n }\n row++;\n }\n }\n if (_this.interlaceMethod == 1) {\n /*\n 1 6 4 6 2 6 4 6\n 7 7 7 7 7 7 7 7\n 5 6 5 6 5 6 5 6\n 7 7 7 7 7 7 7 7\n 3 6 4 6 3 6 4 6\n 7 7 7 7 7 7 7 7\n 5 6 5 6 5 6 5 6\n 7 7 7 7 7 7 7 7\n */\n pass(0, 0, 8, 8); // 1\n /* NOTE these seem to follow the pattern:\n * pass(x, 0, 2*x, 2*x);\n * pass(0, x, x, 2*x);\n * with x being 4, 2, 1.\n */\n pass(4, 0, 8, 8); // 2\n pass(0, 4, 4, 8); // 3\n\n pass(2, 0, 4, 4); // 4\n pass(0, 2, 2, 4); // 5\n\n pass(1, 0, 2, 2); // 6\n pass(0, 1, 1, 2); // 7\n } else {\n pass(0, 0, 1, 1);\n }\n return fullPixels;\n };\n\n PNG.prototype.decodePalette = function() {\n var c, i, length, palette, pos, ret, transparency, _i, _ref, _ref1;\n palette = this.palette;\n transparency = this.transparency.indexed || [];\n ret = new Uint8Array((transparency.length || 0) + palette.length);\n pos = 0;\n length = palette.length;\n c = 0;\n for (i = _i = 0, _ref = length; _i < _ref; i = _i += 3) {\n ret[pos++] = palette[i];\n ret[pos++] = palette[i + 1];\n ret[pos++] = palette[i + 2];\n ret[pos++] = (_ref1 = transparency[c++]) != null ? _ref1 : 255;\n }\n return ret;\n };\n\n PNG.prototype.copyToImageData = function(imageData, pixels) {\n var alpha, colors, data, i, input, j, k, length, palette, v, _ref;\n colors = this.colors;\n palette = null;\n alpha = this.hasAlphaChannel;\n if (this.palette.length) {\n palette =\n (_ref = this._decodedPalette) != null\n ? _ref\n : (this._decodedPalette = this.decodePalette());\n colors = 4;\n alpha = true;\n }\n data = imageData.data || imageData;\n length = data.length;\n input = palette || pixels;\n i = j = 0;\n if (colors === 1) {\n while (i < length) {\n k = palette ? pixels[i / 4] * 4 : j;\n v = input[k++];\n data[i++] = v;\n data[i++] = v;\n data[i++] = v;\n data[i++] = alpha ? input[k++] : 255;\n j = k;\n }\n } else {\n while (i < length) {\n k = palette ? pixels[i / 4] * 4 : j;\n data[i++] = input[k++];\n data[i++] = input[k++];\n data[i++] = input[k++];\n data[i++] = alpha ? input[k++] : 255;\n j = k;\n }\n }\n };\n\n PNG.prototype.decode = function() {\n var ret;\n ret = new Uint8Array(this.width * this.height * 4);\n this.copyToImageData(ret, this.decodePixels());\n return ret;\n };\n\n var hasBrowserCanvas = function() {\n if (Object.prototype.toString.call(globalObject) === \"[object Window]\") {\n try {\n scratchCanvas = globalObject.document.createElement(\"canvas\");\n scratchCtx = scratchCanvas.getContext(\"2d\");\n } catch (e) {\n return false;\n }\n return true;\n }\n return false;\n };\n\n hasBrowserCanvas();\n\n makeImage = function(imageData) {\n if (hasBrowserCanvas() === true) {\n var img;\n scratchCtx.width = imageData.width;\n scratchCtx.height = imageData.height;\n scratchCtx.clearRect(0, 0, imageData.width, imageData.height);\n scratchCtx.putImageData(imageData, 0, 0);\n img = new Image();\n img.src = scratchCanvas.toDataURL();\n return img;\n }\n throw new Error(\"This method requires a Browser with Canvas-capability.\");\n };\n\n PNG.prototype.decodeFrames = function(ctx) {\n var frame, i, imageData, pixels, _i, _len, _ref, _results;\n if (!this.animation) {\n return;\n }\n _ref = this.animation.frames;\n _results = [];\n for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {\n frame = _ref[i];\n imageData = ctx.createImageData(frame.width, frame.height);\n pixels = this.decodePixels(new Uint8Array(frame.data));\n this.copyToImageData(imageData, pixels);\n frame.imageData = imageData;\n _results.push((frame.image = makeImage(imageData)));\n }\n return _results;\n };\n\n PNG.prototype.renderFrame = function(ctx, number) {\n var frame, frames, prev;\n frames = this.animation.frames;\n frame = frames[number];\n prev = frames[number - 1];\n if (number === 0) {\n ctx.clearRect(0, 0, this.width, this.height);\n }\n if (\n (prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_BACKGROUND\n ) {\n ctx.clearRect(prev.xOffset, prev.yOffset, prev.width, prev.height);\n } else if (\n (prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_PREVIOUS\n ) {\n ctx.putImageData(prev.imageData, prev.xOffset, prev.yOffset);\n }\n if (frame.blendOp === APNG_BLEND_OP_SOURCE) {\n ctx.clearRect(frame.xOffset, frame.yOffset, frame.width, frame.height);\n }\n return ctx.drawImage(frame.image, frame.xOffset, frame.yOffset);\n };\n\n PNG.prototype.animate = function(ctx) {\n var doFrame,\n frameNumber,\n frames,\n numFrames,\n numPlays,\n _ref,\n _this = this;\n frameNumber = 0;\n (_ref = this.animation),\n (numFrames = _ref.numFrames),\n (frames = _ref.frames),\n (numPlays = _ref.numPlays);\n return (doFrame = function() {\n var f, frame;\n f = frameNumber++ % numFrames;\n frame = frames[f];\n _this.renderFrame(ctx, f);\n if (numFrames > 1 && frameNumber / numFrames < numPlays) {\n return (_this.animation._timeout = setTimeout(doFrame, frame.delay));\n }\n })();\n };\n\n PNG.prototype.stopAnimation = function() {\n var _ref;\n return clearTimeout(\n (_ref = this.animation) != null ? _ref._timeout : void 0\n );\n };\n\n PNG.prototype.render = function(canvas) {\n var ctx, data;\n if (canvas._png) {\n canvas._png.stopAnimation();\n }\n canvas._png = this;\n canvas.width = this.width;\n canvas.height = this.height;\n ctx = canvas.getContext(\"2d\");\n if (this.animation) {\n this.decodeFrames(ctx);\n return this.animate(ctx);\n } else {\n data = ctx.createImageData(this.width, this.height);\n this.copyToImageData(data, this.decodePixels());\n return ctx.putImageData(data, 0, 0);\n }\n };\n\n return PNG;\n})();\n\nexport { PNG };\n","/** @license\n * MIT license.\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n * 2014 Diego Casorran, https://github.com/diegocr\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF split_text_to_size plugin\n *\n * @name split_text_to_size\n * @module\n */\n(function(API) {\n \"use strict\";\n /**\n * Returns an array of length matching length of the 'word' string, with each\n * cell occupied by the width of the char in that position.\n *\n * @name getCharWidthsArray\n * @function\n * @param {string} text\n * @param {Object} options\n * @returns {Array}\n */\n var getCharWidthsArray = (API.getCharWidthsArray = function(text, options) {\n options = options || {};\n\n var activeFont = options.font || this.internal.getFont();\n var fontSize = options.fontSize || this.internal.getFontSize();\n var charSpace = options.charSpace || this.internal.getCharSpace();\n\n var widths = options.widths\n ? options.widths\n : activeFont.metadata.Unicode.widths;\n var widthsFractionOf = widths.fof ? widths.fof : 1;\n var kerning = options.kerning\n ? options.kerning\n : activeFont.metadata.Unicode.kerning;\n var kerningFractionOf = kerning.fof ? kerning.fof : 1;\n var doKerning = options.doKerning === false ? false : true;\n var kerningValue = 0;\n\n var i;\n var length = text.length;\n var char_code;\n var prior_char_code = 0; //for kerning\n var default_char_width = widths[0] || widthsFractionOf;\n var output = [];\n\n for (i = 0; i < length; i++) {\n char_code = text.charCodeAt(i);\n\n if (typeof activeFont.metadata.widthOfString === \"function\") {\n output.push(\n (activeFont.metadata.widthOfGlyph(\n activeFont.metadata.characterToGlyph(char_code)\n ) +\n charSpace * (1000 / fontSize) || 0) / 1000\n );\n } else {\n if (\n doKerning &&\n typeof kerning[char_code] === \"object\" &&\n !isNaN(parseInt(kerning[char_code][prior_char_code], 10))\n ) {\n kerningValue =\n kerning[char_code][prior_char_code] / kerningFractionOf;\n } else {\n kerningValue = 0;\n }\n output.push(\n (widths[char_code] || default_char_width) / widthsFractionOf +\n kerningValue\n );\n }\n prior_char_code = char_code;\n }\n\n return output;\n });\n\n /**\n * Returns a widths of string in a given font, if the font size is set as 1 point.\n *\n * In other words, this is \"proportional\" value. For 1 unit of font size, the length\n * of the string will be that much.\n *\n * Multiply by font size to get actual width in *points*\n * Then divide by 72 to get inches or divide by (72/25.6) to get 'mm' etc.\n *\n * @name getStringUnitWidth\n * @public\n * @function\n * @param {string} text\n * @param {string} options\n * @returns {number} result\n */\n var getStringUnitWidth = (API.getStringUnitWidth = function(text, options) {\n options = options || {};\n\n var fontSize = options.fontSize || this.internal.getFontSize();\n var font = options.font || this.internal.getFont();\n var charSpace = options.charSpace || this.internal.getCharSpace();\n var result = 0;\n\n if (API.processArabic) {\n text = API.processArabic(text);\n }\n\n if (typeof font.metadata.widthOfString === \"function\") {\n result =\n font.metadata.widthOfString(text, fontSize, charSpace) / fontSize;\n } else {\n result = getCharWidthsArray\n .apply(this, arguments)\n .reduce(function(pv, cv) {\n return pv + cv;\n }, 0);\n }\n return result;\n });\n\n /**\n returns array of lines\n */\n var splitLongWord = function(word, widths_array, firstLineMaxLen, maxLen) {\n var answer = [];\n\n // 1st, chop off the piece that can fit on the hanging line.\n var i = 0,\n l = word.length,\n workingLen = 0;\n while (i !== l && workingLen + widths_array[i] < firstLineMaxLen) {\n workingLen += widths_array[i];\n i++;\n }\n // this is first line.\n answer.push(word.slice(0, i));\n\n // 2nd. Split the rest into maxLen pieces.\n var startOfLine = i;\n workingLen = 0;\n while (i !== l) {\n if (workingLen + widths_array[i] > maxLen) {\n answer.push(word.slice(startOfLine, i));\n workingLen = 0;\n startOfLine = i;\n }\n workingLen += widths_array[i];\n i++;\n }\n if (startOfLine !== i) {\n answer.push(word.slice(startOfLine, i));\n }\n\n return answer;\n };\n\n // Note, all sizing inputs for this function must be in \"font measurement units\"\n // By default, for PDF, it's \"point\".\n var splitParagraphIntoLines = function(text, maxlen, options) {\n // at this time works only on Western scripts, ones with space char\n // separating the words. Feel free to expand.\n\n if (!options) {\n options = {};\n }\n\n var line = [],\n lines = [line],\n line_length = options.textIndent || 0,\n separator_length = 0,\n current_word_length = 0,\n word,\n widths_array,\n words = text.split(\" \"),\n spaceCharWidth = getCharWidthsArray.apply(this, [\" \", options])[0],\n i,\n l,\n tmp,\n lineIndent;\n\n if (options.lineIndent === -1) {\n lineIndent = words[0].length + 2;\n } else {\n lineIndent = options.lineIndent || 0;\n }\n if (lineIndent) {\n var pad = Array(lineIndent).join(\" \"),\n wrds = [];\n words.map(function(wrd) {\n wrd = wrd.split(/\\s*\\n/);\n if (wrd.length > 1) {\n wrds = wrds.concat(\n wrd.map(function(wrd, idx) {\n return (idx && wrd.length ? \"\\n\" : \"\") + wrd;\n })\n );\n } else {\n wrds.push(wrd[0]);\n }\n });\n words = wrds;\n lineIndent = getStringUnitWidth.apply(this, [pad, options]);\n }\n\n for (i = 0, l = words.length; i < l; i++) {\n var force = 0;\n\n word = words[i];\n if (lineIndent && word[0] == \"\\n\") {\n word = word.substr(1);\n force = 1;\n }\n widths_array = getCharWidthsArray.apply(this, [word, options]);\n current_word_length = widths_array.reduce(function(pv, cv) {\n return pv + cv;\n }, 0);\n\n if (\n line_length + separator_length + current_word_length > maxlen ||\n force\n ) {\n if (current_word_length > maxlen) {\n // this happens when you have space-less long URLs for example.\n // we just chop these to size. We do NOT insert hiphens\n tmp = splitLongWord.apply(this, [\n word,\n widths_array,\n maxlen - (line_length + separator_length),\n maxlen\n ]);\n // first line we add to existing line object\n line.push(tmp.shift()); // it's ok to have extra space indicator there\n // last line we make into new line object\n line = [tmp.pop()];\n // lines in the middle we apped to lines object as whole lines\n while (tmp.length) {\n lines.push([tmp.shift()]); // single fragment occupies whole line\n }\n current_word_length = widths_array\n .slice(word.length - (line[0] ? line[0].length : 0))\n .reduce(function(pv, cv) {\n return pv + cv;\n }, 0);\n } else {\n // just put it on a new line\n line = [word];\n }\n\n // now we attach new line to lines\n lines.push(line);\n line_length = current_word_length + lineIndent;\n separator_length = spaceCharWidth;\n } else {\n line.push(word);\n\n line_length += separator_length + current_word_length;\n separator_length = spaceCharWidth;\n }\n }\n\n var postProcess;\n if (lineIndent) {\n postProcess = function(ln, idx) {\n return (idx ? pad : \"\") + ln.join(\" \");\n };\n } else {\n postProcess = function(ln) {\n return ln.join(\" \");\n };\n }\n\n return lines.map(postProcess);\n };\n\n /**\n * Splits a given string into an array of strings. Uses 'size' value\n * (in measurement units declared as default for the jsPDF instance)\n * and the font's \"widths\" and \"Kerning\" tables, where available, to\n * determine display length of a given string for a given font.\n *\n * We use character's 100% of unit size (height) as width when Width\n * table or other default width is not available.\n *\n * @name splitTextToSize\n * @public\n * @function\n * @param {string} text Unencoded, regular JavaScript (Unicode, UTF-16 / UCS-2) string.\n * @param {number} size Nominal number, measured in units default to this instance of jsPDF.\n * @param {Object} options Optional flags needed for chopper to do the right thing.\n * @returns {Array} array Array with strings chopped to size.\n */\n API.splitTextToSize = function(text, maxlen, options) {\n \"use strict\";\n\n options = options || {};\n\n var fsize = options.fontSize || this.internal.getFontSize(),\n newOptions = function(options) {\n var widths = {\n 0: 1\n },\n kerning = {};\n\n if (!options.widths || !options.kerning) {\n var f = this.internal.getFont(options.fontName, options.fontStyle),\n encoding = \"Unicode\";\n // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE\n // Actual JavaScript-native String's 16bit char codes used.\n // no multi-byte logic here\n\n if (f.metadata[encoding]) {\n return {\n widths: f.metadata[encoding].widths || widths,\n kerning: f.metadata[encoding].kerning || kerning\n };\n } else {\n return {\n font: f.metadata,\n fontSize: this.internal.getFontSize(),\n charSpace: this.internal.getCharSpace()\n };\n }\n } else {\n return {\n widths: options.widths,\n kerning: options.kerning\n };\n }\n }.call(this, options);\n\n // first we split on end-of-line chars\n var paragraphs;\n if (Array.isArray(text)) {\n paragraphs = text;\n } else {\n paragraphs = String(text).split(/\\r?\\n/);\n }\n\n // now we convert size (max length of line) into \"font size units\"\n // at present time, the \"font size unit\" is always 'point'\n // 'proportional' means, \"in proportion to font size\"\n var fontUnit_maxLen = (1.0 * this.internal.scaleFactor * maxlen) / fsize;\n // at this time, fsize is always in \"points\" regardless of the default measurement unit of the doc.\n // this may change in the future?\n // until then, proportional_maxlen is likely to be in 'points'\n\n // If first line is to be indented (shorter or longer) than maxLen\n // we indicate that by using CSS-style \"text-indent\" option.\n // here it's in font units too (which is likely 'points')\n // it can be negative (which makes the first line longer than maxLen)\n newOptions.textIndent = options.textIndent\n ? (options.textIndent * 1.0 * this.internal.scaleFactor) / fsize\n : 0;\n newOptions.lineIndent = options.lineIndent;\n\n var i,\n l,\n output = [];\n for (i = 0, l = paragraphs.length; i < l; i++) {\n output = output.concat(\n splitParagraphIntoLines.apply(this, [\n paragraphs[i],\n fontUnit_maxLen,\n newOptions\n ])\n );\n }\n\n return output;\n };\n})(jsPDF.API);\n","/**\n * @license\n * (c) Dean McNamee , 2013.\n *\n * https://github.com/deanm/omggif\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,\n * including animation and compression. It does not rely on any specific\n * underlying system, so should run in the browser, Node, or Plask.\n */\n\n\"use strict\";\n\nimport { console } from \"./console.js\";\n\nfunction GifWriter(buf, width, height, gopts) {\n var p = 0;\n\n var gopts = gopts === undefined ? {} : gopts;\n var loop_count = gopts.loop === undefined ? null : gopts.loop;\n var global_palette = gopts.palette === undefined ? null : gopts.palette;\n\n if (width <= 0 || height <= 0 || width > 65535 || height > 65535)\n throw new Error(\"Width/Height invalid.\");\n\n function check_palette_and_num_colors(palette) {\n var num_colors = palette.length;\n if (num_colors < 2 || num_colors > 256 || num_colors & (num_colors - 1)) {\n throw new Error(\n \"Invalid code/color length, must be power of 2 and 2 .. 256.\"\n );\n }\n return num_colors;\n }\n\n // - Header.\n buf[p++] = 0x47;\n buf[p++] = 0x49;\n buf[p++] = 0x46; // GIF\n buf[p++] = 0x38;\n buf[p++] = 0x39;\n buf[p++] = 0x61; // 89a\n\n // Handling of Global Color Table (palette) and background index.\n var gp_num_colors_pow2 = 0;\n var background = 0;\n if (global_palette !== null) {\n var gp_num_colors = check_palette_and_num_colors(global_palette);\n while ((gp_num_colors >>= 1)) ++gp_num_colors_pow2;\n gp_num_colors = 1 << gp_num_colors_pow2;\n --gp_num_colors_pow2;\n if (gopts.background !== undefined) {\n background = gopts.background;\n if (background >= gp_num_colors)\n throw new Error(\"Background index out of range.\");\n // The GIF spec states that a background index of 0 should be ignored, so\n // this is probably a mistake and you really want to set it to another\n // slot in the palette. But actually in the end most browsers, etc end\n // up ignoring this almost completely (including for dispose background).\n if (background === 0)\n throw new Error(\"Background index explicitly passed as 0.\");\n }\n }\n\n // - Logical Screen Descriptor.\n // NOTE(deanm): w/h apparently ignored by implementations, but set anyway.\n buf[p++] = width & 0xff;\n buf[p++] = (width >> 8) & 0xff;\n buf[p++] = height & 0xff;\n buf[p++] = (height >> 8) & 0xff;\n // NOTE: Indicates 0-bpp original color resolution (unused?).\n buf[p++] = (global_palette !== null ? 0x80 : 0) | gp_num_colors_pow2; // Global Color Table Flag. // NOTE: No sort flag (unused?).\n buf[p++] = background; // Background Color Index.\n buf[p++] = 0; // Pixel aspect ratio (unused?).\n\n // - Global Color Table\n if (global_palette !== null) {\n for (var i = 0, il = global_palette.length; i < il; ++i) {\n var rgb = global_palette[i];\n buf[p++] = (rgb >> 16) & 0xff;\n buf[p++] = (rgb >> 8) & 0xff;\n buf[p++] = rgb & 0xff;\n }\n }\n\n if (loop_count !== null) {\n // Netscape block for looping.\n if (loop_count < 0 || loop_count > 65535)\n throw new Error(\"Loop count invalid.\");\n // Extension code, label, and length.\n buf[p++] = 0x21;\n buf[p++] = 0xff;\n buf[p++] = 0x0b;\n // NETSCAPE2.0\n buf[p++] = 0x4e;\n buf[p++] = 0x45;\n buf[p++] = 0x54;\n buf[p++] = 0x53;\n buf[p++] = 0x43;\n buf[p++] = 0x41;\n buf[p++] = 0x50;\n buf[p++] = 0x45;\n buf[p++] = 0x32;\n buf[p++] = 0x2e;\n buf[p++] = 0x30;\n // Sub-block\n buf[p++] = 0x03;\n buf[p++] = 0x01;\n buf[p++] = loop_count & 0xff;\n buf[p++] = (loop_count >> 8) & 0xff;\n buf[p++] = 0x00; // Terminator.\n }\n\n var ended = false;\n\n this.addFrame = function(x, y, w, h, indexed_pixels, opts) {\n if (ended === true) {\n --p;\n ended = false;\n } // Un-end.\n\n opts = opts === undefined ? {} : opts;\n\n // TODO(deanm): Bounds check x, y. Do they need to be within the virtual\n // canvas width/height, I imagine?\n if (x < 0 || y < 0 || x > 65535 || y > 65535)\n throw new Error(\"x/y invalid.\");\n\n if (w <= 0 || h <= 0 || w > 65535 || h > 65535)\n throw new Error(\"Width/Height invalid.\");\n\n if (indexed_pixels.length < w * h)\n throw new Error(\"Not enough pixels for the frame size.\");\n\n var using_local_palette = true;\n var palette = opts.palette;\n if (palette === undefined || palette === null) {\n using_local_palette = false;\n palette = global_palette;\n }\n\n if (palette === undefined || palette === null)\n throw new Error(\"Must supply either a local or global palette.\");\n\n var num_colors = check_palette_and_num_colors(palette);\n\n // Compute the min_code_size (power of 2), destroying num_colors.\n var min_code_size = 0;\n while ((num_colors >>= 1)) ++min_code_size;\n num_colors = 1 << min_code_size; // Now we can easily get it back.\n\n var delay = opts.delay === undefined ? 0 : opts.delay;\n\n // From the spec:\n // 0 - No disposal specified. The decoder is\n // not required to take any action.\n // 1 - Do not dispose. The graphic is to be left\n // in place.\n // 2 - Restore to background color. The area used by the\n // graphic must be restored to the background color.\n // 3 - Restore to previous. The decoder is required to\n // restore the area overwritten by the graphic with\n // what was there prior to rendering the graphic.\n // 4-7 - To be defined.\n // NOTE(deanm): Dispose background doesn't really work, apparently most\n // browsers ignore the background palette index and clear to transparency.\n var disposal = opts.disposal === undefined ? 0 : opts.disposal;\n if (disposal < 0 || disposal > 3)\n // 4-7 is reserved.\n throw new Error(\"Disposal out of range.\");\n\n var use_transparency = false;\n var transparent_index = 0;\n if (opts.transparent !== undefined && opts.transparent !== null) {\n use_transparency = true;\n transparent_index = opts.transparent;\n if (transparent_index < 0 || transparent_index >= num_colors)\n throw new Error(\"Transparent color index.\");\n }\n\n if (disposal !== 0 || use_transparency || delay !== 0) {\n // - Graphics Control Extension\n buf[p++] = 0x21;\n buf[p++] = 0xf9; // Extension / Label.\n buf[p++] = 4; // Byte size.\n\n buf[p++] = (disposal << 2) | (use_transparency === true ? 1 : 0);\n buf[p++] = delay & 0xff;\n buf[p++] = (delay >> 8) & 0xff;\n buf[p++] = transparent_index; // Transparent color index.\n buf[p++] = 0; // Block Terminator.\n }\n\n // - Image Descriptor\n buf[p++] = 0x2c; // Image Seperator.\n buf[p++] = x & 0xff;\n buf[p++] = (x >> 8) & 0xff; // Left.\n buf[p++] = y & 0xff;\n buf[p++] = (y >> 8) & 0xff; // Top.\n buf[p++] = w & 0xff;\n buf[p++] = (w >> 8) & 0xff;\n buf[p++] = h & 0xff;\n buf[p++] = (h >> 8) & 0xff;\n // NOTE: No sort flag (unused?).\n // TODO(deanm): Support interlace.\n buf[p++] = using_local_palette === true ? 0x80 | (min_code_size - 1) : 0;\n\n // - Local Color Table\n if (using_local_palette === true) {\n for (var i = 0, il = palette.length; i < il; ++i) {\n var rgb = palette[i];\n buf[p++] = (rgb >> 16) & 0xff;\n buf[p++] = (rgb >> 8) & 0xff;\n buf[p++] = rgb & 0xff;\n }\n }\n\n p = GifWriterOutputLZWCodeStream(\n buf,\n p,\n min_code_size < 2 ? 2 : min_code_size,\n indexed_pixels\n );\n\n return p;\n };\n\n this.end = function() {\n if (ended === false) {\n buf[p++] = 0x3b; // Trailer.\n ended = true;\n }\n return p;\n };\n\n this.getOutputBuffer = function() {\n return buf;\n };\n this.setOutputBuffer = function(v) {\n buf = v;\n };\n this.getOutputBufferPosition = function() {\n return p;\n };\n this.setOutputBufferPosition = function(v) {\n p = v;\n };\n}\n\n// Main compression routine, palette indexes -> LZW code stream.\n// |index_stream| must have at least one entry.\nfunction GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) {\n buf[p++] = min_code_size;\n var cur_subblock = p++; // Pointing at the length field.\n\n var clear_code = 1 << min_code_size;\n var code_mask = clear_code - 1;\n var eoi_code = clear_code + 1;\n var next_code = eoi_code + 1;\n\n var cur_code_size = min_code_size + 1; // Number of bits per code.\n var cur_shift = 0;\n // We have at most 12-bit codes, so we should have to hold a max of 19\n // bits here (and then we would write out).\n var cur = 0;\n\n function emit_bytes_to_buffer(bit_block_size) {\n while (cur_shift >= bit_block_size) {\n buf[p++] = cur & 0xff;\n cur >>= 8;\n cur_shift -= 8;\n if (p === cur_subblock + 256) {\n // Finished a subblock.\n buf[cur_subblock] = 255;\n cur_subblock = p++;\n }\n }\n }\n\n function emit_code(c) {\n cur |= c << cur_shift;\n cur_shift += cur_code_size;\n emit_bytes_to_buffer(8);\n }\n\n // I am not an expert on the topic, and I don't want to write a thesis.\n // However, it is good to outline here the basic algorithm and the few data\n // structures and optimizations here that make this implementation fast.\n // The basic idea behind LZW is to build a table of previously seen runs\n // addressed by a short id (herein called output code). All data is\n // referenced by a code, which represents one or more values from the\n // original input stream. All input bytes can be referenced as the same\n // value as an output code. So if you didn't want any compression, you\n // could more or less just output the original bytes as codes (there are\n // some details to this, but it is the idea). In order to achieve\n // compression, values greater then the input range (codes can be up to\n // 12-bit while input only 8-bit) represent a sequence of previously seen\n // inputs. The decompressor is able to build the same mapping while\n // decoding, so there is always a shared common knowledge between the\n // encoding and decoder, which is also important for \"timing\" aspects like\n // how to handle variable bit width code encoding.\n //\n // One obvious but very important consequence of the table system is there\n // is always a unique id (at most 12-bits) to map the runs. 'A' might be\n // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship\n // can be used for an effecient lookup strategy for the code mapping. We\n // need to know if a run has been seen before, and be able to map that run\n // to the output code. Since we start with known unique ids (input bytes),\n // and then from those build more unique ids (table entries), we can\n // continue this chain (almost like a linked list) to always have small\n // integer values that represent the current byte chains in the encoder.\n // This means instead of tracking the input bytes (AAAABCD) to know our\n // current state, we can track the table entry for AAAABC (it is guaranteed\n // to exist by the nature of the algorithm) and the next character D.\n // Therefor the tuple of (table_entry, byte) is guaranteed to also be\n // unique. This allows us to create a simple lookup key for mapping input\n // sequences to codes (table indices) without having to store or search\n // any of the code sequences. So if 'AAAA' has a table entry of 12, the\n // tuple of ('AAAA', K) for any input byte K will be unique, and can be our\n // key. This leads to a integer value at most 20-bits, which can always\n // fit in an SMI value and be used as a fast sparse array / object key.\n\n // Output code for the current contents of the index buffer.\n var ib_code = index_stream[0] & code_mask; // Load first input index.\n var code_table = {}; // Key'd on our 20-bit \"tuple\".\n\n emit_code(clear_code); // Spec says first code should be a clear code.\n\n // First index already loaded, process the rest of the stream.\n for (var i = 1, il = index_stream.length; i < il; ++i) {\n var k = index_stream[i] & code_mask;\n var cur_key = (ib_code << 8) | k; // (prev, k) unique tuple.\n var cur_code = code_table[cur_key]; // buffer + k.\n\n // Check if we have to create a new code table entry.\n if (cur_code === undefined) {\n // We don't have buffer + k.\n // Emit index buffer (without k).\n // This is an inline version of emit_code, because this is the core\n // writing routine of the compressor (and V8 cannot inline emit_code\n // because it is a closure here in a different context). Additionally\n // we can call emit_byte_to_buffer less often, because we can have\n // 30-bits (from our 31-bit signed SMI), and we know our codes will only\n // be 12-bits, so can safely have 18-bits there without overflow.\n // emit_code(ib_code);\n cur |= ib_code << cur_shift;\n cur_shift += cur_code_size;\n while (cur_shift >= 8) {\n buf[p++] = cur & 0xff;\n cur >>= 8;\n cur_shift -= 8;\n if (p === cur_subblock + 256) {\n // Finished a subblock.\n buf[cur_subblock] = 255;\n cur_subblock = p++;\n }\n }\n\n if (next_code === 4096) {\n // Table full, need a clear.\n emit_code(clear_code);\n next_code = eoi_code + 1;\n cur_code_size = min_code_size + 1;\n code_table = {};\n } else {\n // Table not full, insert a new entry.\n // Increase our variable bit code sizes if necessary. This is a bit\n // tricky as it is based on \"timing\" between the encoding and\n // decoder. From the encoders perspective this should happen after\n // we've already emitted the index buffer and are about to create the\n // first table entry that would overflow our current code bit size.\n if (next_code >= 1 << cur_code_size) ++cur_code_size;\n code_table[cur_key] = next_code++; // Insert into code table.\n }\n\n ib_code = k; // Index buffer to single input k.\n } else {\n ib_code = cur_code; // Index buffer to sequence in code table.\n }\n }\n\n emit_code(ib_code); // There will still be something in the index buffer.\n emit_code(eoi_code); // End Of Information.\n\n // Flush / finalize the sub-blocks stream to the buffer.\n emit_bytes_to_buffer(1);\n\n // Finish the sub-blocks, writing out any unfinished lengths and\n // terminating with a sub-block of length 0. If we have already started\n // but not yet used a sub-block it can just become the terminator.\n if (cur_subblock + 1 === p) {\n // Started but unused.\n buf[cur_subblock] = 0;\n } else {\n // Started and used, write length and additional terminator block.\n buf[cur_subblock] = p - cur_subblock - 1;\n buf[p++] = 0;\n }\n return p;\n}\n\nfunction GifReader(buf) {\n var p = 0;\n\n // - Header (GIF87a or GIF89a).\n if (\n buf[p++] !== 0x47 ||\n buf[p++] !== 0x49 ||\n buf[p++] !== 0x46 ||\n buf[p++] !== 0x38 ||\n ((buf[p++] + 1) & 0xfd) !== 0x38 ||\n buf[p++] !== 0x61\n ) {\n throw new Error(\"Invalid GIF 87a/89a header.\");\n }\n\n // - Logical Screen Descriptor.\n var width = buf[p++] | (buf[p++] << 8);\n var height = buf[p++] | (buf[p++] << 8);\n var pf0 = buf[p++]; // .\n var global_palette_flag = pf0 >> 7;\n var num_global_colors_pow2 = pf0 & 0x7;\n var num_global_colors = 1 << (num_global_colors_pow2 + 1);\n var background = buf[p++];\n buf[p++]; // Pixel aspect ratio (unused?).\n\n var global_palette_offset = null;\n var global_palette_size = null;\n\n if (global_palette_flag) {\n global_palette_offset = p;\n global_palette_size = num_global_colors;\n p += num_global_colors * 3; // Seek past palette.\n }\n\n var no_eof = true;\n\n var frames = [];\n\n var delay = 0;\n var transparent_index = null;\n var disposal = 0; // 0 - No disposal specified.\n var loop_count = null;\n\n this.width = width;\n this.height = height;\n\n while (no_eof && p < buf.length) {\n switch (buf[p++]) {\n case 0x21: // Graphics Control Extension Block\n switch (buf[p++]) {\n case 0xff: // Application specific block\n // Try if it's a Netscape block (with animation loop counter).\n if (\n buf[p] !== 0x0b || // 21 FF already read, check block size.\n // NETSCAPE2.0\n (buf[p + 1] == 0x4e &&\n buf[p + 2] == 0x45 &&\n buf[p + 3] == 0x54 &&\n buf[p + 4] == 0x53 &&\n buf[p + 5] == 0x43 &&\n buf[p + 6] == 0x41 &&\n buf[p + 7] == 0x50 &&\n buf[p + 8] == 0x45 &&\n buf[p + 9] == 0x32 &&\n buf[p + 10] == 0x2e &&\n buf[p + 11] == 0x30 &&\n // Sub-block\n buf[p + 12] == 0x03 &&\n buf[p + 13] == 0x01 &&\n buf[p + 16] == 0)\n ) {\n p += 14;\n loop_count = buf[p++] | (buf[p++] << 8);\n p++; // Skip terminator.\n } else {\n // We don't know what it is, just try to get past it.\n p += 12;\n while (true) {\n // Seek through subblocks.\n var block_size = buf[p++];\n // Bad block size (ex: undefined from an out of bounds read).\n if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n if (block_size === 0) break; // 0 size is terminator\n p += block_size;\n }\n }\n break;\n\n case 0xf9: // Graphics Control Extension\n if (buf[p++] !== 0x4 || buf[p + 4] !== 0)\n throw new Error(\"Invalid graphics extension block.\");\n var pf1 = buf[p++];\n delay = buf[p++] | (buf[p++] << 8);\n transparent_index = buf[p++];\n if ((pf1 & 1) === 0) transparent_index = null;\n disposal = (pf1 >> 2) & 0x7;\n p++; // Skip terminator.\n break;\n\n case 0xfe: // Comment Extension.\n while (true) {\n // Seek through subblocks.\n var block_size = buf[p++];\n // Bad block size (ex: undefined from an out of bounds read).\n if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n if (block_size === 0) break; // 0 size is terminator\n // console.log(buf.slice(p, p+block_size).toString('ascii'));\n p += block_size;\n }\n break;\n\n default:\n throw new Error(\n \"Unknown graphic control label: 0x\" + buf[p - 1].toString(16)\n );\n }\n break;\n\n case 0x2c: // Image Descriptor.\n var x = buf[p++] | (buf[p++] << 8);\n var y = buf[p++] | (buf[p++] << 8);\n var w = buf[p++] | (buf[p++] << 8);\n var h = buf[p++] | (buf[p++] << 8);\n var pf2 = buf[p++];\n var local_palette_flag = pf2 >> 7;\n var interlace_flag = (pf2 >> 6) & 1;\n var num_local_colors_pow2 = pf2 & 0x7;\n var num_local_colors = 1 << (num_local_colors_pow2 + 1);\n var palette_offset = global_palette_offset;\n var palette_size = global_palette_size;\n var has_local_palette = false;\n if (local_palette_flag) {\n var has_local_palette = true;\n palette_offset = p; // Override with local palette.\n palette_size = num_local_colors;\n p += num_local_colors * 3; // Seek past palette.\n }\n\n var data_offset = p;\n\n p++; // codesize\n while (true) {\n var block_size = buf[p++];\n // Bad block size (ex: undefined from an out of bounds read).\n if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n if (block_size === 0) break; // 0 size is terminator\n p += block_size;\n }\n\n frames.push({\n x: x,\n y: y,\n width: w,\n height: h,\n has_local_palette: has_local_palette,\n palette_offset: palette_offset,\n palette_size: palette_size,\n data_offset: data_offset,\n data_length: p - data_offset,\n transparent_index: transparent_index,\n interlaced: !!interlace_flag,\n delay: delay,\n disposal: disposal\n });\n break;\n\n case 0x3b: // Trailer Marker (end of file).\n no_eof = false;\n break;\n\n default:\n throw new Error(\"Unknown gif block: 0x\" + buf[p - 1].toString(16));\n break;\n }\n }\n\n this.numFrames = function() {\n return frames.length;\n };\n\n this.loopCount = function() {\n return loop_count;\n };\n\n this.frameInfo = function(frame_num) {\n if (frame_num < 0 || frame_num >= frames.length)\n throw new Error(\"Frame index out of range.\");\n return frames[frame_num];\n };\n\n this.decodeAndBlitFrameBGRA = function(frame_num, pixels) {\n var frame = this.frameInfo(frame_num);\n var num_pixels = frame.width * frame.height;\n var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.\n GifReaderLZWOutputIndexStream(\n buf,\n frame.data_offset,\n index_stream,\n num_pixels\n );\n var palette_offset = frame.palette_offset;\n\n // NOTE(deanm): It seems to be much faster to compare index to 256 than\n // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in\n // the profile, not sure if it's related to using a Uint8Array.\n var trans = frame.transparent_index;\n if (trans === null) trans = 256;\n\n // We are possibly just blitting to a portion of the entire frame.\n // That is a subrect within the framerect, so the additional pixels\n // must be skipped over after we finished a scanline.\n var framewidth = frame.width;\n var framestride = width - framewidth;\n var xleft = framewidth; // Number of subrect pixels left in scanline.\n\n // Output indices of the top left and bottom right corners of the subrect.\n var opbeg = (frame.y * width + frame.x) * 4;\n var opend = ((frame.y + frame.height) * width + frame.x) * 4;\n var op = opbeg;\n\n var scanstride = framestride * 4;\n\n // Use scanstride to skip past the rows when interlacing. This is skipping\n // 7 rows for the first two passes, then 3 then 1.\n if (frame.interlaced === true) {\n scanstride += width * 4 * 7; // Pass 1.\n }\n\n var interlaceskip = 8; // Tracking the row interval in the current pass.\n\n for (var i = 0, il = index_stream.length; i < il; ++i) {\n var index = index_stream[i];\n\n if (xleft === 0) {\n // Beginning of new scan line\n op += scanstride;\n xleft = framewidth;\n if (op >= opend) {\n // Catch the wrap to switch passes when interlacing.\n scanstride = framestride * 4 + width * 4 * (interlaceskip - 1);\n // interlaceskip / 2 * 4 is interlaceskip << 1.\n op = opbeg + (framewidth + framestride) * (interlaceskip << 1);\n interlaceskip >>= 1;\n }\n }\n\n if (index === trans) {\n op += 4;\n } else {\n var r = buf[palette_offset + index * 3];\n var g = buf[palette_offset + index * 3 + 1];\n var b = buf[palette_offset + index * 3 + 2];\n pixels[op++] = b;\n pixels[op++] = g;\n pixels[op++] = r;\n pixels[op++] = 255;\n }\n --xleft;\n }\n };\n\n // I will go to copy and paste hell one day...\n this.decodeAndBlitFrameRGBA = function(frame_num, pixels) {\n var frame = this.frameInfo(frame_num);\n var num_pixels = frame.width * frame.height;\n var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.\n GifReaderLZWOutputIndexStream(\n buf,\n frame.data_offset,\n index_stream,\n num_pixels\n );\n var palette_offset = frame.palette_offset;\n\n // NOTE(deanm): It seems to be much faster to compare index to 256 than\n // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in\n // the profile, not sure if it's related to using a Uint8Array.\n var trans = frame.transparent_index;\n if (trans === null) trans = 256;\n\n // We are possibly just blitting to a portion of the entire frame.\n // That is a subrect within the framerect, so the additional pixels\n // must be skipped over after we finished a scanline.\n var framewidth = frame.width;\n var framestride = width - framewidth;\n var xleft = framewidth; // Number of subrect pixels left in scanline.\n\n // Output indices of the top left and bottom right corners of the subrect.\n var opbeg = (frame.y * width + frame.x) * 4;\n var opend = ((frame.y + frame.height) * width + frame.x) * 4;\n var op = opbeg;\n\n var scanstride = framestride * 4;\n\n // Use scanstride to skip past the rows when interlacing. This is skipping\n // 7 rows for the first two passes, then 3 then 1.\n if (frame.interlaced === true) {\n scanstride += width * 4 * 7; // Pass 1.\n }\n\n var interlaceskip = 8; // Tracking the row interval in the current pass.\n\n for (var i = 0, il = index_stream.length; i < il; ++i) {\n var index = index_stream[i];\n\n if (xleft === 0) {\n // Beginning of new scan line\n op += scanstride;\n xleft = framewidth;\n if (op >= opend) {\n // Catch the wrap to switch passes when interlacing.\n scanstride = framestride * 4 + width * 4 * (interlaceskip - 1);\n // interlaceskip / 2 * 4 is interlaceskip << 1.\n op = opbeg + (framewidth + framestride) * (interlaceskip << 1);\n interlaceskip >>= 1;\n }\n }\n\n if (index === trans) {\n op += 4;\n } else {\n var r = buf[palette_offset + index * 3];\n var g = buf[palette_offset + index * 3 + 1];\n var b = buf[palette_offset + index * 3 + 2];\n pixels[op++] = r;\n pixels[op++] = g;\n pixels[op++] = b;\n pixels[op++] = 255;\n }\n --xleft;\n }\n };\n}\n\nfunction GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) {\n var min_code_size = code_stream[p++];\n\n var clear_code = 1 << min_code_size;\n var eoi_code = clear_code + 1;\n var next_code = eoi_code + 1;\n\n var cur_code_size = min_code_size + 1; // Number of bits per code.\n // NOTE: This shares the same name as the encoder, but has a different\n // meaning here. Here this masks each code coming from the code stream.\n var code_mask = (1 << cur_code_size) - 1;\n var cur_shift = 0;\n var cur = 0;\n\n var op = 0; // Output pointer.\n\n var subblock_size = code_stream[p++];\n\n // TODO(deanm): Would using a TypedArray be any faster? At least it would\n // solve the fast mode / backing store uncertainty.\n // var code_table = Array(4096);\n var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits.\n\n var prev_code = null; // Track code-1.\n\n while (true) {\n // Read up to two bytes, making sure we always 12-bits for max sized code.\n while (cur_shift < 16) {\n if (subblock_size === 0) break; // No more data to be read.\n\n cur |= code_stream[p++] << cur_shift;\n cur_shift += 8;\n\n if (subblock_size === 1) {\n // Never let it get to 0 to hold logic above.\n subblock_size = code_stream[p++]; // Next subblock.\n } else {\n --subblock_size;\n }\n }\n\n // TODO(deanm): We should never really get here, we should have received\n // and EOI.\n if (cur_shift < cur_code_size) break;\n\n var code = cur & code_mask;\n cur >>= cur_code_size;\n cur_shift -= cur_code_size;\n\n // TODO(deanm): Maybe should check that the first code was a clear code,\n // at least this is what you're supposed to do. But actually our encoder\n // now doesn't emit a clear code first anyway.\n if (code === clear_code) {\n // We don't actually have to clear the table. This could be a good idea\n // for greater error checking, but we don't really do any anyway. We\n // will just track it with next_code and overwrite old entries.\n\n next_code = eoi_code + 1;\n cur_code_size = min_code_size + 1;\n code_mask = (1 << cur_code_size) - 1;\n\n // Don't update prev_code ?\n prev_code = null;\n continue;\n } else if (code === eoi_code) {\n break;\n }\n\n // We have a similar situation as the decoder, where we want to store\n // variable length entries (code table entries), but we want to do in a\n // faster manner than an array of arrays. The code below stores sort of a\n // linked list within the code table, and then \"chases\" through it to\n // construct the dictionary entries. When a new entry is created, just the\n // last byte is stored, and the rest (prefix) of the entry is only\n // referenced by its table entry. Then the code chases through the\n // prefixes until it reaches a single byte code. We have to chase twice,\n // first to compute the length, and then to actually copy the data to the\n // output (backwards, since we know the length). The alternative would be\n // storing something in an intermediate stack, but that doesn't make any\n // more sense. I implemented an approach where it also stored the length\n // in the code table, although it's a bit tricky because you run out of\n // bits (12 + 12 + 8), but I didn't measure much improvements (the table\n // entries are generally not the long). Even when I created benchmarks for\n // very long table entries the complexity did not seem worth it.\n // The code table stores the prefix entry in 12 bits and then the suffix\n // byte in 8 bits, so each entry is 20 bits.\n\n var chase_code = code < next_code ? code : prev_code;\n\n // Chase what we will output, either {CODE} or {CODE-1}.\n var chase_length = 0;\n var chase = chase_code;\n while (chase > clear_code) {\n chase = code_table[chase] >> 8;\n ++chase_length;\n }\n\n var k = chase;\n\n var op_end = op + chase_length + (chase_code !== code ? 1 : 0);\n if (op_end > output_length) {\n console.log(\"Warning, gif stream longer than expected.\");\n return;\n }\n\n // Already have the first byte from the chase, might as well write it fast.\n output[op++] = k;\n\n op += chase_length;\n var b = op; // Track pointer, writing backwards.\n\n if (chase_code !== code)\n // The case of emitting {CODE-1} + k.\n output[op++] = k;\n\n chase = chase_code;\n while (chase_length--) {\n chase = code_table[chase];\n output[--b] = chase & 0xff; // Write backwards.\n chase >>= 8; // Pull down to the prefix code.\n }\n\n if (prev_code !== null && next_code < 4096) {\n code_table[next_code++] = (prev_code << 8) | k;\n // TODO(deanm): Figure out this clearing vs code growth logic better. I\n // have an feeling that it should just happen somewhere else, for now it\n // is awkward between when we grow past the max and then hit a clear code.\n // For now just check if we hit the max 12-bits (then a clear code should\n // follow, also of course encoded in 12-bits).\n if (next_code >= code_mask + 1 && cur_code_size < 12) {\n ++cur_code_size;\n code_mask = (code_mask << 1) | 1;\n }\n }\n\n prev_code = code;\n }\n\n if (op !== output_length) {\n console.log(\"Warning, gif stream shorter than expected.\");\n }\n\n return output;\n}\n\nexport { GifReader, GifWriter };\n","/**\n * @license\n Copyright (c) 2008, Adobe Systems Incorporated\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without \n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright notice, \n this list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the \n documentation and/or other materials provided with the distribution.\n \n * Neither the name of Adobe Systems Incorporated nor the names of its \n contributors may be used to endorse or promote products derived from \n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR \n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*\nJPEG encoder ported to JavaScript and optimized by Andreas Ritter, www.bytestrom.eu, 11/2009\n\nBasic GUI blocking jpeg encoder\n*/\n\nfunction JPEGEncoder(quality) {\n var ffloor = Math.floor;\n var YTable = new Array(64);\n var UVTable = new Array(64);\n var fdtbl_Y = new Array(64);\n var fdtbl_UV = new Array(64);\n var YDC_HT;\n var UVDC_HT;\n var YAC_HT;\n var UVAC_HT;\n\n var bitcode = new Array(65535);\n var category = new Array(65535);\n var outputfDCTQuant = new Array(64);\n var DU = new Array(64);\n var byteout = [];\n var bytenew = 0;\n var bytepos = 7;\n\n var YDU = new Array(64);\n var UDU = new Array(64);\n var VDU = new Array(64);\n var clt = new Array(256);\n var RGB_YUV_TABLE = new Array(2048);\n var currentQuality;\n\n var ZigZag = [\n 0,\n 1,\n 5,\n 6,\n 14,\n 15,\n 27,\n 28,\n 2,\n 4,\n 7,\n 13,\n 16,\n 26,\n 29,\n 42,\n 3,\n 8,\n 12,\n 17,\n 25,\n 30,\n 41,\n 43,\n 9,\n 11,\n 18,\n 24,\n 31,\n 40,\n 44,\n 53,\n 10,\n 19,\n 23,\n 32,\n 39,\n 45,\n 52,\n 54,\n 20,\n 22,\n 33,\n 38,\n 46,\n 51,\n 55,\n 60,\n 21,\n 34,\n 37,\n 47,\n 50,\n 56,\n 59,\n 61,\n 35,\n 36,\n 48,\n 49,\n 57,\n 58,\n 62,\n 63\n ];\n\n var std_dc_luminance_nrcodes = [\n 0,\n 0,\n 1,\n 5,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ];\n var std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n var std_ac_luminance_nrcodes = [\n 0,\n 0,\n 2,\n 1,\n 3,\n 3,\n 2,\n 4,\n 3,\n 5,\n 5,\n 4,\n 4,\n 0,\n 0,\n 1,\n 0x7d\n ];\n var std_ac_luminance_values = [\n 0x01,\n 0x02,\n 0x03,\n 0x00,\n 0x04,\n 0x11,\n 0x05,\n 0x12,\n 0x21,\n 0x31,\n 0x41,\n 0x06,\n 0x13,\n 0x51,\n 0x61,\n 0x07,\n 0x22,\n 0x71,\n 0x14,\n 0x32,\n 0x81,\n 0x91,\n 0xa1,\n 0x08,\n 0x23,\n 0x42,\n 0xb1,\n 0xc1,\n 0x15,\n 0x52,\n 0xd1,\n 0xf0,\n 0x24,\n 0x33,\n 0x62,\n 0x72,\n 0x82,\n 0x09,\n 0x0a,\n 0x16,\n 0x17,\n 0x18,\n 0x19,\n 0x1a,\n 0x25,\n 0x26,\n 0x27,\n 0x28,\n 0x29,\n 0x2a,\n 0x34,\n 0x35,\n 0x36,\n 0x37,\n 0x38,\n 0x39,\n 0x3a,\n 0x43,\n 0x44,\n 0x45,\n 0x46,\n 0x47,\n 0x48,\n 0x49,\n 0x4a,\n 0x53,\n 0x54,\n 0x55,\n 0x56,\n 0x57,\n 0x58,\n 0x59,\n 0x5a,\n 0x63,\n 0x64,\n 0x65,\n 0x66,\n 0x67,\n 0x68,\n 0x69,\n 0x6a,\n 0x73,\n 0x74,\n 0x75,\n 0x76,\n 0x77,\n 0x78,\n 0x79,\n 0x7a,\n 0x83,\n 0x84,\n 0x85,\n 0x86,\n 0x87,\n 0x88,\n 0x89,\n 0x8a,\n 0x92,\n 0x93,\n 0x94,\n 0x95,\n 0x96,\n 0x97,\n 0x98,\n 0x99,\n 0x9a,\n 0xa2,\n 0xa3,\n 0xa4,\n 0xa5,\n 0xa6,\n 0xa7,\n 0xa8,\n 0xa9,\n 0xaa,\n 0xb2,\n 0xb3,\n 0xb4,\n 0xb5,\n 0xb6,\n 0xb7,\n 0xb8,\n 0xb9,\n 0xba,\n 0xc2,\n 0xc3,\n 0xc4,\n 0xc5,\n 0xc6,\n 0xc7,\n 0xc8,\n 0xc9,\n 0xca,\n 0xd2,\n 0xd3,\n 0xd4,\n 0xd5,\n 0xd6,\n 0xd7,\n 0xd8,\n 0xd9,\n 0xda,\n 0xe1,\n 0xe2,\n 0xe3,\n 0xe4,\n 0xe5,\n 0xe6,\n 0xe7,\n 0xe8,\n 0xe9,\n 0xea,\n 0xf1,\n 0xf2,\n 0xf3,\n 0xf4,\n 0xf5,\n 0xf6,\n 0xf7,\n 0xf8,\n 0xf9,\n 0xfa\n ];\n\n var std_dc_chrominance_nrcodes = [\n 0,\n 0,\n 3,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0\n ];\n var std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n var std_ac_chrominance_nrcodes = [\n 0,\n 0,\n 2,\n 1,\n 2,\n 4,\n 4,\n 3,\n 4,\n 7,\n 5,\n 4,\n 4,\n 0,\n 1,\n 2,\n 0x77\n ];\n var std_ac_chrominance_values = [\n 0x00,\n 0x01,\n 0x02,\n 0x03,\n 0x11,\n 0x04,\n 0x05,\n 0x21,\n 0x31,\n 0x06,\n 0x12,\n 0x41,\n 0x51,\n 0x07,\n 0x61,\n 0x71,\n 0x13,\n 0x22,\n 0x32,\n 0x81,\n 0x08,\n 0x14,\n 0x42,\n 0x91,\n 0xa1,\n 0xb1,\n 0xc1,\n 0x09,\n 0x23,\n 0x33,\n 0x52,\n 0xf0,\n 0x15,\n 0x62,\n 0x72,\n 0xd1,\n 0x0a,\n 0x16,\n 0x24,\n 0x34,\n 0xe1,\n 0x25,\n 0xf1,\n 0x17,\n 0x18,\n 0x19,\n 0x1a,\n 0x26,\n 0x27,\n 0x28,\n 0x29,\n 0x2a,\n 0x35,\n 0x36,\n 0x37,\n 0x38,\n 0x39,\n 0x3a,\n 0x43,\n 0x44,\n 0x45,\n 0x46,\n 0x47,\n 0x48,\n 0x49,\n 0x4a,\n 0x53,\n 0x54,\n 0x55,\n 0x56,\n 0x57,\n 0x58,\n 0x59,\n 0x5a,\n 0x63,\n 0x64,\n 0x65,\n 0x66,\n 0x67,\n 0x68,\n 0x69,\n 0x6a,\n 0x73,\n 0x74,\n 0x75,\n 0x76,\n 0x77,\n 0x78,\n 0x79,\n 0x7a,\n 0x82,\n 0x83,\n 0x84,\n 0x85,\n 0x86,\n 0x87,\n 0x88,\n 0x89,\n 0x8a,\n 0x92,\n 0x93,\n 0x94,\n 0x95,\n 0x96,\n 0x97,\n 0x98,\n 0x99,\n 0x9a,\n 0xa2,\n 0xa3,\n 0xa4,\n 0xa5,\n 0xa6,\n 0xa7,\n 0xa8,\n 0xa9,\n 0xaa,\n 0xb2,\n 0xb3,\n 0xb4,\n 0xb5,\n 0xb6,\n 0xb7,\n 0xb8,\n 0xb9,\n 0xba,\n 0xc2,\n 0xc3,\n 0xc4,\n 0xc5,\n 0xc6,\n 0xc7,\n 0xc8,\n 0xc9,\n 0xca,\n 0xd2,\n 0xd3,\n 0xd4,\n 0xd5,\n 0xd6,\n 0xd7,\n 0xd8,\n 0xd9,\n 0xda,\n 0xe2,\n 0xe3,\n 0xe4,\n 0xe5,\n 0xe6,\n 0xe7,\n 0xe8,\n 0xe9,\n 0xea,\n 0xf2,\n 0xf3,\n 0xf4,\n 0xf5,\n 0xf6,\n 0xf7,\n 0xf8,\n 0xf9,\n 0xfa\n ];\n\n function initQuantTables(sf) {\n var YQT = [\n 16,\n 11,\n 10,\n 16,\n 24,\n 40,\n 51,\n 61,\n 12,\n 12,\n 14,\n 19,\n 26,\n 58,\n 60,\n 55,\n 14,\n 13,\n 16,\n 24,\n 40,\n 57,\n 69,\n 56,\n 14,\n 17,\n 22,\n 29,\n 51,\n 87,\n 80,\n 62,\n 18,\n 22,\n 37,\n 56,\n 68,\n 109,\n 103,\n 77,\n 24,\n 35,\n 55,\n 64,\n 81,\n 104,\n 113,\n 92,\n 49,\n 64,\n 78,\n 87,\n 103,\n 121,\n 120,\n 101,\n 72,\n 92,\n 95,\n 98,\n 112,\n 100,\n 103,\n 99\n ];\n\n for (var i = 0; i < 64; i++) {\n var t = ffloor((YQT[i] * sf + 50) / 100);\n t = Math.min(Math.max(t, 1), 255);\n YTable[ZigZag[i]] = t;\n }\n var UVQT = [\n 17,\n 18,\n 24,\n 47,\n 99,\n 99,\n 99,\n 99,\n 18,\n 21,\n 26,\n 66,\n 99,\n 99,\n 99,\n 99,\n 24,\n 26,\n 56,\n 99,\n 99,\n 99,\n 99,\n 99,\n 47,\n 66,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99,\n 99\n ];\n for (var j = 0; j < 64; j++) {\n var u = ffloor((UVQT[j] * sf + 50) / 100);\n u = Math.min(Math.max(u, 1), 255);\n UVTable[ZigZag[j]] = u;\n }\n var aasf = [\n 1.0,\n 1.387039845,\n 1.306562965,\n 1.175875602,\n 1.0,\n 0.785694958,\n 0.5411961,\n 0.275899379\n ];\n var k = 0;\n for (var row = 0; row < 8; row++) {\n for (var col = 0; col < 8; col++) {\n fdtbl_Y[k] = 1.0 / (YTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);\n fdtbl_UV[k] = 1.0 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);\n k++;\n }\n }\n }\n\n function computeHuffmanTbl(nrcodes, std_table) {\n var codevalue = 0;\n var pos_in_table = 0;\n var HT = new Array();\n for (var k = 1; k <= 16; k++) {\n for (var j = 1; j <= nrcodes[k]; j++) {\n HT[std_table[pos_in_table]] = [];\n HT[std_table[pos_in_table]][0] = codevalue;\n HT[std_table[pos_in_table]][1] = k;\n pos_in_table++;\n codevalue++;\n }\n codevalue *= 2;\n }\n return HT;\n }\n\n function initHuffmanTbl() {\n YDC_HT = computeHuffmanTbl(\n std_dc_luminance_nrcodes,\n std_dc_luminance_values\n );\n UVDC_HT = computeHuffmanTbl(\n std_dc_chrominance_nrcodes,\n std_dc_chrominance_values\n );\n YAC_HT = computeHuffmanTbl(\n std_ac_luminance_nrcodes,\n std_ac_luminance_values\n );\n UVAC_HT = computeHuffmanTbl(\n std_ac_chrominance_nrcodes,\n std_ac_chrominance_values\n );\n }\n\n function initCategoryNumber() {\n var nrlower = 1;\n var nrupper = 2;\n for (var cat = 1; cat <= 15; cat++) {\n //Positive numbers\n for (var nr = nrlower; nr < nrupper; nr++) {\n category[32767 + nr] = cat;\n bitcode[32767 + nr] = [];\n bitcode[32767 + nr][1] = cat;\n bitcode[32767 + nr][0] = nr;\n }\n //Negative numbers\n for (var nrneg = -(nrupper - 1); nrneg <= -nrlower; nrneg++) {\n category[32767 + nrneg] = cat;\n bitcode[32767 + nrneg] = [];\n bitcode[32767 + nrneg][1] = cat;\n bitcode[32767 + nrneg][0] = nrupper - 1 + nrneg;\n }\n nrlower <<= 1;\n nrupper <<= 1;\n }\n }\n\n function initRGBYUVTable() {\n for (var i = 0; i < 256; i++) {\n RGB_YUV_TABLE[i] = 19595 * i;\n RGB_YUV_TABLE[(i + 256) >> 0] = 38470 * i;\n RGB_YUV_TABLE[(i + 512) >> 0] = 7471 * i + 0x8000;\n RGB_YUV_TABLE[(i + 768) >> 0] = -11059 * i;\n RGB_YUV_TABLE[(i + 1024) >> 0] = -21709 * i;\n RGB_YUV_TABLE[(i + 1280) >> 0] = 32768 * i + 0x807fff;\n RGB_YUV_TABLE[(i + 1536) >> 0] = -27439 * i;\n RGB_YUV_TABLE[(i + 1792) >> 0] = -5329 * i;\n }\n }\n\n // IO functions\n function writeBits(bs) {\n var value = bs[0];\n var posval = bs[1] - 1;\n while (posval >= 0) {\n if (value & (1 << posval)) {\n bytenew |= 1 << bytepos;\n }\n posval--;\n bytepos--;\n if (bytepos < 0) {\n if (bytenew == 0xff) {\n writeByte(0xff);\n writeByte(0);\n } else {\n writeByte(bytenew);\n }\n bytepos = 7;\n bytenew = 0;\n }\n }\n }\n\n function writeByte(value) {\n //byteout.push(clt[value]); // write char directly instead of converting later\n byteout.push(value);\n }\n\n function writeWord(value) {\n writeByte((value >> 8) & 0xff);\n writeByte(value & 0xff);\n }\n\n // DCT & quantization core\n function fDCTQuant(data, fdtbl) {\n var d0, d1, d2, d3, d4, d5, d6, d7;\n /* Pass 1: process rows. */\n var dataOff = 0;\n var i;\n var I8 = 8;\n var I64 = 64;\n for (i = 0; i < I8; ++i) {\n d0 = data[dataOff];\n d1 = data[dataOff + 1];\n d2 = data[dataOff + 2];\n d3 = data[dataOff + 3];\n d4 = data[dataOff + 4];\n d5 = data[dataOff + 5];\n d6 = data[dataOff + 6];\n d7 = data[dataOff + 7];\n\n var tmp0 = d0 + d7;\n var tmp7 = d0 - d7;\n var tmp1 = d1 + d6;\n var tmp6 = d1 - d6;\n var tmp2 = d2 + d5;\n var tmp5 = d2 - d5;\n var tmp3 = d3 + d4;\n var tmp4 = d3 - d4;\n\n /* Even part */\n var tmp10 = tmp0 + tmp3; /* phase 2 */\n var tmp13 = tmp0 - tmp3;\n var tmp11 = tmp1 + tmp2;\n var tmp12 = tmp1 - tmp2;\n\n data[dataOff] = tmp10 + tmp11; /* phase 3 */\n data[dataOff + 4] = tmp10 - tmp11;\n\n var z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */\n data[dataOff + 2] = tmp13 + z1; /* phase 5 */\n data[dataOff + 6] = tmp13 - z1;\n\n /* Odd part */\n tmp10 = tmp4 + tmp5; /* phase 2 */\n tmp11 = tmp5 + tmp6;\n tmp12 = tmp6 + tmp7;\n\n /* The rotator is modified from fig 4-8 to avoid extra negations. */\n var z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */\n var z2 = 0.5411961 * tmp10 + z5; /* c2-c6 */\n var z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */\n var z3 = tmp11 * 0.707106781; /* c4 */\n\n var z11 = tmp7 + z3; /* phase 5 */\n var z13 = tmp7 - z3;\n\n data[dataOff + 5] = z13 + z2; /* phase 6 */\n data[dataOff + 3] = z13 - z2;\n data[dataOff + 1] = z11 + z4;\n data[dataOff + 7] = z11 - z4;\n\n dataOff += 8; /* advance pointer to next row */\n }\n\n /* Pass 2: process columns. */\n dataOff = 0;\n for (i = 0; i < I8; ++i) {\n d0 = data[dataOff];\n d1 = data[dataOff + 8];\n d2 = data[dataOff + 16];\n d3 = data[dataOff + 24];\n d4 = data[dataOff + 32];\n d5 = data[dataOff + 40];\n d6 = data[dataOff + 48];\n d7 = data[dataOff + 56];\n\n var tmp0p2 = d0 + d7;\n var tmp7p2 = d0 - d7;\n var tmp1p2 = d1 + d6;\n var tmp6p2 = d1 - d6;\n var tmp2p2 = d2 + d5;\n var tmp5p2 = d2 - d5;\n var tmp3p2 = d3 + d4;\n var tmp4p2 = d3 - d4;\n\n /* Even part */\n var tmp10p2 = tmp0p2 + tmp3p2; /* phase 2 */\n var tmp13p2 = tmp0p2 - tmp3p2;\n var tmp11p2 = tmp1p2 + tmp2p2;\n var tmp12p2 = tmp1p2 - tmp2p2;\n\n data[dataOff] = tmp10p2 + tmp11p2; /* phase 3 */\n data[dataOff + 32] = tmp10p2 - tmp11p2;\n\n var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781; /* c4 */\n data[dataOff + 16] = tmp13p2 + z1p2; /* phase 5 */\n data[dataOff + 48] = tmp13p2 - z1p2;\n\n /* Odd part */\n tmp10p2 = tmp4p2 + tmp5p2; /* phase 2 */\n tmp11p2 = tmp5p2 + tmp6p2;\n tmp12p2 = tmp6p2 + tmp7p2;\n\n /* The rotator is modified from fig 4-8 to avoid extra negations. */\n var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433; /* c6 */\n var z2p2 = 0.5411961 * tmp10p2 + z5p2; /* c2-c6 */\n var z4p2 = 1.306562965 * tmp12p2 + z5p2; /* c2+c6 */\n var z3p2 = tmp11p2 * 0.707106781; /* c4 */\n\n var z11p2 = tmp7p2 + z3p2; /* phase 5 */\n var z13p2 = tmp7p2 - z3p2;\n\n data[dataOff + 40] = z13p2 + z2p2; /* phase 6 */\n data[dataOff + 24] = z13p2 - z2p2;\n data[dataOff + 8] = z11p2 + z4p2;\n data[dataOff + 56] = z11p2 - z4p2;\n\n dataOff++; /* advance pointer to next column */\n }\n\n // Quantize/descale the coefficients\n var fDCTQuant;\n for (i = 0; i < I64; ++i) {\n // Apply the quantization and scaling factor & Round to nearest integer\n fDCTQuant = data[i] * fdtbl[i];\n outputfDCTQuant[i] =\n fDCTQuant > 0.0 ? (fDCTQuant + 0.5) | 0 : (fDCTQuant - 0.5) | 0;\n //outputfDCTQuant[i] = fround(fDCTQuant);\n }\n return outputfDCTQuant;\n }\n\n function writeAPP0() {\n writeWord(0xffe0); // marker\n writeWord(16); // length\n writeByte(0x4a); // J\n writeByte(0x46); // F\n writeByte(0x49); // I\n writeByte(0x46); // F\n writeByte(0); // = \"JFIF\",'\\0'\n writeByte(1); // versionhi\n writeByte(1); // versionlo\n writeByte(0); // xyunits\n writeWord(1); // xdensity\n writeWord(1); // ydensity\n writeByte(0); // thumbnwidth\n writeByte(0); // thumbnheight\n }\n\n function writeSOF0(width, height) {\n writeWord(0xffc0); // marker\n writeWord(17); // length, truecolor YUV JPG\n writeByte(8); // precision\n writeWord(height);\n writeWord(width);\n writeByte(3); // nrofcomponents\n writeByte(1); // IdY\n writeByte(0x11); // HVY\n writeByte(0); // QTY\n writeByte(2); // IdU\n writeByte(0x11); // HVU\n writeByte(1); // QTU\n writeByte(3); // IdV\n writeByte(0x11); // HVV\n writeByte(1); // QTV\n }\n\n function writeDQT() {\n writeWord(0xffdb); // marker\n writeWord(132); // length\n writeByte(0);\n for (var i = 0; i < 64; i++) {\n writeByte(YTable[i]);\n }\n writeByte(1);\n for (var j = 0; j < 64; j++) {\n writeByte(UVTable[j]);\n }\n }\n\n function writeDHT() {\n writeWord(0xffc4); // marker\n writeWord(0x01a2); // length\n\n writeByte(0); // HTYDCinfo\n for (var i = 0; i < 16; i++) {\n writeByte(std_dc_luminance_nrcodes[i + 1]);\n }\n for (var j = 0; j <= 11; j++) {\n writeByte(std_dc_luminance_values[j]);\n }\n\n writeByte(0x10); // HTYACinfo\n for (var k = 0; k < 16; k++) {\n writeByte(std_ac_luminance_nrcodes[k + 1]);\n }\n for (var l = 0; l <= 161; l++) {\n writeByte(std_ac_luminance_values[l]);\n }\n\n writeByte(1); // HTUDCinfo\n for (var m = 0; m < 16; m++) {\n writeByte(std_dc_chrominance_nrcodes[m + 1]);\n }\n for (var n = 0; n <= 11; n++) {\n writeByte(std_dc_chrominance_values[n]);\n }\n\n writeByte(0x11); // HTUACinfo\n for (var o = 0; o < 16; o++) {\n writeByte(std_ac_chrominance_nrcodes[o + 1]);\n }\n for (var p = 0; p <= 161; p++) {\n writeByte(std_ac_chrominance_values[p]);\n }\n }\n\n function writeSOS() {\n writeWord(0xffda); // marker\n writeWord(12); // length\n writeByte(3); // nrofcomponents\n writeByte(1); // IdY\n writeByte(0); // HTY\n writeByte(2); // IdU\n writeByte(0x11); // HTU\n writeByte(3); // IdV\n writeByte(0x11); // HTV\n writeByte(0); // Ss\n writeByte(0x3f); // Se\n writeByte(0); // Bf\n }\n\n function processDU(CDU, fdtbl, DC, HTDC, HTAC) {\n var EOB = HTAC[0x00];\n var M16zeroes = HTAC[0xf0];\n var pos;\n var I16 = 16;\n var I63 = 63;\n var I64 = 64;\n var DU_DCT = fDCTQuant(CDU, fdtbl);\n //ZigZag reorder\n for (var j = 0; j < I64; ++j) {\n DU[ZigZag[j]] = DU_DCT[j];\n }\n var Diff = DU[0] - DC;\n DC = DU[0];\n //Encode DC\n if (Diff == 0) {\n writeBits(HTDC[0]); // Diff might be 0\n } else {\n pos = 32767 + Diff;\n writeBits(HTDC[category[pos]]);\n writeBits(bitcode[pos]);\n }\n //Encode ACs\n var end0pos = 63; // was const... which is crazy\n while (end0pos > 0 && DU[end0pos] == 0) {\n end0pos--;\n }\n //end0pos = first element in reverse order !=0\n if (end0pos == 0) {\n writeBits(EOB);\n return DC;\n }\n var i = 1;\n var lng;\n while (i <= end0pos) {\n var startpos = i;\n while (DU[i] == 0 && i <= end0pos) {\n ++i;\n }\n var nrzeroes = i - startpos;\n if (nrzeroes >= I16) {\n lng = nrzeroes >> 4;\n for (var nrmarker = 1; nrmarker <= lng; ++nrmarker)\n writeBits(M16zeroes);\n nrzeroes = nrzeroes & 0xf;\n }\n pos = 32767 + DU[i];\n writeBits(HTAC[(nrzeroes << 4) + category[pos]]);\n writeBits(bitcode[pos]);\n i++;\n }\n if (end0pos != I63) {\n writeBits(EOB);\n }\n return DC;\n }\n\n function initCharLookupTable() {\n var sfcc = String.fromCharCode;\n for (var i = 0; i < 256; i++) {\n ///// ACHTUNG // 255\n clt[i] = sfcc(i);\n }\n }\n\n this.encode = function(\n image,\n quality // image data object\n ) {\n if (quality) setQuality(quality);\n\n // Initialize bit writer\n byteout = new Array();\n bytenew = 0;\n bytepos = 7;\n\n // Add JPEG headers\n writeWord(0xffd8); // SOI\n writeAPP0();\n writeDQT();\n writeSOF0(image.width, image.height);\n writeDHT();\n writeSOS();\n\n // Encode 8x8 macroblocks\n var DCY = 0;\n var DCU = 0;\n var DCV = 0;\n\n bytenew = 0;\n bytepos = 7;\n\n this.encode.displayName = \"_encode_\";\n\n var imageData = image.data;\n var width = image.width;\n var height = image.height;\n\n var quadWidth = width * 4;\n\n var x,\n y = 0;\n var r, g, b;\n var start, p, col, row, pos;\n while (y < height) {\n x = 0;\n while (x < quadWidth) {\n start = quadWidth * y + x;\n col = -1;\n row = 0;\n\n for (pos = 0; pos < 64; pos++) {\n row = pos >> 3; // /8\n col = (pos & 7) * 4; // %8\n p = start + row * quadWidth + col;\n\n if (y + row >= height) {\n // padding bottom\n p -= quadWidth * (y + 1 + row - height);\n }\n\n if (x + col >= quadWidth) {\n // padding right\n p -= x + col - quadWidth + 4;\n }\n\n r = imageData[p++];\n g = imageData[p++];\n b = imageData[p++];\n\n /* // calculate YUV values dynamically\n\t\t\t\t\tYDU[pos]=((( 0.29900)*r+( 0.58700)*g+( 0.11400)*b))-128; //-0x80\n\t\t\t\t\tUDU[pos]=(((-0.16874)*r+(-0.33126)*g+( 0.50000)*b));\n\t\t\t\t\tVDU[pos]=((( 0.50000)*r+(-0.41869)*g+(-0.08131)*b));\n\t\t\t\t\t*/\n\n // use lookup table (slightly faster)\n YDU[pos] =\n ((RGB_YUV_TABLE[r] +\n RGB_YUV_TABLE[(g + 256) >> 0] +\n RGB_YUV_TABLE[(b + 512) >> 0]) >>\n 16) -\n 128;\n UDU[pos] =\n ((RGB_YUV_TABLE[(r + 768) >> 0] +\n RGB_YUV_TABLE[(g + 1024) >> 0] +\n RGB_YUV_TABLE[(b + 1280) >> 0]) >>\n 16) -\n 128;\n VDU[pos] =\n ((RGB_YUV_TABLE[(r + 1280) >> 0] +\n RGB_YUV_TABLE[(g + 1536) >> 0] +\n RGB_YUV_TABLE[(b + 1792) >> 0]) >>\n 16) -\n 128;\n }\n\n DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);\n DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);\n DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);\n x += 32;\n }\n y += 8;\n }\n\n ////////////////////////////////////////////////////////////////\n\n // Do the bit alignment of the EOI marker\n if (bytepos >= 0) {\n var fillbits = [];\n fillbits[1] = bytepos + 1;\n fillbits[0] = (1 << (bytepos + 1)) - 1;\n writeBits(fillbits);\n }\n\n writeWord(0xffd9); //EOI\n\n return new Uint8Array(byteout);\n };\n\n function setQuality(quality) {\n quality = Math.min(Math.max(quality, 1), 100);\n\n if (currentQuality == quality) return; // don't recalc if unchanged\n\n var sf =\n quality < 50 ? Math.floor(5000 / quality) : Math.floor(200 - quality * 2);\n\n initQuantTables(sf);\n currentQuality = quality;\n //console.log('Quality set to: '+quality +'%');\n }\n\n function init() {\n quality = quality || 50;\n // Create tables\n initCharLookupTable();\n initHuffmanTbl();\n initCategoryNumber();\n initRGBYUVTable();\n\n setQuality(quality);\n }\n init();\n}\n\nexport { JPEGEncoder };\n","/**\n * @author shaozilee\n *\n * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp\n *\n */\n\nimport { console } from \"./console.js\";\n\nfunction BmpDecoder(buffer, is_with_alpha) {\n this.pos = 0;\n this.buffer = buffer;\n this.datav = new DataView(buffer.buffer);\n this.is_with_alpha = !!is_with_alpha;\n this.bottom_up = true;\n this.flag =\n String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]);\n this.pos += 2;\n if ([\"BM\", \"BA\", \"CI\", \"CP\", \"IC\", \"PT\"].indexOf(this.flag) === -1)\n throw new Error(\"Invalid BMP File\");\n this.parseHeader();\n this.parseBGR();\n}\n\nBmpDecoder.prototype.parseHeader = function() {\n this.fileSize = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.reserved = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.offset = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.headerSize = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.width = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.height = this.datav.getInt32(this.pos, true);\n this.pos += 4;\n this.planes = this.datav.getUint16(this.pos, true);\n this.pos += 2;\n this.bitPP = this.datav.getUint16(this.pos, true);\n this.pos += 2;\n this.compress = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.rawSize = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.hr = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.vr = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.colors = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n this.importantColors = this.datav.getUint32(this.pos, true);\n this.pos += 4;\n\n if (this.bitPP === 16 && this.is_with_alpha) {\n this.bitPP = 15;\n }\n if (this.bitPP < 15) {\n var len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n this.palette = new Array(len);\n for (var i = 0; i < len; i++) {\n var blue = this.datav.getUint8(this.pos++, true);\n var green = this.datav.getUint8(this.pos++, true);\n var red = this.datav.getUint8(this.pos++, true);\n var quad = this.datav.getUint8(this.pos++, true);\n this.palette[i] = {\n red: red,\n green: green,\n blue: blue,\n quad: quad\n };\n }\n }\n if (this.height < 0) {\n this.height *= -1;\n this.bottom_up = false;\n }\n};\n\nBmpDecoder.prototype.parseBGR = function() {\n this.pos = this.offset;\n try {\n var bitn = \"bit\" + this.bitPP;\n var len = this.width * this.height * 4;\n this.data = new Uint8Array(len);\n\n this[bitn]();\n } catch (e) {\n console.log(\"bit decode error:\" + e);\n }\n};\n\nBmpDecoder.prototype.bit1 = function() {\n var xlen = Math.ceil(this.width / 8);\n var mode = xlen % 4;\n var y;\n for (y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < xlen; x++) {\n var b = this.datav.getUint8(this.pos++, true);\n var location = line * this.width * 4 + x * 8 * 4;\n for (var i = 0; i < 8; i++) {\n if (x * 8 + i < this.width) {\n var rgb = this.palette[(b >> (7 - i)) & 0x1];\n this.data[location + i * 4] = rgb.blue;\n this.data[location + i * 4 + 1] = rgb.green;\n this.data[location + i * 4 + 2] = rgb.red;\n this.data[location + i * 4 + 3] = 0xff;\n } else {\n break;\n }\n }\n }\n\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n};\n\nBmpDecoder.prototype.bit4 = function() {\n var xlen = Math.ceil(this.width / 2);\n var mode = xlen % 4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < xlen; x++) {\n var b = this.datav.getUint8(this.pos++, true);\n var location = line * this.width * 4 + x * 2 * 4;\n\n var before = b >> 4;\n var after = b & 0x0f;\n\n var rgb = this.palette[before];\n this.data[location] = rgb.blue;\n this.data[location + 1] = rgb.green;\n this.data[location + 2] = rgb.red;\n this.data[location + 3] = 0xff;\n\n if (x * 2 + 1 >= this.width) break;\n\n rgb = this.palette[after];\n this.data[location + 4] = rgb.blue;\n this.data[location + 4 + 1] = rgb.green;\n this.data[location + 4 + 2] = rgb.red;\n this.data[location + 4 + 3] = 0xff;\n }\n\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n};\n\nBmpDecoder.prototype.bit8 = function() {\n var mode = this.width % 4;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n var b = this.datav.getUint8(this.pos++, true);\n var location = line * this.width * 4 + x * 4;\n if (b < this.palette.length) {\n var rgb = this.palette[b];\n this.data[location] = rgb.red;\n this.data[location + 1] = rgb.green;\n this.data[location + 2] = rgb.blue;\n this.data[location + 3] = 0xff;\n } else {\n this.data[location] = 0xff;\n this.data[location + 1] = 0xff;\n this.data[location + 2] = 0xff;\n this.data[location + 3] = 0xff;\n }\n }\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n};\n\nBmpDecoder.prototype.bit15 = function() {\n var dif_w = this.width % 3;\n var _11111 = parseInt(\"11111\", 2),\n _1_5 = _11111;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n var B = this.datav.getUint16(this.pos, true);\n this.pos += 2;\n var blue = (((B & _1_5) / _1_5) * 255) | 0;\n var green = ((((B >> 5) & _1_5) / _1_5) * 255) | 0;\n var red = ((((B >> 10) & _1_5) / _1_5) * 255) | 0;\n var alpha = B >> 15 ? 0xff : 0x00;\n\n var location = line * this.width * 4 + x * 4;\n this.data[location] = red;\n this.data[location + 1] = green;\n this.data[location + 2] = blue;\n this.data[location + 3] = alpha;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit16 = function() {\n var dif_w = this.width % 3;\n var _11111 = parseInt(\"11111\", 2),\n _1_5 = _11111;\n var _111111 = parseInt(\"111111\", 2),\n _1_6 = _111111;\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n var B = this.datav.getUint16(this.pos, true);\n this.pos += 2;\n var alpha = 0xff;\n var blue = (((B & _1_5) / _1_5) * 255) | 0;\n var green = ((((B >> 5) & _1_6) / _1_6) * 255) | 0;\n var red = (((B >> 11) / _1_5) * 255) | 0;\n\n var location = line * this.width * 4 + x * 4;\n this.data[location] = red;\n this.data[location + 1] = green;\n this.data[location + 2] = blue;\n this.data[location + 3] = alpha;\n }\n //skip extra bytes\n this.pos += dif_w;\n }\n};\n\nBmpDecoder.prototype.bit24 = function() {\n //when height > 0\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n var blue = this.datav.getUint8(this.pos++, true);\n var green = this.datav.getUint8(this.pos++, true);\n var red = this.datav.getUint8(this.pos++, true);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = red;\n this.data[location + 1] = green;\n this.data[location + 2] = blue;\n this.data[location + 3] = 0xff;\n }\n //skip extra bytes\n this.pos += this.width % 4;\n }\n};\n\n/**\n * add 32bit decode func\n * @author soubok\n */\nBmpDecoder.prototype.bit32 = function() {\n //when height > 0\n for (var y = this.height - 1; y >= 0; y--) {\n var line = this.bottom_up ? y : this.height - 1 - y;\n for (var x = 0; x < this.width; x++) {\n var blue = this.datav.getUint8(this.pos++, true);\n var green = this.datav.getUint8(this.pos++, true);\n var red = this.datav.getUint8(this.pos++, true);\n var alpha = this.datav.getUint8(this.pos++, true);\n var location = line * this.width * 4 + x * 4;\n this.data[location] = red;\n this.data[location + 1] = green;\n this.data[location + 2] = blue;\n this.data[location + 3] = alpha;\n }\n //skip extra bytes\n //this.pos += (this.width % 4);\n }\n};\n\nBmpDecoder.prototype.getData = function() {\n return this.data;\n};\n\nexport { BmpDecoder };\n","function WebPDecoder(imageData) {\n /** @license\n * Copyright 2011 Google Inc.\n *\n * This code is licensed under the same terms as WebM:\n * Software License Agreement: http://www.webmproject.org/license/software/\n * Additional IP Rights Grant: http://www.webmproject.org/license/additional/\n * -----------------------------------------------------------------------------\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * -----------------------------------------------------------------------------\n *\n * Copyright 2011-2017 Dominik Homberger\n * Libwebp Javascript / libwebpjs - the libwebp implementation in javascript (v0.6.0)\n *\n * Author: Dominik Homberger (dominik.homberger@gmail.com)\n */\n\n var self = this;\n var UpsampleRgbLinePair,\n UpsampleBgrLinePair,\n UpsampleRgbaLinePair,\n UpsampleBgraLinePair,\n UpsampleArgbLinePair,\n UpsampleArgbLinePair,\n UpsampleRgba4444LinePair,\n UpsampleRgb565LinePair;\n\n function x(F) {\n if (!F) throw Error(\"assert :P\");\n }\n function fa(F, L, J) {\n for (var H = 0; 4 > H; H++) if (F[L + H] != J.charCodeAt(H)) return !0;\n return !1;\n }\n function I(F, L, J, H, Z) {\n for (var O = 0; O < Z; O++) F[L + O] = J[H + O];\n }\n function M(F, L, J, H) {\n for (var Z = 0; Z < H; Z++) F[L + Z] = J;\n }\n function V(F) {\n return new Int32Array(F);\n }\n function wa(F, L) {\n for (var J = [], H = 0; H < F; H++) J.push(new L());\n return J;\n }\n function wb() {\n function F(J, H, Z) {\n for (var O = Z[H], L = 0; L < O; L++) {\n J.push(Z.length > H + 1 ? [] : 0);\n if (Z.length < H + 1) break;\n F(J[L], H + 1, Z);\n }\n }\n var L = [];\n F(L, 0, [3, 11]);\n return L;\n }\n function Ed(F, L) {\n function J(H, O, F) {\n for (var Z = F[O], ma = 0; ma < Z; ma++) {\n H.push(F.length > O + 1 ? [] : new L());\n if (F.length < O + 1) break;\n J(H[ma], O + 1, F);\n }\n }\n var H = [];\n J(H, 0, F);\n return H;\n }\n var _WebPDecoder = function() {\n var self = this;\n function F() {\n V(55);\n }\n function L(a, b) {\n for (var c = (1 << (b - 1)) >>> 0; a & c; ) c >>>= 1;\n return c ? (a & (c - 1)) + c : a;\n }\n function J(a, b, c, d, e) {\n x(!(d % c));\n do (d -= c), (a[b + d] = e);\n while (0 < d);\n }\n function H(a, b, c, d, e, f) {\n var g = b,\n h = 1 << c,\n k,\n l,\n m = V(16),\n n = V(16);\n x(0 != e);\n x(null != d);\n x(null != a);\n x(0 < c);\n for (l = 0; l < e; ++l) {\n if (15 < d[l]) return 0;\n ++m[d[l]];\n }\n if (m[0] == e) return 0;\n n[1] = 0;\n for (k = 1; 15 > k; ++k) {\n if (m[k] > 1 << k) return 0;\n n[k + 1] = n[k] + m[k];\n }\n for (l = 0; l < e; ++l) (k = d[l]), 0 < d[l] && (f[n[k]++] = l);\n if (1 == n[15])\n return (d = new O()), (d.g = 0), (d.value = f[0]), J(a, g, 1, h, d), h;\n var r = -1,\n q = h - 1,\n t = 0,\n v = 1,\n p = 1,\n u,\n w = 1 << c;\n l = 0;\n k = 1;\n for (e = 2; k <= c; ++k, e <<= 1) {\n p <<= 1;\n v += p;\n p -= m[k];\n if (0 > p) return 0;\n for (; 0 < m[k]; --m[k])\n (d = new O()),\n (d.g = k),\n (d.value = f[l++]),\n J(a, g + t, e, w, d),\n (t = L(t, k));\n }\n k = c + 1;\n for (e = 2; 15 >= k; ++k, e <<= 1) {\n p <<= 1;\n v += p;\n p -= m[k];\n if (0 > p) return 0;\n for (; 0 < m[k]; --m[k]) {\n d = new O();\n if ((t & q) != r) {\n g += w;\n r = k;\n for (u = 1 << (r - c); 15 > r; ) {\n u -= m[r];\n if (0 >= u) break;\n ++r;\n u <<= 1;\n }\n u = r - c;\n w = 1 << u;\n h += w;\n r = t & q;\n a[b + r].g = u + c;\n a[b + r].value = g - b - r;\n }\n d.g = k - c;\n d.value = f[l++];\n J(a, g + (t >> c), e, w, d);\n t = L(t, k);\n }\n }\n return v != 2 * n[15] - 1 ? 0 : h;\n }\n function Z(a, b, c, d, e) {\n x(2328 >= e);\n if (512 >= e) var f = V(512);\n else if (((f = V(e)), null == f)) return 0;\n return H(a, b, c, d, e, f);\n }\n function O() {\n this.value = this.g = 0;\n }\n function Fd() {\n this.value = this.g = 0;\n }\n function Ub() {\n this.G = wa(5, O);\n this.H = V(5);\n this.jc = this.Qb = this.qb = this.nd = 0;\n this.pd = wa(xb, Fd);\n }\n function ma(a, b, c, d) {\n x(null != a);\n x(null != b);\n x(2147483648 > d);\n a.Ca = 254;\n a.I = 0;\n a.b = -8;\n a.Ka = 0;\n a.oa = b;\n a.pa = c;\n a.Jd = b;\n a.Yc = c + d;\n a.Zc = 4 <= d ? c + d - 4 + 1 : c;\n Qa(a);\n }\n function na(a, b) {\n for (var c = 0; 0 < b--; ) c |= K(a, 128) << b;\n return c;\n }\n function ca(a, b) {\n var c = na(a, b);\n return G(a) ? -c : c;\n }\n function cb(a, b, c, d) {\n var e,\n f = 0;\n x(null != a);\n x(null != b);\n x(4294967288 > d);\n a.Sb = d;\n a.Ra = 0;\n a.u = 0;\n a.h = 0;\n 4 < d && (d = 4);\n for (e = 0; e < d; ++e) f += b[c + e] << (8 * e);\n a.Ra = f;\n a.bb = d;\n a.oa = b;\n a.pa = c;\n }\n function Vb(a) {\n for (; 8 <= a.u && a.bb < a.Sb; )\n (a.Ra >>>= 8),\n (a.Ra += (a.oa[a.pa + a.bb] << (ob - 8)) >>> 0),\n ++a.bb,\n (a.u -= 8);\n db(a) && ((a.h = 1), (a.u = 0));\n }\n function D(a, b) {\n x(0 <= b);\n if (!a.h && b <= Gd) {\n var c = pb(a) & Hd[b];\n a.u += b;\n Vb(a);\n return c;\n }\n a.h = 1;\n return (a.u = 0);\n }\n function Wb() {\n this.b = this.Ca = this.I = 0;\n this.oa = [];\n this.pa = 0;\n this.Jd = [];\n this.Yc = 0;\n this.Zc = [];\n this.Ka = 0;\n }\n function Ra() {\n this.Ra = 0;\n this.oa = [];\n this.h = this.u = this.bb = this.Sb = this.pa = 0;\n }\n function pb(a) {\n return (a.Ra >>> (a.u & (ob - 1))) >>> 0;\n }\n function db(a) {\n x(a.bb <= a.Sb);\n return a.h || (a.bb == a.Sb && a.u > ob);\n }\n function qb(a, b) {\n a.u = b;\n a.h = db(a);\n }\n function Sa(a) {\n a.u >= Xb && (x(a.u >= Xb), Vb(a));\n }\n function Qa(a) {\n x(null != a && null != a.oa);\n a.pa < a.Zc\n ? ((a.I = (a.oa[a.pa++] | (a.I << 8)) >>> 0), (a.b += 8))\n : (x(null != a && null != a.oa),\n a.pa < a.Yc\n ? ((a.b += 8), (a.I = a.oa[a.pa++] | (a.I << 8)))\n : a.Ka\n ? (a.b = 0)\n : ((a.I <<= 8), (a.b += 8), (a.Ka = 1)));\n }\n function G(a) {\n return na(a, 1);\n }\n function K(a, b) {\n var c = a.Ca;\n 0 > a.b && Qa(a);\n var d = a.b,\n e = (c * b) >>> 8,\n f = (a.I >>> d > e) + 0;\n f ? ((c -= e), (a.I -= ((e + 1) << d) >>> 0)) : (c = e + 1);\n d = c;\n for (e = 0; 256 <= d; ) (e += 8), (d >>= 8);\n d = 7 ^ (e + Id[d]);\n a.b -= d;\n a.Ca = (c << d) - 1;\n return f;\n }\n function ra(a, b, c) {\n a[b + 0] = (c >> 24) & 255;\n a[b + 1] = (c >> 16) & 255;\n a[b + 2] = (c >> 8) & 255;\n a[b + 3] = (c >> 0) & 255;\n }\n function Ta(a, b) {\n return (a[b + 0] << 0) | (a[b + 1] << 8);\n }\n function Yb(a, b) {\n return Ta(a, b) | (a[b + 2] << 16);\n }\n function Ha(a, b) {\n return Ta(a, b) | (Ta(a, b + 2) << 16);\n }\n function Zb(a, b) {\n var c = 1 << b;\n x(null != a);\n x(0 < b);\n a.X = V(c);\n if (null == a.X) return 0;\n a.Mb = 32 - b;\n a.Xa = b;\n return 1;\n }\n function $b(a, b) {\n x(null != a);\n x(null != b);\n x(a.Xa == b.Xa);\n I(b.X, 0, a.X, 0, 1 << b.Xa);\n }\n function ac() {\n this.X = [];\n this.Xa = this.Mb = 0;\n }\n function bc(a, b, c, d) {\n x(null != c);\n x(null != d);\n var e = c[0],\n f = d[0];\n 0 == e && (e = (a * f + b / 2) / b);\n 0 == f && (f = (b * e + a / 2) / a);\n if (0 >= e || 0 >= f) return 0;\n c[0] = e;\n d[0] = f;\n return 1;\n }\n function xa(a, b) {\n return (a + (1 << b) - 1) >>> b;\n }\n function yb(a, b) {\n return (\n (((((a & 4278255360) + (b & 4278255360)) >>> 0) & 4278255360) +\n ((((a & 16711935) + (b & 16711935)) >>> 0) & 16711935)) >>>\n 0\n );\n }\n function X(a, b) {\n self[b] = function(b, d, e, f, g, h, k) {\n var c;\n for (c = 0; c < g; ++c) {\n var m = self[a](h[k + c - 1], e, f + c);\n h[k + c] = yb(b[d + c], m);\n }\n };\n }\n function Jd() {\n this.ud = this.hd = this.jd = 0;\n }\n function aa(a, b) {\n return ((((a ^ b) & 4278124286) >>> 1) + (a & b)) >>> 0;\n }\n function sa(a) {\n if (0 <= a && 256 > a) return a;\n if (0 > a) return 0;\n if (255 < a) return 255;\n }\n function eb(a, b) {\n return sa(a + ((a - b + 0.5) >> 1));\n }\n function Ia(a, b, c) {\n return Math.abs(b - c) - Math.abs(a - c);\n }\n function cc(a, b, c, d, e, f, g) {\n d = f[g - 1];\n for (c = 0; c < e; ++c) f[g + c] = d = yb(a[b + c], d);\n }\n function Kd(a, b, c, d, e) {\n var f;\n for (f = 0; f < c; ++f) {\n var g = a[b + f],\n h = (g >> 8) & 255,\n k = g & 16711935,\n k = k + ((h << 16) + h),\n k = k & 16711935;\n d[e + f] = ((g & 4278255360) + k) >>> 0;\n }\n }\n function dc(a, b) {\n b.jd = (a >> 0) & 255;\n b.hd = (a >> 8) & 255;\n b.ud = (a >> 16) & 255;\n }\n function Ld(a, b, c, d, e, f) {\n var g;\n for (g = 0; g < d; ++g) {\n var h = b[c + g],\n k = h >>> 8,\n l = h >>> 16,\n m = h,\n l = l + ((((a.jd << 24) >> 24) * ((k << 24) >> 24)) >>> 5),\n l = l & 255,\n m = m + ((((a.hd << 24) >> 24) * ((k << 24) >> 24)) >>> 5),\n m = m + ((((a.ud << 24) >> 24) * ((l << 24) >> 24)) >>> 5),\n m = m & 255;\n e[f + g] = (h & 4278255360) + (l << 16) + m;\n }\n }\n function ec(a, b, c, d, e) {\n self[b] = function(a, b, c, k, l, m, n, r, q) {\n for (k = n; k < r; ++k)\n for (n = 0; n < q; ++n) l[m++] = e(c[d(a[b++])]);\n };\n self[a] = function(a, b, h, k, l, m, n) {\n var f = 8 >> a.b,\n g = a.Ea,\n t = a.K[0],\n v = a.w;\n if (8 > f)\n for (a = (1 << a.b) - 1, v = (1 << f) - 1; b < h; ++b) {\n var p = 0,\n u;\n for (u = 0; u < g; ++u)\n u & a || (p = d(k[l++])), (m[n++] = e(t[p & v])), (p >>= f);\n }\n else self[\"VP8LMapColor\" + c](k, l, t, v, m, n, b, h, g);\n };\n }\n function Md(a, b, c, d, e) {\n for (c = b + c; b < c; ) {\n var f = a[b++];\n d[e++] = (f >> 16) & 255;\n d[e++] = (f >> 8) & 255;\n d[e++] = (f >> 0) & 255;\n }\n }\n function Nd(a, b, c, d, e) {\n for (c = b + c; b < c; ) {\n var f = a[b++];\n d[e++] = (f >> 16) & 255;\n d[e++] = (f >> 8) & 255;\n d[e++] = (f >> 0) & 255;\n d[e++] = (f >> 24) & 255;\n }\n }\n function Od(a, b, c, d, e) {\n for (c = b + c; b < c; ) {\n var f = a[b++],\n g = ((f >> 16) & 240) | ((f >> 12) & 15),\n f = ((f >> 0) & 240) | ((f >> 28) & 15);\n d[e++] = g;\n d[e++] = f;\n }\n }\n function Pd(a, b, c, d, e) {\n for (c = b + c; b < c; ) {\n var f = a[b++],\n g = ((f >> 16) & 248) | ((f >> 13) & 7),\n f = ((f >> 5) & 224) | ((f >> 3) & 31);\n d[e++] = g;\n d[e++] = f;\n }\n }\n function Qd(a, b, c, d, e) {\n for (c = b + c; b < c; ) {\n var f = a[b++];\n d[e++] = (f >> 0) & 255;\n d[e++] = (f >> 8) & 255;\n d[e++] = (f >> 16) & 255;\n }\n }\n function fb(a, b, c, d, e, f) {\n if (0 == f)\n for (c = b + c; b < c; )\n (f = a[b++]),\n ra(\n d,\n ((f[0] >> 24) |\n ((f[1] >> 8) & 65280) |\n ((f[2] << 8) & 16711680) |\n (f[3] << 24)) >>>\n 0\n ),\n (e += 32);\n else I(d, e, a, b, c);\n }\n function gb(a, b) {\n self[b][0] = self[a + \"0\"];\n self[b][1] = self[a + \"1\"];\n self[b][2] = self[a + \"2\"];\n self[b][3] = self[a + \"3\"];\n self[b][4] = self[a + \"4\"];\n self[b][5] = self[a + \"5\"];\n self[b][6] = self[a + \"6\"];\n self[b][7] = self[a + \"7\"];\n self[b][8] = self[a + \"8\"];\n self[b][9] = self[a + \"9\"];\n self[b][10] = self[a + \"10\"];\n self[b][11] = self[a + \"11\"];\n self[b][12] = self[a + \"12\"];\n self[b][13] = self[a + \"13\"];\n self[b][14] = self[a + \"0\"];\n self[b][15] = self[a + \"0\"];\n }\n function hb(a) {\n return a == zb || a == Ab || a == Ja || a == Bb;\n }\n function Rd() {\n this.eb = [];\n this.size = this.A = this.fb = 0;\n }\n function Sd() {\n this.y = [];\n this.f = [];\n this.ea = [];\n this.F = [];\n this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;\n }\n function Cb() {\n this.Rd = this.height = this.width = this.S = 0;\n this.f = {};\n this.f.RGBA = new Rd();\n this.f.kb = new Sd();\n this.sd = null;\n }\n function Td() {\n this.width = [0];\n this.height = [0];\n this.Pd = [0];\n this.Qd = [0];\n this.format = [0];\n }\n function Ud() {\n this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;\n }\n function Vd(a) {\n alert(\"todo:WebPSamplerProcessPlane\");\n return a.T;\n }\n function Wd(a, b) {\n var c = a.T,\n d = b.ba.f.RGBA,\n e = d.eb,\n f = d.fb + a.ka * d.A,\n g = P[b.ba.S],\n h = a.y,\n k = a.O,\n l = a.f,\n m = a.N,\n n = a.ea,\n r = a.W,\n q = b.cc,\n t = b.dc,\n v = b.Mc,\n p = b.Nc,\n u = a.ka,\n w = a.ka + a.T,\n y = a.U,\n A = (y + 1) >> 1;\n 0 == u\n ? g(h, k, null, null, l, m, n, r, l, m, n, r, e, f, null, null, y)\n : (g(b.ec, b.fc, h, k, q, t, v, p, l, m, n, r, e, f - d.A, e, f, y),\n ++c);\n for (; u + 2 < w; u += 2)\n (q = l),\n (t = m),\n (v = n),\n (p = r),\n (m += a.Rc),\n (r += a.Rc),\n (f += 2 * d.A),\n (k += 2 * a.fa),\n g(h, k - a.fa, h, k, q, t, v, p, l, m, n, r, e, f - d.A, e, f, y);\n k += a.fa;\n a.j + w < a.o\n ? (I(b.ec, b.fc, h, k, y),\n I(b.cc, b.dc, l, m, A),\n I(b.Mc, b.Nc, n, r, A),\n c--)\n : w & 1 ||\n g(\n h,\n k,\n null,\n null,\n l,\n m,\n n,\n r,\n l,\n m,\n n,\n r,\n e,\n f + d.A,\n null,\n null,\n y\n );\n return c;\n }\n function Xd(a, b, c) {\n var d = a.F,\n e = [a.J];\n if (null != d) {\n var f = a.U,\n g = b.ba.S,\n h = g == ya || g == Ja;\n b = b.ba.f.RGBA;\n var k = [0],\n l = a.ka;\n k[0] = a.T;\n a.Kb &&\n (0 == l ? --k[0] : (--l, (e[0] -= a.width)),\n a.j + a.ka + a.T == a.o && (k[0] = a.o - a.j - l));\n var m = b.eb,\n l = b.fb + l * b.A;\n a = fc(d, e[0], a.width, f, k, m, l + (h ? 0 : 3), b.A);\n x(c == k);\n a && hb(g) && za(m, l, h, f, k, b.A);\n }\n return 0;\n }\n function gc(a) {\n var b = a.ma,\n c = b.ba.S,\n d = 11 > c,\n e = c == Ua || c == Va || c == ya || c == Db || 12 == c || hb(c);\n b.memory = null;\n b.Ib = null;\n b.Jb = null;\n b.Nd = null;\n if (!hc(b.Oa, a, e ? 11 : 12)) return 0;\n e && hb(c) && ic();\n if (a.da) alert(\"todo:use_scaling\");\n else {\n if (d) {\n if (((b.Ib = Vd), a.Kb)) {\n c = (a.U + 1) >> 1;\n b.memory = V(a.U + 2 * c);\n if (null == b.memory) return 0;\n b.ec = b.memory;\n b.fc = 0;\n b.cc = b.ec;\n b.dc = b.fc + a.U;\n b.Mc = b.cc;\n b.Nc = b.dc + c;\n b.Ib = Wd;\n ic();\n }\n } else alert(\"todo:EmitYUV\");\n e && ((b.Jb = Xd), d && Aa());\n }\n if (d && !jc) {\n for (a = 0; 256 > a; ++a)\n (Yd[a] = (89858 * (a - 128) + Ba) >> Wa),\n (Zd[a] = -22014 * (a - 128) + Ba),\n ($d[a] = -45773 * (a - 128)),\n (ae[a] = (113618 * (a - 128) + Ba) >> Wa);\n for (a = ta; a < Eb; ++a)\n (b = (76283 * (a - 16) + Ba) >> Wa),\n (be[a - ta] = ga(b, 255)),\n (ce[a - ta] = ga((b + 8) >> 4, 15));\n jc = 1;\n }\n return 1;\n }\n function kc(a) {\n var b = a.ma,\n c = a.U,\n d = a.T;\n x(!(a.ka & 1));\n if (0 >= c || 0 >= d) return 0;\n c = b.Ib(a, b);\n null != b.Jb && b.Jb(a, b, c);\n b.Dc += c;\n return 1;\n }\n function lc(a) {\n a.ma.memory = null;\n }\n function mc(a, b, c, d) {\n if (47 != D(a, 8)) return 0;\n b[0] = D(a, 14) + 1;\n c[0] = D(a, 14) + 1;\n d[0] = D(a, 1);\n return 0 != D(a, 3) ? 0 : !a.h;\n }\n function ib(a, b) {\n if (4 > a) return a + 1;\n var c = (a - 2) >> 1;\n return ((2 + (a & 1)) << c) + D(b, c) + 1;\n }\n function nc(a, b) {\n if (120 < b) return b - 120;\n var c = de[b - 1],\n c = (c >> 4) * a + (8 - (c & 15));\n return 1 <= c ? c : 1;\n }\n function ua(a, b, c) {\n var d = pb(c);\n b += d & 255;\n var e = a[b].g - 8;\n 0 < e &&\n (qb(c, c.u + 8),\n (d = pb(c)),\n (b += a[b].value),\n (b += d & ((1 << e) - 1)));\n qb(c, c.u + a[b].g);\n return a[b].value;\n }\n function ub(a, b, c) {\n c.g += a.g;\n c.value += (a.value << b) >>> 0;\n x(8 >= c.g);\n return a.g;\n }\n function ha(a, b, c) {\n var d = a.xc;\n b = 0 == d ? 0 : a.vc[a.md * (c >> d) + (b >> d)];\n x(b < a.Wb);\n return a.Ya[b];\n }\n function oc(a, b, c, d) {\n var e = a.ab,\n f = a.c * b,\n g = a.C;\n b = g + b;\n var h = c,\n k = d;\n d = a.Ta;\n for (c = a.Ua; 0 < e--; ) {\n var l = a.gc[e],\n m = g,\n n = b,\n r = h,\n q = k,\n k = d,\n h = c,\n t = l.Ea;\n x(m < n);\n x(n <= l.nc);\n switch (l.hc) {\n case 2:\n pc(r, q, (n - m) * t, k, h);\n break;\n case 0:\n var v = l,\n p = m,\n u = n,\n w = k,\n y = h,\n A = v.Ea;\n 0 == p &&\n (ee(r, q, null, null, 1, w, y),\n cc(r, q + 1, 0, 0, A - 1, w, y + 1),\n (q += A),\n (y += A),\n ++p);\n for (\n var E = 1 << v.b,\n B = E - 1,\n C = xa(A, v.b),\n N = v.K,\n v = v.w + (p >> v.b) * C;\n p < u;\n\n ) {\n var z = N,\n Q = v,\n S = 1;\n for (fe(r, q, w, y - A, 1, w, y); S < A; ) {\n var K = qc[(z[Q++] >> 8) & 15],\n D = (S & ~B) + E;\n D > A && (D = A);\n K(r, q + +S, w, y + S - A, D - S, w, y + S);\n S = D;\n }\n q += A;\n y += A;\n ++p;\n p & B || (v += C);\n }\n n != l.nc && I(k, h - t, k, h + (n - m - 1) * t, t);\n break;\n case 1:\n t = r;\n u = q;\n r = l.Ea;\n q = 1 << l.b;\n w = q - 1;\n y = r & ~w;\n A = r - y;\n p = xa(r, l.b);\n E = l.K;\n for (l = l.w + (m >> l.b) * p; m < n; ) {\n B = E;\n C = l;\n N = new Jd();\n v = u + y;\n for (z = u + r; u < v; )\n dc(B[C++], N), Fb(N, t, u, q, k, h), (u += q), (h += q);\n u < z &&\n (dc(B[C++], N), Fb(N, t, u, A, k, h), (u += A), (h += A));\n ++m;\n m & w || (l += p);\n }\n break;\n case 3:\n if (r == k && q == h && 0 < l.b) {\n y = (n - m) * xa(l.Ea, l.b);\n t = h + (n - m) * t - y;\n u = k;\n r = t;\n q = k;\n w = h;\n A = y;\n p = [];\n for (y = A - 1; 0 <= y; --y) p[y] = q[w + y];\n for (y = A - 1; 0 <= y; --y) u[r + y] = p[y];\n rc(l, m, n, k, t, k, h);\n } else rc(l, m, n, r, q, k, h);\n }\n h = d;\n k = c;\n }\n k != c && I(d, c, h, k, f);\n }\n function ge(a, b) {\n var c = a.V,\n d = a.Ba + a.c * a.C,\n e = b - a.C;\n x(b <= a.l.o);\n x(16 >= e);\n if (0 < e) {\n var f = a.l,\n g = a.Ta,\n h = a.Ua,\n k = f.width;\n oc(a, e, c, d);\n h = [h];\n c = a.C;\n d = b;\n e = h;\n x(c < d);\n x(f.v < f.va);\n d > f.o && (d = f.o);\n if (c < f.j) {\n var l = f.j - c,\n c = f.j;\n e[0] += l * k;\n }\n c >= d\n ? (c = 0)\n : ((e[0] += 4 * f.v),\n (f.ka = c - f.j),\n (f.U = f.va - f.v),\n (f.T = d - c),\n (c = 1));\n if (c) {\n h = h[0];\n c = a.ca;\n if (11 > c.S) {\n for (\n var m = c.f.RGBA,\n d = c.S,\n e = f.U,\n f = f.T,\n l = m.eb,\n n = m.A,\n r = f,\n m = m.fb + a.Ma * m.A;\n 0 < r--;\n\n ) {\n var q = g,\n t = h,\n v = e,\n p = l,\n u = m;\n switch (d) {\n case Ca:\n sc(q, t, v, p, u);\n break;\n case Ua:\n Gb(q, t, v, p, u);\n break;\n case zb:\n Gb(q, t, v, p, u);\n za(p, u, 0, v, 1, 0);\n break;\n case tc:\n uc(q, t, v, p, u);\n break;\n case Va:\n fb(q, t, v, p, u, 1);\n break;\n case Ab:\n fb(q, t, v, p, u, 1);\n za(p, u, 0, v, 1, 0);\n break;\n case ya:\n fb(q, t, v, p, u, 0);\n break;\n case Ja:\n fb(q, t, v, p, u, 0);\n za(p, u, 1, v, 1, 0);\n break;\n case Db:\n Hb(q, t, v, p, u);\n break;\n case Bb:\n Hb(q, t, v, p, u);\n vc(p, u, v, 1, 0);\n break;\n case wc:\n xc(q, t, v, p, u);\n break;\n default:\n x(0);\n }\n h += k;\n m += n;\n }\n a.Ma += f;\n } else alert(\"todo:EmitRescaledRowsYUVA\");\n x(a.Ma <= c.height);\n }\n }\n a.C = b;\n x(a.C <= a.i);\n }\n function yc(a) {\n var b;\n if (0 < a.ua) return 0;\n for (b = 0; b < a.Wb; ++b) {\n var c = a.Ya[b].G,\n d = a.Ya[b].H;\n if (\n 0 < c[1][d[1] + 0].g ||\n 0 < c[2][d[2] + 0].g ||\n 0 < c[3][d[3] + 0].g\n )\n return 0;\n }\n return 1;\n }\n function zc(a, b, c, d, e, f) {\n if (0 != a.Z) {\n var g = a.qd,\n h = a.rd;\n for (x(null != ia[a.Z]); b < c; ++b)\n ia[a.Z](g, h, d, e, d, e, f), (g = d), (h = e), (e += f);\n a.qd = g;\n a.rd = h;\n }\n }\n function Ib(a, b) {\n var c = a.l.ma,\n d = 0 == c.Z || 1 == c.Z ? a.l.j : a.C,\n d = a.C < d ? d : a.C;\n x(b <= a.l.o);\n if (b > d) {\n var e = a.l.width,\n f = c.ca,\n g = c.tb + e * d,\n h = a.V,\n k = a.Ba + a.c * d,\n l = a.gc;\n x(1 == a.ab);\n x(3 == l[0].hc);\n he(l[0], d, b, h, k, f, g);\n zc(c, d, b, f, g, e);\n }\n a.C = a.Ma = b;\n }\n function Jb(a, b, c, d, e, f, g) {\n var h = a.$ / d,\n k = a.$ % d,\n l = a.m,\n m = a.s,\n n = c + a.$,\n r = n;\n e = c + d * e;\n var q = c + d * f,\n t = 280 + m.ua,\n v = a.Pb ? h : 16777216,\n p = 0 < m.ua ? m.Wa : null,\n u = m.wc,\n w = n < q ? ha(m, k, h) : null;\n x(a.C < f);\n x(q <= e);\n var y = !1;\n a: for (;;) {\n for (; y || n < q; ) {\n var A = 0;\n if (h >= v) {\n var v = a,\n E = n - c;\n x(v.Pb);\n v.wd = v.m;\n v.xd = E;\n 0 < v.s.ua && $b(v.s.Wa, v.s.vb);\n v = h + ie;\n }\n k & u || (w = ha(m, k, h));\n x(null != w);\n w.Qb && ((b[n] = w.qb), (y = !0));\n if (!y)\n if ((Sa(l), w.jc)) {\n var A = l,\n E = b,\n B = n,\n C = w.pd[pb(A) & (xb - 1)];\n x(w.jc);\n 256 > C.g\n ? (qb(A, A.u + C.g), (E[B] = C.value), (A = 0))\n : (qb(A, A.u + C.g - 256), x(256 <= C.value), (A = C.value));\n 0 == A && (y = !0);\n } else A = ua(w.G[0], w.H[0], l);\n if (l.h) break;\n if (y || 256 > A) {\n if (!y)\n if (w.nd) b[n] = (w.qb | (A << 8)) >>> 0;\n else {\n Sa(l);\n y = ua(w.G[1], w.H[1], l);\n Sa(l);\n E = ua(w.G[2], w.H[2], l);\n B = ua(w.G[3], w.H[3], l);\n if (l.h) break;\n b[n] = ((B << 24) | (y << 16) | (A << 8) | E) >>> 0;\n }\n y = !1;\n ++n;\n ++k;\n if (\n k >= d &&\n ((k = 0),\n ++h,\n null != g && h <= f && !(h % 16) && g(a, h),\n null != p)\n )\n for (; r < n; )\n (A = b[r++]),\n (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n } else if (280 > A) {\n A = ib(A - 256, l);\n E = ua(w.G[4], w.H[4], l);\n Sa(l);\n E = ib(E, l);\n E = nc(d, E);\n if (l.h) break;\n if (n - c < E || e - n < A) break a;\n else for (B = 0; B < A; ++B) b[n + B] = b[n + B - E];\n n += A;\n for (k += A; k >= d; )\n (k -= d), ++h, null != g && h <= f && !(h % 16) && g(a, h);\n x(n <= e);\n k & u && (w = ha(m, k, h));\n if (null != p)\n for (; r < n; )\n (A = b[r++]),\n (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n } else if (A < t) {\n y = A - 280;\n for (x(null != p); r < n; )\n (A = b[r++]), (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n A = n;\n E = p;\n x(!(y >>> E.Xa));\n b[A] = E.X[y];\n y = !0;\n } else break a;\n y || x(l.h == db(l));\n }\n if (a.Pb && l.h && n < e)\n x(a.m.h),\n (a.a = 5),\n (a.m = a.wd),\n (a.$ = a.xd),\n 0 < a.s.ua && $b(a.s.vb, a.s.Wa);\n else if (l.h) break a;\n else null != g && g(a, h > f ? f : h), (a.a = 0), (a.$ = n - c);\n return 1;\n }\n a.a = 3;\n return 0;\n }\n function Ac(a) {\n x(null != a);\n a.vc = null;\n a.yc = null;\n a.Ya = null;\n var b = a.Wa;\n null != b && (b.X = null);\n a.vb = null;\n x(null != a);\n }\n function Bc() {\n var a = new je();\n if (null == a) return null;\n a.a = 0;\n a.xb = Cc;\n gb(\"Predictor\", \"VP8LPredictors\");\n gb(\"Predictor\", \"VP8LPredictors_C\");\n gb(\"PredictorAdd\", \"VP8LPredictorsAdd\");\n gb(\"PredictorAdd\", \"VP8LPredictorsAdd_C\");\n pc = Kd;\n Fb = Ld;\n sc = Md;\n Gb = Nd;\n Hb = Od;\n xc = Pd;\n uc = Qd;\n self.VP8LMapColor32b = ke;\n self.VP8LMapColor8b = le;\n return a;\n }\n function rb(a, b, c, d, e) {\n var f = 1,\n g = [a],\n h = [b],\n k = d.m,\n l = d.s,\n m = null,\n n = 0;\n a: for (;;) {\n if (c)\n for (; f && D(k, 1); ) {\n var r = g,\n q = h,\n t = d,\n v = 1,\n p = t.m,\n u = t.gc[t.ab],\n w = D(p, 2);\n if (t.Oc & (1 << w)) f = 0;\n else {\n t.Oc |= 1 << w;\n u.hc = w;\n u.Ea = r[0];\n u.nc = q[0];\n u.K = [null];\n ++t.ab;\n x(4 >= t.ab);\n switch (w) {\n case 0:\n case 1:\n u.b = D(p, 3) + 2;\n v = rb(xa(u.Ea, u.b), xa(u.nc, u.b), 0, t, u.K);\n u.K = u.K[0];\n break;\n case 3:\n var y = D(p, 8) + 1,\n A = 16 < y ? 0 : 4 < y ? 1 : 2 < y ? 2 : 3;\n r[0] = xa(u.Ea, A);\n u.b = A;\n var v = rb(y, 1, 0, t, u.K),\n E;\n if ((E = v)) {\n var B,\n C = y,\n N = u,\n z = 1 << (8 >> N.b),\n Q = V(z);\n if (null == Q) E = 0;\n else {\n var S = N.K[0],\n K = N.w;\n Q[0] = N.K[0][0];\n for (B = 1; B < 1 * C; ++B) Q[B] = yb(S[K + B], Q[B - 1]);\n for (; B < 4 * z; ++B) Q[B] = 0;\n N.K[0] = null;\n N.K[0] = Q;\n E = 1;\n }\n }\n v = E;\n break;\n case 2:\n break;\n default:\n x(0);\n }\n f = v;\n }\n }\n g = g[0];\n h = h[0];\n if (f && D(k, 1) && ((n = D(k, 4)), (f = 1 <= n && 11 >= n), !f)) {\n d.a = 3;\n break a;\n }\n var H;\n if ((H = f))\n b: {\n var F = d,\n G = g,\n L = h,\n J = n,\n T = c,\n Da,\n ba,\n X = F.m,\n R = F.s,\n P = [null],\n U,\n W = 1,\n aa = 0,\n na = me[J];\n c: for (;;) {\n if (T && D(X, 1)) {\n var ca = D(X, 3) + 2,\n ga = xa(G, ca),\n ka = xa(L, ca),\n qa = ga * ka;\n if (!rb(ga, ka, 0, F, P)) break c;\n P = P[0];\n R.xc = ca;\n for (Da = 0; Da < qa; ++Da) {\n var ia = (P[Da] >> 8) & 65535;\n P[Da] = ia;\n ia >= W && (W = ia + 1);\n }\n }\n if (X.h) break c;\n for (ba = 0; 5 > ba; ++ba) {\n var Y = Dc[ba];\n !ba && 0 < J && (Y += 1 << J);\n aa < Y && (aa = Y);\n }\n var ma = wa(W * na, O);\n var ua = W,\n va = wa(ua, Ub);\n if (null == va) var la = null;\n else x(65536 >= ua), (la = va);\n var ha = V(aa);\n if (null == la || null == ha || null == ma) {\n F.a = 1;\n break c;\n }\n var pa = ma;\n for (Da = U = 0; Da < W; ++Da) {\n var ja = la[Da],\n da = ja.G,\n ea = ja.H,\n Fa = 0,\n ra = 1,\n Ha = 0;\n for (ba = 0; 5 > ba; ++ba) {\n Y = Dc[ba];\n da[ba] = pa;\n ea[ba] = U;\n !ba && 0 < J && (Y += 1 << J);\n d: {\n var sa,\n za = Y,\n ta = F,\n oa = ha,\n db = pa,\n eb = U,\n Ia = 0,\n Ka = ta.m,\n fb = D(Ka, 1);\n M(oa, 0, 0, za);\n if (fb) {\n var gb = D(Ka, 1) + 1,\n hb = D(Ka, 1),\n Ja = D(Ka, 0 == hb ? 1 : 8);\n oa[Ja] = 1;\n 2 == gb && ((Ja = D(Ka, 8)), (oa[Ja] = 1));\n var ya = 1;\n } else {\n var Ua = V(19),\n Va = D(Ka, 4) + 4;\n if (19 < Va) {\n ta.a = 3;\n var Aa = 0;\n break d;\n }\n for (sa = 0; sa < Va; ++sa) Ua[ne[sa]] = D(Ka, 3);\n var Ba = void 0,\n sb = void 0,\n Wa = ta,\n ib = Ua,\n Ca = za,\n Xa = oa,\n Oa = 0,\n La = Wa.m,\n Ya = 8,\n Za = wa(128, O);\n e: for (;;) {\n if (!Z(Za, 0, 7, ib, 19)) break e;\n if (D(La, 1)) {\n var kb = 2 + 2 * D(La, 3),\n Ba = 2 + D(La, kb);\n if (Ba > Ca) break e;\n } else Ba = Ca;\n for (sb = 0; sb < Ca && Ba--; ) {\n Sa(La);\n var $a = Za[0 + (pb(La) & 127)];\n qb(La, La.u + $a.g);\n var jb = $a.value;\n if (16 > jb) (Xa[sb++] = jb), 0 != jb && (Ya = jb);\n else {\n var lb = 16 == jb,\n ab = jb - 16,\n mb = oe[ab],\n bb = D(La, pe[ab]) + mb;\n if (sb + bb > Ca) break e;\n else\n for (var nb = lb ? Ya : 0; 0 < bb--; )\n Xa[sb++] = nb;\n }\n }\n Oa = 1;\n break e;\n }\n Oa || (Wa.a = 3);\n ya = Oa;\n }\n (ya = ya && !Ka.h) && (Ia = Z(db, eb, 8, oa, za));\n ya && 0 != Ia ? (Aa = Ia) : ((ta.a = 3), (Aa = 0));\n }\n if (0 == Aa) break c;\n ra && 1 == qe[ba] && (ra = 0 == pa[U].g);\n Fa += pa[U].g;\n U += Aa;\n if (3 >= ba) {\n var Pa = ha[0],\n tb;\n for (tb = 1; tb < Y; ++tb) ha[tb] > Pa && (Pa = ha[tb]);\n Ha += Pa;\n }\n }\n ja.nd = ra;\n ja.Qb = 0;\n ra &&\n ((ja.qb =\n ((da[3][ea[3] + 0].value << 24) |\n (da[1][ea[1] + 0].value << 16) |\n da[2][ea[2] + 0].value) >>>\n 0),\n 0 == Fa &&\n 256 > da[0][ea[0] + 0].value &&\n ((ja.Qb = 1), (ja.qb += da[0][ea[0] + 0].value << 8)));\n ja.jc = !ja.Qb && 6 > Ha;\n if (ja.jc) {\n var Ga,\n Ea = ja;\n for (Ga = 0; Ga < xb; ++Ga) {\n var Ma = Ga,\n Na = Ea.pd[Ma],\n vb = Ea.G[0][Ea.H[0] + Ma];\n 256 <= vb.value\n ? ((Na.g = vb.g + 256), (Na.value = vb.value))\n : ((Na.g = 0),\n (Na.value = 0),\n (Ma >>= ub(vb, 8, Na)),\n (Ma >>= ub(Ea.G[1][Ea.H[1] + Ma], 16, Na)),\n (Ma >>= ub(Ea.G[2][Ea.H[2] + Ma], 0, Na)),\n ub(Ea.G[3][Ea.H[3] + Ma], 24, Na));\n }\n }\n }\n R.vc = P;\n R.Wb = W;\n R.Ya = la;\n R.yc = ma;\n H = 1;\n break b;\n }\n H = 0;\n }\n f = H;\n if (!f) {\n d.a = 3;\n break a;\n }\n if (0 < n) {\n if (((l.ua = 1 << n), !Zb(l.Wa, n))) {\n d.a = 1;\n f = 0;\n break a;\n }\n } else l.ua = 0;\n var Qa = d,\n cb = g,\n ob = h,\n Ra = Qa.s,\n Ta = Ra.xc;\n Qa.c = cb;\n Qa.i = ob;\n Ra.md = xa(cb, Ta);\n Ra.wc = 0 == Ta ? -1 : (1 << Ta) - 1;\n if (c) {\n d.xb = re;\n break a;\n }\n m = V(g * h);\n if (null == m) {\n d.a = 1;\n f = 0;\n break a;\n }\n f = (f = Jb(d, m, 0, g, h, h, null)) && !k.h;\n break a;\n }\n f\n ? (null != e ? (e[0] = m) : (x(null == m), x(c)), (d.$ = 0), c || Ac(l))\n : Ac(l);\n return f;\n }\n function Ec(a, b) {\n var c = a.c * a.i,\n d = c + b + 16 * b;\n x(a.c <= b);\n a.V = V(d);\n if (null == a.V) return (a.Ta = null), (a.Ua = 0), (a.a = 1), 0;\n a.Ta = a.V;\n a.Ua = a.Ba + c + b;\n return 1;\n }\n function se(a, b) {\n var c = a.C,\n d = b - c,\n e = a.V,\n f = a.Ba + a.c * c;\n for (x(b <= a.l.o); 0 < d; ) {\n var g = 16 < d ? 16 : d,\n h = a.l.ma,\n k = a.l.width,\n l = k * g,\n m = h.ca,\n n = h.tb + k * c,\n r = a.Ta,\n q = a.Ua;\n oc(a, g, e, f);\n Fc(r, q, m, n, l);\n zc(h, c, c + g, m, n, k);\n d -= g;\n e += g * a.c;\n c += g;\n }\n x(c == b);\n a.C = a.Ma = b;\n }\n function te(a, b) {\n var c = [0],\n d = [0],\n e = [0];\n a: for (;;) {\n if (null == a) return 0;\n if (null == b) return (a.a = 2), 0;\n a.l = b;\n a.a = 0;\n cb(a.m, b.data, b.w, b.ha);\n if (!mc(a.m, c, d, e)) {\n a.a = 3;\n break a;\n }\n a.xb = Cc;\n b.width = c[0];\n b.height = d[0];\n if (!rb(c[0], d[0], 1, a, null)) break a;\n return 1;\n }\n x(0 != a.a);\n return 0;\n }\n function ue() {\n this.ub = this.yd = this.td = this.Rb = 0;\n }\n function ve() {\n this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;\n }\n function we() {\n this.Fb = this.Bb = this.Cb = 0;\n this.Zb = V(4);\n this.Lb = V(4);\n }\n function Gc() {\n this.Yb = wb();\n }\n function xe() {\n this.jb = V(3);\n this.Wc = Ed([4, 8], Gc);\n this.Xc = Ed([4, 17], Gc);\n }\n function ye() {\n this.Pc = this.wb = this.Tb = this.zd = 0;\n this.vd = new V(4);\n this.od = new V(4);\n }\n function Xa() {\n this.ld = this.La = this.dd = this.tc = 0;\n }\n function Hc() {\n this.Na = this.la = 0;\n }\n function ze() {\n this.Sc = [0, 0];\n this.Eb = [0, 0];\n this.Qc = [0, 0];\n this.ia = this.lc = 0;\n }\n function Kb() {\n this.ad = V(384);\n this.Za = 0;\n this.Ob = V(16);\n this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;\n }\n function Ae() {\n this.uc = this.M = this.Nb = 0;\n this.wa = Array(new Xa());\n this.Y = 0;\n this.ya = Array(new Kb());\n this.aa = 0;\n this.l = new Oa();\n }\n function Ic() {\n this.y = V(16);\n this.f = V(8);\n this.ea = V(8);\n }\n function Be() {\n this.cb = this.a = 0;\n this.sc = \"\";\n this.m = new Wb();\n this.Od = new ue();\n this.Kc = new ve();\n this.ed = new ye();\n this.Qa = new we();\n this.Ic = this.$c = this.Aa = 0;\n this.D = new Ae();\n this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0;\n this.Jc = wa(8, Wb);\n this.ia = 0;\n new F();\n this.pb = wa(4, ze);\n this.Pa = new xe();\n this.Bd = this.kc = 0;\n this.Ac = [];\n this.Bc = 0;\n this.zc = [0, 0, 0, 0];\n this.Gd = Array(new Ic());\n this.Hd = 0;\n this.rb = Array(new Hc());\n this.sb = 0;\n this.wa = Array(new Xa());\n this.Y = 0;\n this.oc = [];\n this.pc = 0;\n this.sa = [];\n this.ta = 0;\n this.qa = [];\n this.ra = 0;\n this.Ha = [];\n this.B = this.R = this.Ia = 0;\n this.Ec = [];\n this.M = this.ja = this.Vb = this.Fc = 0;\n this.ya = Array(new Kb());\n this.L = this.aa = 0;\n this.gd = Ed([4, 2], Xa);\n this.ga = null;\n this.Fa = [];\n this.Cc = this.qc = this.P = 0;\n this.Gb = [];\n this.Uc = 0;\n this.mb = [];\n this.nb = 0;\n this.rc = [];\n this.Ga = this.Vc = 0;\n }\n function ga(a, b) {\n return 0 > a ? 0 : a > b ? b : a;\n }\n function Oa() {\n this.T = this.U = this.ka = this.height = this.width = 0;\n this.y = [];\n this.f = [];\n this.ea = [];\n this.Rc = this.fa = this.W = this.N = this.O = 0;\n this.ma = \"void\";\n this.put = \"VP8IoPutHook\";\n this.ac = \"VP8IoSetupHook\";\n this.bc = \"VP8IoTeardownHook\";\n this.ha = this.Kb = 0;\n this.data = [];\n this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0;\n this.F = [];\n this.J = 0;\n }\n function Ce() {\n var a = new Be();\n null != a &&\n ((a.a = 0), (a.sc = \"OK\"), (a.cb = 0), (a.Xb = 0), oa || (oa = De));\n return a;\n }\n function T(a, b, c) {\n 0 == a.a && ((a.a = b), (a.sc = c), (a.cb = 0));\n return 0;\n }\n function Jc(a, b, c) {\n return 3 <= c && 157 == a[b + 0] && 1 == a[b + 1] && 42 == a[b + 2];\n }\n function Kc(a, b) {\n if (null == a) return 0;\n a.a = 0;\n a.sc = \"OK\";\n if (null == b) return T(a, 2, \"null VP8Io passed to VP8GetHeaders()\");\n var c = b.data;\n var d = b.w;\n var e = b.ha;\n if (4 > e) return T(a, 7, \"Truncated header.\");\n var f = c[d + 0] | (c[d + 1] << 8) | (c[d + 2] << 16);\n var g = a.Od;\n g.Rb = !(f & 1);\n g.td = (f >> 1) & 7;\n g.yd = (f >> 4) & 1;\n g.ub = f >> 5;\n if (3 < g.td) return T(a, 3, \"Incorrect keyframe parameters.\");\n if (!g.yd) return T(a, 4, \"Frame not displayable.\");\n d += 3;\n e -= 3;\n var h = a.Kc;\n if (g.Rb) {\n if (7 > e) return T(a, 7, \"cannot parse picture header\");\n if (!Jc(c, d, e)) return T(a, 3, \"Bad code word\");\n h.c = ((c[d + 4] << 8) | c[d + 3]) & 16383;\n h.Td = c[d + 4] >> 6;\n h.i = ((c[d + 6] << 8) | c[d + 5]) & 16383;\n h.Ud = c[d + 6] >> 6;\n d += 7;\n e -= 7;\n a.za = (h.c + 15) >> 4;\n a.Ub = (h.i + 15) >> 4;\n b.width = h.c;\n b.height = h.i;\n b.Da = 0;\n b.j = 0;\n b.v = 0;\n b.va = b.width;\n b.o = b.height;\n b.da = 0;\n b.ib = b.width;\n b.hb = b.height;\n b.U = b.width;\n b.T = b.height;\n f = a.Pa;\n M(f.jb, 0, 255, f.jb.length);\n f = a.Qa;\n x(null != f);\n f.Cb = 0;\n f.Bb = 0;\n f.Fb = 1;\n M(f.Zb, 0, 0, f.Zb.length);\n M(f.Lb, 0, 0, f.Lb);\n }\n if (g.ub > e) return T(a, 7, \"bad partition length\");\n f = a.m;\n ma(f, c, d, g.ub);\n d += g.ub;\n e -= g.ub;\n g.Rb && ((h.Ld = G(f)), (h.Kd = G(f)));\n h = a.Qa;\n var k = a.Pa,\n l;\n x(null != f);\n x(null != h);\n h.Cb = G(f);\n if (h.Cb) {\n h.Bb = G(f);\n if (G(f)) {\n h.Fb = G(f);\n for (l = 0; 4 > l; ++l) h.Zb[l] = G(f) ? ca(f, 7) : 0;\n for (l = 0; 4 > l; ++l) h.Lb[l] = G(f) ? ca(f, 6) : 0;\n }\n if (h.Bb) for (l = 0; 3 > l; ++l) k.jb[l] = G(f) ? na(f, 8) : 255;\n } else h.Bb = 0;\n if (f.Ka) return T(a, 3, \"cannot parse segment header\");\n h = a.ed;\n h.zd = G(f);\n h.Tb = na(f, 6);\n h.wb = na(f, 3);\n h.Pc = G(f);\n if (h.Pc && G(f)) {\n for (k = 0; 4 > k; ++k) G(f) && (h.vd[k] = ca(f, 6));\n for (k = 0; 4 > k; ++k) G(f) && (h.od[k] = ca(f, 6));\n }\n a.L = 0 == h.Tb ? 0 : h.zd ? 1 : 2;\n if (f.Ka) return T(a, 3, \"cannot parse filter header\");\n l = d;\n var m = e;\n e = l;\n d = l + m;\n h = m;\n a.Xb = (1 << na(a.m, 2)) - 1;\n k = a.Xb;\n if (m < 3 * k) c = 7;\n else {\n l += 3 * k;\n h -= 3 * k;\n for (m = 0; m < k; ++m) {\n var n = c[e + 0] | (c[e + 1] << 8) | (c[e + 2] << 16);\n n > h && (n = h);\n ma(a.Jc[+m], c, l, n);\n l += n;\n h -= n;\n e += 3;\n }\n ma(a.Jc[+k], c, l, h);\n c = l < d ? 0 : 5;\n }\n if (0 != c) return T(a, c, \"cannot parse partitions\");\n l = a.m;\n c = na(l, 7);\n e = G(l) ? ca(l, 4) : 0;\n d = G(l) ? ca(l, 4) : 0;\n h = G(l) ? ca(l, 4) : 0;\n k = G(l) ? ca(l, 4) : 0;\n l = G(l) ? ca(l, 4) : 0;\n m = a.Qa;\n for (n = 0; 4 > n; ++n) {\n if (m.Cb) {\n var r = m.Zb[n];\n m.Fb || (r += c);\n } else if (0 < n) {\n a.pb[n] = a.pb[0];\n continue;\n } else r = c;\n var q = a.pb[n];\n q.Sc[0] = Lb[ga(r + e, 127)];\n q.Sc[1] = Mb[ga(r + 0, 127)];\n q.Eb[0] = 2 * Lb[ga(r + d, 127)];\n q.Eb[1] = (101581 * Mb[ga(r + h, 127)]) >> 16;\n 8 > q.Eb[1] && (q.Eb[1] = 8);\n q.Qc[0] = Lb[ga(r + k, 117)];\n q.Qc[1] = Mb[ga(r + l, 127)];\n q.lc = r + l;\n }\n if (!g.Rb) return T(a, 4, \"Not a key frame.\");\n G(f);\n g = a.Pa;\n for (c = 0; 4 > c; ++c) {\n for (e = 0; 8 > e; ++e)\n for (d = 0; 3 > d; ++d)\n for (h = 0; 11 > h; ++h)\n (k = K(f, Ee[c][e][d][h]) ? na(f, 8) : Fe[c][e][d][h]),\n (g.Wc[c][e].Yb[d][h] = k);\n for (e = 0; 17 > e; ++e) g.Xc[c][e] = g.Wc[c][Ge[e]];\n }\n a.kc = G(f);\n a.kc && (a.Bd = na(f, 8));\n return (a.cb = 1);\n }\n function De(a, b, c, d, e, f, g) {\n var h = b[e].Yb[c];\n for (c = 0; 16 > e; ++e) {\n if (!K(a, h[c + 0])) return e;\n for (; !K(a, h[c + 1]); )\n if (((h = b[++e].Yb[0]), (c = 0), 16 == e)) return 16;\n var k = b[e + 1].Yb;\n if (K(a, h[c + 2])) {\n var l = a,\n m = h,\n n = c;\n var r = 0;\n if (K(l, m[n + 3]))\n if (K(l, m[n + 6])) {\n h = 0;\n r = K(l, m[n + 8]);\n m = K(l, m[n + 9 + r]);\n n = 2 * r + m;\n r = 0;\n for (m = He[n]; m[h]; ++h) r += r + K(l, m[h]);\n r += 3 + (8 << n);\n } else\n K(l, m[n + 7])\n ? ((r = 7 + 2 * K(l, 165)), (r += K(l, 145)))\n : (r = 5 + K(l, 159));\n else K(l, m[n + 4]) ? (r = 3 + K(l, m[n + 5])) : (r = 2);\n h = k[2];\n } else (r = 1), (h = k[1]);\n k = g + Ie[e];\n l = a;\n 0 > l.b && Qa(l);\n var m = l.b,\n n = l.Ca >> 1,\n q = (n - (l.I >> m)) >> 31;\n --l.b;\n l.Ca += q;\n l.Ca |= 1;\n l.I -= ((n + 1) & q) << m;\n f[k] = ((r ^ q) - q) * d[(0 < e) + 0];\n }\n return 16;\n }\n function Lc(a) {\n var b = a.rb[a.sb - 1];\n b.la = 0;\n b.Na = 0;\n M(a.zc, 0, 0, a.zc.length);\n a.ja = 0;\n }\n function Je(a, b) {\n for (a.M = 0; a.M < a.Va; ++a.M) {\n var c = a.Jc[a.M & a.Xb],\n d = a.m,\n e = a,\n f;\n for (f = 0; f < e.za; ++f) {\n var g = d;\n var h = e;\n var k = h.Ac,\n l = h.Bc + 4 * f,\n m = h.zc,\n n = h.ya[h.aa + f];\n h.Qa.Bb\n ? (n.$b = K(g, h.Pa.jb[0])\n ? 2 + K(g, h.Pa.jb[2])\n : K(g, h.Pa.jb[1]))\n : (n.$b = 0);\n h.kc && (n.Ad = K(g, h.Bd));\n n.Za = !K(g, 145) + 0;\n if (n.Za) {\n var r = n.Ob,\n q = 0;\n for (h = 0; 4 > h; ++h) {\n var t = m[0 + h];\n var v;\n for (v = 0; 4 > v; ++v) {\n t = Ke[k[l + v]][t];\n for (var p = Mc[K(g, t[0])]; 0 < p; )\n p = Mc[2 * p + K(g, t[p])];\n t = -p;\n k[l + v] = t;\n }\n I(r, q, k, l, 4);\n q += 4;\n m[0 + h] = t;\n }\n } else\n (t = K(g, 156) ? (K(g, 128) ? 1 : 3) : K(g, 163) ? 2 : 0),\n (n.Ob[0] = t),\n M(k, l, t, 4),\n M(m, 0, t, 4);\n n.Dd = K(g, 142) ? (K(g, 114) ? (K(g, 183) ? 1 : 3) : 2) : 0;\n }\n if (e.m.Ka) return T(a, 7, \"Premature end-of-partition0 encountered.\");\n for (; a.ja < a.za; ++a.ja) {\n d = a;\n e = c;\n g = d.rb[d.sb - 1];\n k = d.rb[d.sb + d.ja];\n f = d.ya[d.aa + d.ja];\n if ((l = d.kc ? f.Ad : 0))\n (g.la = k.la = 0),\n f.Za || (g.Na = k.Na = 0),\n (f.Hc = 0),\n (f.Gc = 0),\n (f.ia = 0);\n else {\n var u,\n w,\n g = k,\n k = e,\n l = d.Pa.Xc,\n m = d.ya[d.aa + d.ja],\n n = d.pb[m.$b];\n h = m.ad;\n r = 0;\n q = d.rb[d.sb - 1];\n t = v = 0;\n M(h, r, 0, 384);\n if (m.Za) {\n var y = 0;\n var A = l[3];\n } else {\n p = V(16);\n var E = g.Na + q.Na;\n E = oa(k, l[1], E, n.Eb, 0, p, 0);\n g.Na = q.Na = (0 < E) + 0;\n if (1 < E) Nc(p, 0, h, r);\n else {\n var B = (p[0] + 3) >> 3;\n for (p = 0; 256 > p; p += 16) h[r + p] = B;\n }\n y = 1;\n A = l[0];\n }\n var C = g.la & 15;\n var N = q.la & 15;\n for (p = 0; 4 > p; ++p) {\n var z = N & 1;\n for (B = w = 0; 4 > B; ++B)\n (E = z + (C & 1)),\n (E = oa(k, A, E, n.Sc, y, h, r)),\n (z = E > y),\n (C = (C >> 1) | (z << 7)),\n (w = (w << 2) | (3 < E ? 3 : 1 < E ? 2 : 0 != h[r + 0])),\n (r += 16);\n C >>= 4;\n N = (N >> 1) | (z << 7);\n v = ((v << 8) | w) >>> 0;\n }\n A = C;\n y = N >> 4;\n for (u = 0; 4 > u; u += 2) {\n w = 0;\n C = g.la >> (4 + u);\n N = q.la >> (4 + u);\n for (p = 0; 2 > p; ++p) {\n z = N & 1;\n for (B = 0; 2 > B; ++B)\n (E = z + (C & 1)),\n (E = oa(k, l[2], E, n.Qc, 0, h, r)),\n (z = 0 < E),\n (C = (C >> 1) | (z << 3)),\n (w = (w << 2) | (3 < E ? 3 : 1 < E ? 2 : 0 != h[r + 0])),\n (r += 16);\n C >>= 2;\n N = (N >> 1) | (z << 5);\n }\n t |= w << (4 * u);\n A |= (C << 4) << u;\n y |= (N & 240) << u;\n }\n g.la = A;\n q.la = y;\n m.Hc = v;\n m.Gc = t;\n m.ia = t & 43690 ? 0 : n.ia;\n l = !(v | t);\n }\n 0 < d.L &&\n ((d.wa[d.Y + d.ja] = d.gd[f.$b][f.Za]),\n (d.wa[d.Y + d.ja].La |= !l));\n if (e.Ka) return T(a, 7, \"Premature end-of-file encountered.\");\n }\n Lc(a);\n c = a;\n d = b;\n e = 1;\n f = c.D;\n g = 0 < c.L && c.M >= c.zb && c.M <= c.Va;\n if (0 == c.Aa)\n a: {\n (f.M = c.M), (f.uc = g), Oc(c, f), (e = 1);\n w = c.D;\n f = w.Nb;\n t = Ya[c.L];\n g = t * c.R;\n k = (t / 2) * c.B;\n p = 16 * f * c.R;\n B = 8 * f * c.B;\n l = c.sa;\n m = c.ta - g + p;\n n = c.qa;\n h = c.ra - k + B;\n r = c.Ha;\n q = c.Ia - k + B;\n C = w.M;\n N = 0 == C;\n v = C >= c.Va - 1;\n 2 == c.Aa && Oc(c, w);\n if (w.uc)\n for (E = c, z = E.D.M, x(E.D.uc), w = E.yb; w < E.Hb; ++w) {\n var Q = E;\n y = w;\n A = z;\n var S = Q.D,\n D = S.Nb;\n u = Q.R;\n var S = S.wa[S.Y + y],\n F = Q.sa,\n H = Q.ta + 16 * D * u + 16 * y,\n J = S.dd,\n G = S.tc;\n if (0 != G)\n if ((x(3 <= G), 1 == Q.L))\n 0 < y && Pc(F, H, u, G + 4),\n S.La && Qc(F, H, u, G),\n 0 < A && Rc(F, H, u, G + 4),\n S.La && Sc(F, H, u, G);\n else {\n var L = Q.B,\n O = Q.qa,\n P = Q.ra + 8 * D * L + 8 * y,\n R = Q.Ha,\n Q = Q.Ia + 8 * D * L + 8 * y,\n D = S.ld;\n 0 < y &&\n (Tc(F, H, u, G + 4, J, D),\n Uc(O, P, R, Q, L, G + 4, J, D));\n S.La && (Vc(F, H, u, G, J, D), Wc(O, P, R, Q, L, G, J, D));\n 0 < A &&\n (Xc(F, H, u, G + 4, J, D),\n Yc(O, P, R, Q, L, G + 4, J, D));\n S.La && (Zc(F, H, u, G, J, D), $c(O, P, R, Q, L, G, J, D));\n }\n }\n c.ia && alert(\"todo:DitherRow\");\n if (null != d.put) {\n w = 16 * C;\n C = 16 * (C + 1);\n N\n ? ((d.y = c.sa),\n (d.O = c.ta + p),\n (d.f = c.qa),\n (d.N = c.ra + B),\n (d.ea = c.Ha),\n (d.W = c.Ia + B))\n : ((w -= t),\n (d.y = l),\n (d.O = m),\n (d.f = n),\n (d.N = h),\n (d.ea = r),\n (d.W = q));\n v || (C -= t);\n C > d.o && (C = d.o);\n d.F = null;\n d.J = null;\n if (\n null != c.Fa &&\n 0 < c.Fa.length &&\n w < C &&\n ((d.J = Le(c, d, w, C - w)),\n (d.F = c.mb),\n null == d.F && 0 == d.F.length)\n ) {\n e = T(c, 3, \"Could not decode alpha data.\");\n break a;\n }\n w < d.j &&\n ((t = d.j - w),\n (w = d.j),\n x(!(t & 1)),\n (d.O += c.R * t),\n (d.N += c.B * (t >> 1)),\n (d.W += c.B * (t >> 1)),\n null != d.F && (d.J += d.width * t));\n w < C &&\n ((d.O += d.v),\n (d.N += d.v >> 1),\n (d.W += d.v >> 1),\n null != d.F && (d.J += d.v),\n (d.ka = w - d.j),\n (d.U = d.va - d.v),\n (d.T = C - w),\n (e = d.put(d)));\n }\n f + 1 != c.Ic ||\n v ||\n (I(c.sa, c.ta - g, l, m + 16 * c.R, g),\n I(c.qa, c.ra - k, n, h + 8 * c.B, k),\n I(c.Ha, c.Ia - k, r, q + 8 * c.B, k));\n }\n if (!e) return T(a, 6, \"Output aborted.\");\n }\n return 1;\n }\n function Me(a, b) {\n if (null == a) return 0;\n if (null == b) return T(a, 2, \"NULL VP8Io parameter in VP8Decode().\");\n if (!a.cb && !Kc(a, b)) return 0;\n x(a.cb);\n if (null == b.ac || b.ac(b)) {\n b.ob && (a.L = 0);\n var c = Ya[a.L];\n 2 == a.L\n ? ((a.yb = 0), (a.zb = 0))\n : ((a.yb = (b.v - c) >> 4),\n (a.zb = (b.j - c) >> 4),\n 0 > a.yb && (a.yb = 0),\n 0 > a.zb && (a.zb = 0));\n a.Va = (b.o + 15 + c) >> 4;\n a.Hb = (b.va + 15 + c) >> 4;\n a.Hb > a.za && (a.Hb = a.za);\n a.Va > a.Ub && (a.Va = a.Ub);\n if (0 < a.L) {\n var d = a.ed;\n for (c = 0; 4 > c; ++c) {\n var e;\n if (a.Qa.Cb) {\n var f = a.Qa.Lb[c];\n a.Qa.Fb || (f += d.Tb);\n } else f = d.Tb;\n for (e = 0; 1 >= e; ++e) {\n var g = a.gd[c][e],\n h = f;\n d.Pc && ((h += d.vd[0]), e && (h += d.od[0]));\n h = 0 > h ? 0 : 63 < h ? 63 : h;\n if (0 < h) {\n var k = h;\n 0 < d.wb &&\n ((k = 4 < d.wb ? k >> 2 : k >> 1),\n k > 9 - d.wb && (k = 9 - d.wb));\n 1 > k && (k = 1);\n g.dd = k;\n g.tc = 2 * h + k;\n g.ld = 40 <= h ? 2 : 15 <= h ? 1 : 0;\n } else g.tc = 0;\n g.La = e;\n }\n }\n }\n c = 0;\n } else T(a, 6, \"Frame setup failed\"), (c = a.a);\n if ((c = 0 == c)) {\n if (c) {\n a.$c = 0;\n 0 < a.Aa || (a.Ic = Ne);\n b: {\n c = a.Ic;\n var k = a.za,\n d = 4 * k,\n l = 32 * k,\n m = k + 1,\n n = 0 < a.L ? k * (0 < a.Aa ? 2 : 1) : 0,\n r = (2 == a.Aa ? 2 : 1) * k;\n e = ((3 * (16 * c + Ya[a.L])) / 2) * l;\n f = null != a.Fa && 0 < a.Fa.length ? a.Kc.c * a.Kc.i : 0;\n g = d + 832 + e + f;\n if (g != g) c = 0;\n else {\n if (g > a.Vb) {\n a.Vb = 0;\n a.Ec = V(g);\n a.Fc = 0;\n if (null == a.Ec) {\n c = T(a, 1, \"no memory during frame initialization.\");\n break b;\n }\n a.Vb = g;\n }\n g = a.Ec;\n h = a.Fc;\n a.Ac = g;\n a.Bc = h;\n h += d;\n a.Gd = wa(l, Ic);\n a.Hd = 0;\n a.rb = wa(m + 1, Hc);\n a.sb = 1;\n a.wa = n ? wa(n, Xa) : null;\n a.Y = 0;\n a.D.Nb = 0;\n a.D.wa = a.wa;\n a.D.Y = a.Y;\n 0 < a.Aa && (a.D.Y += k);\n x(!0);\n a.oc = g;\n a.pc = h;\n h += 832;\n a.ya = wa(r, Kb);\n a.aa = 0;\n a.D.ya = a.ya;\n a.D.aa = a.aa;\n 2 == a.Aa && (a.D.aa += k);\n a.R = 16 * k;\n a.B = 8 * k;\n l = Ya[a.L];\n k = l * a.R;\n l = (l / 2) * a.B;\n a.sa = g;\n a.ta = h + k;\n a.qa = a.sa;\n a.ra = a.ta + 16 * c * a.R + l;\n a.Ha = a.qa;\n a.Ia = a.ra + 8 * c * a.B + l;\n a.$c = 0;\n h += e;\n a.mb = f ? g : null;\n a.nb = f ? h : null;\n x(h + f <= a.Fc + a.Vb);\n Lc(a);\n M(a.Ac, a.Bc, 0, d);\n c = 1;\n }\n }\n if (c) {\n b.ka = 0;\n b.y = a.sa;\n b.O = a.ta;\n b.f = a.qa;\n b.N = a.ra;\n b.ea = a.Ha;\n b.Vd = a.Ia;\n b.fa = a.R;\n b.Rc = a.B;\n b.F = null;\n b.J = 0;\n if (!ad) {\n for (c = -255; 255 >= c; ++c) bd[255 + c] = 0 > c ? -c : c;\n for (c = -1020; 1020 >= c; ++c)\n cd[1020 + c] = -128 > c ? -128 : 127 < c ? 127 : c;\n for (c = -112; 112 >= c; ++c)\n dd[112 + c] = -16 > c ? -16 : 15 < c ? 15 : c;\n for (c = -255; 510 >= c; ++c)\n ed[255 + c] = 0 > c ? 0 : 255 < c ? 255 : c;\n ad = 1;\n }\n Nc = Oe;\n Za = Pe;\n Nb = Qe;\n pa = Re;\n Ob = Se;\n fd = Te;\n Xc = Ue;\n Tc = Ve;\n Yc = We;\n Uc = Xe;\n Zc = Ye;\n Vc = Ze;\n $c = $e;\n Wc = af;\n Rc = gd;\n Pc = hd;\n Sc = bf;\n Qc = cf;\n W[0] = df;\n W[1] = ef;\n W[2] = ff;\n W[3] = gf;\n W[4] = hf;\n W[5] = jf;\n W[6] = kf;\n W[7] = lf;\n W[8] = mf;\n W[9] = nf;\n Y[0] = of;\n Y[1] = pf;\n Y[2] = qf;\n Y[3] = rf;\n Y[4] = sf;\n Y[5] = tf;\n Y[6] = uf;\n ka[0] = vf;\n ka[1] = wf;\n ka[2] = xf;\n ka[3] = yf;\n ka[4] = zf;\n ka[5] = Af;\n ka[6] = Bf;\n c = 1;\n } else c = 0;\n }\n c && (c = Je(a, b));\n null != b.bc && b.bc(b);\n c &= 1;\n }\n if (!c) return 0;\n a.cb = 0;\n return c;\n }\n function qa(a, b, c, d, e) {\n e = a[b + c + 32 * d] + (e >> 3);\n a[b + c + 32 * d] = e & -256 ? (0 > e ? 0 : 255) : e;\n }\n function kb(a, b, c, d, e, f) {\n qa(a, b, 0, c, d + e);\n qa(a, b, 1, c, d + f);\n qa(a, b, 2, c, d - f);\n qa(a, b, 3, c, d - e);\n }\n function da(a) {\n return ((20091 * a) >> 16) + a;\n }\n function id(a, b, c, d) {\n var e = 0,\n f;\n var g = V(16);\n for (f = 0; 4 > f; ++f) {\n var h = a[b + 0] + a[b + 8];\n var k = a[b + 0] - a[b + 8];\n var l = ((35468 * a[b + 4]) >> 16) - da(a[b + 12]);\n var m = da(a[b + 4]) + ((35468 * a[b + 12]) >> 16);\n g[e + 0] = h + m;\n g[e + 1] = k + l;\n g[e + 2] = k - l;\n g[e + 3] = h - m;\n e += 4;\n b++;\n }\n for (f = e = 0; 4 > f; ++f)\n (a = g[e + 0] + 4),\n (h = a + g[e + 8]),\n (k = a - g[e + 8]),\n (l = ((35468 * g[e + 4]) >> 16) - da(g[e + 12])),\n (m = da(g[e + 4]) + ((35468 * g[e + 12]) >> 16)),\n qa(c, d, 0, 0, h + m),\n qa(c, d, 1, 0, k + l),\n qa(c, d, 2, 0, k - l),\n qa(c, d, 3, 0, h - m),\n e++,\n (d += 32);\n }\n function Te(a, b, c, d) {\n var e = a[b + 0] + 4,\n f = (35468 * a[b + 4]) >> 16,\n g = da(a[b + 4]),\n h = (35468 * a[b + 1]) >> 16;\n a = da(a[b + 1]);\n kb(c, d, 0, e + g, a, h);\n kb(c, d, 1, e + f, a, h);\n kb(c, d, 2, e - f, a, h);\n kb(c, d, 3, e - g, a, h);\n }\n function Pe(a, b, c, d, e) {\n id(a, b, c, d);\n e && id(a, b + 16, c, d + 4);\n }\n function Qe(a, b, c, d) {\n Za(a, b + 0, c, d, 1);\n Za(a, b + 32, c, d + 128, 1);\n }\n function Re(a, b, c, d) {\n a = a[b + 0] + 4;\n var e;\n for (e = 0; 4 > e; ++e) for (b = 0; 4 > b; ++b) qa(c, d, b, e, a);\n }\n function Se(a, b, c, d) {\n a[b + 0] && pa(a, b + 0, c, d);\n a[b + 16] && pa(a, b + 16, c, d + 4);\n a[b + 32] && pa(a, b + 32, c, d + 128);\n a[b + 48] && pa(a, b + 48, c, d + 128 + 4);\n }\n function Oe(a, b, c, d) {\n var e = V(16),\n f;\n for (f = 0; 4 > f; ++f) {\n var g = a[b + 0 + f] + a[b + 12 + f];\n var h = a[b + 4 + f] + a[b + 8 + f];\n var k = a[b + 4 + f] - a[b + 8 + f];\n var l = a[b + 0 + f] - a[b + 12 + f];\n e[0 + f] = g + h;\n e[8 + f] = g - h;\n e[4 + f] = l + k;\n e[12 + f] = l - k;\n }\n for (f = 0; 4 > f; ++f)\n (a = e[0 + 4 * f] + 3),\n (g = a + e[3 + 4 * f]),\n (h = e[1 + 4 * f] + e[2 + 4 * f]),\n (k = e[1 + 4 * f] - e[2 + 4 * f]),\n (l = a - e[3 + 4 * f]),\n (c[d + 0] = (g + h) >> 3),\n (c[d + 16] = (l + k) >> 3),\n (c[d + 32] = (g - h) >> 3),\n (c[d + 48] = (l - k) >> 3),\n (d += 64);\n }\n function Pb(a, b, c) {\n var d = b - 32,\n e = R,\n f = 255 - a[d - 1],\n g;\n for (g = 0; g < c; ++g) {\n var h = e,\n k = f + a[b - 1],\n l;\n for (l = 0; l < c; ++l) a[b + l] = h[k + a[d + l]];\n b += 32;\n }\n }\n function ef(a, b) {\n Pb(a, b, 4);\n }\n function wf(a, b) {\n Pb(a, b, 8);\n }\n function pf(a, b) {\n Pb(a, b, 16);\n }\n function qf(a, b) {\n var c;\n for (c = 0; 16 > c; ++c) I(a, b + 32 * c, a, b - 32, 16);\n }\n function rf(a, b) {\n var c;\n for (c = 16; 0 < c; --c) M(a, b, a[b - 1], 16), (b += 32);\n }\n function $a(a, b, c) {\n var d;\n for (d = 0; 16 > d; ++d) M(b, c + 32 * d, a, 16);\n }\n function of(a, b) {\n var c = 16,\n d;\n for (d = 0; 16 > d; ++d) c += a[b - 1 + 32 * d] + a[b + d - 32];\n $a(c >> 5, a, b);\n }\n function sf(a, b) {\n var c = 8,\n d;\n for (d = 0; 16 > d; ++d) c += a[b - 1 + 32 * d];\n $a(c >> 4, a, b);\n }\n function tf(a, b) {\n var c = 8,\n d;\n for (d = 0; 16 > d; ++d) c += a[b + d - 32];\n $a(c >> 4, a, b);\n }\n function uf(a, b) {\n $a(128, a, b);\n }\n function z(a, b, c) {\n return (a + 2 * b + c + 2) >> 2;\n }\n function ff(a, b) {\n var c = b - 32,\n c = new Uint8Array([\n z(a[c - 1], a[c + 0], a[c + 1]),\n z(a[c + 0], a[c + 1], a[c + 2]),\n z(a[c + 1], a[c + 2], a[c + 3]),\n z(a[c + 2], a[c + 3], a[c + 4])\n ]),\n d;\n for (d = 0; 4 > d; ++d) I(a, b + 32 * d, c, 0, c.length);\n }\n function gf(a, b) {\n var c = a[b - 1],\n d = a[b - 1 + 32],\n e = a[b - 1 + 64],\n f = a[b - 1 + 96];\n ra(a, b + 0, 16843009 * z(a[b - 1 - 32], c, d));\n ra(a, b + 32, 16843009 * z(c, d, e));\n ra(a, b + 64, 16843009 * z(d, e, f));\n ra(a, b + 96, 16843009 * z(e, f, f));\n }\n function df(a, b) {\n var c = 4,\n d;\n for (d = 0; 4 > d; ++d) c += a[b + d - 32] + a[b - 1 + 32 * d];\n c >>= 3;\n for (d = 0; 4 > d; ++d) M(a, b + 32 * d, c, 4);\n }\n function hf(a, b) {\n var c = a[b - 1 + 0],\n d = a[b - 1 + 32],\n e = a[b - 1 + 64],\n f = a[b - 1 - 32],\n g = a[b + 0 - 32],\n h = a[b + 1 - 32],\n k = a[b + 2 - 32],\n l = a[b + 3 - 32];\n a[b + 0 + 96] = z(d, e, a[b - 1 + 96]);\n a[b + 1 + 96] = a[b + 0 + 64] = z(c, d, e);\n a[b + 2 + 96] = a[b + 1 + 64] = a[b + 0 + 32] = z(f, c, d);\n a[b + 3 + 96] = a[b + 2 + 64] = a[b + 1 + 32] = a[b + 0 + 0] = z(g, f, c);\n a[b + 3 + 64] = a[b + 2 + 32] = a[b + 1 + 0] = z(h, g, f);\n a[b + 3 + 32] = a[b + 2 + 0] = z(k, h, g);\n a[b + 3 + 0] = z(l, k, h);\n }\n function kf(a, b) {\n var c = a[b + 1 - 32],\n d = a[b + 2 - 32],\n e = a[b + 3 - 32],\n f = a[b + 4 - 32],\n g = a[b + 5 - 32],\n h = a[b + 6 - 32],\n k = a[b + 7 - 32];\n a[b + 0 + 0] = z(a[b + 0 - 32], c, d);\n a[b + 1 + 0] = a[b + 0 + 32] = z(c, d, e);\n a[b + 2 + 0] = a[b + 1 + 32] = a[b + 0 + 64] = z(d, e, f);\n a[b + 3 + 0] = a[b + 2 + 32] = a[b + 1 + 64] = a[b + 0 + 96] = z(e, f, g);\n a[b + 3 + 32] = a[b + 2 + 64] = a[b + 1 + 96] = z(f, g, h);\n a[b + 3 + 64] = a[b + 2 + 96] = z(g, h, k);\n a[b + 3 + 96] = z(h, k, k);\n }\n function jf(a, b) {\n var c = a[b - 1 + 0],\n d = a[b - 1 + 32],\n e = a[b - 1 + 64],\n f = a[b - 1 - 32],\n g = a[b + 0 - 32],\n h = a[b + 1 - 32],\n k = a[b + 2 - 32],\n l = a[b + 3 - 32];\n a[b + 0 + 0] = a[b + 1 + 64] = (f + g + 1) >> 1;\n a[b + 1 + 0] = a[b + 2 + 64] = (g + h + 1) >> 1;\n a[b + 2 + 0] = a[b + 3 + 64] = (h + k + 1) >> 1;\n a[b + 3 + 0] = (k + l + 1) >> 1;\n a[b + 0 + 96] = z(e, d, c);\n a[b + 0 + 64] = z(d, c, f);\n a[b + 0 + 32] = a[b + 1 + 96] = z(c, f, g);\n a[b + 1 + 32] = a[b + 2 + 96] = z(f, g, h);\n a[b + 2 + 32] = a[b + 3 + 96] = z(g, h, k);\n a[b + 3 + 32] = z(h, k, l);\n }\n function lf(a, b) {\n var c = a[b + 0 - 32],\n d = a[b + 1 - 32],\n e = a[b + 2 - 32],\n f = a[b + 3 - 32],\n g = a[b + 4 - 32],\n h = a[b + 5 - 32],\n k = a[b + 6 - 32],\n l = a[b + 7 - 32];\n a[b + 0 + 0] = (c + d + 1) >> 1;\n a[b + 1 + 0] = a[b + 0 + 64] = (d + e + 1) >> 1;\n a[b + 2 + 0] = a[b + 1 + 64] = (e + f + 1) >> 1;\n a[b + 3 + 0] = a[b + 2 + 64] = (f + g + 1) >> 1;\n a[b + 0 + 32] = z(c, d, e);\n a[b + 1 + 32] = a[b + 0 + 96] = z(d, e, f);\n a[b + 2 + 32] = a[b + 1 + 96] = z(e, f, g);\n a[b + 3 + 32] = a[b + 2 + 96] = z(f, g, h);\n a[b + 3 + 64] = z(g, h, k);\n a[b + 3 + 96] = z(h, k, l);\n }\n function nf(a, b) {\n var c = a[b - 1 + 0],\n d = a[b - 1 + 32],\n e = a[b - 1 + 64],\n f = a[b - 1 + 96];\n a[b + 0 + 0] = (c + d + 1) >> 1;\n a[b + 2 + 0] = a[b + 0 + 32] = (d + e + 1) >> 1;\n a[b + 2 + 32] = a[b + 0 + 64] = (e + f + 1) >> 1;\n a[b + 1 + 0] = z(c, d, e);\n a[b + 3 + 0] = a[b + 1 + 32] = z(d, e, f);\n a[b + 3 + 32] = a[b + 1 + 64] = z(e, f, f);\n a[b + 3 + 64] = a[b + 2 + 64] = a[b + 0 + 96] = a[b + 1 + 96] = a[\n b + 2 + 96\n ] = a[b + 3 + 96] = f;\n }\n function mf(a, b) {\n var c = a[b - 1 + 0],\n d = a[b - 1 + 32],\n e = a[b - 1 + 64],\n f = a[b - 1 + 96],\n g = a[b - 1 - 32],\n h = a[b + 0 - 32],\n k = a[b + 1 - 32],\n l = a[b + 2 - 32];\n a[b + 0 + 0] = a[b + 2 + 32] = (c + g + 1) >> 1;\n a[b + 0 + 32] = a[b + 2 + 64] = (d + c + 1) >> 1;\n a[b + 0 + 64] = a[b + 2 + 96] = (e + d + 1) >> 1;\n a[b + 0 + 96] = (f + e + 1) >> 1;\n a[b + 3 + 0] = z(h, k, l);\n a[b + 2 + 0] = z(g, h, k);\n a[b + 1 + 0] = a[b + 3 + 32] = z(c, g, h);\n a[b + 1 + 32] = a[b + 3 + 64] = z(d, c, g);\n a[b + 1 + 64] = a[b + 3 + 96] = z(e, d, c);\n a[b + 1 + 96] = z(f, e, d);\n }\n function xf(a, b) {\n var c;\n for (c = 0; 8 > c; ++c) I(a, b + 32 * c, a, b - 32, 8);\n }\n function yf(a, b) {\n var c;\n for (c = 0; 8 > c; ++c) M(a, b, a[b - 1], 8), (b += 32);\n }\n function lb(a, b, c) {\n var d;\n for (d = 0; 8 > d; ++d) M(b, c + 32 * d, a, 8);\n }\n function vf(a, b) {\n var c = 8,\n d;\n for (d = 0; 8 > d; ++d) c += a[b + d - 32] + a[b - 1 + 32 * d];\n lb(c >> 4, a, b);\n }\n function Af(a, b) {\n var c = 4,\n d;\n for (d = 0; 8 > d; ++d) c += a[b + d - 32];\n lb(c >> 3, a, b);\n }\n function zf(a, b) {\n var c = 4,\n d;\n for (d = 0; 8 > d; ++d) c += a[b - 1 + 32 * d];\n lb(c >> 3, a, b);\n }\n function Bf(a, b) {\n lb(128, a, b);\n }\n function ab(a, b, c) {\n var d = a[b - c],\n e = a[b + 0],\n f = 3 * (e - d) + Qb[1020 + a[b - 2 * c] - a[b + c]],\n g = mb[112 + ((f + 4) >> 3)];\n a[b - c] = R[255 + d + mb[112 + ((f + 3) >> 3)]];\n a[b + 0] = R[255 + e - g];\n }\n function jd(a, b, c, d) {\n var e = a[b + 0],\n f = a[b + c];\n return U[255 + a[b - 2 * c] - a[b - c]] > d || U[255 + f - e] > d;\n }\n function kd(a, b, c, d) {\n return (\n 4 * U[255 + a[b - c] - a[b + 0]] + U[255 + a[b - 2 * c] - a[b + c]] <= d\n );\n }\n function ld(a, b, c, d, e) {\n var f = a[b - 3 * c],\n g = a[b - 2 * c],\n h = a[b - c],\n k = a[b + 0],\n l = a[b + c],\n m = a[b + 2 * c],\n n = a[b + 3 * c];\n return 4 * U[255 + h - k] + U[255 + g - l] > d\n ? 0\n : U[255 + a[b - 4 * c] - f] <= e &&\n U[255 + f - g] <= e &&\n U[255 + g - h] <= e &&\n U[255 + n - m] <= e &&\n U[255 + m - l] <= e &&\n U[255 + l - k] <= e;\n }\n function gd(a, b, c, d) {\n var e = 2 * d + 1;\n for (d = 0; 16 > d; ++d) kd(a, b + d, c, e) && ab(a, b + d, c);\n }\n function hd(a, b, c, d) {\n var e = 2 * d + 1;\n for (d = 0; 16 > d; ++d) kd(a, b + d * c, 1, e) && ab(a, b + d * c, 1);\n }\n function bf(a, b, c, d) {\n var e;\n for (e = 3; 0 < e; --e) (b += 4 * c), gd(a, b, c, d);\n }\n function cf(a, b, c, d) {\n var e;\n for (e = 3; 0 < e; --e) (b += 4), hd(a, b, c, d);\n }\n function ea(a, b, c, d, e, f, g, h) {\n for (f = 2 * f + 1; 0 < e--; ) {\n if (ld(a, b, c, f, g))\n if (jd(a, b, c, h)) ab(a, b, c);\n else {\n var k = a,\n l = b,\n m = c,\n n = k[l - 2 * m],\n r = k[l - m],\n q = k[l + 0],\n t = k[l + m],\n v = k[l + 2 * m],\n p = Qb[1020 + 3 * (q - r) + Qb[1020 + n - t]],\n u = (27 * p + 63) >> 7,\n w = (18 * p + 63) >> 7,\n p = (9 * p + 63) >> 7;\n k[l - 3 * m] = R[255 + k[l - 3 * m] + p];\n k[l - 2 * m] = R[255 + n + w];\n k[l - m] = R[255 + r + u];\n k[l + 0] = R[255 + q - u];\n k[l + m] = R[255 + t - w];\n k[l + 2 * m] = R[255 + v - p];\n }\n b += d;\n }\n }\n function Fa(a, b, c, d, e, f, g, h) {\n for (f = 2 * f + 1; 0 < e--; ) {\n if (ld(a, b, c, f, g))\n if (jd(a, b, c, h)) ab(a, b, c);\n else {\n var k = a,\n l = b,\n m = c,\n n = k[l - m],\n r = k[l + 0],\n q = k[l + m],\n t = 3 * (r - n),\n v = mb[112 + ((t + 4) >> 3)],\n t = mb[112 + ((t + 3) >> 3)],\n p = (v + 1) >> 1;\n k[l - 2 * m] = R[255 + k[l - 2 * m] + p];\n k[l - m] = R[255 + n + t];\n k[l + 0] = R[255 + r - v];\n k[l + m] = R[255 + q - p];\n }\n b += d;\n }\n }\n function Ue(a, b, c, d, e, f) {\n ea(a, b, c, 1, 16, d, e, f);\n }\n function Ve(a, b, c, d, e, f) {\n ea(a, b, 1, c, 16, d, e, f);\n }\n function Ye(a, b, c, d, e, f) {\n var g;\n for (g = 3; 0 < g; --g) (b += 4 * c), Fa(a, b, c, 1, 16, d, e, f);\n }\n function Ze(a, b, c, d, e, f) {\n var g;\n for (g = 3; 0 < g; --g) (b += 4), Fa(a, b, 1, c, 16, d, e, f);\n }\n function We(a, b, c, d, e, f, g, h) {\n ea(a, b, e, 1, 8, f, g, h);\n ea(c, d, e, 1, 8, f, g, h);\n }\n function Xe(a, b, c, d, e, f, g, h) {\n ea(a, b, 1, e, 8, f, g, h);\n ea(c, d, 1, e, 8, f, g, h);\n }\n function $e(a, b, c, d, e, f, g, h) {\n Fa(a, b + 4 * e, e, 1, 8, f, g, h);\n Fa(c, d + 4 * e, e, 1, 8, f, g, h);\n }\n function af(a, b, c, d, e, f, g, h) {\n Fa(a, b + 4, 1, e, 8, f, g, h);\n Fa(c, d + 4, 1, e, 8, f, g, h);\n }\n function Cf() {\n this.ba = new Cb();\n this.ec = [];\n this.cc = [];\n this.Mc = [];\n this.Dc = this.Nc = this.dc = this.fc = 0;\n this.Oa = new Ud();\n this.memory = 0;\n this.Ib = \"OutputFunc\";\n this.Jb = \"OutputAlphaFunc\";\n this.Nd = \"OutputRowFunc\";\n }\n function md() {\n this.data = [];\n this.offset = this.kd = this.ha = this.w = 0;\n this.na = [];\n this.xa = this.gb = this.Ja = this.Sa = this.P = 0;\n }\n function Df() {\n this.nc = this.Ea = this.b = this.hc = 0;\n this.K = [];\n this.w = 0;\n }\n function Ef() {\n this.ua = 0;\n this.Wa = new ac();\n this.vb = new ac();\n this.md = this.xc = this.wc = 0;\n this.vc = [];\n this.Wb = 0;\n this.Ya = new Ub();\n this.yc = new O();\n }\n function je() {\n this.xb = this.a = 0;\n this.l = new Oa();\n this.ca = new Cb();\n this.V = [];\n this.Ba = 0;\n this.Ta = [];\n this.Ua = 0;\n this.m = new Ra();\n this.Pb = 0;\n this.wd = new Ra();\n this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0;\n this.s = new Ef();\n this.ab = 0;\n this.gc = wa(4, Df);\n this.Oc = 0;\n }\n function Ff() {\n this.Lc = this.Z = this.$a = this.i = this.c = 0;\n this.l = new Oa();\n this.ic = 0;\n this.ca = [];\n this.tb = 0;\n this.qd = null;\n this.rd = 0;\n }\n function Rb(a, b, c, d, e, f, g) {\n a = null == a ? 0 : a[b + 0];\n for (b = 0; b < g; ++b) (e[f + b] = (a + c[d + b]) & 255), (a = e[f + b]);\n }\n function Gf(a, b, c, d, e, f, g) {\n if (null == a) Rb(null, null, c, d, e, f, g);\n else {\n var h;\n for (h = 0; h < g; ++h) e[f + h] = (a[b + h] + c[d + h]) & 255;\n }\n }\n function Hf(a, b, c, d, e, f, g) {\n if (null == a) Rb(null, null, c, d, e, f, g);\n else {\n var h = a[b + 0],\n k = h,\n l = h,\n m;\n for (m = 0; m < g; ++m)\n (h = a[b + m]),\n (k = l + h - k),\n (l = (c[d + m] + (k & -256 ? (0 > k ? 0 : 255) : k)) & 255),\n (k = h),\n (e[f + m] = l);\n }\n }\n function Le(a, b, c, d) {\n var e = b.width,\n f = b.o;\n x(null != a && null != b);\n if (0 > c || 0 >= d || c + d > f) return null;\n if (!a.Cc) {\n if (null == a.ga) {\n a.ga = new Ff();\n var g;\n (g = null == a.ga) ||\n ((g = b.width * b.o),\n x(0 == a.Gb.length),\n (a.Gb = V(g)),\n (a.Uc = 0),\n null == a.Gb\n ? (g = 0)\n : ((a.mb = a.Gb), (a.nb = a.Uc), (a.rc = null), (g = 1)),\n (g = !g));\n if (!g) {\n g = a.ga;\n var h = a.Fa,\n k = a.P,\n l = a.qc,\n m = a.mb,\n n = a.nb,\n r = k + 1,\n q = l - 1,\n t = g.l;\n x(null != h && null != m && null != b);\n ia[0] = null;\n ia[1] = Rb;\n ia[2] = Gf;\n ia[3] = Hf;\n g.ca = m;\n g.tb = n;\n g.c = b.width;\n g.i = b.height;\n x(0 < g.c && 0 < g.i);\n if (1 >= l) b = 0;\n else if (\n ((g.$a = (h[k + 0] >> 0) & 3),\n (g.Z = (h[k + 0] >> 2) & 3),\n (g.Lc = (h[k + 0] >> 4) & 3),\n (k = (h[k + 0] >> 6) & 3),\n 0 > g.$a || 1 < g.$a || 4 <= g.Z || 1 < g.Lc || k)\n )\n b = 0;\n else if (\n ((t.put = kc),\n (t.ac = gc),\n (t.bc = lc),\n (t.ma = g),\n (t.width = b.width),\n (t.height = b.height),\n (t.Da = b.Da),\n (t.v = b.v),\n (t.va = b.va),\n (t.j = b.j),\n (t.o = b.o),\n g.$a)\n )\n b: {\n x(1 == g.$a), (b = Bc());\n c: for (;;) {\n if (null == b) {\n b = 0;\n break b;\n }\n x(null != g);\n g.mc = b;\n b.c = g.c;\n b.i = g.i;\n b.l = g.l;\n b.l.ma = g;\n b.l.width = g.c;\n b.l.height = g.i;\n b.a = 0;\n cb(b.m, h, r, q);\n if (!rb(g.c, g.i, 1, b, null)) break c;\n 1 == b.ab && 3 == b.gc[0].hc && yc(b.s)\n ? ((g.ic = 1),\n (h = b.c * b.i),\n (b.Ta = null),\n (b.Ua = 0),\n (b.V = V(h)),\n (b.Ba = 0),\n null == b.V ? ((b.a = 1), (b = 0)) : (b = 1))\n : ((g.ic = 0), (b = Ec(b, g.c)));\n if (!b) break c;\n b = 1;\n break b;\n }\n g.mc = null;\n b = 0;\n }\n else b = q >= g.c * g.i;\n g = !b;\n }\n if (g) return null;\n 1 != a.ga.Lc ? (a.Ga = 0) : (d = f - c);\n }\n x(null != a.ga);\n x(c + d <= f);\n a: {\n h = a.ga;\n b = h.c;\n f = h.l.o;\n if (0 == h.$a) {\n r = a.rc;\n q = a.Vc;\n t = a.Fa;\n k = a.P + 1 + c * b;\n l = a.mb;\n m = a.nb + c * b;\n x(k <= a.P + a.qc);\n if (0 != h.Z)\n for (x(null != ia[h.Z]), g = 0; g < d; ++g)\n ia[h.Z](r, q, t, k, l, m, b),\n (r = l),\n (q = m),\n (m += b),\n (k += b);\n else\n for (g = 0; g < d; ++g)\n I(l, m, t, k, b), (r = l), (q = m), (m += b), (k += b);\n a.rc = r;\n a.Vc = q;\n } else {\n x(null != h.mc);\n b = c + d;\n g = h.mc;\n x(null != g);\n x(b <= g.i);\n if (g.C >= b) b = 1;\n else if ((h.ic || Aa(), h.ic)) {\n var h = g.V,\n r = g.Ba,\n q = g.c,\n v = g.i,\n t = 1,\n k = g.$ / q,\n l = g.$ % q,\n m = g.m,\n n = g.s,\n p = g.$,\n u = q * v,\n w = q * b,\n y = n.wc,\n A = p < w ? ha(n, l, k) : null;\n x(p <= u);\n x(b <= v);\n x(yc(n));\n c: for (;;) {\n for (; !m.h && p < w; ) {\n l & y || (A = ha(n, l, k));\n x(null != A);\n Sa(m);\n v = ua(A.G[0], A.H[0], m);\n if (256 > v)\n (h[r + p] = v),\n ++p,\n ++l,\n l >= q && ((l = 0), ++k, k <= b && !(k % 16) && Ib(g, k));\n else if (280 > v) {\n var v = ib(v - 256, m);\n var E = ua(A.G[4], A.H[4], m);\n Sa(m);\n E = ib(E, m);\n E = nc(q, E);\n if (p >= E && u - p >= v) {\n var B;\n for (B = 0; B < v; ++B) h[r + p + B] = h[r + p + B - E];\n } else {\n t = 0;\n break c;\n }\n p += v;\n for (l += v; l >= q; )\n (l -= q), ++k, k <= b && !(k % 16) && Ib(g, k);\n p < w && l & y && (A = ha(n, l, k));\n } else {\n t = 0;\n break c;\n }\n x(m.h == db(m));\n }\n Ib(g, k > b ? b : k);\n break c;\n }\n !t || (m.h && p < u) ? ((t = 0), (g.a = m.h ? 5 : 3)) : (g.$ = p);\n b = t;\n } else b = Jb(g, g.V, g.Ba, g.c, g.i, b, se);\n if (!b) {\n d = 0;\n break a;\n }\n }\n c + d >= f && (a.Cc = 1);\n d = 1;\n }\n if (!d) return null;\n if (\n a.Cc &&\n ((d = a.ga), null != d && (d.mc = null), (a.ga = null), 0 < a.Ga)\n )\n return alert(\"todo:WebPDequantizeLevels\"), null;\n }\n return a.nb + c * e;\n }\n function If(a, b, c, d, e, f) {\n for (; 0 < e--; ) {\n var g = a,\n h = b + (c ? 1 : 0),\n k = a,\n l = b + (c ? 0 : 3),\n m;\n for (m = 0; m < d; ++m) {\n var n = k[l + 4 * m];\n 255 != n &&\n ((n *= 32897),\n (g[h + 4 * m + 0] = (g[h + 4 * m + 0] * n) >> 23),\n (g[h + 4 * m + 1] = (g[h + 4 * m + 1] * n) >> 23),\n (g[h + 4 * m + 2] = (g[h + 4 * m + 2] * n) >> 23));\n }\n b += f;\n }\n }\n function Jf(a, b, c, d, e) {\n for (; 0 < d--; ) {\n var f;\n for (f = 0; f < c; ++f) {\n var g = a[b + 2 * f + 0],\n h = a[b + 2 * f + 1],\n k = h & 15,\n l = 4369 * k,\n h = (((h & 240) | (h >> 4)) * l) >> 16;\n a[b + 2 * f + 0] =\n (((((g & 240) | (g >> 4)) * l) >> 16) & 240) |\n ((((((g & 15) | (g << 4)) * l) >> 16) >> 4) & 15);\n a[b + 2 * f + 1] = (h & 240) | k;\n }\n b += e;\n }\n }\n function Kf(a, b, c, d, e, f, g, h) {\n var k = 255,\n l,\n m;\n for (m = 0; m < e; ++m) {\n for (l = 0; l < d; ++l) {\n var n = a[b + l];\n f[g + 4 * l] = n;\n k &= n;\n }\n b += c;\n g += h;\n }\n return 255 != k;\n }\n function Lf(a, b, c, d, e) {\n var f;\n for (f = 0; f < e; ++f) c[d + f] = a[b + f] >> 8;\n }\n function Aa() {\n za = If;\n vc = Jf;\n fc = Kf;\n Fc = Lf;\n }\n function va(a, b, c) {\n self[a] = function(a, e, f, g, h, k, l, m, n, r, q, t, v, p, u, w, y) {\n var d,\n E = (y - 1) >> 1;\n var B = h[k + 0] | (l[m + 0] << 16);\n var C = n[r + 0] | (q[t + 0] << 16);\n x(null != a);\n var z = (3 * B + C + 131074) >> 2;\n b(a[e + 0], z & 255, z >> 16, v, p);\n null != f &&\n ((z = (3 * C + B + 131074) >> 2),\n b(f[g + 0], z & 255, z >> 16, u, w));\n for (d = 1; d <= E; ++d) {\n var D = h[k + d] | (l[m + d] << 16);\n var G = n[r + d] | (q[t + d] << 16);\n var F = B + D + C + G + 524296;\n var H = (F + 2 * (D + C)) >> 3;\n F = (F + 2 * (B + G)) >> 3;\n z = (H + B) >> 1;\n B = (F + D) >> 1;\n b(a[e + 2 * d - 1], z & 255, z >> 16, v, p + (2 * d - 1) * c);\n b(a[e + 2 * d - 0], B & 255, B >> 16, v, p + (2 * d - 0) * c);\n null != f &&\n ((z = (F + C) >> 1),\n (B = (H + G) >> 1),\n b(f[g + 2 * d - 1], z & 255, z >> 16, u, w + (2 * d - 1) * c),\n b(f[g + 2 * d + 0], B & 255, B >> 16, u, w + (2 * d + 0) * c));\n B = D;\n C = G;\n }\n y & 1 ||\n ((z = (3 * B + C + 131074) >> 2),\n b(a[e + y - 1], z & 255, z >> 16, v, p + (y - 1) * c),\n null != f &&\n ((z = (3 * C + B + 131074) >> 2),\n b(f[g + y - 1], z & 255, z >> 16, u, w + (y - 1) * c)));\n };\n }\n function ic() {\n P[Ca] = Mf;\n P[Ua] = nd;\n P[tc] = Nf;\n P[Va] = od;\n P[ya] = pd;\n P[Db] = qd;\n P[wc] = Of;\n P[zb] = nd;\n P[Ab] = od;\n P[Ja] = pd;\n P[Bb] = qd;\n }\n function Sb(a) {\n return a & ~Pf ? (0 > a ? 0 : 255) : a >> rd;\n }\n function bb(a, b) {\n return Sb(((19077 * a) >> 8) + ((26149 * b) >> 8) - 14234);\n }\n function nb(a, b, c) {\n return Sb(\n ((19077 * a) >> 8) - ((6419 * b) >> 8) - ((13320 * c) >> 8) + 8708\n );\n }\n function Pa(a, b) {\n return Sb(((19077 * a) >> 8) + ((33050 * b) >> 8) - 17685);\n }\n function Ga(a, b, c, d, e) {\n d[e + 0] = bb(a, c);\n d[e + 1] = nb(a, b, c);\n d[e + 2] = Pa(a, b);\n }\n function Tb(a, b, c, d, e) {\n d[e + 0] = Pa(a, b);\n d[e + 1] = nb(a, b, c);\n d[e + 2] = bb(a, c);\n }\n function sd(a, b, c, d, e) {\n var f = nb(a, b, c);\n b = ((f << 3) & 224) | (Pa(a, b) >> 3);\n d[e + 0] = (bb(a, c) & 248) | (f >> 5);\n d[e + 1] = b;\n }\n function td(a, b, c, d, e) {\n var f = (Pa(a, b) & 240) | 15;\n d[e + 0] = (bb(a, c) & 240) | (nb(a, b, c) >> 4);\n d[e + 1] = f;\n }\n function ud(a, b, c, d, e) {\n d[e + 0] = 255;\n Ga(a, b, c, d, e + 1);\n }\n function vd(a, b, c, d, e) {\n Tb(a, b, c, d, e);\n d[e + 3] = 255;\n }\n function wd(a, b, c, d, e) {\n Ga(a, b, c, d, e);\n d[e + 3] = 255;\n }\n function ga(a, b) {\n return 0 > a ? 0 : a > b ? b : a;\n }\n function la(a, b, c) {\n self[a] = function(a, e, f, g, h, k, l, m, n) {\n for (var d = m + (n & -2) * c; m != d; )\n b(a[e + 0], f[g + 0], h[k + 0], l, m),\n b(a[e + 1], f[g + 0], h[k + 0], l, m + c),\n (e += 2),\n ++g,\n ++k,\n (m += 2 * c);\n n & 1 && b(a[e + 0], f[g + 0], h[k + 0], l, m);\n };\n }\n function xd(a, b, c) {\n return 0 == c ? (0 == a ? (0 == b ? 6 : 5) : 0 == b ? 4 : 0) : c;\n }\n function yd(a, b, c, d, e) {\n switch (a >>> 30) {\n case 3:\n Za(b, c, d, e, 0);\n break;\n case 2:\n fd(b, c, d, e);\n break;\n case 1:\n pa(b, c, d, e);\n }\n }\n function Oc(a, b) {\n var c,\n d,\n e = b.M,\n f = b.Nb,\n g = a.oc,\n h = a.pc + 40,\n k = a.oc,\n l = a.pc + 584,\n m = a.oc,\n n = a.pc + 600;\n for (c = 0; 16 > c; ++c) g[h + 32 * c - 1] = 129;\n for (c = 0; 8 > c; ++c)\n (k[l + 32 * c - 1] = 129), (m[n + 32 * c - 1] = 129);\n 0 < e\n ? (g[h - 1 - 32] = k[l - 1 - 32] = m[n - 1 - 32] = 129)\n : (M(g, h - 32 - 1, 127, 21),\n M(k, l - 32 - 1, 127, 9),\n M(m, n - 32 - 1, 127, 9));\n for (d = 0; d < a.za; ++d) {\n var r = b.ya[b.aa + d];\n if (0 < d) {\n for (c = -1; 16 > c; ++c) I(g, h + 32 * c - 4, g, h + 32 * c + 12, 4);\n for (c = -1; 8 > c; ++c)\n I(k, l + 32 * c - 4, k, l + 32 * c + 4, 4),\n I(m, n + 32 * c - 4, m, n + 32 * c + 4, 4);\n }\n var q = a.Gd,\n t = a.Hd + d,\n v = r.ad,\n p = r.Hc;\n 0 < e &&\n (I(g, h - 32, q[t].y, 0, 16),\n I(k, l - 32, q[t].f, 0, 8),\n I(m, n - 32, q[t].ea, 0, 8));\n if (r.Za) {\n var u = g;\n var w = h - 32 + 16;\n 0 < e &&\n (d >= a.za - 1\n ? M(u, w, q[t].y[15], 4)\n : I(u, w, q[t + 1].y, 0, 4));\n for (c = 0; 4 > c; c++)\n u[w + 128 + c] = u[w + 256 + c] = u[w + 384 + c] = u[w + 0 + c];\n for (c = 0; 16 > c; ++c, p <<= 2)\n (u = g), (w = h + zd[c]), W[r.Ob[c]](u, w), yd(p, v, 16 * +c, u, w);\n } else if (((u = xd(d, e, r.Ob[0])), Y[u](g, h), 0 != p))\n for (c = 0; 16 > c; ++c, p <<= 2) yd(p, v, 16 * +c, g, h + zd[c]);\n c = r.Gc;\n u = xd(d, e, r.Dd);\n ka[u](k, l);\n ka[u](m, n);\n r = c >> 0;\n p = v;\n u = k;\n w = l;\n r & 255 && (r & 170 ? Nb(p, 256, u, w) : Ob(p, 256, u, w));\n c >>= 8;\n r = m;\n p = n;\n c & 255 && (c & 170 ? Nb(v, 320, r, p) : Ob(v, 320, r, p));\n e < a.Ub - 1 &&\n (I(q[t].y, 0, g, h + 480, 16),\n I(q[t].f, 0, k, l + 224, 8),\n I(q[t].ea, 0, m, n + 224, 8));\n c = 8 * f * a.B;\n q = a.sa;\n t = a.ta + 16 * d + 16 * f * a.R;\n v = a.qa;\n r = a.ra + 8 * d + c;\n p = a.Ha;\n u = a.Ia + 8 * d + c;\n for (c = 0; 16 > c; ++c) I(q, t + c * a.R, g, h + 32 * c, 16);\n for (c = 0; 8 > c; ++c)\n I(v, r + c * a.B, k, l + 32 * c, 8),\n I(p, u + c * a.B, m, n + 32 * c, 8);\n }\n }\n function Ad(a, b, c, d, e, f, g, h, k) {\n var l = [0],\n m = [0],\n n = 0,\n r = null != k ? k.kd : 0,\n q = null != k ? k : new md();\n if (null == a || 12 > c) return 7;\n q.data = a;\n q.w = b;\n q.ha = c;\n b = [b];\n c = [c];\n q.gb = [q.gb];\n a: {\n var t = b;\n var v = c;\n var p = q.gb;\n x(null != a);\n x(null != v);\n x(null != p);\n p[0] = 0;\n if (12 <= v[0] && !fa(a, t[0], \"RIFF\")) {\n if (fa(a, t[0] + 8, \"WEBP\")) {\n p = 3;\n break a;\n }\n var u = Ha(a, t[0] + 4);\n if (12 > u || 4294967286 < u) {\n p = 3;\n break a;\n }\n if (r && u > v[0] - 8) {\n p = 7;\n break a;\n }\n p[0] = u;\n t[0] += 12;\n v[0] -= 12;\n }\n p = 0;\n }\n if (0 != p) return p;\n u = 0 < q.gb[0];\n for (c = c[0]; ; ) {\n t = [0];\n n = [n];\n a: {\n var w = a;\n v = b;\n p = c;\n var y = n,\n A = l,\n z = m,\n B = t;\n y[0] = 0;\n if (8 > p[0]) p = 7;\n else {\n if (!fa(w, v[0], \"VP8X\")) {\n if (10 != Ha(w, v[0] + 4)) {\n p = 3;\n break a;\n }\n if (18 > p[0]) {\n p = 7;\n break a;\n }\n var C = Ha(w, v[0] + 8);\n var D = 1 + Yb(w, v[0] + 12);\n w = 1 + Yb(w, v[0] + 15);\n if (2147483648 <= D * w) {\n p = 3;\n break a;\n }\n null != B && (B[0] = C);\n null != A && (A[0] = D);\n null != z && (z[0] = w);\n v[0] += 18;\n p[0] -= 18;\n y[0] = 1;\n }\n p = 0;\n }\n }\n n = n[0];\n t = t[0];\n if (0 != p) return p;\n v = !!(t & 2);\n if (!u && n) return 3;\n null != f && (f[0] = !!(t & 16));\n null != g && (g[0] = v);\n null != h && (h[0] = 0);\n g = l[0];\n t = m[0];\n if (n && v && null == k) {\n p = 0;\n break;\n }\n if (4 > c) {\n p = 7;\n break;\n }\n if ((u && n) || (!u && !n && !fa(a, b[0], \"ALPH\"))) {\n c = [c];\n q.na = [q.na];\n q.P = [q.P];\n q.Sa = [q.Sa];\n a: {\n C = a;\n p = b;\n u = c;\n var y = q.gb,\n A = q.na,\n z = q.P,\n B = q.Sa;\n D = 22;\n x(null != C);\n x(null != u);\n w = p[0];\n var F = u[0];\n x(null != A);\n x(null != B);\n A[0] = null;\n z[0] = null;\n for (B[0] = 0; ; ) {\n p[0] = w;\n u[0] = F;\n if (8 > F) {\n p = 7;\n break a;\n }\n var G = Ha(C, w + 4);\n if (4294967286 < G) {\n p = 3;\n break a;\n }\n var H = (8 + G + 1) & -2;\n D += H;\n if (0 < y && D > y) {\n p = 3;\n break a;\n }\n if (!fa(C, w, \"VP8 \") || !fa(C, w, \"VP8L\")) {\n p = 0;\n break a;\n }\n if (F[0] < H) {\n p = 7;\n break a;\n }\n fa(C, w, \"ALPH\") || ((A[0] = C), (z[0] = w + 8), (B[0] = G));\n w += H;\n F -= H;\n }\n }\n c = c[0];\n q.na = q.na[0];\n q.P = q.P[0];\n q.Sa = q.Sa[0];\n if (0 != p) break;\n }\n c = [c];\n q.Ja = [q.Ja];\n q.xa = [q.xa];\n a: if (\n ((y = a),\n (p = b),\n (u = c),\n (A = q.gb[0]),\n (z = q.Ja),\n (B = q.xa),\n (C = p[0]),\n (w = !fa(y, C, \"VP8 \")),\n (D = !fa(y, C, \"VP8L\")),\n x(null != y),\n x(null != u),\n x(null != z),\n x(null != B),\n 8 > u[0])\n )\n p = 7;\n else {\n if (w || D) {\n y = Ha(y, C + 4);\n if (12 <= A && y > A - 12) {\n p = 3;\n break a;\n }\n if (r && y > u[0] - 8) {\n p = 7;\n break a;\n }\n z[0] = y;\n p[0] += 8;\n u[0] -= 8;\n B[0] = D;\n } else\n (B[0] = 5 <= u[0] && 47 == y[C + 0] && !(y[C + 4] >> 5)),\n (z[0] = u[0]);\n p = 0;\n }\n c = c[0];\n q.Ja = q.Ja[0];\n q.xa = q.xa[0];\n b = b[0];\n if (0 != p) break;\n if (4294967286 < q.Ja) return 3;\n null == h || v || (h[0] = q.xa ? 2 : 1);\n g = [g];\n t = [t];\n if (q.xa) {\n if (5 > c) {\n p = 7;\n break;\n }\n h = g;\n r = t;\n v = f;\n null == a || 5 > c\n ? (a = 0)\n : 5 <= c && 47 == a[b + 0] && !(a[b + 4] >> 5)\n ? ((u = [0]),\n (y = [0]),\n (A = [0]),\n (z = new Ra()),\n cb(z, a, b, c),\n mc(z, u, y, A)\n ? (null != h && (h[0] = u[0]),\n null != r && (r[0] = y[0]),\n null != v && (v[0] = A[0]),\n (a = 1))\n : (a = 0))\n : (a = 0);\n } else {\n if (10 > c) {\n p = 7;\n break;\n }\n h = t;\n null == a || 10 > c || !Jc(a, b + 3, c - 3)\n ? (a = 0)\n : ((r = a[b + 0] | (a[b + 1] << 8) | (a[b + 2] << 16)),\n (v = ((a[b + 7] << 8) | a[b + 6]) & 16383),\n (a = ((a[b + 9] << 8) | a[b + 8]) & 16383),\n r & 1 ||\n 3 < ((r >> 1) & 7) ||\n !((r >> 4) & 1) ||\n r >> 5 >= q.Ja ||\n !v ||\n !a\n ? (a = 0)\n : (g && (g[0] = v), h && (h[0] = a), (a = 1)));\n }\n if (!a) return 3;\n g = g[0];\n t = t[0];\n if (n && (l[0] != g || m[0] != t)) return 3;\n null != k &&\n ((k[0] = q),\n (k.offset = b - k.w),\n x(4294967286 > b - k.w),\n x(k.offset == k.ha - c));\n break;\n }\n return 0 == p || (7 == p && n && null == k)\n ? (null != f && (f[0] |= null != q.na && 0 < q.na.length),\n null != d && (d[0] = g),\n null != e && (e[0] = t),\n 0)\n : p;\n }\n function hc(a, b, c) {\n var d = b.width,\n e = b.height,\n f = 0,\n g = 0,\n h = d,\n k = e;\n b.Da = null != a && 0 < a.Da;\n if (\n b.Da &&\n ((h = a.cd),\n (k = a.bd),\n (f = a.v),\n (g = a.j),\n 11 > c || ((f &= -2), (g &= -2)),\n 0 > f || 0 > g || 0 >= h || 0 >= k || f + h > d || g + k > e)\n )\n return 0;\n b.v = f;\n b.j = g;\n b.va = f + h;\n b.o = g + k;\n b.U = h;\n b.T = k;\n b.da = null != a && 0 < a.da;\n if (b.da) {\n c = [a.ib];\n f = [a.hb];\n if (!bc(h, k, c, f)) return 0;\n b.ib = c[0];\n b.hb = f[0];\n }\n b.ob = null != a && a.ob;\n b.Kb = null == a || !a.Sd;\n b.da && ((b.ob = b.ib < (3 * d) / 4 && b.hb < (3 * e) / 4), (b.Kb = 0));\n return 1;\n }\n function Bd(a) {\n if (null == a) return 2;\n if (11 > a.S) {\n var b = a.f.RGBA;\n b.fb += (a.height - 1) * b.A;\n b.A = -b.A;\n } else\n (b = a.f.kb),\n (a = a.height),\n (b.O += (a - 1) * b.fa),\n (b.fa = -b.fa),\n (b.N += ((a - 1) >> 1) * b.Ab),\n (b.Ab = -b.Ab),\n (b.W += ((a - 1) >> 1) * b.Db),\n (b.Db = -b.Db),\n null != b.F && ((b.J += (a - 1) * b.lb), (b.lb = -b.lb));\n return 0;\n }\n function Cd(a, b, c, d) {\n if (null == d || 0 >= a || 0 >= b) return 2;\n if (null != c) {\n if (c.Da) {\n var e = c.cd,\n f = c.bd,\n g = c.v & -2,\n h = c.j & -2;\n if (0 > g || 0 > h || 0 >= e || 0 >= f || g + e > a || h + f > b)\n return 2;\n a = e;\n b = f;\n }\n if (c.da) {\n e = [c.ib];\n f = [c.hb];\n if (!bc(a, b, e, f)) return 2;\n a = e[0];\n b = f[0];\n }\n }\n d.width = a;\n d.height = b;\n a: {\n var k = d.width;\n var l = d.height;\n a = d.S;\n if (0 >= k || 0 >= l || !(a >= Ca && 13 > a)) a = 2;\n else {\n if (0 >= d.Rd && null == d.sd) {\n var g = (f = e = b = 0),\n h = k * Dd[a],\n m = h * l;\n 11 > a ||\n ((b = (k + 1) / 2),\n (f = ((l + 1) / 2) * b),\n 12 == a && ((e = k), (g = e * l)));\n l = V(m + 2 * f + g);\n if (null == l) {\n a = 1;\n break a;\n }\n d.sd = l;\n 11 > a\n ? ((k = d.f.RGBA),\n (k.eb = l),\n (k.fb = 0),\n (k.A = h),\n (k.size = m))\n : ((k = d.f.kb),\n (k.y = l),\n (k.O = 0),\n (k.fa = h),\n (k.Fd = m),\n (k.f = l),\n (k.N = 0 + m),\n (k.Ab = b),\n (k.Cd = f),\n (k.ea = l),\n (k.W = 0 + m + f),\n (k.Db = b),\n (k.Ed = f),\n 12 == a && ((k.F = l), (k.J = 0 + m + 2 * f)),\n (k.Tc = g),\n (k.lb = e));\n }\n b = 1;\n e = d.S;\n f = d.width;\n g = d.height;\n if (e >= Ca && 13 > e)\n if (11 > e)\n (a = d.f.RGBA),\n (h = Math.abs(a.A)),\n (b &= h * (g - 1) + f <= a.size),\n (b &= h >= f * Dd[e]),\n (b &= null != a.eb);\n else {\n a = d.f.kb;\n h = (f + 1) / 2;\n m = (g + 1) / 2;\n k = Math.abs(a.fa);\n var l = Math.abs(a.Ab),\n n = Math.abs(a.Db),\n r = Math.abs(a.lb),\n q = r * (g - 1) + f;\n b &= k * (g - 1) + f <= a.Fd;\n b &= l * (m - 1) + h <= a.Cd;\n b &= n * (m - 1) + h <= a.Ed;\n b = b & (k >= f) & (l >= h) & (n >= h);\n b &= null != a.y;\n b &= null != a.f;\n b &= null != a.ea;\n 12 == e && ((b &= r >= f), (b &= q <= a.Tc), (b &= null != a.F));\n }\n else b = 0;\n a = b ? 0 : 2;\n }\n }\n if (0 != a) return a;\n null != c && c.fd && (a = Bd(d));\n return a;\n }\n var xb = 64,\n Hd = [\n 0,\n 1,\n 3,\n 7,\n 15,\n 31,\n 63,\n 127,\n 255,\n 511,\n 1023,\n 2047,\n 4095,\n 8191,\n 16383,\n 32767,\n 65535,\n 131071,\n 262143,\n 524287,\n 1048575,\n 2097151,\n 4194303,\n 8388607,\n 16777215\n ],\n Gd = 24,\n ob = 32,\n Xb = 8,\n Id = [\n 0,\n 0,\n 1,\n 1,\n 2,\n 2,\n 2,\n 2,\n 3,\n 3,\n 3,\n 3,\n 3,\n 3,\n 3,\n 3,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7\n ];\n X(\"Predictor0\", \"PredictorAdd0\");\n self.Predictor0 = function() {\n return 4278190080;\n };\n self.Predictor1 = function(a) {\n return a;\n };\n self.Predictor2 = function(a, b, c) {\n return b[c + 0];\n };\n self.Predictor3 = function(a, b, c) {\n return b[c + 1];\n };\n self.Predictor4 = function(a, b, c) {\n return b[c - 1];\n };\n self.Predictor5 = function(a, b, c) {\n return aa(aa(a, b[c + 1]), b[c + 0]);\n };\n self.Predictor6 = function(a, b, c) {\n return aa(a, b[c - 1]);\n };\n self.Predictor7 = function(a, b, c) {\n return aa(a, b[c + 0]);\n };\n self.Predictor8 = function(a, b, c) {\n return aa(b[c - 1], b[c + 0]);\n };\n self.Predictor9 = function(a, b, c) {\n return aa(b[c + 0], b[c + 1]);\n };\n self.Predictor10 = function(a, b, c) {\n return aa(aa(a, b[c - 1]), aa(b[c + 0], b[c + 1]));\n };\n self.Predictor11 = function(a, b, c) {\n var d = b[c + 0];\n b = b[c - 1];\n return 0 >=\n Ia((d >> 24) & 255, (a >> 24) & 255, (b >> 24) & 255) +\n Ia((d >> 16) & 255, (a >> 16) & 255, (b >> 16) & 255) +\n Ia((d >> 8) & 255, (a >> 8) & 255, (b >> 8) & 255) +\n Ia(d & 255, a & 255, b & 255)\n ? d\n : a;\n };\n self.Predictor12 = function(a, b, c) {\n var d = b[c + 0];\n b = b[c - 1];\n return (\n ((sa(((a >> 24) & 255) + ((d >> 24) & 255) - ((b >> 24) & 255)) << 24) |\n (sa(((a >> 16) & 255) + ((d >> 16) & 255) - ((b >> 16) & 255)) <<\n 16) |\n (sa(((a >> 8) & 255) + ((d >> 8) & 255) - ((b >> 8) & 255)) << 8) |\n sa((a & 255) + (d & 255) - (b & 255))) >>>\n 0\n );\n };\n self.Predictor13 = function(a, b, c) {\n var d = b[c - 1];\n a = aa(a, b[c + 0]);\n return (\n ((eb((a >> 24) & 255, (d >> 24) & 255) << 24) |\n (eb((a >> 16) & 255, (d >> 16) & 255) << 16) |\n (eb((a >> 8) & 255, (d >> 8) & 255) << 8) |\n eb((a >> 0) & 255, (d >> 0) & 255)) >>>\n 0\n );\n };\n var ee = self.PredictorAdd0;\n self.PredictorAdd1 = cc;\n X(\"Predictor2\", \"PredictorAdd2\");\n X(\"Predictor3\", \"PredictorAdd3\");\n X(\"Predictor4\", \"PredictorAdd4\");\n X(\"Predictor5\", \"PredictorAdd5\");\n X(\"Predictor6\", \"PredictorAdd6\");\n X(\"Predictor7\", \"PredictorAdd7\");\n X(\"Predictor8\", \"PredictorAdd8\");\n X(\"Predictor9\", \"PredictorAdd9\");\n X(\"Predictor10\", \"PredictorAdd10\");\n X(\"Predictor11\", \"PredictorAdd11\");\n X(\"Predictor12\", \"PredictorAdd12\");\n X(\"Predictor13\", \"PredictorAdd13\");\n var fe = self.PredictorAdd2;\n ec(\n \"ColorIndexInverseTransform\",\n \"MapARGB\",\n \"32b\",\n function(a) {\n return (a >> 8) & 255;\n },\n function(a) {\n return a;\n }\n );\n ec(\n \"VP8LColorIndexInverseTransformAlpha\",\n \"MapAlpha\",\n \"8b\",\n function(a) {\n return a;\n },\n function(a) {\n return (a >> 8) & 255;\n }\n );\n var rc = self.ColorIndexInverseTransform,\n ke = self.MapARGB,\n he = self.VP8LColorIndexInverseTransformAlpha,\n le = self.MapAlpha,\n pc,\n qc = (self.VP8LPredictorsAdd = []);\n qc.length = 16;\n (self.VP8LPredictors = []).length = 16;\n (self.VP8LPredictorsAdd_C = []).length = 16;\n (self.VP8LPredictors_C = []).length = 16;\n var Fb,\n sc,\n Gb,\n Hb,\n xc,\n uc,\n bd = V(511),\n cd = V(2041),\n dd = V(225),\n ed = V(767),\n ad = 0,\n Qb = cd,\n mb = dd,\n R = ed,\n U = bd,\n Ca = 0,\n Ua = 1,\n tc = 2,\n Va = 3,\n ya = 4,\n Db = 5,\n wc = 6,\n zb = 7,\n Ab = 8,\n Ja = 9,\n Bb = 10,\n pe = [2, 3, 7],\n oe = [3, 3, 11],\n Dc = [280, 256, 256, 256, 40],\n qe = [0, 1, 1, 1, 0],\n ne = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],\n de = [\n 24,\n 7,\n 23,\n 25,\n 40,\n 6,\n 39,\n 41,\n 22,\n 26,\n 38,\n 42,\n 56,\n 5,\n 55,\n 57,\n 21,\n 27,\n 54,\n 58,\n 37,\n 43,\n 72,\n 4,\n 71,\n 73,\n 20,\n 28,\n 53,\n 59,\n 70,\n 74,\n 36,\n 44,\n 88,\n 69,\n 75,\n 52,\n 60,\n 3,\n 87,\n 89,\n 19,\n 29,\n 86,\n 90,\n 35,\n 45,\n 68,\n 76,\n 85,\n 91,\n 51,\n 61,\n 104,\n 2,\n 103,\n 105,\n 18,\n 30,\n 102,\n 106,\n 34,\n 46,\n 84,\n 92,\n 67,\n 77,\n 101,\n 107,\n 50,\n 62,\n 120,\n 1,\n 119,\n 121,\n 83,\n 93,\n 17,\n 31,\n 100,\n 108,\n 66,\n 78,\n 118,\n 122,\n 33,\n 47,\n 117,\n 123,\n 49,\n 63,\n 99,\n 109,\n 82,\n 94,\n 0,\n 116,\n 124,\n 65,\n 79,\n 16,\n 32,\n 98,\n 110,\n 48,\n 115,\n 125,\n 81,\n 95,\n 64,\n 114,\n 126,\n 97,\n 111,\n 80,\n 113,\n 127,\n 96,\n 112\n ],\n me = [\n 2954,\n 2956,\n 2958,\n 2962,\n 2970,\n 2986,\n 3018,\n 3082,\n 3212,\n 3468,\n 3980,\n 5004\n ],\n ie = 8,\n Lb = [\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 17,\n 18,\n 19,\n 20,\n 20,\n 21,\n 21,\n 22,\n 22,\n 23,\n 23,\n 24,\n 25,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 91,\n 93,\n 95,\n 96,\n 98,\n 100,\n 101,\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 143,\n 145,\n 148,\n 151,\n 154,\n 157\n ],\n Mb = [\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 60,\n 62,\n 64,\n 66,\n 68,\n 70,\n 72,\n 74,\n 76,\n 78,\n 80,\n 82,\n 84,\n 86,\n 88,\n 90,\n 92,\n 94,\n 96,\n 98,\n 100,\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 119,\n 122,\n 125,\n 128,\n 131,\n 134,\n 137,\n 140,\n 143,\n 146,\n 149,\n 152,\n 155,\n 158,\n 161,\n 164,\n 167,\n 170,\n 173,\n 177,\n 181,\n 185,\n 189,\n 193,\n 197,\n 201,\n 205,\n 209,\n 213,\n 217,\n 221,\n 225,\n 229,\n 234,\n 239,\n 245,\n 249,\n 254,\n 259,\n 264,\n 269,\n 274,\n 279,\n 284\n ],\n oa = null,\n He = [\n [173, 148, 140, 0],\n [176, 155, 140, 135, 0],\n [180, 157, 141, 134, 130, 0],\n [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]\n ],\n Ie = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15],\n Mc = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9],\n Fe = [\n [\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n ],\n [\n [253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128],\n [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128],\n [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]\n ],\n [\n [1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128],\n [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128],\n [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]\n ],\n [\n [1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128],\n [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128],\n [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]\n ],\n [\n [1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128],\n [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128],\n [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]\n ],\n [\n [1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128],\n [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128],\n [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]\n ],\n [\n [1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128],\n [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128],\n [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]\n ],\n [\n [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n ]\n ],\n [\n [\n [198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62],\n [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1],\n [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]\n ],\n [\n [1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128],\n [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128],\n [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]\n ],\n [\n [1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128],\n [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128],\n [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]\n ],\n [\n [1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128],\n [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128],\n [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]\n ],\n [\n [1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128],\n [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128],\n [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]\n ],\n [\n [1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128],\n [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128],\n [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]\n ],\n [\n [1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128],\n [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128],\n [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]\n ],\n [\n [1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128],\n [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]\n ]\n ],\n [\n [\n [253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128],\n [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128],\n [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]\n ],\n [\n [1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128],\n [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128],\n [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]\n ],\n [\n [1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128],\n [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128],\n [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]\n ],\n [\n [1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128],\n [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128],\n [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]\n ],\n [\n [1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128],\n [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n ],\n [\n [1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n ],\n [\n [1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128],\n [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128],\n [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n ],\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n ]\n ],\n [\n [\n [202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255],\n [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128],\n [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]\n ],\n [\n [1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128],\n [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128],\n [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]\n ],\n [\n [1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128],\n [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128],\n [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]\n ],\n [\n [1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128],\n [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128],\n [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]\n ],\n [\n [1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128],\n [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128],\n [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]\n ],\n [\n [1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128],\n [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128],\n [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]\n ],\n [\n [1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128],\n [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128],\n [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]\n ],\n [\n [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n ]\n ]\n ],\n Ke = [\n [\n [231, 120, 48, 89, 115, 113, 120, 152, 112],\n [152, 179, 64, 126, 170, 118, 46, 70, 95],\n [175, 69, 143, 80, 85, 82, 72, 155, 103],\n [56, 58, 10, 171, 218, 189, 17, 13, 152],\n [114, 26, 17, 163, 44, 195, 21, 10, 173],\n [121, 24, 80, 195, 26, 62, 44, 64, 85],\n [144, 71, 10, 38, 171, 213, 144, 34, 26],\n [170, 46, 55, 19, 136, 160, 33, 206, 71],\n [63, 20, 8, 114, 114, 208, 12, 9, 226],\n [81, 40, 11, 96, 182, 84, 29, 16, 36]\n ],\n [\n [134, 183, 89, 137, 98, 101, 106, 165, 148],\n [72, 187, 100, 130, 157, 111, 32, 75, 80],\n [66, 102, 167, 99, 74, 62, 40, 234, 128],\n [41, 53, 9, 178, 241, 141, 26, 8, 107],\n [74, 43, 26, 146, 73, 166, 49, 23, 157],\n [65, 38, 105, 160, 51, 52, 31, 115, 128],\n [104, 79, 12, 27, 217, 255, 87, 17, 7],\n [87, 68, 71, 44, 114, 51, 15, 186, 23],\n [47, 41, 14, 110, 182, 183, 21, 17, 194],\n [66, 45, 25, 102, 197, 189, 23, 18, 22]\n ],\n [\n [88, 88, 147, 150, 42, 46, 45, 196, 205],\n [43, 97, 183, 117, 85, 38, 35, 179, 61],\n [39, 53, 200, 87, 26, 21, 43, 232, 171],\n [56, 34, 51, 104, 114, 102, 29, 93, 77],\n [39, 28, 85, 171, 58, 165, 90, 98, 64],\n [34, 22, 116, 206, 23, 34, 43, 166, 73],\n [107, 54, 32, 26, 51, 1, 81, 43, 31],\n [68, 25, 106, 22, 64, 171, 36, 225, 114],\n [34, 19, 21, 102, 132, 188, 16, 76, 124],\n [62, 18, 78, 95, 85, 57, 50, 48, 51]\n ],\n [\n [193, 101, 35, 159, 215, 111, 89, 46, 111],\n [60, 148, 31, 172, 219, 228, 21, 18, 111],\n [112, 113, 77, 85, 179, 255, 38, 120, 114],\n [40, 42, 1, 196, 245, 209, 10, 25, 109],\n [88, 43, 29, 140, 166, 213, 37, 43, 154],\n [61, 63, 30, 155, 67, 45, 68, 1, 209],\n [100, 80, 8, 43, 154, 1, 51, 26, 71],\n [142, 78, 78, 16, 255, 128, 34, 197, 171],\n [41, 40, 5, 102, 211, 183, 4, 1, 221],\n [51, 50, 17, 168, 209, 192, 23, 25, 82]\n ],\n [\n [138, 31, 36, 171, 27, 166, 38, 44, 229],\n [67, 87, 58, 169, 82, 115, 26, 59, 179],\n [63, 59, 90, 180, 59, 166, 93, 73, 154],\n [40, 40, 21, 116, 143, 209, 34, 39, 175],\n [47, 15, 16, 183, 34, 223, 49, 45, 183],\n [46, 17, 33, 183, 6, 98, 15, 32, 183],\n [57, 46, 22, 24, 128, 1, 54, 17, 37],\n [65, 32, 73, 115, 28, 128, 23, 128, 205],\n [40, 3, 9, 115, 51, 192, 18, 6, 223],\n [87, 37, 9, 115, 59, 77, 64, 21, 47]\n ],\n [\n [104, 55, 44, 218, 9, 54, 53, 130, 226],\n [64, 90, 70, 205, 40, 41, 23, 26, 57],\n [54, 57, 112, 184, 5, 41, 38, 166, 213],\n [30, 34, 26, 133, 152, 116, 10, 32, 134],\n [39, 19, 53, 221, 26, 114, 32, 73, 255],\n [31, 9, 65, 234, 2, 15, 1, 118, 73],\n [75, 32, 12, 51, 192, 255, 160, 43, 51],\n [88, 31, 35, 67, 102, 85, 55, 186, 85],\n [56, 21, 23, 111, 59, 205, 45, 37, 192],\n [55, 38, 70, 124, 73, 102, 1, 34, 98]\n ],\n [\n [125, 98, 42, 88, 104, 85, 117, 175, 82],\n [95, 84, 53, 89, 128, 100, 113, 101, 45],\n [75, 79, 123, 47, 51, 128, 81, 171, 1],\n [57, 17, 5, 71, 102, 57, 53, 41, 49],\n [38, 33, 13, 121, 57, 73, 26, 1, 85],\n [41, 10, 67, 138, 77, 110, 90, 47, 114],\n [115, 21, 2, 10, 102, 255, 166, 23, 6],\n [101, 29, 16, 10, 85, 128, 101, 196, 26],\n [57, 18, 10, 102, 102, 213, 34, 20, 43],\n [117, 20, 15, 36, 163, 128, 68, 1, 26]\n ],\n [\n [102, 61, 71, 37, 34, 53, 31, 243, 192],\n [69, 60, 71, 38, 73, 119, 28, 222, 37],\n [68, 45, 128, 34, 1, 47, 11, 245, 171],\n [62, 17, 19, 70, 146, 85, 55, 62, 70],\n [37, 43, 37, 154, 100, 163, 85, 160, 1],\n [63, 9, 92, 136, 28, 64, 32, 201, 85],\n [75, 15, 9, 9, 64, 255, 184, 119, 16],\n [86, 6, 28, 5, 64, 255, 25, 248, 1],\n [56, 8, 17, 132, 137, 255, 55, 116, 128],\n [58, 15, 20, 82, 135, 57, 26, 121, 40]\n ],\n [\n [164, 50, 31, 137, 154, 133, 25, 35, 218],\n [51, 103, 44, 131, 131, 123, 31, 6, 158],\n [86, 40, 64, 135, 148, 224, 45, 183, 128],\n [22, 26, 17, 131, 240, 154, 14, 1, 209],\n [45, 16, 21, 91, 64, 222, 7, 1, 197],\n [56, 21, 39, 155, 60, 138, 23, 102, 213],\n [83, 12, 13, 54, 192, 255, 68, 47, 28],\n [85, 26, 85, 85, 128, 128, 32, 146, 171],\n [18, 11, 7, 63, 144, 171, 4, 4, 246],\n [35, 27, 10, 146, 174, 171, 12, 26, 128]\n ],\n [\n [190, 80, 35, 99, 180, 80, 126, 54, 45],\n [85, 126, 47, 87, 176, 51, 41, 20, 32],\n [101, 75, 128, 139, 118, 146, 116, 128, 85],\n [56, 41, 15, 176, 236, 85, 37, 9, 62],\n [71, 30, 17, 119, 118, 255, 17, 18, 138],\n [101, 38, 60, 138, 55, 70, 43, 26, 142],\n [146, 36, 19, 30, 171, 255, 97, 27, 20],\n [138, 45, 61, 62, 219, 1, 81, 188, 64],\n [32, 41, 20, 117, 151, 142, 20, 21, 163],\n [112, 19, 12, 61, 195, 128, 48, 4, 24]\n ]\n ],\n Ee = [\n [\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255],\n [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ]\n ],\n [\n [\n [217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255],\n [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ]\n ],\n [\n [\n [186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255],\n [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ]\n ],\n [\n [\n [248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n ]\n ]\n ],\n Ge = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0],\n Nc,\n Y = [],\n W = [],\n ka = [],\n Za,\n fd,\n Nb,\n pa,\n Ob,\n Xc,\n Tc,\n Yc,\n Uc,\n Zc,\n Vc,\n $c,\n Wc,\n Rc,\n Pc,\n Sc,\n Qc,\n re = 1,\n Cc = 2,\n ia = [],\n za,\n vc,\n fc,\n Fc,\n P = [];\n va(\"UpsampleRgbLinePair\", Ga, 3);\n va(\"UpsampleBgrLinePair\", Tb, 3);\n va(\"UpsampleRgbaLinePair\", wd, 4);\n va(\"UpsampleBgraLinePair\", vd, 4);\n va(\"UpsampleArgbLinePair\", ud, 4);\n va(\"UpsampleRgba4444LinePair\", td, 2);\n va(\"UpsampleRgb565LinePair\", sd, 2);\n var Mf = self.UpsampleRgbLinePair,\n Nf = self.UpsampleBgrLinePair,\n nd = self.UpsampleRgbaLinePair,\n od = self.UpsampleBgraLinePair,\n pd = self.UpsampleArgbLinePair,\n qd = self.UpsampleRgba4444LinePair,\n Of = self.UpsampleRgb565LinePair,\n Wa = 16,\n Ba = 1 << (Wa - 1),\n ta = -227,\n Eb = 482,\n rd = 6,\n Pf = (256 << rd) - 1,\n jc = 0,\n Yd = V(256),\n ae = V(256),\n $d = V(256),\n Zd = V(256),\n be = V(Eb - ta),\n ce = V(Eb - ta);\n la(\"YuvToRgbRow\", Ga, 3);\n la(\"YuvToBgrRow\", Tb, 3);\n la(\"YuvToRgbaRow\", wd, 4);\n la(\"YuvToBgraRow\", vd, 4);\n la(\"YuvToArgbRow\", ud, 4);\n la(\"YuvToRgba4444Row\", td, 2);\n la(\"YuvToRgb565Row\", sd, 2);\n var zd = [\n 0,\n 4,\n 8,\n 12,\n 128,\n 132,\n 136,\n 140,\n 256,\n 260,\n 264,\n 268,\n 384,\n 388,\n 392,\n 396\n ],\n Ya = [0, 2, 8],\n Qf = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1],\n Ne = 1;\n this.WebPDecodeRGBA = function(a, b, c, d, e) {\n var f = Ua;\n var g = new Cf(),\n h = new Cb();\n g.ba = h;\n h.S = f;\n h.width = [h.width];\n h.height = [h.height];\n var k = h.width;\n var l = h.height,\n m = new Td();\n if (null == m || null == a) var n = 2;\n else\n x(null != m),\n (n = Ad(a, b, c, m.width, m.height, m.Pd, m.Qd, m.format, null));\n 0 != n\n ? (k = 0)\n : (null != k && (k[0] = m.width[0]),\n null != l && (l[0] = m.height[0]),\n (k = 1));\n if (k) {\n h.width = h.width[0];\n h.height = h.height[0];\n null != d && (d[0] = h.width);\n null != e && (e[0] = h.height);\n b: {\n d = new Oa();\n e = new md();\n e.data = a;\n e.w = b;\n e.ha = c;\n e.kd = 1;\n b = [0];\n x(null != e);\n a = Ad(e.data, e.w, e.ha, null, null, null, b, null, e);\n (0 == a || 7 == a) && b[0] && (a = 4);\n b = a;\n if (0 == b) {\n x(null != g);\n d.data = e.data;\n d.w = e.w + e.offset;\n d.ha = e.ha - e.offset;\n d.put = kc;\n d.ac = gc;\n d.bc = lc;\n d.ma = g;\n if (e.xa) {\n a = Bc();\n if (null == a) {\n g = 1;\n break b;\n }\n if (te(a, d)) {\n b = Cd(d.width, d.height, g.Oa, g.ba);\n if ((d = 0 == b)) {\n c: {\n d = a;\n d: for (;;) {\n if (null == d) {\n d = 0;\n break c;\n }\n x(null != d.s.yc);\n x(null != d.s.Ya);\n x(0 < d.s.Wb);\n c = d.l;\n x(null != c);\n e = c.ma;\n x(null != e);\n if (0 != d.xb) {\n d.ca = e.ba;\n d.tb = e.tb;\n x(null != d.ca);\n if (!hc(e.Oa, c, Va)) {\n d.a = 2;\n break d;\n }\n if (!Ec(d, c.width)) break d;\n if (c.da) break d;\n (c.da || hb(d.ca.S)) && Aa();\n 11 > d.ca.S ||\n (alert(\"todo:WebPInitConvertARGBToYUV\"),\n null != d.ca.f.kb.F && Aa());\n if (\n d.Pb &&\n 0 < d.s.ua &&\n null == d.s.vb.X &&\n !Zb(d.s.vb, d.s.Wa.Xa)\n ) {\n d.a = 1;\n break d;\n }\n d.xb = 0;\n }\n if (!Jb(d, d.V, d.Ba, d.c, d.i, c.o, ge)) break d;\n e.Dc = d.Ma;\n d = 1;\n break c;\n }\n x(0 != d.a);\n d = 0;\n }\n d = !d;\n }\n d && (b = a.a);\n } else b = a.a;\n } else {\n a = new Ce();\n if (null == a) {\n g = 1;\n break b;\n }\n a.Fa = e.na;\n a.P = e.P;\n a.qc = e.Sa;\n if (Kc(a, d)) {\n if (((b = Cd(d.width, d.height, g.Oa, g.ba)), 0 == b)) {\n a.Aa = 0;\n c = g.Oa;\n e = a;\n x(null != e);\n if (null != c) {\n k = c.Md;\n k = 0 > k ? 0 : 100 < k ? 255 : (255 * k) / 100;\n if (0 < k) {\n for (l = m = 0; 4 > l; ++l)\n (n = e.pb[l]),\n 12 > n.lc &&\n (n.ia = (k * Qf[0 > n.lc ? 0 : n.lc]) >> 3),\n (m |= n.ia);\n m && (alert(\"todo:VP8InitRandom\"), (e.ia = 1));\n }\n e.Ga = c.Id;\n 100 < e.Ga ? (e.Ga = 100) : 0 > e.Ga && (e.Ga = 0);\n }\n Me(a, d) || (b = a.a);\n }\n } else b = a.a;\n }\n 0 == b && null != g.Oa && g.Oa.fd && (b = Bd(g.ba));\n }\n g = b;\n }\n f = 0 != g ? null : 11 > f ? h.f.RGBA.eb : h.f.kb.y;\n } else f = null;\n return f;\n };\n var Dd = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];\n };\n new _WebPDecoder();\n\n /** @license\n * Copyright (c) 2017 Dominik Homberger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nhttps://webpjs.appspot.com\nWebPRiffParser dominikhlbg@gmail.com\n*/\n\n function memcmp(data, data_off, str, size) {\n for (var i = 0; i < size; i++)\n if (data[data_off + i] != str.charCodeAt(i)) return true;\n return false;\n }\n\n function GetTag(data, data_off) {\n var str = \"\";\n for (var i = 0; i < 4; i++) str += String.fromCharCode(data[data_off++]);\n return str;\n }\n\n function GetLE16(data, data_off) {\n return (data[data_off + 0] << 0) | (data[data_off + 1] << 8);\n }\n\n function GetLE24(data, data_off) {\n return (\n ((data[data_off + 0] << 0) |\n (data[data_off + 1] << 8) |\n (data[data_off + 2] << 16)) >>>\n 0\n );\n }\n\n function GetLE32(data, data_off) {\n return (\n ((data[data_off + 0] << 0) |\n (data[data_off + 1] << 8) |\n (data[data_off + 2] << 16) |\n (data[data_off + 3] << 24)) >>>\n 0\n );\n }\n\n function WebPRiffParser(src, src_off) {\n var imagearray = {};\n var i = 0;\n var alpha_chunk = false;\n var alpha_size = 0;\n var alpha_offset = 0;\n imagearray[\"frames\"] = [];\n if (memcmp(src, src_off, \"RIFF\", 4)) return;\n src_off += 4;\n var riff_size = GetLE32(src, src_off) + 8;\n src_off += 8;\n\n while (src_off < src.length) {\n var fourcc = GetTag(src, src_off);\n src_off += 4;\n\n var payload_size = GetLE32(src, src_off);\n src_off += 4;\n var payload_size_padded = payload_size + (payload_size & 1);\n\n switch (fourcc) {\n case \"VP8 \":\n case \"VP8L\":\n if (typeof imagearray[\"frames\"][i] === \"undefined\")\n imagearray[\"frames\"][i] = {};\n var obj = imagearray[\"frames\"][i];\n var height = [0];\n var width = [0];\n obj[\"src_off\"] = alpha_chunk ? alpha_offset : src_off - 8;\n obj[\"src_size\"] = alpha_size + payload_size + 8;\n //var rgba = webpdecoder.WebPDecodeRGBA(src,(alpha_chunk?alpha_offset:src_off-8),alpha_size+payload_size+8,width,height);\n //imagearray[i]={'rgba':rgba,'width':width[0],'height':height[0]};\n i++;\n if (alpha_chunk) {\n alpha_chunk = false;\n alpha_size = 0;\n alpha_offset = 0;\n }\n break;\n case \"VP8X\":\n var obj = (imagearray[\"header\"] = {});\n var feature_flags = (obj[\"feature_flags\"] = src[src_off]);\n var src_off_ = src_off + 4;\n var canvas_width = (obj[\"canvas_width\"] = 1 + GetLE24(src, src_off_));\n src_off_ += 3;\n var canvas_height = (obj[\"canvas_height\"] =\n 1 + GetLE24(src, src_off_));\n src_off_ += 3;\n break;\n case \"ALPH\":\n alpha_chunk = true;\n alpha_size = payload_size_padded + 8;\n alpha_offset = src_off - 8;\n break;\n\n case \"ANIM\":\n var obj = imagearray[\"header\"];\n var bgcolor = (obj[\"bgcolor\"] = GetLE32(src, src_off));\n src_off_ = src_off + 4;\n\n var loop_count = (obj[\"loop_count\"] = GetLE16(src, src_off_));\n src_off_ += 2;\n break;\n case \"ANMF\":\n var offset_x = 0,\n offset_y = 0,\n width = 0,\n height = 0,\n duration = 0,\n blend = 0,\n dispose = 0,\n temp = 0;\n var obj = (imagearray[\"frames\"][i] = {});\n obj[\"offset_x\"] = offset_x = 2 * GetLE24(src, src_off);\n src_off += 3;\n obj[\"offset_y\"] = offset_y = 2 * GetLE24(src, src_off);\n src_off += 3;\n obj[\"width\"] = width = 1 + GetLE24(src, src_off);\n src_off += 3;\n obj[\"height\"] = height = 1 + GetLE24(src, src_off);\n src_off += 3;\n obj[\"duration\"] = duration = GetLE24(src, src_off);\n src_off += 3;\n temp = src[src_off++];\n obj[\"dispose\"] = dispose = temp & 1;\n obj[\"blend\"] = blend = (temp >> 1) & 1;\n break;\n default:\n }\n if (fourcc != \"ANMF\") src_off += payload_size_padded;\n }\n return imagearray;\n }\n\n var height = [0];\n var width = [0];\n var pixels = [];\n var webpdecoder = new _WebPDecoder();\n\n var response = imageData;\n var imagearray = WebPRiffParser(response, 0);\n imagearray[\"response\"] = response;\n imagearray[\"rgbaoutput\"] = true;\n imagearray[\"dataurl\"] = false;\n\n var header = imagearray[\"header\"] ? imagearray[\"header\"] : null;\n var frames = imagearray[\"frames\"] ? imagearray[\"frames\"] : null;\n\n if (header) {\n header[\"loop_counter\"] = header[\"loop_count\"];\n height = [header[\"canvas_height\"]];\n width = [header[\"canvas_width\"]];\n\n var blend = false;\n for (var f = 0; f < frames.length; f++)\n if (frames[f][\"blend\"] == 0) {\n blend = true;\n break;\n }\n }\n\n var frame = frames[0];\n var rgba = webpdecoder.WebPDecodeRGBA(\n response,\n frame[\"src_off\"],\n frame[\"src_size\"],\n width,\n height\n );\n frame[\"rgba\"] = rgba;\n frame[\"imgwidth\"] = width[0];\n frame[\"imgheight\"] = height[0];\n\n for (var i = 0; i < width[0] * height[0] * 4; i++) {\n pixels[i] = rgba[i];\n }\n\n this.width = width;\n this.height = height;\n this.data = pixels;\n return this;\n}\n\nWebPDecoder.prototype.getData = function() {\n return this.data;\n};\n\nexport { WebPDecoder };\n","/**\n * @license\n *\n * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { zlibSync } from \"../libs/fflate.js\";\nimport { PNG } from \"../libs/png.js\";\n\n/**\n * jsPDF PNG PlugIn\n * @name png_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /*\n * @see http://www.w3.org/TR/PNG-Chunks.html\n *\n Color Allowed Interpretation\n Type Bit Depths\n\n 0 1,2,4,8,16 Each pixel is a grayscale sample.\n\n 2 8,16 Each pixel is an R,G,B triple.\n\n 3 1,2,4,8 Each pixel is a palette index;\n a PLTE chunk must appear.\n\n 4 8,16 Each pixel is a grayscale sample,\n followed by an alpha sample.\n\n 6 8,16 Each pixel is an R,G,B triple,\n followed by an alpha sample.\n */\n\n /*\n * PNG filter method types\n *\n * @see http://www.w3.org/TR/PNG-Filters.html\n * @see http://www.libpng.org/pub/png/book/chapter09.html\n *\n * This is what the value 'Predictor' in decode params relates to\n *\n * 15 is \"optimal prediction\", which means the prediction algorithm can change from line to line.\n * In that case, you actually have to read the first byte off each line for the prediction algorthim (which should be 0-4, corresponding to PDF 10-14) and select the appropriate unprediction algorithm based on that byte.\n *\n 0 None\n 1 Sub\n 2 Up\n 3 Average\n 4 Paeth\n */\n\n var canCompress = function(value) {\n return value !== jsPDFAPI.image_compression.NONE && hasCompressionJS();\n };\n\n var hasCompressionJS = function() {\n return typeof zlibSync === \"function\";\n };\n var compressBytes = function(bytes, lineLength, colorsPerPixel, compression) {\n var level = 4;\n var filter_method = filterUp;\n\n switch (compression) {\n case jsPDFAPI.image_compression.FAST:\n level = 1;\n filter_method = filterSub;\n break;\n\n case jsPDFAPI.image_compression.MEDIUM:\n level = 6;\n filter_method = filterAverage;\n break;\n\n case jsPDFAPI.image_compression.SLOW:\n level = 9;\n filter_method = filterPaeth;\n break;\n }\n\n bytes = applyPngFilterMethod(\n bytes,\n lineLength,\n colorsPerPixel,\n filter_method\n );\n var dat = zlibSync(bytes, { level: level });\n return jsPDFAPI.__addimage__.arrayBufferToBinaryString(dat);\n };\n\n var applyPngFilterMethod = function(\n bytes,\n lineLength,\n colorsPerPixel,\n filter_method\n ) {\n var lines = bytes.length / lineLength,\n result = new Uint8Array(bytes.length + lines),\n filter_methods = getFilterMethods(),\n line,\n prevLine,\n offset;\n\n for (var i = 0; i < lines; i += 1) {\n offset = i * lineLength;\n line = bytes.subarray(offset, offset + lineLength);\n\n if (filter_method) {\n result.set(filter_method(line, colorsPerPixel, prevLine), offset + i);\n } else {\n var len = filter_methods.length,\n results = [];\n\n for (var j; j < len; j += 1) {\n results[j] = filter_methods[j](line, colorsPerPixel, prevLine);\n }\n\n var ind = getIndexOfSmallestSum(results.concat());\n\n result.set(results[ind], offset + i);\n }\n\n prevLine = line;\n }\n\n return result;\n };\n\n var filterNone = function(line) {\n /*var result = new Uint8Array(line.length + 1);\n result[0] = 0;\n result.set(line, 1);*/\n\n var result = Array.apply([], line);\n result.unshift(0);\n\n return result;\n };\n\n var filterSub = function(line, colorsPerPixel) {\n var result = [],\n len = line.length,\n left;\n\n result[0] = 1;\n\n for (var i = 0; i < len; i += 1) {\n left = line[i - colorsPerPixel] || 0;\n result[i + 1] = (line[i] - left + 0x0100) & 0xff;\n }\n\n return result;\n };\n\n var filterUp = function(line, colorsPerPixel, prevLine) {\n var result = [],\n len = line.length,\n up;\n\n result[0] = 2;\n\n for (var i = 0; i < len; i += 1) {\n up = (prevLine && prevLine[i]) || 0;\n result[i + 1] = (line[i] - up + 0x0100) & 0xff;\n }\n\n return result;\n };\n\n var filterAverage = function(line, colorsPerPixel, prevLine) {\n var result = [],\n len = line.length,\n left,\n up;\n\n result[0] = 3;\n\n for (var i = 0; i < len; i += 1) {\n left = line[i - colorsPerPixel] || 0;\n up = (prevLine && prevLine[i]) || 0;\n result[i + 1] = (line[i] + 0x0100 - ((left + up) >>> 1)) & 0xff;\n }\n\n return result;\n };\n\n var filterPaeth = function(line, colorsPerPixel, prevLine) {\n var result = [],\n len = line.length,\n left,\n up,\n upLeft,\n paeth;\n\n result[0] = 4;\n\n for (var i = 0; i < len; i += 1) {\n left = line[i - colorsPerPixel] || 0;\n up = (prevLine && prevLine[i]) || 0;\n upLeft = (prevLine && prevLine[i - colorsPerPixel]) || 0;\n paeth = paethPredictor(left, up, upLeft);\n result[i + 1] = (line[i] - paeth + 0x0100) & 0xff;\n }\n\n return result;\n };\n\n var paethPredictor = function(left, up, upLeft) {\n if (left === up && up === upLeft) {\n return left;\n }\n var pLeft = Math.abs(up - upLeft),\n pUp = Math.abs(left - upLeft),\n pUpLeft = Math.abs(left + up - upLeft - upLeft);\n return pLeft <= pUp && pLeft <= pUpLeft\n ? left\n : pUp <= pUpLeft\n ? up\n : upLeft;\n };\n\n var getFilterMethods = function() {\n return [filterNone, filterSub, filterUp, filterAverage, filterPaeth];\n };\n\n var getIndexOfSmallestSum = function(arrays) {\n var sum = arrays.map(function(value) {\n return value.reduce(function(pv, cv) {\n return pv + Math.abs(cv);\n }, 0);\n });\n return sum.indexOf(Math.min.apply(null, sum));\n };\n\n var getPredictorFromCompression = function(compression) {\n var predictor;\n switch (compression) {\n case jsPDFAPI.image_compression.FAST:\n predictor = 11;\n break;\n\n case jsPDFAPI.image_compression.MEDIUM:\n predictor = 13;\n break;\n\n case jsPDFAPI.image_compression.SLOW:\n predictor = 14;\n break;\n\n default:\n predictor = 12;\n break;\n }\n return predictor;\n };\n\n /**\n * @name processPNG\n * @function\n * @ignore\n */\n jsPDFAPI.processPNG = function(imageData, index, alias, compression) {\n \"use strict\";\n\n var colorSpace,\n filter = this.decode.FLATE_DECODE,\n bitsPerComponent,\n image,\n decodeParameters = \"\",\n trns,\n colors,\n pal,\n smask,\n pixels,\n len,\n alphaData,\n imgData,\n hasColors,\n pixel,\n i,\n n;\n\n if (this.__addimage__.isArrayBuffer(imageData))\n imageData = new Uint8Array(imageData);\n\n if (this.__addimage__.isArrayBufferView(imageData)) {\n image = new PNG(imageData);\n imageData = image.imgData;\n bitsPerComponent = image.bits;\n colorSpace = image.colorSpace;\n colors = image.colors;\n\n /*\n * colorType 6 - Each pixel is an R,G,B triple, followed by an alpha sample.\n *\n * colorType 4 - Each pixel is a grayscale sample, followed by an alpha sample.\n *\n * Extract alpha to create two separate images, using the alpha as a sMask\n */\n if ([4, 6].indexOf(image.colorType) !== -1) {\n /*\n * processes 8 bit RGBA and grayscale + alpha images\n */\n if (image.bits === 8) {\n pixels =\n image.pixelBitlength == 32\n ? new Uint32Array(image.decodePixels().buffer)\n : image.pixelBitlength == 16\n ? new Uint16Array(image.decodePixels().buffer)\n : new Uint8Array(image.decodePixels().buffer);\n len = pixels.length;\n imgData = new Uint8Array(len * image.colors);\n alphaData = new Uint8Array(len);\n var pDiff = image.pixelBitlength - image.bits;\n i = 0;\n n = 0;\n var pbl;\n\n for (; i < len; i++) {\n pixel = pixels[i];\n pbl = 0;\n\n while (pbl < pDiff) {\n imgData[n++] = (pixel >>> pbl) & 0xff;\n pbl = pbl + image.bits;\n }\n\n alphaData[i] = (pixel >>> pbl) & 0xff;\n }\n }\n\n /*\n * processes 16 bit RGBA and grayscale + alpha images\n */\n if (image.bits === 16) {\n pixels = new Uint32Array(image.decodePixels().buffer);\n len = pixels.length;\n imgData = new Uint8Array(\n len * (32 / image.pixelBitlength) * image.colors\n );\n alphaData = new Uint8Array(len * (32 / image.pixelBitlength));\n hasColors = image.colors > 1;\n i = 0;\n n = 0;\n var a = 0;\n\n while (i < len) {\n pixel = pixels[i++];\n\n imgData[n++] = (pixel >>> 0) & 0xff;\n\n if (hasColors) {\n imgData[n++] = (pixel >>> 16) & 0xff;\n\n pixel = pixels[i++];\n imgData[n++] = (pixel >>> 0) & 0xff;\n }\n\n alphaData[a++] = (pixel >>> 16) & 0xff;\n }\n bitsPerComponent = 8;\n }\n\n if (canCompress(compression)) {\n imageData = compressBytes(\n imgData,\n image.width * image.colors,\n image.colors,\n compression\n );\n smask = compressBytes(alphaData, image.width, 1, compression);\n } else {\n imageData = imgData;\n smask = alphaData;\n filter = undefined;\n }\n }\n\n /*\n * Indexed png. Each pixel is a palette index.\n */\n if (image.colorType === 3) {\n colorSpace = this.color_spaces.INDEXED;\n pal = image.palette;\n\n if (image.transparency.indexed) {\n var trans = image.transparency.indexed;\n var total = 0;\n i = 0;\n len = trans.length;\n\n for (; i < len; ++i) {\n total += trans[i];\n }\n\n total = total / 255;\n\n /*\n * a single color is specified as 100% transparent (0),\n * so we set trns to use a /Mask with that index\n */\n if (total === len - 1 && trans.indexOf(0) !== -1) {\n trns = [trans.indexOf(0)];\n\n /*\n * there's more than one colour within the palette that specifies\n * a transparency value less than 255, so we unroll the pixels to create an image sMask\n */\n } else if (total !== len) {\n pixels = image.decodePixels();\n alphaData = new Uint8Array(pixels.length);\n i = 0;\n len = pixels.length;\n\n for (; i < len; i++) {\n alphaData[i] = trans[pixels[i]];\n }\n\n smask = compressBytes(alphaData, image.width, 1);\n }\n }\n }\n\n var predictor = getPredictorFromCompression(compression);\n\n if (filter === this.decode.FLATE_DECODE) {\n decodeParameters = \"/Predictor \" + predictor + \" \";\n }\n decodeParameters +=\n \"/Colors \" +\n colors +\n \" /BitsPerComponent \" +\n bitsPerComponent +\n \" /Columns \" +\n image.width;\n\n if (\n this.__addimage__.isArrayBuffer(imageData) ||\n this.__addimage__.isArrayBufferView(imageData)\n ) {\n imageData = this.__addimage__.arrayBufferToBinaryString(imageData);\n }\n\n if (\n (smask && this.__addimage__.isArrayBuffer(smask)) ||\n this.__addimage__.isArrayBufferView(smask)\n ) {\n smask = this.__addimage__.arrayBufferToBinaryString(smask);\n }\n\n return {\n alias: alias,\n data: imageData,\n index: index,\n filter: filter,\n decodeParameters: decodeParameters,\n transparency: trns,\n palette: pal,\n sMask: smask,\n predictor: predictor,\n width: image.width,\n height: image.height,\n bitsPerComponent: bitsPerComponent,\n colorSpace: colorSpace\n };\n }\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2017 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { GifReader } from \"../libs/omggif.js\";\nimport { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\n\n/**\n * jsPDF Gif Support PlugIn\n *\n * @name gif_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n jsPDFAPI.processGIF89A = function(imageData, index, alias, compression) {\n var reader = new GifReader(imageData);\n var width = reader.width,\n height = reader.height;\n var qu = 100;\n var pixels = [];\n\n reader.decodeAndBlitFrameRGBA(0, pixels);\n var rawImageData = {\n data: pixels,\n width: width,\n height: height\n };\n\n var encoder = new JPEGEncoder(qu);\n var data = encoder.encode(rawImageData, qu);\n return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n };\n\n jsPDFAPI.processGIF87A = jsPDFAPI.processGIF89A;\n})(jsPDF.API);\n","import { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\nimport { BmpDecoder } from \"../libs/BMPDecoder.js\";\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @license\n * Copyright (c) 2018 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF bmp Support PlugIn\n * @name bmp_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n jsPDFAPI.processBMP = function(imageData, index, alias, compression) {\n var reader = new BmpDecoder(imageData, false);\n var width = reader.width,\n height = reader.height;\n var qu = 100;\n var pixels = reader.getData();\n\n var rawImageData = {\n data: pixels,\n width: width,\n height: height\n };\n\n var encoder = new JPEGEncoder(qu);\n var data = encoder.encode(rawImageData, qu);\n return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2019 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\nimport { WebPDecoder } from \"../libs/WebPDecoder.js\";\n\n/**\n * jsPDF webp Support PlugIn\n *\n * @name webp_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n jsPDFAPI.processWEBP = function(imageData, index, alias, compression) {\n var reader = new WebPDecoder(imageData, false);\n var width = reader.width,\n height = reader.height;\n var qu = 100;\n var pixels = reader.getData();\n\n var rawImageData = {\n data: pixels,\n width: width,\n height: height\n };\n\n var encoder = new JPEGEncoder(qu);\n var data = encoder.encode(rawImageData, qu);\n return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n };\n})(jsPDF.API);\n","/**\n * @license\n *\n * Copyright (c) 2021 Antti Palola, https://github.com/Pantura\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF RGBA array PlugIn\n * @name rgba_support\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * @name processRGBA\n * @function\n *\n * Process RGBA Array. This is a one-dimension array with pixel data [red, green, blue, alpha, red, green, ...].\n * RGBA array data can be obtained from DOM canvas getImageData.\n * @ignore\n */\n jsPDFAPI.processRGBA = function(imageData, index, alias) {\n \"use strict\";\n\n var imagePixels = imageData.data;\n var length = imagePixels.length;\n // jsPDF takes alpha data separately so extract that.\n var rgbOut = new Uint8Array((length / 4) * 3);\n var alphaOut = new Uint8Array(length / 4);\n var outIndex = 0;\n var alphaIndex = 0;\n\n for (var i = 0; i < length; i += 4) {\n var r = imagePixels[i];\n var g = imagePixels[i + 1];\n var b = imagePixels[i + 2];\n var alpha = imagePixels[i + 3];\n rgbOut[outIndex++] = r;\n rgbOut[outIndex++] = g;\n rgbOut[outIndex++] = b;\n alphaOut[alphaIndex++] = alpha;\n }\n\n var rgbData = this.__addimage__.arrayBufferToBinaryString(rgbOut);\n var alphaData = this.__addimage__.arrayBufferToBinaryString(alphaOut);\n\n return {\n alpha: alphaData,\n data: rgbData,\n index: index,\n alias: alias,\n colorSpace: \"DeviceRGB\",\n bitsPerComponent: 8,\n width: imageData.width,\n height: imageData.height\n };\n };\n})(jsPDF.API);\n","/**\n * @license\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF setLanguage Plugin\n *\n * @name setLanguage\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * Add Language Tag to the generated PDF\n *\n * @name setLanguage\n * @function\n * @param {string} langCode The Language code as ISO-639-1 (e.g. 'en') or as country language code (e.g. 'en-GB').\n * @returns {jsPDF}\n * @example\n * var doc = new jsPDF()\n * doc.text(10, 10, 'This is a test')\n * doc.setLanguage(\"en-US\")\n * doc.save('english.pdf')\n */\n jsPDFAPI.setLanguage = function(langCode) {\n \"use strict\";\n\n var langCodes = {\n af: \"Afrikaans\",\n sq: \"Albanian\",\n ar: \"Arabic (Standard)\",\n \"ar-DZ\": \"Arabic (Algeria)\",\n \"ar-BH\": \"Arabic (Bahrain)\",\n \"ar-EG\": \"Arabic (Egypt)\",\n \"ar-IQ\": \"Arabic (Iraq)\",\n \"ar-JO\": \"Arabic (Jordan)\",\n \"ar-KW\": \"Arabic (Kuwait)\",\n \"ar-LB\": \"Arabic (Lebanon)\",\n \"ar-LY\": \"Arabic (Libya)\",\n \"ar-MA\": \"Arabic (Morocco)\",\n \"ar-OM\": \"Arabic (Oman)\",\n \"ar-QA\": \"Arabic (Qatar)\",\n \"ar-SA\": \"Arabic (Saudi Arabia)\",\n \"ar-SY\": \"Arabic (Syria)\",\n \"ar-TN\": \"Arabic (Tunisia)\",\n \"ar-AE\": \"Arabic (U.A.E.)\",\n \"ar-YE\": \"Arabic (Yemen)\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n ast: \"Asturian\",\n az: \"Azerbaijani\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n zh: \"Chinese\",\n \"zh-HK\": \"Chinese (Hong Kong)\",\n \"zh-CN\": \"Chinese (PRC)\",\n \"zh-SG\": \"Chinese (Singapore)\",\n \"zh-TW\": \"Chinese (Taiwan)\",\n cv: \"Chuvash\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n nl: \"Dutch (Standard)\",\n \"nl-BE\": \"Dutch (Belgian)\",\n en: \"English\",\n \"en-AU\": \"English (Australia)\",\n \"en-BZ\": \"English (Belize)\",\n \"en-CA\": \"English (Canada)\",\n \"en-IE\": \"English (Ireland)\",\n \"en-JM\": \"English (Jamaica)\",\n \"en-NZ\": \"English (New Zealand)\",\n \"en-PH\": \"English (Philippines)\",\n \"en-ZA\": \"English (South Africa)\",\n \"en-TT\": \"English (Trinidad & Tobago)\",\n \"en-GB\": \"English (United Kingdom)\",\n \"en-US\": \"English (United States)\",\n \"en-ZW\": \"English (Zimbabwe)\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n fo: \"Faeroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French (Standard)\",\n \"fr-BE\": \"French (Belgium)\",\n \"fr-CA\": \"French (Canada)\",\n \"fr-FR\": \"French (France)\",\n \"fr-LU\": \"French (Luxembourg)\",\n \"fr-MC\": \"French (Monaco)\",\n \"fr-CH\": \"French (Switzerland)\",\n fy: \"Frisian\",\n fur: \"Friulian\",\n gd: \"Gaelic (Scots)\",\n \"gd-IE\": \"Gaelic (Irish)\",\n gl: \"Galacian\",\n ka: \"Georgian\",\n de: \"German (Standard)\",\n \"de-AT\": \"German (Austria)\",\n \"de-DE\": \"German (Germany)\",\n \"de-LI\": \"German (Liechtenstein)\",\n \"de-LU\": \"German (Luxembourg)\",\n \"de-CH\": \"German (Switzerland)\",\n el: \"Greek\",\n gu: \"Gujurati\",\n ht: \"Haitian\",\n he: \"Hebrew\",\n hi: \"Hindi\",\n hu: \"Hungarian\",\n is: \"Icelandic\",\n id: \"Indonesian\",\n iu: \"Inuktitut\",\n ga: \"Irish\",\n it: \"Italian (Standard)\",\n \"it-CH\": \"Italian (Switzerland)\",\n ja: \"Japanese\",\n kn: \"Kannada\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ky: \"Kirghiz\",\n tlh: \"Klingon\",\n ko: \"Korean\",\n \"ko-KP\": \"Korean (North Korea)\",\n \"ko-KR\": \"Korean (South Korea)\",\n la: \"Latin\",\n lv: \"Latvian\",\n lt: \"Lithuanian\",\n lb: \"Luxembourgish\",\n mk: \"North Macedonia\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Maori\",\n mr: \"Marathi\",\n mo: \"Moldavian\",\n nv: \"Navajo\",\n ng: \"Ndonga\",\n ne: \"Nepali\",\n no: \"Norwegian\",\n nb: \"Norwegian (Bokmal)\",\n nn: \"Norwegian (Nynorsk)\",\n oc: \"Occitan\",\n or: \"Oriya\",\n om: \"Oromo\",\n fa: \"Persian\",\n \"fa-IR\": \"Persian/Iran\",\n pl: \"Polish\",\n pt: \"Portuguese\",\n \"pt-BR\": \"Portuguese (Brazil)\",\n pa: \"Punjabi\",\n \"pa-IN\": \"Punjabi (India)\",\n \"pa-PK\": \"Punjabi (Pakistan)\",\n qu: \"Quechua\",\n rm: \"Rhaeto-Romanic\",\n ro: \"Romanian\",\n \"ro-MO\": \"Romanian (Moldavia)\",\n ru: \"Russian\",\n \"ru-MO\": \"Russian (Moldavia)\",\n sz: \"Sami (Lappish)\",\n sg: \"Sango\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n si: \"Singhalese\",\n sr: \"Serbian\",\n sk: \"Slovak\",\n sl: \"Slovenian\",\n so: \"Somani\",\n sb: \"Sorbian\",\n es: \"Spanish\",\n \"es-AR\": \"Spanish (Argentina)\",\n \"es-BO\": \"Spanish (Bolivia)\",\n \"es-CL\": \"Spanish (Chile)\",\n \"es-CO\": \"Spanish (Colombia)\",\n \"es-CR\": \"Spanish (Costa Rica)\",\n \"es-DO\": \"Spanish (Dominican Republic)\",\n \"es-EC\": \"Spanish (Ecuador)\",\n \"es-SV\": \"Spanish (El Salvador)\",\n \"es-GT\": \"Spanish (Guatemala)\",\n \"es-HN\": \"Spanish (Honduras)\",\n \"es-MX\": \"Spanish (Mexico)\",\n \"es-NI\": \"Spanish (Nicaragua)\",\n \"es-PA\": \"Spanish (Panama)\",\n \"es-PY\": \"Spanish (Paraguay)\",\n \"es-PE\": \"Spanish (Peru)\",\n \"es-PR\": \"Spanish (Puerto Rico)\",\n \"es-ES\": \"Spanish (Spain)\",\n \"es-UY\": \"Spanish (Uruguay)\",\n \"es-VE\": \"Spanish (Venezuela)\",\n sx: \"Sutu\",\n sw: \"Swahili\",\n sv: \"Swedish\",\n \"sv-FI\": \"Swedish (Finland)\",\n \"sv-SV\": \"Swedish (Sweden)\",\n ta: \"Tamil\",\n tt: \"Tatar\",\n te: \"Teluga\",\n th: \"Thai\",\n tig: \"Tigre\",\n ts: \"Tsonga\",\n tn: \"Tswana\",\n tr: \"Turkish\",\n tk: \"Turkmen\",\n uk: \"Ukrainian\",\n hsb: \"Upper Sorbian\",\n ur: \"Urdu\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapuk\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n xh: \"Xhosa\",\n ji: \"Yiddish\",\n zu: \"Zulu\"\n };\n\n if (this.internal.languageSettings === undefined) {\n this.internal.languageSettings = {};\n this.internal.languageSettings.isSubscribed = false;\n }\n\n if (langCodes[langCode] !== undefined) {\n this.internal.languageSettings.languageCode = langCode;\n if (this.internal.languageSettings.isSubscribed === false) {\n this.internal.events.subscribe(\"putCatalog\", function() {\n this.internal.write(\n \"/Lang (\" + this.internal.languageSettings.languageCode + \")\"\n );\n });\n this.internal.languageSettings.isSubscribed = true;\n }\n }\n return this;\n };\n})(jsPDF.API);\n","/** @license\n jsPDF standard_fonts_metrics plugin\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n * MIT license.\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n * \n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * This file adds the standard font metrics to jsPDF.\n *\n * Font metrics data is reprocessed derivative of contents of\n * \"Font Metrics for PDF Core 14 Fonts\" package, which exhibits the following copyright and license:\n *\n * Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\n *\n * This file and the 14 PostScript(R) AFM files it accompanies may be used,\n * copied, and distributed for any purpose and without charge, with or without\n * modification, provided that all copyright notices are retained; that the AFM\n * files are not distributed without this file; that all modifications to this\n * file or any of the AFM files are prominently noted in the modified file(s);\n * and that this paragraph is not modified. Adobe Systems has no responsibility\n * or obligation to support the use of the AFM files.\n *\n * @name standard_fonts_metrics\n * @module\n */\n\n(function(API) {\n \"use strict\";\n API.__fontmetrics__ = API.__fontmetrics__ || {};\n\n var decoded = \"0123456789abcdef\",\n encoded = \"klmnopqrstuvwxyz\",\n mappingUncompress = {},\n mappingCompress = {};\n\n for (var i = 0; i < encoded.length; i++) {\n mappingUncompress[encoded[i]] = decoded[i];\n mappingCompress[decoded[i]] = encoded[i];\n }\n\n var hex = function(value) {\n return \"0x\" + parseInt(value, 10).toString(16);\n };\n\n var compress = (API.__fontmetrics__.compress = function(data) {\n var vals = [\"{\"];\n var value, keystring, valuestring, numberprefix;\n\n for (var key in data) {\n value = data[key];\n\n if (!isNaN(parseInt(key, 10))) {\n key = parseInt(key, 10);\n keystring = hex(key).slice(2);\n keystring =\n keystring.slice(0, -1) + mappingCompress[keystring.slice(-1)];\n } else {\n keystring = \"'\" + key + \"'\";\n }\n\n if (typeof value == \"number\") {\n if (value < 0) {\n valuestring = hex(value).slice(3);\n numberprefix = \"-\";\n } else {\n valuestring = hex(value).slice(2);\n numberprefix = \"\";\n }\n valuestring =\n numberprefix +\n valuestring.slice(0, -1) +\n mappingCompress[valuestring.slice(-1)];\n } else {\n if (typeof value === \"object\") {\n valuestring = compress(value);\n } else {\n throw new Error(\n \"Don't know what to do with value type \" + typeof value + \".\"\n );\n }\n }\n vals.push(keystring + valuestring);\n }\n vals.push(\"}\");\n return vals.join(\"\");\n });\n\n /**\n * Uncompresses data compressed into custom, base16-like format.\n *\n * @public\n * @function\n * @param\n * @returns {Type}\n */\n var uncompress = (API.__fontmetrics__.uncompress = function(data) {\n if (typeof data !== \"string\") {\n throw new Error(\"Invalid argument passed to uncompress.\");\n }\n\n var output = {},\n sign = 1,\n stringparts, // undef. will be [] in string mode\n activeobject = output,\n parentchain = [],\n parent_key_pair,\n keyparts = \"\",\n valueparts = \"\",\n key, // undef. will be Truthy when Key is resolved.\n datalen = data.length - 1, // stripping ending }\n ch;\n\n for (var i = 1; i < datalen; i += 1) {\n // - { } ' are special.\n\n ch = data[i];\n\n if (ch == \"'\") {\n if (stringparts) {\n // end of string mode\n key = stringparts.join(\"\");\n stringparts = undefined;\n } else {\n // start of string mode\n stringparts = [];\n }\n } else if (stringparts) {\n stringparts.push(ch);\n } else if (ch == \"{\") {\n // start of object\n parentchain.push([activeobject, key]);\n activeobject = {};\n key = undefined;\n } else if (ch == \"}\") {\n // end of object\n parent_key_pair = parentchain.pop();\n parent_key_pair[0][parent_key_pair[1]] = activeobject;\n key = undefined;\n activeobject = parent_key_pair[0];\n } else if (ch == \"-\") {\n sign = -1;\n } else {\n // must be number\n if (key === undefined) {\n if (mappingUncompress.hasOwnProperty(ch)) {\n keyparts += mappingUncompress[ch];\n key = parseInt(keyparts, 16) * sign;\n sign = +1;\n keyparts = \"\";\n } else {\n keyparts += ch;\n }\n } else {\n if (mappingUncompress.hasOwnProperty(ch)) {\n valueparts += mappingUncompress[ch];\n activeobject[key] = parseInt(valueparts, 16) * sign;\n sign = +1;\n key = undefined;\n valueparts = \"\";\n } else {\n valueparts += ch;\n }\n }\n }\n }\n return output;\n });\n\n // encoding = 'Unicode'\n // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE. NO clever BOM behavior\n // Actual 16bit char codes used.\n // no multi-byte logic here\n\n // Unicode characters to WinAnsiEncoding:\n // {402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240:137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158}\n // as you can see, all Unicode chars are outside of 0-255 range. No char code conflicts.\n // this means that you can give Win cp1252 encoded strings to jsPDF for rendering directly\n // as well as give strings with some (supported by these fonts) Unicode characters and\n // these will be mapped to win cp1252\n // for example, you can send char code (cp1252) 0x80 or (unicode) 0x20AC, getting \"Euro\" glyph displayed in both cases.\n\n var encodingBlock = {\n codePages: [\"WinAnsiEncoding\"],\n WinAnsiEncoding: uncompress(\n \"{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}\"\n )\n };\n var encodings = {\n Unicode: {\n Courier: encodingBlock,\n \"Courier-Bold\": encodingBlock,\n \"Courier-BoldOblique\": encodingBlock,\n \"Courier-Oblique\": encodingBlock,\n Helvetica: encodingBlock,\n \"Helvetica-Bold\": encodingBlock,\n \"Helvetica-BoldOblique\": encodingBlock,\n \"Helvetica-Oblique\": encodingBlock,\n \"Times-Roman\": encodingBlock,\n \"Times-Bold\": encodingBlock,\n \"Times-BoldItalic\": encodingBlock,\n \"Times-Italic\": encodingBlock\n //\t, 'Symbol'\n //\t, 'ZapfDingbats'\n }\n };\n\n var fontMetrics = {\n Unicode: {\n // all sizing numbers are n/fontMetricsFractionOf = one font size unit\n // this means that if fontMetricsFractionOf = 1000, and letter A's width is 476, it's\n // width is 476/1000 or 47.6% of its height (regardless of font size)\n // At this time this value applies to \"widths\" and \"kerning\" numbers.\n\n // char code 0 represents \"default\" (average) width - use it for chars missing in this table.\n // key 'fof' represents the \"fontMetricsFractionOf\" value\n\n \"Courier-Oblique\": uncompress(\n \"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"\n ),\n \"Times-BoldItalic\": uncompress(\n \"{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}\"\n ),\n \"Helvetica-Bold\": uncompress(\n \"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"\n ),\n Courier: uncompress(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\n \"Courier-BoldOblique\": uncompress(\n \"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"\n ),\n \"Times-Bold\": uncompress(\n \"{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}\"\n ),\n Symbol: uncompress(\n \"{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}\"\n ),\n Helvetica: uncompress(\n \"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\"\n ),\n \"Helvetica-BoldOblique\": uncompress(\n \"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"\n ),\n ZapfDingbats: uncompress(\"{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}\"),\n \"Courier-Bold\": uncompress(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\n \"Times-Italic\": uncompress(\n \"{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}\"\n ),\n \"Times-Roman\": uncompress(\n \"{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}\"\n ),\n \"Helvetica-Oblique\": uncompress(\n \"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\"\n )\n }\n };\n\n /*\n\tThis event handler is fired when a new jsPDF object is initialized\n\tThis event handler appends metrics data to standard fonts within\n\tthat jsPDF instance. The metrics are mapped over Unicode character\n\tcodes, NOT CIDs or other codes matching the StandardEncoding table of the\n\tstandard PDF fonts.\n\tFuture:\n\tAlso included is the encoding maping table, converting Unicode (UCS-2, UTF-16)\n\tchar codes to StandardEncoding character codes. The encoding table is to be used\n\tsomewhere around \"pdfEscape\" call.\n\t*/\n API.events.push([\n \"addFont\",\n function(data) {\n var font = data.font;\n\n var metrics = fontMetrics[\"Unicode\"][font.postScriptName];\n if (metrics) {\n font.metadata[\"Unicode\"] = {};\n font.metadata[\"Unicode\"].widths = metrics.widths;\n font.metadata[\"Unicode\"].kerning = metrics.kerning;\n }\n\n var encodingBlock = encodings[\"Unicode\"][font.postScriptName];\n if (encodingBlock) {\n font.metadata[\"Unicode\"].encoding = encodingBlock;\n font.encoding = encodingBlock.codePages[0];\n }\n }\n ]); // end of adding event handler\n})(jsPDF.API);\n","/**\n * @license\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { atob } from \"../libs/AtobBtoa.js\";\n\n/**\n * @name ttfsupport\n * @module\n */\n(function(jsPDF) {\n \"use strict\";\n\n var binaryStringToUint8Array = function(binary_string) {\n var len = binary_string.length;\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes;\n };\n\n var addFont = function(font, file) {\n // eslint-disable-next-line no-control-regex\n if (/^\\x00\\x01\\x00\\x00/.test(file)) {\n file = binaryStringToUint8Array(file);\n } else {\n file = binaryStringToUint8Array(atob(file));\n }\n font.metadata = jsPDF.API.TTFFont.open(file);\n font.metadata.Unicode = font.metadata.Unicode || {\n encoding: {},\n kerning: {},\n widths: []\n };\n font.metadata.glyIdsUsed = [0];\n };\n\n jsPDF.API.events.push([\n \"addFont\",\n function(data) {\n var file = undefined;\n var font = data.font;\n var instance = data.instance;\n if (font.isStandardFont) {\n return;\n }\n if (typeof instance !== \"undefined\") {\n if (instance.existsFileInVFS(font.postScriptName) === false) {\n file = instance.loadFile(font.postScriptName);\n } else {\n file = instance.getFileFromVFS(font.postScriptName);\n }\n if (typeof file !== \"string\") {\n throw new Error(\n \"Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('\" +\n font.postScriptName +\n \"').\"\n );\n }\n addFont(font, file);\n } else {\n throw new Error(\n \"Font does not exist in vFS, import fonts or remove declaration doc.addFont('\" +\n font.postScriptName +\n \"').\"\n );\n }\n }\n ]); // end of adding event handler\n})(jsPDF);\n","/** @license\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { console } from \"../libs/console.js\";\nimport { globalObject } from \"../libs/globalObject.js\";\n\n/**\n * jsPDF SVG plugin\n *\n * @name svg\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n function loadCanvg() {\n return (function() {\n if (globalObject[\"canvg\"]) {\n return Promise.resolve(globalObject[\"canvg\"]);\n }\n\n return import(\"canvg\");\n\n })()\n .catch(function(e) {\n return Promise.reject(new Error(\"Could not load canvg: \" + e));\n })\n .then(function(canvg) {\n return canvg.default ? canvg.default : canvg;\n });\n }\n\n /**\n * Parses SVG XML and saves it as image into the PDF.\n *\n * Depends on canvas-element and canvg\n *\n * @name addSvgAsImage\n * @public\n * @function\n * @param {string} SVG-Data as Text\n * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\n * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\n * @param {number} width of SVG-Image (in units declared at inception of PDF document)\n * @param {number} height of SVG-Image (in units declared at inception of PDF document)\n * @param {string} alias of SVG-Image (if used multiple times)\n * @param {string} compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'\n * @param {number} rotation of the image in degrees (0-359)\n *\n * @returns jsPDF jsPDF-instance\n */\n jsPDFAPI.addSvgAsImage = function(\n svg,\n x,\n y,\n w,\n h,\n alias,\n compression,\n rotation\n ) {\n if (isNaN(x) || isNaN(y)) {\n console.error(\"jsPDF.addSvgAsImage: Invalid coordinates\", arguments);\n throw new Error(\"Invalid coordinates passed to jsPDF.addSvgAsImage\");\n }\n\n if (isNaN(w) || isNaN(h)) {\n console.error(\"jsPDF.addSvgAsImage: Invalid measurements\", arguments);\n throw new Error(\n \"Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage\"\n );\n }\n\n var canvas = document.createElement(\"canvas\");\n canvas.width = w;\n canvas.height = h;\n var ctx = canvas.getContext(\"2d\");\n ctx.fillStyle = \"#fff\"; /// set white fill style\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n var options = {\n ignoreMouse: true,\n ignoreAnimation: true,\n ignoreDimensions: true\n };\n var doc = this;\n return loadCanvg()\n .then(\n function(canvg) {\n return canvg.fromString(ctx, svg, options);\n },\n function() {\n return Promise.reject(new Error(\"Could not load canvg.\"));\n }\n )\n .then(function(instance) {\n return instance.render(options);\n })\n .then(function() {\n doc.addImage(\n canvas.toDataURL(\"image/jpeg\", 1.0),\n x,\n y,\n w,\n h,\n compression,\n rotation\n );\n });\n };\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF total_pages plugin\n * @name total_pages\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n /**\n * @name putTotalPages\n * @function\n * @param {string} pageExpression Regular Expression\n * @returns {jsPDF} jsPDF-instance\n */\n\n jsPDFAPI.putTotalPages = function(pageExpression) {\n \"use strict\";\n\n var replaceExpression;\n var totalNumberOfPages = 0;\n if (parseInt(this.internal.getFont().id.substr(1), 10) < 15) {\n replaceExpression = new RegExp(pageExpression, \"g\");\n totalNumberOfPages = this.internal.getNumberOfPages();\n } else {\n replaceExpression = new RegExp(\n this.pdfEscape16(pageExpression, this.internal.getFont()),\n \"g\"\n );\n totalNumberOfPages = this.pdfEscape16(\n this.internal.getNumberOfPages() + \"\",\n this.internal.getFont()\n );\n }\n\n for (var n = 1; n <= this.internal.getNumberOfPages(); n++) {\n for (var i = 0; i < this.internal.pages[n].length; i++) {\n this.internal.pages[n][i] = this.internal.pages[n][i].replace(\n replaceExpression,\n totalNumberOfPages\n );\n }\n }\n\n return this;\n };\n})(jsPDF.API);\n","/**\n * @license\n * jsPDF viewerPreferences Plugin\n * @author Aras Abbasi (github.com/arasabbasi)\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * Adds the ability to set ViewerPreferences and by thus\n * controlling the way the document is to be presented on the\n * screen or in print.\n * @name viewerpreferences\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n /**\n * Set the ViewerPreferences of the generated PDF\n *\n * @name viewerPreferences\n * @function\n * @public\n * @param {Object} options Array with the ViewerPreferences
    \n * Example: doc.viewerPreferences({\"FitWindow\":true});
    \n *
    \n * You can set following preferences:
    \n *
    \n * HideToolbar (boolean)
    \n * Default value: false
    \n *
    \n * HideMenubar (boolean)
    \n * Default value: false.
    \n *
    \n * HideWindowUI (boolean)
    \n * Default value: false.
    \n *
    \n * FitWindow (boolean)
    \n * Default value: false.
    \n *
    \n * CenterWindow (boolean)
    \n * Default value: false
    \n *
    \n * DisplayDocTitle (boolean)
    \n * Default value: false.
    \n *
    \n * NonFullScreenPageMode (string)
    \n * Possible values: UseNone, UseOutlines, UseThumbs, UseOC
    \n * Default value: UseNone
    \n *
    \n * Direction (string)
    \n * Possible values: L2R, R2L
    \n * Default value: L2R.
    \n *
    \n * ViewArea (string)
    \n * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    \n * Default value: CropBox.
    \n *
    \n * ViewClip (string)
    \n * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    \n * Default value: CropBox
    \n *
    \n * PrintArea (string)
    \n * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    \n * Default value: CropBox
    \n *
    \n * PrintClip (string)
    \n * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    \n * Default value: CropBox.
    \n *
    \n * PrintScaling (string)
    \n * Possible values: AppDefault, None
    \n * Default value: AppDefault.
    \n *
    \n * Duplex (string)
    \n * Possible values: Simplex, DuplexFlipLongEdge, DuplexFlipShortEdge\n * Default value: none
    \n *
    \n * PickTrayByPDFSize (boolean)
    \n * Default value: false
    \n *
    \n * PrintPageRange (Array)
    \n * Example: [[1,5], [7,9]]
    \n * Default value: as defined by PDF viewer application
    \n *
    \n * NumCopies (Number)
    \n * Possible values: 1, 2, 3, 4, 5
    \n * Default value: 1
    \n *
    \n * For more information see the PDF Reference, sixth edition on Page 577\n * @param {boolean} doReset True to reset the settings\n * @function\n * @returns jsPDF jsPDF-instance\n * @example\n * var doc = new jsPDF()\n * doc.text('This is a test', 10, 10)\n * doc.viewerPreferences({'FitWindow': true}, true)\n * doc.save(\"viewerPreferences.pdf\")\n *\n * // Example printing 10 copies, using cropbox, and hiding UI.\n * doc.viewerPreferences({\n * 'HideWindowUI': true,\n * 'PrintArea': 'CropBox',\n * 'NumCopies': 10\n * })\n */\n jsPDFAPI.viewerPreferences = function(options, doReset) {\n options = options || {};\n doReset = doReset || false;\n\n var configuration;\n var configurationTemplate = {\n HideToolbar: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.3\n },\n HideMenubar: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.3\n },\n HideWindowUI: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.3\n },\n FitWindow: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.3\n },\n CenterWindow: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.3\n },\n DisplayDocTitle: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.4\n },\n NonFullScreenPageMode: {\n defaultValue: \"UseNone\",\n value: \"UseNone\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"UseNone\", \"UseOutlines\", \"UseThumbs\", \"UseOC\"],\n pdfVersion: 1.3\n },\n Direction: {\n defaultValue: \"L2R\",\n value: \"L2R\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"L2R\", \"R2L\"],\n pdfVersion: 1.3\n },\n ViewArea: {\n defaultValue: \"CropBox\",\n value: \"CropBox\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n pdfVersion: 1.4\n },\n ViewClip: {\n defaultValue: \"CropBox\",\n value: \"CropBox\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n pdfVersion: 1.4\n },\n PrintArea: {\n defaultValue: \"CropBox\",\n value: \"CropBox\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n pdfVersion: 1.4\n },\n PrintClip: {\n defaultValue: \"CropBox\",\n value: \"CropBox\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n pdfVersion: 1.4\n },\n PrintScaling: {\n defaultValue: \"AppDefault\",\n value: \"AppDefault\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\"AppDefault\", \"None\"],\n pdfVersion: 1.6\n },\n Duplex: {\n defaultValue: \"\",\n value: \"none\",\n type: \"name\",\n explicitSet: false,\n valueSet: [\n \"Simplex\",\n \"DuplexFlipShortEdge\",\n \"DuplexFlipLongEdge\",\n \"none\"\n ],\n pdfVersion: 1.7\n },\n PickTrayByPDFSize: {\n defaultValue: false,\n value: false,\n type: \"boolean\",\n explicitSet: false,\n valueSet: [true, false],\n pdfVersion: 1.7\n },\n PrintPageRange: {\n defaultValue: \"\",\n value: \"\",\n type: \"array\",\n explicitSet: false,\n valueSet: null,\n pdfVersion: 1.7\n },\n NumCopies: {\n defaultValue: 1,\n value: 1,\n type: \"integer\",\n explicitSet: false,\n valueSet: null,\n pdfVersion: 1.7\n }\n };\n\n var configurationKeys = Object.keys(configurationTemplate);\n\n var rangeArray = [];\n var i = 0;\n var j = 0;\n var k = 0;\n var isValid;\n\n var method;\n var value;\n\n function arrayContainsElement(array, element) {\n var iterator;\n var result = false;\n\n for (iterator = 0; iterator < array.length; iterator += 1) {\n if (array[iterator] === element) {\n result = true;\n }\n }\n return result;\n }\n\n if (this.internal.viewerpreferences === undefined) {\n this.internal.viewerpreferences = {};\n this.internal.viewerpreferences.configuration = JSON.parse(\n JSON.stringify(configurationTemplate)\n );\n this.internal.viewerpreferences.isSubscribed = false;\n }\n configuration = this.internal.viewerpreferences.configuration;\n\n if (options === \"reset\" || doReset === true) {\n var len = configurationKeys.length;\n\n for (k = 0; k < len; k += 1) {\n configuration[configurationKeys[k]].value =\n configuration[configurationKeys[k]].defaultValue;\n configuration[configurationKeys[k]].explicitSet = false;\n }\n }\n\n if (typeof options === \"object\") {\n for (method in options) {\n value = options[method];\n if (\n arrayContainsElement(configurationKeys, method) &&\n value !== undefined\n ) {\n if (\n configuration[method].type === \"boolean\" &&\n typeof value === \"boolean\"\n ) {\n configuration[method].value = value;\n } else if (\n configuration[method].type === \"name\" &&\n arrayContainsElement(configuration[method].valueSet, value)\n ) {\n configuration[method].value = value;\n } else if (\n configuration[method].type === \"integer\" &&\n Number.isInteger(value)\n ) {\n configuration[method].value = value;\n } else if (configuration[method].type === \"array\") {\n for (i = 0; i < value.length; i += 1) {\n isValid = true;\n if (value[i].length === 1 && typeof value[i][0] === \"number\") {\n rangeArray.push(String(value[i] - 1));\n } else if (value[i].length > 1) {\n for (j = 0; j < value[i].length; j += 1) {\n if (typeof value[i][j] !== \"number\") {\n isValid = false;\n }\n }\n if (isValid === true) {\n rangeArray.push([value[i][0] - 1, value[i][1] - 1].join(\" \"));\n }\n }\n }\n configuration[method].value = \"[\" + rangeArray.join(\" \") + \"]\";\n } else {\n configuration[method].value = configuration[method].defaultValue;\n }\n\n configuration[method].explicitSet = true;\n }\n }\n }\n\n if (this.internal.viewerpreferences.isSubscribed === false) {\n this.internal.events.subscribe(\"putCatalog\", function() {\n var pdfDict = [];\n var vPref;\n for (vPref in configuration) {\n if (configuration[vPref].explicitSet === true) {\n if (configuration[vPref].type === \"name\") {\n pdfDict.push(\"/\" + vPref + \" /\" + configuration[vPref].value);\n } else {\n pdfDict.push(\"/\" + vPref + \" \" + configuration[vPref].value);\n }\n }\n }\n if (pdfDict.length !== 0) {\n this.internal.write(\n \"/ViewerPreferences\\n<<\\n\" + pdfDict.join(\"\\n\") + \"\\n>>\"\n );\n }\n });\n this.internal.viewerpreferences.isSubscribed = true;\n }\n\n this.internal.viewerpreferences.configuration = configuration;\n return this;\n };\n})(jsPDF.API);\n","/** ====================================================================\n * @license\n * jsPDF XMP metadata plugin\n * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name xmp_metadata\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n var postPutResources = function() {\n var xmpmeta_beginning = '';\n var rdf_beginning =\n '';\n var rdf_ending = \"\";\n var xmpmeta_ending = \"\";\n var utf8_xmpmeta_beginning = unescape(\n encodeURIComponent(xmpmeta_beginning)\n );\n var utf8_rdf_beginning = unescape(encodeURIComponent(rdf_beginning));\n var utf8_metadata = unescape(\n encodeURIComponent(this.internal.__metadata__.metadata)\n );\n var utf8_rdf_ending = unescape(encodeURIComponent(rdf_ending));\n var utf8_xmpmeta_ending = unescape(encodeURIComponent(xmpmeta_ending));\n\n var total_len =\n utf8_rdf_beginning.length +\n utf8_metadata.length +\n utf8_rdf_ending.length +\n utf8_xmpmeta_beginning.length +\n utf8_xmpmeta_ending.length;\n\n this.internal.__metadata__.metadata_object_number = this.internal.newObject();\n this.internal.write(\n \"<< /Type /Metadata /Subtype /XML /Length \" + total_len + \" >>\"\n );\n this.internal.write(\"stream\");\n this.internal.write(\n utf8_xmpmeta_beginning +\n utf8_rdf_beginning +\n utf8_metadata +\n utf8_rdf_ending +\n utf8_xmpmeta_ending\n );\n this.internal.write(\"endstream\");\n this.internal.write(\"endobj\");\n };\n\n var putCatalog = function() {\n if (this.internal.__metadata__.metadata_object_number) {\n this.internal.write(\n \"/Metadata \" +\n this.internal.__metadata__.metadata_object_number +\n \" 0 R\"\n );\n }\n };\n\n /**\n * Adds XMP formatted metadata to PDF\n *\n * @name addMetadata\n * @function\n * @param {String} metadata The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters \"<\", \">\" or \"&\", those characters should be written using XML entities.\n * @param {String} namespaceuri Sets the namespace URI for the metadata. Last character should be slash or hash.\n * @returns {jsPDF} jsPDF-instance\n */\n jsPDFAPI.addMetadata = function(metadata, namespaceuri) {\n if (typeof this.internal.__metadata__ === \"undefined\") {\n this.internal.__metadata__ = {\n metadata: metadata,\n namespaceuri: namespaceuri || \"http://jspdf.default.namespaceuri/\"\n };\n this.internal.events.subscribe(\"putCatalog\", putCatalog);\n\n this.internal.events.subscribe(\"postPutResources\", postPutResources);\n }\n return this;\n };\n})(jsPDF.API);\n","import { jsPDF } from \"../jspdf.js\";\nimport { toPDFName } from \"../libs/pdfname.js\";\n\n/**\n * @name utf8\n * @module\n */\n(function(jsPDF) {\n \"use strict\";\n var jsPDFAPI = jsPDF.API;\n\n /***************************************************************************************************/\n /* function : pdfEscape16 */\n /* comment : The character id of a 2-byte string is converted to a hexadecimal number by obtaining */\n /* the corresponding glyph id and width, and then adding padding to the string. */\n /***************************************************************************************************/\n var pdfEscape16 = (jsPDFAPI.pdfEscape16 = function(text, font) {\n var widths = font.metadata.Unicode.widths;\n var padz = [\"\", \"0\", \"00\", \"000\", \"0000\"];\n var ar = [\"\"];\n for (var i = 0, l = text.length, t; i < l; ++i) {\n t = font.metadata.characterToGlyph(text.charCodeAt(i));\n font.metadata.glyIdsUsed.push(t);\n font.metadata.toUnicode[t] = text.charCodeAt(i);\n if (widths.indexOf(t) == -1) {\n widths.push(t);\n widths.push([parseInt(font.metadata.widthOfGlyph(t), 10)]);\n }\n if (t == \"0\") {\n //Spaces are not allowed in cmap.\n return ar.join(\"\");\n } else {\n t = t.toString(16);\n ar.push(padz[4 - t.length], t);\n }\n }\n return ar.join(\"\");\n });\n\n var toUnicodeCmap = function(map) {\n var code, codes, range, unicode, unicodeMap, _i, _len;\n unicodeMap =\n \"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n /Registry (Adobe)\\n /Ordering (UCS)\\n /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\";\n codes = Object.keys(map).sort(function(a, b) {\n return a - b;\n });\n\n range = [];\n for (_i = 0, _len = codes.length; _i < _len; _i++) {\n code = codes[_i];\n if (range.length >= 100) {\n unicodeMap +=\n \"\\n\" +\n range.length +\n \" beginbfchar\\n\" +\n range.join(\"\\n\") +\n \"\\nendbfchar\";\n range = [];\n }\n\n if (\n map[code] !== undefined &&\n map[code] !== null &&\n typeof map[code].toString === \"function\"\n ) {\n unicode = (\"0000\" + map[code].toString(16)).slice(-4);\n code = (\"0000\" + (+code).toString(16)).slice(-4);\n range.push(\"<\" + code + \"><\" + unicode + \">\");\n }\n }\n\n if (range.length) {\n unicodeMap +=\n \"\\n\" +\n range.length +\n \" beginbfchar\\n\" +\n range.join(\"\\n\") +\n \"\\nendbfchar\\n\";\n }\n unicodeMap +=\n \"endcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\";\n return unicodeMap;\n };\n\n var identityHFunction = function(options) {\n var font = options.font;\n var out = options.out;\n var newObject = options.newObject;\n var putStream = options.putStream;\n\n if (\n font.metadata instanceof jsPDF.API.TTFFont &&\n font.encoding === \"Identity-H\"\n ) {\n //Tag with Identity-H\n var widths = font.metadata.Unicode.widths;\n var data = font.metadata.subset.encode(font.metadata.glyIdsUsed, 1);\n var pdfOutput = data;\n var pdfOutput2 = \"\";\n for (var i = 0; i < pdfOutput.length; i++) {\n pdfOutput2 += String.fromCharCode(pdfOutput[i]);\n }\n var fontTable = newObject();\n putStream({ data: pdfOutput2, addLength1: true, objectId: fontTable });\n out(\"endobj\");\n\n var cmap = newObject();\n var cmapData = toUnicodeCmap(font.metadata.toUnicode);\n putStream({ data: cmapData, addLength1: true, objectId: cmap });\n out(\"endobj\");\n\n var fontDescriptor = newObject();\n out(\"<<\");\n out(\"/Type /FontDescriptor\");\n out(\"/FontName /\" + toPDFName(font.fontName));\n out(\"/FontFile2 \" + fontTable + \" 0 R\");\n out(\"/FontBBox \" + jsPDF.API.PDFObject.convert(font.metadata.bbox));\n out(\"/Flags \" + font.metadata.flags);\n out(\"/StemV \" + font.metadata.stemV);\n out(\"/ItalicAngle \" + font.metadata.italicAngle);\n out(\"/Ascent \" + font.metadata.ascender);\n out(\"/Descent \" + font.metadata.decender);\n out(\"/CapHeight \" + font.metadata.capHeight);\n out(\">>\");\n out(\"endobj\");\n\n var DescendantFont = newObject();\n out(\"<<\");\n out(\"/Type /Font\");\n out(\"/BaseFont /\" + toPDFName(font.fontName));\n out(\"/FontDescriptor \" + fontDescriptor + \" 0 R\");\n out(\"/W \" + jsPDF.API.PDFObject.convert(widths));\n out(\"/CIDToGIDMap /Identity\");\n out(\"/DW 1000\");\n out(\"/Subtype /CIDFontType2\");\n out(\"/CIDSystemInfo\");\n out(\"<<\");\n out(\"/Supplement 0\");\n out(\"/Registry (Adobe)\");\n out(\"/Ordering (\" + font.encoding + \")\");\n out(\">>\");\n out(\">>\");\n out(\"endobj\");\n\n font.objectNumber = newObject();\n out(\"<<\");\n out(\"/Type /Font\");\n out(\"/Subtype /Type0\");\n out(\"/ToUnicode \" + cmap + \" 0 R\");\n out(\"/BaseFont /\" + toPDFName(font.fontName));\n out(\"/Encoding /\" + font.encoding);\n out(\"/DescendantFonts [\" + DescendantFont + \" 0 R]\");\n out(\">>\");\n out(\"endobj\");\n\n font.isAlreadyPutted = true;\n }\n };\n\n jsPDFAPI.events.push([\n \"putFont\",\n function(args) {\n identityHFunction(args);\n }\n ]);\n\n var winAnsiEncodingFunction = function(options) {\n var font = options.font;\n var out = options.out;\n var newObject = options.newObject;\n var putStream = options.putStream;\n\n if (\n font.metadata instanceof jsPDF.API.TTFFont &&\n font.encoding === \"WinAnsiEncoding\"\n ) {\n //Tag with WinAnsi encoding\n var data = font.metadata.rawData;\n var pdfOutput = data;\n var pdfOutput2 = \"\";\n for (var i = 0; i < pdfOutput.length; i++) {\n pdfOutput2 += String.fromCharCode(pdfOutput[i]);\n }\n var fontTable = newObject();\n putStream({ data: pdfOutput2, addLength1: true, objectId: fontTable });\n out(\"endobj\");\n\n var cmap = newObject();\n var cmapData = toUnicodeCmap(font.metadata.toUnicode);\n putStream({ data: cmapData, addLength1: true, objectId: cmap });\n out(\"endobj\");\n\n var fontDescriptor = newObject();\n out(\"<<\");\n out(\"/Descent \" + font.metadata.decender);\n out(\"/CapHeight \" + font.metadata.capHeight);\n out(\"/StemV \" + font.metadata.stemV);\n out(\"/Type /FontDescriptor\");\n out(\"/FontFile2 \" + fontTable + \" 0 R\");\n out(\"/Flags 96\");\n out(\"/FontBBox \" + jsPDF.API.PDFObject.convert(font.metadata.bbox));\n out(\"/FontName /\" + toPDFName(font.fontName));\n out(\"/ItalicAngle \" + font.metadata.italicAngle);\n out(\"/Ascent \" + font.metadata.ascender);\n out(\">>\");\n out(\"endobj\");\n font.objectNumber = newObject();\n for (var j = 0; j < font.metadata.hmtx.widths.length; j++) {\n font.metadata.hmtx.widths[j] = parseInt(\n font.metadata.hmtx.widths[j] * (1000 / font.metadata.head.unitsPerEm)\n ); //Change the width of Em units to Point units.\n }\n out(\n \"<>\"\n );\n out(\"endobj\");\n font.isAlreadyPutted = true;\n }\n };\n\n jsPDFAPI.events.push([\n \"putFont\",\n function(args) {\n winAnsiEncodingFunction(args);\n }\n ]);\n\n var utf8TextFunction = function(args) {\n var text = args.text || \"\";\n var x = args.x;\n var y = args.y;\n var options = args.options || {};\n var mutex = args.mutex || {};\n\n var pdfEscape = mutex.pdfEscape;\n var activeFontKey = mutex.activeFontKey;\n var fonts = mutex.fonts;\n var key = activeFontKey;\n\n var str = \"\",\n s = 0,\n cmapConfirm;\n var strText = \"\";\n var encoding = fonts[key].encoding;\n\n if (fonts[key].encoding !== \"Identity-H\") {\n return {\n text: text,\n x: x,\n y: y,\n options: options,\n mutex: mutex\n };\n }\n strText = text;\n\n key = activeFontKey;\n if (Array.isArray(text)) {\n strText = text[0];\n }\n for (s = 0; s < strText.length; s += 1) {\n if (fonts[key].metadata.hasOwnProperty(\"cmap\")) {\n cmapConfirm =\n fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)];\n /*\n if (Object.prototype.toString.call(text) === '[object Array]') {\n var i = 0;\n // for (i = 0; i < text.length; i += 1) {\n if (Object.prototype.toString.call(text[s]) === '[object Array]') {\n cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s][0].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id\n } else {\n\n }\n //}\n\n } else {\n cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id\n }*/\n }\n if (!cmapConfirm) {\n if (\n strText[s].charCodeAt(0) < 256 &&\n fonts[key].metadata.hasOwnProperty(\"Unicode\")\n ) {\n str += strText[s];\n } else {\n str += \"\";\n }\n } else {\n str += strText[s];\n }\n }\n var result = \"\";\n if (parseInt(key.slice(1)) < 14 || encoding === \"WinAnsiEncoding\") {\n //For the default 13 font\n result = pdfEscape(str, key)\n .split(\"\")\n .map(function(cv) {\n return cv.charCodeAt(0).toString(16);\n })\n .join(\"\");\n } else if (encoding === \"Identity-H\") {\n result = pdfEscape16(str, fonts[key]);\n }\n mutex.isHex = true;\n\n return {\n text: result,\n x: x,\n y: y,\n options: options,\n mutex: mutex\n };\n };\n\n var utf8EscapeFunction = function(parms) {\n var text = parms.text || \"\",\n x = parms.x,\n y = parms.y,\n options = parms.options,\n mutex = parms.mutex;\n var tmpText = [];\n var args = {\n text: text,\n x: x,\n y: y,\n options: options,\n mutex: mutex\n };\n\n if (Array.isArray(text)) {\n var i = 0;\n for (i = 0; i < text.length; i += 1) {\n if (Array.isArray(text[i])) {\n if (text[i].length === 3) {\n tmpText.push([\n utf8TextFunction(Object.assign({}, args, { text: text[i][0] }))\n .text,\n text[i][1],\n text[i][2]\n ]);\n } else {\n tmpText.push(\n utf8TextFunction(Object.assign({}, args, { text: text[i] })).text\n );\n }\n } else {\n tmpText.push(\n utf8TextFunction(Object.assign({}, args, { text: text[i] })).text\n );\n }\n }\n parms.text = tmpText;\n } else {\n parms.text = utf8TextFunction(\n Object.assign({}, args, { text: text })\n ).text;\n }\n };\n\n jsPDFAPI.events.push([\"postProcessText\", utf8EscapeFunction]);\n})(jsPDF);\n","/**\n * @license\n * jsPDF virtual FileSystem functionality\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * Use the vFS to handle files\n *\n * @name vFS\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n var _initializeVFS = function() {\n if (typeof this.internal.vFS === \"undefined\") {\n this.internal.vFS = {};\n }\n return true;\n };\n\n /**\n * Check if the file exists in the vFS\n *\n * @name existsFileInVFS\n * @function\n * @param {string} Possible filename in the vFS.\n * @returns {boolean}\n * @example\n * doc.existsFileInVFS(\"someFile.txt\");\n */\n jsPDFAPI.existsFileInVFS = function(filename) {\n _initializeVFS.call(this);\n return typeof this.internal.vFS[filename] !== \"undefined\";\n };\n\n /**\n * Add a file to the vFS\n *\n * @name addFileToVFS\n * @function\n * @param {string} filename The name of the file which should be added.\n * @param {string} filecontent The content of the file.\n * @returns {jsPDF}\n * @example\n * doc.addFileToVFS(\"someFile.txt\", \"BADFACE1\");\n */\n jsPDFAPI.addFileToVFS = function(filename, filecontent) {\n _initializeVFS.call(this);\n this.internal.vFS[filename] = filecontent;\n return this;\n };\n\n /**\n * Get the file from the vFS\n *\n * @name getFileFromVFS\n * @function\n * @param {string} The name of the file which gets requested.\n * @returns {string}\n * @example\n * doc.getFileFromVFS(\"someFile.txt\");\n */\n jsPDFAPI.getFileFromVFS = function(filename) {\n _initializeVFS.call(this);\n\n if (typeof this.internal.vFS[filename] !== \"undefined\") {\n return this.internal.vFS[filename];\n }\n return null;\n };\n})(jsPDF.API);\n","/**\n * @license\n * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)\n * MIT License\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n(function(jsPDF) {\n \"use strict\";\n /**\n * Table of Unicode types.\n *\n * Generated by:\n *\n * var bidi = require(\"./bidi/index\");\n * var bidi_accumulate = bidi.slice(0, 256).concat(bidi.slice(0x0500, 0x0500 + 256 * 3)).\n * concat(bidi.slice(0x2000, 0x2000 + 256)).concat(bidi.slice(0xFB00, 0xFB00 + 256)).\n * concat(bidi.slice(0xFE00, 0xFE00 + 2 * 256));\n *\n * for( var i = 0; i < bidi_accumulate.length; i++) {\n * \tif(bidi_accumulate[i] === undefined || bidi_accumulate[i] === 'ON')\n * \t\tbidi_accumulate[i] = 'N'; //mark as neutral to conserve space and substitute undefined\n * }\n * var bidiAccumulateStr = 'return [ \"' + bidi_accumulate.toString().replace(/,/g, '\", \"') + '\" ];';\n * require(\"fs\").writeFile('unicode-types.js', bidiAccumulateStr);\n *\n * Based on:\n * https://github.com/mathiasbynens/unicode-8.0.0\n */\n var bidiUnicodeTypes = [\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"S\",\n \"B\",\n \"S\",\n \"WS\",\n \"B\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"B\",\n \"B\",\n \"B\",\n \"S\",\n \"WS\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"ES\",\n \"CS\",\n \"ES\",\n \"CS\",\n \"CS\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"CS\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"B\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"CS\",\n \"N\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"N\",\n \"N\",\n \"BN\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"EN\",\n \"EN\",\n \"N\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"EN\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"R\",\n \"NSM\",\n \"R\",\n \"NSM\",\n \"NSM\",\n \"R\",\n \"NSM\",\n \"NSM\",\n \"R\",\n \"NSM\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"N\",\n \"N\",\n \"AL\",\n \"ET\",\n \"ET\",\n \"AL\",\n \"CS\",\n \"AL\",\n \"N\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AL\",\n \"AL\",\n \"N\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"AN\",\n \"ET\",\n \"AN\",\n \"AN\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AN\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AL\",\n \"AL\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"N\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"N\",\n \"N\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"AL\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"R\",\n \"R\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"R\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"WS\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"L\",\n \"R\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"WS\",\n \"B\",\n \"LRE\",\n \"RLE\",\n \"PDF\",\n \"LRO\",\n \"RLO\",\n \"CS\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"CS\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"WS\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"N\",\n \"LRI\",\n \"RLI\",\n \"FSI\",\n \"PDI\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"BN\",\n \"EN\",\n \"L\",\n \"N\",\n \"N\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"ES\",\n \"ES\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"ES\",\n \"ES\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"R\",\n \"NSM\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"ES\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"N\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"N\",\n \"R\",\n \"N\",\n \"R\",\n \"R\",\n \"N\",\n \"R\",\n \"R\",\n \"N\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"R\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"NSM\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"CS\",\n \"N\",\n \"CS\",\n \"N\",\n \"N\",\n \"CS\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"N\",\n \"N\",\n \"ES\",\n \"ES\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"N\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"AL\",\n \"N\",\n \"N\",\n \"BN\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"ES\",\n \"CS\",\n \"ES\",\n \"CS\",\n \"CS\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"EN\",\n \"CS\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"L\",\n \"L\",\n \"L\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"ET\",\n \"ET\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\",\n \"N\"\n ];\n\n /**\n * Unicode Bidi algorithm compliant Bidi engine.\n * For reference see http://unicode.org/reports/tr9/\n */\n\n /**\n * constructor ( options )\n *\n * Initializes Bidi engine\n *\n * @param {Object} See 'setOptions' below for detailed description.\n * options are cashed between invocation of 'doBidiReorder' method\n *\n * sample usage pattern of BidiEngine:\n * var opt = {\n * \tisInputVisual: true,\n * \tisInputRtl: false,\n * \tisOutputVisual: false,\n * \tisOutputRtl: false,\n * \tisSymmetricSwapping: true\n * }\n * var sourceToTarget = [], levels = [];\n * var bidiEng = Globalize.bidiEngine(opt);\n * var src = \"text string to be reordered\";\n * var ret = bidiEng.doBidiReorder(src, sourceToTarget, levels);\n */\n\n jsPDF.__bidiEngine__ = jsPDF.prototype.__bidiEngine__ = function(options) {\n var _UNICODE_TYPES = _bidiUnicodeTypes;\n\n var _STATE_TABLE_LTR = [\n [0, 3, 0, 1, 0, 0, 0],\n [0, 3, 0, 1, 2, 2, 0],\n [0, 3, 0, 0x11, 2, 0, 1],\n [0, 3, 5, 5, 4, 1, 0],\n [0, 3, 0x15, 0x15, 4, 0, 1],\n [0, 3, 5, 5, 4, 2, 0]\n ];\n\n var _STATE_TABLE_RTL = [\n [2, 0, 1, 1, 0, 1, 0],\n [2, 0, 1, 1, 0, 2, 0],\n [2, 0, 2, 1, 3, 2, 0],\n [2, 0, 2, 0x21, 3, 1, 1]\n ];\n\n var _TYPE_NAMES_MAP = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 };\n\n var _UNICODE_RANGES_MAP = {\n 0: 0,\n 5: 1,\n 6: 2,\n 7: 3,\n 0x20: 4,\n 0xfb: 5,\n 0xfe: 6,\n 0xff: 7\n };\n\n var _SWAP_TABLE = [\n \"\\u0028\",\n \"\\u0029\",\n \"\\u0028\",\n \"\\u003C\",\n \"\\u003E\",\n \"\\u003C\",\n \"\\u005B\",\n \"\\u005D\",\n \"\\u005B\",\n \"\\u007B\",\n \"\\u007D\",\n \"\\u007B\",\n \"\\u00AB\",\n \"\\u00BB\",\n \"\\u00AB\",\n \"\\u2039\",\n \"\\u203A\",\n \"\\u2039\",\n \"\\u2045\",\n \"\\u2046\",\n \"\\u2045\",\n \"\\u207D\",\n \"\\u207E\",\n \"\\u207D\",\n \"\\u208D\",\n \"\\u208E\",\n \"\\u208D\",\n \"\\u2264\",\n \"\\u2265\",\n \"\\u2264\",\n \"\\u2329\",\n \"\\u232A\",\n \"\\u2329\",\n \"\\uFE59\",\n \"\\uFE5A\",\n \"\\uFE59\",\n \"\\uFE5B\",\n \"\\uFE5C\",\n \"\\uFE5B\",\n \"\\uFE5D\",\n \"\\uFE5E\",\n \"\\uFE5D\",\n \"\\uFE64\",\n \"\\uFE65\",\n \"\\uFE64\"\n ];\n\n var _LTR_RANGES_REG_EXPR = new RegExp(\n /^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/\n );\n\n var _lastArabic = false,\n _hasUbatAl,\n _hasUbatB,\n _hasUbatS,\n DIR_LTR = 0,\n DIR_RTL = 1,\n _isInVisual,\n _isInRtl,\n _isOutVisual,\n _isOutRtl,\n _isSymmetricSwapping,\n _dir = DIR_LTR;\n\n this.__bidiEngine__ = {};\n\n var _init = function(text, sourceToTargetMap) {\n if (sourceToTargetMap) {\n for (var i = 0; i < text.length; i++) {\n sourceToTargetMap[i] = i;\n }\n }\n if (_isInRtl === undefined) {\n _isInRtl = _isContextualDirRtl(text);\n }\n if (_isOutRtl === undefined) {\n _isOutRtl = _isContextualDirRtl(text);\n }\n };\n\n // for reference see 3.2 in http://unicode.org/reports/tr9/\n //\n var _getCharType = function(ch) {\n var charCode = ch.charCodeAt(),\n range = charCode >> 8,\n rangeIdx = _UNICODE_RANGES_MAP[range];\n\n if (rangeIdx !== undefined) {\n return _UNICODE_TYPES[rangeIdx * 256 + (charCode & 0xff)];\n } else if (range === 0xfc || range === 0xfd) {\n return \"AL\";\n } else if (_LTR_RANGES_REG_EXPR.test(range)) {\n //unlikely case\n return \"L\";\n } else if (range === 8) {\n // even less likely\n return \"R\";\n }\n return \"N\"; //undefined type, mark as neutral\n };\n\n var _isContextualDirRtl = function(text) {\n for (var i = 0, charType; i < text.length; i++) {\n charType = _getCharType(text.charAt(i));\n if (charType === \"L\") {\n return false;\n } else if (charType === \"R\") {\n return true;\n }\n }\n return false;\n };\n\n // for reference see 3.3.4 & 3.3.5 in http://unicode.org/reports/tr9/\n //\n var _resolveCharType = function(chars, types, resolvedTypes, index) {\n var cType = types[index],\n wType,\n nType,\n i,\n len;\n switch (cType) {\n case \"L\":\n case \"R\":\n _lastArabic = false;\n break;\n case \"N\":\n case \"AN\":\n break;\n\n case \"EN\":\n if (_lastArabic) {\n cType = \"AN\";\n }\n break;\n\n case \"AL\":\n _lastArabic = true;\n _hasUbatAl = true;\n cType = \"R\";\n break;\n\n case \"WS\":\n cType = \"N\";\n break;\n\n case \"CS\":\n if (\n index < 1 ||\n index + 1 >= types.length ||\n ((wType = resolvedTypes[index - 1]) !== \"EN\" && wType !== \"AN\") ||\n ((nType = types[index + 1]) !== \"EN\" && nType !== \"AN\")\n ) {\n cType = \"N\";\n } else if (_lastArabic) {\n nType = \"AN\";\n }\n cType = nType === wType ? nType : \"N\";\n break;\n\n case \"ES\":\n wType = index > 0 ? resolvedTypes[index - 1] : \"B\";\n cType =\n wType === \"EN\" &&\n index + 1 < types.length &&\n types[index + 1] === \"EN\"\n ? \"EN\"\n : \"N\";\n break;\n\n case \"ET\":\n if (index > 0 && resolvedTypes[index - 1] === \"EN\") {\n cType = \"EN\";\n break;\n } else if (_lastArabic) {\n cType = \"N\";\n break;\n }\n i = index + 1;\n len = types.length;\n while (i < len && types[i] === \"ET\") {\n i++;\n }\n if (i < len && types[i] === \"EN\") {\n cType = \"EN\";\n } else {\n cType = \"N\";\n }\n break;\n\n case \"NSM\":\n if (_isInVisual && !_isInRtl) {\n //V->L\n len = types.length;\n i = index + 1;\n while (i < len && types[i] === \"NSM\") {\n i++;\n }\n if (i < len) {\n var c = chars[index];\n var rtlCandidate = (c >= 0x0591 && c <= 0x08ff) || c === 0xfb1e;\n wType = types[i];\n if (rtlCandidate && (wType === \"R\" || wType === \"AL\")) {\n cType = \"R\";\n break;\n }\n }\n }\n if (index < 1 || (wType = types[index - 1]) === \"B\") {\n cType = \"N\";\n } else {\n cType = resolvedTypes[index - 1];\n }\n break;\n\n case \"B\":\n _lastArabic = false;\n _hasUbatB = true;\n cType = _dir;\n break;\n\n case \"S\":\n _hasUbatS = true;\n cType = \"N\";\n break;\n\n case \"LRE\":\n case \"RLE\":\n case \"LRO\":\n case \"RLO\":\n case \"PDF\":\n _lastArabic = false;\n break;\n case \"BN\":\n cType = \"N\";\n break;\n }\n return cType;\n };\n\n var _handleUbatS = function(types, levels, length) {\n for (var i = 0; i < length; i++) {\n if (types[i] === \"S\") {\n levels[i] = _dir;\n for (var j = i - 1; j >= 0; j--) {\n if (types[j] === \"WS\") {\n levels[j] = _dir;\n } else {\n break;\n }\n }\n }\n }\n };\n\n var _invertString = function(text, sourceToTargetMap, levels) {\n var charArray = text.split(\"\");\n if (levels) {\n _computeLevels(charArray, levels, { hiLevel: _dir });\n }\n charArray.reverse();\n sourceToTargetMap && sourceToTargetMap.reverse();\n return charArray.join(\"\");\n };\n\n // For reference see 3.3 in http://unicode.org/reports/tr9/\n //\n var _computeLevels = function(chars, levels, params) {\n var action,\n condition,\n i,\n index,\n newLevel,\n prevState,\n condPos = -1,\n len = chars.length,\n newState = 0,\n resolvedTypes = [],\n stateTable = _dir ? _STATE_TABLE_RTL : _STATE_TABLE_LTR,\n types = [];\n\n _lastArabic = false;\n _hasUbatAl = false;\n _hasUbatB = false;\n _hasUbatS = false;\n for (i = 0; i < len; i++) {\n types[i] = _getCharType(chars[i]);\n }\n for (index = 0; index < len; index++) {\n prevState = newState;\n resolvedTypes[index] = _resolveCharType(\n chars,\n types,\n resolvedTypes,\n index\n );\n newState = stateTable[prevState][_TYPE_NAMES_MAP[resolvedTypes[index]]];\n action = newState & 0xf0;\n newState &= 0x0f;\n levels[index] = newLevel = stateTable[newState][5];\n if (action > 0) {\n if (action === 0x10) {\n for (i = condPos; i < index; i++) {\n levels[i] = 1;\n }\n condPos = -1;\n } else {\n condPos = -1;\n }\n }\n condition = stateTable[newState][6];\n if (condition) {\n if (condPos === -1) {\n condPos = index;\n }\n } else {\n if (condPos > -1) {\n for (i = condPos; i < index; i++) {\n levels[i] = newLevel;\n }\n condPos = -1;\n }\n }\n if (types[index] === \"B\") {\n levels[index] = 0;\n }\n params.hiLevel |= newLevel;\n }\n if (_hasUbatS) {\n _handleUbatS(types, levels, len);\n }\n };\n\n // for reference see 3.4 in http://unicode.org/reports/tr9/\n //\n var _invertByLevel = function(\n level,\n charArray,\n sourceToTargetMap,\n levels,\n params\n ) {\n if (params.hiLevel < level) {\n return;\n }\n if (level === 1 && _dir === DIR_RTL && !_hasUbatB) {\n charArray.reverse();\n sourceToTargetMap && sourceToTargetMap.reverse();\n return;\n }\n var ch,\n high,\n end,\n low,\n len = charArray.length,\n start = 0;\n\n while (start < len) {\n if (levels[start] >= level) {\n end = start + 1;\n while (end < len && levels[end] >= level) {\n end++;\n }\n for (low = start, high = end - 1; low < high; low++, high--) {\n ch = charArray[low];\n charArray[low] = charArray[high];\n charArray[high] = ch;\n if (sourceToTargetMap) {\n ch = sourceToTargetMap[low];\n sourceToTargetMap[low] = sourceToTargetMap[high];\n sourceToTargetMap[high] = ch;\n }\n }\n start = end;\n }\n start++;\n }\n };\n\n // for reference see 7 & BD16 in http://unicode.org/reports/tr9/\n //\n var _symmetricSwap = function(charArray, levels, params) {\n if (params.hiLevel !== 0 && _isSymmetricSwapping) {\n for (var i = 0, index; i < charArray.length; i++) {\n if (levels[i] === 1) {\n index = _SWAP_TABLE.indexOf(charArray[i]);\n if (index >= 0) {\n charArray[i] = _SWAP_TABLE[index + 1];\n }\n }\n }\n }\n };\n\n var _reorder = function(text, sourceToTargetMap, levels) {\n var charArray = text.split(\"\"),\n params = { hiLevel: _dir };\n\n if (!levels) {\n levels = [];\n }\n _computeLevels(charArray, levels, params);\n _symmetricSwap(charArray, levels, params);\n _invertByLevel(DIR_RTL + 1, charArray, sourceToTargetMap, levels, params);\n _invertByLevel(DIR_RTL, charArray, sourceToTargetMap, levels, params);\n return charArray.join(\"\");\n };\n\n // doBidiReorder( text, sourceToTargetMap, levels )\n // Performs Bidi reordering by implementing Unicode Bidi algorithm.\n // Returns reordered string\n // @text [String]:\n // - input string to be reordered, this is input parameter\n // $sourceToTargetMap [Array] (optional)\n // - resultant mapping between input and output strings, this is output parameter\n // $levels [Array] (optional)\n // - array of calculated Bidi levels, , this is output parameter\n this.__bidiEngine__.doBidiReorder = function(\n text,\n sourceToTargetMap,\n levels\n ) {\n _init(text, sourceToTargetMap);\n if (!_isInVisual && _isOutVisual && !_isOutRtl) {\n // LLTR->VLTR, LRTL->VLTR\n _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n text = _reorder(text, sourceToTargetMap, levels);\n } else if (_isInVisual && _isOutVisual && _isInRtl ^ _isOutRtl) {\n // VRTL->VLTR, VLTR->VRTL\n _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n text = _invertString(text, sourceToTargetMap, levels);\n } else if (!_isInVisual && _isOutVisual && _isOutRtl) {\n // LLTR->VRTL, LRTL->VRTL\n _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n text = _reorder(text, sourceToTargetMap, levels);\n text = _invertString(text, sourceToTargetMap);\n } else if (_isInVisual && !_isInRtl && !_isOutVisual && !_isOutRtl) {\n // VLTR->LLTR\n _dir = DIR_LTR;\n text = _reorder(text, sourceToTargetMap, levels);\n } else if (_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {\n // VLTR->LRTL, VRTL->LLTR\n text = _invertString(text, sourceToTargetMap);\n if (_isInRtl) {\n //LLTR -> VLTR\n _dir = DIR_LTR;\n text = _reorder(text, sourceToTargetMap, levels);\n } else {\n //LRTL -> VRTL\n _dir = DIR_RTL;\n text = _reorder(text, sourceToTargetMap, levels);\n text = _invertString(text, sourceToTargetMap);\n }\n } else if (_isInVisual && _isInRtl && !_isOutVisual && _isOutRtl) {\n // VRTL->LRTL\n _dir = DIR_RTL;\n text = _reorder(text, sourceToTargetMap, levels);\n text = _invertString(text, sourceToTargetMap);\n } else if (!_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {\n // LRTL->LLTR, LLTR->LRTL\n var isSymmetricSwappingOrig = _isSymmetricSwapping;\n if (_isInRtl) {\n //LRTL->LLTR\n _dir = DIR_RTL;\n text = _reorder(text, sourceToTargetMap, levels);\n _dir = DIR_LTR;\n _isSymmetricSwapping = false;\n text = _reorder(text, sourceToTargetMap, levels);\n _isSymmetricSwapping = isSymmetricSwappingOrig;\n } else {\n //LLTR->LRTL\n _dir = DIR_LTR;\n text = _reorder(text, sourceToTargetMap, levels);\n text = _invertString(text, sourceToTargetMap);\n _dir = DIR_RTL;\n _isSymmetricSwapping = false;\n text = _reorder(text, sourceToTargetMap, levels);\n _isSymmetricSwapping = isSymmetricSwappingOrig;\n text = _invertString(text, sourceToTargetMap);\n }\n }\n return text;\n };\n\n /**\n * @name setOptions( options )\n * @function\n * Sets options for Bidi conversion\n * @param {Object}:\n * - isInputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)\n * - isInputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string)\n * - isOutputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)\n * - isOutputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string)\n * - isSymmetricSwapping {boolean} (defaults to false): allowed values true(needs symmetric swapping), false (no need in symmetric swapping),\n */\n this.__bidiEngine__.setOptions = function(options) {\n if (options) {\n _isInVisual = options.isInputVisual;\n _isOutVisual = options.isOutputVisual;\n _isInRtl = options.isInputRtl;\n _isOutRtl = options.isOutputRtl;\n _isSymmetricSwapping = options.isSymmetricSwapping;\n }\n };\n\n this.__bidiEngine__.setOptions(options);\n return this.__bidiEngine__;\n };\n\n var _bidiUnicodeTypes = bidiUnicodeTypes;\n\n var bidiEngine = new jsPDF.__bidiEngine__({ isInputVisual: true });\n\n var bidiEngineFunction = function(args) {\n var text = args.text;\n var x = args.x;\n var y = args.y;\n var options = args.options || {};\n var mutex = args.mutex || {};\n var lang = options.lang;\n var tmpText = [];\n\n options.isInputVisual =\n typeof options.isInputVisual === \"boolean\" ? options.isInputVisual : true;\n bidiEngine.setOptions(options);\n\n if (Object.prototype.toString.call(text) === \"[object Array]\") {\n var i = 0;\n tmpText = [];\n for (i = 0; i < text.length; i += 1) {\n if (Object.prototype.toString.call(text[i]) === \"[object Array]\") {\n tmpText.push([\n bidiEngine.doBidiReorder(text[i][0]),\n text[i][1],\n text[i][2]\n ]);\n } else {\n tmpText.push([bidiEngine.doBidiReorder(text[i])]);\n }\n }\n args.text = tmpText;\n } else {\n args.text = bidiEngine.doBidiReorder(text);\n }\n bidiEngine.setOptions({ isInputVisual: true });\n };\n\n jsPDF.API.events.push([\"postProcessText\", bidiEngineFunction]);\n})(jsPDF);\n","/* eslint-disable no-control-regex */\n/************************************************\n * Title : custom font *\n * Start Data : 2017. 01. 22. *\n * Comment : TEXT API *\n ************************************************/\n\n/******************************\n * jsPDF extension API Design *\n * ****************************/\n\nimport { jsPDF } from \"../jspdf.js\";\n\njsPDF.API.TTFFont = (function() {\n /************************************************************************/\n /* function : open */\n /* comment : Decode the encoded ttf content and create a TTFFont object. */\n /************************************************************************/\n TTFFont.open = function(file) {\n return new TTFFont(file);\n };\n /***************************************************************/\n /* function : TTFFont gernerator */\n /* comment : Decode TTF contents are parsed, Data, */\n /* Subset object is created, and registerTTF function is called.*/\n /***************************************************************/\n function TTFFont(rawData) {\n var data;\n this.rawData = rawData;\n data = this.contents = new Data(rawData);\n this.contents.pos = 4;\n if (data.readString(4) === \"ttcf\") {\n throw new Error(\"TTCF not supported.\");\n } else {\n data.pos = 0;\n this.parse();\n this.subset = new Subset(this);\n this.registerTTF();\n }\n }\n /********************************************************/\n /* function : parse */\n /* comment : TTF Parses the file contents by each table.*/\n /********************************************************/\n TTFFont.prototype.parse = function() {\n this.directory = new Directory(this.contents);\n this.head = new HeadTable(this);\n this.name = new NameTable(this);\n this.cmap = new CmapTable(this);\n this.toUnicode = {};\n this.hhea = new HheaTable(this);\n this.maxp = new MaxpTable(this);\n this.hmtx = new HmtxTable(this);\n this.post = new PostTable(this);\n this.os2 = new OS2Table(this);\n this.loca = new LocaTable(this);\n this.glyf = new GlyfTable(this);\n this.ascender =\n (this.os2.exists && this.os2.ascender) || this.hhea.ascender;\n this.decender =\n (this.os2.exists && this.os2.decender) || this.hhea.decender;\n this.lineGap = (this.os2.exists && this.os2.lineGap) || this.hhea.lineGap;\n return (this.bbox = [\n this.head.xMin,\n this.head.yMin,\n this.head.xMax,\n this.head.yMax\n ]);\n };\n /***************************************************************/\n /* function : registerTTF */\n /* comment : Get the value to assign pdf font descriptors. */\n /***************************************************************/\n TTFFont.prototype.registerTTF = function() {\n var e, hi, low, raw, _ref;\n this.scaleFactor = 1000.0 / this.head.unitsPerEm;\n this.bbox = function() {\n var _i, _len, _ref, _results;\n _ref = this.bbox;\n _results = [];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n e = _ref[_i];\n _results.push(Math.round(e * this.scaleFactor));\n }\n return _results;\n }.call(this);\n this.stemV = 0;\n if (this.post.exists) {\n raw = this.post.italic_angle;\n hi = raw >> 16;\n low = raw & 0xff;\n if ((hi & 0x8000) !== 0) {\n hi = -((hi ^ 0xffff) + 1);\n }\n this.italicAngle = +(\"\" + hi + \".\" + low);\n } else {\n this.italicAngle = 0;\n }\n this.ascender = Math.round(this.ascender * this.scaleFactor);\n this.decender = Math.round(this.decender * this.scaleFactor);\n this.lineGap = Math.round(this.lineGap * this.scaleFactor);\n this.capHeight = (this.os2.exists && this.os2.capHeight) || this.ascender;\n this.xHeight = (this.os2.exists && this.os2.xHeight) || 0;\n this.familyClass = ((this.os2.exists && this.os2.familyClass) || 0) >> 8;\n this.isSerif =\n (_ref = this.familyClass) === 1 ||\n _ref === 2 ||\n _ref === 3 ||\n _ref === 4 ||\n _ref === 5 ||\n _ref === 7;\n this.isScript = this.familyClass === 10;\n this.flags = 0;\n if (this.post.isFixedPitch) {\n this.flags |= 1 << 0;\n }\n if (this.isSerif) {\n this.flags |= 1 << 1;\n }\n if (this.isScript) {\n this.flags |= 1 << 3;\n }\n if (this.italicAngle !== 0) {\n this.flags |= 1 << 6;\n }\n this.flags |= 1 << 5;\n if (!this.cmap.unicode) {\n throw new Error(\"No unicode cmap for font\");\n }\n };\n TTFFont.prototype.characterToGlyph = function(character) {\n var _ref;\n return (\n ((_ref = this.cmap.unicode) != null ? _ref.codeMap[character] : void 0) ||\n 0\n );\n };\n TTFFont.prototype.widthOfGlyph = function(glyph) {\n var scale;\n scale = 1000.0 / this.head.unitsPerEm;\n return this.hmtx.forGlyph(glyph).advance * scale;\n };\n TTFFont.prototype.widthOfString = function(string, size, charSpace) {\n var charCode, i, scale, width, _ref;\n string = \"\" + string;\n width = 0;\n for (\n i = 0, _ref = string.length;\n 0 <= _ref ? i < _ref : i > _ref;\n i = 0 <= _ref ? ++i : --i\n ) {\n charCode = string.charCodeAt(i);\n width +=\n this.widthOfGlyph(this.characterToGlyph(charCode)) +\n charSpace * (1000 / size) || 0;\n }\n scale = size / 1000;\n return width * scale;\n };\n TTFFont.prototype.lineHeight = function(size, includeGap) {\n var gap;\n if (includeGap == null) {\n includeGap = false;\n }\n gap = includeGap ? this.lineGap : 0;\n return ((this.ascender + gap - this.decender) / 1000) * size;\n };\n return TTFFont;\n})();\n\n/************************************************************************************************/\n/* function : Data */\n/* comment : The ttf data decoded and stored in an array is read and written to the Data object.*/\n/************************************************************************************************/\nvar Data = (function() {\n function Data(data) {\n this.data = data != null ? data : [];\n this.pos = 0;\n this.length = this.data.length;\n }\n Data.prototype.readByte = function() {\n return this.data[this.pos++];\n };\n Data.prototype.writeByte = function(byte) {\n return (this.data[this.pos++] = byte);\n };\n Data.prototype.readUInt32 = function() {\n var b1, b2, b3, b4;\n b1 = this.readByte() * 0x1000000;\n b2 = this.readByte() << 16;\n b3 = this.readByte() << 8;\n b4 = this.readByte();\n return b1 + b2 + b3 + b4;\n };\n Data.prototype.writeUInt32 = function(val) {\n this.writeByte((val >>> 24) & 0xff);\n this.writeByte((val >> 16) & 0xff);\n this.writeByte((val >> 8) & 0xff);\n return this.writeByte(val & 0xff);\n };\n Data.prototype.readInt32 = function() {\n var int;\n int = this.readUInt32();\n if (int >= 0x80000000) {\n return int - 0x100000000;\n } else {\n return int;\n }\n };\n Data.prototype.writeInt32 = function(val) {\n if (val < 0) {\n val += 0x100000000;\n }\n return this.writeUInt32(val);\n };\n Data.prototype.readUInt16 = function() {\n var b1, b2;\n b1 = this.readByte() << 8;\n b2 = this.readByte();\n return b1 | b2;\n };\n Data.prototype.writeUInt16 = function(val) {\n this.writeByte((val >> 8) & 0xff);\n return this.writeByte(val & 0xff);\n };\n Data.prototype.readInt16 = function() {\n var int;\n int = this.readUInt16();\n if (int >= 0x8000) {\n return int - 0x10000;\n } else {\n return int;\n }\n };\n Data.prototype.writeInt16 = function(val) {\n if (val < 0) {\n val += 0x10000;\n }\n return this.writeUInt16(val);\n };\n Data.prototype.readString = function(length) {\n var i, ret;\n ret = [];\n for (\n i = 0;\n 0 <= length ? i < length : i > length;\n i = 0 <= length ? ++i : --i\n ) {\n ret[i] = String.fromCharCode(this.readByte());\n }\n return ret.join(\"\");\n };\n Data.prototype.writeString = function(val) {\n var i, _ref, _results;\n _results = [];\n for (\n i = 0, _ref = val.length;\n 0 <= _ref ? i < _ref : i > _ref;\n i = 0 <= _ref ? ++i : --i\n ) {\n _results.push(this.writeByte(val.charCodeAt(i)));\n }\n return _results;\n };\n /*Data.prototype.stringAt = function (pos, length) {\n this.pos = pos;\n return this.readString(length);\n };*/\n Data.prototype.readShort = function() {\n return this.readInt16();\n };\n Data.prototype.writeShort = function(val) {\n return this.writeInt16(val);\n };\n Data.prototype.readLongLong = function() {\n var b1, b2, b3, b4, b5, b6, b7, b8;\n b1 = this.readByte();\n b2 = this.readByte();\n b3 = this.readByte();\n b4 = this.readByte();\n b5 = this.readByte();\n b6 = this.readByte();\n b7 = this.readByte();\n b8 = this.readByte();\n if (b1 & 0x80) {\n return (\n ((b1 ^ 0xff) * 0x100000000000000 +\n (b2 ^ 0xff) * 0x1000000000000 +\n (b3 ^ 0xff) * 0x10000000000 +\n (b4 ^ 0xff) * 0x100000000 +\n (b5 ^ 0xff) * 0x1000000 +\n (b6 ^ 0xff) * 0x10000 +\n (b7 ^ 0xff) * 0x100 +\n (b8 ^ 0xff) +\n 1) *\n -1\n );\n }\n return (\n b1 * 0x100000000000000 +\n b2 * 0x1000000000000 +\n b3 * 0x10000000000 +\n b4 * 0x100000000 +\n b5 * 0x1000000 +\n b6 * 0x10000 +\n b7 * 0x100 +\n b8\n );\n };\n Data.prototype.writeLongLong = function(val) {\n var high, low;\n high = Math.floor(val / 0x100000000);\n low = val & 0xffffffff;\n this.writeByte((high >> 24) & 0xff);\n this.writeByte((high >> 16) & 0xff);\n this.writeByte((high >> 8) & 0xff);\n this.writeByte(high & 0xff);\n this.writeByte((low >> 24) & 0xff);\n this.writeByte((low >> 16) & 0xff);\n this.writeByte((low >> 8) & 0xff);\n return this.writeByte(low & 0xff);\n };\n Data.prototype.readInt = function() {\n return this.readInt32();\n };\n Data.prototype.writeInt = function(val) {\n return this.writeInt32(val);\n };\n /*Data.prototype.slice = function (start, end) {\n return this.data.slice(start, end);\n };*/\n Data.prototype.read = function(bytes) {\n var buf, i;\n buf = [];\n for (\n i = 0;\n 0 <= bytes ? i < bytes : i > bytes;\n i = 0 <= bytes ? ++i : --i\n ) {\n buf.push(this.readByte());\n }\n return buf;\n };\n Data.prototype.write = function(bytes) {\n var byte, i, _len, _results;\n _results = [];\n for (i = 0, _len = bytes.length; i < _len; i++) {\n byte = bytes[i];\n _results.push(this.writeByte(byte));\n }\n return _results;\n };\n return Data;\n})();\n\nvar Directory = (function() {\n var checksum;\n\n /*****************************************************************************************************/\n /* function : Directory generator */\n /* comment : Initialize the offset, tag, length, and checksum for each table for the font to be used.*/\n /*****************************************************************************************************/\n function Directory(data) {\n var entry, i, _ref;\n this.scalarType = data.readInt();\n this.tableCount = data.readShort();\n this.searchRange = data.readShort();\n this.entrySelector = data.readShort();\n this.rangeShift = data.readShort();\n this.tables = {};\n for (\n i = 0, _ref = this.tableCount;\n 0 <= _ref ? i < _ref : i > _ref;\n i = 0 <= _ref ? ++i : --i\n ) {\n entry = {\n tag: data.readString(4),\n checksum: data.readInt(),\n offset: data.readInt(),\n length: data.readInt()\n };\n this.tables[entry.tag] = entry;\n }\n }\n /********************************************************************************************************/\n /* function : encode */\n /* comment : It encodes and stores the font table object and information used for the directory object. */\n /********************************************************************************************************/\n Directory.prototype.encode = function(tables) {\n var adjustment,\n directory,\n directoryLength,\n entrySelector,\n headOffset,\n log2,\n offset,\n rangeShift,\n searchRange,\n sum,\n table,\n tableCount,\n tableData,\n tag;\n tableCount = Object.keys(tables).length;\n log2 = Math.log(2);\n searchRange = Math.floor(Math.log(tableCount) / log2) * 16;\n entrySelector = Math.floor(searchRange / log2);\n rangeShift = tableCount * 16 - searchRange;\n directory = new Data();\n directory.writeInt(this.scalarType);\n directory.writeShort(tableCount);\n directory.writeShort(searchRange);\n directory.writeShort(entrySelector);\n directory.writeShort(rangeShift);\n directoryLength = tableCount * 16;\n offset = directory.pos + directoryLength;\n headOffset = null;\n tableData = [];\n for (tag in tables) {\n table = tables[tag];\n directory.writeString(tag);\n directory.writeInt(checksum(table));\n directory.writeInt(offset);\n directory.writeInt(table.length);\n tableData = tableData.concat(table);\n if (tag === \"head\") {\n headOffset = offset;\n }\n offset += table.length;\n while (offset % 4) {\n tableData.push(0);\n offset++;\n }\n }\n directory.write(tableData);\n sum = checksum(directory.data);\n adjustment = 0xb1b0afba - sum;\n directory.pos = headOffset + 8;\n directory.writeUInt32(adjustment);\n return directory.data;\n };\n /***************************************************************/\n /* function : checksum */\n /* comment : Duplicate the table for the tag. */\n /***************************************************************/\n checksum = function(data) {\n var i, sum, tmp, _ref;\n data = __slice.call(data);\n while (data.length % 4) {\n data.push(0);\n }\n tmp = new Data(data);\n sum = 0;\n for (i = 0, _ref = data.length; i < _ref; i = i += 4) {\n sum += tmp.readUInt32();\n }\n return sum & 0xffffffff;\n };\n return Directory;\n})();\n\nvar Table,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) {\n for (var key in parent) {\n if (__hasProp.call(parent, key)) child[key] = parent[key];\n }\n\n function ctor() {\n this.constructor = child;\n }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n child.__super__ = parent.prototype;\n return child;\n };\n\n/***************************************************************/\n/* function : Table */\n/* comment : Save info for each table, and parse the table. */\n/***************************************************************/\nTable = (function() {\n function Table(file) {\n var info;\n this.file = file;\n info = this.file.directory.tables[this.tag];\n this.exists = !!info;\n if (info) {\n (this.offset = info.offset), (this.length = info.length);\n this.parse(this.file.contents);\n }\n }\n Table.prototype.parse = function() {};\n Table.prototype.encode = function() {};\n Table.prototype.raw = function() {\n if (!this.exists) {\n return null;\n }\n this.file.contents.pos = this.offset;\n return this.file.contents.read(this.length);\n };\n return Table;\n})();\n\nvar HeadTable = (function(_super) {\n __extends(HeadTable, _super);\n\n function HeadTable() {\n return HeadTable.__super__.constructor.apply(this, arguments);\n }\n HeadTable.prototype.tag = \"head\";\n HeadTable.prototype.parse = function(data) {\n data.pos = this.offset;\n this.version = data.readInt();\n this.revision = data.readInt();\n this.checkSumAdjustment = data.readInt();\n this.magicNumber = data.readInt();\n this.flags = data.readShort();\n this.unitsPerEm = data.readShort();\n this.created = data.readLongLong();\n this.modified = data.readLongLong();\n this.xMin = data.readShort();\n this.yMin = data.readShort();\n this.xMax = data.readShort();\n this.yMax = data.readShort();\n this.macStyle = data.readShort();\n this.lowestRecPPEM = data.readShort();\n this.fontDirectionHint = data.readShort();\n this.indexToLocFormat = data.readShort();\n return (this.glyphDataFormat = data.readShort());\n };\n HeadTable.prototype.encode = function(indexToLocFormat) {\n var table;\n table = new Data();\n table.writeInt(this.version);\n table.writeInt(this.revision);\n table.writeInt(this.checkSumAdjustment);\n table.writeInt(this.magicNumber);\n table.writeShort(this.flags);\n table.writeShort(this.unitsPerEm);\n table.writeLongLong(this.created);\n table.writeLongLong(this.modified);\n table.writeShort(this.xMin);\n table.writeShort(this.yMin);\n table.writeShort(this.xMax);\n table.writeShort(this.yMax);\n table.writeShort(this.macStyle);\n table.writeShort(this.lowestRecPPEM);\n table.writeShort(this.fontDirectionHint);\n table.writeShort(indexToLocFormat);\n table.writeShort(this.glyphDataFormat);\n return table.data;\n };\n return HeadTable;\n})(Table);\n\n/************************************************************************************/\n/* function : CmapEntry */\n/* comment : Cmap Initializes and encodes object information (required by pdf spec).*/\n/************************************************************************************/\nvar CmapEntry = (function() {\n function CmapEntry(data, offset) {\n var code,\n count,\n endCode,\n glyphId,\n glyphIds,\n i,\n idDelta,\n idRangeOffset,\n index,\n saveOffset,\n segCount,\n segCountX2,\n start,\n startCode,\n tail,\n _j,\n _k,\n _len;\n this.platformID = data.readUInt16();\n this.encodingID = data.readShort();\n this.offset = offset + data.readInt();\n saveOffset = data.pos;\n data.pos = this.offset;\n this.format = data.readUInt16();\n this.length = data.readUInt16();\n this.language = data.readUInt16();\n this.isUnicode =\n (this.platformID === 3 && this.encodingID === 1 && this.format === 4) ||\n (this.platformID === 0 && this.format === 4);\n this.codeMap = {};\n switch (this.format) {\n case 0:\n for (i = 0; i < 256; ++i) {\n this.codeMap[i] = data.readByte();\n }\n break;\n case 4:\n segCountX2 = data.readUInt16();\n segCount = segCountX2 / 2;\n data.pos += 6;\n endCode = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= segCount ? _j < segCount : _j > segCount;\n i = 0 <= segCount ? ++_j : --_j\n ) {\n _results.push(data.readUInt16());\n }\n return _results;\n })();\n data.pos += 2;\n startCode = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= segCount ? _j < segCount : _j > segCount;\n i = 0 <= segCount ? ++_j : --_j\n ) {\n _results.push(data.readUInt16());\n }\n return _results;\n })();\n idDelta = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= segCount ? _j < segCount : _j > segCount;\n i = 0 <= segCount ? ++_j : --_j\n ) {\n _results.push(data.readUInt16());\n }\n return _results;\n })();\n idRangeOffset = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= segCount ? _j < segCount : _j > segCount;\n i = 0 <= segCount ? ++_j : --_j\n ) {\n _results.push(data.readUInt16());\n }\n return _results;\n })();\n count = (this.length - data.pos + this.offset) / 2;\n glyphIds = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= count ? _j < count : _j > count;\n i = 0 <= count ? ++_j : --_j\n ) {\n _results.push(data.readUInt16());\n }\n return _results;\n })();\n for (i = _j = 0, _len = endCode.length; _j < _len; i = ++_j) {\n tail = endCode[i];\n start = startCode[i];\n for (\n code = _k = start;\n start <= tail ? _k <= tail : _k >= tail;\n code = start <= tail ? ++_k : --_k\n ) {\n if (idRangeOffset[i] === 0) {\n glyphId = code + idDelta[i];\n } else {\n index = idRangeOffset[i] / 2 + (code - start) - (segCount - i);\n glyphId = glyphIds[index] || 0;\n if (glyphId !== 0) {\n glyphId += idDelta[i];\n }\n }\n this.codeMap[code] = glyphId & 0xffff;\n }\n }\n }\n data.pos = saveOffset;\n }\n CmapEntry.encode = function(charmap, encoding) {\n var charMap,\n code,\n codeMap,\n codes,\n delta,\n deltas,\n diff,\n endCode,\n endCodes,\n entrySelector,\n glyphIDs,\n i,\n id,\n indexes,\n last,\n map,\n nextID,\n offset,\n old,\n rangeOffsets,\n rangeShift,\n searchRange,\n segCount,\n segCountX2,\n startCode,\n startCodes,\n startGlyph,\n subtable,\n _i,\n _j,\n _k,\n _l,\n _len,\n _len1,\n _len2,\n _len3,\n _len4,\n _len5,\n _len6,\n _len7,\n _m,\n _n,\n _name,\n _o,\n _p,\n _q;\n subtable = new Data();\n codes = Object.keys(charmap).sort(function(a, b) {\n return a - b;\n });\n switch (encoding) {\n case \"macroman\":\n id = 0;\n indexes = (function() {\n var _results = [];\n for (i = 0; i < 256; ++i) {\n _results.push(0);\n }\n return _results;\n })();\n map = {\n 0: 0\n };\n codeMap = {};\n for (_i = 0, _len = codes.length; _i < _len; _i++) {\n code = codes[_i];\n if (map[(_name = charmap[code])] == null) {\n map[_name] = ++id;\n }\n codeMap[code] = {\n old: charmap[code],\n new: map[charmap[code]]\n };\n indexes[code] = map[charmap[code]];\n }\n subtable.writeUInt16(1);\n subtable.writeUInt16(0);\n subtable.writeUInt32(12);\n subtable.writeUInt16(0);\n subtable.writeUInt16(262);\n subtable.writeUInt16(0);\n subtable.write(indexes);\n return {\n charMap: codeMap,\n subtable: subtable.data,\n maxGlyphID: id + 1\n };\n case \"unicode\":\n startCodes = [];\n endCodes = [];\n nextID = 0;\n map = {};\n charMap = {};\n last = diff = null;\n for (_j = 0, _len1 = codes.length; _j < _len1; _j++) {\n code = codes[_j];\n old = charmap[code];\n if (map[old] == null) {\n map[old] = ++nextID;\n }\n charMap[code] = {\n old: old,\n new: map[old]\n };\n delta = map[old] - code;\n if (last == null || delta !== diff) {\n if (last) {\n endCodes.push(last);\n }\n startCodes.push(code);\n diff = delta;\n }\n last = code;\n }\n if (last) {\n endCodes.push(last);\n }\n endCodes.push(0xffff);\n startCodes.push(0xffff);\n segCount = startCodes.length;\n segCountX2 = segCount * 2;\n searchRange = 2 * Math.pow(Math.log(segCount) / Math.LN2, 2);\n entrySelector = Math.log(searchRange / 2) / Math.LN2;\n rangeShift = 2 * segCount - searchRange;\n deltas = [];\n rangeOffsets = [];\n glyphIDs = [];\n for (i = _k = 0, _len2 = startCodes.length; _k < _len2; i = ++_k) {\n startCode = startCodes[i];\n endCode = endCodes[i];\n if (startCode === 0xffff) {\n deltas.push(0);\n rangeOffsets.push(0);\n break;\n }\n startGlyph = charMap[startCode][\"new\"];\n if (startCode - startGlyph >= 0x8000) {\n deltas.push(0);\n rangeOffsets.push(2 * (glyphIDs.length + segCount - i));\n for (\n code = _l = startCode;\n startCode <= endCode ? _l <= endCode : _l >= endCode;\n code = startCode <= endCode ? ++_l : --_l\n ) {\n glyphIDs.push(charMap[code][\"new\"]);\n }\n } else {\n deltas.push(startGlyph - startCode);\n rangeOffsets.push(0);\n }\n }\n subtable.writeUInt16(3);\n subtable.writeUInt16(1);\n subtable.writeUInt32(12);\n subtable.writeUInt16(4);\n subtable.writeUInt16(16 + segCount * 8 + glyphIDs.length * 2);\n subtable.writeUInt16(0);\n subtable.writeUInt16(segCountX2);\n subtable.writeUInt16(searchRange);\n subtable.writeUInt16(entrySelector);\n subtable.writeUInt16(rangeShift);\n for (_m = 0, _len3 = endCodes.length; _m < _len3; _m++) {\n code = endCodes[_m];\n subtable.writeUInt16(code);\n }\n subtable.writeUInt16(0);\n for (_n = 0, _len4 = startCodes.length; _n < _len4; _n++) {\n code = startCodes[_n];\n subtable.writeUInt16(code);\n }\n for (_o = 0, _len5 = deltas.length; _o < _len5; _o++) {\n delta = deltas[_o];\n subtable.writeUInt16(delta);\n }\n for (_p = 0, _len6 = rangeOffsets.length; _p < _len6; _p++) {\n offset = rangeOffsets[_p];\n subtable.writeUInt16(offset);\n }\n for (_q = 0, _len7 = glyphIDs.length; _q < _len7; _q++) {\n id = glyphIDs[_q];\n subtable.writeUInt16(id);\n }\n return {\n charMap: charMap,\n subtable: subtable.data,\n maxGlyphID: nextID + 1\n };\n }\n };\n return CmapEntry;\n})();\n\nvar CmapTable = (function(_super) {\n __extends(CmapTable, _super);\n\n function CmapTable() {\n return CmapTable.__super__.constructor.apply(this, arguments);\n }\n CmapTable.prototype.tag = \"cmap\";\n CmapTable.prototype.parse = function(data) {\n var entry, i, tableCount;\n data.pos = this.offset;\n this.version = data.readUInt16();\n tableCount = data.readUInt16();\n this.tables = [];\n this.unicode = null;\n for (\n i = 0;\n 0 <= tableCount ? i < tableCount : i > tableCount;\n i = 0 <= tableCount ? ++i : --i\n ) {\n entry = new CmapEntry(data, this.offset);\n this.tables.push(entry);\n if (entry.isUnicode) {\n if (this.unicode == null) {\n this.unicode = entry;\n }\n }\n }\n return true;\n };\n /*************************************************************************/\n /* function : encode */\n /* comment : Encode the cmap table corresponding to the input character. */\n /*************************************************************************/\n CmapTable.encode = function(charmap, encoding) {\n var result, table;\n if (encoding == null) {\n encoding = \"macroman\";\n }\n result = CmapEntry.encode(charmap, encoding);\n table = new Data();\n table.writeUInt16(0);\n table.writeUInt16(1);\n result.table = table.data.concat(result.subtable);\n return result;\n };\n return CmapTable;\n})(Table);\n\nvar HheaTable = (function(_super) {\n __extends(HheaTable, _super);\n\n function HheaTable() {\n return HheaTable.__super__.constructor.apply(this, arguments);\n }\n HheaTable.prototype.tag = \"hhea\";\n HheaTable.prototype.parse = function(data) {\n data.pos = this.offset;\n this.version = data.readInt();\n this.ascender = data.readShort();\n this.decender = data.readShort();\n this.lineGap = data.readShort();\n this.advanceWidthMax = data.readShort();\n this.minLeftSideBearing = data.readShort();\n this.minRightSideBearing = data.readShort();\n this.xMaxExtent = data.readShort();\n this.caretSlopeRise = data.readShort();\n this.caretSlopeRun = data.readShort();\n this.caretOffset = data.readShort();\n data.pos += 4 * 2;\n this.metricDataFormat = data.readShort();\n return (this.numberOfMetrics = data.readUInt16());\n };\n /*HheaTable.prototype.encode = function (ids) {\n var i, table, _i, _ref;\n table = new Data;\n table.writeInt(this.version);\n table.writeShort(this.ascender);\n table.writeShort(this.decender);\n table.writeShort(this.lineGap);\n table.writeShort(this.advanceWidthMax);\n table.writeShort(this.minLeftSideBearing);\n table.writeShort(this.minRightSideBearing);\n table.writeShort(this.xMaxExtent);\n table.writeShort(this.caretSlopeRise);\n table.writeShort(this.caretSlopeRun);\n table.writeShort(this.caretOffset);\n for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n table.writeByte(0);\n }\n table.writeShort(this.metricDataFormat);\n table.writeUInt16(ids.length);\n return table.data;\n };*/\n return HheaTable;\n})(Table);\n\nvar OS2Table = (function(_super) {\n __extends(OS2Table, _super);\n\n function OS2Table() {\n return OS2Table.__super__.constructor.apply(this, arguments);\n }\n OS2Table.prototype.tag = \"OS/2\";\n OS2Table.prototype.parse = function(data) {\n data.pos = this.offset;\n this.version = data.readUInt16();\n this.averageCharWidth = data.readShort();\n this.weightClass = data.readUInt16();\n this.widthClass = data.readUInt16();\n this.type = data.readShort();\n this.ySubscriptXSize = data.readShort();\n this.ySubscriptYSize = data.readShort();\n this.ySubscriptXOffset = data.readShort();\n this.ySubscriptYOffset = data.readShort();\n this.ySuperscriptXSize = data.readShort();\n this.ySuperscriptYSize = data.readShort();\n this.ySuperscriptXOffset = data.readShort();\n this.ySuperscriptYOffset = data.readShort();\n this.yStrikeoutSize = data.readShort();\n this.yStrikeoutPosition = data.readShort();\n this.familyClass = data.readShort();\n this.panose = (function() {\n var i, _results;\n _results = [];\n for (i = 0; i < 10; ++i) {\n _results.push(data.readByte());\n }\n return _results;\n })();\n this.charRange = (function() {\n var i, _results;\n _results = [];\n for (i = 0; i < 4; ++i) {\n _results.push(data.readInt());\n }\n return _results;\n })();\n this.vendorID = data.readString(4);\n this.selection = data.readShort();\n this.firstCharIndex = data.readShort();\n this.lastCharIndex = data.readShort();\n if (this.version > 0) {\n this.ascent = data.readShort();\n this.descent = data.readShort();\n this.lineGap = data.readShort();\n this.winAscent = data.readShort();\n this.winDescent = data.readShort();\n this.codePageRange = (function() {\n var i, _results;\n _results = [];\n for (i = 0; i < 2; i = ++i) {\n _results.push(data.readInt());\n }\n return _results;\n })();\n if (this.version > 1) {\n this.xHeight = data.readShort();\n this.capHeight = data.readShort();\n this.defaultChar = data.readShort();\n this.breakChar = data.readShort();\n return (this.maxContext = data.readShort());\n }\n }\n };\n /*OS2Table.prototype.encode = function () {\n return this.raw();\n };*/\n return OS2Table;\n})(Table);\n\nvar PostTable = (function(_super) {\n var POSTSCRIPT_GLYPHS;\n __extends(PostTable, _super);\n\n function PostTable() {\n return PostTable.__super__.constructor.apply(this, arguments);\n }\n PostTable.prototype.tag = \"post\";\n PostTable.prototype.parse = function(data) {\n var length, numberOfGlyphs, _results;\n data.pos = this.offset;\n this.format = data.readInt();\n this.italicAngle = data.readInt();\n this.underlinePosition = data.readShort();\n this.underlineThickness = data.readShort();\n this.isFixedPitch = data.readInt();\n this.minMemType42 = data.readInt();\n this.maxMemType42 = data.readInt();\n this.minMemType1 = data.readInt();\n this.maxMemType1 = data.readInt();\n switch (this.format) {\n case 0x00010000:\n break;\n case 0x00020000:\n numberOfGlyphs = data.readUInt16();\n this.glyphNameIndex = [];\n var i;\n for (\n i = 0;\n 0 <= numberOfGlyphs ? i < numberOfGlyphs : i > numberOfGlyphs;\n i = 0 <= numberOfGlyphs ? ++i : --i\n ) {\n this.glyphNameIndex.push(data.readUInt16());\n }\n this.names = [];\n _results = [];\n while (data.pos < this.offset + this.length) {\n length = data.readByte();\n _results.push(this.names.push(data.readString(length)));\n }\n return _results;\n case 0x00025000:\n numberOfGlyphs = data.readUInt16();\n return (this.offsets = data.read(numberOfGlyphs));\n case 0x00030000:\n break;\n case 0x00040000:\n return (this.map = function() {\n var _j, _ref, _results1;\n _results1 = [];\n for (\n i = _j = 0, _ref = this.file.maxp.numGlyphs;\n 0 <= _ref ? _j < _ref : _j > _ref;\n i = 0 <= _ref ? ++_j : --_j\n ) {\n _results1.push(data.readUInt32());\n }\n return _results1;\n }.call(this));\n }\n };\n /*PostTable.prototype.glyphFor = function (code) {\n var index;\n switch (this.format) {\n case 0x00010000:\n return POSTSCRIPT_GLYPHS[code] || '.notdef';\n case 0x00020000:\n index = this.glyphNameIndex[code];\n if (index <= 257) {\n return POSTSCRIPT_GLYPHS[index];\n }\n else {\n return this.names[index - 258] || '.notdef';\n }\n break;\n case 0x00025000:\n return POSTSCRIPT_GLYPHS[code + this.offsets[code]] || '.notdef';\n case 0x00030000:\n return '.notdef';\n case 0x00040000:\n return this.map[code] || 0xFFFF;\n }\n };*/\n /*PostTable.prototype.encode = function (mapping) {\n var id, index, indexes, position, post, raw, string, strings, table, _i, _j, _k, _len, _len1, _len2;\n if (!this.exists) {\n return null;\n }\n raw = this.raw();\n if (this.format === 0x00030000) {\n return raw;\n }\n table = new Data(raw.slice(0, 32));\n table.writeUInt32(0x00020000);\n table.pos = 32;\n indexes = [];\n strings = [];\n for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n id = mapping[_i];\n post = this.glyphFor(id);\n position = POSTSCRIPT_GLYPHS.indexOf(post);\n if (position !== -1) {\n indexes.push(position);\n }\n else {\n indexes.push(257 + strings.length);\n strings.push(post);\n }\n }\n table.writeUInt16(Object.keys(mapping).length);\n for (_j = 0, _len1 = indexes.length; _j < _len1; _j++) {\n index = indexes[_j];\n table.writeUInt16(index);\n }\n for (_k = 0, _len2 = strings.length; _k < _len2; _k++) {\n string = strings[_k];\n table.writeByte(string.length);\n table.writeString(string);\n }\n return table.data;\n };*/\n POSTSCRIPT_GLYPHS = \".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent\\nampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash\\nzero one two three four five six seven eight nine colon semicolon less equal greater\\nquestion at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\\nbracketleft backslash bracketright asciicircum underscore grave\\na b c d e f g h i j k l m n o p q r s t u v w x y z\\nbraceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis\\nUdieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave\\necircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve\\nocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent\\nsterling section bullet paragraph germandbls registered copyright trademark acute\\ndieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu\\npartialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash\\nquestiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft\\nguillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash\\nquotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis\\nfraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered\\nquotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis\\nEgrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute\\nUcircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla\\nhungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth\\neth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior\\nonehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla\\nCacute cacute Ccaron ccaron dcroat\".split(\n /\\s+/g\n );\n return PostTable;\n})(Table);\n\n/*********************************************************************************************************/\n/* function : NameEntry */\n/* comment : Store copyright information, platformID, encodingID, and languageID in the NameEntry object.*/\n/*********************************************************************************************************/\nvar NameEntry = (function() {\n function NameEntry(raw, entry) {\n this.raw = raw;\n this.length = raw.length;\n this.platformID = entry.platformID;\n this.encodingID = entry.encodingID;\n this.languageID = entry.languageID;\n }\n return NameEntry;\n})();\n\nvar NameTable = (function(_super) {\n var subsetTag;\n __extends(NameTable, _super);\n\n function NameTable() {\n return NameTable.__super__.constructor.apply(this, arguments);\n }\n NameTable.prototype.tag = \"name\";\n NameTable.prototype.parse = function(data) {\n var count,\n entries,\n entry,\n i,\n name,\n stringOffset,\n strings,\n text,\n _j,\n _len,\n _name;\n data.pos = this.offset;\n data.readShort(); //format\n count = data.readShort();\n stringOffset = data.readShort();\n entries = [];\n for (\n i = 0;\n 0 <= count ? i < count : i > count;\n i = 0 <= count ? ++i : --i\n ) {\n entries.push({\n platformID: data.readShort(),\n encodingID: data.readShort(),\n languageID: data.readShort(),\n nameID: data.readShort(),\n length: data.readShort(),\n offset: this.offset + stringOffset + data.readShort()\n });\n }\n strings = {};\n for (i = _j = 0, _len = entries.length; _j < _len; i = ++_j) {\n entry = entries[i];\n data.pos = entry.offset;\n text = data.readString(entry.length);\n name = new NameEntry(text, entry);\n if (strings[(_name = entry.nameID)] == null) {\n strings[_name] = [];\n }\n strings[entry.nameID].push(name);\n }\n this.strings = strings;\n this.copyright = strings[0];\n this.fontFamily = strings[1];\n this.fontSubfamily = strings[2];\n this.uniqueSubfamily = strings[3];\n this.fontName = strings[4];\n this.version = strings[5];\n try {\n this.postscriptName = strings[6][0].raw.replace(\n /[\\x00-\\x19\\x80-\\xff]/g,\n \"\"\n );\n } catch (e) {\n this.postscriptName = strings[4][0].raw.replace(\n /[\\x00-\\x19\\x80-\\xff]/g,\n \"\"\n );\n }\n this.trademark = strings[7];\n this.manufacturer = strings[8];\n this.designer = strings[9];\n this.description = strings[10];\n this.vendorUrl = strings[11];\n this.designerUrl = strings[12];\n this.license = strings[13];\n this.licenseUrl = strings[14];\n this.preferredFamily = strings[15];\n this.preferredSubfamily = strings[17];\n this.compatibleFull = strings[18];\n return (this.sampleText = strings[19]);\n };\n subsetTag = \"AAAAAA\";\n /*NameTable.prototype.encode = function () {\n var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref;\n strings = {};\n _ref = this.strings;\n for (id in _ref) {\n val = _ref[id];\n strings[id] = val;\n }\n postscriptName = new NameEntry(\"\" + subsetTag + \"+\" + this.postscriptName, {\n platformID: 1\n , encodingID: 0\n , languageID: 0\n });\n strings[6] = [postscriptName];\n subsetTag = successorOf(subsetTag);\n strCount = 0;\n for (id in strings) {\n list = strings[id];\n if (list != null) {\n strCount += list.length;\n }\n }\n table = new Data;\n strTable = new Data;\n table.writeShort(0);\n table.writeShort(strCount);\n table.writeShort(6 + 12 * strCount);\n for (nameID in strings) {\n list = strings[nameID];\n if (list != null) {\n for (_i = 0, _len = list.length; _i < _len; _i++) {\n string = list[_i];\n table.writeShort(string.platformID);\n table.writeShort(string.encodingID);\n table.writeShort(string.languageID);\n table.writeShort(nameID);\n table.writeShort(string.length);\n table.writeShort(strTable.pos);\n strTable.writeString(string.raw);\n }\n }\n }\n return nameTable = {\n postscriptName: postscriptName.raw\n , table: table.data.concat(strTable.data)\n };\n };*/\n return NameTable;\n})(Table);\n\nvar MaxpTable = (function(_super) {\n __extends(MaxpTable, _super);\n\n function MaxpTable() {\n return MaxpTable.__super__.constructor.apply(this, arguments);\n }\n MaxpTable.prototype.tag = \"maxp\";\n MaxpTable.prototype.parse = function(data) {\n data.pos = this.offset;\n this.version = data.readInt();\n this.numGlyphs = data.readUInt16();\n this.maxPoints = data.readUInt16();\n this.maxContours = data.readUInt16();\n this.maxCompositePoints = data.readUInt16();\n this.maxComponentContours = data.readUInt16();\n this.maxZones = data.readUInt16();\n this.maxTwilightPoints = data.readUInt16();\n this.maxStorage = data.readUInt16();\n this.maxFunctionDefs = data.readUInt16();\n this.maxInstructionDefs = data.readUInt16();\n this.maxStackElements = data.readUInt16();\n this.maxSizeOfInstructions = data.readUInt16();\n this.maxComponentElements = data.readUInt16();\n return (this.maxComponentDepth = data.readUInt16());\n };\n /*MaxpTable.prototype.encode = function (ids) {\n var table;\n table = new Data;\n table.writeInt(this.version);\n table.writeUInt16(ids.length);\n table.writeUInt16(this.maxPoints);\n table.writeUInt16(this.maxContours);\n table.writeUInt16(this.maxCompositePoints);\n table.writeUInt16(this.maxComponentContours);\n table.writeUInt16(this.maxZones);\n table.writeUInt16(this.maxTwilightPoints);\n table.writeUInt16(this.maxStorage);\n table.writeUInt16(this.maxFunctionDefs);\n table.writeUInt16(this.maxInstructionDefs);\n table.writeUInt16(this.maxStackElements);\n table.writeUInt16(this.maxSizeOfInstructions);\n table.writeUInt16(this.maxComponentElements);\n table.writeUInt16(this.maxComponentDepth);\n return table.data;\n };*/\n return MaxpTable;\n})(Table);\n\nvar HmtxTable = (function(_super) {\n __extends(HmtxTable, _super);\n\n function HmtxTable() {\n return HmtxTable.__super__.constructor.apply(this, arguments);\n }\n HmtxTable.prototype.tag = \"hmtx\";\n HmtxTable.prototype.parse = function(data) {\n var i, last, lsbCount, m, _j, _ref, _results;\n data.pos = this.offset;\n this.metrics = [];\n for (\n i = 0, _ref = this.file.hhea.numberOfMetrics;\n 0 <= _ref ? i < _ref : i > _ref;\n i = 0 <= _ref ? ++i : --i\n ) {\n this.metrics.push({\n advance: data.readUInt16(),\n lsb: data.readInt16()\n });\n }\n lsbCount = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics;\n this.leftSideBearings = (function() {\n var _j, _results;\n _results = [];\n for (\n i = _j = 0;\n 0 <= lsbCount ? _j < lsbCount : _j > lsbCount;\n i = 0 <= lsbCount ? ++_j : --_j\n ) {\n _results.push(data.readInt16());\n }\n return _results;\n })();\n this.widths = function() {\n var _j, _len, _ref1, _results;\n _ref1 = this.metrics;\n _results = [];\n for (_j = 0, _len = _ref1.length; _j < _len; _j++) {\n m = _ref1[_j];\n _results.push(m.advance);\n }\n return _results;\n }.call(this);\n last = this.widths[this.widths.length - 1];\n _results = [];\n for (\n i = _j = 0;\n 0 <= lsbCount ? _j < lsbCount : _j > lsbCount;\n i = 0 <= lsbCount ? ++_j : --_j\n ) {\n _results.push(this.widths.push(last));\n }\n return _results;\n };\n /***************************************************************/\n /* function : forGlyph */\n /* comment : Returns the advance width and lsb for this glyph. */\n /***************************************************************/\n HmtxTable.prototype.forGlyph = function(id) {\n if (id in this.metrics) {\n return this.metrics[id];\n }\n return {\n advance: this.metrics[this.metrics.length - 1].advance,\n lsb: this.leftSideBearings[id - this.metrics.length]\n };\n };\n /*HmtxTable.prototype.encode = function (mapping) {\n var id, metric, table, _i, _len;\n table = new Data;\n for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n id = mapping[_i];\n metric = this.forGlyph(id);\n table.writeUInt16(metric.advance);\n table.writeUInt16(metric.lsb);\n }\n return table.data;\n };*/\n return HmtxTable;\n})(Table);\n\nvar __slice = [].slice;\n\nvar GlyfTable = (function(_super) {\n __extends(GlyfTable, _super);\n\n function GlyfTable() {\n return GlyfTable.__super__.constructor.apply(this, arguments);\n }\n GlyfTable.prototype.tag = \"glyf\";\n GlyfTable.prototype.parse = function() {\n return (this.cache = {});\n };\n GlyfTable.prototype.glyphFor = function(id) {\n var data,\n index,\n length,\n loca,\n numberOfContours,\n raw,\n xMax,\n xMin,\n yMax,\n yMin;\n if (id in this.cache) {\n return this.cache[id];\n }\n loca = this.file.loca;\n data = this.file.contents;\n index = loca.indexOf(id);\n length = loca.lengthOf(id);\n if (length === 0) {\n return (this.cache[id] = null);\n }\n data.pos = this.offset + index;\n raw = new Data(data.read(length));\n numberOfContours = raw.readShort();\n xMin = raw.readShort();\n yMin = raw.readShort();\n xMax = raw.readShort();\n yMax = raw.readShort();\n if (numberOfContours === -1) {\n this.cache[id] = new CompoundGlyph(raw, xMin, yMin, xMax, yMax);\n } else {\n this.cache[id] = new SimpleGlyph(\n raw,\n numberOfContours,\n xMin,\n yMin,\n xMax,\n yMax\n );\n }\n return this.cache[id];\n };\n GlyfTable.prototype.encode = function(glyphs, mapping, old2new) {\n var glyph, id, offsets, table, _i, _len;\n table = [];\n offsets = [];\n for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n id = mapping[_i];\n glyph = glyphs[id];\n offsets.push(table.length);\n if (glyph) {\n table = table.concat(glyph.encode(old2new));\n }\n }\n offsets.push(table.length);\n return {\n table: table,\n offsets: offsets\n };\n };\n return GlyfTable;\n})(Table);\n\nvar SimpleGlyph = (function() {\n /**************************************************************************/\n /* function : SimpleGlyph */\n /* comment : Stores raw, xMin, yMin, xMax, and yMax values for this glyph.*/\n /**************************************************************************/\n function SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax) {\n this.raw = raw;\n this.numberOfContours = numberOfContours;\n this.xMin = xMin;\n this.yMin = yMin;\n this.xMax = xMax;\n this.yMax = yMax;\n this.compound = false;\n }\n SimpleGlyph.prototype.encode = function() {\n return this.raw.data;\n };\n return SimpleGlyph;\n})();\n\nvar CompoundGlyph = (function() {\n var ARG_1_AND_2_ARE_WORDS,\n MORE_COMPONENTS,\n WE_HAVE_AN_X_AND_Y_SCALE,\n WE_HAVE_A_SCALE,\n WE_HAVE_A_TWO_BY_TWO,\n WE_HAVE_INSTRUCTIONS;\n ARG_1_AND_2_ARE_WORDS = 0x0001;\n WE_HAVE_A_SCALE = 0x0008;\n MORE_COMPONENTS = 0x0020;\n WE_HAVE_AN_X_AND_Y_SCALE = 0x0040;\n WE_HAVE_A_TWO_BY_TWO = 0x0080;\n WE_HAVE_INSTRUCTIONS = 0x0100;\n\n /********************************************************************************************************************/\n /* function : CompoundGlypg generator */\n /* comment : It stores raw, xMin, yMin, xMax, yMax, glyph id, and glyph offset for the corresponding compound glyph.*/\n /********************************************************************************************************************/\n function CompoundGlyph(raw, xMin, yMin, xMax, yMax) {\n var data, flags;\n this.raw = raw;\n this.xMin = xMin;\n this.yMin = yMin;\n this.xMax = xMax;\n this.yMax = yMax;\n this.compound = true;\n this.glyphIDs = [];\n this.glyphOffsets = [];\n data = this.raw;\n while (true) {\n flags = data.readShort();\n this.glyphOffsets.push(data.pos);\n this.glyphIDs.push(data.readUInt16());\n if (!(flags & MORE_COMPONENTS)) {\n break;\n }\n if (flags & ARG_1_AND_2_ARE_WORDS) {\n data.pos += 4;\n } else {\n data.pos += 2;\n }\n if (flags & WE_HAVE_A_TWO_BY_TWO) {\n data.pos += 8;\n } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {\n data.pos += 4;\n } else if (flags & WE_HAVE_A_SCALE) {\n data.pos += 2;\n }\n }\n }\n /****************************************************************************************************************/\n /* function : CompoundGlypg encode */\n /* comment : After creating a table for the characters you typed, you call directory.encode to encode the table.*/\n /****************************************************************************************************************/\n CompoundGlyph.prototype.encode = function() {\n var i, result, _len, _ref;\n result = new Data(__slice.call(this.raw.data));\n _ref = this.glyphIDs;\n for (i = 0, _len = _ref.length; i < _len; ++i) {\n result.pos = this.glyphOffsets[i];\n }\n return result.data;\n };\n return CompoundGlyph;\n})();\n\nvar LocaTable = (function(_super) {\n __extends(LocaTable, _super);\n\n function LocaTable() {\n return LocaTable.__super__.constructor.apply(this, arguments);\n }\n LocaTable.prototype.tag = \"loca\";\n LocaTable.prototype.parse = function(data) {\n var format, i;\n data.pos = this.offset;\n format = this.file.head.indexToLocFormat;\n if (format === 0) {\n return (this.offsets = function() {\n var _ref, _results;\n _results = [];\n for (i = 0, _ref = this.length; i < _ref; i += 2) {\n _results.push(data.readUInt16() * 2);\n }\n return _results;\n }.call(this));\n } else {\n return (this.offsets = function() {\n var _ref, _results;\n _results = [];\n for (i = 0, _ref = this.length; i < _ref; i += 4) {\n _results.push(data.readUInt32());\n }\n return _results;\n }.call(this));\n }\n };\n LocaTable.prototype.indexOf = function(id) {\n return this.offsets[id];\n };\n LocaTable.prototype.lengthOf = function(id) {\n return this.offsets[id + 1] - this.offsets[id];\n };\n LocaTable.prototype.encode = function(offsets, activeGlyphs) {\n var LocaTable = new Uint32Array(this.offsets.length);\n var glyfPtr = 0;\n var listGlyf = 0;\n for (var k = 0; k < LocaTable.length; ++k) {\n LocaTable[k] = glyfPtr;\n if (listGlyf < activeGlyphs.length && activeGlyphs[listGlyf] == k) {\n ++listGlyf;\n LocaTable[k] = glyfPtr;\n var start = this.offsets[k];\n var len = this.offsets[k + 1] - start;\n if (len > 0) {\n glyfPtr += len;\n }\n }\n }\n var newLocaTable = new Array(LocaTable.length * 4);\n for (var j = 0; j < LocaTable.length; ++j) {\n newLocaTable[4 * j + 3] = LocaTable[j] & 0x000000ff;\n newLocaTable[4 * j + 2] = (LocaTable[j] & 0x0000ff00) >> 8;\n newLocaTable[4 * j + 1] = (LocaTable[j] & 0x00ff0000) >> 16;\n newLocaTable[4 * j] = (LocaTable[j] & 0xff000000) >> 24;\n }\n return newLocaTable;\n };\n return LocaTable;\n})(Table);\n\n/************************************************************************************/\n/* function : invert */\n/* comment : Change the object's (key: value) to create an object with (value: key).*/\n/************************************************************************************/\nvar invert = function(object) {\n var key, ret, val;\n ret = {};\n for (key in object) {\n val = object[key];\n ret[val] = key;\n }\n return ret;\n};\n\n/*var successorOf = function (input) {\n var added, alphabet, carry, i, index, isUpperCase, last, length, next, result;\n alphabet = 'abcdefghijklmnopqrstuvwxyz';\n length = alphabet.length;\n result = input;\n i = input.length;\n while (i >= 0) {\n last = input.charAt(--i);\n if (isNaN(last)) {\n index = alphabet.indexOf(last.toLowerCase());\n if (index === -1) {\n next = last;\n carry = true;\n }\n else {\n next = alphabet.charAt((index + 1) % length);\n isUpperCase = last === last.toUpperCase();\n if (isUpperCase) {\n next = next.toUpperCase();\n }\n carry = index + 1 >= length;\n if (carry && i === 0) {\n added = isUpperCase ? 'A' : 'a';\n result = added + next + result.slice(1);\n break;\n }\n }\n }\n else {\n next = +last + 1;\n carry = next > 9;\n if (carry) {\n next = 0;\n }\n if (carry && i === 0) {\n result = '1' + next + result.slice(1);\n break;\n }\n }\n result = result.slice(0, i) + next + result.slice(i + 1);\n if (!carry) {\n break;\n }\n }\n return result;\n };*/\n\nvar Subset = (function() {\n function Subset(font) {\n this.font = font;\n this.subset = {};\n this.unicodes = {};\n this.next = 33;\n }\n /*Subset.prototype.use = function (character) {\n var i, _i, _ref;\n if (typeof character === 'string') {\n for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n this.use(character.charCodeAt(i));\n }\n return;\n }\n if (!this.unicodes[character]) {\n this.subset[this.next] = character;\n return this.unicodes[character] = this.next++;\n }\n };*/\n /*Subset.prototype.encodeText = function (text) {\n var char, i, string, _i, _ref;\n string = '';\n for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n char = this.unicodes[text.charCodeAt(i)];\n string += String.fromCharCode(char);\n }\n return string;\n };*/\n /***************************************************************/\n /* function : generateCmap */\n /* comment : Returns the unicode cmap for this font. */\n /***************************************************************/\n Subset.prototype.generateCmap = function() {\n var mapping, roman, unicode, unicodeCmap, _ref;\n unicodeCmap = this.font.cmap.tables[0].codeMap;\n mapping = {};\n _ref = this.subset;\n for (roman in _ref) {\n unicode = _ref[roman];\n mapping[roman] = unicodeCmap[unicode];\n }\n return mapping;\n };\n /*Subset.prototype.glyphIDs = function () {\n var ret, roman, unicode, unicodeCmap, val, _ref;\n unicodeCmap = this.font.cmap.tables[0].codeMap;\n ret = [0];\n _ref = this.subset;\n for (roman in _ref) {\n unicode = _ref[roman];\n val = unicodeCmap[unicode];\n if ((val != null) && __indexOf.call(ret, val) < 0) {\n ret.push(val);\n }\n }\n return ret.sort();\n };*/\n /******************************************************************/\n /* function : glyphsFor */\n /* comment : Returns simple glyph objects for the input character.*/\n /******************************************************************/\n Subset.prototype.glyphsFor = function(glyphIDs) {\n var additionalIDs, glyph, glyphs, id, _i, _len, _ref;\n glyphs = {};\n for (_i = 0, _len = glyphIDs.length; _i < _len; _i++) {\n id = glyphIDs[_i];\n glyphs[id] = this.font.glyf.glyphFor(id);\n }\n additionalIDs = [];\n for (id in glyphs) {\n glyph = glyphs[id];\n if (glyph != null ? glyph.compound : void 0) {\n additionalIDs.push.apply(additionalIDs, glyph.glyphIDs);\n }\n }\n if (additionalIDs.length > 0) {\n _ref = this.glyphsFor(additionalIDs);\n for (id in _ref) {\n glyph = _ref[id];\n glyphs[id] = glyph;\n }\n }\n return glyphs;\n };\n /***************************************************************/\n /* function : encode */\n /* comment : Encode various tables for the characters you use. */\n /***************************************************************/\n Subset.prototype.encode = function(glyID, indexToLocFormat) {\n var cmap,\n code,\n glyf,\n glyphs,\n id,\n ids,\n loca,\n new2old,\n newIDs,\n nextGlyphID,\n old2new,\n oldID,\n oldIDs,\n tables,\n _ref;\n cmap = CmapTable.encode(this.generateCmap(), \"unicode\");\n glyphs = this.glyphsFor(glyID);\n old2new = {\n 0: 0\n };\n _ref = cmap.charMap;\n for (code in _ref) {\n ids = _ref[code];\n old2new[ids.old] = ids[\"new\"];\n }\n nextGlyphID = cmap.maxGlyphID;\n for (oldID in glyphs) {\n if (!(oldID in old2new)) {\n old2new[oldID] = nextGlyphID++;\n }\n }\n new2old = invert(old2new);\n newIDs = Object.keys(new2old).sort(function(a, b) {\n return a - b;\n });\n oldIDs = (function() {\n var _i, _len, _results;\n _results = [];\n for (_i = 0, _len = newIDs.length; _i < _len; _i++) {\n id = newIDs[_i];\n _results.push(new2old[id]);\n }\n return _results;\n })();\n glyf = this.font.glyf.encode(glyphs, oldIDs, old2new);\n loca = this.font.loca.encode(glyf.offsets, oldIDs);\n tables = {\n cmap: this.font.cmap.raw(),\n glyf: glyf.table,\n loca: loca,\n hmtx: this.font.hmtx.raw(),\n hhea: this.font.hhea.raw(),\n maxp: this.font.maxp.raw(),\n post: this.font.post.raw(),\n name: this.font.name.raw(),\n head: this.font.head.encode(indexToLocFormat)\n };\n if (this.font.os2.exists) {\n tables[\"OS/2\"] = this.font.os2.raw();\n }\n return this.font.directory.encode(tables);\n };\n return Subset;\n})();\n\njsPDF.API.PDFObject = (function() {\n var pad;\n\n function PDFObject() {}\n pad = function(str, length) {\n return (Array(length + 1).join(\"0\") + str).slice(-length);\n };\n /*****************************************************************************/\n /* function : convert */\n /* comment :Converts pdf tag's / FontBBox and array values in / W to strings */\n /*****************************************************************************/\n PDFObject.convert = function(object) {\n var e, items, key, out, val;\n if (Array.isArray(object)) {\n items = (function() {\n var _i, _len, _results;\n _results = [];\n for (_i = 0, _len = object.length; _i < _len; _i++) {\n e = object[_i];\n _results.push(PDFObject.convert(e));\n }\n return _results;\n })().join(\" \");\n return \"[\" + items + \"]\";\n } else if (typeof object === \"string\") {\n return \"/\" + object;\n } else if (object != null ? object.isString : void 0) {\n return \"(\" + object + \")\";\n } else if (object instanceof Date) {\n return (\n \"(D:\" +\n pad(object.getUTCFullYear(), 4) +\n pad(object.getUTCMonth(), 2) +\n pad(object.getUTCDate(), 2) +\n pad(object.getUTCHours(), 2) +\n pad(object.getUTCMinutes(), 2) +\n pad(object.getUTCSeconds(), 2) +\n \"Z)\"\n );\n } else if ({}.toString.call(object) === \"[object Object]\") {\n out = [\"<<\"];\n for (key in object) {\n val = object[key];\n out.push(\"/\" + key + \" \" + PDFObject.convert(val));\n }\n out.push(\">>\");\n return out.join(\"\\n\");\n } else {\n return \"\" + object;\n }\n };\n return PDFObject;\n})();\n","import { intersection } from \"lodash\";\nimport { message, notification } from \"antd\";\nimport { apiUrl, apiUrlProd } from \"config/config\";\nimport moment from \"moment\";\nimport jsPDF from \"jspdf\";\n\nexport function isLoggedIn() {\n return !!localStorage.getItem(\"roles\");\n}\n\nexport function isArrayWithLength(arr) {\n return Array.isArray(arr) && arr?.length;\n}\n\nexport function getAllowedRoutes(routes) {\n const roles = JSON.parse(localStorage.getItem(\"roles\"));\n return routes.filter(({ permission }) => {\n if (!permission) return true;\n else if (!isArrayWithLength(permission)) return true;\n else return intersection(permission, roles)?.length;\n });\n}\n\nexport function setCookie(cname, cvalue, expires_in = 3600) {\n let d = new Date();\n let expires = \"\";\n if (expires_in) {\n d.setTime(d.getTime() + expires_in);\n expires = \"expires=\" + d.toUTCString();\n }\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}\n\nexport function getCookie(name) {\n let value = \"; \" + document.cookie;\n let parts = value.split(\"; \" + name + \"=\");\n if (parts?.length === 2) return parts.pop().split(\";\").shift();\n}\nexport function deleteCookie(name) {\n setCookie(name, \"\", -1);\n}\n\nexport function deleteAllCookies() {\n var cookies = document.cookie.split(\"; \");\n if (cookies.length > 0) {\n for (let cookie of cookies) {\n let match = /^[^=]+/.exec(cookie);\n if (match) {\n document.cookie =\n match[0] + \"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/\";\n }\n }\n }\n}\n\nexport const fileTypeHandler = (type) => {\n switch (type) {\n case \"zip\":\n return \"/images/files/pdf.svg\";\n\n case \"mp3\":\n case \"wav\":\n return \"/images/files/pdf.svg\";\n\n case \"jpg\":\n case \"jpeg\":\n case \"png\":\n case \"svg\":\n return \"/images/files/pdf.svg\";\n\n case \"pdf\":\n return \"/images/files/pdf.svg\";\n\n case \"csv\":\n return \"/images/files/pdf.svg\";\n\n case \"mp4\":\n return \"/images/files/pdf.svg\";\n\n case \"xlx\":\n case \"xlsx\":\n return \"/images/files/pdf.svg\";\n\n case \"ppt\":\n case \"pptx\":\n return \"/images/files/pdf.svg\";\n\n case \"docx\":\n case \"doc\":\n return \"/images/files/pdf.svg\";\n\n default:\n return \"/images/files/pdf.svg\";\n }\n};\nexport function convertTwoDimensional(arr, size) {\n let res = [];\n for (let i = 0; i < arr?.length; i = i + size)\n res.push(arr.slice(i, i + size));\n return res;\n}\n\nexport function getPosition(elements) {}\n\nexport const cxmessage = message;\n\nexport const formatPhoneNumber = (phoneNumberString) => {\n var cleaned = (\"\" + phoneNumberString).replace(/\\D/g, \"\");\n var match = cleaned.match(/^(1|91)?(\\d{3})(\\d{3})(\\d{4})$/);\n if (match) {\n return [match[2], \"-\", match[3], \"-\", match[4], \"\"].join(\"\");\n }\n return null;\n};\nexport const formatPhoneNumberWithExt = (phoneNumberString) => {\n var cleaned = (\"\" + phoneNumberString).replace(/\\D/g, \"\");\n var match = cleaned.match(/^(1|91)?(\\d{3})(\\d{3})(\\d{4})$/);\n if (match) {\n return [\n \"+\",\n match[1],\n \" \",\n match[2],\n \"-\",\n match[3],\n \"-\",\n match[4],\n \"\",\n ].join(\"\");\n }\n return null;\n};\n\nexport const truncateSt = (str, n) => {\n return str?.length > n ? `${str?.substr(0, n - 1)}...` : str;\n};\n\nexport const ColorSet = (val) => {\n if ([\"A\", \"B\", \"C\"].includes(val)) {\n return \"#4CB580\";\n } else if ([\"G\", \"H\", \"I\"].includes(val)) {\n return \"#7640B8\";\n } else if ([\"J\", \"K\", \"L\"].includes(val)) {\n return \"#446fd4\";\n } else if ([\"M\", \"N\", \"O\"].includes(val)) {\n return \"#961224\";\n } else if ([\"P\", \"Q\", \"R\"].includes(val)) {\n return \"#a737d4\";\n } else if ([\"S\", \"T\", \"U\"].includes(val)) {\n return \"#F1DD96\";\n } else if ([\"V\", \"W\", \"X\"].includes(val)) {\n return \"#2e961a\";\n } else {\n return \"#9B446F\";\n }\n};\n\nexport const getApiUrl = () => {\n const tenantId = getCookie(\"tenant\");\n return process.env.REACT_APP_NODE_ENV === \"development\"\n ? apiUrl + `/${tenantId}`\n : apiUrlProd + `/${tenantId}`;\n};\n\nexport const urlcheck = (url) => {\n return (url = url.replace(/^https?:\\/\\//, \"\"));\n};\n\nexport const copyHandler = (val, text) => {\n navigator.clipboard.writeText(val);\n notification.success({\n message: text,\n });\n};\n\nexport const checkTime = (time) => {\n const today = moment().format(\"DD/MM/YYYY\");\n const yesterday = moment().subtract(1, \"days\").format(\"DD/MM/YYYY\");\n const date = moment(time).format(\"DD/MM/YYYY\");\n if (date === today) {\n return `Today ${moment(time).format(\"hh:mm A\")}`;\n }\n if (date === yesterday) {\n return `Yesterday ${moment(time).format(\"hh:mm A\")}`;\n }\n return moment(time).format(\"lll\");\n};\nexport const checkTimeConList = (time, createdAt) => {\n if (time) {\n const today = moment().format(\"DD/MM/YYYY\");\n const yesterday = moment().subtract(1, \"days\").format(\"DD/MM/YYYY\");\n const date = moment(time).format(\"DD/MM/YYYY\");\n if (date === today) {\n return `Today ${moment(time).format(\"hh:mm A\")}`;\n }\n if (date === yesterday) {\n return `Yesterday ${moment(time).format(\"hh:mm A\")}`;\n }\n return moment(time).format(\"LL\");\n } else {\n return moment(createdAt).format(\"LL\");\n }\n};\nexport const setDateCloud = (time) => {\n const today = moment().format(\"DD/MM/YYYY\");\n const yesterday = moment().subtract(1, \"days\").format(\"DD/MM/YYYY\");\n const date = moment(time).format(\"DD/MM/YYYY\");\n if (date === today) {\n return `Today`;\n }\n if (date === yesterday) {\n return `Yesterday`;\n }\n return moment(time).format(\"LL\");\n};\n\nexport const getBase64 = (file) =>\n new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = (error) => reject(error);\n });\n\nexport const extractVariables = (text) => {\n const re = /{{[^/]*?}}/g;\n let toRet = [];\n const vars = text?.match(re);\n if (!!vars) {\n for (let i = 0; i < vars?.length; i++) {\n let str = vars[i];\n toRet.push(str.substring(2, str?.length - 2));\n }\n }\n let sortUnique = [...new Set(toRet)];\n return sortUnique;\n};\n\nexport const replaceWithMarkdownBold = (input) => {\n if (input) {\n const regex = /\\[@(\\w+\\s?\\w+)\\]/g;\n const output = input.replace(regex, \"**@$1**\");\n return output;\n }\n};\n\nexport function generateUniqueKey() {\n const array = new Uint32Array(1);\n window.crypto.getRandomValues(array);\n return `${array[0]}-min`;\n}\n\nexport const extractMentionUid = (data) => {\n const regex = /UID:([a-f0-9\\-]+)/g;\n let match;\n let uids = new Set();\n\n while ((match = regex.exec(data)) !== null) {\n uids.add(match[1]);\n }\n\n let uidArray = [];\n if (uids.size > 0) {\n uidArray = Array.from(uids);\n }\n return uidArray;\n};\n\nexport const PermissionCheck = (Permissions, Check) => {\n if (Permissions && Check) {\n return Permissions?.some((res) => res?.name === Check);\n }\n};\n\nexport const dfCountry = (data) => {\n console.log(\"dfCountry\", data);\n if (data?.includes(\"US\")) {\n return \"US\";\n } else if (data?.includes(\"Asia/Kolkata\")) {\n return \"IN\";\n } else {\n return \"IN\";\n }\n};\n\nexport const getColorByPercentage = (percent) => {\n console.log(\"percent\", percent);\n switch (true) {\n case percent < 25:\n return \"red\"; // Red for 0-24%\n case percent < 60:\n return \"#FFBC00\"; // Yellow for 25-59%\n case percent <= 100:\n return \"#008000\"; // Green for 60-100%\n case percent === \"Infinity\":\n return \"#008000\";\n default:\n return \"#808080\"; // Default color if percent is out of range\n }\n};\n\nexport const exportJsonToPdf = (jsonData, name) => {\n const doc = new jsPDF();\n const margin = 10;\n const lineHeight = 7; // Reduced line height\n const pageHeight = doc.internal.pageSize.height;\n let y = margin;\n\n doc.setFontSize(10); // Set smaller font size\n\n jsonData.forEach((item) => {\n const text = `Name: ${item?.name}\\nMessage: ${\n item?.message ?? \"NA\"\n }\\nTime: ${item?.time}\\n\\n`;\n const lines = doc.splitTextToSize(\n text,\n doc.internal.pageSize.width - margin * 2\n );\n\n lines.forEach((line) => {\n if (y + lineHeight > pageHeight - margin) {\n doc.addPage();\n y = margin;\n }\n doc.text(line, margin, y);\n y += lineHeight;\n });\n });\n\n doc.save(`${name}.pdf`);\n};\n\nexport const transformString = (input) => {\n let obj = {\n u: \"user\",\n g: \"team\",\n };\n const parts = input.split(\"_\");\n if (parts.length !== 2) {\n throw new Error(\"Invalid input format\");\n }\n const firstLetter = parts[0];\n const restOfString = parts[1];\n return { type: obj[firstLetter], id: restOfString };\n};\nexport const encodeToBase64 = (obj) => {\n const jsonString = JSON.stringify(obj);\n return btoa(jsonString);\n};\n\nexport const decodeFromBase64 = (base64String) => {\n const jsonString = atob(base64String);\n return JSON.parse(jsonString);\n};\n\nexport const customRequires = (contactForm) => {\n if (contactForm?.formItems?.length > 0) {\n let f = contactForm?.formItems;\n let customRequired = f\n .map((res) => {\n if (res?.required && res?.isActive && res?.isCustom) {\n return res?.key;\n }\n return undefined;\n })\n .filter((key) => key !== undefined);\n return customRequired;\n }\n};\n\nexport const checkViewDate = (date) => {\n const viewedDate = moment(date);\n if (viewedDate.isSame(moment(), \"day\")) {\n return `Today at ${viewedDate.format(\"hh:mm a\")}`;\n } else if (viewedDate.isSame(moment().subtract(1, \"day\"), \"day\")) {\n return `Yesterday at ${viewedDate.format(\"hh:mm a\")}`;\n } else {\n return viewedDate.format(\"DD/MM/YY hh:mm a\");\n }\n};\n","export const languageOptions = [\n {\n label: \"English (UK)\",\n value: \"en_GB\",\n },\n {\n label: \"English (US)\",\n value: \"en_US\",\n },\n {\n label: \"French\",\n value: \"fr\",\n },\n {\n label: \"German\",\n value: \"de\",\n },\n {\n label: \"Greek\",\n value: \"el\",\n },\n {\n label: \"Portuguese {Brazil}\",\n value: \"pt_BR\",\n },\n {\n label: \"Portuguese {Portugal}\",\n value: \"pt_PT\",\n },\n {\n label: \"Spanish\",\n value: \"es\",\n },\n {\n label: \"Spanish (Spain)\",\n value: \"es_ES\",\n },\n {\n label: \"Spanish (Mexico)\",\n value: \"es_MX\",\n },\n {\n label: \"Hindi\",\n value: \"hi\",\n },\n {\n label: \"Urdu\",\n value: \"ur\",\n },\n {\n label: \"Bengali\",\n value: \"bn\",\n },\n {\n label: \"Gujarati\",\n value: \"gu\",\n },\n {\n label: \"Kannada\",\n value: \"kn\",\n },\n {\n label: \"Malayalam\",\n value: \"ml\",\n },\n {\n label: \"Marathi\",\n value: \"mr\",\n },\n {\n label: \"Punjabi\",\n value: \"pa\",\n },\n {\n label: \"Tamil\",\n value: \"ta\",\n },\n {\n label: \"Telugu\",\n value: \"te\",\n },\n {\n label: \"Indonesian\",\n value: \"id\",\n },\n];\n","let windowObjectReference = null;\nlet previousUrl = null;\n\nexport const openSignInWindow = (url, name, baseUrl) => {\n // remove any existing event listeners\n window.removeEventListener(\"message\", receiveMessage);\n\n // window features\n const strWindowFeatures =\n \"toolbar=no, menubar=no, width=600, height=900, top=100, left=100\";\n\n if (windowObjectReference === null || windowObjectReference.closed) {\n /* if the pointer to the window object in memory does not exist\n or if such pointer exists but the window was closed */\n windowObjectReference = window.open(url, name, strWindowFeatures);\n } else if (previousUrl !== url) {\n /* if the resource to load is different,\n then we load it in the already opened secondary window and then\n we bring such window back on top/in front of its parent window. */\n windowObjectReference = window.open(url, name, strWindowFeatures);\n windowObjectReference.focus();\n } else {\n /* else the window reference must exist and the window\n is not closed; therefore, we can bring it back on top of any other\n window with the focus() method. There would be no need to re-create\n the window or to reload the referenced resource. */\n windowObjectReference.focus();\n }\n\n // add the listener for receiving a message from the popup\n window.addEventListener(\n \"message\",\n (event) => receiveMessage(event, baseUrl),\n false\n );\n // assign the previous URL\n previousUrl = url;\n};\n\n\nconst receiveMessage = (event, baseUrl) => {\n if (event.origin != baseUrl) {\n return;\n }\n\n const { data } = event;\n const redirectUrl = `${data}`;\n window.location.search = redirectUrl;\n // window.history.replaceState({}, \"\", redirectUrl);\n};","import React, {useEffect} from \"react\"\nimport { openSignInWindow } from \"./open-popup\";\n\n\ntype CallbackObject = {\n client: string\n channels: string[]\n revokedChannels?: string[]\n}\n\ntype QueryParameters = {\n email?: string\n name?: string\n state?: string\n redirect_url?: string\n partner?: string\n next?: string\n}\n\n\ninterface IConnectButton extends React.ButtonHTMLAttributes {\n className?: string;\n partnerId: string;\n callback: (v: CallbackObject) => void;\n requestedNumber?: string;\n label?: React.ReactNode;\n env?: \"local\" | \"staging\" | \"rc\" | \"prod\";\n queryParameters?: QueryParameters\n}\n\nconst ConnectButton = ({\n className,\n partnerId,\n callback,\n requestedNumber,\n label = \"Connect 360dialog\",\n env=\"prod\",\n queryParameters,\n ...props\n}\n: IConnectButton) => {\n\n const baseUrl =\n (env === 'local' && 'http://0.0.0.0:8082') ||\n (env === 'staging' && 'https://admin.hub-staging.360dialog.io') ||\n (env === 'rc' && 'https://rc-admin.360dialog.io') ||\n 'https://hub.360dialog.com';\n \n\n let permissionUrl = requestedNumber\n ? `${baseUrl}/dashboard/app/${partnerId}/permissions?number=${requestedNumber}`\n : `${baseUrl}/dashboard/app/${partnerId}/permissions`;\n\n if (queryParameters) {\n let values = Object.values(queryParameters)\n Object.keys(queryParameters).forEach((k, idx) => {\n if (idx === 0 && !requestedNumber) {\n permissionUrl = permissionUrl + `?${k}=${values[idx]}`;\n } else {\n permissionUrl = permissionUrl + `&${k}=${values[idx]}`;\n }\n })\n }\n\n\n const getUrlParameter = (params: string, name: string) => {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(params);\n return results === null\n ? \"\"\n : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n\n useEffect(() => {\n const params = window.location.search;\n const client = getUrlParameter(params, \"client\");\n const channels = getUrlParameter(params, \"channels\");\n const revokedChannels = getUrlParameter(params, 'revoked');\n\n if (client && channels) {\n const channelsArray = channels\n .substring(1, channels.length - 1)\n .split(\",\");\n \n let callbackObj: CallbackObject = {\n client: client,\n channels: channelsArray,\n };\n\n if (revokedChannels) {\n const revokedChannelsArray = revokedChannels\n .substring(1, revokedChannels.length - 1)\n .split(',');\n callbackObj['revokedChannels'] = revokedChannelsArray;\n }\n callback(callbackObj);\n\n // remove search parameters from URL after fetching them\n // window.history.replaceState(null, \"\", window.location.pathname);\n }\n\n // send to parent (opener) window and close small window\n if (window.opener) {\n window.opener.postMessage(params);\n window.close();\n }\n }, []);\n\n return (\n \n openSignInWindow(\n permissionUrl,\n 'connect-360dialog',\n window.location.origin\n )\n }\n {...props}\n >\n {label}\n \n );\n};\n\nexport default ConnectButton","\n'use strict'\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dialog-connect-button.cjs.production.min.js')\n} else {\n module.exports = require('./dialog-connect-button.cjs.development.js')\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","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\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\" };\nexports.default = CheckCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\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\" };\nexports.default = CheckCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"filled\" };\nexports.default = CloseCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close-circle\", \"theme\": \"outlined\" };\nexports.default = CloseCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CloseOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z\" } }] }, \"name\": \"close\", \"theme\": \"outlined\" };\nexports.default = CloseOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExclamationCircleFilled = { \"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 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"filled\" };\nexports.default = ExclamationCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExclamationCircleOutlined = { \"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 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"outlined\" };\nexports.default = ExclamationCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar InfoCircleFilled = { \"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 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"info-circle\", \"theme\": \"filled\" };\nexports.default = InfoCircleFilled;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\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\" };\nexports.default = InfoCircleOutlined;\n","\"use strict\";\n// This icon file is generated automatically.\nObject.defineProperty(exports, \"__esModule\", { value: true });\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\" };\nexports.default = LoadingOutlined;\n","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CheckCircleFilled = _interopRequireDefault(require('./lib/icons/CheckCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CheckCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CheckCircleOutlined = _interopRequireDefault(require('./lib/icons/CheckCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CheckCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseCircleFilled = _interopRequireDefault(require('./lib/icons/CloseCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseCircleOutlined = _interopRequireDefault(require('./lib/icons/CloseCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _CloseOutlined = _interopRequireDefault(require('./lib/icons/CloseOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _CloseOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _ExclamationCircleFilled = _interopRequireDefault(require('./lib/icons/ExclamationCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _ExclamationCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _ExclamationCircleOutlined = _interopRequireDefault(require('./lib/icons/ExclamationCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _ExclamationCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _InfoCircleFilled = _interopRequireDefault(require('./lib/icons/InfoCircleFilled'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _InfoCircleFilled;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _InfoCircleOutlined = _interopRequireDefault(require('./lib/icons/InfoCircleOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _InfoCircleOutlined;\n exports.default = _default;\n module.exports = _default;","'use strict';\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n \n var _LoadingOutlined = _interopRequireDefault(require('./lib/icons/LoadingOutlined'));\n \n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n \n var _default = _LoadingOutlined;\n exports.default = _default;\n module.exports = _default;","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';\nimport camelCase from 'lodash/camelCase';\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 delete acc[key];\n acc[camelCase(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-flex;\\n alignItems: center;\\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 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, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(icon.name), !!icon.name), \"\".concat(prefixCls, \"-spin\"), !!spin || icon.name === 'loading'), 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;","import { createContext } from 'react';\nvar IconContext = /*#__PURE__*/createContext({});\nexport default IconContext;","// This icon file is generated automatically.\nvar ArrowRightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z\" } }] }, \"name\": \"arrow-right\", \"theme\": \"outlined\" };\nexport default ArrowRightOutlined;\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 ArrowRightOutlinedSvg from \"@ant-design/icons-svg/es/asn/ArrowRightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ArrowRightOutlined = function ArrowRightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ArrowRightOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ArrowRightOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ArrowRightOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CheckCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CheckCircleFilled';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CheckCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CheckCircleOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CheckOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CheckOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloseCircleFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z\" } }] }, \"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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseCircleFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloseCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z\" } }] }, \"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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseCircleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloseOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"fill-rule\": \"evenodd\", \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z\" } }] }, \"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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloudDownloadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z\" } }] }, \"name\": \"cloud-download\", \"theme\": \"outlined\" };\nexport default CloudDownloadOutlined;\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 CloudDownloadOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloudDownloadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloudDownloadOutlined = function CloudDownloadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloudDownloadOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloudDownloadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloudDownloadOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CloudUploadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z\" } }] }, \"name\": \"cloud-upload\", \"theme\": \"outlined\" };\nexport default CloudUploadOutlined;\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 CloudUploadOutlinedSvg from \"@ant-design/icons-svg/es/asn/CloudUploadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CloudUploadOutlined = function CloudUploadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CloudUploadOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloudUploadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloudUploadOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar CopyOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z\" } }] }, \"name\": \"copy\", \"theme\": \"outlined\" };\nexport default CopyOutlined;\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 CopyOutlinedSvg from \"@ant-design/icons-svg/es/asn/CopyOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar CopyOutlined = function CopyOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CopyOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CopyOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CopyOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar DeleteFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z\" } }] }, \"name\": \"delete\", \"theme\": \"filled\" };\nexport default DeleteFilled;\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 DeleteFilledSvg from \"@ant-design/icons-svg/es/asn/DeleteFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar DeleteFilled = function DeleteFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DeleteFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DeleteFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DeleteFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar DeleteOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z\" } }] }, \"name\": \"delete\", \"theme\": \"outlined\" };\nexport default DeleteOutlined;\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 DeleteOutlinedSvg from \"@ant-design/icons-svg/es/asn/DeleteOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DeleteOutlined = function DeleteOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DeleteOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DeleteOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DeleteOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar DoubleRightOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z\" } }] }, \"name\": \"double-right\", \"theme\": \"outlined\" };\nexport default DoubleRightOutlined;\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 DoubleRightOutlinedSvg from \"@ant-design/icons-svg/es/asn/DoubleRightOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DoubleRightOutlined = function DoubleRightOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DoubleRightOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DoubleRightOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DoubleRightOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DownOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DownOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar EditFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z\" } }] }, \"name\": \"edit\", \"theme\": \"filled\" };\nexport default EditFilled;\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 EditFilledSvg from \"@ant-design/icons-svg/es/asn/EditFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar EditFilled = function EditFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EditFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EditFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EditFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar EditOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z\" } }] }, \"name\": \"edit\", \"theme\": \"outlined\" };\nexport default EditOutlined;\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 EditOutlinedSvg from \"@ant-design/icons-svg/es/asn/EditOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EditOutlined = function EditOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EditOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EditOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EditOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar EllipsisOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z\" } }] }, \"name\": \"ellipsis\", \"theme\": \"outlined\" };\nexport default EllipsisOutlined;\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 EllipsisOutlinedSvg from \"@ant-design/icons-svg/es/asn/EllipsisOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EllipsisOutlined = function EllipsisOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EllipsisOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EllipsisOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EllipsisOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ExclamationCircleFilled = { \"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 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"filled\" };\nexport default ExclamationCircleFilled;\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 ExclamationCircleFilledSvg from \"@ant-design/icons-svg/es/asn/ExclamationCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar ExclamationCircleFilled = function ExclamationCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ExclamationCircleFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ExclamationCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ExclamationCircleFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ExclamationCircleOutlined = { \"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 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z\" } }] }, \"name\": \"exclamation-circle\", \"theme\": \"outlined\" };\nexport default ExclamationCircleOutlined;\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 ExclamationCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/ExclamationCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ExclamationCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ExclamationCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ExclamationCircleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ExpandOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"defs\", \"attrs\": {}, \"children\": [{ \"tag\": \"style\", \"attrs\": {} }] }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M342 88H120c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V168h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm578 576h-48c-8.8 0-16 7.2-16 16v176H682c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V680c0-8.8-7.2-16-16-16zM342 856H168V680c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zM904 88H682c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V120c0-17.7-14.3-32-32-32z\" } }] }, \"name\": \"expand\", \"theme\": \"outlined\" };\nexport default ExpandOutlined;\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 ExpandOutlinedSvg from \"@ant-design/icons-svg/es/asn/ExpandOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ExpandOutlined = function ExpandOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ExpandOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ExpandOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ExpandOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar EyeInvisibleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z\" } }] }, \"name\": \"eye-invisible\", \"theme\": \"outlined\" };\nexport default EyeInvisibleOutlined;\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 EyeInvisibleOutlinedSvg from \"@ant-design/icons-svg/es/asn/EyeInvisibleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EyeInvisibleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EyeInvisibleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EyeInvisibleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar EyeOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z\" } }] }, \"name\": \"eye\", \"theme\": \"outlined\" };\nexport default EyeOutlined;\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 EyeOutlinedSvg from \"@ant-design/icons-svg/es/asn/EyeOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar EyeOutlined = function EyeOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: EyeOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(EyeOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'EyeOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar FileImageOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z\" } }] }, \"name\": \"file-image\", \"theme\": \"outlined\" };\nexport default FileImageOutlined;\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 FileImageOutlinedSvg from \"@ant-design/icons-svg/es/asn/FileImageOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FileImageOutlined = function FileImageOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FileImageOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FileImageOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FileImageOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar FileOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z\" } }] }, \"name\": \"file\", \"theme\": \"outlined\" };\nexport default FileOutlined;\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 FileOutlinedSvg from \"@ant-design/icons-svg/es/asn/FileOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FileOutlined = function FileOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FileOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FileOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FileOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar FilterOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z\" } }] }, \"name\": \"filter\", \"theme\": \"outlined\" };\nexport default FilterOutlined;\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 FilterOutlinedSvg from \"@ant-design/icons-svg/es/asn/FilterOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar FilterOutlined = function FilterOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: FilterOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(FilterOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'FilterOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar GlobalOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z\" } }] }, \"name\": \"global\", \"theme\": \"outlined\" };\nexport default GlobalOutlined;\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 GlobalOutlinedSvg from \"@ant-design/icons-svg/es/asn/GlobalOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar GlobalOutlined = function GlobalOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: GlobalOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(GlobalOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'GlobalOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(InfoCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'InfoCircleOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(LeftOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LeftOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar LinkedinOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 10-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z\" } }] }, \"name\": \"linkedin\", \"theme\": \"outlined\" };\nexport default LinkedinOutlined;\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 LinkedinOutlinedSvg from \"@ant-design/icons-svg/es/asn/LinkedinOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar LinkedinOutlined = function LinkedinOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: LinkedinOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(LinkedinOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LinkedinOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(LoadingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LoadingOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MailOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MailOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar MenuFoldOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z\" } }] }, \"name\": \"menu-fold\", \"theme\": \"outlined\" };\nexport default MenuFoldOutlined;\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 MenuFoldOutlinedSvg from \"@ant-design/icons-svg/es/asn/MenuFoldOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MenuFoldOutlined = function MenuFoldOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MenuFoldOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MenuFoldOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MenuFoldOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar MenuUnfoldOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z\" } }] }, \"name\": \"menu-unfold\", \"theme\": \"outlined\" };\nexport default MenuUnfoldOutlined;\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 MenuUnfoldOutlinedSvg from \"@ant-design/icons-svg/es/asn/MenuUnfoldOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MenuUnfoldOutlined = function MenuUnfoldOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MenuUnfoldOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MenuUnfoldOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MenuUnfoldOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar MessageOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z\" } }] }, \"name\": \"message\", \"theme\": \"outlined\" };\nexport default MessageOutlined;\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 MessageOutlinedSvg from \"@ant-design/icons-svg/es/asn/MessageOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MessageOutlined = function MessageOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MessageOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MessageOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MessageOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PaperClipOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z\" } }] }, \"name\": \"paper-clip\", \"theme\": \"outlined\" };\nexport default PaperClipOutlined;\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 PaperClipOutlinedSvg from \"@ant-design/icons-svg/es/asn/PaperClipOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PaperClipOutlined = function PaperClipOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PaperClipOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PaperClipOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PaperClipOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PlayCircleOutlined = { \"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\": \"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z\" } }] }, \"name\": \"play-circle\", \"theme\": \"outlined\" };\nexport default PlayCircleOutlined;\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 PlayCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlayCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PlayCircleOutlined = function PlayCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PlayCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PlayCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PlayCircleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PlaySquareOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M442.3 677.6l199.4-156.7a11.3 11.3 0 000-17.7L442.3 346.4c-7.4-5.8-18.3-.6-18.3 8.8v313.5c0 9.4 10.9 14.7 18.3 8.9z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" } }] }, \"name\": \"play-square\", \"theme\": \"outlined\" };\nexport default PlaySquareOutlined;\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 PlaySquareOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlaySquareOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PlaySquareOutlined = function PlaySquareOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PlaySquareOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PlaySquareOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PlaySquareOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PlusCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z\" } }, { \"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\": \"plus-circle\", \"theme\": \"outlined\" };\nexport default PlusCircleOutlined;\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 PlusCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlusCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PlusCircleOutlined = function PlusCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PlusCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PlusCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PlusCircleOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PlusOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z\" } }] }, \"name\": \"plus\", \"theme\": \"outlined\" };\nexport default PlusOutlined;\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 PlusOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlusOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PlusOutlined = function PlusOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PlusOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PlusOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PlusOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar ProfileOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM492 400h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM340 368a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0z\" } }] }, \"name\": \"profile\", \"theme\": \"outlined\" };\nexport default ProfileOutlined;\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 ProfileOutlinedSvg from \"@ant-design/icons-svg/es/asn/ProfileOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar ProfileOutlined = function ProfileOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: ProfileOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ProfileOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ProfileOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar RightCircleOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z\" } }, { \"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\": \"right-circle\", \"theme\": \"outlined\" };\nexport default RightCircleOutlined;\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 RightCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/RightCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar RightCircleOutlined = function RightCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: RightCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RightCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RightCircleOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(RightOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'RightOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SearchOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SearchOutlined';\n}\nexport default RefIcon;","// 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};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SettingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SettingOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar SlidersOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z\" } }] }, \"name\": \"sliders\", \"theme\": \"outlined\" };\nexport default SlidersOutlined;\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 SlidersOutlinedSvg from \"@ant-design/icons-svg/es/asn/SlidersOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SlidersOutlined = function SlidersOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SlidersOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SlidersOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SlidersOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar SwapOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"swap\", \"theme\": \"outlined\" };\nexport default SwapOutlined;\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 SwapOutlinedSvg from \"@ant-design/icons-svg/es/asn/SwapOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar SwapOutlined = function SwapOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: SwapOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(SwapOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'SwapOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar UploadOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z\" } }] }, \"name\": \"upload\", \"theme\": \"outlined\" };\nexport default UploadOutlined;\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 UploadOutlinedSvg from \"@ant-design/icons-svg/es/asn/UploadOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar UploadOutlined = function UploadOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: UploadOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(UploadOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'UploadOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar WarningOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z\" } }] }, \"name\": \"warning\", \"theme\": \"outlined\" };\nexport default WarningOutlined;\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 WarningOutlinedSvg from \"@ant-design/icons-svg/es/asn/WarningOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar WarningOutlined = function WarningOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: WarningOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(WarningOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'WarningOutlined';\n}\nexport default RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar _Context = _interopRequireDefault(require(\"./Context\"));\nvar _IconBase = _interopRequireDefault(require(\"./IconBase\"));\nvar _twoTonePrimaryColor = require(\"./twoTonePrimaryColor\");\nvar _utils = require(\"../utils\");\nvar _excluded = [\"className\", \"icon\", \"spin\", \"rotate\", \"tabIndex\", \"onClick\", \"twoToneColor\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// Initial setting\n// should move it to antd main repo?\n(0, _twoTonePrimaryColor.setTwoToneColor)('#1890ff');\nvar Icon = /*#__PURE__*/React.forwardRef(function (props, ref) {\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 = (0, _objectWithoutProperties2.default)(props, _excluded);\n var _React$useContext = React.useContext(_Context.default),\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 = (0, _classnames.default)(rootClassName, prefixCls, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, \"\".concat(prefixCls, \"-\").concat(icon.name), !!icon.name), \"\".concat(prefixCls, \"-spin\"), !!spin || icon.name === 'loading'), 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 = (0, _utils.normalizeTwoToneColors)(twoToneColor),\n _normalizeTwoToneColo2 = (0, _slicedToArray2.default)(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return /*#__PURE__*/React.createElement(\"span\", (0, _objectSpread2.default)((0, _objectSpread2.default)({\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(_IconBase.default, {\n icon: icon,\n primaryColor: primaryColor,\n secondaryColor: secondaryColor,\n style: svgStyle\n }));\n});\nIcon.displayName = 'AntdIcon';\nIcon.getTwoToneColor = _twoTonePrimaryColor.getTwoToneColor;\nIcon.setTwoToneColor = _twoTonePrimaryColor.setTwoToneColor;\nvar _default = exports.default = Icon;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _react = require(\"react\");\nvar IconContext = /*#__PURE__*/(0, _react.createContext)({});\nvar _default = exports.default = IconContext;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _utils = require(\"../utils\");\nvar _excluded = [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"];\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 || (0, _utils.getSecondaryColor)(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\nfunction getTwoToneColors() {\n return (0, _objectSpread2.default)({}, 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 = (0, _objectWithoutProperties2.default)(props, _excluded);\n var colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || (0, _utils.getSecondaryColor)(primaryColor)\n };\n }\n (0, _utils.useInsertStyles)();\n (0, _utils.warning)((0, _utils.isIconDefinition)(icon), \"icon should be icon definiton, but got \".concat(icon));\n if (!(0, _utils.isIconDefinition)(icon)) {\n return null;\n }\n var target = icon;\n if (target && typeof target.icon === 'function') {\n target = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return (0, _utils.generate)(target.icon, \"svg-\".concat(target.name), (0, _objectSpread2.default)({\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;\nvar _default = exports.default = IconBase;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getTwoToneColor = getTwoToneColor;\nexports.setTwoToneColor = setTwoToneColor;\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _IconBase = _interopRequireDefault(require(\"./IconBase\"));\nvar _utils = require(\"../utils\");\nfunction setTwoToneColor(twoToneColor) {\n var _normalizeTwoToneColo = (0, _utils.normalizeTwoToneColors)(twoToneColor),\n _normalizeTwoToneColo2 = (0, _slicedToArray2.default)(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n return _IconBase.default.setTwoToneColors({\n primaryColor: primaryColor,\n secondaryColor: secondaryColor\n });\n}\nfunction getTwoToneColor() {\n var colors = _IconBase.default.getTwoToneColors();\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n return [colors.primaryColor, colors.secondaryColor];\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CheckCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CheckCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CheckCircleFilled = function CheckCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CheckCircleFilled.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CheckCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CheckCircleFilled';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CheckCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CheckCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CheckCircleOutlined = function CheckCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CheckCircleOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CheckCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CheckCircleOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseCircleFilled = function CloseCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseCircleFilled.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseCircleFilled';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseCircleOutlined = function CloseCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseCircleOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseCircleOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _CloseOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/CloseOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar CloseOutlined = function CloseOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _CloseOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CloseOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CloseOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ExclamationCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/ExclamationCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar ExclamationCircleFilled = function ExclamationCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _ExclamationCircleFilled.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ExclamationCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ExclamationCircleFilled';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ExclamationCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/ExclamationCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _ExclamationCircleOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(ExclamationCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'ExclamationCircleOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _InfoCircleFilled = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/InfoCircleFilled\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar InfoCircleFilled = function InfoCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _InfoCircleFilled.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(InfoCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'InfoCircleFilled';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _InfoCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/InfoCircleOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar InfoCircleOutlined = function InfoCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _InfoCircleOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(InfoCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'InfoCircleOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _LoadingOutlined = _interopRequireDefault(require(\"@ant-design/icons-svg/lib/asn/LoadingOutlined\"));\nvar _AntdIcon = _interopRequireDefault(require(\"../components/AntdIcon\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nvar LoadingOutlined = function LoadingOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(_AntdIcon.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {\n ref: ref,\n icon: _LoadingOutlined.default\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(LoadingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LoadingOutlined';\n}\nvar _default = exports.default = RefIcon;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _typeof3 = require(\"@babel/runtime/helpers/typeof\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.generate = generate;\nexports.getSecondaryColor = getSecondaryColor;\nexports.iconStyles = void 0;\nexports.isIconDefinition = isIconDefinition;\nexports.normalizeAttrs = normalizeAttrs;\nexports.normalizeTwoToneColors = normalizeTwoToneColors;\nexports.useInsertStyles = exports.svgBaseProps = void 0;\nexports.warning = warning;\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\nvar _colors = require(\"@ant-design/colors\");\nvar _react = _interopRequireWildcard(require(\"react\"));\nvar _warning = _interopRequireDefault(require(\"rc-util/lib/warning\"));\nvar _dynamicCSS = require(\"rc-util/lib/Dom/dynamicCSS\");\nvar _Context = _interopRequireDefault(require(\"./components/Context\"));\nvar _camelCase = _interopRequireDefault(require(\"lodash/camelCase\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof3(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction warning(valid, message) {\n (0, _warning.default)(valid, \"[@ant-design/icons] \".concat(message));\n}\nfunction isIconDefinition(target) {\n return (0, _typeof2.default)(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && ((0, _typeof2.default)(target.icon) === 'object' || typeof target.icon === 'function');\n}\nfunction 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 delete acc[key];\n acc[(0, _camelCase.default)(key)] = val;\n }\n return acc;\n }, {});\n}\nfunction generate(node, key, rootProps) {\n if (!rootProps) {\n return /*#__PURE__*/_react.default.createElement(node.tag, (0, _objectSpread2.default)({\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.default.createElement(node.tag, (0, _objectSpread2.default)((0, _objectSpread2.default)({\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}\nfunction getSecondaryColor(primaryColor) {\n // choose the second color\n return (0, _colors.generate)(primaryColor)[0];\n}\nfunction 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\nvar svgBaseProps = exports.svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nvar iconStyles = exports.iconStyles = \"\\n.anticon {\\n display: inline-flex;\\n alignItems: center;\\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\";\nvar useInsertStyles = exports.useInsertStyles = function useInsertStyles() {\n var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;\n var _useContext = (0, _react.useContext)(_Context.default),\n csp = _useContext.csp;\n (0, _react.useEffect)(function () {\n (0, _dynamicCSS.updateCSS)(styleStr, '@ant-design-icons', {\n prepend: true,\n csp: csp\n });\n }, []);\n};","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CKEditor\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"CKEditor\"] = factory(root[\"React\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__787__) => {\nreturn ","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__787__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","import debounce from './debounce.js';\nimport isObject from './isObject.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nexport default throttle;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","import isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport default isElement;\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module watchdog/utils/getsubnodes\n */\n\n/* globals EventTarget, Event */\n\nexport default function getSubNodes( head, excludedProperties = new Set() ) {\n\tconst nodes = [ head ];\n\n\t// @if CK_DEBUG_WATCHDOG // const prevNodeMap = new Map();\n\n\t// Nodes are stored to prevent infinite looping.\n\tconst subNodes = new Set();\n\tlet nodeIndex = 0;\n\n\twhile ( nodes.length > nodeIndex ) {\n\t\t// Incrementing the iterator is much faster than changing size of the array with Array.prototype.shift().\n\t\tconst node = nodes[ nodeIndex++ ];\n\n\t\tif ( subNodes.has( node ) || shouldNodeBeSkipped( node ) || excludedProperties.has( node ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tsubNodes.add( node );\n\n\t\t// Handle arrays, maps, sets, custom collections that implements `[ Symbol.iterator ]()`, etc.\n\t\tif ( node[ Symbol.iterator ] ) {\n\t\t\t// The custom editor iterators might cause some problems if the editor is crashed.\n\t\t\ttry {\n\t\t\t\tfor ( const n of node ) {\n\t\t\t\t\tnodes.push( n );\n\n\t\t\t\t\t// @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( n ) ) {\n\t\t\t\t\t// @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( n, node );\n\t\t\t\t\t// @if CK_DEBUG_WATCHDOG // }\n\t\t\t\t}\n\t\t\t} catch ( err ) {\n\t\t\t\t// Do not log errors for broken structures\n\t\t\t\t// since we are in the error handling process already.\n\t\t\t\t// eslint-disable-line no-empty\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( const key in node ) {\n\t\t\t\t// We share a reference via the protobuf library within the editors,\n\t\t\t\t// hence the shared value should be skipped. Although, it's not a perfect\n\t\t\t\t// solution since new places like that might occur in the future.\n\t\t\t\tif ( key === 'defaultValue' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tnodes.push( node[ key ] );\n\n\t\t\t\t// @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( node[ key ] ) ) {\n\t\t\t\t// @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( node[ key ], node );\n\t\t\t\t// @if CK_DEBUG_WATCHDOG // }\n\t\t\t}\n\t\t}\n\t}\n\n\t// @if CK_DEBUG_WATCHDOG // return { subNodes, prevNodeMap };\n\n\treturn subNodes;\n}\n\nfunction shouldNodeBeSkipped( node ) {\n\tconst type = Object.prototype.toString.call( node );\n\tconst typeOfNode = typeof node;\n\n\treturn (\n\t\ttypeOfNode === 'number' ||\n\t\ttypeOfNode === 'boolean' ||\n\t\ttypeOfNode === 'string' ||\n\t\ttypeOfNode === 'symbol' ||\n\t\ttypeOfNode === 'function' ||\n\t\ttype === '[object Date]' ||\n\t\ttype === '[object RegExp]' ||\n\t\ttype === '[object Module]' ||\n\n\t\tnode === undefined ||\n\t\tnode === null ||\n\n\t\t// This flag is meant to exclude singletons shared across editor instances. So when an error is thrown in one editor,\n\t\t// the other editors connected through the reference to the same singleton are not restarted. This is a temporary workaround\n\t\t// until a better solution is found.\n\t\t// More in https://github.com/ckeditor/ckeditor5/issues/12292.\n\t\tnode._watchdogExcluded === true ||\n\n\t\t// Skip native DOM objects, e.g. Window, nodes, events, etc.\n\t\tnode instanceof EventTarget ||\n\t\tnode instanceof Event\n\t);\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module watchdog/utils/areconnectedthroughproperties\n */\n\n/* globals console */\n\nimport getSubNodes from './getsubnodes';\n\n/**\n * Traverses both structures to find out whether there is a reference that is shared between both structures.\n *\n * @param {Object|Array} target1\n * @param {Object|Array} target2\n * @returns {Boolean}\n */\nexport default function areConnectedThroughProperties( target1, target2, excludedNodes = new Set() ) {\n\tif ( target1 === target2 && isObject( target1 ) ) {\n\t\treturn true;\n\t}\n\n\t// @if CK_DEBUG_WATCHDOG // return checkConnectionBetweenProps( target1, target2, excludedNodes );\n\n\tconst subNodes1 = getSubNodes( target1, excludedNodes );\n\tconst subNodes2 = getSubNodes( target2, excludedNodes );\n\n\tfor ( const node of subNodes1 ) {\n\t\tif ( subNodes2.has( node ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/* istanbul ignore next */\n// eslint-disable-next-line\nfunction checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = getSubNodes( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = getSubNodes( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction isObject( structure ) {\n\treturn typeof structure === 'object' && structure !== null;\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module watchdog/watchdog\n */\n\n/* globals window */\n\n/**\n * An abstract watchdog class that handles most of the error handling process and the state of the underlying component.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and how to use it.\n *\n * @private\n * @abstract\n */\nexport default class Watchdog {\n\t/**\n\t * @param {module:watchdog/watchdog~WatchdogConfig} config The watchdog plugin configuration.\n\t */\n\tconstructor( config ) {\n\t\t/**\n\t\t * An array of crashes saved as an object with the following properties:\n\t\t *\n\t\t * * `message`: `String`,\n\t\t * * `stack`: `String`,\n\t\t * * `date`: `Number`,\n\t\t * * `filename`: `String | undefined`,\n\t\t * * `lineno`: `Number | undefined`,\n\t\t * * `colno`: `Number | undefined`,\n\t\t *\n\t\t * @public\n\t\t * @readonly\n\t\t * @type {Array.}\n\t\t */\n\t\tthis.crashes = [];\n\n\t\t/**\n\t\t * Specifies the state of the item watched by the watchdog. The state can be one of the following values:\n\t\t *\n\t\t * * `initializing` – Before the first initialization, and after crashes, before the item is ready.\n\t\t * * `ready` – A state when the user can interact with the item.\n\t\t * * `crashed` – A state when an error occurs. It quickly changes to `initializing` or `crashedPermanently`\n\t\t * depending on how many and how frequent errors have been caught recently.\n\t\t * * `crashedPermanently` – A state when the watchdog stops reacting to errors and keeps the item it is watching crashed,\n\t\t * * `destroyed` – A state when the item is manually destroyed by the user after calling `watchdog.destroy()`.\n\t\t *\n\t\t * @public\n\t\t * @type {'initializing'|'ready'|'crashed'|'crashedPermanently'|'destroyed'}\n\t\t */\n\t\tthis.state = 'initializing';\n\n\t\t/**\n\t\t * @protected\n\t\t * @type {Number}\n\t\t * @see module:watchdog/watchdog~WatchdogConfig\n\t\t */\n\t\tthis._crashNumberLimit = typeof config.crashNumberLimit === 'number' ? config.crashNumberLimit : 3;\n\n\t\t/**\n\t\t * Returns the result of the `Date.now()` call. It can be overridden in tests to mock time as some popular\n\t\t * approaches like `sinon.useFakeTimers()` do not work well with error handling.\n\t\t *\n\t\t * @protected\n\t\t */\n\t\tthis._now = Date.now;\n\n\t\t/**\n\t\t * @protected\n\t\t * @type {Number}\n\t\t * @see module:watchdog/watchdog~WatchdogConfig\n\t\t */\n\t\tthis._minimumNonErrorTimePeriod = typeof config.minimumNonErrorTimePeriod === 'number' ? config.minimumNonErrorTimePeriod : 5000;\n\n\t\t/**\n\t\t * Checks if the event error comes from the underlying item and restarts the item.\n\t\t *\n\t\t * @private\n\t\t * @type {Function}\n\t\t */\n\t\tthis._boundErrorHandler = evt => {\n\t\t\t// `evt.error` is exposed by EventError while `evt.reason` is available in PromiseRejectionEvent.\n\t\t\tconst error = evt.error || evt.reason;\n\n\t\t\t// Note that `evt.reason` might be everything that is in the promise rejection.\n\t\t\t// Similarly everything that is thrown lands in `evt.error`.\n\t\t\tif ( error instanceof Error ) {\n\t\t\t\tthis._handleError( error, evt );\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * The creation method.\n\t\t *\n\t\t * @protected\n\t\t * @member {Function} #_creator\n\t\t * @see #setCreator\n\t\t */\n\n\t\t/**\n\t\t * The destruction method.\n\t\t *\n\t\t * @protected\n\t\t * @member {Function} #_destructor\n\t\t * @see #setDestructor\n\t\t */\n\n\t\t/**\n\t\t * The watched item.\n\t\t *\n\t\t * @abstract\n\t\t * @protected\n\t\t * @member {Object|undefined} #_item\n\t\t */\n\n\t\t/**\n\t\t * The method responsible for restarting the watched item.\n\t\t *\n\t\t * @abstract\n\t\t * @protected\n\t\t * @method #_restart\n\t\t */\n\n\t\t/**\n\t\t * Traverses the error context and the watched item to find out whether the error should\n\t\t * be handled by the given item.\n\t\t *\n\t\t * @abstract\n\t\t * @protected\n\t\t * @method #_isErrorComingFromThisItem\n\t\t * @param {module:utils/ckeditorerror~CKEditorError} error\n\t\t */\n\n\t\t/**\n\t\t * A dictionary of event emitter listeners.\n\t\t *\n\t\t * @private\n\t\t * @type {Object.>}\n\t\t */\n\t\tthis._listeners = {};\n\n\t\tif ( !this._restart ) {\n\t\t\tthrow new Error(\n\t\t\t\t'The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. ' +\n\t\t\t\t'Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.'\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Sets the function that is responsible for creating watched items.\n\t *\n\t * @param {Function} creator A callback responsible for creating an item. Returns a promise\n\t * that is resolved when the item is created.\n\t */\n\tsetCreator( creator ) {\n\t\tthis._creator = creator;\n\t}\n\n\t/**\n\t * Sets the function that is responsible for destroying watched items.\n\t *\n\t * @param {Function} destructor A callback that takes the item and returns the promise\n\t * to the destroying process.\n\t */\n\tsetDestructor( destructor ) {\n\t\tthis._destructor = destructor;\n\t}\n\n\t/**\n\t * Destroys the watchdog and releases the resources.\n\t */\n\tdestroy() {\n\t\tthis._stopErrorHandling();\n\n\t\tthis._listeners = {};\n\t}\n\n\t/**\n\t * Starts listening to a specific event name by registering a callback that will be executed\n\t * whenever an event with a given name fires.\n\t *\n\t * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n\t *\n\t * @param {String} eventName The event name.\n\t * @param {Function} callback A callback which will be added to event listeners.\n\t */\n\ton( eventName, callback ) {\n\t\tif ( !this._listeners[ eventName ] ) {\n\t\t\tthis._listeners[ eventName ] = [];\n\t\t}\n\n\t\tthis._listeners[ eventName ].push( callback );\n\t}\n\n\t/**\n\t * Stops listening to the specified event name by removing the callback from event listeners.\n\t *\n\t * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n\t *\n\t * @param {String} eventName The event name.\n\t * @param {Function} callback A callback which will be removed from event listeners.\n\t */\n\toff( eventName, callback ) {\n\t\tthis._listeners[ eventName ] = this._listeners[ eventName ]\n\t\t\t.filter( cb => cb !== callback );\n\t}\n\n\t/**\n\t * Fires an event with a given event name and arguments.\n\t *\n\t * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n\t *\n\t * @protected\n\t * @param {String} eventName The event name.\n\t * @param {...*} args Event arguments.\n\t */\n\t_fire( eventName, ...args ) {\n\t\tconst callbacks = this._listeners[ eventName ] || [];\n\n\t\tfor ( const callback of callbacks ) {\n\t\t\tcallback.apply( this, [ null, ...args ] );\n\t\t}\n\t}\n\n\t/**\n\t * Starts error handling by attaching global error handlers.\n\t *\n\t * @protected\n\t */\n\t_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}\n\n\t/**\n\t * Stops error handling by detaching global error handlers.\n\t *\n\t * @protected\n\t */\n\t_stopErrorHandling() {\n\t\twindow.removeEventListener( 'error', this._boundErrorHandler );\n\t\twindow.removeEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}\n\n\t/**\n\t * Checks if an error comes from the watched item and restarts it.\n\t * It reacts to {@link module:utils/ckeditorerror~CKEditorError `CKEditorError` errors} only.\n\t *\n\t * @private\n\t * @fires error\n\t * @param {Error} error Error.\n\t * @param {ErrorEvent|PromiseRejectionEvent} evt An error event.\n\t */\n\t_handleError( error, evt ) {\n\t\t// @if CK_DEBUG // if ( error.is && error.is( 'CKEditorError' ) && error.context === undefined ) {\n\t\t// @if CK_DEBUG // console.warn( 'The error is missing its context and Watchdog cannot restart the proper item.' );\n\t\t// @if CK_DEBUG // }\n\n\t\tif ( this._shouldReactToError( error ) ) {\n\t\t\tthis.crashes.push( {\n\t\t\t\tmessage: error.message,\n\t\t\t\tstack: error.stack,\n\n\t\t\t\t// `evt.filename`, `evt.lineno` and `evt.colno` are available only in ErrorEvent events\n\t\t\t\tfilename: evt.filename,\n\t\t\t\tlineno: evt.lineno,\n\t\t\t\tcolno: evt.colno,\n\t\t\t\tdate: this._now()\n\t\t\t} );\n\n\t\t\tconst causesRestart = this._shouldRestart();\n\n\t\t\tthis.state = 'crashed';\n\t\t\tthis._fire( 'stateChange' );\n\t\t\tthis._fire( 'error', { error, causesRestart } );\n\n\t\t\tif ( causesRestart ) {\n\t\t\t\tthis._restart();\n\t\t\t} else {\n\t\t\t\tthis.state = 'crashedPermanently';\n\t\t\t\tthis._fire( 'stateChange' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether an error should be handled by the watchdog.\n\t *\n\t * @private\n\t * @param {Error} error An error that was caught by the error handling process.\n\t */\n\t_shouldReactToError( error ) {\n\t\treturn (\n\t\t\terror.is &&\n\t\t\terror.is( 'CKEditorError' ) &&\n\t\t\terror.context !== undefined &&\n\n\t\t\t// In some cases the watched item should not be restarted - e.g. during the item initialization.\n\t\t\t// That's why the `null` was introduced as a correct error context which does cause restarting.\n\t\t\terror.context !== null &&\n\n\t\t\t// Do not react to errors if the watchdog is in states other than `ready`.\n\t\t\tthis.state === 'ready' &&\n\n\t\t\tthis._isErrorComingFromThisItem( error )\n\t\t);\n\t}\n\n\t/**\n\t * Checks if the watchdog should restart the underlying item.\n\t *\n\t * @private\n\t */\n\t_shouldRestart() {\n\t\tif ( this.crashes.length <= this._crashNumberLimit ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst lastErrorTime = this.crashes[ this.crashes.length - 1 ].date;\n\t\tconst firstMeaningfulErrorTime = this.crashes[ this.crashes.length - 1 - this._crashNumberLimit ].date;\n\n\t\tconst averageNonErrorTimePeriod = ( lastErrorTime - firstMeaningfulErrorTime ) / this._crashNumberLimit;\n\n\t\treturn averageNonErrorTimePeriod > this._minimumNonErrorTimePeriod;\n\t}\n\n\t/**\n\t * Fired when a new {@link module:utils/ckeditorerror~CKEditorError `CKEditorError`} error connected to the watchdog instance occurs\n\t * and the watchdog will react to it.\n\t *\n\t * \twatchdog.on( 'error', ( evt, { error, causesRestart } ) => {\n\t * \t\tconsole.log( 'An error occurred.' );\n\t * \t} );\n\t *\n\t * @event error\n\t */\n}\n\n/**\n * The watchdog plugin configuration.\n *\n * @typedef {Object} WatchdogConfig\n *\n * @property {Number} [crashNumberLimit=3] A threshold specifying the number of watched item crashes\n * when the watchdog stops restarting the item in case of errors.\n * After this limit is reached and the time between the last errors is shorter than `minimumNonErrorTimePeriod`,\n * the watchdog changes its state to `crashedPermanently` and it stops restarting the item. This prevents an infinite restart loop.\n *\n * @property {Number} [minimumNonErrorTimePeriod=5000] An average number of milliseconds between the last watched item errors\n * (defaults to 5000). When the period of time between errors is lower than that and the `crashNumberLimit` is also reached,\n * the watchdog changes its state to `crashedPermanently` and it stops restarting the item. This prevents an infinite restart loop.\n *\n * @property {Number} [saveInterval=5000] A minimum number of milliseconds between saving the editor data internally (defaults to 5000).\n * Note that for large documents this might impact the editor performance.\n */\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module watchdog/editorwatchdog\n */\n\n/* globals console */\n\nimport { throttle, cloneDeepWith, isElement } from 'lodash-es';\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties';\nimport Watchdog from './watchdog';\n\n/**\n * A watchdog for CKEditor 5 editors.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n *\n * @extends {module:watchdog/watchdog~Watchdog}\n */\nexport default class EditorWatchdog extends Watchdog {\n\t/**\n\t * @param {*} Editor The editor class.\n\t * @param {module:watchdog/watchdog~WatchdogConfig} [watchdogConfig] The watchdog plugin configuration.\n\t */\n\tconstructor( Editor, watchdogConfig = {} ) {\n\t\tsuper( watchdogConfig );\n\n\t\t/**\n\t\t * The current editor instance.\n\t\t *\n\t\t * @private\n\t\t * @type {module:core/editor/editor~Editor}\n\t\t */\n\t\tthis._editor = null;\n\n\t\t/**\n\t\t * Throttled save method. The `save()` method is called the specified `saveInterval` after `throttledSave()` is called,\n\t\t * unless a new action happens in the meantime.\n\t\t *\n\t\t * @private\n\t\t * @type {Function}\n\t\t */\n\t\tthis._throttledSave = throttle(\n\t\t\tthis._save.bind( this ),\n\t\t\ttypeof watchdogConfig.saveInterval === 'number' ? watchdogConfig.saveInterval : 5000\n\t\t);\n\n\t\t/**\n\t\t * The latest saved editor data represented as a root name -> root data object.\n\t\t *\n\t\t * @private\n\t\t * @member {Object.} #_data\n\t\t */\n\n\t\t/**\n\t\t * The last document version.\n\t\t *\n\t\t * @private\n\t\t * @member {Number} #_lastDocumentVersion\n\t\t */\n\n\t\t/**\n\t\t * The editor source element or data.\n\t\t *\n\t\t * @private\n\t\t * @member {HTMLElement|String|Object.} #_elementOrData\n\t\t */\n\n\t\t/**\n\t\t * The editor configuration.\n\t\t *\n\t\t * @private\n\t\t * @member {Object|undefined} #_config\n\t\t */\n\n\t\t// Set default creator and destructor functions:\n\t\tthis._creator = ( ( elementOrData, config ) => Editor.create( elementOrData, config ) );\n\t\tthis._destructor = editor => editor.destroy();\n\t}\n\n\t/**\n\t * The current editor instance.\n\t *\n\t * @readonly\n\t * @type {module:core/editor/editor~Editor}\n\t */\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget _item() {\n\t\treturn this._editor;\n\t}\n\n\t/**\n\t * Sets the function that is responsible for the editor creation.\n\t * It expects a function that should return a promise.\n\t *\n\t *\t\twatchdog.setCreator( ( element, config ) => ClassicEditor.create( element, config ) );\n\t *\n\t * @method #setCreator\n\t * @param {Function} creator\n\t */\n\n\t/**\n\t * Sets the function that is responsible for the editor destruction.\n\t * Overrides the default destruction function, which destroys only the editor instance.\n\t * It expects a function that should return a promise or `undefined`.\n\t *\n\t *\t\twatchdog.setDestructor( editor => {\n\t *\t\t\t// Do something before the editor is destroyed.\n\t *\n\t *\t\t\treturn editor\n\t *\t\t\t\t.destroy()\n\t *\t\t\t\t.then( () => {\n\t *\t\t\t\t\t// Do something after the editor is destroyed.\n\t *\t\t\t\t} );\n\t *\t\t} );\n\t *\n\t * @method #setDestructor\n\t * @param {Function} destructor\n\t */\n\n\t/**\n\t * Restarts the editor instance. This method is called whenever an editor error occurs. It fires the `restart` event and changes\n\t * the state to `initializing`.\n\t *\n\t * @protected\n\t * @fires restart\n\t * @returns {Promise}\n\t */\n\t_restart() {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tthis.state = 'initializing';\n\t\t\t\tthis._fire( 'stateChange' );\n\n\t\t\t\treturn this._destroy();\n\t\t\t} )\n\t\t\t.catch( err => {\n\t\t\t\tconsole.error( 'An error happened during the editor destroying.', err );\n\t\t\t} )\n\t\t\t.then( () => {\n\t\t\t\tif ( typeof this._elementOrData === 'string' ) {\n\t\t\t\t\treturn this.create( this._data, this._config, this._config.context );\n\t\t\t\t} else {\n\t\t\t\t\tconst updatedConfig = Object.assign( {}, this._config, {\n\t\t\t\t\t\tinitialData: this._data\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn this.create( this._elementOrData, updatedConfig, updatedConfig.context );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.then( () => {\n\t\t\t\tthis._fire( 'restart' );\n\t\t\t} );\n\t}\n\n\t/**\n\t * Creates the editor instance and keeps it running, using the defined creator and destructor.\n\t *\n\t * @param {HTMLElement|String|Object.} [elementOrData] The editor source element or the editor data.\n\t * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.\n\t * @param {Object} [context] A context for the editor.\n\t *\n\t * @returns {Promise}\n\t */\n\tcreate( elementOrData = this._elementOrData, config = this._config, context ) {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tsuper._startErrorHandling();\n\n\t\t\t\tthis._elementOrData = elementOrData;\n\n\t\t\t\t// Clone configuration because it might be shared within multiple watchdog instances. Otherwise,\n\t\t\t\t// when an error occurs in one of these editors, the watchdog will restart all of them.\n\t\t\t\tthis._config = this._cloneEditorConfiguration( config ) || {};\n\n\t\t\t\tthis._config.context = context;\n\n\t\t\t\treturn this._creator( elementOrData, this._config );\n\t\t\t} )\n\t\t\t.then( editor => {\n\t\t\t\tthis._editor = editor;\n\n\t\t\t\teditor.model.document.on( 'change:data', this._throttledSave );\n\n\t\t\t\tthis._lastDocumentVersion = editor.model.document.version;\n\t\t\t\tthis._data = this._getData();\n\n\t\t\t\tthis.state = 'ready';\n\t\t\t\tthis._fire( 'stateChange' );\n\t\t\t} );\n\t}\n\n\t/**\n\t * Destroys the watchdog and the current editor instance. It fires the callback\n\t * registered in {@link #setDestructor `setDestructor()`} and uses it to destroy the editor instance.\n\t * It also sets the state to `destroyed`.\n\t *\n\t * @returns {Promise}\n\t */\n\tdestroy() {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tthis.state = 'destroyed';\n\t\t\t\tthis._fire( 'stateChange' );\n\n\t\t\t\tsuper.destroy();\n\n\t\t\t\treturn this._destroy();\n\t\t\t} );\n\t}\n\n\t/**\n\t * @private\n\t * @returns {Promise}\n\t */\n\t_destroy() {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tthis._stopErrorHandling();\n\n\t\t\t\t// Save data if there is a remaining editor data change.\n\t\t\t\tthis._throttledSave.flush();\n\n\t\t\t\tconst editor = this._editor;\n\n\t\t\t\tthis._editor = null;\n\n\t\t\t\t// Remove the `change:data` listener before destroying the editor.\n\t\t\t\t// Incorrectly written plugins may trigger firing `change:data` events during the editor destruction phase\n\t\t\t\t// causing the watchdog to call `editor.getData()` when some parts of editor are already destroyed.\n\t\t\t\teditor.model.document.off( 'change:data', this._throttledSave );\n\n\t\t\t\treturn this._destructor( editor );\n\t\t\t} );\n\t}\n\n\t/**\n\t * Saves the editor data, so it can be restored after the crash even if the data cannot be fetched at\n\t * the moment of the crash.\n\t *\n\t * @private\n\t */\n\t_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @protected\n\t * @param {Set} props\n\t */\n\t_setExcludedProperties( props ) {\n\t\tthis._excludedProps = props;\n\t}\n\n\t/**\n\t * Returns the editor data.\n\t *\n\t * @private\n\t * @returns {Object}\n\t */\n\t_getData() {\n\t\tconst data = {};\n\n\t\tfor ( const rootName of this._editor.model.document.getRootNames() ) {\n\t\t\tdata[ rootName ] = this._editor.data.get( { rootName } );\n\t\t}\n\n\t\treturn data;\n\t}\n\n\t/**\n\t * Traverses the error context and the current editor to find out whether these structures are connected\n\t * to each other via properties.\n\t *\n\t * @protected\n\t * @param {module:utils/ckeditorerror~CKEditorError} error\n\t */\n\t_isErrorComingFromThisItem( error ) {\n\t\treturn areConnectedThroughProperties( this._editor, error.context, this._excludedProps );\n\t}\n\n\t/**\n\t * Clones the editor configuration.\n\t *\n\t * @private\n\t * @param {Object} config\n\t */\n\t_cloneEditorConfiguration( config ) {\n\t\treturn cloneDeepWith( config, ( value, key ) => {\n\t\t\t// Leave DOM references.\n\t\t\tif ( isElement( value ) ) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif ( key === 'context' ) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Fired after the watchdog restarts the error in case of a crash.\n\t *\n\t * @event restart\n\t */\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneDeepWith;\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/uid\n */\n/**\n * A hash table of hex numbers to avoid using toString() in uid() which is costly.\n * [ '00', '01', '02', ..., 'fe', 'ff' ]\n */\nconst HEX_NUMBERS = new Array(256).fill('')\n .map((_, index) => ('0' + (index).toString(16)).slice(-2));\n/**\n * Returns a unique id. The id starts with an \"e\" character and a randomly generated string of\n * 32 alphanumeric characters.\n *\n * **Note**: The characters the unique id is built from correspond to the hex number notation\n * (from \"0\" to \"9\", from \"a\" to \"f\"). In other words, each id corresponds to an \"e\" followed\n * by 16 8-bit numbers next to each other.\n *\n * @returns An unique id string.\n */\nexport default function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n const r1 = Math.random() * 0x100000000 >>> 0;\n const r2 = Math.random() * 0x100000000 >>> 0;\n const r3 = Math.random() * 0x100000000 >>> 0;\n const r4 = Math.random() * 0x100000000 >>> 0;\n // Make sure that id does not start with number.\n return 'e' +\n HEX_NUMBERS[r1 >> 0 & 0xFF] +\n HEX_NUMBERS[r1 >> 8 & 0xFF] +\n HEX_NUMBERS[r1 >> 16 & 0xFF] +\n HEX_NUMBERS[r1 >> 24 & 0xFF] +\n HEX_NUMBERS[r2 >> 0 & 0xFF] +\n HEX_NUMBERS[r2 >> 8 & 0xFF] +\n HEX_NUMBERS[r2 >> 16 & 0xFF] +\n HEX_NUMBERS[r2 >> 24 & 0xFF] +\n HEX_NUMBERS[r3 >> 0 & 0xFF] +\n HEX_NUMBERS[r3 >> 8 & 0xFF] +\n HEX_NUMBERS[r3 >> 16 & 0xFF] +\n HEX_NUMBERS[r3 >> 24 & 0xFF] +\n HEX_NUMBERS[r4 >> 0 & 0xFF] +\n HEX_NUMBERS[r4 >> 8 & 0xFF] +\n HEX_NUMBERS[r4 >> 16 & 0xFF] +\n HEX_NUMBERS[r4 >> 24 & 0xFF];\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module watchdog/contextwatchdog\n */\n\n/* globals console */\n\nimport Watchdog from './watchdog';\nimport EditorWatchdog from './editorwatchdog';\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties';\nimport getSubNodes from './utils/getsubnodes';\n\nconst mainQueueId = Symbol( 'MainQueueId' );\n\n/**\n * A watchdog for the {@link module:core/context~Context} class.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n *\n * @extends {module:watchdog/watchdog~Watchdog}\n */\nexport default class ContextWatchdog extends Watchdog {\n\t/**\n\t * The context watchdog class constructor.\n\t *\n\t * \tconst watchdog = new ContextWatchdog( Context );\n\t *\n\t * \tawait watchdog.create( contextConfiguration );\n\t *\n\t * \tawait watchdog.add( item );\n\t *\n\t * See the {@glink features/watchdog Watchdog feature guide} to learn more how to use this feature.\n\t *\n\t * @param {Function} Context The {@link module:core/context~Context} class.\n\t * @param {module:watchdog/watchdog~WatchdogConfig} [watchdogConfig] The watchdog configuration.\n\t */\n\tconstructor( Context, watchdogConfig = {} ) {\n\t\tsuper( watchdogConfig );\n\n\t\t/**\n\t\t * A map of internal watchdogs for added items.\n\t\t *\n\t\t * @protected\n\t\t * @type {Map.}\n\t\t */\n\t\tthis._watchdogs = new Map();\n\n\t\t/**\n\t\t * The watchdog configuration.\n\t\t *\n\t\t * @private\n\t\t * @type {module:watchdog/watchdog~WatchdogConfig}\n\t\t */\n\t\tthis._watchdogConfig = watchdogConfig;\n\n\t\t/**\n\t\t * The current context instance.\n\t\t *\n\t\t * @private\n\t\t * @type {module:core/context~Context|null}\n\t\t */\n\t\tthis._context = null;\n\n\t\t/**\n\t\t * Context properties (nodes/references) that are gathered during the initial context creation\n\t\t * and are used to distinguish the origin of an error.\n\t\t *\n\t\t * @private\n\t\t * @type {Set.<*>}\n\t\t */\n\t\tthis._contextProps = new Set();\n\n\t\t/**\n\t\t * An action queue, which is used to handle async functions queuing.\n\t\t *\n\t\t * @private\n\t\t * @type {ActionQueues}\n\t\t */\n\t\tthis._actionQueues = new ActionQueues();\n\n\t\t/**\n\t\t * The configuration for the {@link module:core/context~Context}.\n\t\t *\n\t\t * @private\n\t\t * @member {Object} #_contextConfig\n\t\t */\n\n\t\t/**\n\t\t * The context configuration.\n\t\t *\n\t\t * @private\n\t\t * @member {Object|undefined} #_config\n\t\t */\n\n\t\t// Default creator and destructor.\n\t\tthis._creator = contextConfig => Context.create( contextConfig );\n\t\tthis._destructor = context => context.destroy();\n\n\t\tthis._actionQueues.onEmpty( () => {\n\t\t\tif ( this.state === 'initializing' ) {\n\t\t\t\tthis.state = 'ready';\n\t\t\t\tthis._fire( 'stateChange' );\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Sets the function that is responsible for the context creation.\n\t\t * It expects a function that should return a promise (or `undefined`).\n\t\t *\n\t\t *\t\twatchdog.setCreator( config => Context.create( config ) );\n\t\t *\n\t\t * @method #setCreator\n\t\t * @param {Function} creator\n\t\t */\n\n\t\t/**\n\t\t * Sets the function that is responsible for the context destruction.\n\t\t * Overrides the default destruction function, which destroys only the context instance.\n\t\t * It expects a function that should return a promise (or `undefined`).\n\t\t *\n\t\t *\t\twatchdog.setDestructor( context => {\n\t\t *\t\t\t// Do something before the context is destroyed.\n\t\t *\n\t\t *\t\t\treturn context\n\t\t *\t\t\t\t.destroy()\n\t\t *\t\t\t\t.then( () => {\n\t\t *\t\t\t\t\t// Do something after the context is destroyed.\n\t\t *\t\t\t\t} );\n\t\t *\t\t} );\n\t\t *\n\t\t * @method #setDestructor\n\t\t * @param {Function} destructor\n\t\t */\n\t}\n\n\t/**\n\t * The context instance. Keep in mind that this property might be changed when the context watchdog restarts,\n\t * so do not keep this instance internally. Always operate on the `ContextWatchdog#context` property.\n\t *\n\t * @type {module:core/context~Context|null}\n\t */\n\tget context() {\n\t\treturn this._context;\n\t}\n\n\t/**\n\t * Initializes the context watchdog. Once it is created, the watchdog takes care about\n\t * recreating the context and the provided items, and starts the error handling mechanism.\n\t *\n\t * \tawait watchdog.create( {\n\t * \t\tplugins: []\n\t * \t} );\n\t *\n\t * @param {Object} [contextConfig] The context configuration. See {@link module:core/context~Context}.\n\t * @returns {Promise}\n\t */\n\tcreate( contextConfig = {} ) {\n\t\treturn this._actionQueues.enqueue( mainQueueId, () => {\n\t\t\tthis._contextConfig = contextConfig;\n\n\t\t\treturn this._create();\n\t\t} );\n\t}\n\n\t/**\n\t * Returns an item instance with the given `itemId`.\n\t *\n\t * \tconst editor1 = watchdog.getItem( 'editor1' );\n\t *\n\t * @param {String} itemId The item ID.\n\t * @returns {*} The item instance or `undefined` if an item with a given ID has not been found.\n\t */\n\tgetItem( itemId ) {\n\t\tconst watchdog = this._getWatchdog( itemId );\n\n\t\treturn watchdog._item;\n\t}\n\n\t/**\n\t * Gets the state of the given item. See {@link #state} for a list of available states.\n\t *\n\t * \tconst editor1State = watchdog.getItemState( 'editor1' );\n\t *\n\t * @param {String} itemId Item ID.\n\t * @returns {'initializing'|'ready'|'crashed'|'crashedPermanently'|'destroyed'} The state of the item.\n\t */\n\tgetItemState( itemId ) {\n\t\tconst watchdog = this._getWatchdog( itemId );\n\n\t\treturn watchdog.state;\n\t}\n\n\t/**\n\t * Adds items to the watchdog. Once created, instances of these items will be available using the {@link #getItem} method.\n\t *\n\t * Items can be passed together as an array of objects:\n\t *\n\t * \tawait watchdog.add( [ {\n\t *\t\tid: 'editor1',\n\t *\t\ttype: 'editor',\n\t *\t\tsourceElementOrData: document.querySelector( '#editor' ),\n\t *\t\tconfig: {\n\t *\t\t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n\t *\t\t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n\t *\t\t},\n\t *\t\tcreator: ( element, config ) => ClassicEditor.create( element, config )\n\t *\t} ] );\n\t *\n\t * Or one by one as objects:\n\t *\n\t * \tawait watchdog.add( {\n\t *\t\tid: 'editor1',\n\t *\t\ttype: 'editor',\n\t *\t\tsourceElementOrData: document.querySelector( '#editor' ),\n\t *\t\tconfig: {\n\t *\t\t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n\t *\t\t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n\t *\t\t},\n\t *\t\tcreator: ( element, config ) => ClassicEditor.create( element, config )\n\t *\t] );\n\t *\n\t * Then an instance can be retrieved using the {@link #getItem} method:\n\t *\n\t * \tconst editor1 = watchdog.getItem( 'editor1' );\n\t *\n\t * Note that this method can be called multiple times, but for performance reasons it is better\n\t * to pass all items together.\n\t *\n\t * @param {module:watchdog/contextwatchdog~WatchdogItemConfiguration|Array.}\n\t * itemConfigurationOrItemConfigurations An item configuration object or an array of item configurations.\n\t * @returns {Promise}\n\t */\n\tadd( itemConfigurationOrItemConfigurations ) {\n\t\tconst itemConfigurations = toArray( itemConfigurationOrItemConfigurations );\n\n\t\treturn Promise.all( itemConfigurations.map( item => {\n\t\t\treturn this._actionQueues.enqueue( item.id, () => {\n\t\t\t\tif ( this.state === 'destroyed' ) {\n\t\t\t\t\tthrow new Error( 'Cannot add items to destroyed watchdog.' );\n\t\t\t\t}\n\n\t\t\t\tif ( !this._context ) {\n\t\t\t\t\tthrow new Error( 'Context was not created yet. You should call the `ContextWatchdog#create()` method first.' );\n\t\t\t\t}\n\n\t\t\t\tlet watchdog;\n\n\t\t\t\tif ( this._watchdogs.has( item.id ) ) {\n\t\t\t\t\tthrow new Error( `Item with the given id is already added: '${ item.id }'.` );\n\t\t\t\t}\n\n\t\t\t\tif ( item.type === 'editor' ) {\n\t\t\t\t\twatchdog = new EditorWatchdog( this._watchdogConfig );\n\t\t\t\t\twatchdog.setCreator( item.creator );\n\t\t\t\t\twatchdog._setExcludedProperties( this._contextProps );\n\n\t\t\t\t\tif ( item.destructor ) {\n\t\t\t\t\t\twatchdog.setDestructor( item.destructor );\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._watchdogs.set( item.id, watchdog );\n\n\t\t\t\t\t// Enqueue the internal watchdog errors within the main queue.\n\t\t\t\t\t// And propagate the internal `error` events as `itemError` event.\n\t\t\t\t\twatchdog.on( 'error', ( evt, { error, causesRestart } ) => {\n\t\t\t\t\t\tthis._fire( 'itemError', { itemId: item.id, error } );\n\n\t\t\t\t\t\t// Do not enqueue the item restart action if the item will not restart.\n\t\t\t\t\t\tif ( !causesRestart ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._actionQueues.enqueue( item.id, () => new Promise( res => {\n\t\t\t\t\t\t\twatchdog.on( 'restart', rethrowRestartEventOnce.bind( this ) );\n\n\t\t\t\t\t\t\tfunction rethrowRestartEventOnce() {\n\t\t\t\t\t\t\t\twatchdog.off( 'restart', rethrowRestartEventOnce );\n\n\t\t\t\t\t\t\t\tthis._fire( 'itemRestart', { itemId: item.id } );\n\n\t\t\t\t\t\t\t\tres();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} ) );\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn watchdog.create( item.sourceElementOrData, item.config, this._context );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error( `Not supported item type: '${ item.type }'.` );\n\t\t\t\t}\n\t\t\t} );\n\t\t} ) );\n\t}\n\n\t/**\n\t * Removes and destroys item(s) with given ID(s).\n\t *\n\t * \tawait watchdog.remove( 'editor1' );\n\t *\n\t * Or\n\t *\n\t * \tawait watchdog.remove( [ 'editor1', 'editor2' ] );\n\t *\n\t * @param {Array.|String} itemIdOrItemIds Item ID or an array of item IDs.\n\t * @returns {Promise}\n\t */\n\tremove( itemIdOrItemIds ) {\n\t\tconst itemIds = toArray( itemIdOrItemIds );\n\n\t\treturn Promise.all( itemIds.map( itemId => {\n\t\t\treturn this._actionQueues.enqueue( itemId, () => {\n\t\t\t\tconst watchdog = this._getWatchdog( itemId );\n\n\t\t\t\tthis._watchdogs.delete( itemId );\n\n\t\t\t\treturn watchdog.destroy();\n\t\t\t} );\n\t\t} ) );\n\t}\n\n\t/**\n\t * Destroys the context watchdog and all added items.\n\t * Once the context watchdog is destroyed, new items cannot be added.\n\t *\n\t * \tawait watchdog.destroy();\n\t *\n\t * @returns {Promise}\n\t */\n\tdestroy() {\n\t\treturn this._actionQueues.enqueue( mainQueueId, () => {\n\t\t\tthis.state = 'destroyed';\n\t\t\tthis._fire( 'stateChange' );\n\n\t\t\tsuper.destroy();\n\n\t\t\treturn this._destroy();\n\t\t} );\n\t}\n\n\t/**\n\t * Restarts the context watchdog.\n\t *\n\t * @protected\n\t * @returns {Promise}\n\t */\n\t_restart() {\n\t\treturn this._actionQueues.enqueue( mainQueueId, () => {\n\t\t\tthis.state = 'initializing';\n\t\t\tthis._fire( 'stateChange' );\n\n\t\t\treturn this._destroy()\n\t\t\t\t.catch( err => {\n\t\t\t\t\tconsole.error( 'An error happened during destroying the context or items.', err );\n\t\t\t\t} )\n\t\t\t\t.then( () => this._create() )\n\t\t\t\t.then( () => this._fire( 'restart' ) );\n\t\t} );\n\t}\n\n\t/**\n\t * @private\n\t * @returns {Promise}\n\t */\n\t_create() {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tthis._startErrorHandling();\n\n\t\t\t\treturn this._creator( this._contextConfig );\n\t\t\t} )\n\t\t\t.then( context => {\n\t\t\t\tthis._context = context;\n\t\t\t\tthis._contextProps = getSubNodes( this._context );\n\n\t\t\t\treturn Promise.all(\n\t\t\t\t\tArray.from( this._watchdogs.values() )\n\t\t\t\t\t\t.map( watchdog => {\n\t\t\t\t\t\t\twatchdog._setExcludedProperties( this._contextProps );\n\n\t\t\t\t\t\t\treturn watchdog.create( undefined, undefined, this._context );\n\t\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\t/**\n\t * Destroys the context instance and all added items.\n\t *\n\t * @private\n\t * @returns {Promise}\n\t */\n\t_destroy() {\n\t\treturn Promise.resolve()\n\t\t\t.then( () => {\n\t\t\t\tthis._stopErrorHandling();\n\n\t\t\t\tconst context = this._context;\n\n\t\t\t\tthis._context = null;\n\t\t\t\tthis._contextProps = new Set();\n\n\t\t\t\treturn Promise.all(\n\t\t\t\t\tArray.from( this._watchdogs.values() )\n\t\t\t\t\t\t.map( watchdog => watchdog.destroy() )\n\t\t\t\t)\n\t\t\t\t\t// Context destructor destroys each editor.\n\t\t\t\t\t.then( () => this._destructor( context ) );\n\t\t\t} );\n\t}\n\n\t/**\n\t * Returns the watchdog for a given item ID.\n\t *\n\t * @protected\n\t * @param {String} itemId Item ID.\n\t * @returns {module:watchdog/watchdog~Watchdog} Watchdog\n\t */\n\t_getWatchdog( itemId ) {\n\t\tconst watchdog = this._watchdogs.get( itemId );\n\n\t\tif ( !watchdog ) {\n\t\t\tthrow new Error( `Item with the given id was not registered: ${ itemId }.` );\n\t\t}\n\n\t\treturn watchdog;\n\t}\n\n\t/**\n\t * Checks whether an error comes from the context instance and not from the item instances.\n\t *\n\t * @protected\n\t * @param {Error} error\n\t * @returns {Boolean}\n\t */\n\t_isErrorComingFromThisItem( error ) {\n\t\tfor ( const watchdog of this._watchdogs.values() ) {\n\t\t\tif ( watchdog._isErrorComingFromThisItem( error ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn areConnectedThroughProperties( this._context, error.context );\n\t}\n\n\t/**\n\t * Fired after the watchdog restarts the context and the added items because of a crash.\n\t *\n\t * \twatchdog.on( 'restart', () => {\n\t * \t\tconsole.log( 'The context has been restarted.' );\n\t * \t} );\n\t *\n\t * @event restart\n\t */\n\n\t/**\n\t * Fired when a new error occurred in one of the added items.\n\t *\n\t * \twatchdog.on( 'itemError', ( evt, { error, itemId, causesRestart } ) => {\n\t *\t\tconsole.log( `An error occurred in an item with the '${ itemId }' ID.` );\n\t * \t} );\n\t *\n\t * @event itemError\n\t */\n\n\t/**\n\t * Fired after an item has been restarted.\n\t *\n\t * \twatchdog.on( 'itemRestart', ( evt, { itemId } ) => {\n\t *\t\tconsole.log( 'An item with with the '${ itemId }' ID has been restarted.' );\n\t * \t} );\n\t *\n\t * @event itemRestart\n\t */\n}\n\n// Manager of action queues that allows queuing async functions.\nclass ActionQueues {\n\tconstructor() {\n\t\t// @type {Array.}\n\t\tthis._onEmptyCallbacks = [];\n\n\t\t// @type {Map.}\n\t\tthis._queues = new Map();\n\n\t\tthis._actions = new WeakMap();\n\n\t\tthis._lastActionId = 0;\n\n\t\tthis._activeActions = 0;\n\t}\n\n\t// Used to register callbacks that will be run when the queue becomes empty.\n\t//\n\t// @param {Function} onEmptyCallback A callback that will be run whenever the queue becomes empty.\n\tonEmpty( onEmptyCallback ) {\n\t\tthis._onEmptyCallbacks.push( onEmptyCallback );\n\t}\n\n\t// It adds asynchronous actions (functions) to the proper queue and runs them one by one.\n\t//\n\t// @param {Symbol|String|Number} queueId The action queue ID.\n\t// @param {Function} action A function that should be enqueued.\n\t// @returns {Promise}\n\tenqueue( queueId, action ) {\n\t\tconst isMainAction = queueId === mainQueueId;\n\n\t\tthis._activeActions++;\n\n\t\tif ( !this._queues.get( queueId ) ) {\n\t\t\tthis._queues.set( queueId, Promise.resolve() );\n\t\t}\n\n\t\t// List all sources of actions that the current action needs to await for.\n\t\t// For the main action wait for all other actions.\n\t\t// For the item action wait only for the item queue and the main queue.\n\t\tconst awaitedActions = isMainAction ?\n\t\t\tPromise.all( this._queues.values() ) :\n\t\t\tPromise.all( [ this._queues.get( mainQueueId ), this._queues.get( queueId ) ] );\n\n\t\tconst queueWithAction = awaitedActions.then( action );\n\n\t\t// Catch all errors in the main queue to stack promises even if an error occurred in the past.\n\t\tconst nonErrorQueue = queueWithAction.catch( () => {} );\n\n\t\tthis._queues.set( queueId, nonErrorQueue );\n\n\t\treturn queueWithAction.finally( () => {\n\t\t\tthis._activeActions--;\n\n\t\t\tif ( this._queues.get( queueId ) === nonErrorQueue && this._activeActions === 0 ) {\n\t\t\t\tthis._onEmptyCallbacks.forEach( cb => cb() );\n\t\t\t}\n\t\t} );\n\t}\n}\n\n// Transforms any value to an array. If the provided value is already an array, it is returned unchanged.\n//\n// @param {*} elementOrArray The value to transform to an array.\n// @returns {Array} An array created from data.\nfunction toArray( elementOrArray ) {\n\treturn Array.isArray( elementOrArray ) ? elementOrArray : [ elementOrArray ];\n}\n\n/**\n * The watchdog item configuration interface.\n *\n * @typedef {Object} module:watchdog/contextwatchdog~WatchdogItemConfiguration\n *\n * @property {String} id A unique item identificator.\n *\n * @property {'editor'} type The type of the item to create. At the moment, only `'editor'` is supported.\n *\n * @property {Function} creator A function that initializes the item (the editor). The function takes editor initialization arguments\n * and should return a promise. For example: `( el, config ) => ClassicEditor.create( el, config )`.\n *\n * @property {Function} [destructor] A function that destroys the item instance (the editor). The function\n * takes an item and should return a promise. For example: `editor => editor.destroy()`\n *\n * @property {String|HTMLElement} sourceElementOrData The source element or data that will be passed\n * as the first argument to the `Editor.create()` method.\n *\n * @property {Object} config An editor configuration.\n */\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ContextWatchdog from '@ckeditor/ckeditor5-watchdog/src/contextwatchdog';\n\nexport const ContextWatchdogContext = React.createContext( 'contextWatchdog' );\n\nexport default class CKEditorContext extends React.Component {\n\tconstructor( props, context ) {\n\t\tsuper( props, context );\n\n\t\tthis.contextWatchdog = null;\n\n\t\tif ( this.props.isLayoutReady ) {\n\t\t\tthis._initializeContextWatchdog( this.props.config );\n\t\t}\n\t}\n\n\tasync shouldComponentUpdate( nextProps ) {\n\t\t// If the configuration changes then the ContextWatchdog needs to be destroyed and recreated\n\t\t// On top of the new configuration.\n\t\tif ( nextProps.id !== this.props.id ) {\n\t\t\t/* istanbul ignore else */\n\t\t\tif ( this.contextWatchdog ) {\n\t\t\t\tawait this.contextWatchdog.destroy();\n\t\t\t}\n\n\t\t\tawait this._initializeContextWatchdog( nextProps.config );\n\t\t}\n\n\t\tif ( nextProps.isLayoutReady && !this.contextWatchdog ) {\n\t\t\tawait this._initializeContextWatchdog( nextProps.config );\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// Rerender the component only when children has changed.\n\t\treturn this.props.children !== nextProps.children;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.props.children }\n\t\t\t\n\t\t);\n\t}\n\n\tasync componentWillUnmount() {\n\t\tawait this._destroyContext();\n\t}\n\n\tasync _initializeContextWatchdog( config ) {\n\t\tthis.contextWatchdog = new ContextWatchdog( this.props.context, this.props.watchdogConfig );\n\n\t\tthis.contextWatchdog.on( 'error', ( _, errorEvent ) => {\n\t\t\tthis.props.onError( errorEvent.error, {\n\t\t\t\tphase: 'runtime',\n\t\t\t\twillContextRestart: errorEvent.causesRestart\n\t\t\t} );\n\t\t} );\n\n\t\tthis.contextWatchdog.on( 'stateChange', () => {\n\t\t\tif ( this.contextWatchdog.state === 'ready' && this.props.onReady ) {\n\t\t\t\tthis.props.onReady( this.contextWatchdog.context );\n\t\t\t}\n\t\t} );\n\n\t\tawait this.contextWatchdog.create( config )\n\t\t\t.catch( error => {\n\t\t\t\tthis.props.onError( error, {\n\t\t\t\t\tphase: 'initialization',\n\t\t\t\t\twillContextRestart: false\n\t\t\t\t} );\n\t\t\t} );\n\t}\n\n\tasync _destroyContext() {\n\t\tif ( this.contextWatchdog ) {\n\t\t\tawait this.contextWatchdog.destroy();\n\t\t\tthis.contextWatchdog = null;\n\t\t}\n\t}\n}\n\nCKEditorContext.defaultProps = {\n\tisLayoutReady: true,\n\tonError: ( error, details ) => console.error( error, details )\n};\n\n// Properties definition.\nCKEditorContext.propTypes = {\n\tid: PropTypes.string,\n\tisLayoutReady: PropTypes.bool,\n\tcontext: PropTypes.func,\n\twatchdogConfig: PropTypes.object,\n\tconfig: PropTypes.object,\n\tonReady: PropTypes.func,\n\tonError: PropTypes.func\n};\n\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* globals window */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport EditorWatchdog from '@ckeditor/ckeditor5-watchdog/src/editorwatchdog';\nimport uid from '@ckeditor/ckeditor5-utils/src/uid';\nimport { ContextWatchdogContext } from './ckeditorcontext.jsx';\nimport ContextWatchdog from '@ckeditor/ckeditor5-watchdog/src/contextwatchdog';\n\nconst REACT_INTEGRATION_READ_ONLY_LOCK_ID = 'Lock from React integration (@ckeditor/ckeditor5-react)';\n\nexport default class CKEditor extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\t/**\n\t\t * Contains a promise that resolves when the editor destruction is finished.\n\t\t *\n\t\t * @type {Promise|null}\n\t\t */\n\t\tthis.editorDestructionInProgress = null;\n\n\t\t// After mounting the editor, the variable will contain a reference to the created editor.\n\t\t// @see: https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html\n\t\tthis.domContainer = React.createRef();\n\n\t\t/**\n\t\t * An instance of EditorWatchdog or an instance of EditorWatchdog-like adapter for ContextWatchdog.\n\t\t *\n\t\t * @type {module:watchdog/watchdog~Watchdog|EditorWatchdogAdapter}\n\t\t */\n\t\tthis.watchdog = null;\n\n\t\tconst { CKEDITOR_VERSION } = window;\n\n\t\t// Starting from v34.0.0, CKEditor 5 introduces a lock mechanism enabling/disabling the read-only mode.\n\t\t// As it is a breaking change between major releases of the integration, the component requires using\n\t\t// CKEditor 5 in version 34 or higher.\n\t\tif ( CKEDITOR_VERSION ) {\n\t\t\tconst [ major ] = CKEDITOR_VERSION.split( '.' ).map( Number );\n\n\t\t\tif ( major < 34 ) {\n\t\t\t\tconsole.warn( 'The component requires using CKEditor 5 in version 34 or higher.' );\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn( 'Cannot find the \"CKEDITOR_VERSION\" in the \"window\" scope.' );\n\t\t}\n\t}\n\n\t/**\n\t * An editor instance.\n\t *\n\t * @type {module:core/editor/editor~Editor|null}\n\t */\n\tget editor() {\n\t\tif ( !this.watchdog ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.watchdog.editor;\n\t}\n\n\t/**\n\t * The CKEditor component should not be updated by React itself.\n\t * However, if the component identifier changes, the whole structure should be created once again.\n\t *\n\t * @param {Object} nextProps\n\t * @return {Boolean}\n\t */\n\tshouldComponentUpdate( nextProps ) {\n\t\tif ( !this.editor ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only when the component identifier changes the whole structure should be re-created once again.\n\t\tif ( nextProps.id !== this.props.id ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( this._shouldUpdateEditor( nextProps ) ) {\n\t\t\tthis.editor.setData( nextProps.data );\n\t\t}\n\n\t\tif ( 'disabled' in nextProps ) {\n\t\t\tif ( nextProps.disabled ) {\n\t\t\t\tthis.editor.enableReadOnlyMode( REACT_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t} else {\n\t\t\t\tthis.editor.disableReadOnlyMode( REACT_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Initialize the editor when the component is mounted.\n\t *\n\t * @returns {Promise}\n \t */\n\tasync componentDidMount() {\n\t\tawait this._initializeEditor();\n\t}\n\n\t/**\n\t * Re-render the entire component once again. The old editor will be destroyed and the new one will be created.\n\t *\n\t * @returns {Promise}\n\t */\n\tasync componentDidUpdate() {\n\t\tawait this._destroyEditor();\n\t\tawait this._initializeEditor();\n\t}\n\n\t/**\n\t * Destroy the editor before unmounting the component.\n\t *\n\t * @returns {Promise}\n \t */\n\tasync componentWillUnmount() {\n\t\tawait this._destroyEditor();\n\t}\n\n\t/**\n\t * Render a
    element which will be replaced by CKEditor.\n\t *\n\t * @return {JSX.Element}\n\t */\n\trender() {\n\t\treturn (\n\t\t\t
    \n\t\t);\n\t}\n\n\t/**\n\t * Initializes the editor by creating a proper watchdog and initializing it with the editor's configuration.\n\t *\n\t * @private\n\t * @returns {Promise}\n\t */\n\tasync _initializeEditor() {\n\t\tawait this.editorDestructionInProgress;\n\n\t\t/* istanbul ignore next */\n\t\tif ( this.watchdog ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.context instanceof ContextWatchdog ) {\n\t\t\tthis.watchdog = new EditorWatchdogAdapter( this.context );\n\t\t} else {\n\t\t\tthis.watchdog = new CKEditor._EditorWatchdog( this.props.editor, this.props.watchdogConfig );\n\t\t}\n\n\t\tthis.watchdog.setCreator( ( el, config ) => this._createEditor( el, config ) );\n\n\t\tthis.watchdog.on( 'error', ( _, { error, causesRestart } ) => {\n\t\t\tthis.props.onError( error, { phase: 'runtime', willEditorRestart: causesRestart } );\n\t\t} );\n\n\t\tawait this.watchdog.create( this.domContainer.current, this._getConfig() )\n\t\t\t.catch( error => this.props.onError( error, { phase: 'initialization', willEditorRestart: false } ) );\n\t}\n\n\t/**\n\t * Creates an editor from the element and configuration.\n\t *\n\t * @private\n\t * @param {HTMLElement} element The source element.\n\t * @param {Object} config CKEditor 5 editor configuration.\n\t * @returns {Promise}\n\t */\n\t_createEditor( element, config ) {\n\t\treturn this.props.editor.create( element, config )\n\t\t\t.then( editor => {\n\t\t\t\tif ( 'disabled' in this.props ) {\n\t\t\t\t\t// Switch to the read-only mode if the `[disabled]` attribute is specified.\n\t\t\t\t\t/* istanbul ignore else */\n\t\t\t\t\tif ( this.props.disabled ) {\n\t\t\t\t\t\teditor.enableReadOnlyMode( REACT_INTEGRATION_READ_ONLY_LOCK_ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst modelDocument = editor.model.document;\n\t\t\t\tconst viewDocument = editor.editing.view.document;\n\n\t\t\t\tmodelDocument.on( 'change:data', event => {\n\t\t\t\t\t/* istanbul ignore else */\n\t\t\t\t\tif ( this.props.onChange ) {\n\t\t\t\t\t\tthis.props.onChange( event, editor );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tviewDocument.on( 'focus', event => {\n\t\t\t\t\t/* istanbul ignore else */\n\t\t\t\t\tif ( this.props.onFocus ) {\n\t\t\t\t\t\tthis.props.onFocus( event, editor );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tviewDocument.on( 'blur', event => {\n\t\t\t\t\t/* istanbul ignore else */\n\t\t\t\t\tif ( this.props.onBlur ) {\n\t\t\t\t\t\tthis.props.onBlur( event, editor );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t// The `onReady` callback should be fired once the `editor` property\n\t\t\t\t// can be reached from the `` component.\n\t\t\t\t// Ideally this part should be moved to the watchdog item creator listeners.\n\t\t\t\tsetTimeout( () => {\n\t\t\t\t\tif ( this.props.onReady ) {\n\t\t\t\t\t\tthis.props.onReady( editor );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn editor;\n\t\t\t} );\n\t}\n\n\t/**\n\t * Destroys the editor by destroying the watchdog.\n\t *\n\t * @private\n\t * @returns {Promise}\n\t */\n\tasync _destroyEditor() {\n\t\tthis.editorDestructionInProgress = new Promise( resolve => {\n\t\t\t// It may happen during the tests that the watchdog instance is not assigned before destroying itself. See: #197.\n\t\t\t//\n\t\t\t// Additionally, we need to find a way to detect if the whole context has been destroyed. As `componentWillUnmount()`\n\t\t\t// could be fired by and at the same time, this `setTimeout()` makes sure\n\t\t\t// that component will be destroyed first, so during the code execution\n\t\t\t// the `ContextWatchdog#state` would have a correct value. See `EditorWatchdogAdapter#destroy()` for more information.\n\t\t\t/* istanbul ignore next */\n\t\t\tsetTimeout( () => {\n\t\t\t\tif ( this.watchdog ) {\n\t\t\t\t\tthis.watchdog.destroy().then( () => {\n\t\t\t\t\t\tthis.watchdog = null;\n\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t/**\n\t * Returns true when the editor should be updated.\n\t *\n\t * @private\n\t * @param {Object} nextProps React's properties.\n\t * @returns {Boolean}\n\t */\n\t_shouldUpdateEditor( nextProps ) {\n\t\t// Check whether `nextProps.data` is equal to `this.props.data` is required if somebody defined the `#data`\n\t\t// property as a static string and updated a state of component when the editor's content has been changed.\n\t\t// If we avoid checking those properties, the editor's content will back to the initial value because\n\t\t// the state has been changed and React will call this method.\n\t\tif ( this.props.data === nextProps.data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// We should not change data if the editor's content is equal to the `#data` property.\n\t\tif ( this.editor.getData() === nextProps.data ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns the editor configuration.\n\t *\n\t * @private\n\t * @return {Object}\n\t */\n\t_getConfig() {\n\t\tif ( this.props.data && this.props.config.initialData ) {\n\t\t\tconsole.warn(\n\t\t\t\t'Editor data should be provided either using `config.initialData` or `data` properties. ' +\n\t\t\t\t'The config property is over the data value and the first one will be used when specified both.'\n\t\t\t);\n\t\t}\n\n\t\t// Merge two possible ways of providing data into the `config.initialData` field.\n\t\treturn {\n\t\t\t...this.props.config,\n\t\t\tinitialData: this.props.config.initialData || this.props.data || ''\n\t\t};\n\t}\n}\n\n/**\n * An adapter aligning the context watchdog API to the editor watchdog API for easier usage.\n */\nclass EditorWatchdogAdapter {\n\t/**\n\t * @param {ContextWatchdog} contextWatchdog The context watchdog instance that will be wrapped into editor watchdog API.\n\t */\n\tconstructor( contextWatchdog ) {\n\t\tthis._contextWatchdog = contextWatchdog;\n\n\t\t/**\n\t\t * A unique id for the adapter to distinguish editor items when using the context watchdog API.\n\t\t *\n\t\t * @type {String}\n\t\t */\n\t\tthis._id = uid();\n\t}\n\n\t/**\n\t * @param {Function} creator A watchdog's editor creator function.\n\t */\n\tsetCreator( creator ) {\n\t\tthis._creator = creator;\n\t}\n\n\t/**\n\t * Adds an editor configuration to the context watchdog registry. Creates an instance of it.\n\t *\n\t * @param {HTMLElement|string} sourceElementOrData A source element or data for the new editor.\n\t * @param {Object} config CKEditor 5 editor config.\n\t * @returns {Promise}\n\t */\n\tcreate( sourceElementOrData, config ) {\n\t\treturn this._contextWatchdog.add( {\n\t\t\tsourceElementOrData,\n\t\t\tconfig,\n\t\t\tcreator: this._creator,\n\t\t\tid: this._id,\n\t\t\ttype: 'editor'\n\t\t} );\n\t}\n\n\t/**\n\t * Creates a listener that is attached to context watchdog's item and run when the context watchdog fires.\n\t * Currently works only for the `error` event.\n\t *\n\t * @param {String} _\n\t * @param {Function} callback\n\t */\n\ton( _, callback ) {\n\t\t// Assume that the event name was error.\n\t\tthis._contextWatchdog.on( 'itemError', ( _, { itemId, causesRestart, error } ) => {\n\t\t\tif ( itemId === this._id ) {\n\t\t\t\tcallback( null, { error, causesRestart } );\n\t\t\t}\n\t\t} );\n\t}\n\n\tdestroy() {\n\t\t// Destroying an editor instance after destroying the Context is handled in the `ContextWatchdog` class.\n\t\t// As `EditorWatchdogAdapter` is an adapter, we should not destroy the editor manually.\n\t\t// Otherwise, it causes that the editor is destroyed twice. However, there is a case, when the editor\n\t\t// needs to be removed from the context, without destroying the context itself. We may assume the following\n\t\t// relations with `ContextWatchdog#state`:\n\t\t//\n\t\t// a) `ContextWatchdog#state` === 'ready' - context is not destroyed; it's safe to destroy the editor manually.\n\t\t// b) `ContextWatchdog#state` === 'destroyed' - context is destroyed; let `ContextWatchdog` handle the whole process.\n\t\t//\n\t\t// See #354 for more information.\n\t\tif ( this._contextWatchdog.state === 'ready' ) {\n\t\t\treturn this._contextWatchdog.remove( this._id );\n\t\t}\n\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * An editor instance.\n\t */\n\tget editor() {\n\t\treturn this._contextWatchdog.getItem( this._id );\n\t}\n}\n\nCKEditor.contextType = ContextWatchdogContext;\n\n// Properties definition.\nCKEditor.propTypes = {\n\teditor: PropTypes.func.isRequired,\n\tdata: PropTypes.string,\n\tconfig: PropTypes.object,\n\twatchdogConfig: PropTypes.object,\n\tonChange: PropTypes.func,\n\tonReady: PropTypes.func,\n\tonFocus: PropTypes.func,\n\tonBlur: PropTypes.func,\n\tonError: PropTypes.func,\n\tdisabled: PropTypes.bool,\n\tonInit: ( props, propName ) => {\n\t\tif ( props[ propName ] ) {\n\t\t\treturn new Error(\n\t\t\t\t'The \"onInit\" property is not supported anymore by the CKEditor component. Use the \"onReady\" property instead.'\n\t\t\t);\n\t\t}\n\t}\n};\n\n// Default values for non-required properties.\nCKEditor.defaultProps = {\n\tconfig: {},\n\tonError: ( error, details ) => console.error( error, details )\n};\n\n// Store the API in the static property to easily overwrite it in tests.\n// Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.\nCKEditor._EditorWatchdog = EditorWatchdog;\n","import { bound01, pad2 } from './util.js';\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.js';\nimport { names } from './css-color-names.js';\nimport { boundAlpha, convertToPercentage } from './util.js';\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 { numberInputToObject, rgbaToHex, rgbToHex, rgbToHsl, rgbToHsv } from './conversion.js';\nimport { names } from './css-color-names.js';\nimport { inputToRGB } from './format-input';\nimport { bound01, boundAlpha, clamp01 } from './util.js';\nvar TinyColor = /** @class */ (function () {\n function TinyColor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n var _a;\n // If input is already a tinycolor, return itself\n if (color instanceof TinyColor) {\n // eslint-disable-next-line no-constructor-return\n return color;\n }\n if (typeof color === 'number') {\n color = numberInputToObject(color);\n }\n this.originalInput = color;\n var rgb = inputToRGB(color);\n this.originalInput = color;\n this.r = rgb.r;\n this.g = rgb.g;\n this.b = rgb.b;\n this.a = rgb.a;\n this.roundA = Math.round(100 * this.a) / 100;\n this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;\n this.gradientType = opts.gradientType;\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this.r < 1) {\n this.r = Math.round(this.r);\n }\n if (this.g < 1) {\n this.g = Math.round(this.g);\n }\n if (this.b < 1) {\n this.b = Math.round(this.b);\n }\n this.isValid = rgb.ok;\n }\n TinyColor.prototype.isDark = function () {\n return this.getBrightness() < 128;\n };\n TinyColor.prototype.isLight = function () {\n return !this.isDark();\n };\n /**\n * Returns the perceived brightness of the color, from 0-255.\n */\n TinyColor.prototype.getBrightness = function () {\n // http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n };\n /**\n * Returns the perceived luminance of a color, from 0-1.\n */\n TinyColor.prototype.getLuminance = function () {\n // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var R;\n var G;\n var B;\n var RsRGB = rgb.r / 255;\n var GsRGB = rgb.g / 255;\n var BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n };\n /**\n * Returns the alpha value of a color, from 0-1.\n */\n TinyColor.prototype.getAlpha = function () {\n return this.a;\n };\n /**\n * Sets the alpha value on the current color.\n *\n * @param alpha - The new alpha value. The accepted range is 0-1.\n */\n TinyColor.prototype.setAlpha = function (alpha) {\n this.a = boundAlpha(alpha);\n this.roundA = Math.round(100 * this.a) / 100;\n return this;\n };\n /**\n * Returns whether the color is monochrome.\n */\n TinyColor.prototype.isMonochrome = function () {\n var s = this.toHsl().s;\n return s === 0;\n };\n /**\n * Returns the object as a HSVA object.\n */\n TinyColor.prototype.toHsv = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };\n };\n /**\n * Returns the hsva values interpolated into a string with the following format:\n * \"hsva(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHsvString = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n var h = Math.round(hsv.h * 360);\n var s = Math.round(hsv.s * 100);\n var v = Math.round(hsv.v * 100);\n return this.a === 1 ? \"hsv(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%)\") : \"hsva(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a HSLA object.\n */\n TinyColor.prototype.toHsl = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };\n };\n /**\n * Returns the hsla values interpolated into a string with the following format:\n * \"hsla(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHslString = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n var h = Math.round(hsl.h * 360);\n var s = Math.round(hsl.s * 100);\n var l = Math.round(hsl.l * 100);\n return this.a === 1 ? \"hsl(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%)\") : \"hsla(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the hex value of the color.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHex = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return rgbToHex(this.r, this.g, this.b, allow3Char);\n };\n /**\n * Returns the hex value of the color -with a # prefixed.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHexString = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return '#' + this.toHex(allow3Char);\n };\n /**\n * Returns the hex 8 value of the color.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8 = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);\n };\n /**\n * Returns the hex 8 value of the color -with a # prefixed.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8String = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return '#' + this.toHex8(allow4Char);\n };\n /**\n * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.\n * @param allowShortChar will shorten hex value to 3 or 4 char if possible\n */\n TinyColor.prototype.toHexShortString = function (allowShortChar) {\n if (allowShortChar === void 0) { allowShortChar = false; }\n return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toRgb = function () {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA values interpolated into a string with the following format:\n * \"RGBA(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toRgbString = function () {\n var r = Math.round(this.r);\n var g = Math.round(this.g);\n var b = Math.round(this.b);\n return this.a === 1 ? \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\") : \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toPercentageRgb = function () {\n var fmt = function (x) { return \"\".concat(Math.round(bound01(x, 255) * 100), \"%\"); };\n return {\n r: fmt(this.r),\n g: fmt(this.g),\n b: fmt(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA relative values interpolated into a string\n */\n TinyColor.prototype.toPercentageRgbString = function () {\n var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };\n return this.a === 1\n ? \"rgb(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%)\")\n : \"rgba(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%, \").concat(this.roundA, \")\");\n };\n /**\n * The 'real' name of the color -if there is one.\n */\n TinyColor.prototype.toName = function () {\n if (this.a === 0) {\n return 'transparent';\n }\n if (this.a < 1) {\n return false;\n }\n var hex = '#' + rgbToHex(this.r, this.g, this.b, false);\n for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n if (hex === value) {\n return key;\n }\n }\n return false;\n };\n TinyColor.prototype.toString = function (format) {\n var formatSet = Boolean(format);\n format = format !== null && format !== void 0 ? format : this.format;\n var formattedString = false;\n var hasAlpha = this.a < 1 && this.a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this.a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex4') {\n formattedString = this.toHex8String(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n };\n TinyColor.prototype.toNumber = function () {\n return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);\n };\n TinyColor.prototype.clone = function () {\n return new TinyColor(this.toString());\n };\n /**\n * Lighten the color a given amount. Providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.lighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Brighten the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.brighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var rgb = this.toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return new TinyColor(rgb);\n };\n /**\n * Darken the color a given amount, from 0 to 100.\n * Providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.darken = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.tint = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('white', amount);\n };\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.shade = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('black', amount);\n };\n /**\n * Desaturate the color a given amount, from 0 to 100.\n * Providing 100 will is the same as calling greyscale\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.desaturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Saturate the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.saturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Completely desaturates a color into greyscale.\n * Same as calling `desaturate(100)`\n */\n TinyColor.prototype.greyscale = function () {\n return this.desaturate(100);\n };\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n TinyColor.prototype.spin = function (amount) {\n var hsl = this.toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return new TinyColor(hsl);\n };\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n TinyColor.prototype.mix = function (color, amount) {\n if (amount === void 0) { amount = 50; }\n var rgb1 = this.toRgb();\n var rgb2 = new TinyColor(color).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a,\n };\n return new TinyColor(rgba);\n };\n TinyColor.prototype.analogous = function (results, slices) {\n if (results === void 0) { results = 6; }\n if (slices === void 0) { slices = 30; }\n var hsl = this.toHsl();\n var part = 360 / slices;\n var ret = [this];\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(new TinyColor(hsl));\n }\n return ret;\n };\n /**\n * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js\n */\n TinyColor.prototype.complement = function () {\n var hsl = this.toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return new TinyColor(hsl);\n };\n TinyColor.prototype.monochromatic = function (results) {\n if (results === void 0) { results = 6; }\n var hsv = this.toHsv();\n var h = hsv.h;\n var s = hsv.s;\n var v = hsv.v;\n var res = [];\n var modification = 1 / results;\n while (results--) {\n res.push(new TinyColor({ h: h, s: s, v: v }));\n v = (v + modification) % 1;\n }\n return res;\n };\n TinyColor.prototype.splitcomplement = function () {\n var hsl = this.toHsl();\n var h = hsl.h;\n return [\n this,\n new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),\n ];\n };\n /**\n * Compute how the color would appear on a background\n */\n TinyColor.prototype.onBackground = function (background) {\n var fg = this.toRgb();\n var bg = new TinyColor(background).toRgb();\n var alpha = fg.a + bg.a * (1 - fg.a);\n return new TinyColor({\n r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,\n g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,\n b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,\n a: alpha,\n });\n };\n /**\n * Alias for `polyad(3)`\n */\n TinyColor.prototype.triad = function () {\n return this.polyad(3);\n };\n /**\n * Alias for `polyad(4)`\n */\n TinyColor.prototype.tetrad = function () {\n return this.polyad(4);\n };\n /**\n * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)\n * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...\n */\n TinyColor.prototype.polyad = function (n) {\n var hsl = this.toHsl();\n var h = hsl.h;\n var result = [this];\n var increment = 360 / n;\n for (var i = 1; i < n; i++) {\n result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));\n }\n return result;\n };\n /**\n * compare color vs current color\n */\n TinyColor.prototype.equals = function (color) {\n return this.toRgbString() === new TinyColor(color).toRgbString();\n };\n return TinyColor;\n}());\nexport { TinyColor };\n// kept for backwards compatability with v1\nexport function tinycolor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n return new TinyColor(color, opts);\n}\n","import { TinyColor } from './index.js';\n// Readability Functions\n// ---------------------\n// false\n * new TinyColor().isReadable('#000', '#111', { level: 'AA', size: 'large' }) => false\n * ```\n */\nexport function isReadable(color1, color2, wcag2) {\n var _a, _b;\n if (wcag2 === void 0) { wcag2 = { level: 'AA', size: 'small' }; }\n var readabilityLevel = readability(color1, color2);\n switch (((_a = wcag2.level) !== null && _a !== void 0 ? _a : 'AA') + ((_b = wcag2.size) !== null && _b !== void 0 ? _b : 'small')) {\n case 'AAsmall':\n case 'AAAlarge':\n return readabilityLevel >= 4.5;\n case 'AAlarge':\n return readabilityLevel >= 3;\n case 'AAAsmall':\n return readabilityLevel >= 7;\n default:\n return false;\n }\n}\n/**\n * Given a base color and a list of possible foreground or background\n * colors for that base, returns the most readable color.\n * Optionally returns Black or White if the most readable color is unreadable.\n *\n * @param baseColor - the base color.\n * @param colorList - array of colors to pick the most readable one from.\n * @param args - and object with extra arguments\n *\n * Example\n * ```ts\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'], { includeFallbackColors: false }).toHexString(); // \"#112255\"\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'],{ includeFallbackColors: true }).toHexString(); // \"#ffffff\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'large' }).toHexString(); // \"#faf3f3\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'small' }).toHexString(); // \"#ffffff\"\n * ```\n */\nexport function mostReadable(baseColor, colorList, args) {\n if (args === void 0) { args = { includeFallbackColors: false, level: 'AA', size: 'small' }; }\n var bestColor = null;\n var bestScore = 0;\n var includeFallbackColors = args.includeFallbackColors, level = args.level, size = args.size;\n for (var _i = 0, colorList_1 = colorList; _i < colorList_1.length; _i++) {\n var color = colorList_1[_i];\n var score = readability(baseColor, color);\n if (score > bestScore) {\n bestScore = score;\n bestColor = new TinyColor(color);\n }\n }\n if (isReadable(baseColor, bestColor, { level: level, size: size }) || !includeFallbackColors) {\n return bestColor;\n }\n args.includeFallbackColors = false;\n return mostReadable(baseColor, ['#fff', '#000'], args);\n}\n","import { rgbaToArgbHex } from './conversion.js';\nimport { TinyColor } from './index.js';\n/**\n * Returns the color represented as a Microsoft filter for use in old versions of IE.\n */\nexport function toMsFilter(firstColor, secondColor) {\n var color = new TinyColor(firstColor);\n var hex8String = '#' + rgbaToArgbHex(color.r, color.g, color.b, color.a);\n var secondHex8String = hex8String;\n var gradientType = color.gradientType ? 'GradientType = 1, ' : '';\n if (secondColor) {\n var s = new TinyColor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s.r, s.g, s.b, s.a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\".concat(gradientType, \"startColorstr=\").concat(hex8String, \",endColorstr=\").concat(secondHex8String, \")\");\n}\n","import { TinyColor } from './index.js';\nimport { convertToPercentage } from './util.js';\n/**\n * If input is an object, force 1 into \"1.0\" to handle ratios properly\n * String input requires \"1.0\" as input, so 1 will be treated as 1\n */\nexport function fromRatio(ratio, opts) {\n var newColor = {\n r: convertToPercentage(ratio.r),\n g: convertToPercentage(ratio.g),\n b: convertToPercentage(ratio.b),\n };\n if (ratio.a !== undefined) {\n newColor.a = Number(ratio.a);\n }\n return new TinyColor(newColor, opts);\n}\n/** old random function */\nexport function legacyRandom() {\n return new TinyColor({\n r: Math.random(),\n g: Math.random(),\n b: Math.random(),\n });\n}\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// randomColor by David Merfield under the CC0 license\n// https://github.com/davidmerfield/randomColor/\nimport { TinyColor } from './index.js';\nexport function random(options) {\n if (options === void 0) { options = {}; }\n // Check if we need to generate multiple colors\n if (options.count !== undefined &&\n options.count !== null) {\n var totalColors = options.count;\n var colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n var h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n var s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n var v = pickBrightness(h, s, options);\n var res = { h: h, s: s, v: v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new TinyColor(res);\n}\nfunction pickHue(hue, seed) {\n var hueRange = getHueRange(hue);\n var res = randomWithin(hueRange, seed);\n // Instead of storing red as two seperate ranges,\n // we group them, using negative numbers\n if (res < 0) {\n res = 360 + res;\n }\n return res;\n}\nfunction pickSaturation(hue, options) {\n if (options.hue === 'monochrome') {\n return 0;\n }\n if (options.luminosity === 'random') {\n return randomWithin([0, 100], options.seed);\n }\n var saturationRange = getColorInfo(hue).saturationRange;\n var sMin = saturationRange[0];\n var sMax = saturationRange[1];\n switch (options.luminosity) {\n case 'bright':\n sMin = 55;\n break;\n case 'dark':\n sMin = sMax - 10;\n break;\n case 'light':\n sMax = 55;\n break;\n default:\n break;\n }\n return randomWithin([sMin, sMax], options.seed);\n}\nfunction pickBrightness(H, S, options) {\n var bMin = getMinimumBrightness(H, S);\n var bMax = 100;\n switch (options.luminosity) {\n case 'dark':\n bMax = bMin + 20;\n break;\n case 'light':\n bMin = (bMax + bMin) / 2;\n break;\n case 'random':\n bMin = 0;\n bMax = 100;\n break;\n default:\n break;\n }\n return randomWithin([bMin, bMax], options.seed);\n}\nfunction getMinimumBrightness(H, S) {\n var lowerBounds = getColorInfo(H).lowerBounds;\n for (var i = 0; i < lowerBounds.length - 1; i++) {\n var s1 = lowerBounds[i][0];\n var v1 = lowerBounds[i][1];\n var s2 = lowerBounds[i + 1][0];\n var v2 = lowerBounds[i + 1][1];\n if (S >= s1 && S <= s2) {\n var m = (v2 - v1) / (s2 - s1);\n var b = v1 - m * s1;\n return m * S + b;\n }\n }\n return 0;\n}\nfunction getHueRange(colorInput) {\n var num = parseInt(colorInput, 10);\n if (!Number.isNaN(num) && num < 360 && num > 0) {\n return [num, num];\n }\n if (typeof colorInput === 'string') {\n var namedColor = bounds.find(function (n) { return n.name === colorInput; });\n if (namedColor) {\n var color = defineColor(namedColor);\n if (color.hueRange) {\n return color.hueRange;\n }\n }\n var parsed = new TinyColor(colorInput);\n if (parsed.isValid) {\n var hue = parsed.toHsv().h;\n return [hue, hue];\n }\n }\n return [0, 360];\n}\nfunction getColorInfo(hue) {\n // Maps red colors to make picking hue easier\n if (hue >= 334 && hue <= 360) {\n hue -= 360;\n }\n for (var _i = 0, bounds_1 = bounds; _i < bounds_1.length; _i++) {\n var bound = bounds_1[_i];\n var color = defineColor(bound);\n if (color.hueRange && hue >= color.hueRange[0] && hue <= color.hueRange[1]) {\n return color;\n }\n }\n throw Error('Color not found');\n}\nfunction randomWithin(range, seed) {\n if (seed === undefined) {\n return Math.floor(range[0] + Math.random() * (range[1] + 1 - range[0]));\n }\n // Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/\n var max = range[1] || 1;\n var min = range[0] || 0;\n seed = (seed * 9301 + 49297) % 233280;\n var rnd = seed / 233280.0;\n return Math.floor(min + rnd * (max - min));\n}\nfunction defineColor(bound) {\n var sMin = bound.lowerBounds[0][0];\n var sMax = bound.lowerBounds[bound.lowerBounds.length - 1][0];\n var bMin = bound.lowerBounds[bound.lowerBounds.length - 1][1];\n var bMax = bound.lowerBounds[0][1];\n return {\n name: bound.name,\n hueRange: bound.hueRange,\n lowerBounds: bound.lowerBounds,\n saturationRange: [sMin, sMax],\n brightnessRange: [bMin, bMax],\n };\n}\n/**\n * @hidden\n */\nexport var bounds = [\n {\n name: 'monochrome',\n hueRange: null,\n lowerBounds: [\n [0, 0],\n [100, 0],\n ],\n },\n {\n name: 'red',\n hueRange: [-26, 18],\n lowerBounds: [\n [20, 100],\n [30, 92],\n [40, 89],\n [50, 85],\n [60, 78],\n [70, 70],\n [80, 60],\n [90, 55],\n [100, 50],\n ],\n },\n {\n name: 'orange',\n hueRange: [19, 46],\n lowerBounds: [\n [20, 100],\n [30, 93],\n [40, 88],\n [50, 86],\n [60, 85],\n [70, 70],\n [100, 70],\n ],\n },\n {\n name: 'yellow',\n hueRange: [47, 62],\n lowerBounds: [\n [25, 100],\n [40, 94],\n [50, 89],\n [60, 86],\n [70, 84],\n [80, 82],\n [90, 80],\n [100, 75],\n ],\n },\n {\n name: 'green',\n hueRange: [63, 178],\n lowerBounds: [\n [30, 100],\n [40, 90],\n [50, 85],\n [60, 81],\n [70, 74],\n [80, 64],\n [90, 50],\n [100, 40],\n ],\n },\n {\n name: 'blue',\n hueRange: [179, 257],\n lowerBounds: [\n [20, 100],\n [30, 86],\n [40, 80],\n [50, 74],\n [60, 60],\n [70, 52],\n [80, 44],\n [90, 39],\n [100, 35],\n ],\n },\n {\n name: 'purple',\n hueRange: [258, 282],\n lowerBounds: [\n [20, 100],\n [30, 87],\n [40, 79],\n [50, 70],\n [60, 65],\n [70, 59],\n [80, 52],\n [90, 45],\n [100, 42],\n ],\n },\n {\n name: 'pink',\n hueRange: [283, 334],\n lowerBounds: [\n [20, 100],\n [30, 90],\n [40, 86],\n [60, 84],\n [80, 80],\n [90, 75],\n [100, 73],\n ],\n },\n];\n","import { tinycolor } from './index.js';\nexport * from './index.js';\nexport * from './css-color-names.js';\nexport * from './readability.js';\nexport * from './to-ms-filter.js';\nexport * from './from-ratio.js';\nexport * from './format-input.js';\nexport * from './random.js';\nexport * from './interfaces.js';\nexport * from './conversion.js';\n// kept for backwards compatability with v1\nexport default tinycolor;\n","/**\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","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \" \\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n return _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \" \\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \" \\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \" \\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage ? 'default message' : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.regionAPIs = void 0;\nexports.regionAPIs = new Map([\n [\"us\", \"https://api-iam.intercom.io\"],\n [\"eu\", \"https://api-iam.eu.intercom.io\"],\n [\"ap\", \"https://api-iam.au.intercom.io\"]\n]);\n","\"use strict\";\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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onUserEmailSupplied = exports.showConversation = exports.showTicket = exports.startChecklist = exports.startSurvey = exports.showNews = exports.showArticle = exports.startTour = exports.getVisitorId = exports.trackEvent = exports.onUnreadCountChange = exports.onShow = exports.onHide = exports.showNewMessage = exports.showMessages = exports.showSpace = exports.show = exports.hide = exports.update = exports.shutdown = exports.boot = exports.Intercom = void 0;\nconst constants_1 = require(\"./constants\");\nconst instance_manager_1 = require(\"./instance-manager\");\nconst callIntercomMethod = (method, ...args) => {\n // window is undefined on server-side and this breaks our widget\n if (typeof window !== undefined && window.Intercom) {\n window.Intercom(method, ...args);\n }\n else {\n console.warn(\"Please ensure Intercom is setup and running on client-side!\");\n }\n};\nconst Intercom = (props) => {\n if (typeof props !== \"object\") {\n console.warn(\"Intercom initialiser called with invalid parameters.\");\n return;\n }\n const { region = \"us\" } = props, args = __rest(props, [\"region\"]);\n if (typeof window !== \"undefined\" && !instance_manager_1.ref) {\n window.intercomSettings = Object.assign(Object.assign({}, args), { api_base: constants_1.regionAPIs.get(region) });\n (0, instance_manager_1.init)();\n }\n};\nexports.Intercom = Intercom;\n// Public functions that can be called from outside the module\nexports.default = exports.Intercom;\nconst boot = (arg) => callIntercomMethod(\"boot\", arg);\nexports.boot = boot;\nconst shutdown = () => callIntercomMethod(\"shutdown\");\nexports.shutdown = shutdown;\nconst update = (arg) => callIntercomMethod(\"update\", arg);\nexports.update = update;\nconst hide = () => callIntercomMethod(\"hide\");\nexports.hide = hide;\nconst show = () => callIntercomMethod(\"show\");\nexports.show = show;\nconst showSpace = (spaceName) => callIntercomMethod(\"showSpace\", spaceName);\nexports.showSpace = showSpace;\nconst showMessages = () => callIntercomMethod(\"showMessages\");\nexports.showMessages = showMessages;\nconst showNewMessage = (prePopulatedContent) => callIntercomMethod(\"showNewMessage\", prePopulatedContent);\nexports.showNewMessage = showNewMessage;\nconst onHide = (callback) => callIntercomMethod(\"onHide\", callback);\nexports.onHide = onHide;\nconst onShow = (callback) => callIntercomMethod(\"onShow\", callback);\nexports.onShow = onShow;\nconst onUnreadCountChange = (callback) => callIntercomMethod(\"onUnreadCountChange\", callback);\nexports.onUnreadCountChange = onUnreadCountChange;\nconst trackEvent = (...args) => callIntercomMethod(\"trackEvent\", ...args);\nexports.trackEvent = trackEvent;\nconst getVisitorId = () => callIntercomMethod(\"getVisitorId\");\nexports.getVisitorId = getVisitorId;\nconst startTour = (tourId) => callIntercomMethod(\"startTour\", tourId);\nexports.startTour = startTour;\nconst showArticle = (articleId) => callIntercomMethod(\"showArticle\", articleId);\nexports.showArticle = showArticle;\nconst showNews = (newsItemId) => callIntercomMethod(\"showNews\", newsItemId);\nexports.showNews = showNews;\nconst startSurvey = (surveyId) => callIntercomMethod(\"startSurvey\", surveyId);\nexports.startSurvey = startSurvey;\nconst startChecklist = (checklistId) => callIntercomMethod(\"startChecklist\", checklistId);\nexports.startChecklist = startChecklist;\nconst showTicket = (ticketId) => callIntercomMethod(\"showTicket\", ticketId);\nexports.showTicket = showTicket;\nconst showConversation = (conversationId) => callIntercomMethod(\"showConversation\", conversationId);\nexports.showConversation = showConversation;\nconst onUserEmailSupplied = (callback) => callIntercomMethod(\"onUserEmailSupplied\", callback);\nexports.onUserEmailSupplied = onUserEmailSupplied;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ref = exports.init = void 0;\nconst scriptElementId = \"_intercom_npm_loader\";\n// This holds a queue of commands to be passed to the messenger widget API after it is added to the page\nconst queueHolder = function () {\n queueHolder.loaderQueue(arguments);\n};\nqueueHolder.q = [];\nqueueHolder.loaderQueue = function (args) {\n queueHolder.q.push(args);\n};\nconst addWidgetToPage = function () {\n var _a, _b;\n var d = document;\n if (d.getElementById(scriptElementId)) {\n // script is already in DOM\n return;\n }\n var s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.id = scriptElementId;\n s.src =\n \"https://widget.intercom.io/widget/\" + ((_a = window.intercomSettings) === null || _a === void 0 ? void 0 : _a.app_id);\n var x = d.getElementsByTagName(\"script\")[0];\n (_b = x.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(s, x);\n};\nconst isDocumentReady = () => document.readyState === \"complete\" || document.readyState === \"interactive\";\nconst init = () => __awaiter(void 0, void 0, void 0, function* () {\n var w = window;\n var ic = w.Intercom;\n if (w.intercomSettings) {\n w.intercomSettings.installation_type = \"npm-package\";\n }\n if (typeof ic === \"function\") {\n ic(\"reattach_activator\");\n ic(\"update\", w.intercomSettings);\n }\n else {\n w.Intercom = queueHolder;\n if (isDocumentReady()) {\n addWidgetToPage();\n }\n else {\n document.addEventListener(\"readystatechange\", function () {\n if (isDocumentReady()) {\n addWidgetToPage();\n }\n });\n if (w.attachEvent) {\n w.attachEvent(\"onload\", addWidgetToPage);\n }\n else {\n w.addEventListener(\"load\", addWidgetToPage, false);\n }\n }\n }\n});\nexports.init = init;\nexports.ref = undefined;\n","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import * as React from 'react';\nvar OrderContext = /*#__PURE__*/React.createContext(null);\nexport default OrderContext;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport OrderContext from \"./Context\";\nvar EMPTY_LIST = [];\n\n/**\n * Will add `div` to document. Nest call will keep order\n * @param render Render DOM in document\n */\nexport default function useDom(render, debug) {\n var _React$useState = React.useState(function () {\n if (!canUseDom()) {\n return null;\n }\n var defaultEle = document.createElement('div');\n if (process.env.NODE_ENV !== 'production' && debug) {\n defaultEle.setAttribute('data-debug', debug);\n }\n return defaultEle;\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n ele = _React$useState2[0];\n\n // ========================== Order ==========================\n var appendedRef = React.useRef(false);\n var queueCreate = React.useContext(OrderContext);\n var _React$useState3 = React.useState(EMPTY_LIST),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n queue = _React$useState4[0],\n setQueue = _React$useState4[1];\n var mergedQueueCreate = queueCreate || (appendedRef.current ? undefined : function (appendFn) {\n setQueue(function (origin) {\n var newQueue = [appendFn].concat(_toConsumableArray(origin));\n return newQueue;\n });\n });\n\n // =========================== DOM ===========================\n function append() {\n if (!ele.parentElement) {\n document.body.appendChild(ele);\n }\n appendedRef.current = true;\n }\n function cleanup() {\n var _ele$parentElement;\n (_ele$parentElement = ele.parentElement) === null || _ele$parentElement === void 0 ? void 0 : _ele$parentElement.removeChild(ele);\n appendedRef.current = false;\n }\n useLayoutEffect(function () {\n if (render) {\n if (queueCreate) {\n queueCreate(append);\n } else {\n append();\n }\n } else {\n cleanup();\n }\n return cleanup;\n }, [render]);\n useLayoutEffect(function () {\n if (queue.length) {\n queue.forEach(function (appendFn) {\n return appendFn();\n });\n setQueue(EMPTY_LIST);\n }\n }, [queue]);\n return [ele, mergedQueueCreate];\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { updateCSS, removeCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport { getTargetScrollBarSize } from \"rc-util/es/getScrollBarSize\";\nimport { isBodyOverflowing } from \"./util\";\nvar UNIQUE_ID = \"rc-util-locker-\".concat(Date.now());\nvar uuid = 0;\nexport default function useScrollLocker(lock) {\n var mergedLock = !!lock;\n var _React$useState = React.useState(function () {\n uuid += 1;\n return \"\".concat(UNIQUE_ID, \"_\").concat(uuid);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n id = _React$useState2[0];\n useLayoutEffect(function () {\n if (mergedLock) {\n var scrollbarSize = getTargetScrollBarSize(document.body).width;\n var isOverflow = isBodyOverflowing();\n updateCSS(\"\\nhtml body {\\n overflow-y: hidden;\\n \".concat(isOverflow ? \"width: calc(100% - \".concat(scrollbarSize, \"px);\") : '', \"\\n}\"), id);\n } else {\n removeCSS(id);\n }\n return function () {\n removeCSS(id);\n };\n }, [mergedLock, id]);\n}","/**\n * Test usage export. Do not use in your production\n */\nexport function isBodyOverflowing() {\n return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;\n}","export var inline = false;\nexport function inlineMock(nextInline) {\n if (typeof nextInline === 'boolean') {\n inline = nextInline;\n }\n return inline;\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport warning from \"rc-util/es/warning\";\nimport { supportRef, useComposeRef } from \"rc-util/es/ref\";\nimport OrderContext from \"./Context\";\nimport useDom from \"./useDom\";\nimport useScrollLocker from \"./useScrollLocker\";\nimport { inlineMock } from \"./mock\";\nvar getPortalContainer = function getPortalContainer(getContainer) {\n if (getContainer === false) {\n return false;\n }\n if (!canUseDom() || !getContainer) {\n return null;\n }\n if (typeof getContainer === 'string') {\n return document.querySelector(getContainer);\n }\n if (typeof getContainer === 'function') {\n return getContainer();\n }\n return getContainer;\n};\nvar Portal = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var open = props.open,\n autoLock = props.autoLock,\n getContainer = props.getContainer,\n debug = props.debug,\n _props$autoDestroy = props.autoDestroy,\n autoDestroy = _props$autoDestroy === void 0 ? true : _props$autoDestroy,\n children = props.children;\n var _React$useState = React.useState(open),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n shouldRender = _React$useState2[0],\n setShouldRender = _React$useState2[1];\n var mergedRender = shouldRender || open;\n\n // ========================= Warning =========================\n if (process.env.NODE_ENV !== 'production') {\n warning(canUseDom() || !open, \"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR.\");\n }\n\n // ====================== Should Render ======================\n React.useEffect(function () {\n if (autoDestroy || open) {\n setShouldRender(open);\n }\n }, [open, autoDestroy]);\n\n // ======================== Container ========================\n var _React$useState3 = React.useState(function () {\n return getPortalContainer(getContainer);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n innerContainer = _React$useState4[0],\n setInnerContainer = _React$useState4[1];\n React.useEffect(function () {\n var customizeContainer = getPortalContainer(getContainer);\n\n // Tell component that we check this in effect which is safe to be `null`\n setInnerContainer(customizeContainer !== null && customizeContainer !== void 0 ? customizeContainer : null);\n });\n var _useDom = useDom(mergedRender && !innerContainer, debug),\n _useDom2 = _slicedToArray(_useDom, 2),\n defaultContainer = _useDom2[0],\n queueCreate = _useDom2[1];\n var mergedContainer = innerContainer !== null && innerContainer !== void 0 ? innerContainer : defaultContainer;\n\n // ========================= Locker ==========================\n useScrollLocker(autoLock && open && canUseDom() && (mergedContainer === defaultContainer || mergedContainer === document.body));\n\n // =========================== Ref ===========================\n var childRef = null;\n if (children && supportRef(children) && ref) {\n var _ref = children;\n childRef = _ref.ref;\n }\n var mergedRef = useComposeRef(childRef, ref);\n\n // ========================= Render ==========================\n // Do not render when nothing need render\n // When innerContainer is `undefined`, it may not ready since user use ref in the same render\n if (!mergedRender || !canUseDom() || innerContainer === undefined) {\n return null;\n }\n\n // Render inline\n var renderInline = mergedContainer === false || inlineMock();\n var reffedChildren = children;\n if (ref) {\n reffedChildren = /*#__PURE__*/React.cloneElement(children, {\n ref: mergedRef\n });\n }\n return /*#__PURE__*/React.createElement(OrderContext.Provider, {\n value: queueCreate\n }, renderInline ? reffedChildren : /*#__PURE__*/createPortal(reffedChildren, mergedContainer));\n});\nif (process.env.NODE_ENV !== 'production') {\n Portal.displayName = 'Portal';\n}\nexport default Portal;","import Portal from \"./Portal\";\nimport { inlineMock } from \"./mock\";\nexport { inlineMock };\nexport default Portal;","/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nexport function invariant(condition: any, format: string, ...args: any[]) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n let error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n let argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() {\n return args[argIndex++];\n })\n );\n error.name = 'Invariant Violation';\n }\n\n (error as any).framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n","import type { MeasurementUnit, Span } from '@sentry/types';\nimport type { MetricSummary } from '@sentry/types';\nimport type { Primitive } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { getActiveSpan } from '../tracing';\nimport type { MetricType } from './types';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\ntype MetricSummaryStorage = Map;\n\nlet SPAN_METRIC_SUMMARY: WeakMap | undefined;\n\nfunction getMetricStorageForSpan(span: Span): MetricSummaryStorage | undefined {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nexport function getMetricSummaryJsonForSpan(span: Span): Record> | undefined {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output: Record> = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nexport function updateMetricSummaryOnActiveSpan(\n metricType: MetricType,\n sanitizedName: string,\n value: number,\n unit: MeasurementUnit,\n tags: Record,\n bucketKey: string,\n): void {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n","import type { Span } from '@sentry/types';\n\n/** The status of an Span.\n *\n * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type\n */\nexport enum SpanStatus {\n /** The operation completed successfully. */\n Ok = 'ok',\n /** Deadline expired before operation could complete. */\n DeadlineExceeded = 'deadline_exceeded',\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n Unauthenticated = 'unauthenticated',\n /** 403 Forbidden */\n PermissionDenied = 'permission_denied',\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n NotFound = 'not_found',\n /** 429 Too Many Requests */\n ResourceExhausted = 'resource_exhausted',\n /** Client specified an invalid argument. 4xx. */\n InvalidArgument = 'invalid_argument',\n /** 501 Not Implemented */\n Unimplemented = 'unimplemented',\n /** 503 Service Unavailable */\n Unavailable = 'unavailable',\n /** Other/generic 5xx. */\n InternalError = 'internal_error',\n /** Unknown. Any non-standard HTTP status code. */\n UnknownError = 'unknown_error',\n /** The operation was cancelled (typically by the user). */\n Cancelled = 'cancelled',\n /** Already exists (409) */\n AlreadyExists = 'already_exists',\n /** Operation was rejected because the system is not in a state required for the operation's */\n FailedPrecondition = 'failed_precondition',\n /** The operation was aborted, typically due to a concurrency issue. */\n Aborted = 'aborted',\n /** Operation was attempted past the valid range. */\n OutOfRange = 'out_of_range',\n /** Unrecoverable data loss or corruption */\n DataLoss = 'data_loss',\n}\n\nexport type SpanStatusType =\n /** The operation completed successfully. */\n | 'ok'\n /** Deadline expired before operation could complete. */\n | 'deadline_exceeded'\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n | 'unauthenticated'\n /** 403 Forbidden */\n | 'permission_denied'\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n | 'not_found'\n /** 429 Too Many Requests */\n | 'resource_exhausted'\n /** Client specified an invalid argument. 4xx. */\n | 'invalid_argument'\n /** 501 Not Implemented */\n | 'unimplemented'\n /** 503 Service Unavailable */\n | 'unavailable'\n /** Other/generic 5xx. */\n | 'internal_error'\n /** Unknown. Any non-standard HTTP status code. */\n | 'unknown_error'\n /** The operation was cancelled (typically by the user). */\n | 'cancelled'\n /** Already exists (409) */\n | 'already_exists'\n /** Operation was rejected because the system is not in a state required for the operation's */\n | 'failed_precondition'\n /** The operation was aborted, typically due to a concurrency issue. */\n | 'aborted'\n /** Operation was attempted past the valid range. */\n | 'out_of_range'\n /** Unrecoverable data loss or corruption */\n | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function getSpanStatusFromHttpCode(httpStatus: number): SpanStatusType {\n if (httpStatus < 400 && httpStatus >= 100) {\n return 'ok';\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return 'unauthenticated';\n case 403:\n return 'permission_denied';\n case 404:\n return 'not_found';\n case 409:\n return 'already_exists';\n case 413:\n return 'failed_precondition';\n case 429:\n return 'resource_exhausted';\n default:\n return 'invalid_argument';\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return 'unimplemented';\n case 503:\n return 'unavailable';\n case 504:\n return 'deadline_exceeded';\n default:\n return 'internal_error';\n }\n }\n\n return 'unknown_error';\n}\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @deprecated Use {@link spanStatusFromHttpCode} instead.\n * This export will be removed in v8 as the signature contains a typo.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport const spanStatusfromHttpCode = getSpanStatusFromHttpCode;\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nexport function setHttpStatus(span: Span, httpStatus: number): void {\n // TODO (v8): Remove these calls\n // Relay does not require us to send the status code as a tag\n // For now, just because users might expect it to land as a tag we keep sending it.\n // Same with data.\n // In v8, we replace both, simply with\n // span.setAttribute('http.response.status_code', httpStatus);\n\n // eslint-disable-next-line deprecation/deprecation\n span.setTag('http.status_code', String(httpStatus));\n // eslint-disable-next-line deprecation/deprecation\n span.setData('http.response.status_code', httpStatus);\n\n const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n if (spanStatus !== 'unknown_error') {\n span.setStatus(spanStatus);\n }\n}\n","/* eslint-disable max-lines */\nimport type {\n Instrumenter,\n Measurements,\n Primitive,\n Span as SpanInterface,\n SpanAttributeValue,\n SpanAttributes,\n SpanContext,\n SpanContextData,\n SpanJSON,\n SpanOrigin,\n SpanTimeInput,\n TraceContext,\n Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary';\nimport {\n SEMANTIC_ATTRIBUTE_PROFILE_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n} from '../semanticAttributes';\nimport { getRootSpan } from '../utils/getRootSpan';\nimport {\n TRACE_FLAG_NONE,\n TRACE_FLAG_SAMPLED,\n spanTimeInputToSeconds,\n spanToJSON,\n spanToTraceContext,\n spanToTraceHeader,\n} from '../utils/spanUtils';\nimport type { SpanStatusType } from './spanstatus';\nimport { setHttpStatus } from './spanstatus';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n public spans: Span[];\n\n private readonly _maxlen: number;\n\n public constructor(maxlen: number = 1000) {\n this._maxlen = maxlen;\n this.spans = [];\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n public add(span: Span): void {\n if (this.spans.length > this._maxlen) {\n // eslint-disable-next-line deprecation/deprecation\n span.spanRecorder = undefined;\n } else {\n this.spans.push(span);\n }\n }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n /**\n * Tags for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n public tags: { [key: string]: Primitive };\n\n /**\n * Data for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public data: { [key: string]: any };\n\n /**\n * List of spans that were finalized\n *\n * @deprecated This property will no longer be public. Span recording will be handled internally.\n */\n public spanRecorder?: SpanRecorder;\n\n /**\n * @inheritDoc\n * @deprecated Use top level `Sentry.getRootSpan()` instead\n */\n public transaction?: Transaction;\n\n /**\n * The instrumenter that created this span.\n *\n * TODO (v8): This can probably be replaced by an `instanceOf` check of the span class.\n * the instrumenter can only be sentry or otel so we can check the span instance\n * to verify which one it is and remove this field entirely.\n *\n * @deprecated This field will be removed.\n */\n public instrumenter: Instrumenter;\n\n protected _traceId: string;\n protected _spanId: string;\n protected _parentSpanId?: string | undefined;\n protected _sampled: boolean | undefined;\n protected _name?: string | undefined;\n protected _attributes: SpanAttributes;\n /** Epoch timestamp in seconds when the span started. */\n protected _startTime: number;\n /** Epoch timestamp in seconds when the span ended. */\n protected _endTime?: number | undefined;\n /** Internal keeper of the status */\n protected _status?: SpanStatusType | string | undefined;\n protected _exclusiveTime?: number;\n\n protected _measurements: Measurements;\n\n private _logMessage?: string;\n\n /**\n * You should never call the constructor manually, always use `Sentry.startTransaction()`\n * or call `startChild()` on an existing span.\n * @internal\n * @hideconstructor\n * @hidden\n */\n public constructor(spanContext: SpanContext = {}) {\n this._traceId = spanContext.traceId || uuid4();\n this._spanId = spanContext.spanId || uuid4().substring(16);\n this._startTime = spanContext.startTimestamp || timestampInSeconds();\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags ? { ...spanContext.tags } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data ? { ...spanContext.data } : {};\n // eslint-disable-next-line deprecation/deprecation\n this.instrumenter = spanContext.instrumenter || 'sentry';\n\n this._attributes = {};\n this.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanContext.origin || 'manual',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,\n ...spanContext.attributes,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this._sampled = spanContext.sampled;\n }\n if (spanContext.status) {\n this._status = spanContext.status;\n }\n if (spanContext.endTimestamp) {\n this._endTime = spanContext.endTimestamp;\n }\n if (spanContext.exclusiveTime !== undefined) {\n this._exclusiveTime = spanContext.exclusiveTime;\n }\n this._measurements = spanContext.measurements ? { ...spanContext.measurements } : {};\n }\n\n // This rule conflicts with another eslint rule :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * An alias for `description` of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name || '';\n }\n\n /**\n * Update the name of the span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set name(name: string) {\n this.updateName(name);\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get description(): string | undefined {\n return this._name;\n }\n\n /**\n * Get the description of the Span.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public set description(description: string | undefined) {\n this._name = description;\n }\n\n /**\n * The ID of the trace.\n * @deprecated Use `spanContext().traceId` instead.\n */\n public get traceId(): string {\n return this._traceId;\n }\n\n /**\n * The ID of the trace.\n * @deprecated You cannot update the traceId of a span after span creation.\n */\n public set traceId(traceId: string) {\n this._traceId = traceId;\n }\n\n /**\n * The ID of the span.\n * @deprecated Use `spanContext().spanId` instead.\n */\n public get spanId(): string {\n return this._spanId;\n }\n\n /**\n * The ID of the span.\n * @deprecated You cannot update the spanId of a span after span creation.\n */\n public set spanId(spanId: string) {\n this._spanId = spanId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `startSpan` functions instead.\n */\n public set parentSpanId(string) {\n this._parentSpanId = string;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).parent_span_id` instead.\n */\n public get parentSpanId(): string | undefined {\n return this._parentSpanId;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated Use `isRecording()` instead.\n */\n public get sampled(): boolean | undefined {\n return this._sampled;\n }\n\n /**\n * Was this span chosen to be sent as part of the sample?\n * @deprecated You cannot update the sampling decision of a span after span creation.\n */\n public set sampled(sampled: boolean | undefined) {\n this._sampled = sampled;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `spanToJSON(span).atttributes` instead.\n */\n public get attributes(): SpanAttributes {\n return this._attributes;\n }\n\n /**\n * Attributes for the span.\n * @deprecated Use `setAttributes()` instead.\n */\n public set attributes(attributes: SpanAttributes) {\n this._attributes = attributes;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated Use `spanToJSON()` instead.\n */\n public get startTimestamp(): number {\n return this._startTime;\n }\n\n /**\n * Timestamp in seconds (epoch time) indicating when the span started.\n * @deprecated In v8, you will not be able to update the span start time after creation.\n */\n public set startTimestamp(startTime: number) {\n this._startTime = startTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Use `spanToJSON()` instead.\n */\n public get endTimestamp(): number | undefined {\n return this._endTime;\n }\n\n /**\n * Timestamp in seconds when the span ended.\n * @deprecated Set the end time via `span.end()` instead.\n */\n public set endTimestamp(endTime: number | undefined) {\n this._endTime = endTime;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `spanToJSON().status` instead to get the status.\n */\n public get status(): SpanStatusType | string | undefined {\n return this._status;\n }\n\n /**\n * The status of the span.\n *\n * @deprecated Use `.setStatus()` instead to set or update the status.\n */\n public set status(status: SpanStatusType | string | undefined) {\n this._status = status;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `spanToJSON().op` to read the op instead.\n */\n public get op(): string | undefined {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] as string | undefined;\n }\n\n /**\n * Operation of the span\n *\n * @deprecated Use `startSpan()` functions to set or `span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'op')\n * to update the span instead.\n */\n public set op(op: string | undefined) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, op);\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `spanToJSON().origin` to read the origin instead.\n */\n public get origin(): SpanOrigin | undefined {\n return this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] as SpanOrigin | undefined;\n }\n\n /**\n * The origin of the span, giving context about what created the span.\n *\n * @deprecated Use `startSpan()` functions to set the origin instead.\n */\n public set origin(origin: SpanOrigin | undefined) {\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /** @inheritdoc */\n public spanContext(): SpanContextData {\n const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n return {\n spanId,\n traceId,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n };\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startChild(\n spanContext?: Pick>,\n ): SpanInterface {\n const childSpan = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this._sampled,\n traceId: this._traceId,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder = this.spanRecorder;\n // eslint-disable-next-line deprecation/deprecation\n if (childSpan.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n childSpan.spanRecorder.add(childSpan);\n }\n\n const rootSpan = getRootSpan(this);\n // TODO: still set span.transaction here until we have a more permanent solution\n // Probably similarly to the weakmap we hold in node-experimental\n // eslint-disable-next-line deprecation/deprecation\n childSpan.transaction = rootSpan as Transaction;\n\n if (DEBUG_BUILD && rootSpan) {\n const opStr = (spanContext && spanContext.op) || '< unknown op >';\n const nameStr = spanToJSON(childSpan).description || '< unknown name >';\n const idStr = rootSpan.spanContext().spanId;\n\n const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n logger.log(logMessage);\n this._logMessage = logMessage;\n }\n\n return childSpan;\n }\n\n /**\n * Sets the tag attribute on the current span.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key Tag key\n * @param value Tag value\n * @deprecated Use `setAttribute()` instead.\n */\n public setTag(key: string, value: Primitive): this {\n // eslint-disable-next-line deprecation/deprecation\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n * @deprecated Use `setAttribute()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setData(key: string, value: any): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /** @inheritdoc */\n public setAttribute(key: string, value: SpanAttributeValue | undefined): void {\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._attributes[key];\n } else {\n this._attributes[key] = value;\n }\n }\n\n /** @inheritdoc */\n public setAttributes(attributes: SpanAttributes): void {\n Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key]));\n }\n\n /**\n * @inheritDoc\n */\n public setStatus(value: SpanStatusType): this {\n this._status = value;\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top-level `setHttpStatus()` instead.\n */\n public setHttpStatus(httpStatus: number): this {\n setHttpStatus(this, httpStatus);\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @deprecated Use `.updateName()` instead.\n */\n public setName(name: string): void {\n this.updateName(name);\n }\n\n /**\n * @inheritDoc\n */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON(span).status === 'ok'` instead.\n */\n public isSuccess(): boolean {\n return this._status === 'ok';\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `.end()` instead.\n */\n public finish(endTimestamp?: number): void {\n return this.end(endTimestamp);\n }\n\n /** @inheritdoc */\n public end(endTimestamp?: SpanTimeInput): void {\n // If already ended, skip\n if (this._endTime) {\n return;\n }\n const rootSpan = getRootSpan(this);\n if (\n DEBUG_BUILD &&\n // Don't call this for transactions\n rootSpan &&\n rootSpan.spanContext().spanId !== this._spanId\n ) {\n const logMessage = this._logMessage;\n if (logMessage) {\n logger.log((logMessage as string).replace('Starting', 'Finishing'));\n }\n }\n\n this._endTime = spanTimeInputToSeconds(endTimestamp);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n public toTraceparent(): string {\n return spanToTraceHeader(this);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToJSON()` or access the fields directly instead.\n */\n public toContext(): SpanContext {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n endTimestamp: this._endTime,\n // eslint-disable-next-line deprecation/deprecation\n op: this.op,\n parentSpanId: this._parentSpanId,\n sampled: this._sampled,\n spanId: this._spanId,\n startTimestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n traceId: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Update the fields directly instead.\n */\n public updateWithContext(spanContext: SpanContext): this {\n // eslint-disable-next-line deprecation/deprecation\n this.data = spanContext.data || {};\n // eslint-disable-next-line deprecation/deprecation\n this._name = spanContext.name || spanContext.description;\n this._endTime = spanContext.endTimestamp;\n // eslint-disable-next-line deprecation/deprecation\n this.op = spanContext.op;\n this._parentSpanId = spanContext.parentSpanId;\n this._sampled = spanContext.sampled;\n this._spanId = spanContext.spanId || this._spanId;\n this._startTime = spanContext.startTimestamp || this._startTime;\n this._status = spanContext.status;\n // eslint-disable-next-line deprecation/deprecation\n this.tags = spanContext.tags || {};\n this._traceId = spanContext.traceId || this._traceId;\n\n return this;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `spanToTraceContext()` util function instead.\n */\n public getTraceContext(): TraceContext {\n return spanToTraceContext(this);\n }\n\n /**\n * Get JSON representation of this span.\n *\n * @hidden\n * @internal This method is purely for internal purposes and should not be used outside\n * of SDK code. If you need to get a JSON representation of a span,\n * use `spanToJSON(span)` instead.\n */\n public getSpanJSON(): SpanJSON {\n return dropUndefinedKeys({\n data: this._getData(),\n description: this._name,\n op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] as string | undefined,\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n start_timestamp: this._startTime,\n status: this._status,\n // eslint-disable-next-line deprecation/deprecation\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this._endTime,\n trace_id: this._traceId,\n origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] as SpanOrigin | undefined,\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID] as string | undefined,\n exclusive_time: this._exclusiveTime,\n measurements: Object.keys(this._measurements).length > 0 ? this._measurements : undefined,\n });\n }\n\n /** @inheritdoc */\n public isRecording(): boolean {\n return !this._endTime && !!this._sampled;\n }\n\n /**\n * Convert the object to JSON.\n * @deprecated Use `spanToJSON(span)` instead.\n */\n public toJSON(): SpanJSON {\n return this.getSpanJSON();\n }\n\n /**\n * Get the merged data for this span.\n * For now, this combines `data` and `attributes` together,\n * until eventually we can ingest `attributes` directly.\n */\n private _getData():\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n }\n | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const { data, _attributes: attributes } = this;\n\n const hasData = Object.keys(data).length > 0;\n const hasAttributes = Object.keys(attributes).length > 0;\n\n if (!hasData && !hasAttributes) {\n return undefined;\n }\n\n if (hasData && hasAttributes) {\n return {\n ...data,\n ...attributes,\n };\n }\n\n return hasData ? data : attributes;\n }\n}\n","import type { Options } from '@sentry/types';\n\nimport { getClient } from '../exports';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n maybeOptions?: Pick | undefined,\n): boolean {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n\n const client = getClient();\n const options = maybeOptions || (client && client.getOptions());\n return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n","import type { Scope, Span, SpanTimeInput, StartSpanOptions, TransactionContext } from '@sentry/types';\n\nimport { addNonEnumerableProperty, dropUndefinedKeys, logger, tracingContextFromHeaders } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '.';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getCurrentScope, withScope } from '../exports';\nimport type { Hub } from '../hub';\nimport { runWithAsyncContext } from '../hub';\nimport { getIsolationScope } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport type { Scope as ScopeClass } from '../scope';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanIsSampled, spanTimeInputToSeconds, spanToJSON } from '../utils/spanUtils';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n *\n * @deprecated Use `startSpan` instead.\n */\nexport function trace(\n context: TransactionContext,\n callback: (span?: Span) => T,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onError: (error: unknown, span?: Span) => void = () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n afterFinish: () => void = () => {},\n): T {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const scope = getCurrentScope();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const spanContext = normalizeContext(context);\n const activeSpan = createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: false,\n scope,\n });\n\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(activeSpan);\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n error => {\n activeSpan && activeSpan.setStatus('internal_error');\n onError(error, activeSpan);\n },\n () => {\n activeSpan && activeSpan.end();\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(parentSpan);\n afterFinish();\n },\n );\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpan(context: StartSpanOptions, callback: (span: Span | undefined) => T): T {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n return handleCallbackErrors(\n () => callback(activeSpan),\n () => {\n // Only update the span status if it hasn't been changed yet\n if (activeSpan) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n () => activeSpan && activeSpan.end(),\n );\n });\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically. You'll have to call `span.end()` manually.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpanManual(\n context: StartSpanOptions,\n callback: (span: Span | undefined, finish: () => void) => T,\n): T {\n const spanContext = normalizeContext(context);\n\n return runWithAsyncContext(() => {\n return withScope(context.scope, scope => {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const parentSpan = scope.getSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n const activeSpan = shouldSkipSpan\n ? undefined\n : createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope,\n });\n\n function finishAndSetSpan(): void {\n activeSpan && activeSpan.end();\n }\n\n return handleCallbackErrors(\n () => callback(activeSpan, finishAndSetSpan),\n () => {\n // Only update the span status if it hasn't been changed yet, and the span is not yet finished\n if (activeSpan && activeSpan.isRecording()) {\n const { status } = spanToJSON(activeSpan);\n if (!status || status === 'ok') {\n activeSpan.setStatus('internal_error');\n }\n }\n },\n );\n });\n });\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(context: StartSpanOptions): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const spanContext = normalizeContext(context);\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n const parentSpan = context.scope\n ? // eslint-disable-next-line deprecation/deprecation\n context.scope.getSpan()\n : getActiveSpan();\n\n const shouldSkipSpan = context.onlyIfParent && !parentSpan;\n\n if (shouldSkipSpan) {\n return undefined;\n }\n\n const scope = context.scope || getCurrentScope();\n\n // Even though we don't actually want to make this span active on the current scope,\n // we need to make it active on a temporary scope that we use for event processing\n // as otherwise, it won't pick the correct span for the event when processing it\n const temporaryScope = (scope as ScopeClass).clone();\n\n return createChildSpanOrTransaction(hub, {\n parentSpan,\n spanContext,\n forceTransaction: context.forceTransaction,\n scope: temporaryScope,\n });\n}\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getSpan();\n}\n\ninterface ContinueTrace {\n /**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers,\n * or in the browser from `` and `` HTML tags.\n *\n * @deprecated Use the version of this function taking a callback as second parameter instead:\n *\n * ```\n * Sentry.continueTrace(sentryTrace: '...', baggage: '...' }, () => {\n * // ...\n * })\n * ```\n *\n */\n ({\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters[1];\n }): Partial;\n\n /**\n * Continue a trace from `sentry-trace` and `baggage` values.\n * These values can be obtained from incoming request headers, or in the browser from ``\n * and `` HTML tags.\n *\n * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically\n * be attached to the incoming trace.\n *\n * Deprecation notice: In the next major version of the SDK the provided callback will not receive a transaction\n * context argument.\n */\n (\n {\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters[1];\n },\n // TODO(v8): Remove parameter from this callback.\n callback: (transactionContext: Partial) => V,\n ): V;\n}\n\nexport const continueTrace: ContinueTrace = (\n {\n sentryTrace,\n baggage,\n }: {\n // eslint-disable-next-line deprecation/deprecation\n sentryTrace: Parameters[0];\n // eslint-disable-next-line deprecation/deprecation\n baggage: Parameters[1];\n },\n callback?: (transactionContext: Partial) => V,\n): V | Partial => {\n // TODO(v8): Change this function so it doesn't do anything besides setting the propagation context on the current scope:\n /*\n return withScope((scope) => {\n const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n scope.setPropagationContext(propagationContext);\n return callback();\n })\n */\n\n const currentScope = getCurrentScope();\n\n // eslint-disable-next-line deprecation/deprecation\n const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n sentryTrace,\n baggage,\n );\n\n currentScope.setPropagationContext(propagationContext);\n\n if (DEBUG_BUILD && traceparentData) {\n logger.log(`[Tracing] Continuing trace ${traceparentData.traceId}.`);\n }\n\n const transactionContext: Partial = {\n ...traceparentData,\n metadata: dropUndefinedKeys({\n dynamicSamplingContext,\n }),\n };\n\n if (!callback) {\n return transactionContext;\n }\n\n return runWithAsyncContext(() => {\n return callback(transactionContext);\n });\n};\n\nfunction createChildSpanOrTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub,\n {\n parentSpan,\n spanContext,\n forceTransaction,\n scope,\n }: {\n parentSpan: Span | undefined;\n spanContext: TransactionContext;\n forceTransaction?: boolean;\n scope: Scope;\n },\n): Span | undefined {\n if (!hasTracingEnabled()) {\n return undefined;\n }\n\n const isolationScope = getIsolationScope();\n\n let span: Span | undefined;\n if (parentSpan && !forceTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n span = parentSpan.startChild(spanContext);\n } else if (parentSpan) {\n // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope\n const dsc = getDynamicSamplingContextFromSpan(parentSpan);\n const { traceId, spanId: parentSpanId } = parentSpan.spanContext();\n const sampled = spanIsSampled(parentSpan);\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n } else {\n const { traceId, dsc, parentSpanId, sampled } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n span = hub.startTransaction({\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...spanContext,\n metadata: {\n dynamicSamplingContext: dsc,\n // eslint-disable-next-line deprecation/deprecation\n ...spanContext.metadata,\n },\n });\n }\n\n // We always set this as active span on the scope\n // In the case of this being an inactive span, we ensure to pass a detached scope in here in the first place\n // But by having this here, we can ensure that the lookup through `getCapturedScopesOnSpan` results in the correct scope & span combo\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n\n setCapturedScopesOnSpan(span, scope, isolationScope);\n\n return span;\n}\n\n/**\n * This converts StartSpanOptions to TransactionContext.\n * For the most part (for now) we accept the same options,\n * but some of them need to be transformed.\n *\n * Eventually the StartSpanOptions will be more aligned with OpenTelemetry.\n */\nfunction normalizeContext(context: StartSpanOptions): TransactionContext {\n if (context.startTime) {\n const ctx: TransactionContext & { startTime?: SpanTimeInput } = { ...context };\n ctx.startTimestamp = spanTimeInputToSeconds(context.startTime);\n delete ctx.startTime;\n return ctx;\n }\n\n return context;\n}\n\nconst SCOPE_ON_START_SPAN_FIELD = '_sentryScope';\nconst ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope';\n\ntype SpanWithScopes = Span & {\n [SCOPE_ON_START_SPAN_FIELD]?: Scope;\n [ISOLATION_SCOPE_ON_START_SPAN_FIELD]?: Scope;\n};\n\nfunction setCapturedScopesOnSpan(span: Span | undefined, scope: Scope, isolationScope: Scope): void {\n if (span) {\n addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);\n addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);\n }\n}\n\n/**\n * Grabs the scope and isolation scope off a span that were active when the span was started.\n */\nexport function getCapturedScopesOnSpan(span: Span): { scope?: Scope; isolationScope?: Scope } {\n return {\n scope: (span as SpanWithScopes)[SCOPE_ON_START_SPAN_FIELD],\n isolationScope: (span as SpanWithScopes)[ISOLATION_SCOPE_ON_START_SPAN_FIELD],\n };\n}\n","import type {\n Context,\n Contexts,\n DynamicSamplingContext,\n MeasurementUnit,\n SpanTimeInput,\n Transaction as TransactionInterface,\n TransactionContext,\n TransactionEvent,\n TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { getMetricSummaryJsonForSpan } from '../metrics/metric-summary';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes';\nimport { spanTimeInputToSeconds, spanToJSON, spanToTraceContext } from '../utils/spanUtils';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';\nimport { Span as SpanClass, SpanRecorder } from './span';\nimport { getCapturedScopesOnSpan } from './trace';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n /**\n * The reference to the current hub.\n */\n // eslint-disable-next-line deprecation/deprecation\n public _hub: Hub;\n\n protected _name: string;\n\n private _contexts: Contexts;\n\n private _trimEnd?: boolean | undefined;\n\n // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.\n private _frozenDynamicSamplingContext: Readonly> | undefined;\n\n private _metadata: Partial;\n\n /**\n * This constructor should never be called manually. Those instrumenting tracing should use\n * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n * @internal\n * @hideconstructor\n * @hidden\n *\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n // eslint-disable-next-line deprecation/deprecation\n public constructor(transactionContext: TransactionContext, hub?: Hub) {\n super(transactionContext);\n this._contexts = {};\n\n // eslint-disable-next-line deprecation/deprecation\n this._hub = hub || getCurrentHub();\n\n this._name = transactionContext.name || '';\n\n this._metadata = {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.metadata,\n };\n\n this._trimEnd = transactionContext.trimEnd;\n\n // this is because transactions are also spans, and spans have a transaction pointer\n // TODO (v8): Replace this with another way to set the root span\n // eslint-disable-next-line deprecation/deprecation\n this.transaction = this;\n\n // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n const incomingDynamicSamplingContext = this._metadata.dynamicSamplingContext;\n if (incomingDynamicSamplingContext) {\n // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n }\n }\n\n // This sadly conflicts with the getter/setter ordering :(\n /* eslint-disable @typescript-eslint/member-ordering */\n\n /**\n * Getter for `name` property.\n * @deprecated Use `spanToJSON(span).description` instead.\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Setter for `name` property, which also sets `source` as custom.\n * @deprecated Use `updateName()` and `setMetadata()` instead.\n */\n public set name(newName: string) {\n // eslint-disable-next-line deprecation/deprecation\n this.setName(newName);\n }\n\n /**\n * Get the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public get metadata(): TransactionMetadata {\n // We merge attributes in for backwards compatibility\n return {\n // Defaults\n // eslint-disable-next-line deprecation/deprecation\n source: 'custom',\n spanMetadata: {},\n\n // Legacy metadata\n ...this._metadata,\n\n // From attributes\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && {\n source: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] as TransactionMetadata['source'],\n }),\n ...(this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] && {\n sampleRate: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] as TransactionMetadata['sampleRate'],\n }),\n };\n }\n\n /**\n * Update the metadata for this transaction.\n * @deprecated Use `spanGetMetadata(transaction)` instead.\n */\n public set metadata(metadata: TransactionMetadata) {\n this._metadata = metadata;\n }\n\n /* eslint-enable @typescript-eslint/member-ordering */\n\n /**\n * Setter for `name` property, which also sets `source` on the metadata.\n *\n * @deprecated Use `.updateName()` and `.setAttribute()` instead.\n */\n public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n this._name = name;\n this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n\n /** @inheritdoc */\n public updateName(name: string): this {\n this._name = name;\n return this;\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n public initSpanRecorder(maxlen: number = 1000): void {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Set the context of a transaction event.\n * @deprecated Use either `.setAttribute()`, or set the context on the scope before creating the transaction.\n */\n public setContext(key: string, context: Context | null): void {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top-level `setMeasurement()` instead.\n */\n public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n this._measurements[name] = { value, unit };\n }\n\n /**\n * Store metadata on this transaction.\n * @deprecated Use attributes or store data on the scope instead.\n */\n public setMetadata(newMetadata: Partial): void {\n this._metadata = { ...this._metadata, ...newMetadata };\n }\n\n /**\n * @inheritDoc\n */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const timestampInS = spanTimeInputToSeconds(endTimestamp);\n const transaction = this._finishTransaction(timestampInS);\n if (!transaction) {\n return undefined;\n }\n // eslint-disable-next-line deprecation/deprecation\n return this._hub.captureEvent(transaction);\n }\n\n /**\n * @inheritDoc\n */\n public toContext(): TransactionContext {\n // eslint-disable-next-line deprecation/deprecation\n const spanContext = super.toContext();\n\n return dropUndefinedKeys({\n ...spanContext,\n name: this._name,\n trimEnd: this._trimEnd,\n });\n }\n\n /**\n * @inheritDoc\n */\n public updateWithContext(transactionContext: TransactionContext): this {\n // eslint-disable-next-line deprecation/deprecation\n super.updateWithContext(transactionContext);\n\n this._name = transactionContext.name || '';\n this._trimEnd = transactionContext.trimEnd;\n\n return this;\n }\n\n /**\n * @inheritdoc\n *\n * @experimental\n *\n * @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.\n */\n public getDynamicSamplingContext(): Readonly> {\n return getDynamicSamplingContextFromSpan(this);\n }\n\n /**\n * Override the current hub with a new one.\n * Used if you want another hub to finish the transaction.\n *\n * @internal\n */\n // eslint-disable-next-line deprecation/deprecation\n public setHub(hub: Hub): void {\n this._hub = hub;\n }\n\n /**\n * Get the profile id of the transaction.\n */\n public getProfileId(): string | undefined {\n if (this._contexts !== undefined && this._contexts['profile'] !== undefined) {\n return this._contexts['profile'].profile_id as string;\n }\n return undefined;\n }\n\n /**\n * Finish the transaction & prepare the event to send to Sentry.\n */\n protected _finishTransaction(endTimestamp?: number): TransactionEvent | undefined {\n // This transaction is already finished, so we should not flush it again.\n if (this._endTime !== undefined) {\n return undefined;\n }\n\n if (!this._name) {\n DEBUG_BUILD && logger.warn('Transaction has no name, falling back to ``.');\n this._name = '';\n }\n\n // just sets the end timestamp\n super.end(endTimestamp);\n\n // eslint-disable-next-line deprecation/deprecation\n const client = this._hub.getClient();\n if (client && client.emit) {\n client.emit('finishTransaction', this);\n }\n\n if (this._sampled !== true) {\n // At this point if `sampled !== true` we want to discard the transaction.\n DEBUG_BUILD && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n if (client) {\n client.recordDroppedEvent('sample_rate', 'transaction');\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const finishedSpans = this.spanRecorder\n ? // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans.filter(span => span !== this && spanToJSON(span).timestamp)\n : [];\n\n if (this._trimEnd && finishedSpans.length > 0) {\n const endTimes = finishedSpans.map(span => spanToJSON(span).timestamp).filter(Boolean) as number[];\n this._endTime = endTimes.reduce((prev, current) => {\n return prev > current ? prev : current;\n });\n }\n\n const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);\n\n // eslint-disable-next-line deprecation/deprecation\n const { metadata } = this;\n // eslint-disable-next-line deprecation/deprecation\n const { source } = metadata;\n\n const transaction: TransactionEvent = {\n contexts: {\n ...this._contexts,\n // We don't want to override trace context\n trace: spanToTraceContext(this),\n },\n // TODO: Pass spans serialized via `spanToJSON()` here instead in v8.\n spans: finishedSpans,\n start_timestamp: this._startTime,\n // eslint-disable-next-line deprecation/deprecation\n tags: this.tags,\n timestamp: this._endTime,\n transaction: this._name,\n type: 'transaction',\n sdkProcessingMetadata: {\n ...metadata,\n capturedSpanScope,\n capturedSpanIsolationScope,\n ...dropUndefinedKeys({\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n }),\n },\n _metrics_summary: getMetricSummaryJsonForSpan(this),\n ...(source && {\n transaction_info: {\n source,\n },\n }),\n };\n\n const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n if (hasMeasurements) {\n DEBUG_BUILD &&\n logger.log(\n '[Measurements] Adding measurements to transaction',\n JSON.stringify(this._measurements, undefined, 2),\n );\n transaction.measurements = this._measurements;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n DEBUG_BUILD && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`);\n\n return transaction;\n }\n}\n","/* eslint-disable max-lines */\nimport type { SpanTimeInput, TransactionContext } from '@sentry/types';\nimport { logger, timestampInSeconds } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { spanTimeInputToSeconds, spanToJSON } from '../utils/spanUtils';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n idleTimeout: 1000,\n finalTimeout: 30000,\n heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n 'heartbeatFailed',\n 'idleTimeout',\n 'documentHidden',\n 'finalTimeout',\n 'externalFinish',\n 'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n public constructor(\n private readonly _pushActivity: (id: string) => void,\n private readonly _popActivity: (id: string) => void,\n public transactionSpanId: string,\n maxlen?: number,\n ) {\n super(maxlen);\n }\n\n /**\n * @inheritDoc\n */\n public add(span: Span): void {\n // We should make sure we do not push and pop activities for\n // the transaction that this span recorder belongs to.\n if (span.spanContext().spanId !== this.transactionSpanId) {\n // We patch span.end() to pop an activity after setting an endTimestamp.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalEnd = span.end;\n span.end = (...rest: unknown[]) => {\n this._popActivity(span.spanContext().spanId);\n return originalEnd.apply(span, rest);\n };\n\n // We should only push new activities if the span does not have an end timestamp.\n if (spanToJSON(span).timestamp === undefined) {\n this._pushActivity(span.spanContext().spanId);\n }\n }\n\n super.add(span);\n }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n // Activities store a list of active spans\n public activities: Record;\n // Track state of activities in previous heartbeat\n private _prevHeartbeatString: string | undefined;\n\n // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n private _heartbeatCounter: number;\n\n // We should not use heartbeat if we finished a transaction\n private _finished: boolean;\n\n // Idle timeout was canceled and we should finish the transaction with the last span end.\n private _idleTimeoutCanceledPermanently: boolean;\n\n private readonly _beforeFinishCallbacks: BeforeFinishCallback[];\n\n /**\n * Timer that tracks Transaction idleTimeout\n */\n private _idleTimeoutID: ReturnType | undefined;\n\n private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number];\n\n private _autoFinishAllowed: boolean;\n\n /**\n * @deprecated Transactions will be removed in v8. Use spans instead.\n */\n public constructor(\n transactionContext: TransactionContext,\n // eslint-disable-next-line deprecation/deprecation\n private readonly _idleHub: Hub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n private readonly _onScope: boolean = false,\n /**\n * When set to `true`, will disable the idle timeout (`_idleTimeout` option) and heartbeat mechanisms (`_heartbeatInterval`\n * option) until the `sendAutoFinishSignal()` method is called. The final timeout mechanism (`_finalTimeout` option)\n * will not be affected by this option, meaning the transaction will definitely be finished when the final timeout is\n * reached, no matter what this option is configured to.\n *\n * Defaults to `false`.\n */\n delayAutoFinishUntilSignal: boolean = false,\n ) {\n super(transactionContext, _idleHub);\n\n this.activities = {};\n this._heartbeatCounter = 0;\n this._finished = false;\n this._idleTimeoutCanceledPermanently = false;\n this._beforeFinishCallbacks = [];\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];\n this._autoFinishAllowed = !delayAutoFinishUntilSignal;\n\n if (_onScope) {\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n DEBUG_BUILD && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`);\n // eslint-disable-next-line deprecation/deprecation\n _idleHub.getScope().setSpan(this);\n }\n\n if (!delayAutoFinishUntilSignal) {\n this._restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n this.end();\n }\n }, this._finalTimeout);\n }\n\n /** {@inheritDoc} */\n public end(endTimestamp?: SpanTimeInput): string | undefined {\n const endTimestampInS = spanTimeInputToSeconds(endTimestamp);\n\n this._finished = true;\n this.activities = {};\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.op === 'ui.action.click') {\n this.setAttribute(FINISH_REASON_TAG, this._finishReason);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n if (this.spanRecorder) {\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestampInS * 1000).toISOString(), this.op);\n\n for (const callback of this._beforeFinishCallbacks) {\n callback(this, endTimestampInS);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n // If we are dealing with the transaction itself, we just return it\n if (span.spanContext().spanId === this.spanContext().spanId) {\n return true;\n }\n\n // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n if (!spanToJSON(span).timestamp) {\n span.setStatus('cancelled');\n span.end(endTimestampInS);\n DEBUG_BUILD &&\n logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n }\n\n const { start_timestamp: startTime, timestamp: endTime } = spanToJSON(span);\n const spanStartedBeforeTransactionFinish = startTime && startTime < endTimestampInS;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = endTime && startTime && endTime - startTime < timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(span, undefined, 2);\n if (!spanStartedBeforeTransactionFinish) {\n logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan);\n }\n }\n\n return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout;\n });\n\n DEBUG_BUILD && logger.log('[Tracing] flushing IdleTransaction');\n } else {\n DEBUG_BUILD && logger.log('[Tracing] No active IdleTransaction');\n }\n\n // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n if (this._onScope) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this._idleHub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n if (scope.getTransaction() === this) {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(undefined);\n }\n }\n\n return super.end(endTimestamp);\n }\n\n /**\n * Register a callback function that gets executed before the transaction finishes.\n * Useful for cleanup or if you want to add any additional spans based on current context.\n *\n * This is exposed because users have no other way of running something before an idle transaction\n * finishes.\n */\n public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n this._beforeFinishCallbacks.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public initSpanRecorder(maxlen?: number): void {\n // eslint-disable-next-line deprecation/deprecation\n if (!this.spanRecorder) {\n const pushActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._pushActivity(id);\n };\n const popActivity = (id: string): void => {\n if (this._finished) {\n return;\n }\n this._popActivity(id);\n };\n\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanContext().spanId, maxlen);\n\n // Start heartbeat so that transactions do not run forever.\n DEBUG_BUILD && logger.log('Starting heartbeat');\n this._pingHeartbeat();\n }\n // eslint-disable-next-line deprecation/deprecation\n this.spanRecorder.add(this);\n }\n\n /**\n * Cancels the existing idle timeout, if there is one.\n * @param restartOnChildSpanChange Default is `true`.\n * If set to false the transaction will end\n * with the last child span.\n */\n public cancelIdleTimeout(\n endTimestamp?: Parameters[0],\n {\n restartOnChildSpanChange,\n }: {\n restartOnChildSpanChange?: boolean;\n } = {\n restartOnChildSpanChange: true,\n },\n ): void {\n this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n if (this._idleTimeoutID) {\n clearTimeout(this._idleTimeoutID);\n this._idleTimeoutID = undefined;\n\n if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n }\n }\n\n /**\n * Temporary method used to externally set the transaction's `finishReason`\n *\n * ** WARNING**\n * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n *\n * @internal\n *\n */\n public setFinishReason(reason: string): void {\n this._finishReason = reason;\n }\n\n /**\n * Permits the IdleTransaction to automatically end itself via the idle timeout and heartbeat mechanisms when the `delayAutoFinishUntilSignal` option was set to `true`.\n */\n public sendAutoFinishSignal(): void {\n if (!this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Received finish signal for idle transaction.');\n this._restartIdleTimeout();\n this._autoFinishAllowed = true;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n private _restartIdleTimeout(endTimestamp?: Parameters[0]): void {\n this.cancelIdleTimeout();\n this._idleTimeoutID = setTimeout(() => {\n if (!this._finished && Object.keys(this.activities).length === 0) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n this.end(endTimestamp);\n }\n }, this._idleTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n private _pushActivity(spanId: string): void {\n this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n DEBUG_BUILD && logger.log(`[Tracing] pushActivity: ${spanId}`);\n this.activities[spanId] = true;\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n private _popActivity(spanId: string): void {\n if (this.activities[spanId]) {\n DEBUG_BUILD && logger.log(`[Tracing] popActivity ${spanId}`);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this.activities[spanId];\n DEBUG_BUILD && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n }\n\n if (Object.keys(this.activities).length === 0) {\n const endTimestamp = timestampInSeconds();\n if (this._idleTimeoutCanceledPermanently) {\n if (this._autoFinishAllowed) {\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n this.end(endTimestamp);\n }\n } else {\n // We need to add the timeout here to have the real endtimestamp of the transaction\n // Remember timestampInSeconds is in seconds, timeout is in ms\n this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n }\n }\n }\n\n /**\n * Checks when entries of this.activities are not changing for 3 beats.\n * If this occurs we finish the transaction.\n */\n private _beat(): void {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n if (this._autoFinishAllowed) {\n DEBUG_BUILD && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n this.end();\n }\n } else {\n this._pingHeartbeat();\n }\n }\n\n /**\n * Pings the heartbeat\n */\n private _pingHeartbeat(): void {\n DEBUG_BUILD && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n setTimeout(() => {\n this._beat();\n }, this._heartbeatInterval);\n }\n}\n","import type { Transaction } from '@sentry/types';\nimport { extractTraceparentData as _extractTraceparentData } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getActiveTransaction(maybeHub?: Hub): T | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const hub = maybeHub || getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const scope = hub.getScope();\n // eslint-disable-next-line deprecation/deprecation\n return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n *\n * @deprecated Import this function from `@sentry/utils` instead\n */\nexport const extractTraceparentData = _extractTraceparentData;\n","import {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n logger,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { SpanStatusType } from './spanstatus';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status: SpanStatusType = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n","import type { Options, SamplingContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { spanToJSON } from '../utils/spanUtils';\nimport type { Transaction } from './transaction';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nexport function sampleTransaction(\n transaction: T,\n options: Pick,\n samplingContext: SamplingContext,\n): T {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nexport function isValidSampleRate(rate: unknown): boolean {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n","import type { ClientOptions, CustomSamplingContext, TransactionContext } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { spanToTraceHeader } from '../utils/spanUtils';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { sampleTransaction } from './sampling';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n): Transaction {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options: Partial = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub,\n transactionContext: TransactionContext,\n idleTimeout: number,\n finalTimeout: number,\n onScope?: boolean,\n customSamplingContext?: CustomSamplingContext,\n heartbeatInterval?: number,\n delayAutoFinishUntilSignal: boolean = false,\n): IdleTransaction {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options: Partial = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n","import type { DsnComponents, SpanEnvelope, SpanItem } from '@sentry/types';\nimport type { Span } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Create envelope from Span item.\n */\nexport function createSpanEnvelope(spans: Span[], dsn?: DsnComponents): SpanEnvelope {\n const headers: SpanEnvelope[0] = {\n sent_at: new Date().toISOString(),\n };\n\n if (dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const items = spans.map(createSpanItem);\n return createEnvelope(headers, items);\n}\n\nfunction createSpanItem(span: Span): SpanItem {\n const spanHeaders: SpanItem[0] = {\n type: 'span',\n };\n return [spanHeaders, span];\n}\n","import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n *\n * Note: this will not be possible anymore in v8,\n * unless we do some special handling for browser here...\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n // eslint-disable-next-line deprecation/deprecation\n if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.startTimestamp = startTimestamp;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return transaction.startChild({\n startTimestamp,\n ...ctx,\n });\n}\n","/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport {\n Span,\n getActiveTransaction,\n getClient,\n hasTracingEnabled,\n isValidSampleRate,\n setMeasurement,\n} from '@sentry/core';\nimport type { ClientOptions, Measurements, SpanContext, TransactionContext } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, getComponentName, htmlTreeAsString, logger, parseUrl } from '@sentry/utils';\n\nimport { spanToJSON } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../common/debug-build';\nimport {\n addClsInstrumentationHandler,\n addFidInstrumentationHandler,\n addInpInstrumentationHandler,\n addLcpInstrumentationHandler,\n addPerformanceInstrumentationHandler,\n addTtfbInstrumentationHandler,\n} from '../instrument';\nimport { WINDOW } from '../types';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport type {\n InteractionRouteNameMapping,\n NavigatorDeviceMemory,\n NavigatorNetworkInformation,\n} from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\nimport { createSpanEnvelope } from '@sentry/core';\nimport { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry';\n\nconst MAX_INT_AS_BYTES = 2147483647;\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals.\n * The callback returned by this function can be used to stop tracking & ensure all measurements are final & captured.\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n const fidCallback = _trackFID();\n const clsCallback = _trackCLS();\n const lcpCallback = _trackLCP();\n const ttfbCallback = _trackTtfb();\n\n return (): void => {\n fidCallback();\n clsCallback();\n lcpCallback();\n ttfbCallback();\n };\n }\n\n return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n addPerformanceInstrumentationHandler('longtask', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild({\n description: 'Main UI thread blocked',\n op: 'ui.long-task',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n });\n }\n });\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n addPerformanceInstrumentationHandler('event', ({ entries }) => {\n for (const entry of entries) {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction() as IdleTransaction | undefined;\n if (!transaction) {\n return;\n }\n\n if (entry.name === 'click') {\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(entry.duration);\n\n const span: SpanContext = {\n description: htmlTreeAsString(entry.target),\n op: `ui.interaction.${entry.name}`,\n origin: 'auto.ui.browser.metrics',\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n };\n\n const componentName = getComponentName(entry.target);\n if (componentName) {\n span.attributes = { 'ui.component_name': componentName };\n }\n\n // eslint-disable-next-line deprecation/deprecation\n transaction.startChild(span);\n }\n }\n });\n}\n\n/**\n * Start tracking INP webvital events.\n */\nexport function startTrackingINP(\n interactionIdtoRouteNameMapping: InteractionRouteNameMapping,\n interactionsSampleRate: number,\n): () => void {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n const inpCallback = _trackINP(interactionIdtoRouteNameMapping, interactionsSampleRate);\n\n return (): void => {\n inpCallback();\n };\n }\n\n return () => undefined;\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): () => void {\n return addClsInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS');\n _measurements['cls'] = { value: metric.value, unit: '' };\n _clsEntry = entry as LayoutShift;\n }, true);\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): () => void {\n return addLcpInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP');\n _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n _lcpEntry = entry as LargestContentfulPaint;\n }, true);\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): () => void {\n return addFidInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n const startTime = msToSec(entry.startTime);\n DEBUG_BUILD && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}\n\nfunction _trackTtfb(): () => void {\n return addTtfbInstrumentationHandler(({ metric }) => {\n const entry = metric.entries[metric.entries.length - 1];\n if (!entry) {\n return;\n }\n\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');\n _measurements['ttfb'] = { value: metric.value, unit: 'millisecond' };\n });\n}\n\nconst INP_ENTRY_MAP: Record = {\n click: 'click',\n pointerdown: 'click',\n pointerup: 'click',\n mousedown: 'click',\n mouseup: 'click',\n touchstart: 'click',\n touchend: 'click',\n mouseover: 'hover',\n mouseout: 'hover',\n mouseenter: 'hover',\n mouseleave: 'hover',\n pointerover: 'hover',\n pointerout: 'hover',\n pointerenter: 'hover',\n pointerleave: 'hover',\n dragstart: 'drag',\n dragend: 'drag',\n drag: 'drag',\n dragenter: 'drag',\n dragleave: 'drag',\n dragover: 'drag',\n drop: 'drag',\n keydown: 'press',\n keyup: 'press',\n keypress: 'press',\n input: 'press',\n};\n\n/** Starts tracking the Interaction to Next Paint on the current page. */\nfunction _trackINP(\n interactionIdToRouteNameMapping: InteractionRouteNameMapping,\n interactionsSampleRate: number,\n): () => void {\n return addInpInstrumentationHandler(({ metric }) => {\n if (metric.value === undefined) {\n return;\n }\n const entry = metric.entries.find(\n entry => entry.duration === metric.value && INP_ENTRY_MAP[entry.name] !== undefined,\n );\n const client = getClient();\n if (!entry || !client) {\n return;\n }\n const interactionType = INP_ENTRY_MAP[entry.name];\n const options = client.getOptions();\n /** Build the INP span, create an envelope from the span, and then send the envelope */\n const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n const duration = msToSec(metric.value);\n const interaction =\n entry.interactionId !== undefined ? interactionIdToRouteNameMapping[entry.interactionId] : undefined;\n if (interaction === undefined) {\n return;\n }\n const { routeName, parentContext, activeTransaction, user, replayId } = interaction;\n const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const profileId = activeTransaction !== undefined ? activeTransaction.getProfileId() : undefined;\n const span = new Span({\n startTimestamp: startTime,\n endTimestamp: startTime + duration,\n op: `ui.interaction.${interactionType}`,\n name: htmlTreeAsString(entry.target),\n attributes: {\n release: options.release,\n environment: options.environment,\n transaction: routeName,\n ...(userDisplay !== undefined && userDisplay !== '' ? { user: userDisplay } : {}),\n ...(profileId !== undefined ? { profile_id: profileId } : {}),\n ...(replayId !== undefined ? { replay_id: replayId } : {}),\n },\n exclusiveTime: metric.value,\n measurements: {\n inp: { value: metric.value, unit: 'millisecond' },\n },\n });\n\n /** Check to see if the span should be sampled */\n const sampleRate = getSampleRate(parentContext, options, interactionsSampleRate);\n\n if (!sampleRate) {\n return;\n }\n\n if (Math.random() < (sampleRate as number | boolean)) {\n const envelope = span ? createSpanEnvelope([span], client.getDsn()) : undefined;\n const transport = client && client.getTransport();\n if (transport && envelope) {\n transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending interaction:', reason);\n });\n }\n return;\n }\n });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n const performance = getBrowserPerformanceAPI();\n if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n // Gatekeeper if performance API not available\n return;\n }\n\n DEBUG_BUILD && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n const performanceEntries = performance.getEntries();\n\n const { op, start_timestamp: transactionStartTime } = spanToJSON(transaction);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n performanceEntries.slice(_performanceCursor).forEach((entry: Record) => {\n const startTime = msToSec(entry.startTime);\n const duration = msToSec(entry.duration);\n\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.op === 'navigation' && transactionStartTime && timeOrigin + startTime < transactionStartTime) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation': {\n _addNavigationSpans(transaction, entry, timeOrigin);\n break;\n }\n case 'mark':\n case 'paint':\n case 'measure': {\n _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n // capture web vitals\n const firstHidden = getVisibilityWatcher();\n // Only report if the page wasn't hidden prior to the web vital.\n const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n if (entry.name === 'first-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FP');\n _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n if (entry.name === 'first-contentful-paint' && shouldRecord) {\n DEBUG_BUILD && logger.log('[Measurements] Adding FCP');\n _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n }\n break;\n }\n case 'resource': {\n _addResourceSpans(transaction, entry, entry.name as string, startTime, duration, timeOrigin);\n break;\n }\n default:\n // Ignore other entry types.\n }\n });\n\n _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n _trackNavigator(transaction);\n\n // Measurements are only available for pageload transactions\n if (op === 'pageload') {\n _addTtfbRequestTimeToMeasurements(_measurements);\n\n ['fcp', 'fp', 'lcp'].forEach(name => {\n if (!_measurements[name] || !transactionStartTime || timeOrigin >= transactionStartTime) {\n return;\n }\n // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n // to be adjusted to be relative to transaction.startTimestamp.\n const oldValue = _measurements[name].value;\n const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n // normalizedValue should be in milliseconds\n const normalizedValue = Math.abs((measurementTimestamp - transactionStartTime) * 1000);\n const delta = normalizedValue - oldValue;\n\n DEBUG_BUILD && logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n _measurements[name].value = normalizedValue;\n });\n\n const fidMark = _measurements['mark.fid'];\n if (fidMark && _measurements['fid']) {\n // create span for FID\n _startChild(transaction, {\n description: 'first input delay',\n endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n op: 'ui.action',\n origin: 'auto.ui.browser.metrics',\n startTimestamp: fidMark.value,\n });\n\n // Delete mark.fid as we don't want it to be part of final payload\n delete _measurements['mark.fid'];\n }\n\n // If FCP is not recorded we should not record the cls value\n // according to the new definition of CLS.\n if (!('fcp' in _measurements)) {\n delete _measurements.cls;\n }\n\n Object.keys(_measurements).forEach(measurementName => {\n setMeasurement(measurementName, _measurements[measurementName].value, _measurements[measurementName].unit);\n });\n\n _tagMetricInfo(transaction);\n }\n\n _lcpEntry = undefined;\n _clsEntry = undefined;\n _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): number {\n const measureStartTimestamp = timeOrigin + startTime;\n const measureEndTimestamp = measureStartTimestamp + duration;\n\n _startChild(transaction, {\n description: entry.name as string,\n endTimestamp: measureEndTimestamp,\n op: entry.entryType as string,\n origin: 'auto.resource.browser.metrics',\n startTimestamp: measureStartTimestamp,\n });\n\n return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record, timeOrigin: number): void {\n ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n });\n _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n transaction: Transaction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n entry: Record,\n event: string,\n timeOrigin: number,\n description?: string,\n eventEnd?: string,\n): void {\n const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n const start = entry[`${event}Start`] as number | undefined;\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: description || event,\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end),\n });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record, timeOrigin: number): void {\n if (entry.responseEnd) {\n // It is possible that we are collecting these metrics when the page hasn't finished loading yet, for example when the HTML slowly streams in.\n // In this case, ie. when the document request hasn't finished yet, `entry.responseEnd` will be 0.\n // In order not to produce faulty spans, where the end timestamp is before the start timestamp, we will only collect\n // these spans when the responseEnd value is available. The backend (Relay) would drop the entire transaction if it contained faulty spans.\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'request',\n startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n\n _startChild(transaction, {\n op: 'browser',\n origin: 'auto.browser.browser.metrics',\n description: 'response',\n startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n });\n }\n}\n\nexport interface ResourceEntry extends Record {\n initiatorType?: string;\n transferSize?: number;\n encodedBodySize?: number;\n decodedBodySize?: number;\n renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n transaction: Transaction,\n entry: ResourceEntry,\n resourceUrl: string,\n startTime: number,\n duration: number,\n timeOrigin: number,\n): void {\n // we already instrument based on fetch and xhr, so we don't need to\n // duplicate spans here.\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n return;\n }\n\n const parsedUrl = parseUrl(resourceUrl);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data: Record = {};\n setResourceEntrySizeData(data, entry, 'transferSize', 'http.response_transfer_size');\n setResourceEntrySizeData(data, entry, 'encodedBodySize', 'http.response_content_length');\n setResourceEntrySizeData(data, entry, 'decodedBodySize', 'http.decoded_response_content_length');\n\n if ('renderBlockingStatus' in entry) {\n data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n }\n if (parsedUrl.protocol) {\n data['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it.\n }\n\n if (parsedUrl.host) {\n data['server.address'] = parsedUrl.host;\n }\n\n data['url.same_origin'] = resourceUrl.includes(WINDOW.location.origin);\n\n const startTimestamp = timeOrigin + startTime;\n const endTimestamp = startTimestamp + duration;\n\n _startChild(transaction, {\n description: resourceUrl.replace(WINDOW.location.origin, ''),\n endTimestamp,\n op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n origin: 'auto.resource.browser.metrics',\n startTimestamp,\n data,\n });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n if (!navigator) {\n return;\n }\n\n // track network connectivity\n const connection = navigator.connection;\n if (connection) {\n if (connection.effectiveType) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('effectiveConnectionType', connection.effectiveType);\n }\n\n if (connection.type) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('connectionType', connection.type);\n }\n\n if (isMeasurementValue(connection.rtt)) {\n _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n }\n }\n\n if (isMeasurementValue(navigator.deviceMemory)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n }\n\n if (isMeasurementValue(navigator.hardwareConcurrency)) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n if (_lcpEntry) {\n DEBUG_BUILD && logger.log('[Measurements] Adding LCP Data');\n\n // Capture Properties of the LCP element that contributes to the LCP.\n\n if (_lcpEntry.element) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n }\n\n if (_lcpEntry.id) {\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.id', _lcpEntry.id);\n }\n\n if (_lcpEntry.url) {\n // Trim URL to the first 200 characters.\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n }\n\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag('lcp.size', _lcpEntry.size);\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n if (_clsEntry && _clsEntry.sources) {\n DEBUG_BUILD && logger.log('[Measurements] Adding CLS Data');\n _clsEntry.sources.forEach((source, index) =>\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n );\n }\n}\n\nfunction setResourceEntrySizeData(\n data: Record,\n entry: ResourceEntry,\n key: keyof Pick,\n dataKey: 'http.response_transfer_size' | 'http.response_content_length' | 'http.decoded_response_content_length',\n): void {\n const entryVal = entry[key];\n if (entryVal != null && entryVal < MAX_INT_AS_BYTES) {\n data[dataKey] = entryVal;\n }\n}\n\n/**\n * Add ttfb request time information to measurements.\n *\n * ttfb information is added via vendored web vitals library.\n */\nfunction _addTtfbRequestTimeToMeasurements(_measurements: Measurements): void {\n const navEntry = getNavigationEntry();\n if (!navEntry) {\n return;\n }\n\n const { responseStart, requestStart } = navEntry;\n\n if (requestStart <= responseStart) {\n DEBUG_BUILD && logger.log('[Measurements] Adding TTFB Request Time');\n _measurements['ttfb.requestTime'] = {\n value: responseStart - requestStart,\n unit: 'millisecond',\n };\n }\n}\n\n/** Taken from @sentry/core sampling.ts */\nfunction getSampleRate(\n transactionContext: TransactionContext | undefined,\n options: ClientOptions,\n interactionsSampleRate: number,\n): number | boolean {\n if (!hasTracingEnabled(options)) {\n return false;\n }\n let sampleRate;\n if (transactionContext !== undefined && typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler({\n transactionContext,\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n location: WINDOW.location,\n });\n } else if (transactionContext !== undefined && transactionContext.sampled !== undefined) {\n sampleRate = transactionContext.sampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n } else {\n sampleRate = 1;\n }\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding interaction span because of invalid sample rate.');\n return false;\n }\n if (sampleRate === true) {\n return interactionsSampleRate;\n } else if (sampleRate === false) {\n return 0;\n }\n return sampleRate * interactionsSampleRate;\n}\n","import type { MeasurementUnit } from '@sentry/types';\n\nimport { getActiveTransaction } from './utils';\n\n/**\n * Adds a measurement to the current active transaction.\n */\nexport function setMeasurement(name: string, value: number, unit: MeasurementUnit): void {\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction();\n if (transaction) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setMeasurement(name, value, unit);\n }\n}\n","import {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n getIsolationScope,\n hasTracingEnabled,\n setHttpStatus,\n spanToTraceHeader,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { Client, HandlerDataFetch, Scope, Span, SpanOrigin } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n isInstanceOf,\n parseUrl,\n} from '@sentry/utils';\n\ntype PolymorphicRequestHeaders =\n | Record\n | Array<[string, string]>\n // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n append: (key: string, value: string) => void;\n get: (key: string) => string | null | undefined;\n };\n\n/**\n * Create and track fetch request spans for usage in combination with `addInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record,\n spanOrigin: SpanOrigin = 'auto.http.browser',\n): Span | undefined {\n if (!hasTracingEnabled() || !handlerData.fetchData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);\n\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span) {\n endSpan(span, handlerData);\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n\n const { method, url } = handlerData.fetchData;\n\n const fullUrl = getFullURL(url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${method} ${url}`,\n onlyIfParent: true,\n attributes: {\n url,\n type: 'fetch',\n 'http.method': method,\n 'http.url': fullUrl,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n }\n\n if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n const request: string | Request = handlerData.args[0];\n\n // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n handlerData.args[1] = handlerData.args[1] || {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options: { [key: string]: any } = handlerData.args[1];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);\n }\n\n return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n client: Client,\n scope: Scope,\n options: {\n headers?:\n | {\n [key: string]: string[] | string | undefined;\n }\n | PolymorphicRequestHeaders;\n },\n requestSpan?: Span,\n): PolymorphicRequestHeaders | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const span = requestSpan || scope.getSpan();\n\n const isolationScope = getIsolationScope();\n\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n const headers =\n options.headers ||\n (typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : undefined);\n\n if (!headers) {\n return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n const newHeaders = new Headers(headers as Headers);\n\n newHeaders.append('sentry-trace', sentryTraceHeader);\n\n if (sentryBaggageHeader) {\n // If the same header is appended multiple times the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else if (Array.isArray(headers)) {\n const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n if (sentryBaggageHeader) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n }\n\n return newHeaders as PolymorphicRequestHeaders;\n } else {\n const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n const newBaggageHeaders: string[] = [];\n\n if (Array.isArray(existingBaggageHeader)) {\n newBaggageHeaders.push(...existingBaggageHeader);\n } else if (existingBaggageHeader) {\n newBaggageHeaders.push(existingBaggageHeader);\n }\n\n if (sentryBaggageHeader) {\n newBaggageHeaders.push(sentryBaggageHeader);\n }\n\n return {\n ...(headers as Exclude),\n 'sentry-trace': sentryTraceHeader,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n };\n }\n}\n\nfunction getFullURL(url: string): string | undefined {\n try {\n const parsed = new URL(url);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n\nfunction endSpan(span: Span, handlerData: HandlerDataFetch): void {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength =\n handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus('internal_error');\n }\n span.end();\n}\n","/* eslint-disable max-lines */\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n getClient,\n getCurrentScope,\n getDynamicSamplingContextFromClient,\n getDynamicSamplingContextFromSpan,\n getIsolationScope,\n hasTracingEnabled,\n setHttpStatus,\n spanToJSON,\n spanToTraceHeader,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, Span } from '@sentry/types';\nimport {\n BAGGAGE_HEADER_NAME,\n SENTRY_XHR_DATA_KEY,\n addFetchInstrumentationHandler,\n addXhrInstrumentationHandler,\n browserPerformanceTimeOrigin,\n dynamicSamplingContextToSentryBaggageHeader,\n generateSentryTraceHeader,\n parseUrl,\n stringMatchesSomePattern,\n} from '@sentry/utils';\n\nimport { instrumentFetchRequest } from '../common/fetch';\nimport { addPerformanceInstrumentationHandler } from './instrument';\nimport { WINDOW } from './types';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n /**\n * @deprecated Will be removed in v8.\n * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n * trace header attachment.\n */\n tracingOrigins: Array;\n\n /**\n * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n * headers attached.\n *\n * @deprecated Use the top-level `tracePropagationTargets` option in `Sentry.init` instead.\n * This option will be removed in v8.\n *\n * Default: ['localhost', /^\\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS}\n */\n tracePropagationTargets: Array;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * Default: true\n */\n enableHTTPTimings: boolean;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * Default: (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n traceFetch: true,\n traceXHR: true,\n enableHTTPTimings: true,\n // TODO (v8): Remove this property\n tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests */\nexport function instrumentOutgoingRequests(_options?: Partial): void {\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n } = {\n traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n ..._options,\n };\n\n const shouldCreateSpan =\n typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n // TODO(v8) Remove tracingOrigins here\n // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n // and we don't want to break the API. We can remove it in v8.\n const shouldAttachHeadersWithTargets = (url: string): boolean =>\n shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n const spans: Record = {};\n\n if (traceFetch) {\n addFetchInstrumentationHandler(handlerData => {\n const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n // We cannot use `window.location` in the generic fetch instrumentation,\n // but we need it for reliable `server.address` attribute.\n // so we extend this in here\n if (createdSpan) {\n const fullUrl = getFullURL(handlerData.fetchData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n createdSpan.setAttributes({\n 'http.url': fullUrl,\n 'server.address': host,\n });\n }\n\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n\n if (traceXHR) {\n addXhrInstrumentationHandler(handlerData => {\n const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n if (enableHTTPTimings && createdSpan) {\n addHTTPTimings(createdSpan);\n }\n });\n }\n}\n\nfunction isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n return (\n entry.entryType === 'resource' &&\n 'initiatorType' in entry &&\n typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span: Span): void {\n const { url } = spanToJSON(span).data || {};\n\n if (!url || typeof url !== 'string') {\n return;\n }\n\n const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {\n entries.forEach(entry => {\n if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n const spanData = resourceTimingEntryToSpanData(entry);\n spanData.forEach(data => span.setAttribute(...data));\n // In the next tick, clean this handler up\n // We have to wait here because otherwise this cleans itself up before it is fully done\n setTimeout(cleanup);\n }\n });\n });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nexport function extractNetworkProtocol(nextHopProtocol: string): { name: string; version: string } {\n let name = 'unknown';\n let version = 'unknown';\n let _name = '';\n for (const char of nextHopProtocol) {\n // http/1.1 etc.\n if (char === '/') {\n [name, version] = nextHopProtocol.split('/');\n break;\n }\n // h2, h3 etc.\n if (!isNaN(Number(char))) {\n name = _name === 'h' ? 'http' : _name;\n version = nextHopProtocol.split(_name)[1];\n break;\n }\n _name += char;\n }\n if (_name === nextHopProtocol) {\n // webrtc, ftp, etc.\n name = _name;\n }\n return { name, version };\n}\n\nfunction getAbsoluteTime(time: number = 0): number {\n return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming: PerformanceResourceTiming): [string, string | number][] {\n const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n const timingSpanData: [string, string | number][] = [];\n\n timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n if (!browserPerformanceTimeOrigin) {\n return timingSpanData;\n }\n return [\n ...timingSpanData,\n ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\n// eslint-disable-next-line complexity\nexport function xhrCallback(\n handlerData: HandlerDataXhr,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record,\n): Span | undefined {\n const xhr = handlerData.xhr;\n const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n if (!hasTracingEnabled() || !xhr || xhr.__sentry_own_request__ || !sentryXhrData) {\n return undefined;\n }\n\n const shouldCreateSpanResult = shouldCreateSpan(sentryXhrData.url);\n\n // check first if the request has finished and is tracked by an existing span which should now end\n if (handlerData.endTimestamp && shouldCreateSpanResult) {\n const spanId = xhr.__sentry_xhr_span_id__;\n if (!spanId) return;\n\n const span = spans[spanId];\n if (span && sentryXhrData.status_code !== undefined) {\n setHttpStatus(span, sentryXhrData.status_code);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n return undefined;\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n\n const fullUrl = getFullURL(sentryXhrData.url);\n const host = fullUrl ? parseUrl(fullUrl).host : undefined;\n\n const span = shouldCreateSpanResult\n ? startInactiveSpan({\n name: `${sentryXhrData.method} ${sentryXhrData.url}`,\n onlyIfParent: true,\n attributes: {\n type: 'xhr',\n 'http.method': sentryXhrData.method,\n 'http.url': fullUrl,\n url: sentryXhrData.url,\n 'server.address': host,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',\n },\n op: 'http.client',\n })\n : undefined;\n\n if (span) {\n xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;\n spans[xhr.__sentry_xhr_span_id__] = span;\n }\n\n const client = getClient();\n\n if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url) && client) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n }\n\n return span;\n}\n\nfunction setHeaderOnXhr(\n xhr: SentryWrappedXMLHttpRequest,\n sentryTraceHeader: string,\n sentryBaggageHeader: string | undefined,\n): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!('sentry-trace', sentryTraceHeader);\n if (sentryBaggageHeader) {\n // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n // We can therefore simply set a baggage header without checking what was there before\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n xhr.setRequestHeader!(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n }\n } catch (_) {\n // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n }\n}\n\nfunction getFullURL(url: string): string | undefined {\n try {\n // By adding a base URL to new URL(), this will also work for relative urls\n // If `url` is a full URL, the base URL is ignored anyhow\n const parsed = new URL(url, WINDOW.location.origin);\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n","/* eslint-disable max-lines */\nimport type { IdleTransaction } from '@sentry/core';\nimport { getActiveSpan, getClient, getCurrentScope } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n TRACING_DEFAULTS,\n addTracingExtensions,\n getActiveTransaction,\n spanToJSON,\n startIdleTransaction,\n} from '@sentry/core';\nimport type {\n Client,\n Integration,\n IntegrationFn,\n StartSpanOptions,\n Transaction,\n TransactionContext,\n TransactionSource,\n} from '@sentry/types';\nimport type { Span } from '@sentry/types';\nimport {\n addHistoryInstrumentationHandler,\n browserPerformanceTimeOrigin,\n getDomElement,\n logger,\n propagationContextFromHeaders,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport { addPerformanceInstrumentationHandler } from './instrument';\nimport {\n addPerformanceEntries,\n startTrackingINP,\n startTrackingInteractions,\n startTrackingLongTasks,\n startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { WINDOW } from './types';\nimport type { InteractionRouteNameMapping } from './web-vitals/types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n /**\n * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n * by a moment where there are no in-progress spans.\n *\n * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n * Time is in ms.\n *\n * Default: 1000\n */\n idleTimeout: number;\n\n /**\n * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n * will be finished.\n * Time is in ms.\n *\n * Default: 30000\n */\n finalTimeout: number;\n\n /**\n * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n * the transaction will be finished.\n * Time is in ms.\n *\n * Default: 5000\n */\n heartbeatInterval: number;\n\n /**\n * If a span should be created on page load.\n * If this is set to `false`, this integration will not start the default page load span.\n * Default: true\n */\n instrumentPageLoad: boolean;\n\n /**\n * If a span should be created on navigation (history change).\n * If this is set to `false`, this integration will not start the default navigation spans.\n * Default: true\n */\n instrumentNavigation: boolean;\n\n /**\n * Flag spans where tabs moved to background with \"cancelled\". Browser background tab timing is\n * not suited towards doing precise measurements of operations. By default, we recommend that this option\n * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n *\n * Default: true\n */\n markBackgroundSpan: boolean;\n\n /**\n * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n *\n * Default: true\n */\n enableLongTask: boolean;\n\n /**\n * If true, Sentry will capture INP web vitals as standalone spans .\n *\n * Default: false\n */\n enableInp: boolean;\n\n /**\n * Sample rate to determine interaction span sampling.\n * interactionsSampleRate is applied on top of the global tracesSampleRate.\n * ie a tracesSampleRate of 0.1 and interactionsSampleRate of 0.5 will result in a 0.05 sample rate for interactions.\n *\n * Default: 1\n */\n interactionsSampleRate: number;\n\n /**\n * _metricOptions allows the user to send options to change how metrics are collected.\n *\n * _metricOptions is currently experimental.\n *\n * Default: undefined\n */\n _metricOptions?: Partial<{\n /**\n * @deprecated This property no longer has any effect and will be removed in v8.\n */\n _reportAllChanges: boolean;\n }>;\n\n /**\n * _experiments allows the user to send options to define how this integration works.\n * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n *\n * TODO (v8): Remove enableLongTask\n *\n * Default: undefined\n */\n _experiments: Partial<{\n enableInteractions: boolean;\n }>;\n\n /**\n * A callback which is called before a span for a pageload or navigation is started.\n * It receives the options passed to `startSpan`, and expects to return an updated options object.\n */\n beforeStartSpan?: (options: StartSpanOptions) => StartSpanOptions;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n ...TRACING_DEFAULTS,\n instrumentNavigation: true,\n instrumentPageLoad: true,\n markBackgroundSpan: true,\n enableLongTask: true,\n enableInp: false,\n interactionsSampleRate: 1,\n _experiments: {},\n ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n *\n * We explicitly export the proper type here, as this has to be extended in some cases.\n */\nexport const browserTracingIntegration = ((_options: Partial = {}) => {\n const _hasSetTracePropagationTargets = DEBUG_BUILD\n ? !!(\n // eslint-disable-next-line deprecation/deprecation\n (_options.tracePropagationTargets || _options.tracingOrigins)\n )\n : false;\n\n addTracingExtensions();\n\n // TODO (v8): remove this block after tracingOrigins is removed\n // Set tracePropagationTargets to tracingOrigins if specified by the user\n // In case both are specified, tracePropagationTargets takes precedence\n // eslint-disable-next-line deprecation/deprecation\n if (!_options.tracePropagationTargets && _options.tracingOrigins) {\n // eslint-disable-next-line deprecation/deprecation\n _options.tracePropagationTargets = _options.tracingOrigins;\n }\n\n const options = {\n ...DEFAULT_BROWSER_TRACING_OPTIONS,\n ..._options,\n };\n\n const _collectWebVitals = startTrackingWebVitals();\n\n /** Stores a mapping of interactionIds from PerformanceEventTimings to the origin interaction path */\n const interactionIdToRouteNameMapping: InteractionRouteNameMapping = {};\n if (options.enableInp) {\n startTrackingINP(interactionIdToRouteNameMapping, options.interactionsSampleRate);\n }\n\n if (options.enableLongTask) {\n startTrackingLongTasks();\n }\n if (options._experiments.enableInteractions) {\n startTrackingInteractions();\n }\n\n const latestRoute: {\n name: string | undefined;\n context: TransactionContext | undefined;\n } = {\n name: undefined,\n context: undefined,\n };\n\n /** Create routing idle transaction. */\n function _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n const { beforeStartSpan, idleTimeout, finalTimeout, heartbeatInterval } = options;\n\n const isPageloadTransaction = context.op === 'pageload';\n\n let expandedContext: TransactionContext;\n if (isPageloadTransaction) {\n const sentryTrace = isPageloadTransaction ? getMetaContent('sentry-trace') : '';\n const baggage = isPageloadTransaction ? getMetaContent('baggage') : undefined;\n const { traceId, dsc, parentSpanId, sampled } = propagationContextFromHeaders(sentryTrace, baggage);\n expandedContext = {\n traceId,\n parentSpanId,\n parentSampled: sampled,\n ...context,\n metadata: {\n // eslint-disable-next-line deprecation/deprecation\n ...context.metadata,\n dynamicSamplingContext: dsc,\n },\n trimEnd: true,\n };\n } else {\n expandedContext = {\n trimEnd: true,\n ...context,\n };\n }\n\n const finalContext = beforeStartSpan ? beforeStartSpan(expandedContext) : expandedContext;\n\n // If `beforeStartSpan` set a custom name, record that fact\n // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata =\n finalContext.name !== expandedContext.name\n ? // eslint-disable-next-line deprecation/deprecation\n { ...finalContext.metadata, source: 'custom' }\n : // eslint-disable-next-line deprecation/deprecation\n finalContext.metadata;\n\n latestRoute.name = finalContext.name;\n latestRoute.context = finalContext;\n\n if (finalContext.sampled === false) {\n DEBUG_BUILD && logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n }\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n const { location } = WINDOW;\n\n const idleTransaction = startIdleTransaction(\n hub,\n finalContext,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n isPageloadTransaction, // should wait for finish signal if it's a pageload transaction\n );\n\n if (isPageloadTransaction && WINDOW.document) {\n WINDOW.document.addEventListener('readystatechange', () => {\n if (['interactive', 'complete'].includes(WINDOW.document!.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n });\n\n if (['interactive', 'complete'].includes(WINDOW.document.readyState)) {\n idleTransaction.sendAutoFinishSignal();\n }\n }\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n _collectWebVitals();\n addPerformanceEntries(transaction);\n });\n\n return idleTransaction as Transaction;\n }\n\n return {\n name: BROWSER_TRACING_INTEGRATION_ID,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setupOnce: () => {},\n afterAllSetup(client) {\n const clientOptions = client.getOptions();\n\n const { markBackgroundSpan, traceFetch, traceXHR, shouldCreateSpanForRequest, enableHTTPTimings, _experiments } =\n options;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via BrowserTracing option `tracePropagationTargets`\n // 3. via BrowserTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // BrowserTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n // This is done as it minimizes bundle size (we don't have to have undefined checks).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = clientOptionsTracePropagationTargets || options.tracePropagationTargets;\n if (DEBUG_BUILD && _hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) {\n logger.warn(\n '[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n let activeSpan: Span | undefined;\n let startingUrl: string | undefined = WINDOW.location && WINDOW.location.href;\n\n if (client.on) {\n client.on('startNavigationSpan', (context: StartSpanOptions) => {\n if (activeSpan) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current transaction with op: ${spanToJSON(activeSpan).op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeSpan.end();\n }\n activeSpan = _createRouteTransaction({\n op: 'navigation',\n ...context,\n });\n });\n\n client.on('startPageLoadSpan', (context: StartSpanOptions) => {\n if (activeSpan) {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing current transaction with op: ${spanToJSON(activeSpan).op}`);\n // If there's an open transaction on the scope, we need to finish it before creating an new one.\n activeSpan.end();\n }\n activeSpan = _createRouteTransaction({\n op: 'pageload',\n ...context,\n });\n });\n }\n\n if (options.instrumentPageLoad && client.emit && WINDOW.location) {\n const context: StartSpanOptions = {\n name: WINDOW.location.pathname,\n // pageload should always start at timeOrigin (and needs to be in s, not ms)\n startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n origin: 'auto.pageload.browser',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n };\n startBrowserTracingPageLoadSpan(client, context);\n }\n\n if (options.instrumentNavigation && client.emit && WINDOW.location) {\n addHistoryInstrumentationHandler(({ to, from }) => {\n /**\n * This early return is there to account for some cases where a navigation transaction starts right after\n * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n * create an uneccessary navigation transaction.\n *\n * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n * only be caused in certain development environments where the usage of a hot module reloader is causing\n * errors.\n */\n if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n startingUrl = undefined;\n return;\n }\n\n if (from !== to) {\n startingUrl = undefined;\n const context: StartSpanOptions = {\n name: WINDOW.location.pathname,\n origin: 'auto.navigation.browser',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n };\n\n startBrowserTracingNavigationSpan(client, context);\n }\n });\n }\n\n if (markBackgroundSpan) {\n registerBackgroundTabDetection();\n }\n\n if (_experiments.enableInteractions) {\n registerInteractionListener(options, latestRoute);\n }\n\n if (options.enableInp) {\n registerInpInteractionListener(interactionIdToRouteNameMapping, latestRoute);\n }\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n tracePropagationTargets,\n shouldCreateSpanForRequest,\n enableHTTPTimings,\n });\n },\n // TODO v8: Remove this again\n // This is private API that we use to fix converted BrowserTracing integrations in Next.js & SvelteKit\n options,\n };\n}) satisfies IntegrationFn;\n\n/**\n * Manually start a page load span.\n * This will only do something if the BrowserTracing integration has been setup.\n */\nexport function startBrowserTracingPageLoadSpan(client: Client, spanOptions: StartSpanOptions): Span | undefined {\n if (!client.emit) {\n return;\n }\n\n client.emit('startPageLoadSpan', spanOptions);\n\n const span = getActiveSpan();\n const op = span && spanToJSON(span).op;\n return op === 'pageload' ? span : undefined;\n}\n\n/**\n * Manually start a navigation span.\n * This will only do something if the BrowserTracing integration has been setup.\n */\nexport function startBrowserTracingNavigationSpan(client: Client, spanOptions: StartSpanOptions): Span | undefined {\n if (!client.emit) {\n return;\n }\n\n client.emit('startNavigationSpan', spanOptions);\n\n const span = getActiveSpan();\n const op = span && spanToJSON(span).op;\n return op === 'navigation' ? span : undefined;\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n // Can't specify generic to `getDomElement` because tracing can be used\n // in a variety of environments, have to disable `no-unsafe-member-access`\n // as a result.\n const metaTag = getDomElement(`meta[name=${metaName}]`);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n\n/** Start listener for interaction transactions */\nfunction registerInteractionListener(\n options: BrowserTracingOptions,\n latestRoute: {\n name: string | undefined;\n context: TransactionContext | undefined;\n },\n): void {\n let inflightInteractionTransaction: IdleTransaction | undefined;\n const registerInteractionTransaction = (): void => {\n const { idleTimeout, finalTimeout, heartbeatInterval } = options;\n const op = 'ui.action.click';\n\n // eslint-disable-next-line deprecation/deprecation\n const currentTransaction = getActiveTransaction();\n if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n );\n return undefined;\n }\n\n if (inflightInteractionTransaction) {\n inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n inflightInteractionTransaction.end();\n inflightInteractionTransaction = undefined;\n }\n\n if (!latestRoute.name) {\n DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n return undefined;\n }\n\n const { location } = WINDOW;\n\n const context: TransactionContext = {\n name: latestRoute.name,\n op,\n trimEnd: true,\n data: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.context ? getSource(latestRoute.context) : undefined || 'url',\n },\n };\n\n inflightInteractionTransaction = startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub(),\n context,\n idleTimeout,\n finalTimeout,\n true,\n { location }, // for use in the tracesSampler\n heartbeatInterval,\n );\n };\n\n ['click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n }\n });\n}\n\nfunction isPerformanceEventTiming(entry: PerformanceEntry): entry is PerformanceEventTiming {\n return 'duration' in entry;\n}\n\n/** We store up to 10 interaction candidates max to cap memory usage. This is the same cap as getINP from web-vitals */\nconst MAX_INTERACTIONS = 10;\n\n/** Creates a listener on interaction entries, and maps interactionIds to the origin path of the interaction */\nfunction registerInpInteractionListener(\n interactionIdToRouteNameMapping: InteractionRouteNameMapping,\n latestRoute: {\n name: string | undefined;\n context: TransactionContext | undefined;\n },\n): void {\n const handleEntries = ({ entries }: { entries: PerformanceEntry[] }): void => {\n const client = getClient();\n // We need to get the replay, user, and activeTransaction from the current scope\n // so that we can associate replay id, profile id, and a user display to the span\n const replay =\n client !== undefined && client.getIntegrationByName !== undefined\n ? (client.getIntegrationByName('Replay') as Integration & { getReplayId: () => string })\n : undefined;\n const replayId = replay !== undefined ? replay.getReplayId() : undefined;\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n const currentScope = getCurrentScope();\n const user = currentScope !== undefined ? currentScope.getUser() : undefined;\n entries.forEach(entry => {\n if (isPerformanceEventTiming(entry)) {\n const interactionId = entry.interactionId;\n if (interactionId === undefined) {\n return;\n }\n const existingInteraction = interactionIdToRouteNameMapping[interactionId];\n const duration = entry.duration;\n const startTime = entry.startTime;\n const keys = Object.keys(interactionIdToRouteNameMapping);\n const minInteractionId =\n keys.length > 0\n ? keys.reduce((a, b) => {\n return interactionIdToRouteNameMapping[a].duration < interactionIdToRouteNameMapping[b].duration\n ? a\n : b;\n })\n : undefined;\n // For a first input event to be considered, we must check that an interaction event does not already exist with the same duration and start time.\n // This is also checked in the web-vitals library.\n if (entry.entryType === 'first-input') {\n const matchingEntry = keys\n .map(key => interactionIdToRouteNameMapping[key])\n .some(interaction => {\n return interaction.duration === duration && interaction.startTime === startTime;\n });\n if (matchingEntry) {\n return;\n }\n }\n // Interactions with an id of 0 and are not first-input are not valid.\n if (!interactionId) {\n return;\n }\n // If the interaction already exists, we want to use the duration of the longest entry, since that is what the INP metric uses.\n if (existingInteraction) {\n existingInteraction.duration = Math.max(existingInteraction.duration, duration);\n } else if (\n keys.length < MAX_INTERACTIONS ||\n minInteractionId === undefined ||\n duration > interactionIdToRouteNameMapping[minInteractionId].duration\n ) {\n // If the interaction does not exist, we want to add it to the mapping if there is space, or if the duration is longer than the shortest entry.\n const routeName = latestRoute.name;\n const parentContext = latestRoute.context;\n if (routeName && parentContext) {\n if (minInteractionId && Object.keys(interactionIdToRouteNameMapping).length >= MAX_INTERACTIONS) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete interactionIdToRouteNameMapping[minInteractionId];\n }\n interactionIdToRouteNameMapping[interactionId] = {\n routeName,\n duration,\n parentContext,\n user,\n activeTransaction,\n replayId,\n startTime,\n };\n }\n }\n }\n });\n };\n addPerformanceInstrumentationHandler('event', handleEntries);\n addPerformanceInstrumentationHandler('first-input', handleEntries);\n}\n\nfunction getSource(context: TransactionContext): TransactionSource | undefined {\n const sourceFromAttributes = context.attributes && context.attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromData = context.data && context.data[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n // eslint-disable-next-line deprecation/deprecation\n const sourceFromMetadata = context.metadata && context.metadata.source;\n\n return sourceFromAttributes || sourceFromData || sourceFromMetadata;\n}\n","import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction, spanToJSON } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction() as IdleTransaction;\n if (WINDOW.document!.hidden && activeTransaction) {\n const statusType: SpanStatusType = 'cancelled';\n\n const { op, status } = spanToJSON(activeTransaction);\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${op}`);\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n activeTransaction.setStatus(statusType);\n }\n // TODO: Can we rewrite this to an attribute?\n // eslint-disable-next-line deprecation/deprecation\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.end();\n }\n });\n } else {\n DEBUG_BUILD && logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n callback: ReportCallback,\n metric: Metric,\n reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n let prevValue: number;\n let delta: number;\n return (forceReport?: boolean) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n callback(metric);\n }\n }\n }\n };\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n const navEntry = getNavigationEntry();\n let navigationType: Metric['navigationType'] = 'navigate';\n\n if (navEntry) {\n if ((WINDOW.document && WINDOW.document.prerendering) || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else {\n navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n }\n }\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good', // Will be updated if the value changes.\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n navigationType,\n };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n event: PerformanceEventTiming[];\n paint: PerformancePaintTiming[];\n 'layout-shift': LayoutShift[];\n 'largest-contentful-paint': LargestContentfulPaint[];\n 'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n resource: PerformanceResourceTiming[];\n longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = (\n type: K,\n callback: (entries: PerformanceEntryMap[K]) => void,\n opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n callback(list.getEntries() as PerformanceEntryMap[K]);\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) as PerformanceObserverInit,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (\n onReport: ReportCallback,\n options: { reportAllChanges?: boolean } = {},\n): StopListening | undefined => {\n const metric = initMetric('CLS', 0);\n let report: ReturnType;\n\n let sessionValue = 0;\n let sessionEntries: PerformanceEntry[] = [];\n\n // const handleEntries = (entries: Metric['entries']) => {\n const handleEntries = (entries: LayoutShift[]): void => {\n entries.forEach(entry => {\n // Only count layout shifts without recent user input.\n if (!entry.hadRecentInput) {\n const firstSessionEntry = sessionEntries[0];\n const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry and\n // less than 5 seconds after the first entry in the session, include the\n // entry in the current session. Otherwise, start a new session.\n if (\n sessionValue &&\n sessionEntries.length !== 0 &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n sessionValue += entry.value;\n sessionEntries.push(entry);\n } else {\n sessionValue = entry.value;\n sessionEntries = [entry];\n }\n\n // If the current session value is larger than the current CLS value,\n // update CLS and the entries contributing to it.\n if (sessionValue > metric.value) {\n metric.value = sessionValue;\n metric.entries = sessionEntries;\n if (report) {\n report();\n }\n }\n }\n });\n };\n\n const po = observe('layout-shift', handleEntries);\n if (po) {\n report = bindReporter(onReport, metric, options.reportAllChanges);\n\n const stopListening = (): void => {\n handleEntries(po.takeRecords() as CLSMetric['entries']);\n report(true);\n };\n\n onHidden(stopListening);\n\n return stopListening;\n }\n\n return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('FID');\n // eslint-disable-next-line prefer-const\n let report: ReturnType;\n\n const handleEntry = (entry: PerformanceEventTiming): void => {\n // Only report if the page wasn't hidden prior to the first input.\n if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n metric.value = entry.processingStart - entry.startTime;\n metric.entries.push(entry);\n report(true);\n }\n };\n\n const handleEntries = (entries: FIDMetric['entries']): void => {\n (entries as PerformanceEventTiming[]).forEach(handleEntry);\n };\n\n const po = observe('first-input', handleEntries);\n report = bindReporter(onReport, metric);\n\n if (po) {\n onHidden(() => {\n handleEntries(po.takeRecords() as FIDMetric['entries']);\n po.disconnect();\n }, true);\n }\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric } from '../../types';\nimport { observe } from '../observe';\n\ndeclare global {\n interface Performance {\n interactionCount: number;\n }\n}\n\nlet interactionCountEstimate = 0;\nlet minKnownInteractionId = Infinity;\nlet maxKnownInteractionId = 0;\n\nconst updateEstimate = (entries: Metric['entries']): void => {\n (entries as PerformanceEventTiming[]).forEach(e => {\n if (e.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, e.interactionId);\n maxKnownInteractionId = Math.max(maxKnownInteractionId, e.interactionId);\n\n interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0;\n }\n });\n};\n\nlet po: PerformanceObserver | undefined;\n\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nexport const getInteractionCount = (): number => {\n return po ? interactionCountEstimate : performance.interactionCount || 0;\n};\n\n/**\n * Feature detects native support or initializes the polyfill if needed.\n */\nexport const initInteractionCountPolyfill = (): void => {\n if ('interactionCount' in performance || po) return;\n\n po = observe('event', updateEstimate, {\n type: 'event',\n buffered: true,\n durationThreshold: 0,\n } as PerformanceObserverInit);\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport { getInteractionCount, initInteractionCountPolyfill } from './lib/polyfills/interactionCountPolyfill';\nimport type { ReportCallback, ReportOpts } from './types';\nimport type { INPMetric } from './types/inp';\n\ninterface Interaction {\n id: number;\n latency: number;\n entries: PerformanceEventTiming[];\n}\n\n/**\n * Returns the interaction count since the last bfcache restore (or for the\n * full page lifecycle if there were no bfcache restores).\n */\nconst getInteractionCountForNavigation = (): number => {\n return getInteractionCount();\n};\n\n// To prevent unnecessary memory usage on pages with lots of interactions,\n// store at most 10 of the longest interactions to consider as INP candidates.\nconst MAX_INTERACTIONS_TO_CONSIDER = 10;\n\n// A list of longest interactions on the page (by latency) sorted so the\n// longest one is first. The list is as most MAX_INTERACTIONS_TO_CONSIDER long.\nconst longestInteractionList: Interaction[] = [];\n\n// A mapping of longest interactions by their interaction ID.\n// This is used for faster lookup.\nconst longestInteractionMap: { [interactionId: string]: Interaction } = {};\n\n/**\n * Takes a performance entry and adds it to the list of worst interactions\n * if its duration is long enough to make it among the worst. If the\n * entry is part of an existing interaction, it is merged and the latency\n * and entries list is updated as needed.\n */\nconst processEntry = (entry: PerformanceEventTiming): void => {\n // The least-long of the 10 longest interactions.\n const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1];\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const existingInteraction = longestInteractionMap[entry.interactionId!];\n\n // Only process the entry if it's possibly one of the ten longest,\n // or if it's part of an existing interaction.\n if (\n existingInteraction ||\n longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||\n entry.duration > minLongestInteraction.latency\n ) {\n // If the interaction already exists, update it. Otherwise create one.\n if (existingInteraction) {\n existingInteraction.entries.push(entry);\n existingInteraction.latency = Math.max(existingInteraction.latency, entry.duration);\n } else {\n const interaction = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n id: entry.interactionId!,\n latency: entry.duration,\n entries: [entry],\n };\n longestInteractionMap[interaction.id] = interaction;\n longestInteractionList.push(interaction);\n }\n\n // Sort the entries by latency (descending) and keep only the top ten.\n longestInteractionList.sort((a, b) => b.latency - a.latency);\n longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach(i => {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete longestInteractionMap[i.id];\n });\n }\n};\n\n/**\n * Returns the estimated p98 longest interaction based on the stored\n * interaction candidates and the interaction count for the current page.\n */\nconst estimateP98LongestInteraction = (): Interaction => {\n const candidateInteractionIndex = Math.min(\n longestInteractionList.length - 1,\n Math.floor(getInteractionCountForNavigation() / 50),\n );\n\n return longestInteractionList[candidateInteractionIndex];\n};\n\n/**\n * Calculates the [INP](https://web.dev/responsiveness/) value for the current\n * page and calls the `callback` function once the value is ready, along with\n * the `event` performance entries reported for that interaction. The reported\n * value is a `DOMHighResTimeStamp`.\n *\n * A custom `durationThreshold` configuration option can optionally be passed to\n * control what `event-timing` entries are considered for INP reporting. The\n * default threshold is `40`, which means INP scores of less than 40 are\n * reported as 0. Note that this will not affect your 75th percentile INP value\n * unless that value is also less than 40 (well below the recommended\n * [good](https://web.dev/inp/#what-is-a-good-inp-score) threshold).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** INP should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onINP = (onReport: ReportCallback, opts?: ReportOpts): void => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/inp/#what's-a-%22good%22-inp-value\n // const thresholds = [200, 500];\n\n // TODO(philipwalton): remove once the polyfill is no longer needed.\n initInteractionCountPolyfill();\n\n const metric = initMetric('INP');\n // eslint-disable-next-line prefer-const\n let report: ReturnType;\n\n const handleEntries = (entries: INPMetric['entries']): void => {\n entries.forEach(entry => {\n if (entry.interactionId) {\n processEntry(entry);\n }\n\n // Entries of type `first-input` don't currently have an `interactionId`,\n // so to consider them in INP we have to first check that an existing\n // entry doesn't match the `duration` and `startTime`.\n // Note that this logic assumes that `event` entries are dispatched\n // before `first-input` entries. This is true in Chrome but it is not\n // true in Firefox; however, Firefox doesn't support interactionId, so\n // it's not an issue at the moment.\n // TODO(philipwalton): remove once crbug.com/1325826 is fixed.\n if (entry.entryType === 'first-input') {\n const noMatchingEntry = !longestInteractionList.some(interaction => {\n return interaction.entries.some(prevEntry => {\n return entry.duration === prevEntry.duration && entry.startTime === prevEntry.startTime;\n });\n });\n if (noMatchingEntry) {\n processEntry(entry);\n }\n }\n });\n\n const inp = estimateP98LongestInteraction();\n\n if (inp && inp.latency !== metric.value) {\n metric.value = inp.latency;\n metric.entries = inp.entries;\n report();\n }\n };\n\n const po = observe('event', handleEntries, {\n // Event Timing entries have their durations rounded to the nearest 8ms,\n // so a duration of 40ms would be any event that spans 2.5 or more frames\n // at 60Hz. This threshold is chosen to strike a balance between usefulness\n // and performance. Running this callback for any interaction that spans\n // just one or two frames is likely not worth the insight that could be\n // gained.\n durationThreshold: opts.durationThreshold || 40,\n } as PerformanceObserverInit);\n\n report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n if (po) {\n // Also observe entries of type `first-input`. This is useful in cases\n // where the first interaction is less than the `durationThreshold`.\n po.observe({ type: 'first-input', buffered: true });\n\n onHidden(() => {\n handleEntries(po.takeRecords() as INPMetric['entries']);\n\n // If the interaction count shows that there were interactions but\n // none were captured by the PerformanceObserver, report a latency of 0.\n if (metric.value < 0 && getInteractionCountForNavigation() > 0) {\n metric.value = 0;\n metric.entries = [];\n }\n\n report(true);\n });\n }\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../types';\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report: ReturnType;\n\n const handleEntries = (entries: LCPMetric['entries']): void => {\n const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n if (lastEntry) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered.\n const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n // Only report if the page wasn't hidden prior to LCP.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = (): void => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() as LCPMetric['entries']);\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, stopListening, { once: true, capture: true });\n }\n });\n\n onHidden(stopListening, true);\n\n return stopListening;\n }\n\n return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../types';\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getNavigationEntry } from './lib/getNavigationEntry';\nimport { initMetric } from './lib/initMetric';\nimport type { ReportCallback, ReportOpts } from './types';\nimport type { TTFBMetric } from './types/ttfb';\n\n/**\n * Runs in the next task after the page is done loading and/or prerendering.\n * @param callback\n */\nconst whenReady = (callback: () => void): void => {\n if (!WINDOW.document) {\n return;\n }\n\n if (WINDOW.document.prerendering) {\n addEventListener('prerenderingchange', () => whenReady(callback), true);\n } else if (WINDOW.document.readyState !== 'complete') {\n addEventListener('load', () => whenReady(callback), true);\n } else {\n // Queue a task so the callback runs after `loadEventEnd`.\n setTimeout(callback, 0);\n }\n};\n\n/**\n * Calculates the [TTFB](https://web.dev/time-to-first-byte/) value for the\n * current page and calls the `callback` function once the page has loaded,\n * along with the relevant `navigation` performance entry used to determine the\n * value. The reported value is a `DOMHighResTimeStamp`.\n *\n * Note, this function waits until after the page is loaded to call `callback`\n * in order to ensure all properties of the `navigation` entry are populated.\n * This is useful if you want to report on other metrics exposed by the\n * [Navigation Timing API](https://w3c.github.io/navigation-timing/). For\n * example, the TTFB metric starts from the page's [time\n * origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it\n * includes time spent on DNS lookup, connection negotiation, network latency,\n * and server processing time.\n */\nexport const onTTFB = (onReport: ReportCallback, opts?: ReportOpts): void => {\n // Set defaults\n // eslint-disable-next-line no-param-reassign\n opts = opts || {};\n\n // https://web.dev/ttfb/#what-is-a-good-ttfb-score\n // const thresholds = [800, 1800];\n\n const metric = initMetric('TTFB');\n const report = bindReporter(onReport, metric, opts.reportAllChanges);\n\n whenReady(() => {\n const navEntry = getNavigationEntry() as TTFBMetric['entries'][number];\n\n if (navEntry) {\n // The activationStart reference is used because TTFB should be\n // relative to page activation rather than navigation start if the\n // page was prerendered. But in cases where `activationStart` occurs\n // after the first byte is received, this time should be clamped at 0.\n metric.value = Math.max(navEntry.responseStart - getActivationStart(), 0);\n\n // In some cases the value reported is negative or is larger\n // than the current page time. Ignore these cases:\n // https://github.com/GoogleChrome/web-vitals/issues/137\n // https://github.com/GoogleChrome/web-vitals/issues/162\n if (metric.value < 0 || metric.value > performance.now()) return;\n\n metric.entries = [navEntry];\n\n report(true);\n }\n });\n};\n","import { getFunctionName, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { onCLS } from './web-vitals/getCLS';\nimport { onFID } from './web-vitals/getFID';\nimport { onINP } from './web-vitals/getINP';\nimport { onLCP } from './web-vitals/getLCP';\nimport { observe } from './web-vitals/lib/observe';\nimport { onTTFB } from './web-vitals/onTTFB';\n\ntype InstrumentHandlerTypePerformanceObserver =\n | 'longtask'\n | 'event'\n | 'navigation'\n | 'paint'\n | 'resource'\n | 'first-input';\n\ntype InstrumentHandlerTypeMetric = 'cls' | 'lcp' | 'fid' | 'ttfb' | 'inp';\n\n// We provide this here manually instead of relying on a global, as this is not available in non-browser environements\n// And we do not want to expose such types\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): Record;\n}\ninterface PerformanceEventTiming extends PerformanceEntry {\n processingStart: number;\n processingEnd: number;\n duration: number;\n cancelable?: boolean;\n target?: unknown | null;\n interactionId?: number;\n}\n\ninterface Metric {\n /**\n * The name of the metric (in acronym form).\n */\n name: 'CLS' | 'FCP' | 'FID' | 'INP' | 'LCP' | 'TTFB';\n\n /**\n * The current value of the metric.\n */\n value: number;\n\n /**\n * The rating as to whether the metric value is within the \"good\",\n * \"needs improvement\", or \"poor\" thresholds of the metric.\n */\n rating: 'good' | 'needs-improvement' | 'poor';\n\n /**\n * The delta between the current value and the last-reported value.\n * On the first report, `delta` and `value` will always be the same.\n */\n delta: number;\n\n /**\n * A unique ID representing this particular metric instance. This ID can\n * be used by an analytics tool to dedupe multiple values sent for the same\n * metric instance, or to group multiple deltas together and calculate a\n * total. It can also be used to differentiate multiple different metric\n * instances sent from the same page, which can happen if the page is\n * restored from the back/forward cache (in that case new metrics object\n * get created).\n */\n id: string;\n\n /**\n * Any performance entries relevant to the metric value calculation.\n * The array may also be empty if the metric value was not based on any\n * entries (e.g. a CLS value of 0 given no layout shifts).\n */\n entries: PerformanceEntry[];\n\n /**\n * The type of navigation\n *\n * Navigation Timing API (or `undefined` if the browser doesn't\n * support that API). For pages that are restored from the bfcache, this\n * value will be 'back-forward-cache'.\n */\n navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender';\n}\n\ntype InstrumentHandlerType = InstrumentHandlerTypeMetric | InstrumentHandlerTypePerformanceObserver;\n\ntype StopListening = undefined | void | (() => void);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InstrumentHandlerCallback = (data: any) => void;\n\ntype CleanupHandlerCallback = () => void;\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\nlet _previousCls: Metric | undefined;\nlet _previousFid: Metric | undefined;\nlet _previousLcp: Metric | undefined;\nlet _previousTtfb: Metric | undefined;\nlet _previousInp: Metric | undefined;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.\n * This will lead to the CLS being finalized and frozen.\n */\nexport function addClsInstrumentationHandler(\n callback: (data: { metric: Metric }) => void,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.\n * This will lead to the LCP being finalized and frozen.\n */\nexport function addLcpInstrumentationHandler(\n callback: (data: { metric: Metric }) => void,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n */\nexport function addTtfbInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addFidInstrumentationHandler(callback: (data: { metric: Metric }) => void): CleanupHandlerCallback {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\n/**\n * Add a callback that will be triggered when a INP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addInpInstrumentationHandler(\n callback: (data: { metric: Omit & { entries: PerformanceEventTiming[] } }) => void,\n): CleanupHandlerCallback {\n return addMetricObserver('inp', callback, instrumentInp, _previousInp);\n}\n\nexport function addPerformanceInstrumentationHandler(\n type: 'event' | 'first-input',\n callback: (data: { entries: ((PerformanceEntry & { target?: unknown | null }) | PerformanceEventTiming)[] }) => void,\n): CleanupHandlerCallback;\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback;\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nexport function addPerformanceInstrumentationHandler(\n type: InstrumentHandlerTypePerformanceObserver,\n callback: (data: { entries: PerformanceEntry[] }) => void,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls(): StopListening {\n return onCLS(\n metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n },\n { reportAllChanges: true },\n );\n}\n\nfunction instrumentFid(): void {\n return onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp(): StopListening {\n return onLCP(metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n });\n}\n\nfunction instrumentTtfb(): StopListening {\n return onTTFB(metric => {\n triggerHandlers('ttfb', {\n metric,\n });\n _previousTtfb = metric;\n });\n}\n\nfunction instrumentInp(): void {\n return onINP(metric => {\n triggerHandlers('inp', {\n metric,\n });\n _previousInp = metric;\n });\n}\n\nfunction addMetricObserver(\n type: InstrumentHandlerTypeMetric,\n callback: InstrumentHandlerCallback,\n instrumentFn: () => StopListening,\n previousValue: Metric | undefined,\n stopOnCallback = false,\n): CleanupHandlerCallback {\n addHandler(type, callback);\n\n let stopListening: StopListening | undefined;\n\n if (!instrumented[type]) {\n stopListening = instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined);\n}\n\nfunction instrumentPerformanceObserver(type: InstrumentHandlerTypePerformanceObserver): void {\n const options: PerformanceObserverInit = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(\n type: InstrumentHandlerType,\n callback: InstrumentHandlerCallback,\n stopListening: StopListening,\n): CleanupHandlerCallback {\n return () => {\n if (stopListening) {\n stopListening();\n }\n\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ &\n // document is not available in all browser environments (webworkers). We make it optional so you have to explicitly check for it\n Omit &\n Partial>;\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n // eslint-disable-next-line deprecation/deprecation\n const timing = WINDOW.performance.timing;\n // eslint-disable-next-line deprecation/deprecation\n const type = WINDOW.performance.navigation.type;\n\n const navigationEntry: { [key: string]: number | string } = {\n entryType: 'navigation',\n startTime: 0,\n type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n };\n\n for (const key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n // eslint-disable-next-line deprecation/deprecation\n navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n }\n }\n return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n if (WINDOW.__WEB_VITALS_POLYFILL__) {\n return (\n WINDOW.performance &&\n ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n getNavigationEntryFromPerformanceTiming())\n );\n } else {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n }\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): void => {\n // If the document is hidden and not prerendering, assume it was always\n // hidden and the page was loaded in the background.\n if (WINDOW.document && WINDOW.document.visibilityState) {\n firstHiddenTime = WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n }\n};\n\nconst trackChanges = (): void => {\n // Update the time if/when the document becomes hidden.\n onHidden(({ timeStamp }) => {\n firstHiddenTime = timeStamp;\n }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n readonly firstHiddenTime: number;\n} => {\n if (firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n initHiddenTime();\n trackChanges();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n const onHiddenOrPageHide = (event: Event): void => {\n if (event.type === 'pagehide' || WINDOW.document!.visibilityState === 'hidden') {\n cb(event);\n if (once) {\n removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n removeEventListener('pagehide', onHiddenOrPageHide, true);\n }\n }\n };\n\n if (WINDOW.document) {\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n }\n};\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n dsn: DsnComponents,\n // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n // options: ClientOptions = {} as ClientOptions,\n tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n // TODO (v8): Use this code instead\n // const { tunnel, _metadata = {} } = options;\n // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n const sdkInfo =\n typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n dsnLike: DsnLike,\n dialogOptions: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n user?: { name?: string; email?: string };\n },\n): string {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n","import type { DsnComponents, MetricBucketItem, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\nimport { serializeMetricBuckets } from './utils';\n\n/**\n * Create envelope from a metric aggregate.\n */\nexport function createMetricEnvelope(\n metricBucketItems: Array,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): StatsdEnvelope {\n const headers: StatsdEnvelope[0] = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const item = createMetricEnvelopeItem(metricBucketItems);\n return createEnvelope(headers, [item]);\n}\n\nfunction createMetricEnvelopeItem(metricBucketItems: MetricBucketItem[]): StatsdItem {\n const payload = serializeMetricBuckets(metricBucketItems);\n const metricHeaders: StatsdItem[0] = {\n type: 'statsd',\n length: payload.length,\n };\n return [metricHeaders, payload];\n}\n","import type { MeasurementUnit, MetricBucketItem, Primitive } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport type { MetricType } from './types';\n\n/**\n * Generate bucket key from metric properties.\n */\nexport function getBucketKey(\n metricType: MetricType,\n name: string,\n unit: MeasurementUnit,\n tags: Record,\n): string {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nexport function simpleHash(s: string): number {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nexport function serializeMetricBuckets(metricBucketItems: MetricBucketItem[]): string {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nexport function sanitizeUnit(unit: string): string {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nexport function sanitizeMetricKey(key: string): string {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key: string): string {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements: [string, string][] = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input: string): string {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value: string): string {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nexport function sanitizeTags(unsanitizedTags: Record): Record {\n const tags: Record = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n","/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n ClientOptions,\n DataCategory,\n DsnComponents,\n DynamicSamplingContext,\n Envelope,\n ErrorEvent,\n Event,\n EventDropReason,\n EventHint,\n EventProcessor,\n FeedbackEvent,\n Integration,\n IntegrationClass,\n MetricBucketItem,\n MetricsAggregator,\n Outcome,\n ParameterizedString,\n SdkMetadata,\n Session,\n SessionAggregates,\n Severity,\n SeverityLevel,\n StartSpanOptions,\n Transaction,\n TransactionEvent,\n Transport,\n TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n SentryError,\n SyncPromise,\n addItemToEnvelope,\n checkOrSetAlreadyCaught,\n createAttachmentEnvelopeItem,\n isParameterizedString,\n isPlainObject,\n isPrimitive,\n isThenable,\n logger,\n makeDsn,\n rejectedSyncPromise,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { DEBUG_BUILD } from './debug-build';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport { getClient } from './exports';\nimport { getIsolationScope } from './hub';\nimport type { IntegrationIndex } from './integration';\nimport { afterSetupIntegrations } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport { createMetricEnvelope } from './metrics/envelope';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nexport abstract class BaseClient implements Client {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n public metricsAggregator?: MetricsAggregator;\n\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n protected readonly _dsn?: DsnComponents;\n\n protected readonly _transport?: Transport;\n\n /** Array of set up integrations. */\n protected _integrations: IntegrationIndex;\n\n /** Indicates whether this client's integrations have been set up. */\n protected _integrationsInitialized: boolean;\n\n /** Number of calls being processed */\n protected _numProcessing: number;\n\n protected _eventProcessors: EventProcessor[];\n\n /** Holds flushable */\n private _outcomes: { [key: string]: number };\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n private _hooks: Record;\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n protected constructor(options: O) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n tunnel: this._options.tunnel,\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n scope?: Scope,\n ): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId: string | undefined = hint && hint.event_id;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope: Scope | undefined = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(\n this._captureEvent(event, hint, capturedSpanScope || scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureSession(session: Session): void {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n public getDsn(): DsnComponents | undefined {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n public getOptions(): O {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n public getSdkMetadata(): SdkMetadata | undefined {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n public getTransport(): Transport | undefined {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n public flush(timeout?: number): PromiseLike {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n public getEventProcessors(): EventProcessor[] {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n public addEventProcessor(eventProcessor: EventProcessor): void {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * This is an internal function to setup all integrations that should run on the client.\n * @deprecated Use `client.init()` instead.\n */\n public setupIntegrations(forceInitialize?: boolean): void {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._setupIntegrations();\n }\n }\n\n /** @inheritdoc */\n public init(): void {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n public getIntegrationById(integrationId: string): Integration | undefined {\n return this.getIntegrationByName(integrationId);\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n public getIntegrationByName(integrationName: string): T | undefined {\n return this._integrations[integrationName] as T | undefined;\n }\n\n /**\n * Returns the client's instance of the given integration class, it any.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n public getIntegration(integration: IntegrationClass): T | null {\n try {\n return (this._integrations[integration.id] as T) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n public addIntegration(integration: Integration): void {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event, hint: EventHint = {}): void {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session | SessionAggregates): void {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n public recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void {\n // Note: we use `event` in replay, where we overwrite this hook.\n\n if (this._options.sendClientReports) {\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Adding outcome: \"${key}\"`);\n\n // The following works because undefined + 1 === NaN and NaN is falsy\n this._outcomes[key] = this._outcomes[key] + 1 || 1;\n }\n }\n\n /**\n * @inheritDoc\n */\n public captureAggregateMetrics(metricBucketItems: Array): void {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n public on(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'afterSendEvent',\n callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'otelSpanEnd', callback: (otelSpan: unknown, mutableOptions: { drop: boolean }) => void): void;\n\n /** @inheritdoc */\n public on(\n hook: 'beforeSendFeedback',\n callback: (feedback: FeedbackEvent, options?: { includeReplay: boolean }) => void,\n ): void;\n\n /** @inheritdoc */\n public on(hook: 'startPageLoadSpan', callback: (options: StartSpanOptions) => void): void;\n\n /** @inheritdoc */\n public on(hook: 'startNavigationSpan', callback: (options: StartSpanOptions) => void): void;\n\n /** @inheritdoc */\n public on(hook: string, callback: unknown): void {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n public emit(hook: 'startTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'finishTransaction', transaction: Transaction): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n /** @inheritdoc */\n public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n /** @inheritdoc */\n public emit(hook: 'otelSpanEnd', otelSpan: unknown, mutableOptions: { drop: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay: boolean }): void;\n\n /** @inheritdoc */\n public emit(hook: 'startPageLoadSpan', options: StartSpanOptions): void;\n\n /** @inheritdoc */\n public emit(hook: 'startNavigationSpan', options: StartSpanOptions): void;\n\n /** @inheritdoc */\n public emit(hook: string, ...rest: unknown[]): void {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n protected _setupIntegrations(): void {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n\n // TODO v8: We don't need this flag anymore\n this._integrationsInitialized = true;\n }\n\n /** Updates existing session based on the provided event */\n protected _updateSessionFromEvent(session: Session, event: Event): void {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n protected _isClientDoneProcessing(timeout?: number): PromiseLike {\n return new SyncPromise(resolve => {\n let ticked: number = 0;\n const tick: number = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n protected _isEnabled(): boolean {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n scope?: Scope,\n isolationScope = getIsolationScope(),\n ): PromiseLike {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(scope ? scope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason as SentryError;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope: Scope | undefined = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, scope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n protected _process(promise: PromiseLike): void {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): PromiseLike | void {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n protected _clearOutcomes(): Outcome[] {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike;\n\n /**\n * @inheritDoc\n */\n public abstract eventFromMessage(\n _message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n _level?: Severity | SeverityLevel,\n _hint?: EventHint,\n ): PromiseLike;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult: PromiseLike | Event | null,\n beforeSendLabel: string,\n): PromiseLike | Event | null {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n): PromiseLike | Event | null {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nexport function addEventProcessor(callback: EventProcessor): void {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n","import type {\n DsnComponents,\n Event,\n EventEnvelope,\n EventItem,\n SdkInfo,\n SdkMetadata,\n Session,\n SessionAggregates,\n SessionEnvelope,\n SessionItem,\n} from '@sentry/types';\nimport {\n createEnvelope,\n createEventEnvelopeHeaders,\n dsnToString,\n getSdkMetadataForEnvelopeHeader,\n} from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nexport function createSessionEnvelope(\n session: Session | SessionAggregates,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): SessionEnvelope {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem: SessionItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nexport function createEventEnvelope(\n event: Event,\n dsn?: DsnComponents,\n metadata?: SdkMetadata,\n tunnel?: string,\n): EventEnvelope {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem: EventItem = [{ type: eventType }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n","export const DEFAULT_ENVIRONMENT = 'production';\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import type { Event, EventHint, EventProcessor } from '@sentry/types';\nimport { SyncPromise, getGlobalSingleton, isThenable, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nexport function getGlobalEventProcessors(): EventProcessor[] {\n return getGlobalSingleton('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nexport function notifyEventProcessors(\n processors: EventProcessor[],\n event: Event | null,\n hint: EventHint,\n index: number = 0,\n): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) as Event | null;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n","import type {\n Breadcrumb,\n BreadcrumbHint,\n CaptureContext,\n CheckIn,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n FinishedCheckIn,\n MonitorConfig,\n Primitive,\n Scope as ScopeInterface,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n Span,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, isThenable, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { Hub } from './hub';\nimport { runWithAsyncContext } from './hub';\nimport { getCurrentHub, getIsolationScope } from './hub';\nimport type { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport type { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception: any,\n hint?: ExclusiveEventHintOrCaptureContext,\n): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nexport function captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n captureContext?: CaptureContext | Severity | SeverityLevel,\n): string {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nexport function captureEvent(event: Event, hint?: EventHint): string {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function configureScope(callback: (scope: Scope) => void): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, deprecation/deprecation\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setExtras(extras: Extras): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setExtra(key: string, extra: Extra): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setTag(key: string, value: Primitive): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setUser(user: User | null): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\nexport function withScope(callback: (scope: Scope) => T): T;\n/**\n * Set the given scope as the active scope in the callback.\n */\nexport function withScope(scope: ScopeInterface | undefined, callback: (scope: Scope) => T): T;\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nexport function withScope(\n ...rest: [callback: (scope: Scope) => T] | [scope: ScopeInterface | undefined, callback: (scope: Scope) => T]\n): T {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(callback);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(() => {\n // eslint-disable-next-line deprecation/deprecation\n hub.getStackTop().scope = scope as Scope;\n return callback(scope as Scope);\n });\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * @param callback The callback in which the passed isolation scope is active. (Note: In environments without async\n * context strategy, the currently active isolation scope may change within execution of the callback.)\n * @returns The same value that `callback` returns.\n */\nexport function withIsolationScope(callback: (isolationScope: Scope) => T): T {\n return runWithAsyncContext(() => {\n return callback(getIsolationScope());\n });\n}\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback.\n *\n * @param span Spans started in the context of the provided callback will be children of this span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nexport function withActiveSpan(span: Span, callback: (scope: Scope) => T): T {\n return withScope(scope => {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n return callback(scope);\n });\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nexport function startTransaction(\n context: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n // eslint-disable-next-line deprecation/deprecation\n): ReturnType {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function withMonitor(\n monitorSlug: CheckIn['monitorSlug'],\n callback: () => T,\n upsertMonitorConfig?: MonitorConfig,\n): T {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status: FinishedCheckIn['status']): void {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nexport function getClient(): C | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getClient();\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nexport function isInitialized(): boolean {\n return !!getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nexport function getCurrentScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nexport function startSession(context?: SessionContext): Session {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nexport function endSession(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate(): void {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nexport function captureSession(end: boolean = false): void {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n","/* eslint-disable max-lines */\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n Hub as HubInterface,\n Integration,\n IntegrationClass,\n Primitive,\n Session,\n SessionContext,\n Severity,\n SeverityLevel,\n Transaction,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n consoleSandbox,\n dateTimestampInSeconds,\n getGlobalSingleton,\n isThenable,\n logger,\n uuid4,\n} from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { DEBUG_BUILD } from './debug-build';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\nimport { SDK_VERSION } from './version';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n /** Whether to reuse an existing async context if one exists. Defaults to false. */\n reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n /**\n * Gets the current async context. Returns undefined if there is no current async context.\n */\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub: () => Hub | undefined;\n /**\n * Runs the supplied callback in its own async context.\n */\n runWithAsyncContext(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n __SENTRY__?: {\n // eslint-disable-next-line deprecation/deprecation\n hub?: Hub;\n acs?: AsyncContextStrategy;\n /**\n * Extra Hub properties injected by various SDKs\n */\n integrations?: Integration[];\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n}\n\n/**\n * @deprecated The `Hub` class will be removed in version 8 of the SDK in favour of `Scope` and `Client` objects.\n *\n * If you previously used the `Hub` class directly, replace it with `Scope` and `Client` objects. More information:\n * - [Multiple Sentry Instances](https://docs.sentry.io/platforms/javascript/best-practices/multiple-sentry-instances/)\n * - [Browser Extensions](https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/)\n *\n * Some of our APIs are typed with the Hub class instead of the interface (e.g. `getCurrentHub`). Most of them are deprecated\n * themselves and will also be removed in version 8. More information:\n * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class Hub implements HubInterface {\n /** Is a {@link Layer}[] containing the client and scope */\n private readonly _stack: Layer[];\n\n /** Contains the last event id of a captured event. */\n private _lastEventId?: string;\n\n private _isolationScope: Scope;\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n *\n * @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.\n *\n * If you are currently using the Hub for multi-client use like so:\n *\n * ```\n * // OLD\n * const hub = new Hub();\n * hub.bindClient(client);\n * makeMain(hub)\n * ```\n *\n * instead initialize the client as follows:\n *\n * ```\n * // NEW\n * Sentry.withIsolationScope(() => {\n * Sentry.setCurrentClient(client);\n * client.init();\n * });\n * ```\n *\n * If you are using the Hub to capture events like so:\n *\n * ```\n * // OLD\n * const client = new Client();\n * const hub = new Hub(client);\n * hub.captureException()\n * ```\n *\n * instead capture isolated events as follows:\n *\n * ```\n * // NEW\n * const client = new Client();\n * const scope = new Scope();\n * scope.setClient(client);\n * scope.captureException();\n * ```\n */\n public constructor(\n client?: Client,\n scope?: Scope,\n isolationScope?: Scope,\n private readonly _version: number = API_VERSION,\n ) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Checks if this hub's version is older than the given version.\n *\n * @param version A version number to compare to.\n * @return True if the given version is newer; otherwise false.\n *\n * @deprecated This will be removed in v8.\n */\n public isOlderThan(version: number): boolean {\n return this._version < version;\n }\n\n /**\n * This binds the given client to the current scope.\n * @param client An SDK client (client) instance.\n *\n * @deprecated Use `initAndBind()` directly, or `setCurrentClient()` and/or `client.init()` instead.\n */\n public bindClient(client?: Client): void {\n // eslint-disable-next-line deprecation/deprecation\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n // eslint-disable-next-line deprecation/deprecation\n if (client && client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public pushScope(): Scope {\n // We want to clone the content of prev scope\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope().clone();\n // eslint-disable-next-line deprecation/deprecation\n this.getStack().push({\n // eslint-disable-next-line deprecation/deprecation\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n public popScope(): boolean {\n // eslint-disable-next-line deprecation/deprecation\n if (this.getStack().length <= 1) return false;\n // eslint-disable-next-line deprecation/deprecation\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.withScope()` instead.\n */\n public withScope(callback: (scope: Scope) => T): T {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.getClient()` instead.\n */\n public getClient(): C | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().client as C;\n }\n\n /**\n * Returns the scope of the top stack.\n *\n * @deprecated Use `Sentry.getCurrentScope()` instead.\n */\n public getScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().scope;\n }\n\n /**\n * @deprecated Use `Sentry.getIsolationScope()` instead.\n */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n * @deprecated This will be removed in v8.\n */\n public getStack(): Layer[] {\n return this._stack;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n * @deprecated This will be removed in v8.\n */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n public captureMessage(\n message: string,\n // eslint-disable-next-line deprecation/deprecation\n level?: Severity | SeverityLevel,\n hint?: EventHint,\n ): string {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated This will be removed in v8.\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.addBreadcrumb()` instead.\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n // TODO(v8): I know this comment doesn't make much sense because the hub will be deprecated but I still wanted to\n // write it down. In theory, we would have to add the breadcrumbs to the isolation scope here, however, that would\n // duplicate all of the breadcrumbs. There was the possibility of adding breadcrumbs to both, the isolation scope\n // and the normal scope, and deduplicating it down the line in the event processing pipeline. However, that would\n // have been very fragile, because the breadcrumb objects would have needed to keep their identity all throughout\n // the event processing pipeline.\n // In the new implementation, the top level `Sentry.addBreadcrumb()` should ONLY write to the isolation scope.\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setUser()` instead.\n */\n public setUser(user: User | null): void {\n // TODO(v8): The top level `Sentry.setUser()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setUser(user);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTags()` instead.\n */\n public setTags(tags: { [key: string]: Primitive }): void {\n // TODO(v8): The top level `Sentry.setTags()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTags(tags);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtras()` instead.\n */\n public setExtras(extras: Extras): void {\n // TODO(v8): The top level `Sentry.setExtras()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtras(extras);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTag()` instead.\n */\n public setTag(key: string, value: Primitive): void {\n // TODO(v8): The top level `Sentry.setTag()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTag(key, value);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtra()` instead.\n */\n public setExtra(key: string, extra: Extra): void {\n // TODO(v8): The top level `Sentry.setExtra()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtra(key, extra);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setContext()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(name: string, context: { [key: string]: any } | null): void {\n // TODO(v8): The top level `Sentry.setContext()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setContext(name, context);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n public configureScope(callback: (scope: Scope) => void): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n public run(callback: (hub: Hub) => void): void {\n // eslint-disable-next-line deprecation/deprecation\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n // eslint-disable-next-line deprecation/deprecation\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.getClient().getIntegrationByName()` instead.\n */\n public getIntegration(integration: IntegrationClass): T | null {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) return null;\n try {\n // eslint-disable-next-line deprecation/deprecation\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n public traceHeaders(): { [key: string]: string } {\n return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n public captureSession(endSession: boolean = false): void {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n public endSession(): void {\n // eslint-disable-next-line deprecation/deprecation\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n public startSession(context?: SessionContext): Session {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n public shouldSendDefaultPii(): boolean {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n private _sendSessionUpdate(): void {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _callExtensionMethod(method: string, ...args: any[]): T {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n *\n * @deprecated Use `setCurrentClient()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function makeMain(hub: Hub): Hub {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n *\n * @deprecated Use the respective replacement method directly instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getCurrentHub(): Hub {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nexport function getIsolationScope(): Scope {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getIsolationScope();\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n // If there's no hub, or its an old API, assign a new one\n\n if (\n !hasHubOnCarrier(registry) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(registry).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (\n !hasHubOnCarrier(carrier) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(carrier).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const client = parent.getClient();\n // eslint-disable-next-line deprecation/deprecation\n const scope = parent.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const isolationScope = parent.getIsolationScope();\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n // eslint-disable-next-line deprecation/deprecation\n return getGlobalSingleton('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n","import type {\n Client,\n Event,\n EventHint,\n Integration,\n IntegrationClass,\n IntegrationFn,\n IntegrationFnResult,\n Options,\n} from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { addGlobalEventProcessor } from './eventProcessors';\nimport { getClient } from './exports';\nimport { getCurrentHub } from './hub';\n\ndeclare module '@sentry/types' {\n interface Integration {\n isDefaultInstance?: boolean;\n }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n const integrationsByName: { [key: string]: Integration } = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Pick): Integration[] {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations: Integration[];\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex {\n const integrationIndex: IntegrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nexport function afterSetupIntegrations(client: Client, integrations: Integration[]): void {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nexport function setupIntegration(client: Client, integration: Integration, integrationIndex: IntegrationIndex): void {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1) {\n // eslint-disable-next-line deprecation/deprecation\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (client.on && typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) as typeof integration.preprocessEvent;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) as typeof integration.processEvent;\n\n const processor = Object.assign((event: Event, hint: EventHint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current hub's client. */\nexport function addIntegration(integration: Integration): void {\n const client = getClient();\n\n if (!client || !client.addIntegration) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex(arr: T[], callback: (item: T) => boolean): number {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Convert a new integration function to the legacy class syntax.\n * In v8, we can remove this and instead export the integration functions directly.\n *\n * @deprecated This will be removed in v8!\n */\nexport function convertIntegrationFnToClass(\n name: string,\n fn: Fn,\n): IntegrationClass {\n return Object.assign(\n function ConvertedIntegration(...args: Parameters): Integration {\n return fn(...args);\n },\n { id: name },\n ) as unknown as IntegrationClass;\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nexport function defineIntegration(fn: Fn): (...args: Parameters) => IntegrationFnResult {\n return fn;\n}\n","/* eslint-disable max-lines */\nimport type {\n Attachment,\n Breadcrumb,\n CaptureContext,\n Client,\n Context,\n Contexts,\n Event,\n EventHint,\n EventProcessor,\n Extra,\n Extras,\n Primitive,\n PropagationContext,\n RequestSession,\n Scope as ScopeInterface,\n ScopeContext,\n ScopeData,\n Session,\n Severity,\n SeverityLevel,\n Span,\n Transaction,\n User,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, isPlainObject, logger, uuid4 } from '@sentry/utils';\n\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors';\nimport { updateSession } from './session';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope: ScopeInterface | undefined;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n /** Flag if notifying is happening. */\n protected _notifyingListeners: boolean;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void>;\n\n /** Callback list that will be called after {@link applyToEvent}. */\n protected _eventProcessors: EventProcessor[];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[];\n\n /** User */\n protected _user: User;\n\n /** Tags */\n protected _tags: { [key: string]: Primitive };\n\n /** Extra */\n protected _extra: Extras;\n\n /** Contexts */\n protected _contexts: Contexts;\n\n /** Attachments */\n protected _attachments: Attachment[];\n\n /** Propagation Context for distributed tracing */\n protected _propagationContext: PropagationContext;\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n protected _level?: Severity | SeverityLevel;\n\n /**\n * Transaction Name\n */\n protected _transactionName?: string;\n\n /** Span */\n protected _span?: Span;\n\n /** Session */\n protected _session?: Session;\n\n /** Request Mode Session Status */\n protected _requestSession?: RequestSession;\n\n /** The client on this scope */\n protected _client?: Client;\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n public constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n public static clone(scope?: Scope): Scope {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n public clone(): Scope {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n public setClient(client: Client | undefined): void {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n public getClient(): Client | undefined {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n segment: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getUser(): User | undefined {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n public getRequestSession(): RequestSession | undefined {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n public setRequestSession(requestSession?: RequestSession): this {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel,\n ): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n */\n public setTransactionName(name?: string): this {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setContext(key: string, context: Context | null): this {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n public setSpan(span?: Span): this {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n public getSpan(): Span | undefined {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n public getTransaction(): Transaction | undefined {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n // Cannot replace with getRootSpan because getRootSpan returns a span, not a transaction\n // Also, this method will be removed anyway.\n // eslint-disable-next-line deprecation/deprecation\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n public setSession(session?: Session): this {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getSession(): Session | undefined {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n public update(captureContext?: CaptureContext): this {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n if (scopeToMerge instanceof Scope) {\n const scopeData = scopeToMerge.getScopeData();\n\n this._tags = { ...this._tags, ...scopeData.tags };\n this._extra = { ...this._extra, ...scopeData.extra };\n this._contexts = { ...this._contexts, ...scopeData.contexts };\n if (scopeData.user && Object.keys(scopeData.user).length) {\n this._user = scopeData.user;\n }\n if (scopeData.level) {\n this._level = scopeData.level;\n }\n if (scopeData.fingerprint.length) {\n this._fingerprint = scopeData.fingerprint;\n }\n if (scopeToMerge.getRequestSession()) {\n this._requestSession = scopeToMerge.getRequestSession();\n }\n if (scopeData.propagationContext) {\n this._propagationContext = scopeData.propagationContext;\n }\n } else if (isPlainObject(scopeToMerge)) {\n const scopeContext = captureContext as ScopeContext;\n this._tags = { ...this._tags, ...scopeContext.tags };\n this._extra = { ...this._extra, ...scopeContext.extra };\n this._contexts = { ...this._contexts, ...scopeContext.contexts };\n if (scopeContext.user) {\n this._user = scopeContext.user;\n }\n if (scopeContext.level) {\n this._level = scopeContext.level;\n }\n if (scopeContext.fingerprint) {\n this._fingerprint = scopeContext.fingerprint;\n }\n if (scopeContext.requestSession) {\n this._requestSession = scopeContext.requestSession;\n }\n if (scopeContext.propagationContext) {\n this._propagationContext = scopeContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clear(): this {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getLastBreadcrumb(): Breadcrumb | undefined {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n public getAttachments(): Attachment[] {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n public getScopeData(): ScopeData {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n public applyToEvent(\n event: Event,\n hint: EventHint = {},\n additionalEventProcessors: EventProcessor[] = [],\n ): PromiseLike {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors: EventProcessor[] = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setPropagationContext(context: PropagationContext): this {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getPropagationContext(): PropagationContext {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n public captureException(exception: unknown, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nexport function getGlobalScope(): ScopeInterface {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nexport function setGlobalScope(scope: ScopeInterface | undefined): void {\n globalScope = scope;\n}\n\nfunction generatePropagationContext(): PropagationContext {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/**\n * The id of the profile that this span occured in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'profile_id';\n","import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit): Session {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session: Session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude): void {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n","import type { Client, DynamicSamplingContext, Scope, Span, Transaction } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getClient, getCurrentScope } from '../exports';\nimport { getRootSpan } from '../utils/getRootSpan';\nimport { spanIsSampled, spanToJSON } from '../utils/spanUtils';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nexport function getDynamicSamplingContextFromClient(\n trace_id: string,\n client: Client,\n scope?: Scope,\n): DynamicSamplingContext {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) as DynamicSamplingContext;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\ntype TransactionWithV7FrozenDsc = Transaction & { _frozenDynamicSamplingContext?: DynamicSamplingContext };\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nexport function getDynamicSamplingContextFromSpan(span: Span): Readonly> {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) as TransactionWithV7FrozenDsc | undefined;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n","import type { Breadcrumb, Event, ScopeData, Span } from '@sentry/types';\nimport { arrayify, dropUndefinedKeys } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext';\nimport { getRootSpan } from './getRootSpan';\nimport { spanToJSON, spanToTraceContext } from './spanUtils';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nexport function applyScopeDataToEvent(event: Event, data: ScopeData): void {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nexport function mergeScopeData(data: ScopeData, mergeData: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nexport function mergeAndOverwriteScopeData<\n Prop extends 'extra' | 'tags' | 'user' | 'contexts' | 'sdkProcessingMetadata',\n Data extends ScopeData,\n>(data: Data, prop: Prop, mergeVal: Data[Prop]): void {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\n/** Exported only for tests */\nexport function mergeArray(\n event: Event,\n prop: Prop,\n mergeVal: ScopeData[Prop],\n): void {\n const prevVal = event[prop];\n // If we are not merging any new values,\n // we only need to proceed if there was an empty array before (as we want to replace it with undefined)\n if (!mergeVal.length && (!prevVal || prevVal.length)) {\n return;\n }\n\n const merged = [...(prevVal || []), ...mergeVal] as ScopeData[Prop];\n event[prop] = merged.length ? merged : undefined;\n}\n\nfunction applyDataToEvent(event: Event, data: ScopeData): void {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event: Event, breadcrumbs: Breadcrumb[]): void {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event: Event, sdkProcessingMetadata: ScopeData['sdkProcessingMetadata']): void {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event: Event, span: Span): void {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const rootSpan = getRootSpan(span);\n if (rootSpan) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event: Event, fingerprint: ScopeData['fingerprint'] | undefined): void {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n","import type { Span } from '@sentry/types';\n\n/**\n * Returns the root span of a given span.\n *\n * As long as we use `Transaction`s internally, the returned root span\n * will be a `Transaction` but be aware that this might change in the future.\n *\n * If the given span has no root span or transaction, `undefined` is returned.\n */\nexport function getRootSpan(span: Span): Span | undefined {\n // TODO (v8): Remove this check and just return span\n // eslint-disable-next-line deprecation/deprecation\n return span.transaction;\n}\n","import type {\n CaptureContext,\n Client,\n ClientOptions,\n Event,\n EventHint,\n Scope as ScopeInterface,\n ScopeContext,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { GLOBAL_OBJ, addExceptionMechanism, dateTimestampInSeconds, normalize, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors';\nimport { Scope, getGlobalScope } from '../scope';\nimport { applyScopeDataToEvent, mergeScopeData } from './applyScopeDataToEvent';\nimport { spanToJSON } from './spanUtils';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\nexport type ExclusiveEventHintOrCaptureContext =\n | (CaptureContext & Partial<{ [key in keyof EventHint]: never }>)\n | (EventHint & Partial<{ [key in keyof ScopeContext]: never }>);\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n options: ClientOptions,\n event: Event,\n hint: EventHint,\n scope?: Scope,\n client?: Client,\n isolationScope?: Scope,\n): PromiseLike {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n const prepared: Event = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap>();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nexport function applyDebugIds(event: Event, stackParser: StackParser): void {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache: Map;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce>((acc, debugIdStackTrace) => {\n let parsedStack: StackFrame[];\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event!.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nexport function applyDebugMeta(event: Event): void {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap: Record = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception!.values!.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace!.frames!.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n if (!event) {\n return null;\n }\n\n const normalized: Event = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope: Scope | undefined, captureContext: CaptureContext | undefined): Scope | undefined {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nexport function parseEventHintOrCaptureContext(\n hint: ExclusiveEventHintOrCaptureContext | undefined,\n): EventHint | undefined {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint: CaptureContext | EventHint,\n): hint is ScopeInterface | ((scope: ScopeInterface) => ScopeInterface) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\ntype ScopeContextProperty = keyof ScopeContext;\nconst captureContextKeys: readonly ScopeContextProperty[] = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] as const;\n\nfunction hintIsScopeContext(hint: Partial | EventHint): hint is Partial {\n return Object.keys(hint).some(key => captureContextKeys.includes(key as ScopeContextProperty));\n}\n","import type { Span, SpanJSON, SpanTimeInput, TraceContext } from '@sentry/types';\nimport { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\nimport type { Span as SpanClass } from '../tracing/span';\n\n// These are aligned with OpenTelemetry trace flags\nexport const TRACE_FLAG_NONE = 0x0;\nexport const TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nexport function spanToTraceContext(span: Span): TraceContext {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nexport function spanToTraceHeader(span: Span): string {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nexport function spanTimeInputToSeconds(input: SpanTimeInput | undefined): number {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp: number): number {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nexport function spanToJSON(span: Span): Partial {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span: Span): span is SpanClass {\n return typeof (span as SpanClass).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nexport function spanIsSampled(span: Span): boolean {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n","export const SDK_VERSION = '7.118.0';\n","import type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [\n /^Script error\\.?$/,\n /^Javascript error: Script error\\.? on line 0$/,\n /^ResizeObserver loop completed with undelivered notifications.$/,\n /^Cannot redefine property: googletag$/,\n];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n /^.*\\/healthcheck$/,\n /^.*\\/healthy$/,\n /^.*\\/live$/,\n /^.*\\/ready$/,\n /^.*\\/heartbeat$/,\n /^.*\\/health$/,\n /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n allowUrls: Array;\n denyUrls: Array;\n ignoreErrors: Array;\n ignoreTransactions: Array;\n ignoreInternal: boolean;\n disableErrorDefaults: boolean;\n disableTransactionDefaults: boolean;\n}\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst _inboundFiltersIntegration = ((options: Partial = {}) => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);\n\n/**\n * Inbound filters configurable by the user.\n * @deprecated Use `inboundFiltersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const InboundFilters = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n inboundFiltersIntegration,\n) as IntegrationClass void }> & {\n new (\n options?: Partial<{\n allowUrls: Array;\n denyUrls: Array;\n ignoreErrors: Array;\n ignoreTransactions: Array;\n ignoreInternal: boolean;\n disableErrorDefaults: boolean;\n disableTransactionDefaults: boolean;\n }>,\n ): Integration;\n};\n\nfunction _mergeOptions(\n internalOptions: Partial = {},\n clientOptions: Partial = {},\n): Partial {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [\n ...(internalOptions.ignoreTransactions || []),\n ...(clientOptions.ignoreTransactions || []),\n ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n ],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event: Event, options: Partial): boolean {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array): boolean {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array): boolean {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array): boolean {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array): boolean {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n const possibleMessages: string[] = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n if (DEBUG_BUILD && possibleMessages.length === 0) {\n logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event: Event): boolean {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n","import type { Client, Integration, IntegrationClass, IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\nimport { getClient } from '../exports';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration';\n\nlet originalFunctionToString: () => void;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() as Client) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nexport const functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * @deprecated Use `functionToStringIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const FunctionToString = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n functionToStringIntegration,\n) as IntegrationClass void }>;\n\n// eslint-disable-next-line deprecation/deprecation\nexport type FunctionToString = typeof FunctionToString;\n","import type { Client, ClientOptions } from '@sentry/types';\nimport { consoleSandbox, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { getCurrentScope } from './exports';\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind(\n clientClass: ClientClass,\n options: O,\n): void {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n initializeClient(client);\n}\n\n/**\n * Make the given client the current client.\n */\nexport function setCurrentClient(client: Client): void {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const top = hub.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n}\n\n/**\n * Initialize the client for the current scope.\n * Make sure to call this after `setCurrentClient()`.\n */\nfunction initializeClient(client: Client): void {\n if (client.init) {\n client.init();\n // TODO v8: Remove this fallback\n // eslint-disable-next-line deprecation/deprecation\n } else if (client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n}\n","import type { Options } from '@sentry/types';\nimport { SDK_VERSION } from '../version';\n\n/**\n * A builder for the SDK metadata in the options for the SDK initialization.\n *\n * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit.\n * We don't extract it for bundle size reasons.\n * @see https://github.com/getsentry/sentry-javascript/pull/7404\n * @see https://github.com/getsentry/sentry-javascript/pull/4196\n *\n * If you make changes to this function consider updating the others as well.\n *\n * @param options SDK options object that gets mutated\n * @param names list of package names\n */\nexport function applySdkMetadata(options: Options, name: string, names = [name], source = 'npm'): void {\n const metadata = options._metadata || {};\n\n if (!metadata.sdk) {\n metadata.sdk = {\n name: `sentry.javascript.${name}`,\n packages: names.map(name => ({\n name: `${source}:@sentry/${name}`,\n version: SDK_VERSION,\n })),\n version: SDK_VERSION,\n };\n }\n\n options._metadata = metadata;\n}\n","declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n","import { getClient } from '@sentry/core';\nimport type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n Severity,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/utils';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: ex && ex.name,\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n stackParser: StackParser,\n exception: Record,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n },\n };\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const popSize = getPopSize(ex);\n\n try {\n return stackParser(stacktrace, popSize);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception as Record;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n","import type { browserTracingIntegration } from '@sentry-internal/tracing';\nimport { BrowserTracing } from '@sentry-internal/tracing';\nimport { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Integration, Mechanism, WrappedFunction } from '@sentry/types';\nimport {\n GLOBAL_OBJ,\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n getOriginalFunction,\n markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n return wrapper;\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped: WrappedFunction = function (this: unknown): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n *\n * @deprecated This type will be removed in the next major version of the Sentry SDK. `showReportDialog` will still be around, however the `eventId` option will now be required.\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(this: void): void;\n /** Callback after reportDialog closed */\n onClose?(this: void): void;\n}\n\n/**\n * This is a slim shim of `browserTracingIntegration` for the CDN bundles.\n * Since the actual functional integration uses a different code from `BrowserTracing`,\n * we want to avoid shipping both of them in the CDN bundles, as that would blow up the size.\n * Instead, we provide a functional integration with the same API, but the old implementation.\n * This means that it's not possible to register custom routing instrumentation, but that's OK for now.\n * We also don't expose the utilities for this anyhow in the CDN bundles.\n * For users that need custom routing in CDN bundles, they have to continue using `new BrowserTracing()` until v8.\n */\nexport function bundleBrowserTracingIntegration(\n options: Parameters[0] = {},\n): Integration {\n // Migrate some options from the old integration to the new one\n // eslint-disable-next-line deprecation/deprecation\n const opts: ConstructorParameters[0] = options;\n\n if (typeof options.markBackgroundSpan === 'boolean') {\n opts.markBackgroundTransactions = options.markBackgroundSpan;\n }\n\n if (typeof options.instrumentPageLoad === 'boolean') {\n opts.startTransactionOnPageLoad = options.instrumentPageLoad;\n }\n\n if (typeof options.instrumentNavigation === 'boolean') {\n opts.startTransactionOnLocationChange = options.instrumentNavigation;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return new BrowserTracing(opts);\n}\n","import type { Scope } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport { BaseClient } from '@sentry/core';\nimport type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options,\n ParameterizedString,\n Severity,\n SeverityLevel,\n UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions &\n BrowserClientReplayOptions &\n BrowserClientProfilingOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(options, 'browser', ['browser'], sdkSource);\n\n super(options);\n\n if (options.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n // eslint-disable-next-line deprecation/deprecation\n level: Severity | SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n\n /**\n * Sends client reports as an envelope.\n */\n private _flushOutcomes(): void {\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n}\n","import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n","import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n discarded_events: ClientReport['discarded_events'],\n dsn?: string,\n timestamp?: number,\n): ClientReportEnvelope {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { ConsoleLevel, HandlerDataConsole } from '@sentry/types';\n\nimport { CONSOLE_LEVELS, originalConsoleMethods } from '../logger';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addConsoleInstrumentationHandler(handler: (data: HandlerDataConsole) => void): void {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole(): void {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level: ConsoleLevel): void {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod: () => any): Function {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args: any[]): void {\n const handlerData: HandlerDataConsole = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n","/* eslint-disable deprecation/deprecation */\nimport type { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n","/* eslint-disable max-lines */\nimport { addBreadcrumb, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';\nimport type {\n Client,\n Event as SentryEvent,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n Integration,\n IntegrationClass,\n IntegrationFn,\n} from '@sentry/types';\nimport type {\n Breadcrumb,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n SENTRY_XHR_DATA_KEY,\n addClickKeypressInstrumentationHandler,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n logger,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BreadcrumbsOptions {\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options: Partial = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry && client.on) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Default Breadcrumbs instrumentations\n *\n * @deprecated Use `breadcrumbsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration) as IntegrationClass<\n Integration & { setup: (client: Client) => void }\n> & {\n new (\n options?: Partial<{\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n }>,\n ): Integration;\n};\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): void {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client: Client,\n dom: BreadcrumbsOptions['dom'],\n): (handlerData: HandlerDataDom) => void {\n return function _innerDomBreadcrumb(handlerData: HandlerDataDom): void {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event as Event | Node;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb: Breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client: Client): (handlerData: HandlerDataConsole) => void {\n return function _consoleBreadcrumb(handlerData: HandlerDataConsole): void {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client: Client): (handlerData: HandlerDataXhr) => void {\n return function _xhrBreadcrumb(handlerData: HandlerDataXhr): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data: XhrBreadcrumbData = {\n method,\n url,\n status_code,\n };\n\n const hint: XhrBreadcrumbHint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client: Client): (handlerData: HandlerDataFetch) => void {\n return function _fetchBreadcrumb(handlerData: HandlerDataFetch): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data: FetchBreadcrumbData = handlerData.fetchData;\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response as Response | undefined;\n const data: FetchBreadcrumbData = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client: Client): (handlerData: HandlerDataHistory) => void {\n return function _historyBreadcrumb(handlerData: HandlerDataHistory): void {\n if (getClient() !== client) {\n return;\n }\n\n let from: string | undefined = handlerData.from;\n let to: string | undefined = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event: unknown): event is Event {\n return !!event && !!(event as Record).target;\n}\n","import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Event, Exception, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst _dedupeIntegration = (() => {\n let previousEvent: Event | undefined;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const dedupeIntegration = defineIntegration(_dedupeIntegration);\n\n/**\n * Deduplication filter.\n * @deprecated Use `dedupeIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Dedupe = convertIntegrationFnToClass(INTEGRATION_NAME, dedupeIntegration) as IntegrationClass<\n Integration & { processEvent: (event: Event) => Event }\n>;\n\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n let currentFrames = _getFramesFromEvent(currentEvent);\n let previousFrames = _getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames as StackFrame[];\n previousFrames = previousFrames as StackFrame[];\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n const frameA = previousFrames[i];\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint as string[];\n previousFingerprint = previousFingerprint as string[];\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n const exception = event.exception;\n\n if (exception) {\n try {\n // @ts-expect-error Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { captureEvent, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';\nimport type {\n Client,\n Event,\n Integration,\n IntegrationClass,\n IntegrationFn,\n Primitive,\n StackParser,\n} from '@sentry/types';\nimport {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n getLocationHref,\n isErrorEvent,\n isPrimitive,\n isString,\n logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\ntype GlobalHandlersIntegrations = Record;\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options: Partial = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\n/**\n * Global handlers.\n * @deprecated Use `globalHandlersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const GlobalHandlers = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n globalHandlersIntegration,\n) as IntegrationClass void }> & {\n new (options?: Partial): Integration;\n};\n\nfunction _installGlobalOnErrorHandler(client: Client): void {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event =\n error === undefined && isString(msg)\n ? _eventFromIncompleteOnError(msg, url, line, column)\n : _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client: Client): void {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e as unknown);\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error: unknown): unknown {\n if (isPrimitive(error)) {\n return error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = error as any;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n return e.reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n return e.detail.reason;\n }\n } catch {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n const ERROR_TYPES_RE =\n /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name = 'Error';\n\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name,\n value: message,\n },\n ],\n },\n };\n\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions(): { stackParser: StackParser; attachStacktrace?: boolean } {\n const client = getClient();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n","import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Event, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'HttpContext';\n\nconst _httpContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const httpContextIntegration = defineIntegration(_httpContextIntegration);\n\n/**\n * HttpContext integration collects information about HTTP request headers.\n * @deprecated Use `httpContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration) as IntegrationClass<\n Integration & { preprocessEvent: (event: Event) => void }\n>;\n","import type { Event, EventHint, Exception, ExtendedError, StackParser } from '@sentry/types';\n\nimport { isInstanceOf } from './is';\nimport { truncate } from './string';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n maxValueLimit: number = 250,\n key: string,\n limit: number,\n event: Event,\n hint?: EventHint,\n): void {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException: Exception | undefined =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n prevExceptions: Exception[],\n exception: Exception,\n exceptionId: number,\n): Exception[] {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception: Exception, exceptionId: number): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n ...(exception.type === 'AggregateError' && { is_exception_group: true }),\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception: Exception,\n source: string,\n exceptionId: number,\n parentId: number | undefined,\n): void {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions: Exception[], maxValueLength: number): Exception[] {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n","import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) satisfies IntegrationFn;\n\nexport const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\n/**\n * Aggregrate linked errors in an event.\n * @deprecated Use `linkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration) as IntegrationClass<\n Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }\n> & { new (options?: { key?: string; limit?: number }): Integration };\n","import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Integration, IntegrationClass, IntegrationFn, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'TryCatch';\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\ninterface TryCatchOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n}\n\nconst _browserApiErrorsIntegration = ((options: Partial = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n * @deprecated Use `browserApiErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const TryCatch = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n browserApiErrorsIntegration,\n) as IntegrationClass & {\n new (options?: {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n }): Integration;\n};\n\nfunction _wrapTimeFunction(original: () => void): () => number {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: any, callback: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (this: XMLHttpRequest, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original: WrappedFunction): () => any {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target: string): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW as { [key: string]: any };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original: VoidFunction,): (\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn as any as WrappedFunction, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener: () => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn as unknown as WrappedFunction;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n","// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n const frame: StackFrame = {\n filename,\n function: func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn: StackLineParserFn = line => {\n const parts = chromeRegex.exec(line);\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n const parts = geckoREgex.exec(line);\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n const parts = winjsRegex.exec(line);\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n const parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n const parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n","import { SentryError } from './error';\nimport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer {\n // exposes the internal array so tests can assert on the state of it.\n // XXX: this really should not be public api.\n $: Array>;\n add(taskProducer: () => PromiseLike): PromiseLike;\n drain(timeout?: number): PromiseLike;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer(limit?: number): PromiseBuffer {\n const buffer: Array> = [];\n\n function isReady(): boolean {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n function remove(task: PromiseLike): PromiseLike {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer: () => PromiseLike): PromiseLike {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout?: number): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n","import type {\n Envelope,\n EnvelopeItem,\n EnvelopeItemType,\n Event,\n EventDropReason,\n EventItem,\n InternalBaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n SentryError,\n createEnvelope,\n envelopeItemTypeToDataCategory,\n forEachEnvelopeItem,\n isRateLimited,\n logger,\n makePromiseBuffer,\n resolvedSyncPromise,\n serializeEnvelope,\n updateRateLimits,\n} from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n options: InternalBaseTransportOptions,\n makeRequest: TransportRequestExecutor,\n buffer: PromiseBuffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n): Transport {\n let rateLimits: RateLimits = {};\n const flush = (timeout?: number): PromiseLike => buffer.drain(timeout);\n\n function send(envelope: Envelope): PromiseLike {\n const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason: EventDropReason): void => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event: Event | undefined = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = (): PromiseLike =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise();\n } else {\n throw error;\n }\n },\n );\n }\n\n // We use this to identifify if the transport is the base transport\n // TODO (v8): Remove this again as we'll no longer need it\n send.__sentry__baseTransport__ = true;\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n","import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(WINDOW.fetch)) {\n return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n }\n\n const document = WINDOW.document;\n let fetchImpl = WINDOW.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n cachedFetchImpl = undefined;\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n options: BrowserTransportOptions,\n nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request: TransportRequest): PromiseLike {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedFetchImplementation();\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n function makeRequest(request: TransportRequest): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onerror = reject;\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n resolve({\n statusCode: xhr.status,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n });\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport(options, makeRequest);\n}\n","import type { Hub } from '@sentry/core';\nimport { functionToStringIntegration, inboundFiltersIntegration } from '@sentry/core';\nimport {\n captureSession,\n getClient,\n getCurrentHub,\n getIntegrationsToSetup,\n getReportDialogEndpoint,\n initAndBind,\n startSession,\n} from '@sentry/core';\nimport type { Integration, Options, UserFeedback } from '@sentry/types';\nimport {\n addHistoryInstrumentationHandler,\n logger,\n stackParserFromStackParserOptions,\n supportsFetch,\n} from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs';\nimport { dedupeIntegration } from './integrations/dedupe';\nimport { globalHandlersIntegration } from './integrations/globalhandlers';\nimport { httpContextIntegration } from './integrations/httpcontext';\nimport { linkedErrorsIntegration } from './integrations/linkederrors';\nimport { browserApiErrorsIntegration } from './integrations/trycatch';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\n/** @deprecated Use `getDefaultIntegrations(options)` instead. */\nexport const defaultIntegrations = [\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n];\n\n/** Get the default integrations for the browser SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n // We return a copy of the defaultIntegrations here to avoid mutating this\n return [\n // eslint-disable-next-line deprecation/deprecation\n ...defaultIntegrations,\n ];\n}\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n if (options.release === undefined) {\n // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n if (typeof __SENTRY_RELEASE__ === 'string') {\n options.release = __SENTRY_RELEASE__;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n options.release = WINDOW.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n const clientOptions: BrowserClientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n };\n\n initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\ntype NewReportDialogOptions = ReportDialogOptions & { eventId: string }; // eslint-disable-line\n\ninterface ShowReportDialogFunction {\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\n (options: NewReportDialogOptions): void;\n\n /**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n *\n * @deprecated Please always pass an `options` argument with `eventId`. The `hub` argument will not be used in the next version of the SDK.\n */\n // eslint-disable-next-line deprecation/deprecation\n (options?: ReportDialogOptions, hub?: Hub): void;\n}\n\nexport const showReportDialog: ShowReportDialogFunction = (\n // eslint-disable-next-line deprecation/deprecation\n options: ReportDialogOptions = {},\n // eslint-disable-next-line deprecation/deprecation\n hub: Hub = getCurrentHub(),\n) => {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n if (!options.eventId) {\n // eslint-disable-next-line deprecation/deprecation\n options.eventId = hub.lastEventId();\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n};\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n return internalWrap(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n const client = getClient();\n if (client) {\n client.captureUserFeedback(feedback);\n }\n}\n","// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport function _optionalChain(ops: unknown[]): unknown {\n let lastAccessLHS: unknown = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] as string;\n const fn = ops[i + 1] as (intermediateValue: unknown) => unknown;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n// let lastAccessLHS = undefined;\n// let value = ops[0];\n// let i = 1;\n// while (i < ops.length) {\n// const op = ops[i];\n// const fn = ops[i + 1];\n// i += 2;\n// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n// return undefined;\n// }\n// if (op === 'access' || op === 'optionalAccess') {\n// lastAccessLHS = value;\n// value = fn(value);\n// } else if (op === 'call' || op === 'optionalCall') {\n// value = fn((...args) => value.call(lastAccessLHS, ...args));\n// lastAccessLHS = undefined;\n// }\n// }\n// return value;\n// }\n","import type { Client, DsnComponents, Hub } from '@sentry/types';\n\n/**\n * Checks whether given url points to Sentry server\n * @param url url to verify\n *\n * TODO(v8): Remove Hub fallback type\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function isSentryRequestUrl(url: string, hubOrClient: Hub | Client | undefined): boolean {\n const client =\n hubOrClient && isHub(hubOrClient)\n ? // eslint-disable-next-line deprecation/deprecation\n hubOrClient.getClient()\n : hubOrClient;\n const dsn = client && client.getDsn();\n const tunnel = client && client.getOptions().tunnel;\n\n return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\n\nfunction checkTunnel(url: string, tunnel: string | undefined): boolean {\n if (!tunnel) {\n return false;\n }\n\n return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\n\nfunction checkDsn(url: string, dsn: DsnComponents | undefined): boolean {\n return dsn ? url.includes(dsn.host) : false;\n}\n\nfunction removeTrailingSlash(str: string): string {\n return str[str.length - 1] === '/' ? str.slice(0, -1) : str;\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction isHub(hubOrClient: Hub | Client | undefined): hubOrClient is Hub {\n // eslint-disable-next-line deprecation/deprecation\n return (hubOrClient as Hub).getClient !== undefined;\n}\n","import { isNodeEnv } from './node';\nimport { GLOBAL_OBJ } from './worldwide';\n\n/**\n * Returns true if we are in the browser.\n */\nexport function isBrowser(): boolean {\n // eslint-disable-next-line no-restricted-globals\n return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\ntype ElectronProcess = { type?: string };\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer(): boolean {\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (GLOBAL_OBJ as any).process !== undefined && ((GLOBAL_OBJ as any).process as ElectronProcess).type === 'renderer'\n );\n}\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\n// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nexport const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const REPLAY_EVENT_NAME = 'replay_event';\nexport const RECORDING_EVENT_NAME = 'replay_recording';\nexport const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';\n\n// The idle limit for a session after which recording is paused.\nexport const SESSION_IDLE_PAUSE_DURATION = 300_000; // 5 minutes in ms\n\n// The idle limit for a session after which the session expires.\nexport const SESSION_IDLE_EXPIRE_DURATION = 900_000; // 15 minutes in ms\n\n/** Default flush delays */\nexport const DEFAULT_FLUSH_MIN_DELAY = 5_000;\n// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\nexport const DEFAULT_FLUSH_MAX_DELAY = 5_500;\n\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60_000;\n\nexport const RETRY_BASE_INTERVAL = 5000;\nexport const RETRY_MAX_COUNT = 3;\n\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be truncated. */\nexport const NETWORK_BODY_MAX_SIZE = 150_000;\n\n/* The max size of a single console arg that is captured. Any arg larger than this will be truncated. */\nexport const CONSOLE_ARG_MAX_SIZE = 5_000;\n\n/* Min. time to wait before we consider something a slow click. */\nexport const SLOW_CLICK_THRESHOLD = 3_000;\n/* For scroll actions after a click, we only look for a very short time period to detect programmatic scrolling. */\nexport const SLOW_CLICK_SCROLL_TIMEOUT = 300;\n\n/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */\nexport const REPLAY_MAX_EVENT_BUFFER_SIZE = 20_000_000; // ~20MB\n\n/** Replays must be min. 5s long before we send them. */\nexport const MIN_REPLAY_DURATION = 4_999;\n/* The max. allowed value that the minReplayDuration can be set to. */\nexport const MIN_REPLAY_DURATION_LIMIT = 15_000;\n\n/** The max. length of a replay. */\nexport const MAX_REPLAY_DURATION = 3_600_000; // 60 minutes in ms;\n\n/** Default attributes to be ignored when `maskAllText` is enabled */\nexport const DEFAULT_IGNORED_ATTRIBUTES = ['title', 'placeholder'];\n","var NodeType;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n const host = n?.host;\r\n return Boolean(host?.shadowRoot === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n if (cssText.includes(' background-clip: text;') &&\r\n !cssText.includes(' -webkit-background-clip: text;')) {\r\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n }\r\n return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n const { cssText } = rule;\r\n if (cssText.split('\"').length < 3)\r\n return cssText;\r\n const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n if (rule.layerName === '') {\r\n statement.push(`layer`);\r\n }\r\n else if (rule.layerName) {\r\n statement.push(`layer(${rule.layerName})`);\r\n }\r\n if (rule.supportsText) {\r\n statement.push(`supports(${rule.supportsText})`);\r\n }\r\n if (rule.media.length) {\r\n statement.push(rule.media.mediaText);\r\n }\r\n return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n try {\r\n const rules = s.rules || s.cssRules;\r\n return rules\r\n ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n}\r\nfunction stringifyRule(rule) {\r\n let importStringified;\r\n if (isCSSImportRule(rule)) {\r\n try {\r\n importStringified =\r\n stringifyStylesheet(rule.styleSheet) ||\r\n escapeImportStatement(rule);\r\n }\r\n catch (error) {\r\n }\r\n }\r\n else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n return fixSafariColons(rule.cssText);\r\n }\r\n return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n if (!n)\r\n return -1;\r\n const id = this.getMeta(n)?.id;\r\n return id ?? -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction createMirror() {\r\n return new Mirror();\r\n}\r\nfunction shouldMaskInput({ maskInputOptions, tagName, type, }) {\r\n if (tagName === 'OPTION') {\r\n tagName = 'SELECT';\r\n }\r\n return Boolean(maskInputOptions[tagName.toLowerCase()] ||\r\n (type && maskInputOptions[type]) ||\r\n type === 'password' ||\r\n (tagName === 'INPUT' && !type && maskInputOptions['text']));\r\n}\r\nfunction maskInputValue({ isMasked, element, value, maskInputFn, }) {\r\n let text = value || '';\r\n if (!isMasked) {\r\n return text;\r\n }\r\n if (maskInputFn) {\r\n text = maskInputFn(text, element);\r\n }\r\n return '*'.repeat(text.length);\r\n}\r\nfunction toLowerCase(str) {\r\n return str.toLowerCase();\r\n}\r\nfunction toUpperCase(str) {\r\n return str.toUpperCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx)\r\n return true;\r\n const chunkSize = 50;\r\n for (let x = 0; x < canvas.width; x += chunkSize) {\r\n for (let y = 0; y < canvas.height; y += chunkSize) {\r\n const getImageData = ctx.getImageData;\r\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n : getImageData;\r\n const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n if (pixelBuffer.some((pixel) => pixel !== 0))\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isNodeMetaEqual(a, b) {\r\n if (!a || !b || a.type !== b.type)\r\n return false;\r\n if (a.type === NodeType.Document)\r\n return a.compatMode === b.compatMode;\r\n else if (a.type === NodeType.DocumentType)\r\n return (a.name === b.name &&\r\n a.publicId === b.publicId &&\r\n a.systemId === b.systemId);\r\n else if (a.type === NodeType.Comment ||\r\n a.type === NodeType.Text ||\r\n a.type === NodeType.CDATA)\r\n return a.textContent === b.textContent;\r\n else if (a.type === NodeType.Element)\r\n return (a.tagName === b.tagName &&\r\n JSON.stringify(a.attributes) ===\r\n JSON.stringify(b.attributes) &&\r\n a.isSVG === b.isSVG &&\r\n a.needBlock === b.needBlock);\r\n return false;\r\n}\r\nfunction getInputType(element) {\r\n const type = element.type;\r\n return element.hasAttribute('data-rr-is-password')\r\n ? 'password'\r\n : type\r\n ?\r\n toLowerCase(type)\r\n : null;\r\n}\r\nfunction getInputValue(el, tagName, type) {\r\n if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\r\n return el.getAttribute('value') || '';\r\n }\r\n return el.value;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n if (element instanceof HTMLFormElement) {\r\n return 'form';\r\n }\r\n const processedTagName = toLowerCase(element.tagName);\r\n if (tagNameRegex.test(processedTagName)) {\r\n return 'div';\r\n }\r\n return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n let origin = '';\r\n if (url.indexOf('//') > -1) {\r\n origin = url.split('/').slice(0, 3).join('/');\r\n }\r\n else {\r\n origin = url.split('/')[0];\r\n }\r\n origin = origin.split('?')[0];\r\n return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n const filePath = path1 || path2 || path3;\r\n const maybeQuote = quote1 || quote2 || '';\r\n if (!filePath) {\r\n return origin;\r\n }\r\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (DATA_URI.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (filePath[0] === '/') {\r\n return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n }\r\n const stack = href.split('/');\r\n const parts = filePath.split('/');\r\n stack.pop();\r\n for (const part of parts) {\r\n if (part === '.') {\r\n continue;\r\n }\r\n else if (part === '..') {\r\n stack.pop();\r\n }\r\n else {\r\n stack.push(part);\r\n }\r\n }\r\n return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n if (attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n let pos = 0;\r\n function collectCharacters(regEx) {\r\n let chars;\r\n const match = regEx.exec(attributeValue.substring(pos));\r\n if (match) {\r\n chars = match[0];\r\n pos += chars.length;\r\n return chars;\r\n }\r\n return '';\r\n }\r\n const output = [];\r\n while (true) {\r\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n if (pos >= attributeValue.length) {\r\n break;\r\n }\r\n let url = collectCharacters(SRCSET_NOT_SPACES);\r\n if (url.slice(-1) === ',') {\r\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n output.push(url);\r\n }\r\n else {\r\n let descriptorsStr = '';\r\n url = absoluteToDoc(doc, url);\r\n let inParens = false;\r\n while (true) {\r\n const c = attributeValue.charAt(pos);\r\n if (c === '') {\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (!inParens) {\r\n if (c === ',') {\r\n pos += 1;\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (c === '(') {\r\n inParens = true;\r\n }\r\n }\r\n else {\r\n if (c === ')') {\r\n inParens = false;\r\n }\r\n }\r\n descriptorsStr += c;\r\n pos += 1;\r\n }\r\n }\r\n }\r\n return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n if (!attributeValue || attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n const a = doc.createElement('a');\r\n a.href = attributeValue;\r\n return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n const a = document.createElement('a');\r\n a.href = '';\r\n return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\r\n if (!value) {\r\n return value;\r\n }\r\n if (name === 'src' ||\r\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'xlink:href' && value[0] !== '#') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'background' &&\r\n (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'srcset') {\r\n return getAbsoluteSrcsetString(doc, value);\r\n }\r\n else if (name === 'style') {\r\n return absoluteToStylesheet(value, getHref());\r\n }\r\n else if (tagName === 'object' && name === 'data') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n if (typeof maskAttributeFn === 'function') {\r\n return maskAttributeFn(name, value, element);\r\n }\r\n return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\r\n try {\r\n if (unblockSelector && element.matches(unblockSelector)) {\r\n return false;\r\n }\r\n if (typeof blockClass === 'string') {\r\n if (element.classList.contains(blockClass)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n for (let eIndex = element.classList.length; eIndex--;) {\r\n const className = element.classList[eIndex];\r\n if (blockClass.test(className)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (blockSelector) {\r\n return element.matches(blockSelector);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction elementClassMatchesRegex(el, regex) {\r\n for (let eIndex = el.classList.length; eIndex--;) {\r\n const className = el.classList[eIndex];\r\n if (regex.test(className)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) {\r\n if (!node)\r\n return -1;\r\n if (node.nodeType !== node.ELEMENT_NODE)\r\n return -1;\r\n if (distance > limit)\r\n return -1;\r\n if (matchPredicate(node))\r\n return distance;\r\n return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\r\n}\r\nfunction createMatchPredicate(className, selector) {\r\n return (node) => {\r\n const el = node;\r\n if (el === null)\r\n return false;\r\n try {\r\n if (className) {\r\n if (typeof className === 'string') {\r\n if (el.matches(`.${className}`))\r\n return true;\r\n }\r\n else if (elementClassMatchesRegex(el, className)) {\r\n return true;\r\n }\r\n }\r\n if (selector && el.matches(selector))\r\n return true;\r\n return false;\r\n }\r\n catch {\r\n return false;\r\n }\r\n };\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\r\n try {\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n if (el === null)\r\n return false;\r\n if (el.tagName === 'INPUT') {\r\n const autocomplete = el.getAttribute('autocomplete');\r\n const disallowedAutocompleteValues = [\r\n 'current-password',\r\n 'new-password',\r\n 'cc-number',\r\n 'cc-exp',\r\n 'cc-exp-month',\r\n 'cc-exp-year',\r\n 'cc-csc',\r\n ];\r\n if (disallowedAutocompleteValues.includes(autocomplete)) {\r\n return true;\r\n }\r\n }\r\n let maskDistance = -1;\r\n let unmaskDistance = -1;\r\n if (maskAllText) {\r\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\r\n if (unmaskDistance < 0) {\r\n return true;\r\n }\r\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\r\n }\r\n else {\r\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\r\n if (maskDistance < 0) {\r\n return false;\r\n }\r\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\r\n }\r\n return maskDistance >= 0\r\n ? unmaskDistance >= 0\r\n ? maskDistance <= unmaskDistance\r\n : true\r\n : unmaskDistance >= 0\r\n ? false\r\n : !!maskAllText;\r\n }\r\n catch (e) {\r\n }\r\n return !!maskAllText;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n const win = iframeEl.contentWindow;\r\n if (!win) {\r\n return;\r\n }\r\n let fired = false;\r\n let readyState;\r\n try {\r\n readyState = win.document.readyState;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (readyState !== 'complete') {\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, iframeLoadTimeout);\r\n iframeEl.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n return;\r\n }\r\n const blankUrl = 'about:blank';\r\n if (win.location.href !== blankUrl ||\r\n iframeEl.src === blankUrl ||\r\n iframeEl.src === '') {\r\n setTimeout(listener, 0);\r\n return iframeEl.addEventListener('load', listener);\r\n }\r\n iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n let fired = false;\r\n let styleSheetLoaded;\r\n try {\r\n styleSheetLoaded = link.sheet;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (styleSheetLoaded)\r\n return;\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, styleSheetLoadTimeout);\r\n link.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n}\r\nfunction serializeNode(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n const rootId = getRootId(doc, mirror);\r\n switch (n.nodeType) {\r\n case n.DOCUMENT_NODE:\r\n if (n.compatMode !== 'CSS1Compat') {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n compatMode: n.compatMode,\r\n };\r\n }\r\n else {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n };\r\n }\r\n case n.DOCUMENT_TYPE_NODE:\r\n return {\r\n type: NodeType.DocumentType,\r\n name: n.name,\r\n publicId: n.publicId,\r\n systemId: n.systemId,\r\n rootId,\r\n };\r\n case n.ELEMENT_NODE:\r\n return serializeElementNode(n, {\r\n doc,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n inlineStylesheet,\r\n maskAttributeFn,\r\n maskInputOptions,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n rootId,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n });\r\n case n.TEXT_NODE:\r\n return serializeTextNode(n, {\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n maskTextFn,\r\n maskInputOptions,\r\n maskInputFn,\r\n rootId,\r\n });\r\n case n.CDATA_SECTION_NODE:\r\n return {\r\n type: NodeType.CDATA,\r\n textContent: '',\r\n rootId,\r\n };\r\n case n.COMMENT_NODE:\r\n return {\r\n type: NodeType.Comment,\r\n textContent: n.textContent || '',\r\n rootId,\r\n };\r\n default:\r\n return false;\r\n }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n if (!mirror.hasNode(doc))\r\n return undefined;\r\n const docId = mirror.getId(doc);\r\n return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options;\r\n const parentTagName = n.parentNode && n.parentNode.tagName;\r\n let textContent = n.textContent;\r\n const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\r\n if (isStyle && textContent) {\r\n try {\r\n if (n.nextSibling || n.previousSibling) {\r\n }\r\n else if (n.parentNode.sheet?.cssRules) {\r\n textContent = stringifyStylesheet(n.parentNode.sheet);\r\n }\r\n }\r\n catch (err) {\r\n console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n }\r\n textContent = absoluteToStylesheet(textContent, getHref());\r\n }\r\n if (isScript) {\r\n textContent = 'SCRIPT_PLACEHOLDER';\r\n }\r\n const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\r\n if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\r\n textContent = maskTextFn\r\n ? maskTextFn(textContent, n.parentElement)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\r\n textContent = maskInputFn\r\n ? maskInputFn(textContent, n.parentNode)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n if (parentTagName === 'OPTION' && textContent) {\r\n const isInputMasked = shouldMaskInput({\r\n type: null,\r\n tagName: parentTagName,\r\n maskInputOptions,\r\n });\r\n textContent = maskInputValue({\r\n isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\r\n element: n,\r\n value: textContent,\r\n maskInputFn,\r\n });\r\n }\r\n return {\r\n type: NodeType.Text,\r\n textContent: textContent || '',\r\n isStyle,\r\n rootId,\r\n };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options;\r\n const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\r\n const tagName = getValidTagName(n);\r\n let attributes = {};\r\n const len = n.attributes.length;\r\n for (let i = 0; i < len; i++) {\r\n const attr = n.attributes[i];\r\n if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) {\r\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\r\n }\r\n }\r\n if (tagName === 'link' && inlineStylesheet) {\r\n const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n return s.href === n.href;\r\n });\r\n let cssText = null;\r\n if (stylesheet) {\r\n cssText = stringifyStylesheet(stylesheet);\r\n }\r\n if (cssText) {\r\n delete attributes.rel;\r\n delete attributes.href;\r\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n }\r\n }\r\n if (tagName === 'style' &&\r\n n.sheet &&\r\n !(n.innerText || n.textContent || '').trim().length) {\r\n const cssText = stringifyStylesheet(n.sheet);\r\n if (cssText) {\r\n attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n }\r\n }\r\n if (tagName === 'input' ||\r\n tagName === 'textarea' ||\r\n tagName === 'select' ||\r\n tagName === 'option') {\r\n const el = n;\r\n const type = getInputType(el);\r\n const value = getInputValue(el, toUpperCase(tagName), type);\r\n const checked = el.checked;\r\n if (type !== 'submit' && type !== 'button' && value) {\r\n const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\r\n type,\r\n tagName: toUpperCase(tagName),\r\n maskInputOptions,\r\n }));\r\n attributes.value = maskInputValue({\r\n isMasked: forceMask,\r\n element: el,\r\n value,\r\n maskInputFn,\r\n });\r\n }\r\n if (checked) {\r\n attributes.checked = checked;\r\n }\r\n }\r\n if (tagName === 'option') {\r\n if (n.selected && !maskInputOptions['select']) {\r\n attributes.selected = true;\r\n }\r\n else {\r\n delete attributes.selected;\r\n }\r\n }\r\n if (tagName === 'canvas' && recordCanvas) {\r\n if (n.__context === '2d') {\r\n if (!is2DCanvasBlank(n)) {\r\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n }\r\n else if (!('__context' in n)) {\r\n const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n const blankCanvas = document.createElement('canvas');\r\n blankCanvas.width = n.width;\r\n blankCanvas.height = n.height;\r\n const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n if (canvasDataURL !== blankCanvasDataURL) {\r\n attributes.rr_dataURL = canvasDataURL;\r\n }\r\n }\r\n }\r\n if (tagName === 'img' && inlineImages) {\r\n if (!canvasService) {\r\n canvasService = doc.createElement('canvas');\r\n canvasCtx = canvasService.getContext('2d');\r\n }\r\n const image = n;\r\n const oldValue = image.crossOrigin;\r\n image.crossOrigin = 'anonymous';\r\n const recordInlineImage = () => {\r\n image.removeEventListener('load', recordInlineImage);\r\n try {\r\n canvasService.width = image.naturalWidth;\r\n canvasService.height = image.naturalHeight;\r\n canvasCtx.drawImage(image, 0, 0);\r\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n catch (err) {\r\n console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n }\r\n oldValue\r\n ? (attributes.crossOrigin = oldValue)\r\n : image.removeAttribute('crossorigin');\r\n };\r\n if (image.complete && image.naturalWidth !== 0)\r\n recordInlineImage();\r\n else\r\n image.addEventListener('load', recordInlineImage);\r\n }\r\n if (tagName === 'audio' || tagName === 'video') {\r\n attributes.rr_mediaState = n.paused\r\n ? 'paused'\r\n : 'played';\r\n attributes.rr_mediaCurrentTime = n.currentTime;\r\n }\r\n if (!newlyAddedElement) {\r\n if (n.scrollLeft) {\r\n attributes.rr_scrollLeft = n.scrollLeft;\r\n }\r\n if (n.scrollTop) {\r\n attributes.rr_scrollTop = n.scrollTop;\r\n }\r\n }\r\n if (needBlock) {\r\n const { width, height } = n.getBoundingClientRect();\r\n attributes = {\r\n class: attributes.class,\r\n rr_width: `${width}px`,\r\n rr_height: `${height}px`,\r\n };\r\n }\r\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n if (!n.contentDocument) {\r\n attributes.rr_src = attributes.src;\r\n }\r\n delete attributes.src;\r\n }\r\n let isCustomElement;\r\n try {\r\n if (customElements.get(tagName))\r\n isCustomElement = true;\r\n }\r\n catch (e) {\r\n }\r\n return {\r\n type: NodeType.Element,\r\n tagName,\r\n attributes,\r\n childNodes: [],\r\n isSVG: isSVGElement(n) || undefined,\r\n needBlock,\r\n rootId,\r\n isCustom: isCustomElement,\r\n };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n if (maybeAttr === undefined || maybeAttr === null) {\r\n return '';\r\n }\r\n else {\r\n return maybeAttr.toLowerCase();\r\n }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n return true;\r\n }\r\n else if (sn.type === NodeType.Element) {\r\n if (slimDOMOptions.script &&\r\n (sn.tagName === 'script' ||\r\n (sn.tagName === 'link' &&\r\n (sn.attributes.rel === 'preload' ||\r\n sn.attributes.rel === 'modulepreload') &&\r\n sn.attributes.as === 'script') ||\r\n (sn.tagName === 'link' &&\r\n sn.attributes.rel === 'prefetch' &&\r\n typeof sn.attributes.href === 'string' &&\r\n sn.attributes.href.endsWith('.js')))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headFavicon &&\r\n ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n (sn.tagName === 'meta' &&\r\n (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n return true;\r\n }\r\n else if (sn.tagName === 'meta') {\r\n if (slimDOMOptions.headMetaDescKeywords &&\r\n lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaSocial &&\r\n (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaRobots &&\r\n (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaHttpEquiv &&\r\n sn.attributes['http-equiv'] !== undefined) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaAuthorship &&\r\n (lowerIfExists(sn.attributes.name) === 'author' ||\r\n lowerIfExists(sn.attributes.name) === 'generator' ||\r\n lowerIfExists(sn.attributes.name) === 'framework' ||\r\n lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n lowerIfExists(sn.attributes.name) === 'progid' ||\r\n lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaVerification &&\r\n (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n lowerIfExists(sn.attributes.name) === 'verification' ||\r\n lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n let { preserveWhiteSpace = true } = options;\r\n const _serializedNode = serializeNode(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskAllText,\r\n unblockSelector,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n });\r\n if (!_serializedNode) {\r\n console.warn(n, 'not serialized');\r\n return null;\r\n }\r\n let id;\r\n if (mirror.hasNode(n)) {\r\n id = mirror.getId(n);\r\n }\r\n else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n (!preserveWhiteSpace &&\r\n _serializedNode.type === NodeType.Text &&\r\n !_serializedNode.isStyle &&\r\n !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n id = IGNORED_NODE;\r\n }\r\n else {\r\n id = genId();\r\n }\r\n const serializedNode = Object.assign(_serializedNode, { id });\r\n mirror.add(n, serializedNode);\r\n if (id === IGNORED_NODE) {\r\n return null;\r\n }\r\n if (onSerialize) {\r\n onSerialize(n);\r\n }\r\n let recordChild = !skipChild;\r\n if (serializedNode.type === NodeType.Element) {\r\n recordChild = recordChild && !serializedNode.needBlock;\r\n delete serializedNode.needBlock;\r\n const shadowRoot = n.shadowRoot;\r\n if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n serializedNode.isShadowHost = true;\r\n }\r\n if ((serializedNode.type === NodeType.Document ||\r\n serializedNode.type === NodeType.Element) &&\r\n recordChild) {\r\n if (slimDOMOptions.headWhitespace &&\r\n serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'head') {\r\n preserveWhiteSpace = false;\r\n }\r\n const bypassOptions = {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskAllText,\r\n unblockSelector,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n };\r\n for (const childN of Array.from(n.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n if (isElement(n) && n.shadowRoot) {\r\n for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n isNativeShadowDom(n.shadowRoot) &&\r\n (serializedChildNode.isShadow = true);\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n }\r\n if (n.parentNode &&\r\n isShadowRoot(n.parentNode) &&\r\n isNativeShadowDom(n.parentNode)) {\r\n serializedNode.isShadow = true;\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'iframe') {\r\n onceIframeLoaded(n, () => {\r\n const iframeDoc = n.contentDocument;\r\n if (iframeDoc && onIframeLoad) {\r\n const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n doc: iframeDoc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedIframeNode) {\r\n onIframeLoad(n, serializedIframeNode);\r\n }\r\n }\r\n }, iframeLoadTimeout);\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'link' &&\r\n serializedNode.attributes.rel === 'stylesheet') {\r\n onceStylesheetLoaded(n, () => {\r\n if (onStylesheetLoad) {\r\n const serializedLinkNode = serializeNodeWithId(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedLinkNode) {\r\n onStylesheetLoad(n, serializedLinkNode);\r\n }\r\n }\r\n }, stylesheetLoadTimeout);\r\n }\r\n return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n }\r\n : maskAllInputs === false\r\n ? {}\r\n : maskAllInputs;\r\n const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n ?\r\n {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaDescKeywords: slimDOM === 'all',\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaAuthorship: true,\r\n headMetaVerification: true,\r\n }\r\n : slimDOM === false\r\n ? {}\r\n : slimDOM;\r\n return serializeNodeWithId(n, {\r\n doc: n,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n newlyAddedElement: false,\r\n });\r\n}\r\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\r\nfunction parse(css, options = {}) {\r\n let lineno = 1;\r\n let column = 1;\r\n function updatePosition(str) {\r\n const lines = str.match(/\\n/g);\r\n if (lines) {\r\n lineno += lines.length;\r\n }\r\n const i = str.lastIndexOf('\\n');\r\n column = i === -1 ? column + str.length : str.length - i;\r\n }\r\n function position() {\r\n const start = { line: lineno, column };\r\n return (node) => {\r\n node.position = new Position(start);\r\n whitespace();\r\n return node;\r\n };\r\n }\r\n class Position {\r\n constructor(start) {\r\n this.start = start;\r\n this.end = { line: lineno, column };\r\n this.source = options.source;\r\n }\r\n }\r\n Position.prototype.content = css;\r\n const errorsList = [];\r\n function error(msg) {\r\n const err = new Error(`${options.source || ''}:${lineno}:${column}: ${msg}`);\r\n err.reason = msg;\r\n err.filename = options.source;\r\n err.line = lineno;\r\n err.column = column;\r\n err.source = css;\r\n if (options.silent) {\r\n errorsList.push(err);\r\n }\r\n else {\r\n throw err;\r\n }\r\n }\r\n function stylesheet() {\r\n const rulesList = rules();\r\n return {\r\n type: 'stylesheet',\r\n stylesheet: {\r\n source: options.source,\r\n rules: rulesList,\r\n parsingErrors: errorsList,\r\n },\r\n };\r\n }\r\n function open() {\r\n return match(/^{\\s*/);\r\n }\r\n function close() {\r\n return match(/^}/);\r\n }\r\n function rules() {\r\n let node;\r\n const rules = [];\r\n whitespace();\r\n comments(rules);\r\n while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\r\n if (node) {\r\n rules.push(node);\r\n comments(rules);\r\n }\r\n }\r\n return rules;\r\n }\r\n function match(re) {\r\n const m = re.exec(css);\r\n if (!m) {\r\n return;\r\n }\r\n const str = m[0];\r\n updatePosition(str);\r\n css = css.slice(str.length);\r\n return m;\r\n }\r\n function whitespace() {\r\n match(/^\\s*/);\r\n }\r\n function comments(rules = []) {\r\n let c;\r\n while ((c = comment())) {\r\n if (c) {\r\n rules.push(c);\r\n }\r\n c = comment();\r\n }\r\n return rules;\r\n }\r\n function comment() {\r\n const pos = position();\r\n if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\r\n return;\r\n }\r\n let i = 2;\r\n while ('' !== css.charAt(i) &&\r\n ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\r\n ++i;\r\n }\r\n i += 2;\r\n if ('' === css.charAt(i - 1)) {\r\n return error('End of comment missing');\r\n }\r\n const str = css.slice(2, i - 2);\r\n column += 2;\r\n updatePosition(str);\r\n css = css.slice(i);\r\n column += 2;\r\n return pos({\r\n type: 'comment',\r\n comment: str,\r\n });\r\n }\r\n function selector() {\r\n whitespace();\r\n while (css[0] == '}') {\r\n error('extra closing bracket');\r\n css = css.slice(1);\r\n whitespace();\r\n }\r\n const m = match(/^((\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'|[^{])+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const cleanedInput = m[0]\r\n .trim()\r\n .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\r\n .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\r\n return m.replace(/,/g, '\\u200C');\r\n });\r\n return customSplit(cleanedInput).map((s) => s.replace(/\\u200C/g, ',').trim());\r\n }\r\n function customSplit(input) {\r\n const result = [];\r\n let currentSegment = '';\r\n let depthParentheses = 0;\r\n let depthBrackets = 0;\r\n let currentStringChar = null;\r\n for (const char of input) {\r\n const hasStringEscape = currentSegment.endsWith('\\\\');\r\n if (currentStringChar) {\r\n if (currentStringChar === char && !hasStringEscape) {\r\n currentStringChar = null;\r\n }\r\n }\r\n else if (char === '(') {\r\n depthParentheses++;\r\n }\r\n else if (char === ')') {\r\n depthParentheses--;\r\n }\r\n else if (char === '[') {\r\n depthBrackets++;\r\n }\r\n else if (char === ']') {\r\n depthBrackets--;\r\n }\r\n else if ('\\'\"'.includes(char)) {\r\n currentStringChar = char;\r\n }\r\n if (char === ',' && depthParentheses === 0 && depthBrackets === 0) {\r\n result.push(currentSegment);\r\n currentSegment = '';\r\n }\r\n else {\r\n currentSegment += char;\r\n }\r\n }\r\n if (currentSegment) {\r\n result.push(currentSegment);\r\n }\r\n return result;\r\n }\r\n function declaration() {\r\n const pos = position();\r\n const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\r\n if (!propMatch) {\r\n return;\r\n }\r\n const prop = trim(propMatch[0]);\r\n if (!match(/^:\\s*/)) {\r\n return error(`property missing ':'`);\r\n }\r\n const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\r\n const ret = pos({\r\n type: 'declaration',\r\n property: prop.replace(commentre, ''),\r\n value: val ? trim(val[0]).replace(commentre, '') : '',\r\n });\r\n match(/^[;\\s]*/);\r\n return ret;\r\n }\r\n function declarations() {\r\n const decls = [];\r\n if (!open()) {\r\n return error(`missing '{'`);\r\n }\r\n comments(decls);\r\n let decl;\r\n while ((decl = declaration())) {\r\n if (decl !== false) {\r\n decls.push(decl);\r\n comments(decls);\r\n }\r\n decl = declaration();\r\n }\r\n if (!close()) {\r\n return error(`missing '}'`);\r\n }\r\n return decls;\r\n }\r\n function keyframe() {\r\n let m;\r\n const vals = [];\r\n const pos = position();\r\n while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\r\n vals.push(m[1]);\r\n match(/^,\\s*/);\r\n }\r\n if (!vals.length) {\r\n return;\r\n }\r\n return pos({\r\n type: 'keyframe',\r\n values: vals,\r\n declarations: declarations(),\r\n });\r\n }\r\n function atkeyframes() {\r\n const pos = position();\r\n let m = match(/^@([-\\w]+)?keyframes\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = m[1];\r\n m = match(/^([-\\w]+)\\s*/);\r\n if (!m) {\r\n return error('@keyframes missing name');\r\n }\r\n const name = m[1];\r\n if (!open()) {\r\n return error(`@keyframes missing '{'`);\r\n }\r\n let frame;\r\n let frames = comments();\r\n while ((frame = keyframe())) {\r\n frames.push(frame);\r\n frames = frames.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@keyframes missing '}'`);\r\n }\r\n return pos({\r\n type: 'keyframes',\r\n name,\r\n vendor,\r\n keyframes: frames,\r\n });\r\n }\r\n function atsupports() {\r\n const pos = position();\r\n const m = match(/^@supports *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const supports = trim(m[1]);\r\n if (!open()) {\r\n return error(`@supports missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@supports missing '}'`);\r\n }\r\n return pos({\r\n type: 'supports',\r\n supports,\r\n rules: style,\r\n });\r\n }\r\n function athost() {\r\n const pos = position();\r\n const m = match(/^@host\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@host missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@host missing '}'`);\r\n }\r\n return pos({\r\n type: 'host',\r\n rules: style,\r\n });\r\n }\r\n function atmedia() {\r\n const pos = position();\r\n const m = match(/^@media *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const media = trim(m[1]);\r\n if (!open()) {\r\n return error(`@media missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@media missing '}'`);\r\n }\r\n return pos({\r\n type: 'media',\r\n media,\r\n rules: style,\r\n });\r\n }\r\n function atcustommedia() {\r\n const pos = position();\r\n const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\r\n if (!m) {\r\n return;\r\n }\r\n return pos({\r\n type: 'custom-media',\r\n name: trim(m[1]),\r\n media: trim(m[2]),\r\n });\r\n }\r\n function atpage() {\r\n const pos = position();\r\n const m = match(/^@page */);\r\n if (!m) {\r\n return;\r\n }\r\n const sel = selector() || [];\r\n if (!open()) {\r\n return error(`@page missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@page missing '}'`);\r\n }\r\n return pos({\r\n type: 'page',\r\n selectors: sel,\r\n declarations: decls,\r\n });\r\n }\r\n function atdocument() {\r\n const pos = position();\r\n const m = match(/^@([-\\w]+)?document *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = trim(m[1]);\r\n const doc = trim(m[2]);\r\n if (!open()) {\r\n return error(`@document missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@document missing '}'`);\r\n }\r\n return pos({\r\n type: 'document',\r\n document: doc,\r\n vendor,\r\n rules: style,\r\n });\r\n }\r\n function atfontface() {\r\n const pos = position();\r\n const m = match(/^@font-face\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@font-face missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@font-face missing '}'`);\r\n }\r\n return pos({\r\n type: 'font-face',\r\n declarations: decls,\r\n });\r\n }\r\n const atimport = _compileAtrule('import');\r\n const atcharset = _compileAtrule('charset');\r\n const atnamespace = _compileAtrule('namespace');\r\n function _compileAtrule(name) {\r\n const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\r\n return () => {\r\n const pos = position();\r\n const m = match(re);\r\n if (!m) {\r\n return;\r\n }\r\n const ret = { type: name };\r\n ret[name] = m[1].trim();\r\n return pos(ret);\r\n };\r\n }\r\n function atrule() {\r\n if (css[0] !== '@') {\r\n return;\r\n }\r\n return (atkeyframes() ||\r\n atmedia() ||\r\n atcustommedia() ||\r\n atsupports() ||\r\n atimport() ||\r\n atcharset() ||\r\n atnamespace() ||\r\n atdocument() ||\r\n atpage() ||\r\n athost() ||\r\n atfontface());\r\n }\r\n function rule() {\r\n const pos = position();\r\n const sel = selector();\r\n if (!sel) {\r\n return error('selector missing');\r\n }\r\n comments();\r\n return pos({\r\n type: 'rule',\r\n selectors: sel,\r\n declarations: declarations(),\r\n });\r\n }\r\n return addParent(stylesheet());\r\n}\r\nfunction trim(str) {\r\n return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\r\n}\r\nfunction addParent(obj, parent) {\r\n const isNode = obj && typeof obj.type === 'string';\r\n const childParent = isNode ? obj : parent;\r\n for (const k of Object.keys(obj)) {\r\n const value = obj[k];\r\n if (Array.isArray(value)) {\r\n value.forEach((v) => {\r\n addParent(v, childParent);\r\n });\r\n }\r\n else if (value && typeof value === 'object') {\r\n addParent(value, childParent);\r\n }\r\n }\r\n if (isNode) {\r\n Object.defineProperty(obj, 'parent', {\r\n configurable: true,\r\n writable: true,\r\n enumerable: false,\r\n value: parent || null,\r\n });\r\n }\r\n return obj;\r\n}\n\nconst tagMap = {\r\n script: 'noscript',\r\n altglyph: 'altGlyph',\r\n altglyphdef: 'altGlyphDef',\r\n altglyphitem: 'altGlyphItem',\r\n animatecolor: 'animateColor',\r\n animatemotion: 'animateMotion',\r\n animatetransform: 'animateTransform',\r\n clippath: 'clipPath',\r\n feblend: 'feBlend',\r\n fecolormatrix: 'feColorMatrix',\r\n fecomponenttransfer: 'feComponentTransfer',\r\n fecomposite: 'feComposite',\r\n feconvolvematrix: 'feConvolveMatrix',\r\n fediffuselighting: 'feDiffuseLighting',\r\n fedisplacementmap: 'feDisplacementMap',\r\n fedistantlight: 'feDistantLight',\r\n fedropshadow: 'feDropShadow',\r\n feflood: 'feFlood',\r\n fefunca: 'feFuncA',\r\n fefuncb: 'feFuncB',\r\n fefuncg: 'feFuncG',\r\n fefuncr: 'feFuncR',\r\n fegaussianblur: 'feGaussianBlur',\r\n feimage: 'feImage',\r\n femerge: 'feMerge',\r\n femergenode: 'feMergeNode',\r\n femorphology: 'feMorphology',\r\n feoffset: 'feOffset',\r\n fepointlight: 'fePointLight',\r\n fespecularlighting: 'feSpecularLighting',\r\n fespotlight: 'feSpotLight',\r\n fetile: 'feTile',\r\n feturbulence: 'feTurbulence',\r\n foreignobject: 'foreignObject',\r\n glyphref: 'glyphRef',\r\n lineargradient: 'linearGradient',\r\n radialgradient: 'radialGradient',\r\n};\r\nfunction getTagName(n) {\r\n let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\r\n if (tagName === 'link' && n.attributes._cssText) {\r\n tagName = 'style';\r\n }\r\n return tagName;\r\n}\r\nfunction escapeRegExp(str) {\r\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\r\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\r\nfunction addHoverClass(cssText, cache) {\r\n const cachedStyle = cache?.stylesWithHoverClass.get(cssText);\r\n if (cachedStyle)\r\n return cachedStyle;\r\n if (cssText.length >= 1000000) {\r\n return cssText;\r\n }\r\n const ast = parse(cssText, {\r\n silent: true,\r\n });\r\n if (!ast.stylesheet) {\r\n return cssText;\r\n }\r\n const selectors = [];\r\n ast.stylesheet.rules.forEach((rule) => {\r\n if ('selectors' in rule) {\r\n (rule.selectors || []).forEach((selector) => {\r\n if (HOVER_SELECTOR.test(selector)) {\r\n selectors.push(selector);\r\n }\r\n });\r\n }\r\n });\r\n if (selectors.length === 0) {\r\n return cssText;\r\n }\r\n const selectorMatcher = new RegExp(selectors\r\n .filter((selector, index) => selectors.indexOf(selector) === index)\r\n .sort((a, b) => b.length - a.length)\r\n .map((selector) => {\r\n return escapeRegExp(selector);\r\n })\r\n .join('|'), 'g');\r\n const result = cssText.replace(selectorMatcher, (selector) => {\r\n const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\r\n return `${selector}, ${newSelector}`;\r\n });\r\n cache?.stylesWithHoverClass.set(cssText, result);\r\n return result;\r\n}\r\nfunction createCache() {\r\n const stylesWithHoverClass = new Map();\r\n return {\r\n stylesWithHoverClass,\r\n };\r\n}\r\nfunction buildNode(n, options) {\r\n const { doc, hackCss, cache } = options;\r\n switch (n.type) {\r\n case NodeType.Document:\r\n return doc.implementation.createDocument(null, '', null);\r\n case NodeType.DocumentType:\r\n return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\r\n case NodeType.Element: {\r\n const tagName = getTagName(n);\r\n let node;\r\n if (n.isSVG) {\r\n node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\r\n }\r\n else {\r\n if (n.isCustom &&\r\n doc.defaultView?.customElements &&\r\n !doc.defaultView.customElements.get(n.tagName))\r\n doc.defaultView.customElements.define(n.tagName, class extends doc.defaultView.HTMLElement {\r\n });\r\n node = doc.createElement(tagName);\r\n }\r\n const specialAttributes = {};\r\n for (const name in n.attributes) {\r\n if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {\r\n continue;\r\n }\r\n let value = n.attributes[name];\r\n if (tagName === 'option' &&\r\n name === 'selected' &&\r\n value === false) {\r\n continue;\r\n }\r\n if (value === null) {\r\n continue;\r\n }\r\n if (value === true)\r\n value = '';\r\n if (name.startsWith('rr_')) {\r\n specialAttributes[name] = value;\r\n continue;\r\n }\r\n const isTextarea = tagName === 'textarea' && name === 'value';\r\n const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\r\n if (isRemoteOrDynamicCss && hackCss && typeof value === 'string') {\r\n value = addHoverClass(value, cache);\r\n }\r\n if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {\r\n const child = doc.createTextNode(value);\r\n for (const c of Array.from(node.childNodes)) {\r\n if (c.nodeType === node.TEXT_NODE) {\r\n node.removeChild(c);\r\n }\r\n }\r\n node.appendChild(child);\r\n continue;\r\n }\r\n try {\r\n if (n.isSVG && name === 'xlink:href') {\r\n node.setAttributeNS('http://www.w3.org/1999/xlink', name, value.toString());\r\n }\r\n else if (name === 'onload' ||\r\n name === 'onclick' ||\r\n name.substring(0, 7) === 'onmouse') {\r\n node.setAttribute('_' + name, value.toString());\r\n }\r\n else if (tagName === 'meta' &&\r\n n.attributes['http-equiv'] === 'Content-Security-Policy' &&\r\n name === 'content') {\r\n node.setAttribute('csp-content', value.toString());\r\n continue;\r\n }\r\n else if (tagName === 'link' &&\r\n (n.attributes.rel === 'preload' ||\r\n n.attributes.rel === 'modulepreload') &&\r\n n.attributes.as === 'script') {\r\n }\r\n else if (tagName === 'link' &&\r\n n.attributes.rel === 'prefetch' &&\r\n typeof n.attributes.href === 'string' &&\r\n n.attributes.href.endsWith('.js')) {\r\n }\r\n else if (tagName === 'img' &&\r\n n.attributes.srcset &&\r\n n.attributes.rr_dataURL) {\r\n node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\r\n }\r\n else {\r\n node.setAttribute(name, value.toString());\r\n }\r\n }\r\n catch (error) {\r\n }\r\n }\r\n for (const name in specialAttributes) {\r\n const value = specialAttributes[name];\r\n if (tagName === 'canvas' && name === 'rr_dataURL') {\r\n const image = document.createElement('img');\r\n image.onload = () => {\r\n const ctx = node.getContext('2d');\r\n if (ctx) {\r\n ctx.drawImage(image, 0, 0, image.width, image.height);\r\n }\r\n };\r\n image.src = value.toString();\r\n if (node.RRNodeType)\r\n node.rr_dataURL = value.toString();\r\n }\r\n else if (tagName === 'img' && name === 'rr_dataURL') {\r\n const image = node;\r\n if (!image.currentSrc.startsWith('data:')) {\r\n image.setAttribute('rrweb-original-src', n.attributes.src);\r\n image.src = value.toString();\r\n }\r\n }\r\n if (name === 'rr_width') {\r\n node.style.setProperty('width', value.toString());\r\n }\r\n else if (name === 'rr_height') {\r\n node.style.setProperty('height', value.toString());\r\n }\r\n else if (name === 'rr_mediaCurrentTime' &&\r\n typeof value === 'number') {\r\n node.currentTime = value;\r\n }\r\n else if (name === 'rr_mediaState') {\r\n switch (value) {\r\n case 'played':\r\n node\r\n .play()\r\n .catch((e) => console.warn('media playback error', e));\r\n break;\r\n case 'paused':\r\n node.pause();\r\n break;\r\n }\r\n }\r\n }\r\n if (n.isShadowHost) {\r\n if (!node.shadowRoot) {\r\n node.attachShadow({ mode: 'open' });\r\n }\r\n else {\r\n while (node.shadowRoot.firstChild) {\r\n node.shadowRoot.removeChild(node.shadowRoot.firstChild);\r\n }\r\n }\r\n }\r\n return node;\r\n }\r\n case NodeType.Text:\r\n return doc.createTextNode(n.isStyle && hackCss\r\n ? addHoverClass(n.textContent, cache)\r\n : n.textContent);\r\n case NodeType.CDATA:\r\n return doc.createCDATASection(n.textContent);\r\n case NodeType.Comment:\r\n return doc.createComment(n.textContent);\r\n default:\r\n return null;\r\n }\r\n}\r\nfunction buildNodeWithSN(n, options) {\r\n const { doc, mirror, skipChild = false, hackCss = true, afterAppend, cache, } = options;\r\n if (mirror.has(n.id)) {\r\n const nodeInMirror = mirror.getNode(n.id);\r\n const meta = mirror.getMeta(nodeInMirror);\r\n if (isNodeMetaEqual(meta, n))\r\n return mirror.getNode(n.id);\r\n }\r\n let node = buildNode(n, { doc, hackCss, cache });\r\n if (!node) {\r\n return null;\r\n }\r\n if (n.rootId && mirror.getNode(n.rootId) !== doc) {\r\n mirror.replace(n.rootId, doc);\r\n }\r\n if (n.type === NodeType.Document) {\r\n doc.close();\r\n doc.open();\r\n if (n.compatMode === 'BackCompat' &&\r\n n.childNodes &&\r\n n.childNodes[0].type !== NodeType.DocumentType) {\r\n if (n.childNodes[0].type === NodeType.Element &&\r\n 'xmlns' in n.childNodes[0].attributes &&\r\n n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\r\n doc.write('');\r\n }\r\n else {\r\n doc.write('');\r\n }\r\n }\r\n node = doc;\r\n }\r\n mirror.add(node, n);\r\n if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\r\n !skipChild) {\r\n for (const childN of n.childNodes) {\r\n const childNode = buildNodeWithSN(childN, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n if (!childNode) {\r\n console.warn('Failed to rebuild', childN);\r\n continue;\r\n }\r\n if (childN.isShadow && isElement(node) && node.shadowRoot) {\r\n node.shadowRoot.appendChild(childNode);\r\n }\r\n else if (n.type === NodeType.Document &&\r\n childN.type == NodeType.Element) {\r\n const htmlElement = childNode;\r\n let body = null;\r\n htmlElement.childNodes.forEach((child) => {\r\n if (child.nodeName === 'BODY')\r\n body = child;\r\n });\r\n if (body) {\r\n htmlElement.removeChild(body);\r\n node.appendChild(childNode);\r\n htmlElement.appendChild(body);\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n if (afterAppend) {\r\n afterAppend(childNode, childN.id);\r\n }\r\n }\r\n }\r\n return node;\r\n}\r\nfunction visit(mirror, onVisit) {\r\n function walk(node) {\r\n onVisit(node);\r\n }\r\n for (const id of mirror.getIds()) {\r\n if (mirror.has(id)) {\r\n walk(mirror.getNode(id));\r\n }\r\n }\r\n}\r\nfunction handleScroll(node, mirror) {\r\n const n = mirror.getMeta(node);\r\n if (n?.type !== NodeType.Element) {\r\n return;\r\n }\r\n const el = node;\r\n for (const name in n.attributes) {\r\n if (!(Object.prototype.hasOwnProperty.call(n.attributes, name) &&\r\n name.startsWith('rr_'))) {\r\n continue;\r\n }\r\n const value = n.attributes[name];\r\n if (name === 'rr_scrollLeft') {\r\n el.scrollLeft = value;\r\n }\r\n if (name === 'rr_scrollTop') {\r\n el.scrollTop = value;\r\n }\r\n }\r\n}\r\nfunction rebuild(n, options) {\r\n const { doc, onVisit, hackCss = true, afterAppend, cache, mirror = new Mirror(), } = options;\r\n const node = buildNodeWithSN(n, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n visit(mirror, (visitedNode) => {\r\n if (onVisit) {\r\n onVisit(visitedNode);\r\n }\r\n handleScroll(visitedNode, mirror);\r\n });\r\n return node;\r\n}\n\nexport { IGNORED_NODE, Mirror, NodeType, addHoverClass, buildNodeWithSN, createCache, createMatchPredicate, createMirror, distanceToMatch, escapeImportStatement, fixSafariColons, genId, getInputType, getInputValue, ignoreAttribute, is2DCanvasBlank, isCSSImportRule, isCSSStyleRule, isElement, isNativeShadowDom, isNodeMetaEqual, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, shouldMaskInput, snapshot, stringifyRule, stringifyStylesheet, toLowerCase, toUpperCase, transformAttribute };\n","import { distanceToMatch, IGNORED_NODE, isShadowRoot, createMatchPredicate } from '../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nfunction on(type, fn, target = document) {\r\n const options = { capture: true, passive: true };\r\n target.addEventListener(type, fn, options);\r\n return () => target.removeEventListener(type, fn, options);\r\n}\r\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\r\n '\\r\\n' +\r\n 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\r\n '\\r\\n' +\r\n 'or you can use record.mirror to access the mirror instance during recording.';\r\nlet _mirror = {\r\n map: {},\r\n getId() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return -1;\r\n },\r\n getNode() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return null;\r\n },\r\n removeNodeFromMap() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n has() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return false;\r\n },\r\n reset() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n};\r\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\r\n _mirror = new Proxy(_mirror, {\r\n get(target, prop, receiver) {\r\n if (prop === 'map') {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n }\r\n return Reflect.get(target, prop, receiver);\r\n },\r\n });\r\n}\r\nfunction throttle(func, wait, options = {}) {\r\n let timeout = null;\r\n let previous = 0;\r\n return function (...args) {\r\n const now = Date.now();\r\n if (!previous && options.leading === false) {\r\n previous = now;\r\n }\r\n const remaining = wait - (now - previous);\r\n const context = this;\r\n if (remaining <= 0 || remaining > wait) {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n timeout = null;\r\n }\r\n previous = now;\r\n func.apply(context, args);\r\n }\r\n else if (!timeout && options.trailing !== false) {\r\n timeout = setTimeout(() => {\r\n previous = options.leading === false ? 0 : Date.now();\r\n timeout = null;\r\n func.apply(context, args);\r\n }, remaining);\r\n }\r\n };\r\n}\r\nfunction hookSetter(target, key, d, isRevoked, win = window) {\r\n const original = win.Object.getOwnPropertyDescriptor(target, key);\r\n win.Object.defineProperty(target, key, isRevoked\r\n ? d\r\n : {\r\n set(value) {\r\n setTimeout(() => {\r\n d.set.call(this, value);\r\n }, 0);\r\n if (original && original.set) {\r\n original.set.call(this, value);\r\n }\r\n },\r\n });\r\n return () => hookSetter(target, key, original || {}, true);\r\n}\r\nfunction patch(source, name, replacement) {\r\n try {\r\n if (!(name in source)) {\r\n return () => {\r\n };\r\n }\r\n const original = source[name];\r\n const wrapped = replacement(original);\r\n if (typeof wrapped === 'function') {\r\n wrapped.prototype = wrapped.prototype || {};\r\n Object.defineProperties(wrapped, {\r\n __rrweb_original__: {\r\n enumerable: false,\r\n value: original,\r\n },\r\n });\r\n }\r\n source[name] = wrapped;\r\n return () => {\r\n source[name] = original;\r\n };\r\n }\r\n catch {\r\n return () => {\r\n };\r\n }\r\n}\r\nlet nowTimestamp = Date.now;\r\nif (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {\r\n nowTimestamp = () => new Date().getTime();\r\n}\r\nfunction getWindowScroll(win) {\r\n const doc = win.document;\r\n return {\r\n left: doc.scrollingElement\r\n ? doc.scrollingElement.scrollLeft\r\n : win.pageXOffset !== undefined\r\n ? win.pageXOffset\r\n : doc?.documentElement.scrollLeft ||\r\n doc?.body?.parentElement?.scrollLeft ||\r\n doc?.body?.scrollLeft ||\r\n 0,\r\n top: doc.scrollingElement\r\n ? doc.scrollingElement.scrollTop\r\n : win.pageYOffset !== undefined\r\n ? win.pageYOffset\r\n : doc?.documentElement.scrollTop ||\r\n doc?.body?.parentElement?.scrollTop ||\r\n doc?.body?.scrollTop ||\r\n 0,\r\n };\r\n}\r\nfunction getWindowHeight() {\r\n return (window.innerHeight ||\r\n (document.documentElement && document.documentElement.clientHeight) ||\r\n (document.body && document.body.clientHeight));\r\n}\r\nfunction getWindowWidth() {\r\n return (window.innerWidth ||\r\n (document.documentElement && document.documentElement.clientWidth) ||\r\n (document.body && document.body.clientWidth));\r\n}\r\nfunction closestElementOfNode(node) {\r\n if (!node) {\r\n return null;\r\n }\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n return el;\r\n}\r\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector, checkAncestors) {\r\n if (!node) {\r\n return false;\r\n }\r\n const el = closestElementOfNode(node);\r\n if (!el) {\r\n return false;\r\n }\r\n const blockedPredicate = createMatchPredicate(blockClass, blockSelector);\r\n if (!checkAncestors) {\r\n const isUnblocked = unblockSelector && el.matches(unblockSelector);\r\n return blockedPredicate(el) && !isUnblocked;\r\n }\r\n const blockDistance = distanceToMatch(el, blockedPredicate);\r\n let unblockDistance = -1;\r\n if (blockDistance < 0) {\r\n return false;\r\n }\r\n if (unblockSelector) {\r\n unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector));\r\n }\r\n if (blockDistance > -1 && unblockDistance < 0) {\r\n return true;\r\n }\r\n return blockDistance < unblockDistance;\r\n}\r\nfunction isSerialized(n, mirror) {\r\n return mirror.getId(n) !== -1;\r\n}\r\nfunction isIgnored(n, mirror) {\r\n return mirror.getId(n) === IGNORED_NODE;\r\n}\r\nfunction isAncestorRemoved(target, mirror) {\r\n if (isShadowRoot(target)) {\r\n return false;\r\n }\r\n const id = mirror.getId(target);\r\n if (!mirror.has(id)) {\r\n return true;\r\n }\r\n if (target.parentNode &&\r\n target.parentNode.nodeType === target.DOCUMENT_NODE) {\r\n return false;\r\n }\r\n if (!target.parentNode) {\r\n return true;\r\n }\r\n return isAncestorRemoved(target.parentNode, mirror);\r\n}\r\nfunction legacy_isTouchEvent(event) {\r\n return Boolean(event.changedTouches);\r\n}\r\nfunction polyfill(win = window) {\r\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\r\n win.NodeList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\r\n win.DOMTokenList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if (!Node.prototype.contains) {\r\n Node.prototype.contains = (...args) => {\r\n let node = args[0];\r\n if (!(0 in args)) {\r\n throw new TypeError('1 argument is required');\r\n }\r\n do {\r\n if (this === node) {\r\n return true;\r\n }\r\n } while ((node = node && node.parentNode));\r\n return false;\r\n };\r\n }\r\n}\r\nfunction queueToResolveTrees(queue) {\r\n const queueNodeMap = {};\r\n const putIntoMap = (m, parent) => {\r\n const nodeInTree = {\r\n value: m,\r\n parent,\r\n children: [],\r\n };\r\n queueNodeMap[m.node.id] = nodeInTree;\r\n return nodeInTree;\r\n };\r\n const queueNodeTrees = [];\r\n for (const mutation of queue) {\r\n const { nextId, parentId } = mutation;\r\n if (nextId && nextId in queueNodeMap) {\r\n const nextInTree = queueNodeMap[nextId];\r\n if (nextInTree.parent) {\r\n const idx = nextInTree.parent.children.indexOf(nextInTree);\r\n nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));\r\n }\r\n else {\r\n const idx = queueNodeTrees.indexOf(nextInTree);\r\n queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\r\n }\r\n continue;\r\n }\r\n if (parentId in queueNodeMap) {\r\n const parentInTree = queueNodeMap[parentId];\r\n parentInTree.children.push(putIntoMap(mutation, parentInTree));\r\n continue;\r\n }\r\n queueNodeTrees.push(putIntoMap(mutation, null));\r\n }\r\n return queueNodeTrees;\r\n}\r\nfunction iterateResolveTree(tree, cb) {\r\n cb(tree.value);\r\n for (let i = tree.children.length - 1; i >= 0; i--) {\r\n iterateResolveTree(tree.children[i], cb);\r\n }\r\n}\r\nfunction isSerializedIframe(n, mirror) {\r\n return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\r\n}\r\nfunction isSerializedStylesheet(n, mirror) {\r\n return Boolean(n.nodeName === 'LINK' &&\r\n n.nodeType === n.ELEMENT_NODE &&\r\n n.getAttribute &&\r\n n.getAttribute('rel') === 'stylesheet' &&\r\n mirror.getMeta(n));\r\n}\r\nfunction getBaseDimension(node, rootIframe) {\r\n const frameElement = node.ownerDocument?.defaultView?.frameElement;\r\n if (!frameElement || frameElement === rootIframe) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n relativeScale: 1,\r\n absoluteScale: 1,\r\n };\r\n }\r\n const frameDimension = frameElement.getBoundingClientRect();\r\n const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\r\n const relativeScale = frameDimension.height / frameElement.clientHeight;\r\n return {\r\n x: frameDimension.x * frameBaseDimension.relativeScale +\r\n frameBaseDimension.x,\r\n y: frameDimension.y * frameBaseDimension.relativeScale +\r\n frameBaseDimension.y,\r\n relativeScale,\r\n absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\r\n };\r\n}\r\nfunction hasShadowRoot(n) {\r\n return Boolean(n?.shadowRoot);\r\n}\r\nfunction getNestedRule(rules, position) {\r\n const rule = rules[position[0]];\r\n if (position.length === 1) {\r\n return rule;\r\n }\r\n else {\r\n return getNestedRule(rule.cssRules[position[1]].cssRules, position.slice(2));\r\n }\r\n}\r\nfunction getPositionsAndIndex(nestedIndex) {\r\n const positions = [...nestedIndex];\r\n const index = positions.pop();\r\n return { positions, index };\r\n}\r\nfunction uniqueTextMutations(mutations) {\r\n const idSet = new Set();\r\n const uniqueMutations = [];\r\n for (let i = mutations.length; i--;) {\r\n const mutation = mutations[i];\r\n if (!idSet.has(mutation.id)) {\r\n uniqueMutations.push(mutation);\r\n idSet.add(mutation.id);\r\n }\r\n }\r\n return uniqueMutations;\r\n}\r\nclass StyleSheetMirror {\r\n constructor() {\r\n this.id = 1;\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n }\r\n getId(stylesheet) {\r\n return this.styleIDMap.get(stylesheet) ?? -1;\r\n }\r\n has(stylesheet) {\r\n return this.styleIDMap.has(stylesheet);\r\n }\r\n add(stylesheet, id) {\r\n if (this.has(stylesheet))\r\n return this.getId(stylesheet);\r\n let newId;\r\n if (id === undefined) {\r\n newId = this.id++;\r\n }\r\n else\r\n newId = id;\r\n this.styleIDMap.set(stylesheet, newId);\r\n this.idStyleMap.set(newId, stylesheet);\r\n return newId;\r\n }\r\n getStyle(id) {\r\n return this.idStyleMap.get(id) || null;\r\n }\r\n reset() {\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n this.id = 1;\r\n }\r\n generateId() {\r\n return this.id++;\r\n }\r\n}\r\nfunction getShadowHost(n) {\r\n let shadowHost = null;\r\n if (n.getRootNode?.()?.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\r\n n.getRootNode().host)\r\n shadowHost = n.getRootNode().host;\r\n return shadowHost;\r\n}\r\nfunction getRootShadowHost(n) {\r\n let rootShadowHost = n;\r\n let shadowHost;\r\n while ((shadowHost = getShadowHost(rootShadowHost)))\r\n rootShadowHost = shadowHost;\r\n return rootShadowHost;\r\n}\r\nfunction shadowHostInDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n const shadowHost = getRootShadowHost(n);\r\n return doc.contains(shadowHost);\r\n}\r\nfunction inDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n return doc.contains(n) || shadowHostInDom(n);\r\n}\r\nconst cachedImplementations = {};\r\nfunction getImplementation(name) {\r\n const cached = cachedImplementations[name];\r\n if (cached) {\r\n return cached;\r\n }\r\n const document = window.document;\r\n let impl = window[name];\r\n if (document && typeof document.createElement === 'function') {\r\n try {\r\n const sandbox = document.createElement('iframe');\r\n sandbox.hidden = true;\r\n document.head.appendChild(sandbox);\r\n const contentWindow = sandbox.contentWindow;\r\n if (contentWindow && contentWindow[name]) {\r\n impl =\r\n contentWindow[name];\r\n }\r\n document.head.removeChild(sandbox);\r\n }\r\n catch (e) {\r\n }\r\n }\r\n return (cachedImplementations[name] = impl.bind(window));\r\n}\r\nfunction onRequestAnimationFrame(...rest) {\r\n return getImplementation('requestAnimationFrame')(...rest);\r\n}\r\nfunction setTimeout(...rest) {\r\n return getImplementation('setTimeout')(...rest);\r\n}\r\nfunction clearTimeout(...rest) {\r\n return getImplementation('clearTimeout')(...rest);\r\n}\n\nexport { StyleSheetMirror, _mirror, clearTimeout, closestElementOfNode, getBaseDimension, getNestedRule, getPositionsAndIndex, getRootShadowHost, getShadowHost, getWindowHeight, getWindowScroll, getWindowWidth, hasShadowRoot, hookSetter, inDom, isAncestorRemoved, isBlocked, isIgnored, isSerialized, isSerializedIframe, isSerializedStylesheet, iterateResolveTree, legacy_isTouchEvent, nowTimestamp, on, onRequestAnimationFrame, patch, polyfill, queueToResolveTrees, setTimeout, shadowHostInDom, throttle, uniqueTextMutations };\n","// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport function _nullishCoalesce(lhs: unknown, rhsFn: () => unknown): unknown {\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n// if (lhs != null) {\n// return lhs;\n// } else {\n// return rhsFn();\n// }\n// }\n","var EventType = /* @__PURE__ */ ((EventType2) => {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n return CanvasContext2;\n})(CanvasContext || {});\nvar ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {\n ReplayerEvents2[\"Start\"] = \"start\";\n ReplayerEvents2[\"Pause\"] = \"pause\";\n ReplayerEvents2[\"Resume\"] = \"resume\";\n ReplayerEvents2[\"Resize\"] = \"resize\";\n ReplayerEvents2[\"Finish\"] = \"finish\";\n ReplayerEvents2[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n ReplayerEvents2[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n ReplayerEvents2[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n ReplayerEvents2[\"SkipStart\"] = \"skip-start\";\n ReplayerEvents2[\"SkipEnd\"] = \"skip-end\";\n ReplayerEvents2[\"MouseInteraction\"] = \"mouse-interaction\";\n ReplayerEvents2[\"EventCast\"] = \"event-cast\";\n ReplayerEvents2[\"CustomEvent\"] = \"custom-event\";\n ReplayerEvents2[\"Flush\"] = \"flush\";\n ReplayerEvents2[\"StateChange\"] = \"state-change\";\n ReplayerEvents2[\"PlayBack\"] = \"play-back\";\n ReplayerEvents2[\"Destroy\"] = \"destroy\";\n return ReplayerEvents2;\n})(ReplayerEvents || {});\n\nexport { CanvasContext, EventType, IncrementalSource, MouseInteractions, PointerTypes, ReplayerEvents };\n","import { isShadowRoot, isNativeShadowDom, getInputType, getInputValue, shouldMaskInput, needMaskingText, maskInputValue, ignoreAttribute, transformAttribute, toLowerCase, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { isIgnored, isBlocked, isSerialized, isAncestorRemoved, closestElementOfNode, hasShadowRoot, inDom, getShadowHost, isSerializedIframe, isSerializedStylesheet } from '../utils.js';\n\nfunction isNodeInLinkedList(n) {\r\n return '__ln' in n;\r\n}\r\nclass DoubleLinkedList {\r\n constructor() {\r\n this.length = 0;\r\n this.head = null;\r\n this.tail = null;\r\n }\r\n get(position) {\r\n if (position >= this.length) {\r\n throw new Error('Position outside of list range');\r\n }\r\n let current = this.head;\r\n for (let index = 0; index < position; index++) {\r\n current = current?.next || null;\r\n }\r\n return current;\r\n }\r\n addNode(n) {\r\n const node = {\r\n value: n,\r\n previous: null,\r\n next: null,\r\n };\r\n n.__ln = node;\r\n if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\r\n const current = n.previousSibling.__ln.next;\r\n node.next = current;\r\n node.previous = n.previousSibling.__ln;\r\n n.previousSibling.__ln.next = node;\r\n if (current) {\r\n current.previous = node;\r\n }\r\n }\r\n else if (n.nextSibling &&\r\n isNodeInLinkedList(n.nextSibling) &&\r\n n.nextSibling.__ln.previous) {\r\n const current = n.nextSibling.__ln.previous;\r\n node.previous = current;\r\n node.next = n.nextSibling.__ln;\r\n n.nextSibling.__ln.previous = node;\r\n if (current) {\r\n current.next = node;\r\n }\r\n }\r\n else {\r\n if (this.head) {\r\n this.head.previous = node;\r\n }\r\n node.next = this.head;\r\n this.head = node;\r\n }\r\n if (node.next === null) {\r\n this.tail = node;\r\n }\r\n this.length++;\r\n }\r\n removeNode(n) {\r\n const current = n.__ln;\r\n if (!this.head) {\r\n return;\r\n }\r\n if (!current.previous) {\r\n this.head = current.next;\r\n if (this.head) {\r\n this.head.previous = null;\r\n }\r\n else {\r\n this.tail = null;\r\n }\r\n }\r\n else {\r\n current.previous.next = current.next;\r\n if (current.next) {\r\n current.next.previous = current.previous;\r\n }\r\n else {\r\n this.tail = current.previous;\r\n }\r\n }\r\n if (n.__ln) {\r\n delete n.__ln;\r\n }\r\n this.length--;\r\n }\r\n}\r\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\r\nclass MutationBuffer {\r\n constructor() {\r\n this.frozen = false;\r\n this.locked = false;\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.mapRemoves = [];\r\n this.movedMap = {};\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.processMutations = (mutations) => {\r\n mutations.forEach(this.processMutation);\r\n this.emit();\r\n };\r\n this.emit = () => {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const adds = [];\r\n const addedIds = new Set();\r\n const addList = new DoubleLinkedList();\r\n const getNextId = (n) => {\r\n let ns = n;\r\n let nextId = IGNORED_NODE;\r\n while (nextId === IGNORED_NODE) {\r\n ns = ns && ns.nextSibling;\r\n nextId = ns && this.mirror.getId(ns);\r\n }\r\n return nextId;\r\n };\r\n const pushAdd = (n) => {\r\n if (!n.parentNode || !inDom(n)) {\r\n return;\r\n }\r\n const parentId = isShadowRoot(n.parentNode)\r\n ? this.mirror.getId(getShadowHost(n))\r\n : this.mirror.getId(n.parentNode);\r\n const nextId = getNextId(n);\r\n if (parentId === -1 || nextId === -1) {\r\n return addList.addNode(n);\r\n }\r\n const sn = serializeNodeWithId(n, {\r\n doc: this.doc,\r\n mirror: this.mirror,\r\n blockClass: this.blockClass,\r\n blockSelector: this.blockSelector,\r\n maskAllText: this.maskAllText,\r\n unblockSelector: this.unblockSelector,\r\n maskTextClass: this.maskTextClass,\r\n unmaskTextClass: this.unmaskTextClass,\r\n maskTextSelector: this.maskTextSelector,\r\n unmaskTextSelector: this.unmaskTextSelector,\r\n skipChild: true,\r\n newlyAddedElement: true,\r\n inlineStylesheet: this.inlineStylesheet,\r\n maskInputOptions: this.maskInputOptions,\r\n maskAttributeFn: this.maskAttributeFn,\r\n maskTextFn: this.maskTextFn,\r\n maskInputFn: this.maskInputFn,\r\n slimDOMOptions: this.slimDOMOptions,\r\n dataURLOptions: this.dataURLOptions,\r\n recordCanvas: this.recordCanvas,\r\n inlineImages: this.inlineImages,\r\n onSerialize: (currentN) => {\r\n if (isSerializedIframe(currentN, this.mirror)) {\r\n this.iframeManager.addIframe(currentN);\r\n }\r\n if (isSerializedStylesheet(currentN, this.mirror)) {\r\n this.stylesheetManager.trackLinkElement(currentN);\r\n }\r\n if (hasShadowRoot(n)) {\r\n this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n this.iframeManager.attachIframe(iframe, childSn);\r\n this.shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (link, childSn) => {\r\n this.stylesheetManager.attachLinkElement(link, childSn);\r\n },\r\n });\r\n if (sn) {\r\n adds.push({\r\n parentId,\r\n nextId,\r\n node: sn,\r\n });\r\n addedIds.add(sn.id);\r\n }\r\n };\r\n while (this.mapRemoves.length) {\r\n this.mirror.removeNodeFromMap(this.mapRemoves.shift());\r\n }\r\n for (const n of this.movedSet) {\r\n if (isParentRemoved(this.removes, n, this.mirror) &&\r\n !this.movedSet.has(n.parentNode)) {\r\n continue;\r\n }\r\n pushAdd(n);\r\n }\r\n for (const n of this.addedSet) {\r\n if (!isAncestorInSet(this.droppedSet, n) &&\r\n !isParentRemoved(this.removes, n, this.mirror)) {\r\n pushAdd(n);\r\n }\r\n else if (isAncestorInSet(this.movedSet, n)) {\r\n pushAdd(n);\r\n }\r\n else {\r\n this.droppedSet.add(n);\r\n }\r\n }\r\n let candidate = null;\r\n while (addList.length) {\r\n let node = null;\r\n if (candidate) {\r\n const parentId = this.mirror.getId(candidate.value.parentNode);\r\n const nextId = getNextId(candidate.value);\r\n if (parentId !== -1 && nextId !== -1) {\r\n node = candidate;\r\n }\r\n }\r\n if (!node) {\r\n let tailNode = addList.tail;\r\n while (tailNode) {\r\n const _node = tailNode;\r\n tailNode = tailNode.previous;\r\n if (_node) {\r\n const parentId = this.mirror.getId(_node.value.parentNode);\r\n const nextId = getNextId(_node.value);\r\n if (nextId === -1)\r\n continue;\r\n else if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n else {\r\n const unhandledNode = _node.value;\r\n if (unhandledNode.parentNode &&\r\n unhandledNode.parentNode.nodeType ===\r\n Node.DOCUMENT_FRAGMENT_NODE) {\r\n const shadowHost = unhandledNode.parentNode\r\n .host;\r\n const parentId = this.mirror.getId(shadowHost);\r\n if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!node) {\r\n while (addList.head) {\r\n addList.removeNode(addList.head.value);\r\n }\r\n break;\r\n }\r\n candidate = node.previous;\r\n addList.removeNode(node.value);\r\n pushAdd(node.value);\r\n }\r\n const payload = {\r\n texts: this.texts\r\n .map((text) => ({\r\n id: this.mirror.getId(text.node),\r\n value: text.value,\r\n }))\r\n .filter((text) => !addedIds.has(text.id))\r\n .filter((text) => this.mirror.has(text.id)),\r\n attributes: this.attributes\r\n .map((attribute) => {\r\n const { attributes } = attribute;\r\n if (typeof attributes.style === 'string') {\r\n const diffAsStr = JSON.stringify(attribute.styleDiff);\r\n const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\r\n if (diffAsStr.length < attributes.style.length) {\r\n if ((diffAsStr + unchangedAsStr).split('var(').length ===\r\n attributes.style.split('var(').length) {\r\n attributes.style = attribute.styleDiff;\r\n }\r\n }\r\n }\r\n return {\r\n id: this.mirror.getId(attribute.node),\r\n attributes: attributes,\r\n };\r\n })\r\n .filter((attribute) => !addedIds.has(attribute.id))\r\n .filter((attribute) => this.mirror.has(attribute.id)),\r\n removes: this.removes,\r\n adds,\r\n };\r\n if (!payload.texts.length &&\r\n !payload.attributes.length &&\r\n !payload.removes.length &&\r\n !payload.adds.length) {\r\n return;\r\n }\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.movedMap = {};\r\n this.mutationCb(payload);\r\n };\r\n this.processMutation = (m) => {\r\n if (isIgnored(m.target, this.mirror)) {\r\n return;\r\n }\r\n switch (m.type) {\r\n case 'characterData': {\r\n const value = m.target.textContent;\r\n if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) &&\r\n value !== m.oldValue) {\r\n this.texts.push({\r\n value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, this.maskAllText) && value\r\n ? this.maskTextFn\r\n ? this.maskTextFn(value, closestElementOfNode(m.target))\r\n : value.replace(/[\\S]/g, '*')\r\n : value,\r\n node: m.target,\r\n });\r\n }\r\n break;\r\n }\r\n case 'attributes': {\r\n const target = m.target;\r\n let attributeName = m.attributeName;\r\n let value = m.target.getAttribute(attributeName);\r\n if (attributeName === 'value') {\r\n const type = getInputType(target);\r\n const tagName = target.tagName;\r\n value = getInputValue(target, tagName, type);\r\n const isInputMasked = shouldMaskInput({\r\n maskInputOptions: this.maskInputOptions,\r\n tagName,\r\n type,\r\n });\r\n const forceMask = needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, isInputMasked);\r\n value = maskInputValue({\r\n isMasked: forceMask,\r\n element: target,\r\n value,\r\n maskInputFn: this.maskInputFn,\r\n });\r\n }\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\r\n value === m.oldValue) {\r\n return;\r\n }\r\n let item = this.attributeMap.get(m.target);\r\n if (target.tagName === 'IFRAME' &&\r\n attributeName === 'src' &&\r\n !this.keepIframeSrcFn(value)) {\r\n if (!target.contentDocument) {\r\n attributeName = 'rr_src';\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n if (!item) {\r\n item = {\r\n node: m.target,\r\n attributes: {},\r\n styleDiff: {},\r\n _unchangedStyles: {},\r\n };\r\n this.attributes.push(item);\r\n this.attributeMap.set(m.target, item);\r\n }\r\n if (attributeName === 'type' &&\r\n target.tagName === 'INPUT' &&\r\n (m.oldValue || '').toLowerCase() === 'password') {\r\n target.setAttribute('data-rr-is-password', 'true');\r\n }\r\n if (!ignoreAttribute(target.tagName, attributeName)) {\r\n item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value, target, this.maskAttributeFn);\r\n if (attributeName === 'style') {\r\n if (!this.unattachedDoc) {\r\n try {\r\n this.unattachedDoc =\r\n document.implementation.createHTMLDocument();\r\n }\r\n catch (e) {\r\n this.unattachedDoc = this.doc;\r\n }\r\n }\r\n const old = this.unattachedDoc.createElement('span');\r\n if (m.oldValue) {\r\n old.setAttribute('style', m.oldValue);\r\n }\r\n for (const pname of Array.from(target.style)) {\r\n const newValue = target.style.getPropertyValue(pname);\r\n const newPriority = target.style.getPropertyPriority(pname);\r\n if (newValue !== old.style.getPropertyValue(pname) ||\r\n newPriority !== old.style.getPropertyPriority(pname)) {\r\n if (newPriority === '') {\r\n item.styleDiff[pname] = newValue;\r\n }\r\n else {\r\n item.styleDiff[pname] = [newValue, newPriority];\r\n }\r\n }\r\n else {\r\n item._unchangedStyles[pname] = [newValue, newPriority];\r\n }\r\n }\r\n for (const pname of Array.from(old.style)) {\r\n if (target.style.getPropertyValue(pname) === '') {\r\n item.styleDiff[pname] = false;\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case 'childList': {\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, true)) {\r\n return;\r\n }\r\n m.addedNodes.forEach((n) => this.genAdds(n, m.target));\r\n m.removedNodes.forEach((n) => {\r\n const nodeId = this.mirror.getId(n);\r\n const parentId = isShadowRoot(m.target)\r\n ? this.mirror.getId(m.target.host)\r\n : this.mirror.getId(m.target);\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\r\n isIgnored(n, this.mirror) ||\r\n !isSerialized(n, this.mirror)) {\r\n return;\r\n }\r\n if (this.addedSet.has(n)) {\r\n deepDelete(this.addedSet, n);\r\n this.droppedSet.add(n);\r\n }\r\n else if (this.addedSet.has(m.target) && nodeId === -1) ;\r\n else if (isAncestorRemoved(m.target, this.mirror)) ;\r\n else if (this.movedSet.has(n) &&\r\n this.movedMap[moveKey(nodeId, parentId)]) {\r\n deepDelete(this.movedSet, n);\r\n }\r\n else {\r\n this.removes.push({\r\n parentId,\r\n id: nodeId,\r\n isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)\r\n ? true\r\n : undefined,\r\n });\r\n }\r\n this.mapRemoves.push(n);\r\n });\r\n break;\r\n }\r\n }\r\n };\r\n this.genAdds = (n, target) => {\r\n if (this.processedNodeManager.inOtherBuffer(n, this))\r\n return;\r\n if (this.addedSet.has(n) || this.movedSet.has(n))\r\n return;\r\n if (this.mirror.hasNode(n)) {\r\n if (isIgnored(n, this.mirror)) {\r\n return;\r\n }\r\n this.movedSet.add(n);\r\n let targetId = null;\r\n if (target && this.mirror.hasNode(target)) {\r\n targetId = this.mirror.getId(target);\r\n }\r\n if (targetId && targetId !== -1) {\r\n this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\r\n }\r\n }\r\n else {\r\n this.addedSet.add(n);\r\n this.droppedSet.delete(n);\r\n }\r\n if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector, false)) {\r\n n.childNodes.forEach((childN) => this.genAdds(childN));\r\n if (hasShadowRoot(n)) {\r\n n.shadowRoot.childNodes.forEach((childN) => {\r\n this.processedNodeManager.add(childN, this);\r\n this.genAdds(childN, n);\r\n });\r\n }\r\n }\r\n };\r\n }\r\n init(options) {\r\n [\r\n 'mutationCb',\r\n 'blockClass',\r\n 'blockSelector',\r\n 'unblockSelector',\r\n 'maskAllText',\r\n 'maskTextClass',\r\n 'unmaskTextClass',\r\n 'maskTextSelector',\r\n 'unmaskTextSelector',\r\n 'inlineStylesheet',\r\n 'maskInputOptions',\r\n 'maskAttributeFn',\r\n 'maskTextFn',\r\n 'maskInputFn',\r\n 'keepIframeSrcFn',\r\n 'recordCanvas',\r\n 'inlineImages',\r\n 'slimDOMOptions',\r\n 'dataURLOptions',\r\n 'doc',\r\n 'mirror',\r\n 'iframeManager',\r\n 'stylesheetManager',\r\n 'shadowDomManager',\r\n 'canvasManager',\r\n 'processedNodeManager',\r\n ].forEach((key) => {\r\n this[key] = options[key];\r\n });\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n this.canvasManager.freeze();\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n this.canvasManager.unfreeze();\r\n this.emit();\r\n }\r\n isFrozen() {\r\n return this.frozen;\r\n }\r\n lock() {\r\n this.locked = true;\r\n this.canvasManager.lock();\r\n }\r\n unlock() {\r\n this.locked = false;\r\n this.canvasManager.unlock();\r\n this.emit();\r\n }\r\n reset() {\r\n this.shadowDomManager.reset();\r\n this.canvasManager.reset();\r\n }\r\n}\r\nfunction deepDelete(addsSet, n) {\r\n addsSet.delete(n);\r\n n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\r\n}\r\nfunction isParentRemoved(removes, n, mirror) {\r\n if (removes.length === 0)\r\n return false;\r\n return _isParentRemoved(removes, n, mirror);\r\n}\r\nfunction _isParentRemoved(removes, n, mirror) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n const parentId = mirror.getId(parentNode);\r\n if (removes.some((r) => r.id === parentId)) {\r\n return true;\r\n }\r\n return _isParentRemoved(removes, parentNode, mirror);\r\n}\r\nfunction isAncestorInSet(set, n) {\r\n if (set.size === 0)\r\n return false;\r\n return _isAncestorInSet(set, n);\r\n}\r\nfunction _isAncestorInSet(set, n) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n if (set.has(parentNode)) {\r\n return true;\r\n }\r\n return _isAncestorInSet(set, parentNode);\r\n}\n\nexport { MutationBuffer as default };\n","let errorHandler;\r\nfunction registerErrorHandler(handler) {\r\n errorHandler = handler;\r\n}\r\nfunction unregisterErrorHandler() {\r\n errorHandler = undefined;\r\n}\r\nconst callbackWrapper = (cb) => {\r\n if (!errorHandler) {\r\n return cb;\r\n }\r\n const rrwebWrapped = ((...rest) => {\r\n try {\r\n return cb(...rest);\r\n }\r\n catch (error) {\r\n if (errorHandler && errorHandler(error) === true) {\r\n return () => {\r\n };\r\n }\r\n throw error;\r\n }\r\n });\r\n return rrwebWrapped;\r\n};\n\nexport { callbackWrapper, registerErrorHandler, unregisterErrorHandler };\n","import { toLowerCase, toUpperCase, getInputType, getInputValue, shouldMaskInput, needMaskingText, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { on, throttle, isBlocked, getWindowScroll, hookSetter, patch, setTimeout, legacy_isTouchEvent, nowTimestamp, getWindowHeight, getWindowWidth } from '../utils.js';\nimport { MouseInteractions, IncrementalSource, PointerTypes } from '../../../types/dist/rrweb-types.js';\nimport MutationBuffer from './mutation.js';\nimport { callbackWrapper } from './error-handler.js';\n\nconst mutationBuffers = [];\r\nfunction getEventTarget(event) {\r\n try {\r\n if ('composedPath' in event) {\r\n const path = event.composedPath();\r\n if (path.length) {\r\n return path[0];\r\n }\r\n }\r\n else if ('path' in event && event.path.length) {\r\n return event.path[0];\r\n }\r\n }\r\n catch {\r\n }\r\n return event && event.target;\r\n}\r\nfunction initMutationObserver(options, rootEl) {\r\n const mutationBuffer = new MutationBuffer();\r\n mutationBuffers.push(mutationBuffer);\r\n mutationBuffer.init(options);\r\n let mutationObserverCtor = window.MutationObserver ||\r\n window.__rrMutationObserver;\r\n const angularZoneSymbol = window?.Zone?.__symbol__?.('MutationObserver');\r\n if (angularZoneSymbol &&\r\n window[angularZoneSymbol]) {\r\n mutationObserverCtor = window[angularZoneSymbol];\r\n }\r\n const observer = new mutationObserverCtor(callbackWrapper((mutations) => {\r\n if (options.onMutation && options.onMutation(mutations) === false) {\r\n return;\r\n }\r\n mutationBuffer.processMutations.bind(mutationBuffer)(mutations);\r\n }));\r\n observer.observe(rootEl, {\r\n attributes: true,\r\n attributeOldValue: true,\r\n characterData: true,\r\n characterDataOldValue: true,\r\n childList: true,\r\n subtree: true,\r\n });\r\n return observer;\r\n}\r\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\r\n if (sampling.mousemove === false) {\r\n return () => {\r\n };\r\n }\r\n const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\r\n const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\r\n ? sampling.mousemoveCallback\r\n : 500;\r\n let positions = [];\r\n let timeBaseline;\r\n const wrappedCb = throttle(callbackWrapper((source) => {\r\n const totalOffset = Date.now() - timeBaseline;\r\n mousemoveCb(positions.map((p) => {\r\n p.timeOffset -= totalOffset;\r\n return p;\r\n }), source);\r\n positions = [];\r\n timeBaseline = null;\r\n }), callbackThreshold);\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n const { clientX, clientY } = legacy_isTouchEvent(evt)\r\n ? evt.changedTouches[0]\r\n : evt;\r\n if (!timeBaseline) {\r\n timeBaseline = nowTimestamp();\r\n }\r\n positions.push({\r\n x: clientX,\r\n y: clientY,\r\n id: mirror.getId(target),\r\n timeOffset: nowTimestamp() - timeBaseline,\r\n });\r\n wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\r\n ? IncrementalSource.Drag\r\n : evt instanceof MouseEvent\r\n ? IncrementalSource.MouseMove\r\n : IncrementalSource.TouchMove);\r\n }), threshold, {\r\n trailing: false,\r\n }));\r\n const handlers = [\r\n on('mousemove', updatePosition, doc),\r\n on('touchmove', updatePosition, doc),\r\n on('drag', updatePosition, doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\r\n if (sampling.mouseInteraction === false) {\r\n return () => {\r\n };\r\n }\r\n const disableMap = sampling.mouseInteraction === true ||\r\n sampling.mouseInteraction === undefined\r\n ? {}\r\n : sampling.mouseInteraction;\r\n const handlers = [];\r\n let currentPointerType = null;\r\n const getHandler = (eventKey) => {\r\n return (event) => {\r\n const target = getEventTarget(event);\r\n if (isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n return;\r\n }\r\n let pointerType = null;\r\n let thisEventKey = eventKey;\r\n if ('pointerType' in event) {\r\n switch (event.pointerType) {\r\n case 'mouse':\r\n pointerType = PointerTypes.Mouse;\r\n break;\r\n case 'touch':\r\n pointerType = PointerTypes.Touch;\r\n break;\r\n case 'pen':\r\n pointerType = PointerTypes.Pen;\r\n break;\r\n }\r\n if (pointerType === PointerTypes.Touch) {\r\n if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\r\n thisEventKey = 'TouchStart';\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\r\n thisEventKey = 'TouchEnd';\r\n }\r\n }\r\n else if (pointerType === PointerTypes.Pen) ;\r\n }\r\n else if (legacy_isTouchEvent(event)) {\r\n pointerType = PointerTypes.Touch;\r\n }\r\n if (pointerType !== null) {\r\n currentPointerType = pointerType;\r\n if ((thisEventKey.startsWith('Touch') &&\r\n pointerType === PointerTypes.Touch) ||\r\n (thisEventKey.startsWith('Mouse') &&\r\n pointerType === PointerTypes.Mouse)) {\r\n pointerType = null;\r\n }\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\r\n pointerType = currentPointerType;\r\n currentPointerType = null;\r\n }\r\n const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\r\n if (!e) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n const { clientX, clientY } = e;\r\n callbackWrapper(mouseInteractionCb)({\r\n type: MouseInteractions[thisEventKey],\r\n id,\r\n x: clientX,\r\n y: clientY,\r\n ...(pointerType !== null && { pointerType }),\r\n });\r\n };\r\n };\r\n Object.keys(MouseInteractions)\r\n .filter((key) => Number.isNaN(Number(key)) &&\r\n !key.endsWith('_Departed') &&\r\n disableMap[key] !== false)\r\n .forEach((eventKey) => {\r\n let eventName = toLowerCase(eventKey);\r\n const handler = getHandler(eventKey);\r\n if (window.PointerEvent) {\r\n switch (MouseInteractions[eventKey]) {\r\n case MouseInteractions.MouseDown:\r\n case MouseInteractions.MouseUp:\r\n eventName = eventName.replace('mouse', 'pointer');\r\n break;\r\n case MouseInteractions.TouchStart:\r\n case MouseInteractions.TouchEnd:\r\n return;\r\n }\r\n }\r\n handlers.push(on(eventName, handler, doc));\r\n });\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n if (target === doc && doc.defaultView) {\r\n const scrollLeftTop = getWindowScroll(doc.defaultView);\r\n scrollCb({\r\n id,\r\n x: scrollLeftTop.left,\r\n y: scrollLeftTop.top,\r\n });\r\n }\r\n else {\r\n scrollCb({\r\n id,\r\n x: target.scrollLeft,\r\n y: target.scrollTop,\r\n });\r\n }\r\n }), sampling.scroll || 100));\r\n return on('scroll', updatePosition, doc);\r\n}\r\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\r\n let lastH = -1;\r\n let lastW = -1;\r\n const updateDimension = callbackWrapper(throttle(callbackWrapper(() => {\r\n const height = getWindowHeight();\r\n const width = getWindowWidth();\r\n if (lastH !== height || lastW !== width) {\r\n viewportResizeCb({\r\n width: Number(width),\r\n height: Number(height),\r\n });\r\n lastH = height;\r\n lastW = width;\r\n }\r\n }), 200));\r\n return on('resize', updateDimension, win);\r\n}\r\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\r\nconst lastInputValueMap = new WeakMap();\r\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, }) {\r\n function eventHandler(event) {\r\n let target = getEventTarget(event);\r\n const userTriggered = event.isTrusted;\r\n const tagName = target && toUpperCase(target.tagName);\r\n if (tagName === 'OPTION')\r\n target = target.parentElement;\r\n if (!target ||\r\n !tagName ||\r\n INPUT_TAGS.indexOf(tagName) < 0 ||\r\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n return;\r\n }\r\n const el = target;\r\n if (el.classList.contains(ignoreClass) ||\r\n (ignoreSelector && el.matches(ignoreSelector))) {\r\n return;\r\n }\r\n const type = getInputType(target);\r\n let text = getInputValue(el, tagName, type);\r\n let isChecked = false;\r\n const isInputMasked = shouldMaskInput({\r\n maskInputOptions,\r\n tagName,\r\n type,\r\n });\r\n const forceMask = needMaskingText(target, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked);\r\n if (type === 'radio' || type === 'checkbox') {\r\n isChecked = target.checked;\r\n }\r\n text = maskInputValue({\r\n isMasked: forceMask,\r\n element: target,\r\n value: text,\r\n maskInputFn,\r\n });\r\n cbWithDedup(target, userTriggeredOnInput\r\n ? { text, isChecked, userTriggered }\r\n : { text, isChecked });\r\n const name = target.name;\r\n if (type === 'radio' && name && isChecked) {\r\n doc\r\n .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\r\n .forEach((el) => {\r\n if (el !== target) {\r\n const text = maskInputValue({\r\n isMasked: forceMask,\r\n element: el,\r\n value: getInputValue(el, tagName, type),\r\n maskInputFn,\r\n });\r\n cbWithDedup(el, userTriggeredOnInput\r\n ? { text, isChecked: !isChecked, userTriggered: false }\r\n : { text, isChecked: !isChecked });\r\n }\r\n });\r\n }\r\n }\r\n function cbWithDedup(target, v) {\r\n const lastInputValue = lastInputValueMap.get(target);\r\n if (!lastInputValue ||\r\n lastInputValue.text !== v.text ||\r\n lastInputValue.isChecked !== v.isChecked) {\r\n lastInputValueMap.set(target, v);\r\n const id = mirror.getId(target);\r\n callbackWrapper(inputCb)({\r\n ...v,\r\n id,\r\n });\r\n }\r\n }\r\n const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\r\n const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\r\n const currentWindow = doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n }\r\n const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\r\n const hookProperties = [\r\n [currentWindow.HTMLInputElement.prototype, 'value'],\r\n [currentWindow.HTMLInputElement.prototype, 'checked'],\r\n [currentWindow.HTMLSelectElement.prototype, 'value'],\r\n [currentWindow.HTMLTextAreaElement.prototype, 'value'],\r\n [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'],\r\n [currentWindow.HTMLOptionElement.prototype, 'selected'],\r\n ];\r\n if (propertyDescriptor && propertyDescriptor.set) {\r\n handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\r\n set() {\r\n callbackWrapper(eventHandler)({\r\n target: this,\r\n isTrusted: false,\r\n });\r\n },\r\n }, false, currentWindow)));\r\n }\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction getNestedCSSRulePositions(rule) {\r\n const positions = [];\r\n function recurse(childRule, pos) {\r\n if ((hasNestedCSSRule('CSSGroupingRule') &&\r\n childRule.parentRule instanceof CSSGroupingRule) ||\r\n (hasNestedCSSRule('CSSMediaRule') &&\r\n childRule.parentRule instanceof CSSMediaRule) ||\r\n (hasNestedCSSRule('CSSSupportsRule') &&\r\n childRule.parentRule instanceof CSSSupportsRule) ||\r\n (hasNestedCSSRule('CSSConditionRule') &&\r\n childRule.parentRule instanceof CSSConditionRule)) {\r\n const rules = Array.from(childRule.parentRule.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n else if (childRule.parentStyleSheet) {\r\n const rules = Array.from(childRule.parentStyleSheet.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n return pos;\r\n }\r\n return recurse(rule, positions);\r\n}\r\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\r\n let id, styleId;\r\n if (!sheet)\r\n return {};\r\n if (sheet.ownerNode)\r\n id = mirror.getId(sheet.ownerNode);\r\n else\r\n styleId = styleMirror.getId(sheet);\r\n return {\r\n styleId,\r\n id,\r\n };\r\n}\r\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) {\r\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\r\n return () => {\r\n };\r\n }\r\n const insertRule = win.CSSStyleSheet.prototype.insertRule;\r\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [{ rule, index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\r\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [{ index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n let replace;\r\n if (win.CSSStyleSheet.prototype.replace) {\r\n replace = win.CSSStyleSheet.prototype.replace;\r\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replace: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n let replaceSync;\r\n if (win.CSSStyleSheet.prototype.replaceSync) {\r\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\r\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replaceSync: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n const supportedNestedCSSRuleTypes = {};\r\n if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\r\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\r\n }\r\n else {\r\n if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\r\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\r\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\r\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\r\n }\r\n }\r\n const unmodifiedFunctions = {};\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n unmodifiedFunctions[typeKey] = {\r\n insertRule: type.prototype.insertRule,\r\n deleteRule: type.prototype.deleteRule,\r\n };\r\n type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [\r\n {\r\n rule,\r\n index: [\r\n ...getNestedCSSRulePositions(thisArg),\r\n index || 0,\r\n ],\r\n },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [\r\n { index: [...getNestedCSSRulePositions(thisArg), index] },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleSheet.prototype.insertRule = insertRule;\r\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\r\n replace && (win.CSSStyleSheet.prototype.replace = replace);\r\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\r\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\r\n });\r\n });\r\n}\r\nfunction initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) {\r\n let hostId = null;\r\n if (host.nodeName === '#document')\r\n hostId = mirror.getId(host);\r\n else\r\n hostId = mirror.getId(host.host);\r\n const patchTarget = host.nodeName === '#document'\r\n ? host.defaultView?.Document\r\n : host.ownerDocument?.defaultView?.ShadowRoot;\r\n const originalPropertyDescriptor = patchTarget?.prototype\r\n ? Object.getOwnPropertyDescriptor(patchTarget?.prototype, 'adoptedStyleSheets')\r\n : undefined;\r\n if (hostId === null ||\r\n hostId === -1 ||\r\n !patchTarget ||\r\n !originalPropertyDescriptor)\r\n return () => {\r\n };\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get() {\r\n return originalPropertyDescriptor.get?.call(this);\r\n },\r\n set(sheets) {\r\n const result = originalPropertyDescriptor.set?.call(this, sheets);\r\n if (hostId !== null && hostId !== -1) {\r\n try {\r\n stylesheetManager.adoptStyleSheets(sheets, hostId);\r\n }\r\n catch (e) {\r\n }\r\n }\r\n return result;\r\n },\r\n });\r\n return callbackWrapper(() => {\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get: originalPropertyDescriptor.get,\r\n set: originalPropertyDescriptor.set,\r\n });\r\n });\r\n}\r\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) {\r\n const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\r\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [property, value, priority] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return setProperty.apply(thisArg, [property, value, priority]);\r\n }\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentRule?.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n set: {\r\n property,\r\n value,\r\n priority,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [property] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return removeProperty.apply(thisArg, [property]);\r\n }\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentRule?.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n remove: {\r\n property,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\r\n });\r\n}\r\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, doc, }) {\r\n const handler = callbackWrapper((type) => throttle(callbackWrapper((event) => {\r\n const target = getEventTarget(event);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n return;\r\n }\r\n const { currentTime, volume, muted, playbackRate } = target;\r\n mediaInteractionCb({\r\n type,\r\n id: mirror.getId(target),\r\n currentTime,\r\n volume,\r\n muted,\r\n playbackRate,\r\n });\r\n }), sampling.media || 500));\r\n const handlers = [\r\n on('play', handler(0), doc),\r\n on('pause', handler(1), doc),\r\n on('seeked', handler(2), doc),\r\n on('volumechange', handler(3), doc),\r\n on('ratechange', handler(4), doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initFontObserver({ fontCb, doc }) {\r\n const win = doc.defaultView;\r\n if (!win) {\r\n return () => {\r\n };\r\n }\r\n const handlers = [];\r\n const fontMap = new WeakMap();\r\n const originalFontFace = win.FontFace;\r\n win.FontFace = function FontFace(family, source, descriptors) {\r\n const fontFace = new originalFontFace(family, source, descriptors);\r\n fontMap.set(fontFace, {\r\n family,\r\n buffer: typeof source !== 'string',\r\n descriptors,\r\n fontSource: typeof source === 'string'\r\n ? source\r\n : JSON.stringify(Array.from(new Uint8Array(source))),\r\n });\r\n return fontFace;\r\n };\r\n const restoreHandler = patch(doc.fonts, 'add', function (original) {\r\n return function (fontFace) {\r\n setTimeout(callbackWrapper(() => {\r\n const p = fontMap.get(fontFace);\r\n if (p) {\r\n fontCb(p);\r\n fontMap.delete(fontFace);\r\n }\r\n }), 0);\r\n return original.apply(this, [fontFace]);\r\n };\r\n });\r\n handlers.push(() => {\r\n win.FontFace = originalFontFace;\r\n });\r\n handlers.push(restoreHandler);\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initSelectionObserver(param) {\r\n const { doc, mirror, blockClass, blockSelector, unblockSelector, selectionCb, } = param;\r\n let collapsed = true;\r\n const updateSelection = callbackWrapper(() => {\r\n const selection = doc.getSelection();\r\n if (!selection || (collapsed && selection?.isCollapsed))\r\n return;\r\n collapsed = selection.isCollapsed || false;\r\n const ranges = [];\r\n const count = selection.rangeCount || 0;\r\n for (let i = 0; i < count; i++) {\r\n const range = selection.getRangeAt(i);\r\n const { startContainer, startOffset, endContainer, endOffset } = range;\r\n const blocked = isBlocked(startContainer, blockClass, blockSelector, unblockSelector, true) ||\r\n isBlocked(endContainer, blockClass, blockSelector, unblockSelector, true);\r\n if (blocked)\r\n continue;\r\n ranges.push({\r\n start: mirror.getId(startContainer),\r\n startOffset,\r\n end: mirror.getId(endContainer),\r\n endOffset,\r\n });\r\n }\r\n selectionCb({ ranges });\r\n });\r\n updateSelection();\r\n return on('selectionchange', updateSelection);\r\n}\r\nfunction initCustomElementObserver({ doc, customElementCb, }) {\r\n const win = doc.defaultView;\r\n if (!win || !win.customElements)\r\n return () => { };\r\n const restoreHandler = patch(win.customElements, 'define', function (original) {\r\n return function (name, constructor, options) {\r\n try {\r\n customElementCb({\r\n define: {\r\n name,\r\n },\r\n });\r\n }\r\n catch (e) {\r\n }\r\n return original.apply(this, [name, constructor, options]);\r\n };\r\n });\r\n return restoreHandler;\r\n}\r\nfunction initObservers(o, _hooks = {}) {\r\n const currentWindow = o.doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n };\r\n }\r\n const mutationObserver = initMutationObserver(o, o.doc);\r\n const mousemoveHandler = initMoveObserver(o);\r\n const mouseInteractionHandler = initMouseInteractionObserver(o);\r\n const scrollHandler = initScrollObserver(o);\r\n const viewportResizeHandler = initViewportResizeObserver(o, {\r\n win: currentWindow,\r\n });\r\n const inputHandler = initInputObserver(o);\r\n const mediaInteractionHandler = initMediaInteractionObserver(o);\r\n const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\r\n const adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\r\n const styleDeclarationObserver = initStyleDeclarationObserver(o, {\r\n win: currentWindow,\r\n });\r\n const fontObserver = o.collectFonts\r\n ? initFontObserver(o)\r\n : () => {\r\n };\r\n const selectionObserver = initSelectionObserver(o);\r\n const customElementObserver = initCustomElementObserver(o);\r\n const pluginHandlers = [];\r\n for (const plugin of o.plugins) {\r\n pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\r\n }\r\n return callbackWrapper(() => {\r\n mutationBuffers.forEach((b) => b.reset());\r\n mutationObserver.disconnect();\r\n mousemoveHandler();\r\n mouseInteractionHandler();\r\n scrollHandler();\r\n viewportResizeHandler();\r\n inputHandler();\r\n mediaInteractionHandler();\r\n styleSheetObserver();\r\n adoptedStyleSheetObserver();\r\n styleDeclarationObserver();\r\n fontObserver();\r\n selectionObserver();\r\n customElementObserver();\r\n pluginHandlers.forEach((h) => h());\r\n });\r\n}\r\nfunction hasNestedCSSRule(prop) {\r\n return typeof window[prop] !== 'undefined';\r\n}\r\nfunction canMonkeyPatchNestedCSSRule(prop) {\r\n return Boolean(typeof window[prop] !== 'undefined' &&\r\n window[prop].prototype &&\r\n 'insertRule' in window[prop].prototype &&\r\n 'deleteRule' in window[prop].prototype);\r\n}\n\nexport { INPUT_TAGS, initAdoptedStyleSheetObserver, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };\n","class CrossOriginIframeMirror {\r\n constructor(generateIdFn) {\r\n this.generateIdFn = generateIdFn;\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n }\r\n getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\r\n const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\r\n let id = idToRemoteIdMap.get(remoteId);\r\n if (!id) {\r\n id = this.generateIdFn();\r\n idToRemoteIdMap.set(remoteId, id);\r\n remoteIdToIdMap.set(id, remoteId);\r\n }\r\n return id;\r\n }\r\n getIds(iframe, remoteId) {\r\n const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap));\r\n }\r\n getRemoteId(iframe, id, map) {\r\n const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\r\n if (typeof id !== 'number')\r\n return id;\r\n const remoteId = remoteIdToIdMap.get(id);\r\n if (!remoteId)\r\n return -1;\r\n return remoteId;\r\n }\r\n getRemoteIds(iframe, ids) {\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\r\n }\r\n reset(iframe) {\r\n if (!iframe) {\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n return;\r\n }\r\n this.iframeIdToRemoteIdMap.delete(iframe);\r\n this.iframeRemoteIdToIdMap.delete(iframe);\r\n }\r\n getIdToRemoteIdMap(iframe) {\r\n let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\r\n if (!idToRemoteIdMap) {\r\n idToRemoteIdMap = new Map();\r\n this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\r\n }\r\n return idToRemoteIdMap;\r\n }\r\n getRemoteIdToIdMap(iframe) {\r\n let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\r\n if (!remoteIdToIdMap) {\r\n remoteIdToIdMap = new Map();\r\n this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\r\n }\r\n return remoteIdToIdMap;\r\n }\r\n}\n\nexport { CrossOriginIframeMirror as default };\n","import { genId, NodeType } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport CrossOriginIframeMirror from './cross-origin-iframe-mirror.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/rrweb-types.js';\n\nclass IframeManagerNoop {\r\n constructor() {\r\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\r\n this.crossOriginIframeRootIdMap = new WeakMap();\r\n }\r\n addIframe() {\r\n }\r\n addLoadListener() {\r\n }\r\n attachIframe() {\r\n }\r\n}\r\nclass IframeManager {\r\n constructor(options) {\r\n this.iframes = new WeakMap();\r\n this.crossOriginIframeMap = new WeakMap();\r\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\r\n this.crossOriginIframeRootIdMap = new WeakMap();\r\n this.mutationCb = options.mutationCb;\r\n this.wrappedEmit = options.wrappedEmit;\r\n this.stylesheetManager = options.stylesheetManager;\r\n this.recordCrossOriginIframes = options.recordCrossOriginIframes;\r\n this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\r\n this.mirror = options.mirror;\r\n if (this.recordCrossOriginIframes) {\r\n window.addEventListener('message', this.handleMessage.bind(this));\r\n }\r\n }\r\n addIframe(iframeEl) {\r\n this.iframes.set(iframeEl, true);\r\n if (iframeEl.contentWindow)\r\n this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\r\n }\r\n addLoadListener(cb) {\r\n this.loadListener = cb;\r\n }\r\n attachIframe(iframeEl, childSn) {\r\n this.mutationCb({\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: childSn,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n });\r\n this.loadListener?.(iframeEl);\r\n if (iframeEl.contentDocument &&\r\n iframeEl.contentDocument.adoptedStyleSheets &&\r\n iframeEl.contentDocument.adoptedStyleSheets.length > 0)\r\n this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\r\n }\r\n handleMessage(message) {\r\n const crossOriginMessageEvent = message;\r\n if (crossOriginMessageEvent.data.type !== 'rrweb' ||\r\n crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\r\n return;\r\n const iframeSourceWindow = message.source;\r\n if (!iframeSourceWindow)\r\n return;\r\n const iframeEl = this.crossOriginIframeMap.get(message.source);\r\n if (!iframeEl)\r\n return;\r\n const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\r\n if (transformedEvent)\r\n this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\r\n }\r\n transformCrossOriginEvent(iframeEl, e) {\r\n switch (e.type) {\r\n case EventType.FullSnapshot: {\r\n this.crossOriginIframeMirror.reset(iframeEl);\r\n this.crossOriginIframeStyleMirror.reset(iframeEl);\r\n this.replaceIdOnNode(e.data.node, iframeEl);\r\n const rootId = e.data.node.id;\r\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\r\n this.patchRootIdOnNode(e.data.node, rootId);\r\n return {\r\n timestamp: e.timestamp,\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Mutation,\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: e.data.node,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n },\r\n };\r\n }\r\n case EventType.Meta:\r\n case EventType.Load:\r\n case EventType.DomContentLoaded: {\r\n return false;\r\n }\r\n case EventType.Plugin: {\r\n return e;\r\n }\r\n case EventType.Custom: {\r\n this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\r\n return e;\r\n }\r\n case EventType.IncrementalSnapshot: {\r\n switch (e.data.source) {\r\n case IncrementalSource.Mutation: {\r\n e.data.adds.forEach((n) => {\r\n this.replaceIds(n, iframeEl, [\r\n 'parentId',\r\n 'nextId',\r\n 'previousId',\r\n ]);\r\n this.replaceIdOnNode(n.node, iframeEl);\r\n const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\r\n rootId && this.patchRootIdOnNode(n.node, rootId);\r\n });\r\n e.data.removes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['parentId', 'id']);\r\n });\r\n e.data.attributes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n e.data.texts.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.Drag:\r\n case IncrementalSource.TouchMove:\r\n case IncrementalSource.MouseMove: {\r\n e.data.positions.forEach((p) => {\r\n this.replaceIds(p, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.ViewportResize: {\r\n return false;\r\n }\r\n case IncrementalSource.MediaInteraction:\r\n case IncrementalSource.MouseInteraction:\r\n case IncrementalSource.Scroll:\r\n case IncrementalSource.CanvasMutation:\r\n case IncrementalSource.Input: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n return e;\r\n }\r\n case IncrementalSource.StyleSheetRule:\r\n case IncrementalSource.StyleDeclaration: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleId']);\r\n return e;\r\n }\r\n case IncrementalSource.Font: {\r\n return e;\r\n }\r\n case IncrementalSource.Selection: {\r\n e.data.ranges.forEach((range) => {\r\n this.replaceIds(range, iframeEl, ['start', 'end']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.AdoptedStyleSheet: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\r\n e.data.styles?.forEach((style) => {\r\n this.replaceStyleIds(style, iframeEl, ['styleId']);\r\n });\r\n return e;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n replace(iframeMirror, obj, iframeEl, keys) {\r\n for (const key of keys) {\r\n if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number')\r\n continue;\r\n if (Array.isArray(obj[key])) {\r\n obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\r\n }\r\n else {\r\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\r\n }\r\n }\r\n return obj;\r\n }\r\n replaceIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\r\n }\r\n replaceStyleIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\r\n }\r\n replaceIdOnNode(node, iframeEl) {\r\n this.replaceIds(node, iframeEl, ['id', 'rootId']);\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.replaceIdOnNode(child, iframeEl);\r\n });\r\n }\r\n }\r\n patchRootIdOnNode(node, rootId) {\r\n if (node.type !== NodeType.Document && !node.rootId)\r\n node.rootId = rootId;\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.patchRootIdOnNode(child, rootId);\r\n });\r\n }\r\n }\r\n}\n\nexport { IframeManager, IframeManagerNoop };\n","import { initMutationObserver, initScrollObserver, initAdoptedStyleSheetObserver } from './observer.js';\nimport { setTimeout, patch, inDom } from '../utils.js';\nimport { isNativeShadowDom } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nclass ShadowDomManagerNoop {\r\n init() {\r\n }\r\n addShadowRoot() {\r\n }\r\n observeAttachShadow() {\r\n }\r\n reset() {\r\n }\r\n}\r\nclass ShadowDomManager {\r\n constructor(options) {\r\n this.shadowDoms = new WeakSet();\r\n this.restoreHandlers = [];\r\n this.mutationCb = options.mutationCb;\r\n this.scrollCb = options.scrollCb;\r\n this.bypassOptions = options.bypassOptions;\r\n this.mirror = options.mirror;\r\n this.init();\r\n }\r\n init() {\r\n this.reset();\r\n this.patchAttachShadow(Element, document);\r\n }\r\n addShadowRoot(shadowRoot, doc) {\r\n if (!isNativeShadowDom(shadowRoot))\r\n return;\r\n if (this.shadowDoms.has(shadowRoot))\r\n return;\r\n this.shadowDoms.add(shadowRoot);\r\n const observer = initMutationObserver({\r\n ...this.bypassOptions,\r\n doc,\r\n mutationCb: this.mutationCb,\r\n mirror: this.mirror,\r\n shadowDomManager: this,\r\n }, shadowRoot);\r\n this.restoreHandlers.push(() => observer.disconnect());\r\n this.restoreHandlers.push(initScrollObserver({\r\n ...this.bypassOptions,\r\n scrollCb: this.scrollCb,\r\n doc: shadowRoot,\r\n mirror: this.mirror,\r\n }));\r\n setTimeout(() => {\r\n if (shadowRoot.adoptedStyleSheets &&\r\n shadowRoot.adoptedStyleSheets.length > 0)\r\n this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host));\r\n this.restoreHandlers.push(initAdoptedStyleSheetObserver({\r\n mirror: this.mirror,\r\n stylesheetManager: this.bypassOptions.stylesheetManager,\r\n }, shadowRoot));\r\n }, 0);\r\n }\r\n observeAttachShadow(iframeElement) {\r\n if (!iframeElement.contentWindow || !iframeElement.contentDocument)\r\n return;\r\n this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\r\n }\r\n patchAttachShadow(element, doc) {\r\n const manager = this;\r\n this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\r\n return function (option) {\r\n const shadowRoot = original.call(this, option);\r\n if (this.shadowRoot && inDom(this))\r\n manager.addShadowRoot(this.shadowRoot, doc);\r\n return shadowRoot;\r\n };\r\n }));\r\n }\r\n reset() {\r\n this.restoreHandlers.forEach((handler) => {\r\n try {\r\n handler();\r\n }\r\n catch (e) {\r\n }\r\n });\r\n this.restoreHandlers = [];\r\n this.shadowDoms = new WeakSet();\r\n }\r\n}\n\nexport { ShadowDomManager, ShadowDomManagerNoop };\n","import { onRequestAnimationFrame, isBlocked } from '../../../utils.js';\nimport { CanvasContext } from '../../../../../types/dist/rrweb-types.js';\nimport initCanvas2DMutationObserver from './2d.js';\nimport initCanvasContextObserver from './canvas.js';\nimport initCanvasWebGLMutationObserver from './webgl.js';\nimport { getImageBitmapDataUrlWorkerURL as t } from '../../../../../rrweb-worker/es/rrweb-worker/index.js';\nimport { callbackWrapper, registerErrorHandler } from '../../error-handler.js';\n\nclass CanvasManagerNoop {\r\n reset() {\r\n }\r\n freeze() {\r\n }\r\n unfreeze() {\r\n }\r\n lock() {\r\n }\r\n unlock() {\r\n }\r\n snapshot() {\r\n }\r\n}\r\nclass CanvasManager {\r\n reset() {\r\n this.pendingCanvasMutations.clear();\r\n this.resetObservers && this.resetObservers();\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n }\r\n lock() {\r\n this.locked = true;\r\n }\r\n unlock() {\r\n this.locked = false;\r\n }\r\n constructor(options) {\r\n this.pendingCanvasMutations = new Map();\r\n this.rafStamps = { latestId: 0, invokeId: null };\r\n this.frozen = false;\r\n this.locked = false;\r\n this.processMutation = (target, mutation) => {\r\n const newFrame = this.rafStamps.invokeId &&\r\n this.rafStamps.latestId !== this.rafStamps.invokeId;\r\n if (newFrame || !this.rafStamps.invokeId)\r\n this.rafStamps.invokeId = this.rafStamps.latestId;\r\n if (!this.pendingCanvasMutations.has(target)) {\r\n this.pendingCanvasMutations.set(target, []);\r\n }\r\n this.pendingCanvasMutations.get(target).push(mutation);\r\n };\r\n const { sampling = 'all', win, blockClass, blockSelector, unblockSelector, maxCanvasSize, recordCanvas, dataURLOptions, errorHandler, } = options;\r\n this.mutationCb = options.mutationCb;\r\n this.mirror = options.mirror;\r\n this.options = options;\r\n if (errorHandler) {\r\n registerErrorHandler(errorHandler);\r\n }\r\n if (options.enableManualSnapshot) {\r\n return;\r\n }\r\n callbackWrapper(() => {\r\n if (recordCanvas && sampling === 'all')\r\n this.initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector);\r\n if (recordCanvas && typeof sampling === 'number')\r\n this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, unblockSelector, maxCanvasSize, {\r\n dataURLOptions,\r\n });\r\n })();\r\n }\r\n initCanvasFPSObserver(fps, win, blockClass, blockSelector, unblockSelector, maxCanvasSize, options) {\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, true);\r\n const rafId = this.takeSnapshot(false, fps, win, blockClass, blockSelector, unblockSelector, maxCanvasSize, options.dataURLOptions);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n cancelAnimationFrame(rafId);\r\n };\r\n }\r\n initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector) {\r\n this.startRAFTimestamping();\r\n this.startPendingCanvasMutationFlusher();\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, false);\r\n const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector);\r\n const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n canvas2DReset();\r\n canvasWebGL1and2Reset();\r\n };\r\n }\r\n snapshot(canvasElement) {\r\n const { options } = this;\r\n const rafId = this.takeSnapshot(true, options.sampling === 'all' ? 2 : options.sampling || 2, options.win, options.blockClass, options.blockSelector, options.unblockSelector, options.maxCanvasSize, options.dataURLOptions, canvasElement);\r\n this.resetObservers = () => {\r\n cancelAnimationFrame(rafId);\r\n };\r\n }\r\n takeSnapshot(isManualSnapshot, fps, win, blockClass, blockSelector, unblockSelector, maxCanvasSize, dataURLOptions, canvasElement) {\r\n const snapshotInProgressMap = new Map();\r\n const worker = new Worker(t());\r\n worker.onmessage = (e) => {\r\n const data = e.data;\r\n const { id } = data;\r\n snapshotInProgressMap.set(id, false);\r\n if (!('base64' in data))\r\n return;\r\n const { base64, type, width, height } = data;\r\n this.mutationCb({\r\n id,\r\n type: CanvasContext['2D'],\r\n commands: [\r\n {\r\n property: 'clearRect',\r\n args: [0, 0, width, height],\r\n },\r\n {\r\n property: 'drawImage',\r\n args: [\r\n {\r\n rr_type: 'ImageBitmap',\r\n args: [\r\n {\r\n rr_type: 'Blob',\r\n data: [{ rr_type: 'ArrayBuffer', base64 }],\r\n type,\r\n },\r\n ],\r\n },\r\n 0,\r\n 0,\r\n width,\r\n height,\r\n ],\r\n },\r\n ],\r\n });\r\n };\r\n const timeBetweenSnapshots = 1000 / fps;\r\n let lastSnapshotTime = 0;\r\n let rafId;\r\n const getCanvas = (canvasElement) => {\r\n if (canvasElement) {\r\n return [canvasElement];\r\n }\r\n const matchedCanvas = [];\r\n win.document.querySelectorAll('canvas').forEach((canvas) => {\r\n if (!isBlocked(canvas, blockClass, blockSelector, unblockSelector, true)) {\r\n matchedCanvas.push(canvas);\r\n }\r\n });\r\n return matchedCanvas;\r\n };\r\n const takeCanvasSnapshots = (timestamp) => {\r\n if (lastSnapshotTime &&\r\n timestamp - lastSnapshotTime < timeBetweenSnapshots) {\r\n rafId = onRequestAnimationFrame(takeCanvasSnapshots);\r\n return;\r\n }\r\n lastSnapshotTime = timestamp;\r\n getCanvas(canvasElement).forEach((canvas) => {\r\n const id = this.mirror.getId(canvas);\r\n if (snapshotInProgressMap.get(id))\r\n return;\r\n if (!canvas.width || !canvas.height)\r\n return;\r\n snapshotInProgressMap.set(id, true);\r\n if (!isManualSnapshot &&\r\n ['webgl', 'webgl2'].includes(canvas.__context)) {\r\n const context = canvas.getContext(canvas.__context);\r\n if (context?.getContextAttributes()?.preserveDrawingBuffer === false) {\r\n context.clear(context.COLOR_BUFFER_BIT);\r\n }\r\n }\r\n createImageBitmap(canvas)\r\n .then((bitmap) => {\r\n worker.postMessage({\r\n id,\r\n bitmap,\r\n width: canvas.width,\r\n height: canvas.height,\r\n dataURLOptions,\r\n maxCanvasSize,\r\n }, [bitmap]);\r\n })\r\n .catch((error) => {\r\n callbackWrapper(() => {\r\n throw error;\r\n })();\r\n });\r\n });\r\n rafId = onRequestAnimationFrame(takeCanvasSnapshots);\r\n };\r\n rafId = onRequestAnimationFrame(takeCanvasSnapshots);\r\n return rafId;\r\n }\r\n startPendingCanvasMutationFlusher() {\r\n onRequestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n startRAFTimestamping() {\r\n const setLatestRAFTimestamp = (timestamp) => {\r\n this.rafStamps.latestId = timestamp;\r\n onRequestAnimationFrame(setLatestRAFTimestamp);\r\n };\r\n onRequestAnimationFrame(setLatestRAFTimestamp);\r\n }\r\n flushPendingCanvasMutations() {\r\n this.pendingCanvasMutations.forEach((values, canvas) => {\r\n const id = this.mirror.getId(canvas);\r\n this.flushPendingCanvasMutationFor(canvas, id);\r\n });\r\n onRequestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n flushPendingCanvasMutationFor(canvas, id) {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const valuesWithType = this.pendingCanvasMutations.get(canvas);\r\n if (!valuesWithType || id === -1)\r\n return;\r\n const values = valuesWithType.map((value) => {\r\n const { type, ...rest } = value;\r\n return rest;\r\n });\r\n const { type } = valuesWithType[0];\r\n this.mutationCb({ id, type, commands: values });\r\n this.pendingCanvasMutations.delete(canvas);\r\n }\r\n}\n\nexport { CanvasManager, CanvasManagerNoop };\n","import { stringifyRule } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { StyleSheetMirror } from '../utils.js';\n\nclass StylesheetManager {\r\n constructor(options) {\r\n this.trackedLinkElements = new WeakSet();\r\n this.styleMirror = new StyleSheetMirror();\r\n this.mutationCb = options.mutationCb;\r\n this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\r\n }\r\n attachLinkElement(linkEl, childSn) {\r\n if ('_cssText' in childSn.attributes)\r\n this.mutationCb({\r\n adds: [],\r\n removes: [],\r\n texts: [],\r\n attributes: [\r\n {\r\n id: childSn.id,\r\n attributes: childSn\r\n .attributes,\r\n },\r\n ],\r\n });\r\n this.trackLinkElement(linkEl);\r\n }\r\n trackLinkElement(linkEl) {\r\n if (this.trackedLinkElements.has(linkEl))\r\n return;\r\n this.trackedLinkElements.add(linkEl);\r\n this.trackStylesheetInLinkElement(linkEl);\r\n }\r\n adoptStyleSheets(sheets, hostId) {\r\n if (sheets.length === 0)\r\n return;\r\n const adoptedStyleSheetData = {\r\n id: hostId,\r\n styleIds: [],\r\n };\r\n const styles = [];\r\n for (const sheet of sheets) {\r\n let styleId;\r\n if (!this.styleMirror.has(sheet)) {\r\n styleId = this.styleMirror.add(sheet);\r\n styles.push({\r\n styleId,\r\n rules: Array.from(sheet.rules || CSSRule, (r, index) => ({\r\n rule: stringifyRule(r),\r\n index,\r\n })),\r\n });\r\n }\r\n else\r\n styleId = this.styleMirror.getId(sheet);\r\n adoptedStyleSheetData.styleIds.push(styleId);\r\n }\r\n if (styles.length > 0)\r\n adoptedStyleSheetData.styles = styles;\r\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\r\n }\r\n reset() {\r\n this.styleMirror.reset();\r\n this.trackedLinkElements = new WeakSet();\r\n }\r\n trackStylesheetInLinkElement(linkEl) {\r\n }\r\n}\n\nexport { StylesheetManager };\n","import { onRequestAnimationFrame } from '../utils.js';\n\nclass ProcessedNodeManager {\r\n constructor() {\r\n this.nodeMap = new WeakMap();\r\n this.loop = true;\r\n this.periodicallyClear();\r\n }\r\n periodicallyClear() {\r\n onRequestAnimationFrame(() => {\r\n this.clear();\r\n if (this.loop)\r\n this.periodicallyClear();\r\n });\r\n }\r\n inOtherBuffer(node, thisBuffer) {\r\n const buffers = this.nodeMap.get(node);\r\n return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer));\r\n }\r\n add(node, buffer) {\r\n this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\r\n }\r\n clear() {\r\n this.nodeMap = new WeakMap();\r\n }\r\n destroy() {\r\n this.loop = false;\r\n }\r\n}\n\nexport { ProcessedNodeManager as default };\n","import { createMirror, snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { initObservers, mutationBuffers } from './observer.js';\nimport { polyfill, on, nowTimestamp, getWindowWidth, getWindowHeight, getWindowScroll, isSerializedIframe, isSerializedStylesheet, hasShadowRoot } from '../utils.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/rrweb-types.js';\nimport { IframeManagerNoop, IframeManager } from './iframe-manager.js';\nimport { ShadowDomManagerNoop, ShadowDomManager } from './shadow-dom-manager.js';\nimport { CanvasManagerNoop } from './observers/canvas/canvas-manager.js';\nexport { CanvasManager } from './observers/canvas/canvas-manager.js';\nimport { StylesheetManager } from './stylesheet-manager.js';\nimport ProcessedNodeManager from './processed-node-manager.js';\nimport { callbackWrapper, unregisterErrorHandler, registerErrorHandler } from './error-handler.js';\n\nlet wrappedEmit;\r\nlet _wrappedEmit;\r\nlet _takeFullSnapshot;\r\nconst mirror = createMirror();\r\nfunction record(options = {}) {\r\n const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskAttributeFn, maskInputFn, maskTextFn, maxCanvasSize = null, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'\r\n ? options.recordAfter\r\n : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, onMutation, getCanvasManager, } = options;\r\n registerErrorHandler(errorHandler);\r\n const inEmittingFrame = recordCrossOriginIframes\r\n ? window.parent === window\r\n : true;\r\n let passEmitsToParent = false;\r\n if (!inEmittingFrame) {\r\n try {\r\n if (window.parent.document) {\r\n passEmitsToParent = false;\r\n }\r\n }\r\n catch (e) {\r\n passEmitsToParent = true;\r\n }\r\n }\r\n if (inEmittingFrame && !emit) {\r\n throw new Error('emit function is required');\r\n }\r\n if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\r\n sampling.mousemove = mousemoveWait;\r\n }\r\n mirror.reset();\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n radio: true,\r\n checkbox: true,\r\n }\r\n : _maskInputOptions !== undefined\r\n ? _maskInputOptions\r\n : {};\r\n const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\r\n ? {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaVerification: true,\r\n headMetaAuthorship: _slimDOMOptions === 'all',\r\n headMetaDescKeywords: _slimDOMOptions === 'all',\r\n }\r\n : _slimDOMOptions\r\n ? _slimDOMOptions\r\n : {};\r\n polyfill();\r\n let lastFullSnapshotEvent;\r\n let incrementalSnapshotCount = 0;\r\n const eventProcessor = (e) => {\r\n for (const plugin of plugins || []) {\r\n if (plugin.eventProcessor) {\r\n e = plugin.eventProcessor(e);\r\n }\r\n }\r\n if (packFn &&\r\n !passEmitsToParent) {\r\n e = packFn(e);\r\n }\r\n return e;\r\n };\r\n wrappedEmit = (r, isCheckout) => {\r\n const e = r;\r\n e.timestamp = nowTimestamp();\r\n if (mutationBuffers[0]?.isFrozen() &&\r\n e.type !== EventType.FullSnapshot &&\r\n !(e.type === EventType.IncrementalSnapshot &&\r\n e.data.source === IncrementalSource.Mutation)) {\r\n mutationBuffers.forEach((buf) => buf.unfreeze());\r\n }\r\n if (inEmittingFrame) {\r\n emit?.(eventProcessor(e), isCheckout);\r\n }\r\n else if (passEmitsToParent) {\r\n const message = {\r\n type: 'rrweb',\r\n event: eventProcessor(e),\r\n origin: window.location.origin,\r\n isCheckout,\r\n };\r\n window.parent.postMessage(message, '*');\r\n }\r\n if (e.type === EventType.FullSnapshot) {\r\n lastFullSnapshotEvent = e;\r\n incrementalSnapshotCount = 0;\r\n }\r\n else if (e.type === EventType.IncrementalSnapshot) {\r\n if (e.data.source === IncrementalSource.Mutation &&\r\n e.data.isAttachIframe) {\r\n return;\r\n }\r\n incrementalSnapshotCount++;\r\n const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\r\n const exceedTime = checkoutEveryNms &&\r\n lastFullSnapshotEvent &&\r\n e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\r\n if (exceedCount || exceedTime) {\r\n takeFullSnapshot(true);\r\n }\r\n }\r\n };\r\n _wrappedEmit = wrappedEmit;\r\n const wrappedMutationEmit = (m) => {\r\n wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Mutation,\r\n ...m,\r\n },\r\n });\r\n };\r\n const wrappedScrollEmit = (p) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Scroll,\r\n ...p,\r\n },\r\n });\r\n const wrappedCanvasMutationEmit = (p) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.CanvasMutation,\r\n ...p,\r\n },\r\n });\r\n const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.AdoptedStyleSheet,\r\n ...a,\r\n },\r\n });\r\n const stylesheetManager = new StylesheetManager({\r\n mutationCb: wrappedMutationEmit,\r\n adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit,\r\n });\r\n const iframeManager = typeof __RRWEB_EXCLUDE_IFRAME__ === 'boolean' && __RRWEB_EXCLUDE_IFRAME__\r\n ? new IframeManagerNoop()\r\n : new IframeManager({\r\n mirror,\r\n mutationCb: wrappedMutationEmit,\r\n stylesheetManager: stylesheetManager,\r\n recordCrossOriginIframes,\r\n wrappedEmit,\r\n });\r\n for (const plugin of plugins || []) {\r\n if (plugin.getMirror)\r\n plugin.getMirror({\r\n nodeMirror: mirror,\r\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\r\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror,\r\n });\r\n }\r\n const processedNodeManager = new ProcessedNodeManager();\r\n const canvasManager = _getCanvasManager(getCanvasManager, {\r\n mirror,\r\n win: window,\r\n mutationCb: (p) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.CanvasMutation,\r\n ...p,\r\n },\r\n }),\r\n recordCanvas,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maxCanvasSize,\r\n sampling: sampling['canvas'],\r\n dataURLOptions,\r\n errorHandler,\r\n });\r\n const shadowDomManager = typeof __RRWEB_EXCLUDE_SHADOW_DOM__ === 'boolean' &&\r\n __RRWEB_EXCLUDE_SHADOW_DOM__\r\n ? new ShadowDomManagerNoop()\r\n : new ShadowDomManager({\r\n mutationCb: wrappedMutationEmit,\r\n scrollCb: wrappedScrollEmit,\r\n bypassOptions: {\r\n onMutation,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n dataURLOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n recordCanvas,\r\n inlineImages,\r\n sampling,\r\n slimDOMOptions,\r\n iframeManager,\r\n stylesheetManager,\r\n canvasManager,\r\n keepIframeSrcFn,\r\n processedNodeManager,\r\n },\r\n mirror,\r\n });\r\n const takeFullSnapshot = (isCheckout = false) => {\r\n wrappedEmit({\r\n type: EventType.Meta,\r\n data: {\r\n href: window.location.href,\r\n width: getWindowWidth(),\r\n height: getWindowHeight(),\r\n },\r\n }, isCheckout);\r\n stylesheetManager.reset();\r\n shadowDomManager.init();\r\n mutationBuffers.forEach((buf) => buf.lock());\r\n const node = snapshot(document, {\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n inlineStylesheet,\r\n maskAllInputs: maskInputOptions,\r\n maskAttributeFn,\r\n maskInputFn,\r\n maskTextFn,\r\n slimDOM: slimDOMOptions,\r\n dataURLOptions,\r\n recordCanvas,\r\n inlineImages,\r\n onSerialize: (n) => {\r\n if (isSerializedIframe(n, mirror)) {\r\n iframeManager.addIframe(n);\r\n }\r\n if (isSerializedStylesheet(n, mirror)) {\r\n stylesheetManager.trackLinkElement(n);\r\n }\r\n if (hasShadowRoot(n)) {\r\n shadowDomManager.addShadowRoot(n.shadowRoot, document);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n iframeManager.attachIframe(iframe, childSn);\r\n shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (linkEl, childSn) => {\r\n stylesheetManager.attachLinkElement(linkEl, childSn);\r\n },\r\n keepIframeSrcFn,\r\n });\r\n if (!node) {\r\n return console.warn('Failed to snapshot the document');\r\n }\r\n wrappedEmit({\r\n type: EventType.FullSnapshot,\r\n data: {\r\n node,\r\n initialOffset: getWindowScroll(window),\r\n },\r\n });\r\n mutationBuffers.forEach((buf) => buf.unlock());\r\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\r\n stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\r\n };\r\n _takeFullSnapshot = takeFullSnapshot;\r\n try {\r\n const handlers = [];\r\n const observe = (doc) => {\r\n return callbackWrapper(initObservers)({\r\n onMutation,\r\n mutationCb: wrappedMutationEmit,\r\n mousemoveCb: (positions, source) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source,\r\n positions,\r\n },\r\n }),\r\n mouseInteractionCb: (d) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.MouseInteraction,\r\n ...d,\r\n },\r\n }),\r\n scrollCb: wrappedScrollEmit,\r\n viewportResizeCb: (d) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.ViewportResize,\r\n ...d,\r\n },\r\n }),\r\n inputCb: (v) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Input,\r\n ...v,\r\n },\r\n }),\r\n mediaInteractionCb: (p) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.MediaInteraction,\r\n ...p,\r\n },\r\n }),\r\n styleSheetRuleCb: (r) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.StyleSheetRule,\r\n ...r,\r\n },\r\n }),\r\n styleDeclarationCb: (r) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.StyleDeclaration,\r\n ...r,\r\n },\r\n }),\r\n canvasMutationCb: wrappedCanvasMutationEmit,\r\n fontCb: (p) => wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Font,\r\n ...p,\r\n },\r\n }),\r\n selectionCb: (p) => {\r\n wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Selection,\r\n ...p,\r\n },\r\n });\r\n },\r\n customElementCb: (c) => {\r\n wrappedEmit({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.CustomElement,\r\n ...c,\r\n },\r\n });\r\n },\r\n blockClass,\r\n ignoreClass,\r\n ignoreSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n maskInputOptions,\r\n inlineStylesheet,\r\n sampling,\r\n recordCanvas,\r\n inlineImages,\r\n userTriggeredOnInput,\r\n collectFonts,\r\n doc,\r\n maskAttributeFn,\r\n maskInputFn,\r\n maskTextFn,\r\n keepIframeSrcFn,\r\n blockSelector,\r\n unblockSelector,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n mirror,\r\n iframeManager,\r\n stylesheetManager,\r\n shadowDomManager,\r\n processedNodeManager,\r\n canvasManager,\r\n ignoreCSSAttributes,\r\n plugins: plugins\r\n ?.filter((p) => p.observer)\r\n ?.map((p) => ({\r\n observer: p.observer,\r\n options: p.options,\r\n callback: (payload) => wrappedEmit({\r\n type: EventType.Plugin,\r\n data: {\r\n plugin: p.name,\r\n payload,\r\n },\r\n }),\r\n })) || [],\r\n }, {});\r\n };\r\n iframeManager.addLoadListener((iframeEl) => {\r\n try {\r\n handlers.push(observe(iframeEl.contentDocument));\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n });\r\n const init = () => {\r\n takeFullSnapshot();\r\n handlers.push(observe(document));\r\n };\r\n if (document.readyState === 'interactive' ||\r\n document.readyState === 'complete') {\r\n init();\r\n }\r\n else {\r\n handlers.push(on('DOMContentLoaded', () => {\r\n wrappedEmit({\r\n type: EventType.DomContentLoaded,\r\n data: {},\r\n });\r\n if (recordAfter === 'DOMContentLoaded')\r\n init();\r\n }));\r\n handlers.push(on('load', () => {\r\n wrappedEmit({\r\n type: EventType.Load,\r\n data: {},\r\n });\r\n if (recordAfter === 'load')\r\n init();\r\n }, window));\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n processedNodeManager.destroy();\r\n _takeFullSnapshot = undefined;\r\n unregisterErrorHandler();\r\n };\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n}\r\nfunction addCustomEvent(tag, payload) {\r\n if (!_wrappedEmit) {\r\n throw new Error('please add custom event after start recording');\r\n }\r\n wrappedEmit({\r\n type: EventType.Custom,\r\n data: {\r\n tag,\r\n payload,\r\n },\r\n });\r\n}\r\nfunction freezePage() {\r\n mutationBuffers.forEach((buf) => buf.freeze());\r\n}\r\nfunction takeFullSnapshot(isCheckout) {\r\n if (!_takeFullSnapshot) {\r\n throw new Error('please take full snapshot after start recording');\r\n }\r\n _takeFullSnapshot(isCheckout);\r\n}\r\nrecord.mirror = mirror;\r\nrecord.takeFullSnapshot = takeFullSnapshot;\r\nfunction _getCanvasManager(getCanvasManagerFn, options) {\r\n try {\r\n return getCanvasManagerFn\r\n ? getCanvasManagerFn(options)\r\n : new CanvasManagerNoop();\r\n }\r\n catch {\r\n console.warn('Unable to initialize CanvasManager');\r\n return new CanvasManagerNoop();\r\n }\r\n}\n\nexport { addCustomEvent, record as default, freezePage, mirror, takeFullSnapshot };\n","type ClassOption = string | RegExp;\n\n/** Duplicate this from @sentry-internal/rrweb so we can export this as well. */\nexport const ReplayEventTypeDomContentLoaded = 0;\nexport const ReplayEventTypeLoad = 1;\nexport const ReplayEventTypeFullSnapshot = 2;\nexport const ReplayEventTypeIncrementalSnapshot = 3;\nexport const ReplayEventTypeMeta = 4;\nexport const ReplayEventTypeCustom = 5;\nexport const ReplayEventTypePlugin = 6;\n\nexport type ReplayEventType =\n | typeof ReplayEventTypeDomContentLoaded\n | typeof ReplayEventTypeLoad\n | typeof ReplayEventTypeFullSnapshot\n | typeof ReplayEventTypeIncrementalSnapshot\n | typeof ReplayEventTypeMeta\n | typeof ReplayEventTypeCustom\n | typeof ReplayEventTypePlugin;\n\n/**\n * This is a partial copy of rrweb's eventWithTime type which only contains the properties\n * we specifcally need in the SDK.\n */\nexport type ReplayEventWithTime = {\n type: ReplayEventType;\n data: unknown;\n timestamp: number;\n delay?: number;\n};\n\n/**\n * This is a partial copy of rrweb's recording options which only contains the properties\n * we specifically us in the SDK. Users can specify additional properties, hence we add the\n * Record union type.\n */\nexport type RrwebRecordOptions = {\n maskAllText?: boolean;\n maskAllInputs?: boolean;\n blockClass?: ClassOption;\n ignoreClass?: string;\n maskTextClass?: ClassOption;\n maskTextSelector?: string;\n blockSelector?: string;\n maskInputOptions?: Record;\n} & Record;\n\nexport interface CanvasManagerInterface {\n reset(): void;\n freeze(): void;\n unfreeze(): void;\n lock(): void;\n unlock(): void;\n snapshot(): void;\n}\n\nexport interface CanvasManagerOptions {\n recordCanvas: boolean;\n enableManualSnapshot?: boolean;\n blockClass: string | RegExp;\n blockSelector: string | null;\n unblockSelector: string | null;\n sampling?: 'all' | number;\n dataURLOptions: Partial<{\n type: string;\n quality: number;\n }>;\n mutationCb: (p: any) => void;\n win: typeof globalThis & Window;\n mirror: any;\n}\n","/**\n * Converts a timestamp to ms, if it was in s, or keeps it as ms.\n */\nexport function timestampToMs(timestamp: number): number {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp : timestamp * 1000;\n}\n\n/**\n * Converts a timestamp to s, if it was in ms, or keeps it as s.\n */\nexport function timestampToS(timestamp: number): number {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport type { Breadcrumb } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../../types';\n\n/**\n * Add a breadcrumb event to replay.\n */\nexport function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void {\n if (breadcrumb.category === 'sentry.transaction') {\n return;\n }\n\n if (['ui.click', 'ui.input'].includes(breadcrumb.category as string)) {\n replay.triggerUserActivity();\n } else {\n replay.checkAndHandleExpiredSession();\n }\n\n replay.addUpdate(() => {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.throttledAddEvent({\n type: EventType.Custom,\n // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n // but maybe we should just keep them as milliseconds\n timestamp: (breadcrumb.timestamp || 0) * 1000,\n data: {\n tag: 'breadcrumb',\n // normalize to max. 10 depth and 1_000 properties per object\n payload: normalize(breadcrumb, 10, 1_000),\n },\n });\n\n // Do not flush after console log messages\n return breadcrumb.category === 'console';\n });\n}\n","import type { INode } from '@sentry-internal/rrweb-snapshot';\n\nconst INTERACTIVE_SELECTOR = 'button,a';\n\n/** Get the closest interactive parent element, or else return the given element. */\nexport function getClosestInteractive(element: Element): Element {\n const closestInteractive = element.closest(INTERACTIVE_SELECTOR);\n return closestInteractive || element;\n}\n\n/**\n * For clicks, we check if the target is inside of a button or link\n * If so, we use this as the target instead\n * This is useful because if you click on the image in ,\n * The target will be the image, not the button, which we don't want here\n */\nexport function getClickTargetNode(event: Event | MouseEvent | Node): Node | INode | null {\n const target = getTargetNode(event);\n\n if (!target || !(target instanceof Element)) {\n return target;\n }\n\n return getClosestInteractive(target);\n}\n\n/** Get the event target node. */\nexport function getTargetNode(event: Node | { target: EventTarget | null }): Node | INode | null {\n if (isEventWithTarget(event)) {\n return event.target as Node | null;\n }\n\n return event;\n}\n\nfunction isEventWithTarget(event: unknown): event is { target: EventTarget | null } {\n return typeof event === 'object' && !!event && 'target' in event;\n}\n","import { fill } from '@sentry/utils';\n\nimport { WINDOW } from '../../constants';\n\ntype WindowOpenHandler = () => void;\n\nlet handlers: undefined | WindowOpenHandler[];\n\n/**\n * Register a handler to be called when `window.open()` is called.\n * Returns a cleanup function.\n */\nexport function onWindowOpen(cb: WindowOpenHandler): () => void {\n // Ensure to only register this once\n if (!handlers) {\n handlers = [];\n monkeyPatchWindowOpen();\n }\n\n handlers.push(cb);\n\n return () => {\n const pos = handlers ? handlers.indexOf(cb) : -1;\n if (pos > -1) {\n (handlers as WindowOpenHandler[]).splice(pos, 1);\n }\n };\n}\n\nfunction monkeyPatchWindowOpen(): void {\n fill(WINDOW, 'open', function (originalWindowOpen: () => void): () => void {\n return function (...args: unknown[]): void {\n if (handlers) {\n try {\n handlers.forEach(handler => handler());\n } catch (e) {\n // ignore errors in here\n }\n }\n\n return originalWindowOpen.apply(WINDOW, args);\n };\n });\n}\n","import { IncrementalSource, MouseInteractions, record } from '@sentry-internal/rrweb';\nimport type { Breadcrumb } from '@sentry/types';\n\nimport { WINDOW } from '../constants';\nimport type {\n RecordingEvent,\n ReplayClickDetector,\n ReplayContainer,\n ReplayMultiClickFrame,\n ReplaySlowClickFrame,\n SlowClickConfig,\n} from '../types';\nimport { ReplayEventTypeIncrementalSnapshot } from '../types';\nimport { timestampToS } from '../util/timestamp';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport { getClosestInteractive } from './util/domUtils';\nimport { onWindowOpen } from './util/onWindowOpen';\n\ntype ClickBreadcrumb = Breadcrumb & {\n timestamp: number;\n};\n\ninterface Click {\n timestamp: number;\n mutationAfter?: number;\n scrollAfter?: number;\n clickBreadcrumb: ClickBreadcrumb;\n clickCount: number;\n node: HTMLElement;\n}\n\ntype IncrementalRecordingEvent = RecordingEvent & {\n type: typeof ReplayEventTypeIncrementalSnapshot;\n data: { source: IncrementalSource };\n};\n\ntype IncrementalMouseInteractionRecordingEvent = IncrementalRecordingEvent & {\n type: typeof ReplayEventTypeIncrementalSnapshot;\n data: { type: MouseInteractions; id: number };\n};\n\n/** Handle a click. */\nexport function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void {\n clickDetector.handleClick(clickBreadcrumb, node);\n}\n\n/** A click detector class that can be used to detect slow or rage clicks on elements. */\nexport class ClickDetector implements ReplayClickDetector {\n // protected for testing\n protected _lastMutation: number;\n protected _lastScroll: number;\n\n private _clicks: Click[];\n private _teardown: undefined | (() => void);\n\n private _threshold: number;\n private _scollTimeout: number;\n private _timeout: number;\n private _ignoreSelector: string;\n\n private _replay: ReplayContainer;\n private _checkClickTimeout?: ReturnType;\n private _addBreadcrumbEvent: typeof addBreadcrumbEvent;\n\n public constructor(\n replay: ReplayContainer,\n slowClickConfig: SlowClickConfig,\n // Just for easier testing\n _addBreadcrumbEvent = addBreadcrumbEvent,\n ) {\n this._lastMutation = 0;\n this._lastScroll = 0;\n this._clicks = [];\n\n // We want everything in s, but options are in ms\n this._timeout = slowClickConfig.timeout / 1000;\n this._threshold = slowClickConfig.threshold / 1000;\n this._scollTimeout = slowClickConfig.scrollTimeout / 1000;\n this._replay = replay;\n this._ignoreSelector = slowClickConfig.ignoreSelector;\n this._addBreadcrumbEvent = _addBreadcrumbEvent;\n }\n\n /** Register click detection handlers on mutation or scroll. */\n public addListeners(): void {\n const cleanupWindowOpen = onWindowOpen(() => {\n // Treat window.open as mutation\n this._lastMutation = nowInSeconds();\n });\n\n this._teardown = () => {\n cleanupWindowOpen();\n\n this._clicks = [];\n this._lastMutation = 0;\n this._lastScroll = 0;\n };\n }\n\n /** Clean up listeners. */\n public removeListeners(): void {\n if (this._teardown) {\n this._teardown();\n }\n\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n }\n\n /** @inheritDoc */\n public handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void {\n if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) {\n return;\n }\n\n const newClick: Click = {\n timestamp: timestampToS(breadcrumb.timestamp),\n clickBreadcrumb: breadcrumb,\n // Set this to 0 so we know it originates from the click breadcrumb\n clickCount: 0,\n node,\n };\n\n // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second\n if (\n this._clicks.some(click => click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1)\n ) {\n return;\n }\n\n this._clicks.push(newClick);\n\n // If this is the first new click, set a timeout to check for multi clicks\n if (this._clicks.length === 1) {\n this._scheduleCheckClicks();\n }\n }\n\n /** @inheritDoc */\n public registerMutation(timestamp = Date.now()): void {\n this._lastMutation = timestampToS(timestamp);\n }\n\n /** @inheritDoc */\n public registerScroll(timestamp = Date.now()): void {\n this._lastScroll = timestampToS(timestamp);\n }\n\n /** @inheritDoc */\n public registerClick(element: HTMLElement): void {\n const node = getClosestInteractive(element);\n this._handleMultiClick(node as HTMLElement);\n }\n\n /** Count multiple clicks on elements. */\n private _handleMultiClick(node: HTMLElement): void {\n this._getClicks(node).forEach(click => {\n click.clickCount++;\n });\n }\n\n /** Get all pending clicks for a given node. */\n private _getClicks(node: HTMLElement): Click[] {\n return this._clicks.filter(click => click.node === node);\n }\n\n /** Check the clicks that happened. */\n private _checkClicks(): void {\n const timedOutClicks: Click[] = [];\n\n const now = nowInSeconds();\n\n this._clicks.forEach(click => {\n if (!click.mutationAfter && this._lastMutation) {\n click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined;\n }\n if (!click.scrollAfter && this._lastScroll) {\n click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : undefined;\n }\n\n // All of these are in seconds!\n if (click.timestamp + this._timeout <= now) {\n timedOutClicks.push(click);\n }\n });\n\n // Remove \"old\" clicks\n for (const click of timedOutClicks) {\n const pos = this._clicks.indexOf(click);\n\n if (pos > -1) {\n this._generateBreadcrumbs(click);\n this._clicks.splice(pos, 1);\n }\n }\n\n // Trigger new check, unless no clicks left\n if (this._clicks.length) {\n this._scheduleCheckClicks();\n }\n }\n\n /** Generate matching breadcrumb(s) for the click. */\n private _generateBreadcrumbs(click: Click): void {\n const replay = this._replay;\n const hadScroll = click.scrollAfter && click.scrollAfter <= this._scollTimeout;\n const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold;\n\n const isSlowClick = !hadScroll && !hadMutation;\n const { clickCount, clickBreadcrumb } = click;\n\n // Slow click\n if (isSlowClick) {\n // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout\n // If not, it means we just timed out without scroll & mutation\n const timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000;\n const endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout';\n\n const breadcrumb: ReplaySlowClickFrame = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.slowClickDetected',\n data: {\n ...clickBreadcrumb.data,\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n timeAfterClickMs,\n endReason,\n // If clickCount === 0, it means multiClick was not correctly captured here\n // - we still want to send 1 in this case\n clickCount: clickCount || 1,\n },\n };\n\n this._addBreadcrumbEvent(replay, breadcrumb);\n return;\n }\n\n // Multi click\n if (clickCount > 1) {\n const breadcrumb: ReplayMultiClickFrame = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.multiClick',\n data: {\n ...clickBreadcrumb.data,\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n clickCount,\n metric: true,\n },\n };\n\n this._addBreadcrumbEvent(replay, breadcrumb);\n }\n }\n\n /** Schedule to check current clicks. */\n private _scheduleCheckClicks(): void {\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n\n this._checkClickTimeout = setTimeout(() => this._checkClicks(), 1000);\n }\n}\n\nconst SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT'];\n\n/** exported for tests only */\nexport function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean {\n if (!SLOW_CLICK_TAGS.includes(node.tagName)) {\n return true;\n }\n\n // If tag, we only want to consider input[type='submit'] & input[type='button']\n if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) {\n return true;\n }\n\n // If tag, detect special variants that may not lead to an action\n // If target !== _self, we may open the link somewhere else, which would lead to no action\n // Also, when downloading a file, we may not leave the page, but still not trigger an action\n if (\n node.tagName === 'A' &&\n (node.hasAttribute('download') || (node.hasAttribute('target') && node.getAttribute('target') !== '_self'))\n ) {\n return true;\n }\n\n if (ignoreSelector && node.matches(ignoreSelector)) {\n return true;\n }\n\n return false;\n}\n\nfunction isClickBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is ClickBreadcrumb {\n return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp);\n}\n\n// This is good enough for us, and is easier to test/mock than `timestampInSeconds`\nfunction nowInSeconds(): number {\n return Date.now() / 1000;\n}\n\n/** Update the click detector based on a recording event of rrweb. */\nexport function updateClickDetectorForRecordingEvent(clickDetector: ReplayClickDetector, event: RecordingEvent): void {\n try {\n // note: We only consider incremental snapshots here\n // This means that any full snapshot is ignored for mutation detection - the reason is that we simply cannot know if a mutation happened here.\n // E.g. think that we are buffering, an error happens and we take a full snapshot because we switched to session mode -\n // in this scenario, we would not know if a dead click happened because of the error, which is a key dead click scenario.\n // Instead, by ignoring full snapshots, we have the risk that we generate a false positive\n // (if a mutation _did_ happen but was \"swallowed\" by the full snapshot)\n // But this should be more unlikely as we'd generally capture the incremental snapshot right away\n\n if (!isIncrementalEvent(event)) {\n return;\n }\n\n const { source } = event.data;\n if (source === IncrementalSource.Mutation) {\n clickDetector.registerMutation(event.timestamp);\n }\n\n if (source === IncrementalSource.Scroll) {\n clickDetector.registerScroll(event.timestamp);\n }\n\n if (isIncrementalMouseInteraction(event)) {\n const { type, id } = event.data;\n const node = record.mirror.getNode(id);\n\n if (node instanceof HTMLElement && type === MouseInteractions.Click) {\n clickDetector.registerClick(node);\n }\n }\n } catch {\n // ignore errors here, e.g. if accessing something that does not exist\n }\n}\n\nfunction isIncrementalEvent(event: RecordingEvent): event is IncrementalRecordingEvent {\n return event.type === ReplayEventTypeIncrementalSnapshot;\n}\n\nfunction isIncrementalMouseInteraction(\n event: IncrementalRecordingEvent,\n): event is IncrementalMouseInteractionRecordingEvent {\n return event.data.source === IncrementalSource.MouseInteraction;\n}\n","import type { ReplayBreadcrumbFrame } from '../types/replayFrame';\n\n/**\n * Create a breadcrumb for a replay.\n */\nexport function createBreadcrumb(\n breadcrumb: Omit & Partial>,\n): ReplayBreadcrumbFrame {\n return {\n timestamp: Date.now() / 1000,\n type: 'default',\n ...breadcrumb,\n };\n}\n","var NodeType;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n const host = n?.host;\r\n return Boolean(host?.shadowRoot === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n if (cssText.includes(' background-clip: text;') &&\r\n !cssText.includes(' -webkit-background-clip: text;')) {\r\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n }\r\n return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n const { cssText } = rule;\r\n if (cssText.split('\"').length < 3)\r\n return cssText;\r\n const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n if (rule.layerName === '') {\r\n statement.push(`layer`);\r\n }\r\n else if (rule.layerName) {\r\n statement.push(`layer(${rule.layerName})`);\r\n }\r\n if (rule.supportsText) {\r\n statement.push(`supports(${rule.supportsText})`);\r\n }\r\n if (rule.media.length) {\r\n statement.push(rule.media.mediaText);\r\n }\r\n return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n try {\r\n const rules = s.rules || s.cssRules;\r\n return rules\r\n ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n}\r\nfunction stringifyRule(rule) {\r\n let importStringified;\r\n if (isCSSImportRule(rule)) {\r\n try {\r\n importStringified =\r\n stringifyStylesheet(rule.styleSheet) ||\r\n escapeImportStatement(rule);\r\n }\r\n catch (error) {\r\n }\r\n }\r\n else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n return fixSafariColons(rule.cssText);\r\n }\r\n return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n if (!n)\r\n return -1;\r\n const id = this.getMeta(n)?.id;\r\n return id ?? -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction createMirror() {\r\n return new Mirror();\r\n}\r\nfunction shouldMaskInput({ maskInputOptions, tagName, type, }) {\r\n if (tagName === 'OPTION') {\r\n tagName = 'SELECT';\r\n }\r\n return Boolean(maskInputOptions[tagName.toLowerCase()] ||\r\n (type && maskInputOptions[type]) ||\r\n type === 'password' ||\r\n (tagName === 'INPUT' && !type && maskInputOptions['text']));\r\n}\r\nfunction maskInputValue({ isMasked, element, value, maskInputFn, }) {\r\n let text = value || '';\r\n if (!isMasked) {\r\n return text;\r\n }\r\n if (maskInputFn) {\r\n text = maskInputFn(text, element);\r\n }\r\n return '*'.repeat(text.length);\r\n}\r\nfunction toLowerCase(str) {\r\n return str.toLowerCase();\r\n}\r\nfunction toUpperCase(str) {\r\n return str.toUpperCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx)\r\n return true;\r\n const chunkSize = 50;\r\n for (let x = 0; x < canvas.width; x += chunkSize) {\r\n for (let y = 0; y < canvas.height; y += chunkSize) {\r\n const getImageData = ctx.getImageData;\r\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n : getImageData;\r\n const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n if (pixelBuffer.some((pixel) => pixel !== 0))\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isNodeMetaEqual(a, b) {\r\n if (!a || !b || a.type !== b.type)\r\n return false;\r\n if (a.type === NodeType.Document)\r\n return a.compatMode === b.compatMode;\r\n else if (a.type === NodeType.DocumentType)\r\n return (a.name === b.name &&\r\n a.publicId === b.publicId &&\r\n a.systemId === b.systemId);\r\n else if (a.type === NodeType.Comment ||\r\n a.type === NodeType.Text ||\r\n a.type === NodeType.CDATA)\r\n return a.textContent === b.textContent;\r\n else if (a.type === NodeType.Element)\r\n return (a.tagName === b.tagName &&\r\n JSON.stringify(a.attributes) ===\r\n JSON.stringify(b.attributes) &&\r\n a.isSVG === b.isSVG &&\r\n a.needBlock === b.needBlock);\r\n return false;\r\n}\r\nfunction getInputType(element) {\r\n const type = element.type;\r\n return element.hasAttribute('data-rr-is-password')\r\n ? 'password'\r\n : type\r\n ?\r\n toLowerCase(type)\r\n : null;\r\n}\r\nfunction getInputValue(el, tagName, type) {\r\n if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\r\n return el.getAttribute('value') || '';\r\n }\r\n return el.value;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n if (element instanceof HTMLFormElement) {\r\n return 'form';\r\n }\r\n const processedTagName = toLowerCase(element.tagName);\r\n if (tagNameRegex.test(processedTagName)) {\r\n return 'div';\r\n }\r\n return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n let origin = '';\r\n if (url.indexOf('//') > -1) {\r\n origin = url.split('/').slice(0, 3).join('/');\r\n }\r\n else {\r\n origin = url.split('/')[0];\r\n }\r\n origin = origin.split('?')[0];\r\n return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n const filePath = path1 || path2 || path3;\r\n const maybeQuote = quote1 || quote2 || '';\r\n if (!filePath) {\r\n return origin;\r\n }\r\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (DATA_URI.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (filePath[0] === '/') {\r\n return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n }\r\n const stack = href.split('/');\r\n const parts = filePath.split('/');\r\n stack.pop();\r\n for (const part of parts) {\r\n if (part === '.') {\r\n continue;\r\n }\r\n else if (part === '..') {\r\n stack.pop();\r\n }\r\n else {\r\n stack.push(part);\r\n }\r\n }\r\n return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n if (attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n let pos = 0;\r\n function collectCharacters(regEx) {\r\n let chars;\r\n const match = regEx.exec(attributeValue.substring(pos));\r\n if (match) {\r\n chars = match[0];\r\n pos += chars.length;\r\n return chars;\r\n }\r\n return '';\r\n }\r\n const output = [];\r\n while (true) {\r\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n if (pos >= attributeValue.length) {\r\n break;\r\n }\r\n let url = collectCharacters(SRCSET_NOT_SPACES);\r\n if (url.slice(-1) === ',') {\r\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n output.push(url);\r\n }\r\n else {\r\n let descriptorsStr = '';\r\n url = absoluteToDoc(doc, url);\r\n let inParens = false;\r\n while (true) {\r\n const c = attributeValue.charAt(pos);\r\n if (c === '') {\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (!inParens) {\r\n if (c === ',') {\r\n pos += 1;\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (c === '(') {\r\n inParens = true;\r\n }\r\n }\r\n else {\r\n if (c === ')') {\r\n inParens = false;\r\n }\r\n }\r\n descriptorsStr += c;\r\n pos += 1;\r\n }\r\n }\r\n }\r\n return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n if (!attributeValue || attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n const a = doc.createElement('a');\r\n a.href = attributeValue;\r\n return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n const a = document.createElement('a');\r\n a.href = '';\r\n return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\r\n if (!value) {\r\n return value;\r\n }\r\n if (name === 'src' ||\r\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'xlink:href' && value[0] !== '#') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'background' &&\r\n (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'srcset') {\r\n return getAbsoluteSrcsetString(doc, value);\r\n }\r\n else if (name === 'style') {\r\n return absoluteToStylesheet(value, getHref());\r\n }\r\n else if (tagName === 'object' && name === 'data') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n if (typeof maskAttributeFn === 'function') {\r\n return maskAttributeFn(name, value, element);\r\n }\r\n return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\r\n try {\r\n if (unblockSelector && element.matches(unblockSelector)) {\r\n return false;\r\n }\r\n if (typeof blockClass === 'string') {\r\n if (element.classList.contains(blockClass)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n for (let eIndex = element.classList.length; eIndex--;) {\r\n const className = element.classList[eIndex];\r\n if (blockClass.test(className)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (blockSelector) {\r\n return element.matches(blockSelector);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction elementClassMatchesRegex(el, regex) {\r\n for (let eIndex = el.classList.length; eIndex--;) {\r\n const className = el.classList[eIndex];\r\n if (regex.test(className)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction classMatchesRegex(node, regex, checkAncestors) {\r\n if (!node)\r\n return false;\r\n if (checkAncestors) {\r\n return (distanceToMatch(node, (node) => elementClassMatchesRegex(node, regex)) >= 0);\r\n }\r\n else if (node.nodeType === node.ELEMENT_NODE) {\r\n return elementClassMatchesRegex(node, regex);\r\n }\r\n return false;\r\n}\r\nfunction distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) {\r\n if (!node)\r\n return -1;\r\n if (node.nodeType !== node.ELEMENT_NODE)\r\n return -1;\r\n if (distance > limit)\r\n return -1;\r\n if (matchPredicate(node))\r\n return distance;\r\n return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\r\n}\r\nfunction createMatchPredicate(className, selector) {\r\n return (node) => {\r\n const el = node;\r\n if (el === null)\r\n return false;\r\n try {\r\n if (className) {\r\n if (typeof className === 'string') {\r\n if (el.matches(`.${className}`))\r\n return true;\r\n }\r\n else if (elementClassMatchesRegex(el, className)) {\r\n return true;\r\n }\r\n }\r\n if (selector && el.matches(selector))\r\n return true;\r\n return false;\r\n }\r\n catch {\r\n return false;\r\n }\r\n };\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\r\n try {\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n if (el === null)\r\n return false;\r\n if (el.tagName === 'INPUT') {\r\n const autocomplete = el.getAttribute('autocomplete');\r\n const disallowedAutocompleteValues = [\r\n 'current-password',\r\n 'new-password',\r\n 'cc-number',\r\n 'cc-exp',\r\n 'cc-exp-month',\r\n 'cc-exp-year',\r\n 'cc-csc',\r\n ];\r\n if (disallowedAutocompleteValues.includes(autocomplete)) {\r\n return true;\r\n }\r\n }\r\n let maskDistance = -1;\r\n let unmaskDistance = -1;\r\n if (maskAllText) {\r\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\r\n if (unmaskDistance < 0) {\r\n return true;\r\n }\r\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\r\n }\r\n else {\r\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\r\n if (maskDistance < 0) {\r\n return false;\r\n }\r\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\r\n }\r\n return maskDistance >= 0\r\n ? unmaskDistance >= 0\r\n ? maskDistance <= unmaskDistance\r\n : true\r\n : unmaskDistance >= 0\r\n ? false\r\n : !!maskAllText;\r\n }\r\n catch (e) {\r\n }\r\n return !!maskAllText;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n const win = iframeEl.contentWindow;\r\n if (!win) {\r\n return;\r\n }\r\n let fired = false;\r\n let readyState;\r\n try {\r\n readyState = win.document.readyState;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (readyState !== 'complete') {\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, iframeLoadTimeout);\r\n iframeEl.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n return;\r\n }\r\n const blankUrl = 'about:blank';\r\n if (win.location.href !== blankUrl ||\r\n iframeEl.src === blankUrl ||\r\n iframeEl.src === '') {\r\n setTimeout(listener, 0);\r\n return iframeEl.addEventListener('load', listener);\r\n }\r\n iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n let fired = false;\r\n let styleSheetLoaded;\r\n try {\r\n styleSheetLoaded = link.sheet;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (styleSheetLoaded)\r\n return;\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, styleSheetLoadTimeout);\r\n link.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n}\r\nfunction serializeNode(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n const rootId = getRootId(doc, mirror);\r\n switch (n.nodeType) {\r\n case n.DOCUMENT_NODE:\r\n if (n.compatMode !== 'CSS1Compat') {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n compatMode: n.compatMode,\r\n };\r\n }\r\n else {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n };\r\n }\r\n case n.DOCUMENT_TYPE_NODE:\r\n return {\r\n type: NodeType.DocumentType,\r\n name: n.name,\r\n publicId: n.publicId,\r\n systemId: n.systemId,\r\n rootId,\r\n };\r\n case n.ELEMENT_NODE:\r\n return serializeElementNode(n, {\r\n doc,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n inlineStylesheet,\r\n maskAttributeFn,\r\n maskInputOptions,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n rootId,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n });\r\n case n.TEXT_NODE:\r\n return serializeTextNode(n, {\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n maskTextFn,\r\n maskInputOptions,\r\n maskInputFn,\r\n rootId,\r\n });\r\n case n.CDATA_SECTION_NODE:\r\n return {\r\n type: NodeType.CDATA,\r\n textContent: '',\r\n rootId,\r\n };\r\n case n.COMMENT_NODE:\r\n return {\r\n type: NodeType.Comment,\r\n textContent: n.textContent || '',\r\n rootId,\r\n };\r\n default:\r\n return false;\r\n }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n if (!mirror.hasNode(doc))\r\n return undefined;\r\n const docId = mirror.getId(doc);\r\n return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options;\r\n const parentTagName = n.parentNode && n.parentNode.tagName;\r\n let textContent = n.textContent;\r\n const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\r\n if (isStyle && textContent) {\r\n try {\r\n if (n.nextSibling || n.previousSibling) {\r\n }\r\n else if (n.parentNode.sheet?.cssRules) {\r\n textContent = stringifyStylesheet(n.parentNode.sheet);\r\n }\r\n }\r\n catch (err) {\r\n console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n }\r\n textContent = absoluteToStylesheet(textContent, getHref());\r\n }\r\n if (isScript) {\r\n textContent = 'SCRIPT_PLACEHOLDER';\r\n }\r\n const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\r\n if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\r\n textContent = maskTextFn\r\n ? maskTextFn(textContent, n.parentElement)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\r\n textContent = maskInputFn\r\n ? maskInputFn(textContent, n.parentNode)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n if (parentTagName === 'OPTION' && textContent) {\r\n const isInputMasked = shouldMaskInput({\r\n type: null,\r\n tagName: parentTagName,\r\n maskInputOptions,\r\n });\r\n textContent = maskInputValue({\r\n isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\r\n element: n,\r\n value: textContent,\r\n maskInputFn,\r\n });\r\n }\r\n return {\r\n type: NodeType.Text,\r\n textContent: textContent || '',\r\n isStyle,\r\n rootId,\r\n };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options;\r\n const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\r\n const tagName = getValidTagName(n);\r\n let attributes = {};\r\n const len = n.attributes.length;\r\n for (let i = 0; i < len; i++) {\r\n const attr = n.attributes[i];\r\n if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) {\r\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\r\n }\r\n }\r\n if (tagName === 'link' && inlineStylesheet) {\r\n const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n return s.href === n.href;\r\n });\r\n let cssText = null;\r\n if (stylesheet) {\r\n cssText = stringifyStylesheet(stylesheet);\r\n }\r\n if (cssText) {\r\n delete attributes.rel;\r\n delete attributes.href;\r\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n }\r\n }\r\n if (tagName === 'style' &&\r\n n.sheet &&\r\n !(n.innerText || n.textContent || '').trim().length) {\r\n const cssText = stringifyStylesheet(n.sheet);\r\n if (cssText) {\r\n attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n }\r\n }\r\n if (tagName === 'input' ||\r\n tagName === 'textarea' ||\r\n tagName === 'select' ||\r\n tagName === 'option') {\r\n const el = n;\r\n const type = getInputType(el);\r\n const value = getInputValue(el, toUpperCase(tagName), type);\r\n const checked = el.checked;\r\n if (type !== 'submit' && type !== 'button' && value) {\r\n const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\r\n type,\r\n tagName: toUpperCase(tagName),\r\n maskInputOptions,\r\n }));\r\n attributes.value = maskInputValue({\r\n isMasked: forceMask,\r\n element: el,\r\n value,\r\n maskInputFn,\r\n });\r\n }\r\n if (checked) {\r\n attributes.checked = checked;\r\n }\r\n }\r\n if (tagName === 'option') {\r\n if (n.selected && !maskInputOptions['select']) {\r\n attributes.selected = true;\r\n }\r\n else {\r\n delete attributes.selected;\r\n }\r\n }\r\n if (tagName === 'canvas' && recordCanvas) {\r\n if (n.__context === '2d') {\r\n if (!is2DCanvasBlank(n)) {\r\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n }\r\n else if (!('__context' in n)) {\r\n const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n const blankCanvas = document.createElement('canvas');\r\n blankCanvas.width = n.width;\r\n blankCanvas.height = n.height;\r\n const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n if (canvasDataURL !== blankCanvasDataURL) {\r\n attributes.rr_dataURL = canvasDataURL;\r\n }\r\n }\r\n }\r\n if (tagName === 'img' && inlineImages) {\r\n if (!canvasService) {\r\n canvasService = doc.createElement('canvas');\r\n canvasCtx = canvasService.getContext('2d');\r\n }\r\n const image = n;\r\n const oldValue = image.crossOrigin;\r\n image.crossOrigin = 'anonymous';\r\n const recordInlineImage = () => {\r\n image.removeEventListener('load', recordInlineImage);\r\n try {\r\n canvasService.width = image.naturalWidth;\r\n canvasService.height = image.naturalHeight;\r\n canvasCtx.drawImage(image, 0, 0);\r\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n catch (err) {\r\n console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n }\r\n oldValue\r\n ? (attributes.crossOrigin = oldValue)\r\n : image.removeAttribute('crossorigin');\r\n };\r\n if (image.complete && image.naturalWidth !== 0)\r\n recordInlineImage();\r\n else\r\n image.addEventListener('load', recordInlineImage);\r\n }\r\n if (tagName === 'audio' || tagName === 'video') {\r\n attributes.rr_mediaState = n.paused\r\n ? 'paused'\r\n : 'played';\r\n attributes.rr_mediaCurrentTime = n.currentTime;\r\n }\r\n if (!newlyAddedElement) {\r\n if (n.scrollLeft) {\r\n attributes.rr_scrollLeft = n.scrollLeft;\r\n }\r\n if (n.scrollTop) {\r\n attributes.rr_scrollTop = n.scrollTop;\r\n }\r\n }\r\n if (needBlock) {\r\n const { width, height } = n.getBoundingClientRect();\r\n attributes = {\r\n class: attributes.class,\r\n rr_width: `${width}px`,\r\n rr_height: `${height}px`,\r\n };\r\n }\r\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n if (!n.contentDocument) {\r\n attributes.rr_src = attributes.src;\r\n }\r\n delete attributes.src;\r\n }\r\n let isCustomElement;\r\n try {\r\n if (customElements.get(tagName))\r\n isCustomElement = true;\r\n }\r\n catch (e) {\r\n }\r\n return {\r\n type: NodeType.Element,\r\n tagName,\r\n attributes,\r\n childNodes: [],\r\n isSVG: isSVGElement(n) || undefined,\r\n needBlock,\r\n rootId,\r\n isCustom: isCustomElement,\r\n };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n if (maybeAttr === undefined || maybeAttr === null) {\r\n return '';\r\n }\r\n else {\r\n return maybeAttr.toLowerCase();\r\n }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n return true;\r\n }\r\n else if (sn.type === NodeType.Element) {\r\n if (slimDOMOptions.script &&\r\n (sn.tagName === 'script' ||\r\n (sn.tagName === 'link' &&\r\n (sn.attributes.rel === 'preload' ||\r\n sn.attributes.rel === 'modulepreload') &&\r\n sn.attributes.as === 'script') ||\r\n (sn.tagName === 'link' &&\r\n sn.attributes.rel === 'prefetch' &&\r\n typeof sn.attributes.href === 'string' &&\r\n sn.attributes.href.endsWith('.js')))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headFavicon &&\r\n ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n (sn.tagName === 'meta' &&\r\n (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n return true;\r\n }\r\n else if (sn.tagName === 'meta') {\r\n if (slimDOMOptions.headMetaDescKeywords &&\r\n lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaSocial &&\r\n (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaRobots &&\r\n (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaHttpEquiv &&\r\n sn.attributes['http-equiv'] !== undefined) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaAuthorship &&\r\n (lowerIfExists(sn.attributes.name) === 'author' ||\r\n lowerIfExists(sn.attributes.name) === 'generator' ||\r\n lowerIfExists(sn.attributes.name) === 'framework' ||\r\n lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n lowerIfExists(sn.attributes.name) === 'progid' ||\r\n lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaVerification &&\r\n (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n lowerIfExists(sn.attributes.name) === 'verification' ||\r\n lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n let { preserveWhiteSpace = true } = options;\r\n const _serializedNode = serializeNode(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskAllText,\r\n unblockSelector,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n });\r\n if (!_serializedNode) {\r\n console.warn(n, 'not serialized');\r\n return null;\r\n }\r\n let id;\r\n if (mirror.hasNode(n)) {\r\n id = mirror.getId(n);\r\n }\r\n else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n (!preserveWhiteSpace &&\r\n _serializedNode.type === NodeType.Text &&\r\n !_serializedNode.isStyle &&\r\n !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n id = IGNORED_NODE;\r\n }\r\n else {\r\n id = genId();\r\n }\r\n const serializedNode = Object.assign(_serializedNode, { id });\r\n mirror.add(n, serializedNode);\r\n if (id === IGNORED_NODE) {\r\n return null;\r\n }\r\n if (onSerialize) {\r\n onSerialize(n);\r\n }\r\n let recordChild = !skipChild;\r\n if (serializedNode.type === NodeType.Element) {\r\n recordChild = recordChild && !serializedNode.needBlock;\r\n delete serializedNode.needBlock;\r\n const shadowRoot = n.shadowRoot;\r\n if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n serializedNode.isShadowHost = true;\r\n }\r\n if ((serializedNode.type === NodeType.Document ||\r\n serializedNode.type === NodeType.Element) &&\r\n recordChild) {\r\n if (slimDOMOptions.headWhitespace &&\r\n serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'head') {\r\n preserveWhiteSpace = false;\r\n }\r\n const bypassOptions = {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskAllText,\r\n unblockSelector,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n };\r\n for (const childN of Array.from(n.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n if (isElement(n) && n.shadowRoot) {\r\n for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n isNativeShadowDom(n.shadowRoot) &&\r\n (serializedChildNode.isShadow = true);\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n }\r\n if (n.parentNode &&\r\n isShadowRoot(n.parentNode) &&\r\n isNativeShadowDom(n.parentNode)) {\r\n serializedNode.isShadow = true;\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'iframe') {\r\n onceIframeLoaded(n, () => {\r\n const iframeDoc = n.contentDocument;\r\n if (iframeDoc && onIframeLoad) {\r\n const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n doc: iframeDoc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedIframeNode) {\r\n onIframeLoad(n, serializedIframeNode);\r\n }\r\n }\r\n }, iframeLoadTimeout);\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'link' &&\r\n serializedNode.attributes.rel === 'stylesheet') {\r\n onceStylesheetLoaded(n, () => {\r\n if (onStylesheetLoad) {\r\n const serializedLinkNode = serializeNodeWithId(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedLinkNode) {\r\n onStylesheetLoad(n, serializedLinkNode);\r\n }\r\n }\r\n }, stylesheetLoadTimeout);\r\n }\r\n return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n }\r\n : maskAllInputs === false\r\n ? {}\r\n : maskAllInputs;\r\n const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n ?\r\n {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaDescKeywords: slimDOM === 'all',\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaAuthorship: true,\r\n headMetaVerification: true,\r\n }\r\n : slimDOM === false\r\n ? {}\r\n : slimDOM;\r\n return serializeNodeWithId(n, {\r\n doc: n,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n unblockSelector,\r\n maskAllText,\r\n maskTextClass,\r\n unmaskTextClass,\r\n maskTextSelector,\r\n unmaskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskAttributeFn,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n newlyAddedElement: false,\r\n });\r\n}\r\nfunction visitSnapshot(node, onVisit) {\r\n function walk(current) {\r\n onVisit(current);\r\n if (current.type === NodeType.Document ||\r\n current.type === NodeType.Element) {\r\n current.childNodes.forEach(walk);\r\n }\r\n }\r\n walk(node);\r\n}\r\nfunction cleanupSnapshot() {\r\n _id = 1;\r\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\r\nfunction parse(css, options = {}) {\r\n let lineno = 1;\r\n let column = 1;\r\n function updatePosition(str) {\r\n const lines = str.match(/\\n/g);\r\n if (lines) {\r\n lineno += lines.length;\r\n }\r\n const i = str.lastIndexOf('\\n');\r\n column = i === -1 ? column + str.length : str.length - i;\r\n }\r\n function position() {\r\n const start = { line: lineno, column };\r\n return (node) => {\r\n node.position = new Position(start);\r\n whitespace();\r\n return node;\r\n };\r\n }\r\n class Position {\r\n constructor(start) {\r\n this.start = start;\r\n this.end = { line: lineno, column };\r\n this.source = options.source;\r\n }\r\n }\r\n Position.prototype.content = css;\r\n const errorsList = [];\r\n function error(msg) {\r\n const err = new Error(`${options.source || ''}:${lineno}:${column}: ${msg}`);\r\n err.reason = msg;\r\n err.filename = options.source;\r\n err.line = lineno;\r\n err.column = column;\r\n err.source = css;\r\n if (options.silent) {\r\n errorsList.push(err);\r\n }\r\n else {\r\n throw err;\r\n }\r\n }\r\n function stylesheet() {\r\n const rulesList = rules();\r\n return {\r\n type: 'stylesheet',\r\n stylesheet: {\r\n source: options.source,\r\n rules: rulesList,\r\n parsingErrors: errorsList,\r\n },\r\n };\r\n }\r\n function open() {\r\n return match(/^{\\s*/);\r\n }\r\n function close() {\r\n return match(/^}/);\r\n }\r\n function rules() {\r\n let node;\r\n const rules = [];\r\n whitespace();\r\n comments(rules);\r\n while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\r\n if (node) {\r\n rules.push(node);\r\n comments(rules);\r\n }\r\n }\r\n return rules;\r\n }\r\n function match(re) {\r\n const m = re.exec(css);\r\n if (!m) {\r\n return;\r\n }\r\n const str = m[0];\r\n updatePosition(str);\r\n css = css.slice(str.length);\r\n return m;\r\n }\r\n function whitespace() {\r\n match(/^\\s*/);\r\n }\r\n function comments(rules = []) {\r\n let c;\r\n while ((c = comment())) {\r\n if (c) {\r\n rules.push(c);\r\n }\r\n c = comment();\r\n }\r\n return rules;\r\n }\r\n function comment() {\r\n const pos = position();\r\n if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\r\n return;\r\n }\r\n let i = 2;\r\n while ('' !== css.charAt(i) &&\r\n ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\r\n ++i;\r\n }\r\n i += 2;\r\n if ('' === css.charAt(i - 1)) {\r\n return error('End of comment missing');\r\n }\r\n const str = css.slice(2, i - 2);\r\n column += 2;\r\n updatePosition(str);\r\n css = css.slice(i);\r\n column += 2;\r\n return pos({\r\n type: 'comment',\r\n comment: str,\r\n });\r\n }\r\n function selector() {\r\n whitespace();\r\n while (css[0] == '}') {\r\n error('extra closing bracket');\r\n css = css.slice(1);\r\n whitespace();\r\n }\r\n const m = match(/^((\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'|[^{])+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const cleanedInput = m[0]\r\n .trim()\r\n .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\r\n .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\r\n return m.replace(/,/g, '\\u200C');\r\n });\r\n return customSplit(cleanedInput).map((s) => s.replace(/\\u200C/g, ',').trim());\r\n }\r\n function customSplit(input) {\r\n const result = [];\r\n let currentSegment = '';\r\n let depthParentheses = 0;\r\n let depthBrackets = 0;\r\n let currentStringChar = null;\r\n for (const char of input) {\r\n const hasStringEscape = currentSegment.endsWith('\\\\');\r\n if (currentStringChar) {\r\n if (currentStringChar === char && !hasStringEscape) {\r\n currentStringChar = null;\r\n }\r\n }\r\n else if (char === '(') {\r\n depthParentheses++;\r\n }\r\n else if (char === ')') {\r\n depthParentheses--;\r\n }\r\n else if (char === '[') {\r\n depthBrackets++;\r\n }\r\n else if (char === ']') {\r\n depthBrackets--;\r\n }\r\n else if ('\\'\"'.includes(char)) {\r\n currentStringChar = char;\r\n }\r\n if (char === ',' && depthParentheses === 0 && depthBrackets === 0) {\r\n result.push(currentSegment);\r\n currentSegment = '';\r\n }\r\n else {\r\n currentSegment += char;\r\n }\r\n }\r\n if (currentSegment) {\r\n result.push(currentSegment);\r\n }\r\n return result;\r\n }\r\n function declaration() {\r\n const pos = position();\r\n const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\r\n if (!propMatch) {\r\n return;\r\n }\r\n const prop = trim(propMatch[0]);\r\n if (!match(/^:\\s*/)) {\r\n return error(`property missing ':'`);\r\n }\r\n const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\r\n const ret = pos({\r\n type: 'declaration',\r\n property: prop.replace(commentre, ''),\r\n value: val ? trim(val[0]).replace(commentre, '') : '',\r\n });\r\n match(/^[;\\s]*/);\r\n return ret;\r\n }\r\n function declarations() {\r\n const decls = [];\r\n if (!open()) {\r\n return error(`missing '{'`);\r\n }\r\n comments(decls);\r\n let decl;\r\n while ((decl = declaration())) {\r\n if (decl !== false) {\r\n decls.push(decl);\r\n comments(decls);\r\n }\r\n decl = declaration();\r\n }\r\n if (!close()) {\r\n return error(`missing '}'`);\r\n }\r\n return decls;\r\n }\r\n function keyframe() {\r\n let m;\r\n const vals = [];\r\n const pos = position();\r\n while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\r\n vals.push(m[1]);\r\n match(/^,\\s*/);\r\n }\r\n if (!vals.length) {\r\n return;\r\n }\r\n return pos({\r\n type: 'keyframe',\r\n values: vals,\r\n declarations: declarations(),\r\n });\r\n }\r\n function atkeyframes() {\r\n const pos = position();\r\n let m = match(/^@([-\\w]+)?keyframes\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = m[1];\r\n m = match(/^([-\\w]+)\\s*/);\r\n if (!m) {\r\n return error('@keyframes missing name');\r\n }\r\n const name = m[1];\r\n if (!open()) {\r\n return error(`@keyframes missing '{'`);\r\n }\r\n let frame;\r\n let frames = comments();\r\n while ((frame = keyframe())) {\r\n frames.push(frame);\r\n frames = frames.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@keyframes missing '}'`);\r\n }\r\n return pos({\r\n type: 'keyframes',\r\n name,\r\n vendor,\r\n keyframes: frames,\r\n });\r\n }\r\n function atsupports() {\r\n const pos = position();\r\n const m = match(/^@supports *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const supports = trim(m[1]);\r\n if (!open()) {\r\n return error(`@supports missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@supports missing '}'`);\r\n }\r\n return pos({\r\n type: 'supports',\r\n supports,\r\n rules: style,\r\n });\r\n }\r\n function athost() {\r\n const pos = position();\r\n const m = match(/^@host\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@host missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@host missing '}'`);\r\n }\r\n return pos({\r\n type: 'host',\r\n rules: style,\r\n });\r\n }\r\n function atmedia() {\r\n const pos = position();\r\n const m = match(/^@media *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const media = trim(m[1]);\r\n if (!open()) {\r\n return error(`@media missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@media missing '}'`);\r\n }\r\n return pos({\r\n type: 'media',\r\n media,\r\n rules: style,\r\n });\r\n }\r\n function atcustommedia() {\r\n const pos = position();\r\n const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\r\n if (!m) {\r\n return;\r\n }\r\n return pos({\r\n type: 'custom-media',\r\n name: trim(m[1]),\r\n media: trim(m[2]),\r\n });\r\n }\r\n function atpage() {\r\n const pos = position();\r\n const m = match(/^@page */);\r\n if (!m) {\r\n return;\r\n }\r\n const sel = selector() || [];\r\n if (!open()) {\r\n return error(`@page missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@page missing '}'`);\r\n }\r\n return pos({\r\n type: 'page',\r\n selectors: sel,\r\n declarations: decls,\r\n });\r\n }\r\n function atdocument() {\r\n const pos = position();\r\n const m = match(/^@([-\\w]+)?document *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = trim(m[1]);\r\n const doc = trim(m[2]);\r\n if (!open()) {\r\n return error(`@document missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@document missing '}'`);\r\n }\r\n return pos({\r\n type: 'document',\r\n document: doc,\r\n vendor,\r\n rules: style,\r\n });\r\n }\r\n function atfontface() {\r\n const pos = position();\r\n const m = match(/^@font-face\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@font-face missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@font-face missing '}'`);\r\n }\r\n return pos({\r\n type: 'font-face',\r\n declarations: decls,\r\n });\r\n }\r\n const atimport = _compileAtrule('import');\r\n const atcharset = _compileAtrule('charset');\r\n const atnamespace = _compileAtrule('namespace');\r\n function _compileAtrule(name) {\r\n const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\r\n return () => {\r\n const pos = position();\r\n const m = match(re);\r\n if (!m) {\r\n return;\r\n }\r\n const ret = { type: name };\r\n ret[name] = m[1].trim();\r\n return pos(ret);\r\n };\r\n }\r\n function atrule() {\r\n if (css[0] !== '@') {\r\n return;\r\n }\r\n return (atkeyframes() ||\r\n atmedia() ||\r\n atcustommedia() ||\r\n atsupports() ||\r\n atimport() ||\r\n atcharset() ||\r\n atnamespace() ||\r\n atdocument() ||\r\n atpage() ||\r\n athost() ||\r\n atfontface());\r\n }\r\n function rule() {\r\n const pos = position();\r\n const sel = selector();\r\n if (!sel) {\r\n return error('selector missing');\r\n }\r\n comments();\r\n return pos({\r\n type: 'rule',\r\n selectors: sel,\r\n declarations: declarations(),\r\n });\r\n }\r\n return addParent(stylesheet());\r\n}\r\nfunction trim(str) {\r\n return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\r\n}\r\nfunction addParent(obj, parent) {\r\n const isNode = obj && typeof obj.type === 'string';\r\n const childParent = isNode ? obj : parent;\r\n for (const k of Object.keys(obj)) {\r\n const value = obj[k];\r\n if (Array.isArray(value)) {\r\n value.forEach((v) => {\r\n addParent(v, childParent);\r\n });\r\n }\r\n else if (value && typeof value === 'object') {\r\n addParent(value, childParent);\r\n }\r\n }\r\n if (isNode) {\r\n Object.defineProperty(obj, 'parent', {\r\n configurable: true,\r\n writable: true,\r\n enumerable: false,\r\n value: parent || null,\r\n });\r\n }\r\n return obj;\r\n}\n\nconst tagMap = {\r\n script: 'noscript',\r\n altglyph: 'altGlyph',\r\n altglyphdef: 'altGlyphDef',\r\n altglyphitem: 'altGlyphItem',\r\n animatecolor: 'animateColor',\r\n animatemotion: 'animateMotion',\r\n animatetransform: 'animateTransform',\r\n clippath: 'clipPath',\r\n feblend: 'feBlend',\r\n fecolormatrix: 'feColorMatrix',\r\n fecomponenttransfer: 'feComponentTransfer',\r\n fecomposite: 'feComposite',\r\n feconvolvematrix: 'feConvolveMatrix',\r\n fediffuselighting: 'feDiffuseLighting',\r\n fedisplacementmap: 'feDisplacementMap',\r\n fedistantlight: 'feDistantLight',\r\n fedropshadow: 'feDropShadow',\r\n feflood: 'feFlood',\r\n fefunca: 'feFuncA',\r\n fefuncb: 'feFuncB',\r\n fefuncg: 'feFuncG',\r\n fefuncr: 'feFuncR',\r\n fegaussianblur: 'feGaussianBlur',\r\n feimage: 'feImage',\r\n femerge: 'feMerge',\r\n femergenode: 'feMergeNode',\r\n femorphology: 'feMorphology',\r\n feoffset: 'feOffset',\r\n fepointlight: 'fePointLight',\r\n fespecularlighting: 'feSpecularLighting',\r\n fespotlight: 'feSpotLight',\r\n fetile: 'feTile',\r\n feturbulence: 'feTurbulence',\r\n foreignobject: 'foreignObject',\r\n glyphref: 'glyphRef',\r\n lineargradient: 'linearGradient',\r\n radialgradient: 'radialGradient',\r\n};\r\nfunction getTagName(n) {\r\n let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\r\n if (tagName === 'link' && n.attributes._cssText) {\r\n tagName = 'style';\r\n }\r\n return tagName;\r\n}\r\nfunction escapeRegExp(str) {\r\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\r\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\r\nfunction addHoverClass(cssText, cache) {\r\n const cachedStyle = cache?.stylesWithHoverClass.get(cssText);\r\n if (cachedStyle)\r\n return cachedStyle;\r\n if (cssText.length >= 1000000) {\r\n return cssText;\r\n }\r\n const ast = parse(cssText, {\r\n silent: true,\r\n });\r\n if (!ast.stylesheet) {\r\n return cssText;\r\n }\r\n const selectors = [];\r\n ast.stylesheet.rules.forEach((rule) => {\r\n if ('selectors' in rule) {\r\n (rule.selectors || []).forEach((selector) => {\r\n if (HOVER_SELECTOR.test(selector)) {\r\n selectors.push(selector);\r\n }\r\n });\r\n }\r\n });\r\n if (selectors.length === 0) {\r\n return cssText;\r\n }\r\n const selectorMatcher = new RegExp(selectors\r\n .filter((selector, index) => selectors.indexOf(selector) === index)\r\n .sort((a, b) => b.length - a.length)\r\n .map((selector) => {\r\n return escapeRegExp(selector);\r\n })\r\n .join('|'), 'g');\r\n const result = cssText.replace(selectorMatcher, (selector) => {\r\n const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\r\n return `${selector}, ${newSelector}`;\r\n });\r\n cache?.stylesWithHoverClass.set(cssText, result);\r\n return result;\r\n}\r\nfunction createCache() {\r\n const stylesWithHoverClass = new Map();\r\n return {\r\n stylesWithHoverClass,\r\n };\r\n}\r\nfunction buildNode(n, options) {\r\n const { doc, hackCss, cache } = options;\r\n switch (n.type) {\r\n case NodeType.Document:\r\n return doc.implementation.createDocument(null, '', null);\r\n case NodeType.DocumentType:\r\n return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\r\n case NodeType.Element: {\r\n const tagName = getTagName(n);\r\n let node;\r\n if (n.isSVG) {\r\n node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\r\n }\r\n else {\r\n if (n.isCustom &&\r\n doc.defaultView?.customElements &&\r\n !doc.defaultView.customElements.get(n.tagName))\r\n doc.defaultView.customElements.define(n.tagName, class extends doc.defaultView.HTMLElement {\r\n });\r\n node = doc.createElement(tagName);\r\n }\r\n const specialAttributes = {};\r\n for (const name in n.attributes) {\r\n if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {\r\n continue;\r\n }\r\n let value = n.attributes[name];\r\n if (tagName === 'option' &&\r\n name === 'selected' &&\r\n value === false) {\r\n continue;\r\n }\r\n if (value === null) {\r\n continue;\r\n }\r\n if (value === true)\r\n value = '';\r\n if (name.startsWith('rr_')) {\r\n specialAttributes[name] = value;\r\n continue;\r\n }\r\n const isTextarea = tagName === 'textarea' && name === 'value';\r\n const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\r\n if (isRemoteOrDynamicCss && hackCss && typeof value === 'string') {\r\n value = addHoverClass(value, cache);\r\n }\r\n if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {\r\n const child = doc.createTextNode(value);\r\n for (const c of Array.from(node.childNodes)) {\r\n if (c.nodeType === node.TEXT_NODE) {\r\n node.removeChild(c);\r\n }\r\n }\r\n node.appendChild(child);\r\n continue;\r\n }\r\n try {\r\n if (n.isSVG && name === 'xlink:href') {\r\n node.setAttributeNS('http://www.w3.org/1999/xlink', name, value.toString());\r\n }\r\n else if (name === 'onload' ||\r\n name === 'onclick' ||\r\n name.substring(0, 7) === 'onmouse') {\r\n node.setAttribute('_' + name, value.toString());\r\n }\r\n else if (tagName === 'meta' &&\r\n n.attributes['http-equiv'] === 'Content-Security-Policy' &&\r\n name === 'content') {\r\n node.setAttribute('csp-content', value.toString());\r\n continue;\r\n }\r\n else if (tagName === 'link' &&\r\n (n.attributes.rel === 'preload' ||\r\n n.attributes.rel === 'modulepreload') &&\r\n n.attributes.as === 'script') {\r\n }\r\n else if (tagName === 'link' &&\r\n n.attributes.rel === 'prefetch' &&\r\n typeof n.attributes.href === 'string' &&\r\n n.attributes.href.endsWith('.js')) {\r\n }\r\n else if (tagName === 'img' &&\r\n n.attributes.srcset &&\r\n n.attributes.rr_dataURL) {\r\n node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\r\n }\r\n else {\r\n node.setAttribute(name, value.toString());\r\n }\r\n }\r\n catch (error) {\r\n }\r\n }\r\n for (const name in specialAttributes) {\r\n const value = specialAttributes[name];\r\n if (tagName === 'canvas' && name === 'rr_dataURL') {\r\n const image = document.createElement('img');\r\n image.onload = () => {\r\n const ctx = node.getContext('2d');\r\n if (ctx) {\r\n ctx.drawImage(image, 0, 0, image.width, image.height);\r\n }\r\n };\r\n image.src = value.toString();\r\n if (node.RRNodeType)\r\n node.rr_dataURL = value.toString();\r\n }\r\n else if (tagName === 'img' && name === 'rr_dataURL') {\r\n const image = node;\r\n if (!image.currentSrc.startsWith('data:')) {\r\n image.setAttribute('rrweb-original-src', n.attributes.src);\r\n image.src = value.toString();\r\n }\r\n }\r\n if (name === 'rr_width') {\r\n node.style.setProperty('width', value.toString());\r\n }\r\n else if (name === 'rr_height') {\r\n node.style.setProperty('height', value.toString());\r\n }\r\n else if (name === 'rr_mediaCurrentTime' &&\r\n typeof value === 'number') {\r\n node.currentTime = value;\r\n }\r\n else if (name === 'rr_mediaState') {\r\n switch (value) {\r\n case 'played':\r\n node\r\n .play()\r\n .catch((e) => console.warn('media playback error', e));\r\n break;\r\n case 'paused':\r\n node.pause();\r\n break;\r\n }\r\n }\r\n }\r\n if (n.isShadowHost) {\r\n if (!node.shadowRoot) {\r\n node.attachShadow({ mode: 'open' });\r\n }\r\n else {\r\n while (node.shadowRoot.firstChild) {\r\n node.shadowRoot.removeChild(node.shadowRoot.firstChild);\r\n }\r\n }\r\n }\r\n return node;\r\n }\r\n case NodeType.Text:\r\n return doc.createTextNode(n.isStyle && hackCss\r\n ? addHoverClass(n.textContent, cache)\r\n : n.textContent);\r\n case NodeType.CDATA:\r\n return doc.createCDATASection(n.textContent);\r\n case NodeType.Comment:\r\n return doc.createComment(n.textContent);\r\n default:\r\n return null;\r\n }\r\n}\r\nfunction buildNodeWithSN(n, options) {\r\n const { doc, mirror, skipChild = false, hackCss = true, afterAppend, cache, } = options;\r\n if (mirror.has(n.id)) {\r\n const nodeInMirror = mirror.getNode(n.id);\r\n const meta = mirror.getMeta(nodeInMirror);\r\n if (isNodeMetaEqual(meta, n))\r\n return mirror.getNode(n.id);\r\n }\r\n let node = buildNode(n, { doc, hackCss, cache });\r\n if (!node) {\r\n return null;\r\n }\r\n if (n.rootId && mirror.getNode(n.rootId) !== doc) {\r\n mirror.replace(n.rootId, doc);\r\n }\r\n if (n.type === NodeType.Document) {\r\n doc.close();\r\n doc.open();\r\n if (n.compatMode === 'BackCompat' &&\r\n n.childNodes &&\r\n n.childNodes[0].type !== NodeType.DocumentType) {\r\n if (n.childNodes[0].type === NodeType.Element &&\r\n 'xmlns' in n.childNodes[0].attributes &&\r\n n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\r\n doc.write('');\r\n }\r\n else {\r\n doc.write('');\r\n }\r\n }\r\n node = doc;\r\n }\r\n mirror.add(node, n);\r\n if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\r\n !skipChild) {\r\n for (const childN of n.childNodes) {\r\n const childNode = buildNodeWithSN(childN, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n if (!childNode) {\r\n console.warn('Failed to rebuild', childN);\r\n continue;\r\n }\r\n if (childN.isShadow && isElement(node) && node.shadowRoot) {\r\n node.shadowRoot.appendChild(childNode);\r\n }\r\n else if (n.type === NodeType.Document &&\r\n childN.type == NodeType.Element) {\r\n const htmlElement = childNode;\r\n let body = null;\r\n htmlElement.childNodes.forEach((child) => {\r\n if (child.nodeName === 'BODY')\r\n body = child;\r\n });\r\n if (body) {\r\n htmlElement.removeChild(body);\r\n node.appendChild(childNode);\r\n htmlElement.appendChild(body);\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n if (afterAppend) {\r\n afterAppend(childNode, childN.id);\r\n }\r\n }\r\n }\r\n return node;\r\n}\r\nfunction visit(mirror, onVisit) {\r\n function walk(node) {\r\n onVisit(node);\r\n }\r\n for (const id of mirror.getIds()) {\r\n if (mirror.has(id)) {\r\n walk(mirror.getNode(id));\r\n }\r\n }\r\n}\r\nfunction handleScroll(node, mirror) {\r\n const n = mirror.getMeta(node);\r\n if (n?.type !== NodeType.Element) {\r\n return;\r\n }\r\n const el = node;\r\n for (const name in n.attributes) {\r\n if (!(Object.prototype.hasOwnProperty.call(n.attributes, name) &&\r\n name.startsWith('rr_'))) {\r\n continue;\r\n }\r\n const value = n.attributes[name];\r\n if (name === 'rr_scrollLeft') {\r\n el.scrollLeft = value;\r\n }\r\n if (name === 'rr_scrollTop') {\r\n el.scrollTop = value;\r\n }\r\n }\r\n}\r\nfunction rebuild(n, options) {\r\n const { doc, onVisit, hackCss = true, afterAppend, cache, mirror = new Mirror(), } = options;\r\n const node = buildNodeWithSN(n, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n visit(mirror, (visitedNode) => {\r\n if (onVisit) {\r\n onVisit(visitedNode);\r\n }\r\n handleScroll(visitedNode, mirror);\r\n });\r\n return node;\r\n}\n\nexport { IGNORED_NODE, Mirror, NodeType, addHoverClass, buildNodeWithSN, classMatchesRegex, cleanupSnapshot, createCache, createMatchPredicate, createMirror, distanceToMatch, escapeImportStatement, fixSafariColons, genId, getInputType, getInputValue, ignoreAttribute, is2DCanvasBlank, isCSSImportRule, isCSSStyleRule, isElement, isNativeShadowDom, isNodeMetaEqual, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, shouldMaskInput, snapshot, stringifyRule, stringifyStylesheet, toLowerCase, toUpperCase, transformAttribute, visitSnapshot };\n","// Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\nconst ATTRIBUTES_TO_RECORD = new Set([\n 'id',\n 'class',\n 'aria-label',\n 'role',\n 'name',\n 'alt',\n 'title',\n 'data-test-id',\n 'data-testid',\n 'disabled',\n 'aria-disabled',\n 'data-sentry-component',\n]);\n\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\nexport function getAttributesToRecord(attributes: Record): Record {\n const obj: Record = {};\n for (const key in attributes) {\n if (ATTRIBUTES_TO_RECORD.has(key)) {\n let normalizedKey = key;\n\n if (key === 'data-testid' || key === 'data-test-id') {\n normalizedKey = 'testId';\n }\n\n obj[normalizedKey] = attributes[key];\n }\n }\n\n return obj;\n}\n","import { record } from '@sentry-internal/rrweb';\nimport type { serializedElementNodeWithId, serializedNodeWithId } from '@sentry-internal/rrweb-snapshot';\nimport { NodeType } from '@sentry-internal/rrweb-snapshot';\nimport type { Breadcrumb, HandlerDataDom } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { handleClick } from './handleClick';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport { getClickTargetNode, getTargetNode } from './util/domUtils';\nimport { getAttributesToRecord } from './util/getAttributesToRecord';\n\nexport const handleDomListener: (replay: ReplayContainer) => (handlerData: HandlerDataDom) => void = (\n replay: ReplayContainer,\n) => {\n return (handlerData: HandlerDataDom): void => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleDom(handlerData);\n\n if (!result) {\n return;\n }\n\n const isClick = handlerData.name === 'click';\n const event = isClick ? (handlerData.event as PointerEvent) : undefined;\n // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab)\n if (\n isClick &&\n replay.clickDetector &&\n event &&\n event.target &&\n !event.altKey &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey\n ) {\n handleClick(\n replay.clickDetector,\n result as Breadcrumb & { timestamp: number; data: { nodeId: number } },\n getClickTargetNode(handlerData.event as Event) as HTMLElement,\n );\n }\n\n addBreadcrumbEvent(replay, result);\n };\n};\n\n/** Get the base DOM breadcrumb. */\nexport function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb {\n const nodeId = record.mirror.getId(target);\n const node = nodeId && record.mirror.getNode(nodeId);\n const meta = node && record.mirror.getMeta(node);\n const element = meta && isElement(meta) ? meta : null;\n\n return {\n message,\n data: element\n ? {\n nodeId,\n node: {\n id: nodeId,\n tagName: element.tagName,\n textContent: Array.from(element.childNodes)\n .map((node: serializedNodeWithId) => node.type === NodeType.Text && node.textContent)\n .filter(Boolean) // filter out empty values\n .map(text => (text as string).trim())\n .join(''),\n attributes: getAttributesToRecord(element.attributes),\n },\n }\n : {},\n };\n}\n\n/**\n * An event handler to react to DOM events.\n * Exported for tests.\n */\nexport function handleDom(handlerData: HandlerDataDom): Breadcrumb | null {\n const { target, message } = getDomTarget(handlerData);\n\n return createBreadcrumb({\n category: `ui.${handlerData.name}`,\n ...getBaseDomBreadcrumb(target, message),\n });\n}\n\nfunction getDomTarget(handlerData: HandlerDataDom): { target: Node | null; message: string } {\n const isClick = handlerData.name === 'click';\n\n let message: string | undefined;\n let target: Node | null = null;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = isClick ? getClickTargetNode(handlerData.event as Event) : getTargetNode(handlerData.event as Event);\n message = htmlTreeAsString(target, { maxStringLength: 200 }) || '';\n } catch (e) {\n message = '';\n }\n\n return { target, message };\n}\n\nfunction isElement(node: serializedNodeWithId): node is serializedElementNodeWithId {\n return node.type === NodeType.Element;\n}\n","import type { Breadcrumb } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { getBaseDomBreadcrumb } from './handleDom';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\n/** Handle keyboard events & create breadcrumbs. */\nexport function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void {\n if (!replay.isEnabled()) {\n return;\n }\n\n // Update user activity, but do not restart recording as it can create\n // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new\n // session with a single \"keydown\" breadcrumb is created)\n replay.updateUserActivity();\n\n const breadcrumb = getKeyboardBreadcrumb(event);\n\n if (!breadcrumb) {\n return;\n }\n\n addBreadcrumbEvent(replay, breadcrumb);\n}\n\n/** exported only for tests */\nexport function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null {\n const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;\n\n // never capture for input fields\n if (!target || isInputElement(target as HTMLElement) || !key) {\n return null;\n }\n\n // Note: We do not consider shift here, as that means \"uppercase\"\n const hasModifierKey = metaKey || ctrlKey || altKey;\n const isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length\n\n // Do not capture breadcrumb if only a word key is pressed\n // This could leak e.g. user input\n if (!hasModifierKey && isCharacterKey) {\n return null;\n }\n\n const message = htmlTreeAsString(target, { maxStringLength: 200 }) || '';\n const baseBreadcrumb = getBaseDomBreadcrumb(target as Node, message);\n\n return createBreadcrumb({\n category: 'ui.keyDown',\n message,\n data: {\n ...baseBreadcrumb.data,\n metaKey,\n shiftKey,\n ctrlKey,\n altKey,\n key,\n },\n });\n}\n\nfunction isInputElement(target: HTMLElement): boolean {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;\n}\n","import { record } from '@sentry-internal/rrweb';\nimport { browserPerformanceTimeOrigin } from '@sentry/utils';\n\nimport { WINDOW } from '../constants';\nimport type {\n AllPerformanceEntry,\n AllPerformanceEntryData,\n ExperimentalPerformanceResourceTiming,\n LargestContentfulPaintData,\n NavigationData,\n PaintData,\n ReplayPerformanceEntry,\n ResourceData,\n} from '../types';\n\n// Map entryType -> function to normalize data for event\nconst ENTRY_TYPES: Record<\n string,\n (entry: AllPerformanceEntry) => null | ReplayPerformanceEntry\n> = {\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n resource: createResourceEntry,\n paint: createPaintEntry,\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n navigation: createNavigationEntry,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nexport function createPerformanceEntries(\n entries: AllPerformanceEntry[],\n): ReplayPerformanceEntry[] {\n return entries.map(createPerformanceEntry).filter(Boolean) as ReplayPerformanceEntry[];\n}\n\nfunction createPerformanceEntry(entry: AllPerformanceEntry): ReplayPerformanceEntry | null {\n if (!ENTRY_TYPES[entry.entryType]) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number): number {\n // browserPerformanceTimeOrigin can be undefined if `performance` or\n // `performance.now` doesn't exist, but this is already checked by this integration\n return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming): ReplayPerformanceEntry {\n const { duration, entryType, name, startTime } = entry;\n\n const start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name,\n start,\n end: start + duration,\n data: undefined,\n };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming): ReplayPerformanceEntry | null {\n const {\n entryType,\n name,\n decodedBodySize,\n duration,\n domComplete,\n encodedBodySize,\n domContentLoadedEventStart,\n domContentLoadedEventEnd,\n domInteractive,\n loadEventStart,\n loadEventEnd,\n redirectCount,\n startTime,\n transferSize,\n type,\n } = entry;\n\n // Ignore entries with no duration, they do not seem to be useful and cause dupes\n if (duration === 0) {\n return null;\n }\n\n return {\n type: `${entryType}.${type}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name,\n data: {\n size: transferSize,\n decodedBodySize,\n encodedBodySize,\n duration,\n domInteractive,\n domContentLoadedEventStart,\n domContentLoadedEventEnd,\n loadEventStart,\n loadEventEnd,\n domComplete,\n redirectCount,\n },\n };\n}\n\nfunction createResourceEntry(\n entry: ExperimentalPerformanceResourceTiming,\n): ReplayPerformanceEntry | null {\n const {\n entryType,\n initiatorType,\n name,\n responseEnd,\n startTime,\n decodedBodySize,\n encodedBodySize,\n responseStatus,\n transferSize,\n } = entry;\n\n // Core SDK handles these\n if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n return null;\n }\n\n return {\n type: `${entryType}.${initiatorType}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name,\n data: {\n size: transferSize,\n statusCode: responseStatus,\n decodedBodySize,\n encodedBodySize,\n },\n };\n}\n\n/**\n * Add a LCP event to the replay based on an LCP metric.\n */\nexport function getLargestContentfulPaint(metric: {\n value: number;\n entries: PerformanceEntry[];\n}): ReplayPerformanceEntry {\n const entries = metric.entries;\n const lastEntry = entries[entries.length - 1] as (PerformanceEntry & { element?: Element }) | undefined;\n const element = lastEntry ? lastEntry.element : undefined;\n\n const value = metric.value;\n\n const end = getAbsoluteTime(value);\n\n const data: ReplayPerformanceEntry = {\n type: 'largest-contentful-paint',\n name: 'largest-contentful-paint',\n start: end,\n end,\n data: {\n value,\n size: value,\n nodeId: element ? record.mirror.getId(element) : undefined,\n },\n };\n\n return data;\n}\n","import { addLcpInstrumentationHandler, addPerformanceInstrumentationHandler } from '@sentry-internal/tracing';\n\nimport type { ReplayContainer } from '../types';\nimport { getLargestContentfulPaint } from '../util/createPerformanceEntries';\n\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n * Returns a callback to stop observing.\n */\nexport function setupPerformanceObserver(replay: ReplayContainer): () => void {\n function addPerformanceEntry(entry: PerformanceEntry): void {\n // It is possible for entries to come up multiple times\n if (!replay.performanceEntries.includes(entry)) {\n replay.performanceEntries.push(entry);\n }\n }\n\n function onEntries({ entries }: { entries: PerformanceEntry[] }): void {\n entries.forEach(addPerformanceEntry);\n }\n\n const clearCallbacks: (() => void)[] = [];\n\n (['navigation', 'paint', 'resource'] as const).forEach(type => {\n clearCallbacks.push(addPerformanceInstrumentationHandler(type, onEntries));\n });\n\n clearCallbacks.push(\n addLcpInstrumentationHandler(({ metric }) => {\n replay.replayPerformanceEntries.push(getLargestContentfulPaint(metric));\n }),\n );\n\n // A callback to cleanup all handlers\n return () => {\n clearCallbacks.forEach(clearCallback => clearCallback());\n };\n}\n","export default `var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a>h]=l}else for(o=new n(i),a=0;a>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=[\"unexpected EOF\",\"invalid block type\",\"invalid length/literal\",\"invalid distance\",\"stream finished\",\"no stream handler\",,\"no callback\",\"invalid UTF-8 data\",\"extra field too long\",\"date not in range 1980-2099\",\"filename too long\",\"stream finishing\",\"invalid zip data\"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;ad&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<e))break;p+=m-(1<>=y;p>0;){var M=o[a].s;g[M]=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if(\"function\"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G=\"undefined\"!=typeof TextEncoder&&new TextEncoder,H=\"undefined\"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i>1)),o=0,f=function(t){s[o++]=t};for(i=0;is.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\"Adding invalid event\");const n=this._hasEvents?\",\":\"\";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push(\"]\",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push(\"[\")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener(\"message\",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&\"function\"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\"init\",success:!0,response:void 0});`;\n","import { addBreadcrumb } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\n\n/**\n * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.\n */\nexport function logInfo(message: string, shouldAddBreadcrumb?: boolean): void {\n if (!DEBUG_BUILD) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n addLogBreadcrumb(message);\n }\n}\n\n/**\n * Log a message, and add a breadcrumb in the next tick.\n * This is necessary when the breadcrumb may be added before the replay is initialized.\n */\nexport function logInfoNextTick(message: string, shouldAddBreadcrumb?: boolean): void {\n if (!DEBUG_BUILD) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n // Wait a tick here to avoid race conditions for some initial logs\n // which may be added before replay is initialized\n setTimeout(() => {\n addLogBreadcrumb(message);\n }, 0);\n }\n}\n\nfunction addLogBreadcrumb(message: string): void {\n addBreadcrumb(\n {\n category: 'console',\n data: {\n logger: 'replay',\n },\n level: 'info',\n message,\n },\n { level: 'info' },\n );\n}\n","import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\n\n/** This error indicates that the event buffer size exceeded the limit.. */\nexport class EventBufferSizeExceededError extends Error {\n public constructor() {\n super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`);\n }\n}\n","import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { timestampToMs } from '../util/timestamp';\nimport { EventBufferSizeExceededError } from './error';\n\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\nexport class EventBufferArray implements EventBuffer {\n /** All the events that are buffered to be sent. */\n public events: RecordingEvent[];\n\n /** @inheritdoc */\n public hasCheckout: boolean;\n\n private _totalSize: number;\n\n public constructor() {\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n public get hasEvents(): boolean {\n return this.events.length > 0;\n }\n\n /** @inheritdoc */\n public get type(): EventBufferType {\n return 'sync';\n }\n\n /** @inheritdoc */\n public destroy(): void {\n this.events = [];\n }\n\n /** @inheritdoc */\n public async addEvent(event: RecordingEvent): Promise {\n const eventSize = JSON.stringify(event).length;\n this._totalSize += eventSize;\n if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n throw new EventBufferSizeExceededError();\n }\n\n this.events.push(event);\n }\n\n /** @inheritdoc */\n public finish(): Promise {\n return new Promise(resolve => {\n // Make a copy of the events array reference and immediately clear the\n // events member so that we do not lose new events while uploading\n // attachment.\n const eventsRet = this.events;\n this.clear();\n resolve(JSON.stringify(eventsRet));\n });\n }\n\n /** @inheritdoc */\n public clear(): void {\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n public getEarliestTimestamp(): number | null {\n const timestamp = this.events.map(event => event.timestamp).sort()[0];\n\n if (!timestamp) {\n return null;\n }\n\n return timestampToMs(timestamp);\n }\n}\n","import { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WorkerRequest, WorkerResponse } from '../types';\nimport { logInfo } from '../util/log';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class WorkerHandler {\n private _worker: Worker;\n private _id: number;\n private _ensureReadyPromise?: Promise;\n\n public constructor(worker: Worker) {\n this._worker = worker;\n this._id = 0;\n }\n\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n public ensureReady(): Promise {\n // Ensure we only check once\n if (this._ensureReadyPromise) {\n return this._ensureReadyPromise;\n }\n\n this._ensureReadyPromise = new Promise((resolve, reject) => {\n this._worker.addEventListener(\n 'message',\n ({ data }: MessageEvent) => {\n if ((data as WorkerResponse).success) {\n resolve();\n } else {\n reject();\n }\n },\n { once: true },\n );\n\n this._worker.addEventListener(\n 'error',\n error => {\n reject(error);\n },\n { once: true },\n );\n });\n\n return this._ensureReadyPromise;\n }\n\n /**\n * Destroy the worker.\n */\n public destroy(): void {\n logInfo('[Replay] Destroying compression worker');\n this._worker.terminate();\n }\n\n /**\n * Post message to worker and wait for response before resolving promise.\n */\n public postMessage(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise {\n const id = this._getAndIncrementId();\n\n return new Promise((resolve, reject) => {\n const listener = ({ data }: MessageEvent): void => {\n const response = data as WorkerResponse;\n if (response.method !== method) {\n return;\n }\n\n // There can be multiple listeners for a single method, the id ensures\n // that the response matches the caller.\n if (response.id !== id) {\n return;\n }\n\n // At this point, we'll always want to remove listener regardless of result status\n this._worker.removeEventListener('message', listener);\n\n if (!response.success) {\n // TODO: Do some error handling, not sure what\n DEBUG_BUILD && logger.error('[Replay]', response.response);\n\n reject(new Error('Error in compression worker'));\n return;\n }\n\n resolve(response.response as T);\n };\n\n // Note: we can't use `once` option because it's possible it needs to\n // listen to multiple messages\n this._worker.addEventListener('message', listener);\n this._worker.postMessage({ id, method, arg });\n });\n }\n\n /** Get the current ID and increment it for the next call. */\n private _getAndIncrementId(): number {\n return this._id++;\n }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\nimport { logger } from '@sentry/utils';\nimport { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { timestampToMs } from '../util/timestamp';\nimport { WorkerHandler } from './WorkerHandler';\nimport { EventBufferSizeExceededError } from './error';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class EventBufferCompressionWorker implements EventBuffer {\n /** @inheritdoc */\n public hasCheckout: boolean;\n\n private _worker: WorkerHandler;\n private _earliestTimestamp: number | null;\n private _totalSize;\n\n public constructor(worker: Worker) {\n this._worker = new WorkerHandler(worker);\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n public get hasEvents(): boolean {\n return !!this._earliestTimestamp;\n }\n\n /** @inheritdoc */\n public get type(): EventBufferType {\n return 'worker';\n }\n\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n public ensureReady(): Promise {\n return this._worker.ensureReady();\n }\n\n /**\n * Destroy the event buffer.\n */\n public destroy(): void {\n this._worker.destroy();\n }\n\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfuly received and processed by worker.\n */\n public addEvent(event: RecordingEvent): Promise {\n const timestamp = timestampToMs(event.timestamp);\n if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) {\n this._earliestTimestamp = timestamp;\n }\n\n const data = JSON.stringify(event);\n this._totalSize += data.length;\n\n if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n return Promise.reject(new EventBufferSizeExceededError());\n }\n\n return this._sendEventToWorker(data);\n }\n\n /**\n * Finish the event buffer and return the compressed data.\n */\n public finish(): Promise {\n return this._finishRequest();\n }\n\n /** @inheritdoc */\n public clear(): void {\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false;\n\n // We do not wait on this, as we assume the order of messages is consistent for the worker\n this._worker.postMessage('clear').then(null, e => {\n DEBUG_BUILD && logger.warn('[Replay] Sending \"clear\" message to worker failed', e);\n });\n }\n\n /** @inheritdoc */\n public getEarliestTimestamp(): number | null {\n return this._earliestTimestamp;\n }\n\n /**\n * Send the event to the worker.\n */\n private _sendEventToWorker(data: string): Promise {\n return this._worker.postMessage('addEvent', data);\n }\n\n /**\n * Finish the request and return the compressed data from the worker.\n */\n private async _finishRequest(): Promise {\n const response = await this._worker.postMessage('finish');\n\n this._earliestTimestamp = null;\n this._totalSize = 0;\n\n return response;\n }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { logInfo } from '../util/log';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferCompressionWorker } from './EventBufferCompressionWorker';\n\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\nexport class EventBufferProxy implements EventBuffer {\n private _fallback: EventBufferArray;\n private _compression: EventBufferCompressionWorker;\n private _used: EventBuffer;\n private _ensureWorkerIsLoadedPromise: Promise;\n\n public constructor(worker: Worker) {\n this._fallback = new EventBufferArray();\n this._compression = new EventBufferCompressionWorker(worker);\n this._used = this._fallback;\n\n this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n }\n\n /** @inheritdoc */\n public get type(): EventBufferType {\n return this._used.type;\n }\n\n /** @inheritDoc */\n public get hasEvents(): boolean {\n return this._used.hasEvents;\n }\n\n /** @inheritdoc */\n public get hasCheckout(): boolean {\n return this._used.hasCheckout;\n }\n /** @inheritdoc */\n public set hasCheckout(value: boolean) {\n this._used.hasCheckout = value;\n }\n\n /** @inheritDoc */\n public destroy(): void {\n this._fallback.destroy();\n this._compression.destroy();\n }\n\n /** @inheritdoc */\n public clear(): void {\n return this._used.clear();\n }\n\n /** @inheritdoc */\n public getEarliestTimestamp(): number | null {\n return this._used.getEarliestTimestamp();\n }\n\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfully added.\n */\n public addEvent(event: RecordingEvent): Promise {\n return this._used.addEvent(event);\n }\n\n /** @inheritDoc */\n public async finish(): Promise {\n // Ensure the worker is loaded, so the sent event is compressed\n await this.ensureWorkerIsLoaded();\n\n return this._used.finish();\n }\n\n /** Ensure the worker has loaded. */\n public ensureWorkerIsLoaded(): Promise {\n return this._ensureWorkerIsLoadedPromise;\n }\n\n /** Actually check if the worker has been loaded. */\n private async _ensureWorkerIsLoaded(): Promise {\n try {\n await this._compression.ensureReady();\n } catch (error) {\n // If the worker fails to load, we fall back to the simple buffer.\n // Nothing more to do from our side here\n logInfo('[Replay] Failed to load the compression worker, falling back to simple buffer');\n return;\n }\n\n // Now we need to switch over the array buffer to the compression worker\n await this._switchToCompressionWorker();\n }\n\n /** Switch the used buffer to the compression worker. */\n private async _switchToCompressionWorker(): Promise {\n const { events, hasCheckout } = this._fallback;\n\n const addEventPromises: Promise[] = [];\n for (const event of events) {\n addEventPromises.push(this._compression.addEvent(event));\n }\n\n this._compression.hasCheckout = hasCheckout;\n\n // We switch over to the new buffer immediately - any further events will be added\n // after the previously buffered ones\n this._used = this._compression;\n\n // Wait for original events to be re-added before resolving\n try {\n await Promise.all(addEventPromises);\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n }\n }\n}\n","import { getWorkerURL } from '@sentry-internal/replay-worker';\n\nimport type { EventBuffer } from '../types';\nimport { logInfo } from '../util/log';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferProxy } from './EventBufferProxy';\n\ninterface CreateEventBufferParams {\n useCompression: boolean;\n workerUrl?: string;\n}\n\n// Treeshakable guard to remove the code of the included compression worker\ndeclare const __SENTRY_EXCLUDE_REPLAY_WORKER__: boolean;\n\n/**\n * Create an event buffer for replays.\n */\nexport function createEventBuffer({\n useCompression,\n workerUrl: customWorkerUrl,\n}: CreateEventBufferParams): EventBuffer {\n if (\n useCompression &&\n // eslint-disable-next-line no-restricted-globals\n window.Worker\n ) {\n const worker = _loadWorker(customWorkerUrl);\n\n if (worker) {\n return worker;\n }\n }\n\n logInfo('[Replay] Using simple buffer');\n return new EventBufferArray();\n}\n\nfunction _loadWorker(customWorkerUrl?: string): EventBufferProxy | void {\n try {\n const workerUrl = customWorkerUrl || _getWorkerUrl();\n\n if (!workerUrl) {\n return;\n }\n\n logInfo(`[Replay] Using compression worker${customWorkerUrl ? ` from ${customWorkerUrl}` : ''}`);\n const worker = new Worker(workerUrl);\n return new EventBufferProxy(worker);\n } catch (error) {\n logInfo('[Replay] Failed to create compression worker');\n // Fall back to use simple event buffer array\n }\n}\n\nfunction _getWorkerUrl(): string {\n if (typeof __SENTRY_EXCLUDE_REPLAY_WORKER__ === 'undefined' || !__SENTRY_EXCLUDE_REPLAY_WORKER__) {\n return getWorkerURL();\n }\n\n return '';\n}\n","import r from\"./worker\";function e(){const e=new Blob([r]);return URL.createObjectURL(e)}export{e as getWorkerURL};\n","import { WINDOW } from '../constants';\n\n/** If sessionStorage is available. */\nexport function hasSessionStorage(): boolean {\n try {\n // This can throw, e.g. when being accessed in a sandboxed iframe\n return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;\n } catch {\n return false;\n }\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../../src/constants';\nimport type { ReplayContainer } from '../../src/types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\n\n/**\n * Removes the session from Session Storage and unsets session in replay instance\n */\nexport function clearSession(replay: ReplayContainer): void {\n deleteSession();\n replay.session = undefined;\n}\n\n/**\n * Deletes a session from storage\n */\nfunction deleteSession(): void {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY);\n } catch {\n // Ignore potential SecurityError exceptions\n }\n}\n","/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\nexport function isSampled(sampleRate?: number): boolean {\n if (sampleRate === undefined) {\n return false;\n }\n\n // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n return Math.random() < sampleRate;\n}\n","import { uuid4 } from '@sentry/utils';\n\nimport type { Sampled, Session } from '../types';\n\n/**\n * Get a session with defaults & applied sampling.\n */\nexport function makeSession(session: Partial & { sampled: Sampled }): Session {\n const now = Date.now();\n const id = session.id || uuid4();\n // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n const started = session.started || now;\n const lastActivity = session.lastActivity || now;\n const segmentId = session.segmentId || 0;\n const sampled = session.sampled;\n const previousSessionId = session.previousSessionId;\n\n return {\n id,\n started,\n lastActivity,\n segmentId,\n sampled,\n previousSessionId,\n };\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\n\n/**\n * Save a session to session storage.\n */\nexport function saveSession(session: Session): void {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch {\n // Ignore potential SecurityError exceptions\n }\n}\n","import type { Sampled, Session, SessionOptions } from '../types';\nimport { isSampled } from '../util/isSampled';\nimport { makeSession } from './Session';\nimport { saveSession } from './saveSession';\n\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\nexport function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled {\n return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false;\n}\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession(\n { sessionSampleRate, allowBuffering, stickySession = false }: SessionOptions,\n { previousSessionId }: { previousSessionId?: string } = {},\n): Session {\n const sampled = getSessionSampleType(sessionSampleRate, allowBuffering);\n const session = makeSession({\n sampled,\n previousSessionId,\n });\n\n if (stickySession) {\n saveSession(session);\n }\n\n return session;\n}\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n initialTime: null | number,\n expiry: undefined | number,\n targetTime: number = +new Date(),\n): boolean {\n // Always expired if < 0\n if (initialTime === null || expiry === undefined || expiry < 0) {\n return true;\n }\n\n // Never expires if == 0\n if (expiry === 0) {\n return false;\n }\n\n return initialTime + expiry <= targetTime;\n}\n","import type { Session } from '../types';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(\n session: Session,\n {\n maxReplayDuration,\n sessionIdleExpire,\n targetTime = Date.now(),\n }: { maxReplayDuration: number; sessionIdleExpire: number; targetTime?: number },\n): boolean {\n return (\n // First, check that maximum session length has not been exceeded\n isExpired(session.started, maxReplayDuration, targetTime) ||\n // check that the idle timeout has not been exceeded (i.e. user has\n // performed an action within the last `sessionIdleExpire` ms)\n isExpired(session.lastActivity, sessionIdleExpire, targetTime)\n );\n}\n","import type { Session } from '../types';\nimport { isSessionExpired } from '../util/isSessionExpired';\n\n/** If the session should be refreshed or not. */\nexport function shouldRefreshSession(\n session: Session,\n { sessionIdleExpire, maxReplayDuration }: { sessionIdleExpire: number; maxReplayDuration: number },\n): boolean {\n // If not expired, all good, just keep the session\n if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) {\n return false;\n }\n\n // If we are buffering & haven't ever flushed yet, always continue\n if (session.sampled === 'buffer' && session.segmentId === 0) {\n return false;\n }\n\n return true;\n}\n","import type { Session, SessionOptions } from '../types';\nimport { logInfoNextTick } from '../util/log';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { shouldRefreshSession } from './shouldRefreshSession';\n\n/**\n * Get or create a session, when initializing the replay.\n * Returns a session that may be unsampled.\n */\nexport function loadOrCreateSession(\n {\n traceInternals,\n sessionIdleExpire,\n maxReplayDuration,\n previousSessionId,\n }: {\n sessionIdleExpire: number;\n maxReplayDuration: number;\n traceInternals?: boolean;\n previousSessionId?: string;\n },\n sessionOptions: SessionOptions,\n): Session {\n const existingSession = sessionOptions.stickySession && fetchSession(traceInternals);\n\n // No session exists yet, just create a new one\n if (!existingSession) {\n logInfoNextTick('[Replay] Creating new session', traceInternals);\n return createSession(sessionOptions, { previousSessionId });\n }\n\n if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) {\n return existingSession;\n }\n\n logInfoNextTick('[Replay] Session in sessionStorage is expired, creating new one...');\n return createSession(sessionOptions, { previousSessionId: existingSession.id });\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\nimport { logInfoNextTick } from '../util/log';\nimport { makeSession } from './Session';\n\n/**\n * Fetches a session from storage\n */\nexport function fetchSession(traceInternals?: boolean): Session | null {\n if (!hasSessionStorage()) {\n return null;\n }\n\n try {\n // This can throw if cookies are disabled\n const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n if (!sessionStringFromStorage) {\n return null;\n }\n\n const sessionObj = JSON.parse(sessionStringFromStorage) as Session;\n\n logInfoNextTick('[Replay] Loading existing session', traceInternals);\n\n return makeSession(sessionObj);\n } catch {\n return null;\n }\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport { getClient } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport { EventBufferSizeExceededError } from '../eventBuffer/error';\nimport type { AddEventResult, RecordingEvent, ReplayContainer, ReplayFrameEvent, ReplayPluginOptions } from '../types';\nimport { logInfo } from './log';\nimport { timestampToMs } from './timestamp';\n\nfunction isCustomEvent(event: RecordingEvent): event is ReplayFrameEvent {\n return event.type === EventType.Custom;\n}\n\n/**\n * Add an event to the event buffer.\n * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.\n * Instead this returns `true` if we tried to add the event, else false.\n * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean {\n if (!shouldAddEvent(replay, event)) {\n return false;\n }\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n _addEvent(replay, event, isCheckout);\n\n return true;\n}\n\n/**\n * Add an event to the event buffer.\n * Resolves to `null` if no event was added, else to `void`.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport function addEvent(\n replay: ReplayContainer,\n event: RecordingEvent,\n isCheckout?: boolean,\n): Promise {\n if (!shouldAddEvent(replay, event)) {\n return Promise.resolve(null);\n }\n\n return _addEvent(replay, event, isCheckout);\n}\n\nasync function _addEvent(\n replay: ReplayContainer,\n event: RecordingEvent,\n isCheckout?: boolean,\n): Promise {\n if (!replay.eventBuffer) {\n return null;\n }\n\n try {\n if (isCheckout && replay.recordingMode === 'buffer') {\n replay.eventBuffer.clear();\n }\n\n if (isCheckout) {\n replay.eventBuffer.hasCheckout = true;\n }\n\n const replayOptions = replay.getOptions();\n\n const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent);\n\n if (!eventAfterPossibleCallback) {\n return;\n }\n\n return await replay.eventBuffer.addEvent(eventAfterPossibleCallback);\n } catch (error) {\n const reason = error && error instanceof EventBufferSizeExceededError ? 'addEventSizeExceeded' : 'addEvent';\n\n DEBUG_BUILD && logger.error(error);\n await replay.stop({ reason });\n\n const client = getClient();\n\n if (client) {\n client.recordDroppedEvent('internal_sdk_error', 'replay');\n }\n }\n}\n\n/** Exported only for tests. */\nexport function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean {\n if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) {\n return false;\n }\n\n const timestampInMs = timestampToMs(event.timestamp);\n\n // Throw out events that happen more than 5 minutes ago. This can happen if\n // page has been left open and idle for a long period of time and user\n // comes back to trigger a new session. The performance entries rely on\n // `performance.timeOrigin`, which is when the page first opened.\n if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) {\n return false;\n }\n\n // Throw out events that are +60min from the initial timestamp\n if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) {\n logInfo(\n `[Replay] Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`,\n replay.getOptions()._experiments.traceInternals,\n );\n return false;\n }\n\n return true;\n}\n\nfunction maybeApplyCallback(\n event: RecordingEvent,\n callback: ReplayPluginOptions['beforeAddRecordingEvent'],\n): RecordingEvent | null | undefined {\n try {\n if (typeof callback === 'function' && isCustomEvent(event)) {\n return callback(event);\n }\n } catch (error) {\n DEBUG_BUILD &&\n logger.error('[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...', error);\n return null;\n }\n\n return event;\n}\n","import type { ErrorEvent, Event, FeedbackEvent, ReplayEvent, TransactionEvent } from '@sentry/types';\n\n/** If the event is an error event */\nexport function isErrorEvent(event: Event): event is ErrorEvent {\n return !event.type;\n}\n\n/** If the event is a transaction event */\nexport function isTransactionEvent(event: Event): event is TransactionEvent {\n return event.type === 'transaction';\n}\n\n/** If the event is an replay event */\nexport function isReplayEvent(event: Event): event is ReplayEvent {\n return event.type === 'replay_event';\n}\n\n/** If the event is a feedback event */\nexport function isFeedbackEvent(event: Event): event is FeedbackEvent {\n return event.type === 'feedback';\n}\n","import { getClient } from '@sentry/core';\nimport type { ErrorEvent, Event, TransactionEvent, Transport, TransportMakeRequestResponse } from '@sentry/types';\n\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isTransactionEvent } from '../util/eventUtils';\n\ntype AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nexport function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback {\n // Custom transports may still be returning `Promise`, which means we cannot expect the status code to be available there\n // TODO (v8): remove this check as it will no longer be necessary\n const enforceStatusCode = isBaseTransportSend();\n\n return (event: Event, sendResponse: TransportMakeRequestResponse | void) => {\n if (!replay.isEnabled() || (!isErrorEvent(event) && !isTransactionEvent(event))) {\n return;\n }\n\n const statusCode = sendResponse && sendResponse.statusCode;\n\n // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n // If we do use the base transport, we skip if we encountered an non-OK status code\n if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n return;\n }\n\n if (isTransactionEvent(event)) {\n handleTransactionEvent(replay, event);\n return;\n }\n\n handleErrorEvent(replay, event);\n };\n}\n\nfunction handleTransactionEvent(replay: ReplayContainer, event: TransactionEvent): void {\n const replayContext = replay.getContext();\n\n // Collect traceIds in _context regardless of `recordingMode`\n // In error mode, _context gets cleared on every checkout\n // We limit to max. 100 transactions linked\n if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) {\n replayContext.traceIds.add(event.contexts.trace.trace_id as string);\n }\n}\n\nfunction handleErrorEvent(replay: ReplayContainer, event: ErrorEvent): void {\n const replayContext = replay.getContext();\n\n // Add error to list of errorIds of replay. This is ok to do even if not\n // sampled because context will get reset at next checkout.\n // XXX: There is also a race condition where it's possible to capture an\n // error to Sentry before Replay SDK has loaded, but response returns after\n // it was loaded, and this gets called.\n // We limit to max. 100 errors linked\n if (event.event_id && replayContext.errorIds.size < 100) {\n replayContext.errorIds.add(event.event_id);\n }\n\n // If error event is tagged with replay id it means it was sampled (when in buffer mode)\n // Need to be very careful that this does not cause an infinite loop\n if (replay.recordingMode !== 'buffer' || !event.tags || !event.tags.replayId) {\n return;\n }\n\n const { beforeErrorSampling } = replay.getOptions();\n if (typeof beforeErrorSampling === 'function' && !beforeErrorSampling(event)) {\n return;\n }\n\n setTimeout(() => {\n // Capture current event buffer as new replay\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.sendBufferedReplayOrFlush();\n });\n}\n\nfunction isBaseTransportSend(): boolean {\n const client = getClient();\n if (!client) {\n return false;\n }\n\n const transport = client.getTransport();\n if (!transport) {\n return false;\n }\n\n return (\n (transport.send as Transport['send'] & { __sentry__baseTransport__?: true }).__sentry__baseTransport__ || false\n );\n}\n","import type { ErrorEvent, Event } from '@sentry/types';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { isErrorEvent } from '../util/eventUtils';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\ntype BeforeSendEventCallback = (event: Event) => void;\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nexport function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventCallback {\n return (event: Event) => {\n if (!replay.isEnabled() || !isErrorEvent(event)) {\n return;\n }\n\n handleHydrationError(replay, event);\n };\n}\n\nfunction handleHydrationError(replay: ReplayContainer, event: ErrorEvent): void {\n const exceptionValue = event.exception && event.exception.values && event.exception.values[0].value;\n if (typeof exceptionValue !== 'string') {\n return;\n }\n\n if (\n // Only matches errors in production builds of react-dom\n // Example https://reactjs.org/docs/error-decoder.html?invariant=423\n exceptionValue.match(/reactjs\\.org\\/docs\\/error-decoder\\.html\\?invariant=(418|419|422|423|425)/) ||\n // Development builds of react-dom\n // Error 1: Hydration failed because the initial UI does not match what was rendered on the server.\n // Error 2: Text content does not match server-rendered HTML. Warning: Text content did not match.\n exceptionValue.match(/(does not match server-rendered HTML|Hydration failed because)/i)\n ) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.hydrate-error',\n });\n addBreadcrumbEvent(replay, breadcrumb);\n }\n}\n","import type { Event, EventHint } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isFeedbackEvent, isReplayEvent, isTransactionEvent } from '../util/eventUtils';\nimport { isRrwebError } from '../util/isRrwebError';\nimport { handleAfterSendEvent } from './handleAfterSendEvent';\nimport { addFeedbackBreadcrumb } from './util/addFeedbackBreadcrumb';\nimport { shouldSampleForBufferEvent } from './util/shouldSampleForBufferEvent';\n\n/**\n * Returns a listener to be added to `addEventProcessor(listener)`.\n */\nexport function handleGlobalEventListener(\n replay: ReplayContainer,\n includeAfterSendEventHandling = false,\n): (event: Event, hint: EventHint) => Event | null {\n const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n\n return Object.assign(\n (event: Event, hint: EventHint) => {\n // Do nothing if replay has been disabled\n if (!replay.isEnabled()) {\n return event;\n }\n\n if (isReplayEvent(event)) {\n // Replays have separate set of breadcrumbs, do not include breadcrumbs\n // from core SDK\n delete event.breadcrumbs;\n return event;\n }\n\n // We only want to handle errors, transactions, and feedbacks, nothing else\n if (!isErrorEvent(event) && !isTransactionEvent(event) && !isFeedbackEvent(event)) {\n return event;\n }\n\n // Ensure we do not add replay_id if the session is expired\n const isSessionActive = replay.checkAndHandleExpiredSession();\n if (!isSessionActive) {\n return event;\n }\n\n if (isFeedbackEvent(event)) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.flush();\n event.contexts.feedback.replay_id = replay.getSessionId();\n // Add a replay breadcrumb for this piece of feedback\n addFeedbackBreadcrumb(replay, event);\n return event;\n }\n\n // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n DEBUG_BUILD && logger.log('[Replay] Ignoring error from rrweb internals', event);\n return null;\n }\n\n // When in buffer mode, we decide to sample here.\n // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled\n // And convert the buffer session to a full session\n const isErrorEventSampled = shouldSampleForBufferEvent(replay, event);\n\n // Tag errors if it has been sampled in buffer mode, or if it is session mode\n // Only tag transactions if in session mode\n const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session';\n\n if (shouldTagReplayId) {\n event.tags = { ...event.tags, replayId: replay.getSessionId() };\n }\n\n // In cases where a custom client is used that does not support the new hooks (yet),\n // we manually call this hook method here\n if (afterSendHandler) {\n // Pretend the error had a 200 response so we always capture it\n afterSendHandler(event, { statusCode: 200 });\n }\n\n return event;\n },\n { id: 'Replay' },\n );\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport type { FeedbackEvent } from '@sentry/types';\n\nimport type { ReplayBreadcrumbFrameEvent, ReplayContainer } from '../../types';\n\n/**\n * Add a feedback breadcrumb event to replay.\n */\nexport function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEvent): void {\n replay.triggerUserActivity();\n replay.addUpdate(() => {\n if (!event.timestamp) {\n // Ignore events that don't have timestamps (this shouldn't happen, more of a typing issue)\n // Return true here so that we don't flush\n return true;\n }\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.throttledAddEvent({\n type: EventType.Custom,\n timestamp: event.timestamp * 1000,\n data: {\n tag: 'breadcrumb',\n payload: {\n timestamp: event.timestamp,\n type: 'default',\n category: 'sentry.feedback',\n data: {\n feedbackId: event.event_id,\n },\n },\n },\n } as ReplayBreadcrumbFrameEvent);\n\n return false;\n });\n}\n","import type { Event, EventHint } from '@sentry/types';\n\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\nexport function isRrwebError(event: Event, hint: EventHint): boolean {\n if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n return false;\n }\n\n // @ts-expect-error this may be set by rrweb when it finds errors\n if (hint.originalException && hint.originalException.__rrweb__) {\n return true;\n }\n\n return false;\n}\n","import type { Event } from '@sentry/types';\n\nimport { UNABLE_TO_SEND_REPLAY } from '../../constants';\nimport type { ReplayContainer } from '../../types';\nimport { isSampled } from '../../util/isSampled';\n\n/**\n * Determine if event should be sampled (only applies in buffer mode).\n * When an event is captured by `hanldleGlobalEvent`, when in buffer mode\n * we determine if we want to sample the error or not.\n */\nexport function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean {\n if (replay.recordingMode !== 'buffer') {\n return false;\n }\n\n // ignore this error because otherwise we could loop indefinitely with\n // trying to capture replay and failing\n if (event.message === UNABLE_TO_SEND_REPLAY) {\n return false;\n }\n\n // Require the event to be an error event & to have an exception\n if (!event.exception || event.type) {\n return false;\n }\n\n return isSampled(replay.getOptions().errorSampleRate);\n}\n","import { EventType } from '@sentry-internal/rrweb';\n\nimport type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\n\n/**\n * Create a \"span\" for each performance entry.\n */\nexport function createPerformanceSpans(\n replay: ReplayContainer,\n entries: ReplayPerformanceEntry[],\n): Promise[] {\n return entries.map(({ type, start, end, name, data }) => {\n const response = replay.throttledAddEvent({\n type: EventType.Custom,\n timestamp: start,\n data: {\n tag: 'performanceSpan',\n payload: {\n op: type,\n description: name,\n startTimestamp: start,\n endTimestamp: end,\n data,\n },\n },\n });\n\n // If response is a string, it means its either THROTTLED or SKIPPED\n return typeof response === 'string' ? Promise.resolve(null) : response;\n });\n}\n","import type { HandlerDataHistory } from '@sentry/types';\n\nimport type { HistoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from '../util/createPerformanceSpans';\n\nfunction handleHistory(handlerData: HandlerDataHistory): ReplayPerformanceEntry {\n const { from, to } = handlerData;\n\n const now = Date.now() / 1000;\n\n return {\n type: 'navigation.push',\n start: now,\n end: now,\n name: to,\n data: {\n previous: from,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.\n */\nexport function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HandlerDataHistory) => void {\n return (handlerData: HandlerDataHistory) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleHistory(handlerData);\n\n if (result === null) {\n return;\n }\n\n // Need to collect visited URLs\n replay.getContext().urls.push(result.name);\n replay.triggerUserActivity();\n\n replay.addUpdate(() => {\n createPerformanceSpans(replay, [result]);\n // Returning false to flush\n return false;\n });\n };\n}\n","import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';\nimport { createPerformanceSpans } from '../../util/createPerformanceSpans';\nimport { shouldFilterRequest } from '../../util/shouldFilterRequest';\n\n/** Add a performance entry breadcrumb */\nexport function addNetworkBreadcrumb(\n replay: ReplayContainer,\n result: ReplayPerformanceEntry | null,\n): void {\n if (!replay.isEnabled()) {\n return;\n }\n\n if (result === null) {\n return;\n }\n\n if (shouldFilterRequest(replay, result.name)) {\n return;\n }\n\n replay.addUpdate(() => {\n createPerformanceSpans(replay, [result]);\n // Returning true will cause `addUpdate` to not flush\n // We do not want network requests to cause a flush. This will prevent\n // recurring/polling requests from keeping the replay session alive.\n return true;\n });\n}\n","import { getClient, isSentryRequestUrl } from '@sentry/core';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { ReplayContainer } from '../types';\n\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\nexport function shouldFilterRequest(replay: ReplayContainer, url: string): boolean {\n // If we enabled the `traceInternals` experiment, we want to trace everything\n if (DEBUG_BUILD && replay.getOptions()._experiments.traceInternals) {\n return false;\n }\n\n return isSentryRequestUrl(url, getClient());\n}\n","import type { HandlerDataXhr } from '@sentry/types';\nimport { SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry | null {\n const { startTimestamp, endTimestamp, xhr } = handlerData;\n\n const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return null;\n }\n\n // This is only used as a fallback, so we know the body sizes are never set here\n const { method, url, status_code: statusCode } = sentryXhrData;\n\n if (url === undefined) {\n return null;\n }\n\n return {\n type: 'resource.xhr',\n name: url,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n data: {\n method,\n statusCode,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addXhrInstrumentationHandler(listener)`.\n */\nexport function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void {\n return (handlerData: HandlerDataXhr) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleXhr(handlerData);\n\n addNetworkBreadcrumb(replay, result);\n };\n}\n","import type { TextEncoderInternal } from '@sentry/types';\nimport { dropUndefinedKeys, logger, stringMatchesSomePattern } from '@sentry/utils';\n\nimport { NETWORK_BODY_MAX_SIZE, WINDOW } from '../../constants';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type {\n NetworkBody,\n NetworkMetaWarning,\n NetworkRequestData,\n ReplayNetworkRequestData,\n ReplayNetworkRequestOrResponse,\n ReplayPerformanceEntry,\n} from '../../types';\n\n/** Get the size of a body. */\nexport function getBodySize(\n body: RequestInit['body'],\n textEncoder: TextEncoder | TextEncoderInternal,\n): number | undefined {\n if (!body) {\n return undefined;\n }\n\n try {\n if (typeof body === 'string') {\n return textEncoder.encode(body).length;\n }\n\n if (body instanceof URLSearchParams) {\n return textEncoder.encode(body.toString()).length;\n }\n\n if (body instanceof FormData) {\n const formDataStr = _serializeFormData(body);\n return textEncoder.encode(formDataStr).length;\n }\n\n if (body instanceof Blob) {\n return body.size;\n }\n\n if (body instanceof ArrayBuffer) {\n return body.byteLength;\n }\n\n // Currently unhandled types: ArrayBufferView, ReadableStream\n } catch {\n // just return undefined\n }\n\n return undefined;\n}\n\n/** Convert a Content-Length header to number/undefined. */\nexport function parseContentLengthHeader(header: string | null | undefined): number | undefined {\n if (!header) {\n return undefined;\n }\n\n const size = parseInt(header, 10);\n return isNaN(size) ? undefined : size;\n}\n\n/** Get the string representation of a body. */\nexport function getBodyString(body: unknown): [string | undefined, NetworkMetaWarning?] {\n try {\n if (typeof body === 'string') {\n return [body];\n }\n\n if (body instanceof URLSearchParams) {\n return [body.toString()];\n }\n\n if (body instanceof FormData) {\n return [_serializeFormData(body)];\n }\n\n if (!body) {\n return [undefined];\n }\n } catch {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize body', body);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n DEBUG_BUILD && logger.info('[Replay] Skipping network body because of body type', body);\n\n return [undefined, 'UNPARSEABLE_BODY_TYPE'];\n}\n\n/** Merge a warning into an existing network request/response. */\nexport function mergeWarning(\n info: ReplayNetworkRequestOrResponse | undefined,\n warning: NetworkMetaWarning,\n): ReplayNetworkRequestOrResponse {\n if (!info) {\n return {\n headers: {},\n size: undefined,\n _meta: {\n warnings: [warning],\n },\n };\n }\n\n const newMeta = { ...info._meta };\n const existingWarnings = newMeta.warnings || [];\n newMeta.warnings = [...existingWarnings, warning];\n\n info._meta = newMeta;\n return info;\n}\n\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\nexport function makeNetworkReplayBreadcrumb(\n type: string,\n data: ReplayNetworkRequestData | null,\n): ReplayPerformanceEntry | null {\n if (!data) {\n return null;\n }\n\n const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;\n\n const result: ReplayPerformanceEntry = {\n type,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: dropUndefinedKeys({\n method,\n statusCode,\n request,\n response,\n }),\n };\n\n return result;\n}\n\n/** Build the request or response part of a replay network breadcrumb that was skipped. */\nexport function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse {\n return {\n headers: {},\n size: bodySize,\n _meta: {\n warnings: ['URL_SKIPPED'],\n },\n };\n}\n\n/** Build the request or response part of a replay network breadcrumb. */\nexport function buildNetworkRequestOrResponse(\n headers: Record,\n bodySize: number | undefined,\n body: string | undefined,\n): ReplayNetworkRequestOrResponse | undefined {\n if (!bodySize && Object.keys(headers).length === 0) {\n return undefined;\n }\n\n if (!bodySize) {\n return {\n headers,\n };\n }\n\n if (!body) {\n return {\n headers,\n size: bodySize,\n };\n }\n\n const info: ReplayNetworkRequestOrResponse = {\n headers,\n size: bodySize,\n };\n\n const { body: normalizedBody, warnings } = normalizeNetworkBody(body);\n info.body = normalizedBody;\n if (warnings && warnings.length > 0) {\n info._meta = {\n warnings,\n };\n }\n\n return info;\n}\n\n/** Filter a set of headers */\nexport function getAllowedHeaders(headers: Record, allowedHeaders: string[]): Record {\n return Object.keys(headers).reduce((filteredHeaders: Record, key: string) => {\n const normalizedKey = key.toLowerCase();\n // Avoid putting empty strings into the headers\n if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n filteredHeaders[normalizedKey] = headers[key];\n }\n return filteredHeaders;\n }, {});\n}\n\nfunction _serializeFormData(formData: FormData): string {\n // This is a bit simplified, but gives us a decent estimate\n // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n // @ts-expect-error passing FormData to URLSearchParams actually works\n return new URLSearchParams(formData).toString();\n}\n\nfunction normalizeNetworkBody(body: string | undefined): {\n body: NetworkBody | undefined;\n warnings?: NetworkMetaWarning[];\n} {\n if (!body || typeof body !== 'string') {\n return {\n body,\n };\n }\n\n const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE;\n const isProbablyJson = _strIsProbablyJson(body);\n\n if (exceedsSizeLimit) {\n const truncatedBody = body.slice(0, NETWORK_BODY_MAX_SIZE);\n\n if (isProbablyJson) {\n return {\n body: truncatedBody,\n warnings: ['MAYBE_JSON_TRUNCATED'],\n };\n }\n\n return {\n body: `${truncatedBody}…`,\n warnings: ['TEXT_TRUNCATED'],\n };\n }\n\n if (isProbablyJson) {\n try {\n const jsonBody = JSON.parse(body);\n return {\n body: jsonBody,\n };\n } catch {\n // fall back to just send the body as string\n }\n }\n\n return {\n body,\n };\n}\n\nfunction _strIsProbablyJson(str: string): boolean {\n const first = str[0];\n const last = str[str.length - 1];\n\n // Simple check: If this does not start & end with {} or [], it's not JSON\n return (first === '[' && last === ']') || (first === '{' && last === '}');\n}\n\n/** Match an URL against a list of strings/Regex. */\nexport function urlMatches(url: string, urls: (string | RegExp)[]): boolean {\n const fullUrl = getFullUrl(url);\n\n return stringMatchesSomePattern(fullUrl, urls);\n}\n\n/** exported for tests */\nexport function getFullUrl(url: string, baseURI = WINDOW.document.baseURI): string {\n // Short circuit for common cases:\n if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) {\n return url;\n }\n const fixedUrl = new URL(url, baseURI);\n\n // If these do not match, we are not dealing with a relative URL, so just return it\n if (fixedUrl.origin !== new URL(baseURI).origin) {\n return url;\n }\n\n const fullUrl = fixedUrl.href;\n\n // Remove trailing slashes, if they don't match the original URL\n if (!url.endsWith('/') && fullUrl.endsWith('/')) {\n return fullUrl.slice(0, -1);\n }\n\n return fullUrl;\n}\n","import type { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type {\n FetchHint,\n NetworkMetaWarning,\n ReplayContainer,\n ReplayNetworkOptions,\n ReplayNetworkRequestData,\n ReplayNetworkRequestOrResponse,\n} from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n buildNetworkRequestOrResponse,\n buildSkippedNetworkRequestOrResponse,\n getAllowedHeaders,\n getBodySize,\n getBodyString,\n makeNetworkReplayBreadcrumb,\n mergeWarning,\n parseContentLengthHeader,\n urlMatches,\n} from './networkUtils';\n\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureFetchBreadcrumbToReplay(\n breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n hint: Partial,\n options: ReplayNetworkOptions & {\n textEncoder: TextEncoderInternal;\n replay: ReplayContainer;\n },\n): Promise {\n try {\n const data = await _prepareFetchData(breadcrumb, hint, options);\n\n // Create a replay performance entry from this breadcrumb\n const result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n addNetworkBreadcrumb(options.replay, result);\n } catch (error) {\n DEBUG_BUILD && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichFetchBreadcrumb(\n breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n hint: Partial,\n options: { textEncoder: TextEncoderInternal },\n): void {\n const { input, response } = hint;\n\n const body = input ? _getFetchRequestArgBody(input) : undefined;\n const reqSize = getBodySize(body, options.textEncoder);\n\n const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nasync function _prepareFetchData(\n breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n hint: Partial,\n options: ReplayNetworkOptions & {\n textEncoder: TextEncoderInternal;\n },\n): Promise {\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now } = hint;\n\n const {\n url,\n method,\n status_code: statusCode = 0,\n request_body_size: requestBodySize,\n response_body_size: responseBodySize,\n } = breadcrumb.data;\n\n const captureDetails =\n urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls);\n\n const request = captureDetails\n ? _getRequestInfo(options, hint.input, requestBodySize)\n : buildSkippedNetworkRequestOrResponse(requestBodySize);\n const response = await _getResponseInfo(captureDetails, options, hint.response, responseBodySize);\n\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request,\n response,\n };\n}\n\nfunction _getRequestInfo(\n { networkCaptureBodies, networkRequestHeaders }: ReplayNetworkOptions,\n input: FetchHint['input'] | undefined,\n requestBodySize?: number,\n): ReplayNetworkRequestOrResponse | undefined {\n const headers = input ? getRequestHeaders(input, networkRequestHeaders) : {};\n\n if (!networkCaptureBodies) {\n return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n }\n\n // We only want to transmit string or string-like bodies\n const requestBody = _getFetchRequestArgBody(input);\n const [bodyStr, warning] = getBodyString(requestBody);\n const data = buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr);\n\n if (warning) {\n return mergeWarning(data, warning);\n }\n\n return data;\n}\n\n/** Exported only for tests. */\nexport async function _getResponseInfo(\n captureDetails: boolean,\n {\n networkCaptureBodies,\n textEncoder,\n networkResponseHeaders,\n }: Pick & {\n textEncoder: TextEncoderInternal;\n },\n response: Response | undefined,\n responseBodySize?: number,\n): Promise {\n if (!captureDetails && responseBodySize !== undefined) {\n return buildSkippedNetworkRequestOrResponse(responseBodySize);\n }\n\n const headers = response ? getAllHeaders(response.headers, networkResponseHeaders) : {};\n\n if (!response || (!networkCaptureBodies && responseBodySize !== undefined)) {\n return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n }\n\n const [bodyText, warning] = await _parseFetchResponseBody(response);\n const result = getResponseData(bodyText, {\n networkCaptureBodies,\n textEncoder,\n responseBodySize,\n captureDetails,\n headers,\n });\n\n if (warning) {\n return mergeWarning(result, warning);\n }\n\n return result;\n}\n\nfunction getResponseData(\n bodyText: string | undefined,\n {\n networkCaptureBodies,\n textEncoder,\n responseBodySize,\n captureDetails,\n headers,\n }: {\n captureDetails: boolean;\n networkCaptureBodies: boolean;\n responseBodySize: number | undefined;\n headers: Record;\n textEncoder: TextEncoderInternal;\n },\n): ReplayNetworkRequestOrResponse | undefined {\n try {\n const size =\n bodyText && bodyText.length && responseBodySize === undefined\n ? getBodySize(bodyText, textEncoder)\n : responseBodySize;\n\n if (!captureDetails) {\n return buildSkippedNetworkRequestOrResponse(size);\n }\n\n if (networkCaptureBodies) {\n return buildNetworkRequestOrResponse(headers, size, bodyText);\n }\n\n return buildNetworkRequestOrResponse(headers, size, undefined);\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize response body', error);\n // fallback\n return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n }\n}\n\nasync function _parseFetchResponseBody(response: Response): Promise<[string | undefined, NetworkMetaWarning?]> {\n const res = _tryCloneResponse(response);\n\n if (!res) {\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n try {\n const text = await _tryGetResponseText(res);\n return [text];\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to get text body from response', error);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n}\n\nfunction _getFetchRequestArgBody(fetchArgs: unknown[] = []): RequestInit['body'] | undefined {\n // We only support getting the body from the fetch options\n if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n return undefined;\n }\n\n return (fetchArgs[1] as RequestInit).body;\n}\n\nfunction getAllHeaders(headers: Headers, allowedHeaders: string[]): Record {\n const allHeaders: Record = {};\n\n allowedHeaders.forEach(header => {\n if (headers.get(header)) {\n allHeaders[header] = headers.get(header) as string;\n }\n });\n\n return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs: unknown[], allowedHeaders: string[]): Record {\n if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n return getHeadersFromOptions(fetchArgs[0] as Request | RequestInit, allowedHeaders);\n }\n\n if (fetchArgs.length === 2) {\n return getHeadersFromOptions(fetchArgs[1] as Request | RequestInit, allowedHeaders);\n }\n\n return {};\n}\n\nfunction getHeadersFromOptions(\n input: Request | RequestInit | undefined,\n allowedHeaders: string[],\n): Record {\n if (!input) {\n return {};\n }\n\n const headers = input.headers;\n\n if (!headers) {\n return {};\n }\n\n if (headers instanceof Headers) {\n return getAllHeaders(headers, allowedHeaders);\n }\n\n // We do not support this, as it is not really documented (anymore?)\n if (Array.isArray(headers)) {\n return {};\n }\n\n return getAllowedHeaders(headers, allowedHeaders);\n}\n\nfunction _tryCloneResponse(response: Response): Response | void {\n try {\n // We have to clone this, as the body can only be read once\n return response.clone();\n } catch (error) {\n // this can throw if the response was already consumed before\n DEBUG_BUILD && logger.warn('[Replay] Failed to clone response body', error);\n }\n}\n\n/**\n * Get the response body of a fetch request, or timeout after 500ms.\n * Fetch can return a streaming body, that may not resolve (or not for a long time).\n * If that happens, we rather abort after a short time than keep waiting for this.\n */\nfunction _tryGetResponseText(response: Response): Promise {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error('Timeout while trying to read response body')), 500);\n\n _getResponseText(response)\n .then(\n txt => resolve(txt),\n reason => reject(reason),\n )\n .finally(() => clearTimeout(timeout));\n });\n\n return _getResponseText(response);\n}\n\nasync function _getResponseText(response: Response): Promise {\n // Force this to be a promise, just to be safe\n // eslint-disable-next-line no-return-await\n return await response.text();\n}\n","import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';\nimport { SENTRY_XHR_DATA_KEY, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type {\n NetworkMetaWarning,\n ReplayContainer,\n ReplayNetworkOptions,\n ReplayNetworkRequestData,\n XhrHint,\n} from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n buildNetworkRequestOrResponse,\n buildSkippedNetworkRequestOrResponse,\n getAllowedHeaders,\n getBodySize,\n getBodyString,\n makeNetworkReplayBreadcrumb,\n mergeWarning,\n parseContentLengthHeader,\n urlMatches,\n} from './networkUtils';\n\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureXhrBreadcrumbToReplay(\n breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n hint: Partial,\n options: ReplayNetworkOptions & { replay: ReplayContainer },\n): Promise {\n try {\n const data = _prepareXhrData(breadcrumb, hint, options);\n\n // Create a replay performance entry from this breadcrumb\n const result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n addNetworkBreadcrumb(options.replay, result);\n } catch (error) {\n DEBUG_BUILD && logger.error('[Replay] Failed to capture xhr breadcrumb', error);\n }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichXhrBreadcrumb(\n breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n hint: Partial,\n options: { textEncoder: TextEncoderInternal },\n): void {\n const { xhr, input } = hint;\n\n if (!xhr) {\n return;\n }\n\n const reqSize = getBodySize(input, options.textEncoder);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType, options.textEncoder);\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nfunction _prepareXhrData(\n breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n hint: Partial,\n options: ReplayNetworkOptions,\n): ReplayNetworkRequestData | null {\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = hint;\n\n const {\n url,\n method,\n status_code: statusCode = 0,\n request_body_size: requestBodySize,\n response_body_size: responseBodySize,\n } = breadcrumb.data;\n\n if (!url) {\n return null;\n }\n\n if (!xhr || !urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) {\n const request = buildSkippedNetworkRequestOrResponse(requestBodySize);\n const response = buildSkippedNetworkRequestOrResponse(responseBodySize);\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request,\n response,\n };\n }\n\n const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n const networkRequestHeaders = xhrInfo\n ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders)\n : {};\n const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders);\n\n const [requestBody, requestWarning] = options.networkCaptureBodies ? getBodyString(input) : [undefined];\n const [responseBody, responseWarning] = options.networkCaptureBodies ? _getXhrResponseBody(xhr) : [undefined];\n\n const request = buildNetworkRequestOrResponse(networkRequestHeaders, requestBodySize, requestBody);\n const response = buildNetworkRequestOrResponse(networkResponseHeaders, responseBodySize, responseBody);\n\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request: requestWarning ? mergeWarning(request, requestWarning) : request,\n response: responseWarning ? mergeWarning(response, responseWarning) : response,\n };\n}\n\nfunction getResponseHeaders(xhr: XMLHttpRequest): Record {\n const headers = xhr.getAllResponseHeaders();\n\n if (!headers) {\n return {};\n }\n\n return headers.split('\\r\\n').reduce((acc: Record, line: string) => {\n const [key, value] = line.split(': ');\n acc[key.toLowerCase()] = value;\n return acc;\n }, {});\n}\n\nfunction _getXhrResponseBody(xhr: XMLHttpRequest): [string | undefined, NetworkMetaWarning?] {\n // We collect errors that happen, but only log them if we can't get any response body\n const errors: unknown[] = [];\n\n try {\n return [xhr.responseText];\n } catch (e) {\n errors.push(e);\n }\n\n // Try to manually parse the response body, if responseText fails\n try {\n return _parseXhrResponse(xhr.response, xhr.responseType);\n } catch (e) {\n errors.push(e);\n }\n\n DEBUG_BUILD && logger.warn('[Replay] Failed to get xhr response body', ...errors);\n\n return [undefined];\n}\n\n/**\n * Get the string representation of the XHR response.\n * Based on MDN, these are the possible types of the response:\n * string\n * ArrayBuffer\n * Blob\n * Document\n * POJO\n *\n * Exported only for tests.\n */\nexport function _parseXhrResponse(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): [string | undefined, NetworkMetaWarning?] {\n try {\n if (typeof body === 'string') {\n return [body];\n }\n\n if (body instanceof Document) {\n return [body.body.outerHTML];\n }\n\n if (responseType === 'json' && body && typeof body === 'object') {\n return [JSON.stringify(body)];\n }\n\n if (!body) {\n return [undefined];\n }\n } catch {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize body', body);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n DEBUG_BUILD && logger.info('[Replay] Skipping network body because of body type', body);\n\n return [undefined, 'UNPARSEABLE_BODY_TYPE'];\n}\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n textEncoder: TextEncoder | TextEncoderInternal,\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr, textEncoder);\n } catch {\n return undefined;\n }\n}\n","import { getClient } from '@sentry/core';\nimport type {\n Breadcrumb,\n BreadcrumbHint,\n FetchBreadcrumbData,\n TextEncoderInternal,\n XhrBreadcrumbData,\n} from '@sentry/types';\nimport { addFetchInstrumentationHandler, addXhrInstrumentationHandler, logger } from '@sentry/utils';\n\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { FetchHint, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../types';\nimport { handleFetchSpanListener } from './handleFetch';\nimport { handleXhrSpanListener } from './handleXhr';\nimport { captureFetchBreadcrumbToReplay, enrichFetchBreadcrumb } from './util/fetchUtils';\nimport { captureXhrBreadcrumbToReplay, enrichXhrBreadcrumb } from './util/xhrUtils';\n\ninterface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {\n replay: ReplayContainer;\n textEncoder: TextEncoderInternal;\n}\n\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n * (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\nexport function handleNetworkBreadcrumbs(replay: ReplayContainer): void {\n const client = getClient();\n\n try {\n const textEncoder = new TextEncoder();\n\n const {\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders,\n networkResponseHeaders,\n } = replay.getOptions();\n\n const options: ExtendedNetworkBreadcrumbsOptions = {\n replay,\n textEncoder,\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders,\n networkResponseHeaders,\n };\n\n if (client && client.on) {\n client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));\n } else {\n // Fallback behavior\n addFetchInstrumentationHandler(handleFetchSpanListener(replay));\n addXhrInstrumentationHandler(handleXhrSpanListener(replay));\n }\n } catch {\n // Do nothing\n }\n}\n\n/** just exported for tests */\nexport function beforeAddNetworkBreadcrumb(\n options: ExtendedNetworkBreadcrumbsOptions,\n breadcrumb: Breadcrumb,\n hint?: BreadcrumbHint,\n): void {\n if (!breadcrumb.data) {\n return;\n }\n\n try {\n if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichXhrBreadcrumb(breadcrumb, hint, options);\n\n // This call should not reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n }\n\n if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichFetchBreadcrumb(breadcrumb, hint, options);\n\n // This call should not reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n }\n } catch (e) {\n DEBUG_BUILD && logger.warn('Error when enriching network breadcrumb');\n }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: XhrBreadcrumbData } {\n return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: FetchBreadcrumbData } {\n return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint?: BreadcrumbHint): hint is XhrHint {\n return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint?: BreadcrumbHint): hint is FetchHint {\n return hint && hint.response;\n}\n","import type { HandlerDataFetch } from '@sentry/types';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry {\n const { startTimestamp, endTimestamp, fetchData, response } = handlerData;\n\n if (!endTimestamp) {\n return null;\n }\n\n // This is only used as a fallback, so we know the body sizes are never set here\n const { method, url } = fetchData;\n\n return {\n type: 'resource.fetch',\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: {\n method,\n statusCode: response ? (response as Response).status : undefined,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addFetchInstrumentationHandler(listener)`.\n */\nexport function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void {\n return (handlerData: HandlerDataFetch) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleFetch(handlerData);\n\n addNetworkBreadcrumb(replay, result);\n };\n}\n","import type { Breadcrumb, Scope } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { CONSOLE_ARG_MAX_SIZE } from '../constants';\nimport type { ReplayContainer } from '../types';\nimport type { ReplayFrame } from '../types/replayFrame';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\nlet _LAST_BREADCRUMB: null | Breadcrumb = null;\n\ntype BreadcrumbWithCategory = Required>;\n\nfunction isBreadcrumbWithCategory(breadcrumb: Breadcrumb): breadcrumb is BreadcrumbWithCategory {\n return !!breadcrumb.category;\n}\n\nexport const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void =\n (replay: ReplayContainer) =>\n (scope: Scope): void => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleScope(scope);\n\n if (!result) {\n return;\n }\n\n addBreadcrumbEvent(replay, result);\n };\n\n/**\n * An event handler to handle scope changes.\n */\nexport function handleScope(scope: Scope): Breadcrumb | null {\n // TODO (v8): Remove this guard. This was put in place because we introduced\n // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n // For now, we'll just return null if the method doesn't exist but we should eventually\n // get rid of this guard.\n const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();\n\n // Listener can be called when breadcrumbs have not changed, so we store the\n // reference to the last crumb and only return a crumb if it has changed\n if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n return null;\n }\n\n _LAST_BREADCRUMB = newBreadcrumb;\n\n if (\n !isBreadcrumbWithCategory(newBreadcrumb) ||\n ['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||\n newBreadcrumb.category.startsWith('ui.')\n ) {\n return null;\n }\n\n if (newBreadcrumb.category === 'console') {\n return normalizeConsoleBreadcrumb(newBreadcrumb);\n }\n\n return createBreadcrumb(newBreadcrumb);\n}\n\n/** exported for tests only */\nexport function normalizeConsoleBreadcrumb(\n breadcrumb: Omit & BreadcrumbWithCategory,\n): ReplayFrame {\n const args = breadcrumb.data && breadcrumb.data.arguments;\n\n if (!Array.isArray(args) || args.length === 0) {\n return createBreadcrumb(breadcrumb);\n }\n\n let isTruncated = false;\n\n // Avoid giant args captures\n const normalizedArgs = args.map(arg => {\n if (!arg) {\n return arg;\n }\n if (typeof arg === 'string') {\n if (arg.length > CONSOLE_ARG_MAX_SIZE) {\n isTruncated = true;\n return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`;\n }\n\n return arg;\n }\n if (typeof arg === 'object') {\n try {\n const normalizedArg = normalize(arg, 7);\n const stringified = JSON.stringify(normalizedArg);\n if (stringified.length > CONSOLE_ARG_MAX_SIZE) {\n isTruncated = true;\n // We use the pretty printed JSON string here as a base\n return `${JSON.stringify(normalizedArg, null, 2).slice(0, CONSOLE_ARG_MAX_SIZE)}…`;\n }\n return normalizedArg;\n } catch {\n // fall back to default\n }\n }\n\n return arg;\n });\n\n return createBreadcrumb({\n ...breadcrumb,\n data: {\n ...breadcrumb.data,\n arguments: normalizedArgs,\n ...(isTruncated ? { _meta: { warnings: ['CONSOLE_ARG_TRUNCATED'] } } : {}),\n },\n });\n}\n","import type { BaseClient } from '@sentry/core';\nimport { getCurrentScope } from '@sentry/core';\nimport { addEventProcessor, getClient } from '@sentry/core';\nimport type { Client, DynamicSamplingContext } from '@sentry/types';\nimport { addClickKeypressInstrumentationHandler, addHistoryInstrumentationHandler } from '@sentry/utils';\n\nimport { handleAfterSendEvent } from '../coreHandlers/handleAfterSendEvent';\nimport { handleBeforeSendEvent } from '../coreHandlers/handleBeforeSendEvent';\nimport { handleDomListener } from '../coreHandlers/handleDom';\nimport { handleGlobalEventListener } from '../coreHandlers/handleGlobalEvent';\nimport { handleHistorySpanListener } from '../coreHandlers/handleHistory';\nimport { handleNetworkBreadcrumbs } from '../coreHandlers/handleNetworkBreadcrumbs';\nimport { handleScopeListener } from '../coreHandlers/handleScope';\nimport type { ReplayContainer } from '../types';\n\n/**\n * Add global listeners that cannot be removed.\n */\nexport function addGlobalListeners(replay: ReplayContainer): void {\n // Listeners from core SDK //\n const scope = getCurrentScope();\n const client = getClient();\n\n scope.addScopeListener(handleScopeListener(replay));\n addClickKeypressInstrumentationHandler(handleDomListener(replay));\n addHistoryInstrumentationHandler(handleHistorySpanListener(replay));\n handleNetworkBreadcrumbs(replay);\n\n // Tag all (non replay) events that get sent to Sentry with the current\n // replay ID so that we can reference them later in the UI\n const eventProcessor = handleGlobalEventListener(replay, !hasHooks(client));\n if (client && client.addEventProcessor) {\n client.addEventProcessor(eventProcessor);\n } else {\n addEventProcessor(eventProcessor);\n }\n\n // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n if (hasHooks(client)) {\n client.on('beforeSendEvent', handleBeforeSendEvent(replay));\n client.on('afterSendEvent', handleAfterSendEvent(replay));\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n const replayId = replay.getSessionId();\n // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet)\n if (replayId && replay.isEnabled() && replay.recordingMode === 'session') {\n // Ensure to check that the session is still active - it could have expired in the meanwhile\n const isSessionActive = replay.checkAndHandleExpiredSession();\n if (isSessionActive) {\n dsc.replay_id = replayId;\n }\n }\n });\n\n client.on('startTransaction', transaction => {\n replay.lastTransaction = transaction;\n });\n\n // We may be missing the initial startTransaction due to timing issues,\n // so we capture it on finish again.\n client.on('finishTransaction', transaction => {\n replay.lastTransaction = transaction;\n });\n\n // We want to flush replay\n client.on('beforeSendFeedback', (feedbackEvent, options) => {\n const replayId = replay.getSessionId();\n if (options && options.includeReplay && replay.isEnabled() && replayId) {\n // This should never reject\n if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) {\n feedbackEvent.contexts.feedback.replay_id = replayId;\n }\n }\n });\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction hasHooks(client: Client | undefined): client is BaseClient {\n return !!(client && client.on);\n}\n","import { WINDOW } from '../constants';\nimport type { AddEventResult, MemoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from './createPerformanceSpans';\n\ntype ReplayMemoryEntry = ReplayPerformanceEntry & { data: { memory: MemoryInfo } };\n\ninterface MemoryInfo {\n jsHeapSizeLimit: number;\n totalJSHeapSize: number;\n usedJSHeapSize: number;\n}\n\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\nexport async function addMemoryEntry(replay: ReplayContainer): Promise> {\n // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this\n try {\n return Promise.all(\n createPerformanceSpans(replay, [\n // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n createMemoryEntry(WINDOW.performance.memory),\n ]),\n );\n } catch (error) {\n // Do nothing\n return [];\n }\n}\n\nfunction createMemoryEntry(memoryEntry: MemoryInfo): ReplayMemoryEntry {\n const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n // we don't want to use `getAbsoluteTime` because it adds the event time to the\n // time origin, so we get the current timestamp instead\n const time = Date.now() / 1000;\n return {\n type: 'memory',\n name: 'memory',\n start: time,\n end: time,\n data: {\n memory: {\n jsHeapSizeLimit,\n totalJSHeapSize,\n usedJSHeapSize,\n },\n },\n };\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport { logger } from '@sentry/utils';\n\nimport { updateClickDetectorForRecordingEvent } from '../coreHandlers/handleClick';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { saveSession } from '../session/saveSession';\nimport type { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';\nimport { addEventSync } from './addEvent';\nimport { logInfo } from './log';\n\ntype RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;\n\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\nexport function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback {\n let hadFirstEvent = false;\n\n return (event: RecordingEvent, _isCheckout?: boolean) => {\n // If this is false, it means session is expired, create and a new session and wait for checkout\n if (!replay.checkAndHandleExpiredSession()) {\n DEBUG_BUILD && logger.warn('[Replay] Received replay event after session expired.');\n\n return;\n }\n\n // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n // We also want to treat the first event as a checkout, so we handle this specifically here\n const isCheckout = _isCheckout || !hadFirstEvent;\n hadFirstEvent = true;\n\n if (replay.clickDetector) {\n updateClickDetectorForRecordingEvent(replay.clickDetector, event);\n }\n\n // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n replay.addUpdate(() => {\n // The session is always started immediately on pageload/init, but for\n // error-only replays, it should reflect the most recent checkout\n // when an error occurs. Clear any state that happens before this current\n // checkout. This needs to happen before `addEvent()` which updates state\n // dependent on this reset.\n if (replay.recordingMode === 'buffer' && isCheckout) {\n replay.setInitialState();\n }\n\n // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration),\n // Skip all further steps\n if (!addEventSync(replay, event, isCheckout)) {\n // Return true to skip scheduling a debounced flush\n return true;\n }\n\n // Different behavior for full snapshots (type=2), ignore other event types\n // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n if (!isCheckout) {\n return false;\n }\n\n // Additionally, create a meta event that will capture certain SDK settings.\n // In order to handle buffer mode, this needs to either be done when we\n // receive checkout events or at flush time.\n //\n // `isCheckout` is always true, but want to be explicit that it should\n // only be added for checkouts\n addSettingsEvent(replay, isCheckout);\n\n // If there is a previousSessionId after a full snapshot occurs, then\n // the replay session was started due to session expiration. The new session\n // is started before triggering a new checkout and contains the id\n // of the previous session. Do not immediately flush in this case\n // to avoid capturing only the checkout and instead the replay will\n // be captured if they perform any follow-up actions.\n if (replay.session && replay.session.previousSessionId) {\n return true;\n }\n\n // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer\n // this should usually be the timestamp of the checkout event, but to be safe...\n if (replay.recordingMode === 'buffer' && replay.session && replay.eventBuffer) {\n const earliestEvent = replay.eventBuffer.getEarliestTimestamp();\n if (earliestEvent) {\n logInfo(\n `[Replay] Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`,\n replay.getOptions()._experiments.traceInternals,\n );\n\n replay.session.started = earliestEvent;\n\n if (replay.getOptions().stickySession) {\n saveSession(replay.session);\n }\n }\n }\n\n if (replay.recordingMode === 'session') {\n // If the full snapshot is due to an initial load, we will not have\n // a previous session ID. In this case, we want to buffer events\n // for a set amount of time before flushing. This can help avoid\n // capturing replays of users that immediately close the window.\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n void replay.flush();\n }\n\n return true;\n });\n };\n}\n\n/**\n * Exported for tests\n */\nexport function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent {\n const options = replay.getOptions();\n return {\n type: EventType.Custom,\n timestamp: Date.now(),\n data: {\n tag: 'options',\n payload: {\n shouldRecordCanvas: replay.isRecordingCanvas(),\n sessionSampleRate: options.sessionSampleRate,\n errorSampleRate: options.errorSampleRate,\n useCompressionOption: options.useCompression,\n blockAllMedia: options.blockAllMedia,\n maskAllText: options.maskAllText,\n maskAllInputs: options.maskAllInputs,\n useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false,\n networkDetailHasUrls: options.networkDetailAllowUrls.length > 0,\n networkCaptureBodies: options.networkCaptureBodies,\n networkRequestHasHeaders: options.networkRequestHeaders.length > 0,\n networkResponseHasHeaders: options.networkResponseHeaders.length > 0,\n },\n },\n };\n}\n\n/**\n * Add a \"meta\" event that contains a simplified view on current configuration\n * options. This should only be included on the first segment of a recording.\n */\nfunction addSettingsEvent(replay: ReplayContainer, isCheckout?: boolean): void {\n // Only need to add this event when sending the first segment\n if (!isCheckout || !replay.session || replay.session.segmentId !== 0) {\n return;\n }\n\n addEventSync(replay, createOptionsEvent(replay), false);\n}\n","import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';\nimport { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';\n\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\nexport function createReplayEnvelope(\n replayEvent: ReplayEvent,\n recordingData: ReplayRecordingData,\n dsn: DsnComponents,\n tunnel?: string,\n): ReplayEnvelope {\n return createEnvelope(\n createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),\n [\n [{ type: 'replay_event' }, replayEvent],\n [\n {\n type: 'replay_recording',\n // If string then we need to encode to UTF8, otherwise will have\n // wrong size. TextEncoder has similar browser support to\n // MutationObserver, although it does not accept IE11.\n length:\n typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,\n },\n recordingData,\n ],\n ],\n );\n}\n","import { getClient, getCurrentScope } from '@sentry/core';\nimport type { ReplayEvent, TransportMakeRequestResponse } from '@sentry/types';\nimport type { RateLimits } from '@sentry/utils';\nimport { isRateLimited, updateRateLimits } from '@sentry/utils';\n\nimport { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { createReplayEnvelope } from './createReplayEnvelope';\nimport { logInfo } from './log';\nimport { prepareRecordingData } from './prepareRecordingData';\nimport { prepareReplayEvent } from './prepareReplayEvent';\n\n/**\n * Send replay attachment using `fetch()`\n */\nexport async function sendReplayRequest({\n recordingData,\n replayId,\n segmentId: segment_id,\n eventContext,\n timestamp,\n session,\n}: SendReplayData): Promise {\n const preparedRecordingData = prepareRecordingData({\n recordingData,\n headers: {\n segment_id,\n },\n });\n\n const { urls, errorIds, traceIds, initialTimestamp } = eventContext;\n\n const client = getClient();\n const scope = getCurrentScope();\n const transport = client && client.getTransport();\n const dsn = client && client.getDsn();\n\n if (!client || !transport || !dsn || !session.sampled) {\n return;\n }\n\n const baseEvent: ReplayEvent = {\n type: REPLAY_EVENT_NAME,\n replay_start_timestamp: initialTimestamp / 1000,\n timestamp: timestamp / 1000,\n error_ids: errorIds,\n trace_ids: traceIds,\n urls,\n replay_id: replayId,\n segment_id,\n replay_type: session.sampled,\n };\n\n const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });\n\n if (!replayEvent) {\n // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n logInfo('An event processor returned `null`, will not send event.');\n return;\n }\n\n /*\n For reference, the fully built event looks something like this:\n {\n \"type\": \"replay_event\",\n \"timestamp\": 1670837008.634,\n \"error_ids\": [\n \"errorId\"\n ],\n \"trace_ids\": [\n \"traceId\"\n ],\n \"urls\": [\n \"https://example.com\"\n ],\n \"replay_id\": \"eventId\",\n \"segment_id\": 3,\n \"replay_type\": \"error\",\n \"platform\": \"javascript\",\n \"event_id\": \"eventId\",\n \"environment\": \"production\",\n \"sdk\": {\n \"integrations\": [\n \"BrowserTracing\",\n \"Replay\"\n ],\n \"name\": \"sentry.javascript.browser\",\n \"version\": \"7.25.0\"\n },\n \"sdkProcessingMetadata\": {},\n \"contexts\": {\n },\n }\n */\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete replayEvent.sdkProcessingMetadata;\n\n const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n\n let response: void | TransportMakeRequestResponse;\n\n try {\n response = await transport.send(envelope);\n } catch (err) {\n const error = new Error(UNABLE_TO_SEND_REPLAY);\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = err;\n } catch {\n // nothing to do\n }\n throw error;\n }\n\n // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore\n if (!response) {\n return response;\n }\n\n // If the status code is invalid, we want to immediately stop & not retry\n if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {\n throw new TransportStatusCodeError(response.statusCode);\n }\n\n const rateLimits = updateRateLimits({}, response);\n if (isRateLimited(rateLimits, 'replay')) {\n throw new RateLimitError(rateLimits);\n }\n\n return response;\n}\n\n/**\n * This error indicates that the transport returned an invalid status code.\n */\nexport class TransportStatusCodeError extends Error {\n public constructor(statusCode: number) {\n super(`Transport returned status code ${statusCode}`);\n }\n}\n\n/**\n * This error indicates that we hit a rate limit API error.\n */\nexport class RateLimitError extends Error {\n public rateLimits: RateLimits;\n\n public constructor(rateLimits: RateLimits) {\n super('Rate limit hit');\n this.rateLimits = rateLimits;\n }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\n/**\n * Prepare the recording data ready to be sent.\n */\nexport function prepareRecordingData({\n recordingData,\n headers,\n}: {\n recordingData: ReplayRecordingData;\n headers: Record;\n}): ReplayRecordingData {\n let payloadWithSequence;\n\n // XXX: newline is needed to separate sequence id from events\n const replayHeaders = `${JSON.stringify(headers)}\n`;\n\n if (typeof recordingData === 'string') {\n payloadWithSequence = `${replayHeaders}${recordingData}`;\n } else {\n const enc = new TextEncoder();\n // XXX: newline is needed to separate sequence id from events\n const sequence = enc.encode(replayHeaders);\n // Merge the two Uint8Arrays\n payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n payloadWithSequence.set(sequence);\n payloadWithSequence.set(recordingData, sequence.length);\n }\n\n return payloadWithSequence;\n}\n","import type { IntegrationIndex, Scope } from '@sentry/core';\nimport { getIsolationScope } from '@sentry/core';\nimport { prepareEvent } from '@sentry/core';\nimport type { Client, EventHint, ReplayEvent } from '@sentry/types';\n\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\nexport async function prepareReplayEvent({\n client,\n scope,\n replayId: event_id,\n event,\n}: {\n client: Client & { _integrations?: IntegrationIndex };\n scope: Scope;\n replayId: string;\n event: ReplayEvent;\n}): Promise {\n const integrations =\n typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)\n ? Object.keys(client._integrations)\n : undefined;\n\n const eventHint: EventHint = { event_id, integrations };\n\n if (client.emit) {\n client.emit('preprocessEvent', event, eventHint);\n }\n\n const preparedEvent = (await prepareEvent(\n client.getOptions(),\n event,\n eventHint,\n scope,\n client,\n getIsolationScope(),\n )) as ReplayEvent | null;\n\n // If e.g. a global event processor returned null\n if (!preparedEvent) {\n return null;\n }\n\n // This normally happens in browser client \"_prepareEvent\"\n // but since we do not use this private method from the client, but rather the plain import\n // we need to do this manually.\n preparedEvent.platform = preparedEvent.platform || 'javascript';\n\n // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n const metadata = client.getSdkMetadata && client.getSdkMetadata();\n const { name, version } = (metadata && metadata.sdk) || {};\n\n preparedEvent.sdk = {\n ...preparedEvent.sdk,\n name: name || 'sentry.javascript.unknown',\n version: version || '0.0.0',\n };\n\n return preparedEvent;\n}\n","import { captureException, setContext } from '@sentry/core';\n\nimport { RETRY_BASE_INTERVAL, RETRY_MAX_COUNT, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { SendReplayData } from '../types';\nimport { RateLimitError, TransportStatusCodeError, sendReplayRequest } from './sendReplayRequest';\n\n/**\n * Finalize and send the current replay event to Sentry\n */\nexport async function sendReplay(\n replayData: SendReplayData,\n retryConfig = {\n count: 0,\n interval: RETRY_BASE_INTERVAL,\n },\n): Promise {\n const { recordingData, options } = replayData;\n\n // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n if (!recordingData.length) {\n return;\n }\n\n try {\n await sendReplayRequest(replayData);\n return true;\n } catch (err) {\n if (err instanceof TransportStatusCodeError || err instanceof RateLimitError) {\n throw err;\n }\n\n // Capture error for every failed replay\n setContext('Replays', {\n _retryCount: retryConfig.count,\n });\n\n if (DEBUG_BUILD && options._experiments && options._experiments.captureExceptions) {\n captureException(err);\n }\n\n // If an error happened here, it's likely that uploading the attachment\n // failed, we'll can retry with the same events payload\n if (retryConfig.count >= RETRY_MAX_COUNT) {\n const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = err;\n } catch {\n // nothing to do\n }\n\n throw error;\n }\n\n // will retry in intervals of 5, 10, 30\n retryConfig.interval *= ++retryConfig.count;\n\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n await sendReplay(replayData, retryConfig);\n resolve(true);\n } catch (err) {\n reject(err);\n }\n }, retryConfig.interval);\n });\n }\n}\n","export const THROTTLED = '__THROTTLED';\nexport const SKIPPED = '__SKIPPED';\n\n/**\n * Create a throttled function off a given function.\n * When calling the throttled function, it will call the original function only\n * if it hasn't been called more than `maxCount` times in the last `durationSeconds`.\n *\n * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,\n * or else the return value of the original function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function throttle any>(\n fn: T,\n maxCount: number,\n durationSeconds: number,\n): (...rest: Parameters) => ReturnType | typeof THROTTLED | typeof SKIPPED {\n const counter = new Map();\n\n const _cleanup = (now: number): void => {\n const threshold = now - durationSeconds;\n counter.forEach((_value, key) => {\n if (key < threshold) {\n counter.delete(key);\n }\n });\n };\n\n const _getTotalCount = (): number => {\n return [...counter.values()].reduce((a, b) => a + b, 0);\n };\n\n let isThrottled = false;\n\n return (...rest: Parameters): ReturnType | typeof THROTTLED | typeof SKIPPED => {\n // Date in second-precision, which we use as basis for the throttling\n const now = Math.floor(Date.now() / 1000);\n\n // First, make sure to delete any old entries\n _cleanup(now);\n\n // If already over limit, do nothing\n if (_getTotalCount() >= maxCount) {\n const wasThrottled = isThrottled;\n isThrottled = true;\n return wasThrottled ? SKIPPED : THROTTLED;\n }\n\n isThrottled = false;\n const count = counter.get(now) || 0;\n counter.set(now, count + 1);\n\n return fn(...rest);\n };\n}\n","/* eslint-disable max-lines */ // TODO: We might want to split this file up\nimport { EventType, record } from '@sentry-internal/rrweb';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n captureException,\n getClient,\n getCurrentScope,\n spanToJSON,\n} from '@sentry/core';\nimport type { ReplayRecordingMode, Transaction } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport {\n BUFFER_CHECKOUT_TIME,\n SESSION_IDLE_EXPIRE_DURATION,\n SESSION_IDLE_PAUSE_DURATION,\n SLOW_CLICK_SCROLL_TIMEOUT,\n SLOW_CLICK_THRESHOLD,\n WINDOW,\n} from './constants';\nimport { ClickDetector } from './coreHandlers/handleClick';\nimport { handleKeyboardEvent } from './coreHandlers/handleKeyboardEvent';\nimport { setupPerformanceObserver } from './coreHandlers/performanceObserver';\nimport { DEBUG_BUILD } from './debug-build';\nimport { createEventBuffer } from './eventBuffer';\nimport { clearSession } from './session/clearSession';\nimport { loadOrCreateSession } from './session/loadOrCreateSession';\nimport { saveSession } from './session/saveSession';\nimport { shouldRefreshSession } from './session/shouldRefreshSession';\n\nimport type {\n AddEventResult,\n AddUpdateCallback,\n AllPerformanceEntry,\n AllPerformanceEntryData,\n EventBuffer,\n InternalEventContext,\n PopEventContext,\n RecordingEvent,\n RecordingOptions,\n ReplayBreadcrumbFrame,\n ReplayCanvasIntegrationOptions,\n ReplayContainer as ReplayContainerInterface,\n ReplayPerformanceEntry,\n ReplayPluginOptions,\n SendBufferedReplayOptions,\n Session,\n SlowClickConfig,\n Timeouts,\n} from './types';\nimport { ReplayEventTypeCustom } from './types';\nimport { addEvent, addEventSync } from './util/addEvent';\nimport { addGlobalListeners } from './util/addGlobalListeners';\nimport { addMemoryEntry } from './util/addMemoryEntry';\nimport { createBreadcrumb } from './util/createBreadcrumb';\nimport { createPerformanceEntries } from './util/createPerformanceEntries';\nimport { createPerformanceSpans } from './util/createPerformanceSpans';\nimport { debounce } from './util/debounce';\nimport { getHandleRecordingEmit } from './util/handleRecordingEmit';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { logInfo, logInfoNextTick } from './util/log';\nimport { sendReplay } from './util/sendReplay';\nimport type { SKIPPED } from './util/throttle';\nimport { THROTTLED, throttle } from './util/throttle';\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\nexport class ReplayContainer implements ReplayContainerInterface {\n public eventBuffer: EventBuffer | null;\n\n public performanceEntries: AllPerformanceEntry[];\n\n public replayPerformanceEntries: ReplayPerformanceEntry[];\n\n public session: Session | undefined;\n\n public clickDetector: ClickDetector | undefined;\n\n /**\n * Recording can happen in one of three modes:\n * - session: Record the whole session, sending it continuously\n * - buffer: Always keep the last 60s of recording, requires:\n * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs\n * - or calling `flush()` to send the replay\n */\n public recordingMode: ReplayRecordingMode;\n\n /**\n * The current or last active transcation.\n * This is only available when performance is enabled.\n */\n public lastTransaction?: Transaction;\n\n /**\n * These are here so we can overwrite them in tests etc.\n * @hidden\n */\n public readonly timeouts: Timeouts;\n\n private _throttledAddEvent: (\n event: RecordingEvent,\n isCheckout?: boolean,\n ) => typeof THROTTLED | typeof SKIPPED | Promise;\n\n /**\n * Options to pass to `rrweb.record()`\n */\n private readonly _recordingOptions: RecordingOptions;\n\n private readonly _options: ReplayPluginOptions;\n\n private _performanceCleanupCallback?: () => void;\n\n private _debouncedFlush: ReturnType;\n private _flushLock: Promise | undefined;\n\n /**\n * Timestamp of the last user activity. This lives across sessions.\n */\n private _lastActivity: number;\n\n /**\n * Is the integration currently active?\n */\n private _isEnabled: boolean;\n\n /**\n * Paused is a state where:\n * - DOM Recording is not listening at all\n * - Nothing will be added to event buffer (e.g. core SDK events)\n */\n private _isPaused: boolean;\n\n /**\n * Have we attached listeners to the core SDK?\n * Note we have to track this as there is no way to remove instrumentation handlers.\n */\n private _hasInitializedCoreListeners: boolean;\n\n /**\n * Function to stop recording\n */\n private _stopRecording: ReturnType | undefined;\n\n private _context: InternalEventContext;\n\n /**\n * Internal use for canvas recording options\n */\n private _canvas: ReplayCanvasIntegrationOptions | undefined;\n\n public constructor({\n options,\n recordingOptions,\n }: {\n options: ReplayPluginOptions;\n recordingOptions: RecordingOptions;\n }) {\n this.eventBuffer = null;\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n this.recordingMode = 'session';\n this.timeouts = {\n sessionIdlePause: SESSION_IDLE_PAUSE_DURATION,\n sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION,\n } as const;\n this._lastActivity = Date.now();\n this._isEnabled = false;\n this._isPaused = false;\n this._hasInitializedCoreListeners = false;\n this._context = {\n errorIds: new Set(),\n traceIds: new Set(),\n urls: [],\n initialTimestamp: Date.now(),\n initialUrl: '',\n };\n\n this._recordingOptions = recordingOptions;\n this._options = options;\n\n this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {\n maxWait: this._options.flushMaxDelay,\n });\n\n this._throttledAddEvent = throttle(\n (event: RecordingEvent, isCheckout?: boolean) => addEvent(this, event, isCheckout),\n // Max 300 events...\n 300,\n // ... per 5s\n 5,\n );\n\n const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions();\n\n const slowClickConfig: SlowClickConfig | undefined = slowClickTimeout\n ? {\n threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout),\n timeout: slowClickTimeout,\n scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT,\n ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : '',\n }\n : undefined;\n\n if (slowClickConfig) {\n this.clickDetector = new ClickDetector(this, slowClickConfig);\n }\n }\n\n /** Get the event context. */\n public getContext(): InternalEventContext {\n return this._context;\n }\n\n /** If recording is currently enabled. */\n public isEnabled(): boolean {\n return this._isEnabled;\n }\n\n /** If recording is currently paused. */\n public isPaused(): boolean {\n return this._isPaused;\n }\n\n /**\n * Determine if canvas recording is enabled\n */\n public isRecordingCanvas(): boolean {\n return Boolean(this._canvas);\n }\n\n /** Get the replay integration options. */\n public getOptions(): ReplayPluginOptions {\n return this._options;\n }\n\n /**\n * Initializes the plugin based on sampling configuration. Should not be\n * called outside of constructor.\n */\n public initializeSampling(previousSessionId?: string): void {\n const { errorSampleRate, sessionSampleRate } = this._options;\n\n // If neither sample rate is > 0, then do nothing - user will need to call one of\n // `start()` or `startBuffering` themselves.\n if (errorSampleRate <= 0 && sessionSampleRate <= 0) {\n return;\n }\n\n // Otherwise if there is _any_ sample rate set, try to load an existing\n // session, or create a new one.\n this._initializeSessionForSampling(previousSessionId);\n\n if (!this.session) {\n // This should not happen, something wrong has occurred\n this._handleException(new Error('Unable to initialize and create session'));\n return;\n }\n\n if (this.session.sampled === false) {\n // This should only occur if `errorSampleRate` is 0 and was unsampled for\n // session-based replay. In this case there is nothing to do.\n return;\n }\n\n // If segmentId > 0, it means we've previously already captured this session\n // In this case, we still want to continue in `session` recording mode\n this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session';\n\n logInfoNextTick(\n `[Replay] Starting replay in ${this.recordingMode} mode`,\n this._options._experiments.traceInternals,\n );\n\n this._initializeRecording();\n }\n\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * _performanceObserver, Recording, Sentry SDK, etc)\n */\n public start(): void {\n if (this._isEnabled && this.recordingMode === 'session') {\n throw new Error('Replay recording is already in progress');\n }\n\n if (this._isEnabled && this.recordingMode === 'buffer') {\n throw new Error('Replay buffering is in progress, call `flush()` to save the replay');\n }\n\n logInfoNextTick('[Replay] Starting replay in session mode', this._options._experiments.traceInternals);\n\n // Required as user activity is initially set in\n // constructor, so if `start()` is called after\n // session idle expiration, a replay will not be\n // created due to an idle timeout.\n this._updateUserActivity();\n\n const session = loadOrCreateSession(\n {\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n traceInternals: this._options._experiments.traceInternals,\n },\n {\n stickySession: this._options.stickySession,\n // This is intentional: create a new session-based replay when calling `start()`\n sessionSampleRate: 1,\n allowBuffering: false,\n },\n );\n\n this.session = session;\n\n this._initializeRecording();\n }\n\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, an error occurs.\n */\n public startBuffering(): void {\n if (this._isEnabled) {\n throw new Error('Replay recording is already in progress');\n }\n\n logInfoNextTick('[Replay] Starting replay in buffer mode', this._options._experiments.traceInternals);\n\n const session = loadOrCreateSession(\n {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals,\n },\n {\n stickySession: this._options.stickySession,\n sessionSampleRate: 0,\n allowBuffering: true,\n },\n );\n\n this.session = session;\n\n this.recordingMode = 'buffer';\n this._initializeRecording();\n }\n\n /**\n * Start recording.\n *\n * Note that this will cause a new DOM checkout\n */\n public startRecording(): void {\n try {\n const canvasOptions = this._canvas;\n\n this._stopRecording = record({\n ...this._recordingOptions,\n // When running in error sampling mode, we need to overwrite `checkoutEveryNms`\n // Without this, it would record forever, until an error happens, which we don't want\n // instead, we'll always keep the last 60 seconds of replay before an error happened\n ...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }),\n emit: getHandleRecordingEmit(this),\n onMutation: this._onMutationHandler,\n ...(canvasOptions\n ? {\n recordCanvas: canvasOptions.recordCanvas,\n getCanvasManager: canvasOptions.getCanvasManager,\n sampling: canvasOptions.sampling,\n dataURLOptions: canvasOptions.dataURLOptions,\n }\n : {}),\n });\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Stops the recording, if it was running.\n *\n * Returns true if it was previously stopped, or is now stopped,\n * otherwise false.\n */\n public stopRecording(): boolean {\n try {\n if (this._stopRecording) {\n this._stopRecording();\n this._stopRecording = undefined;\n }\n\n return true;\n } catch (err) {\n this._handleException(err);\n return false;\n }\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n public async stop({ forceFlush = false, reason }: { forceFlush?: boolean; reason?: string } = {}): Promise {\n if (!this._isEnabled) {\n return;\n }\n\n // We can't move `_isEnabled` after awaiting a flush, otherwise we can\n // enter into an infinite loop when `stop()` is called while flushing.\n this._isEnabled = false;\n\n try {\n logInfo(\n `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`,\n this._options._experiments.traceInternals,\n );\n\n this._removeListeners();\n this.stopRecording();\n\n this._debouncedFlush.cancel();\n // See comment above re: `_isEnabled`, we \"force\" a flush, ignoring the\n // `_isEnabled` state of the plugin since it was disabled above.\n if (forceFlush) {\n await this._flush({ force: true });\n }\n\n // After flush, destroy event buffer\n this.eventBuffer && this.eventBuffer.destroy();\n this.eventBuffer = null;\n\n // Clear session from session storage, note this means if a new session\n // is started after, it will not have `previousSessionId`\n clearSession(this);\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Pause some replay functionality. See comments for `_isPaused`.\n * This differs from stop as this only stops DOM recording, it is\n * not as thorough of a shutdown as `stop()`.\n */\n public pause(): void {\n if (this._isPaused) {\n return;\n }\n\n this._isPaused = true;\n this.stopRecording();\n\n logInfo('[Replay] Pausing replay', this._options._experiments.traceInternals);\n }\n\n /**\n * Resumes recording, see notes for `pause().\n *\n * Note that calling `startRecording()` here will cause a\n * new DOM checkout.`\n */\n public resume(): void {\n if (!this._isPaused || !this._checkSession()) {\n return;\n }\n\n this._isPaused = false;\n this.startRecording();\n\n logInfo('[Replay] Resuming replay', this._options._experiments.traceInternals);\n }\n\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n public async sendBufferedReplayOrFlush({ continueRecording = true }: SendBufferedReplayOptions = {}): Promise {\n if (this.recordingMode === 'session') {\n return this.flushImmediate();\n }\n\n const activityTime = Date.now();\n\n logInfo('[Replay] Converting buffer to session', this._options._experiments.traceInternals);\n\n // Allow flush to complete before resuming as a session recording, otherwise\n // the checkout from `startRecording` may be included in the payload.\n // Prefer to keep the error replay as a separate (and smaller) segment\n // than the session replay.\n await this.flushImmediate();\n\n const hasStoppedRecording = this.stopRecording();\n\n if (!continueRecording || !hasStoppedRecording) {\n return;\n }\n\n // To avoid race conditions where this is called multiple times, we check here again that we are still buffering\n if ((this.recordingMode as ReplayRecordingMode) === 'session') {\n return;\n }\n\n // Re-start recording in session-mode\n this.recordingMode = 'session';\n\n // Once this session ends, we do not want to refresh it\n if (this.session) {\n this._updateUserActivity(activityTime);\n this._updateSessionActivity(activityTime);\n this._maybeSaveSession();\n }\n\n this.startRecording();\n }\n\n /**\n * We want to batch uploads of replay events. Save events only if\n * `` milliseconds have elapsed since the last event\n * *OR* if `` milliseconds have elapsed.\n *\n * Accepts a callback to perform side-effects and returns true to stop batch\n * processing and hand back control to caller.\n */\n public addUpdate(cb: AddUpdateCallback): void {\n // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`)\n const cbResult = cb();\n\n // If this option is turned on then we will only want to call `flush`\n // explicitly\n if (this.recordingMode === 'buffer') {\n return;\n }\n\n // If callback is true, we do not want to continue with flushing -- the\n // caller will need to handle it.\n if (cbResult === true) {\n return;\n }\n\n // addUpdate is called quite frequently - use _debouncedFlush so that it\n // respects the flush delays and does not flush immediately\n this._debouncedFlush();\n }\n\n /**\n * Updates the user activity timestamp and resumes recording. This should be\n * called in an event handler for a user action that we consider as the user\n * being \"active\" (e.g. a mouse click).\n */\n public triggerUserActivity(): void {\n this._updateUserActivity();\n\n // This case means that recording was once stopped due to inactivity.\n // Ensure that recording is resumed.\n if (!this._stopRecording) {\n // Create a new session, otherwise when the user action is flushed, it\n // will get rejected due to an expired session.\n if (!this._checkSession()) {\n return;\n }\n\n // Note: This will cause a new DOM checkout\n this.resume();\n return;\n }\n\n // Otherwise... recording was never suspended, continue as normalish\n this.checkAndHandleExpiredSession();\n\n this._updateSessionActivity();\n }\n\n /**\n * Updates the user activity timestamp *without* resuming\n * recording. Some user events (e.g. keydown) can be create\n * low-value replays that only contain the keypress as a\n * breadcrumb. Instead this would require other events to\n * create a new replay after a session has expired.\n */\n public updateUserActivity(): void {\n this._updateUserActivity();\n this._updateSessionActivity();\n }\n\n /**\n * Only flush if `this.recordingMode === 'session'`\n */\n public conditionalFlush(): Promise {\n if (this.recordingMode === 'buffer') {\n return Promise.resolve();\n }\n\n return this.flushImmediate();\n }\n\n /**\n * Flush using debounce flush\n */\n public flush(): Promise {\n return this._debouncedFlush() as Promise;\n }\n\n /**\n * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n * cases of mulitple flushes happening closely together.\n */\n public flushImmediate(): Promise {\n this._debouncedFlush();\n // `.flush` is provided by the debounced function, analogously to lodash.debounce\n return this._debouncedFlush.flush() as Promise;\n }\n\n /**\n * Cancels queued up flushes.\n */\n public cancelFlush(): void {\n this._debouncedFlush.cancel();\n }\n\n /** Get the current sesion (=replay) ID */\n public getSessionId(): string | undefined {\n return this.session && this.session.id;\n }\n\n /**\n * Checks if recording should be stopped due to user inactivity. Otherwise\n * check if session is expired and create a new session if so. Triggers a new\n * full snapshot on new session.\n *\n * Returns true if session is not expired, false otherwise.\n * @hidden\n */\n public checkAndHandleExpiredSession(): boolean | void {\n // Prevent starting a new session if the last user activity is older than\n // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new\n // session+recording. This creates noisy replays that do not have much\n // content in them.\n if (\n this._lastActivity &&\n isExpired(this._lastActivity, this.timeouts.sessionIdlePause) &&\n this.session &&\n this.session.sampled === 'session'\n ) {\n // Pause recording only for session-based replays. Otherwise, resuming\n // will create a new replay and will conflict with users who only choose\n // to record error-based replays only. (e.g. the resumed replay will not\n // contain a reference to an error)\n this.pause();\n return;\n }\n\n // --- There is recent user activity --- //\n // This will create a new session if expired, based on expiry length\n if (!this._checkSession()) {\n // Check session handles the refreshing itself\n return false;\n }\n\n return true;\n }\n\n /**\n * Capture some initial state that can change throughout the lifespan of the\n * replay. This is required because otherwise they would be captured at the\n * first flush.\n */\n public setInitialState(): void {\n const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;\n const url = `${WINDOW.location.origin}${urlPath}`;\n\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n\n // Reset _context as well\n this._clearContext();\n\n this._context.initialUrl = url;\n this._context.initialTimestamp = Date.now();\n this._context.urls.push(url);\n }\n\n /**\n * Add a breadcrumb event, that may be throttled.\n * If it was throttled, we add a custom breadcrumb to indicate that.\n */\n public throttledAddEvent(\n event: RecordingEvent,\n isCheckout?: boolean,\n ): typeof THROTTLED | typeof SKIPPED | Promise {\n const res = this._throttledAddEvent(event, isCheckout);\n\n // If this is THROTTLED, it means we have throttled the event for the first time\n // In this case, we want to add a breadcrumb indicating that something was skipped\n if (res === THROTTLED) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.throttled',\n });\n\n this.addUpdate(() => {\n // Return `false` if the event _was_ added, as that means we schedule a flush\n return !addEventSync(this, {\n type: ReplayEventTypeCustom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n metric: true,\n },\n });\n });\n }\n\n return res;\n }\n\n /**\n * This will get the parametrized route name of the current page.\n * This is only available if performance is enabled, and if an instrumented router is used.\n */\n public getCurrentRoute(): string | undefined {\n // eslint-disable-next-line deprecation/deprecation\n const lastTransaction = this.lastTransaction || getCurrentScope().getTransaction();\n\n const attributes = (lastTransaction && spanToJSON(lastTransaction).data) || {};\n const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (!lastTransaction || !source || !['route', 'custom'].includes(source)) {\n return undefined;\n }\n\n return spanToJSON(lastTransaction).description;\n }\n\n /**\n * Initialize and start all listeners to varying events (DOM,\n * Performance Observer, Recording, Sentry SDK, etc)\n */\n private _initializeRecording(): void {\n this.setInitialState();\n\n // this method is generally called on page load or manually - in both cases\n // we should treat it as an activity\n this._updateSessionActivity();\n\n this.eventBuffer = createEventBuffer({\n useCompression: this._options.useCompression,\n workerUrl: this._options.workerUrl,\n });\n\n this._removeListeners();\n this._addListeners();\n\n // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n this._isEnabled = true;\n this._isPaused = false;\n\n this.startRecording();\n }\n\n /** A wrapper to conditionally capture exceptions. */\n private _handleException(error: unknown): void {\n DEBUG_BUILD && logger.error('[Replay]', error);\n\n if (DEBUG_BUILD && this._options._experiments && this._options._experiments.captureExceptions) {\n captureException(error);\n }\n }\n\n /**\n * Loads (or refreshes) the current session.\n */\n private _initializeSessionForSampling(previousSessionId?: string): void {\n // Whenever there is _any_ error sample rate, we always allow buffering\n // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors\n const allowBuffering = this._options.errorSampleRate > 0;\n\n const session = loadOrCreateSession(\n {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals,\n previousSessionId,\n },\n {\n stickySession: this._options.stickySession,\n sessionSampleRate: this._options.sessionSampleRate,\n allowBuffering,\n },\n );\n\n this.session = session;\n }\n\n /**\n * Checks and potentially refreshes the current session.\n * Returns false if session is not recorded.\n */\n private _checkSession(): boolean {\n // If there is no session yet, we do not want to refresh anything\n // This should generally not happen, but to be safe....\n if (!this.session) {\n return false;\n }\n\n const currentSession = this.session;\n\n if (\n shouldRefreshSession(currentSession, {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n })\n ) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._refreshSession(currentSession);\n return false;\n }\n\n return true;\n }\n\n /**\n * Refresh a session with a new one.\n * This stops the current session (without forcing a flush, as that would never work since we are expired),\n * and then does a new sampling based on the refreshed session.\n */\n private async _refreshSession(session: Session): Promise {\n if (!this._isEnabled) {\n return;\n }\n await this.stop({ reason: 'refresh session' });\n this.initializeSampling(session.id);\n }\n\n /**\n * Adds listeners to record events for the replay\n */\n private _addListeners(): void {\n try {\n WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n WINDOW.addEventListener('blur', this._handleWindowBlur);\n WINDOW.addEventListener('focus', this._handleWindowFocus);\n WINDOW.addEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.addListeners();\n }\n\n // There is no way to remove these listeners, so ensure they are only added once\n if (!this._hasInitializedCoreListeners) {\n addGlobalListeners(this);\n\n this._hasInitializedCoreListeners = true;\n }\n } catch (err) {\n this._handleException(err);\n }\n\n this._performanceCleanupCallback = setupPerformanceObserver(this);\n }\n\n /**\n * Cleans up listeners that were created in `_addListeners`\n */\n private _removeListeners(): void {\n try {\n WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n WINDOW.removeEventListener('blur', this._handleWindowBlur);\n WINDOW.removeEventListener('focus', this._handleWindowFocus);\n WINDOW.removeEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.removeListeners();\n }\n\n if (this._performanceCleanupCallback) {\n this._performanceCleanupCallback();\n }\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Handle when visibility of the page content changes. Opening a new tab will\n * cause the state to change to hidden because of content of current page will\n * be hidden. Likewise, moving a different window to cover the contents of the\n * page will also trigger a change to a hidden state.\n */\n private _handleVisibilityChange: () => void = () => {\n if (WINDOW.document.visibilityState === 'visible') {\n this._doChangeToForegroundTasks();\n } else {\n this._doChangeToBackgroundTasks();\n }\n };\n\n /**\n * Handle when page is blurred\n */\n private _handleWindowBlur: () => void = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.blur',\n });\n\n // Do not count blur as a user action -- it's part of the process of them\n // leaving the page\n this._doChangeToBackgroundTasks(breadcrumb);\n };\n\n /**\n * Handle when page is focused\n */\n private _handleWindowFocus: () => void = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.focus',\n });\n\n // Do not count focus as a user action -- instead wait until they focus and\n // interactive with page\n this._doChangeToForegroundTasks(breadcrumb);\n };\n\n /** Ensure page remains active when a key is pressed. */\n private _handleKeyboardEvent: (event: KeyboardEvent) => void = (event: KeyboardEvent) => {\n handleKeyboardEvent(this, event);\n };\n\n /**\n * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n */\n private _doChangeToBackgroundTasks(breadcrumb?: ReplayBreadcrumbFrame): void {\n if (!this.session) {\n return;\n }\n\n const expired = isSessionExpired(this.session, {\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n });\n\n if (expired) {\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n }\n\n // Send replay when the page/tab becomes hidden. There is no reason to send\n // replay if it becomes visible, since no actions we care about were done\n // while it was hidden\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n void this.conditionalFlush();\n }\n\n /**\n * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n */\n private _doChangeToForegroundTasks(breadcrumb?: ReplayBreadcrumbFrame): void {\n if (!this.session) {\n return;\n }\n\n const isSessionActive = this.checkAndHandleExpiredSession();\n\n if (!isSessionActive) {\n // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION\n // ms, we will re-use the existing session, otherwise create a new\n // session\n logInfo('[Replay] Document has become active, but session has expired');\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n }\n }\n\n /**\n * Update user activity (across session lifespans)\n */\n private _updateUserActivity(_lastActivity: number = Date.now()): void {\n this._lastActivity = _lastActivity;\n }\n\n /**\n * Updates the session's last activity timestamp\n */\n private _updateSessionActivity(_lastActivity: number = Date.now()): void {\n if (this.session) {\n this.session.lastActivity = _lastActivity;\n this._maybeSaveSession();\n }\n }\n\n /**\n * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n */\n private _createCustomBreadcrumb(breadcrumb: ReplayBreadcrumbFrame): void {\n this.addUpdate(() => {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.throttledAddEvent({\n type: EventType.Custom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n },\n });\n });\n }\n\n /**\n * Observed performance events are added to `this.performanceEntries`. These\n * are included in the replay event before it is finished and sent to Sentry.\n */\n private _addPerformanceEntries(): Promise> {\n const performanceEntries = createPerformanceEntries(this.performanceEntries).concat(this.replayPerformanceEntries);\n\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n\n return Promise.all(createPerformanceSpans(this, performanceEntries));\n }\n\n /**\n * Clear _context\n */\n private _clearContext(): void {\n // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n this._context.errorIds.clear();\n this._context.traceIds.clear();\n this._context.urls = [];\n }\n\n /** Update the initial timestamp based on the buffer content. */\n private _updateInitialTimestampFromEventBuffer(): void {\n const { session, eventBuffer } = this;\n if (!session || !eventBuffer) {\n return;\n }\n\n // we only ever update this on the initial segment\n if (session.segmentId) {\n return;\n }\n\n const earliestEvent = eventBuffer.getEarliestTimestamp();\n if (earliestEvent && earliestEvent < this._context.initialTimestamp) {\n this._context.initialTimestamp = earliestEvent;\n }\n }\n\n /**\n * Return and clear _context\n */\n private _popEventContext(): PopEventContext {\n const _context = {\n initialTimestamp: this._context.initialTimestamp,\n initialUrl: this._context.initialUrl,\n errorIds: Array.from(this._context.errorIds),\n traceIds: Array.from(this._context.traceIds),\n urls: this._context.urls,\n };\n\n this._clearContext();\n\n return _context;\n }\n\n /**\n * Flushes replay event buffer to Sentry.\n *\n * Performance events are only added right before flushing - this is\n * due to the buffered performance observer events.\n *\n * Should never be called directly, only by `flush`\n */\n private async _runFlush(): Promise {\n const replayId = this.getSessionId();\n\n if (!this.session || !this.eventBuffer || !replayId) {\n DEBUG_BUILD && logger.error('[Replay] No session or eventBuffer found to flush.');\n return;\n }\n\n await this._addPerformanceEntries();\n\n // Check eventBuffer again, as it could have been stopped in the meanwhile\n if (!this.eventBuffer || !this.eventBuffer.hasEvents) {\n return;\n }\n\n // Only attach memory event if eventBuffer is not empty\n await addMemoryEntry(this);\n\n // Check eventBuffer again, as it could have been stopped in the meanwhile\n if (!this.eventBuffer) {\n return;\n }\n\n // if this changed in the meanwhile, e.g. because the session was refreshed or similar, we abort here\n if (replayId !== this.getSessionId()) {\n return;\n }\n\n try {\n // This uses the data from the eventBuffer, so we need to call this before `finish()\n this._updateInitialTimestampFromEventBuffer();\n\n const timestamp = Date.now();\n\n // Check total duration again, to avoid sending outdated stuff\n // We leave 30s wiggle room to accomodate late flushing etc.\n // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop\n if (timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30_000) {\n throw new Error('Session is too long, not sending replay');\n }\n\n const eventContext = this._popEventContext();\n // Always increment segmentId regardless of outcome of sending replay\n const segmentId = this.session.segmentId++;\n this._maybeSaveSession();\n\n // Note this empties the event buffer regardless of outcome of sending replay\n const recordingData = await this.eventBuffer.finish();\n\n await sendReplay({\n replayId,\n recordingData,\n segmentId,\n eventContext,\n session: this.session,\n options: this.getOptions(),\n timestamp,\n });\n } catch (err) {\n this._handleException(err);\n\n // This means we retried 3 times and all of them failed,\n // or we ran into a problem we don't want to retry, like rate limiting.\n // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.stop({ reason: 'sendReplay' });\n\n const client = getClient();\n\n if (client) {\n client.recordDroppedEvent('send_error', 'replay');\n }\n }\n }\n\n /**\n * Flush recording data to Sentry. Creates a lock so that only a single flush\n * can be active at a time. Do not call this directly.\n */\n private _flush = async ({\n force = false,\n }: {\n /**\n * If true, flush while ignoring the `_isEnabled` state of\n * Replay integration. (By default, flush is noop if integration\n * is stopped).\n */\n force?: boolean;\n } = {}): Promise => {\n if (!this._isEnabled && !force) {\n // This can happen if e.g. the replay was stopped because of exceeding the retry limit\n return;\n }\n\n if (!this.checkAndHandleExpiredSession()) {\n DEBUG_BUILD && logger.error('[Replay] Attempting to finish replay event after session expired.');\n return;\n }\n\n if (!this.session) {\n // should never happen, as we would have bailed out before\n return;\n }\n\n const start = this.session.started;\n const now = Date.now();\n const duration = now - start;\n\n // A flush is about to happen, cancel any queued flushes\n this._debouncedFlush.cancel();\n\n // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it\n // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar\n const tooShort = duration < this._options.minReplayDuration;\n const tooLong = duration > this._options.maxReplayDuration + 5_000;\n if (tooShort || tooLong) {\n logInfo(\n `[Replay] Session duration (${Math.floor(duration / 1000)}s) is too ${\n tooShort ? 'short' : 'long'\n }, not sending replay.`,\n this._options._experiments.traceInternals,\n );\n\n if (tooShort) {\n this._debouncedFlush();\n }\n return;\n }\n\n const eventBuffer = this.eventBuffer;\n if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) {\n logInfo('[Replay] Flushing initial segment without checkout.', this._options._experiments.traceInternals);\n // TODO FN: Evaluate if we want to stop here, or remove this again?\n }\n\n // this._flushLock acts as a lock so that future calls to `_flush()`\n // will be blocked until this promise resolves\n if (!this._flushLock) {\n this._flushLock = this._runFlush();\n await this._flushLock;\n this._flushLock = undefined;\n return;\n }\n\n // Wait for previous flush to finish, then call the debounced `_flush()`.\n // It's possible there are other flush requests queued and waiting for it\n // to resolve. We want to reduce all outstanding requests (as well as any\n // new flush requests that occur within a second of the locked flush\n // completing) into a single flush.\n\n try {\n await this._flushLock;\n } catch (err) {\n DEBUG_BUILD && logger.error(err);\n } finally {\n this._debouncedFlush();\n }\n };\n\n /** Save the session, if it is sticky */\n private _maybeSaveSession(): void {\n if (this.session && this._options.stickySession) {\n saveSession(this.session);\n }\n }\n\n /** Handler for rrweb.record.onMutation */\n private _onMutationHandler = (mutations: unknown[]): boolean => {\n const count = mutations.length;\n\n const mutationLimit = this._options.mutationLimit;\n const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit;\n const overMutationLimit = mutationLimit && count > mutationLimit;\n\n // Create a breadcrumb if a lot of mutations happen at the same time\n // We can show this in the UI as an information with potential performance improvements\n if (count > mutationBreadcrumbLimit || overMutationLimit) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.mutations',\n data: {\n count,\n limit: overMutationLimit,\n },\n });\n this._createCustomBreadcrumb(breadcrumb);\n }\n\n // Stop replay if over the mutation limit\n if (overMutationLimit) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.stop({ reason: 'mutationLimit', forceFlush: this.recordingMode === 'session' });\n return false;\n }\n\n // `true` means we use the regular mutation handling by rrweb\n return true;\n };\n}\n","type DebouncedCallback = {\n (): void | unknown;\n flush: () => void | unknown;\n cancel: () => void;\n};\ntype CallbackFunction = () => unknown;\ntype DebounceOptions = { maxWait?: number };\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n * was already invoked in the meantime, return @param func's return value.\n * The debounced function has two additional properties:\n * - `flush`: Invokes the debounced function immediately and returns its return value\n * - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nexport function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback {\n let callbackReturnValue: unknown;\n\n let timerId: ReturnType | undefined;\n let maxTimerId: ReturnType | undefined;\n\n const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n function invokeFunc(): unknown {\n cancelTimers();\n callbackReturnValue = func();\n return callbackReturnValue;\n }\n\n function cancelTimers(): void {\n timerId !== undefined && clearTimeout(timerId);\n maxTimerId !== undefined && clearTimeout(maxTimerId);\n timerId = maxTimerId = undefined;\n }\n\n function flush(): unknown {\n if (timerId !== undefined || maxTimerId !== undefined) {\n return invokeFunc();\n }\n return callbackReturnValue;\n }\n\n function debounced(): unknown {\n if (timerId) {\n clearTimeout(timerId);\n }\n timerId = setTimeout(invokeFunc, wait);\n\n if (maxWait && maxTimerId === undefined) {\n maxTimerId = setTimeout(invokeFunc, maxWait);\n }\n\n return callbackReturnValue;\n }\n\n debounced.cancel = cancelTimers;\n debounced.flush = flush;\n return debounced;\n}\n","import { consoleSandbox } from '@sentry/utils';\n\nimport type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';\n\ntype GetPrivacyOptions = Required> &\n Omit;\ninterface GetPrivacyReturn {\n maskTextSelector: string;\n unmaskTextSelector: string;\n blockSelector: string;\n unblockSelector: string;\n ignoreSelector: string;\n\n blockClass?: RegExp;\n maskTextClass?: RegExp;\n}\n\nfunction getOption(\n selectors: string[],\n defaultSelectors: string[],\n deprecatedClassOption?: string | RegExp,\n deprecatedSelectorOption?: string,\n): string {\n const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n\n const allSelectors = [\n ...selectors,\n // @deprecated\n ...deprecatedSelectors,\n\n // sentry defaults\n ...defaultSelectors,\n ];\n\n // @deprecated\n if (typeof deprecatedClassOption !== 'undefined') {\n // NOTE: No support for RegExp\n if (typeof deprecatedClassOption === 'string') {\n allSelectors.push(`.${deprecatedClassOption}`);\n }\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',\n );\n });\n }\n\n return allSelectors.join(',');\n}\n\n/**\n * Returns privacy related configuration for use in rrweb\n */\nexport function getPrivacyOptions({\n mask,\n unmask,\n block,\n unblock,\n ignore,\n\n // eslint-disable-next-line deprecation/deprecation\n blockClass,\n // eslint-disable-next-line deprecation/deprecation\n blockSelector,\n // eslint-disable-next-line deprecation/deprecation\n maskTextClass,\n // eslint-disable-next-line deprecation/deprecation\n maskTextSelector,\n // eslint-disable-next-line deprecation/deprecation\n ignoreClass,\n}: GetPrivacyOptions): GetPrivacyReturn {\n const defaultBlockedElements = ['base[href=\"/\"]'];\n\n const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n\n const options: GetPrivacyReturn = {\n // We are making the decision to make text and input selectors the same\n maskTextSelector: maskSelector,\n unmaskTextSelector: unmaskSelector,\n\n blockSelector: getOption(\n block,\n ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],\n blockClass,\n blockSelector,\n ),\n unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass),\n };\n\n if (blockClass instanceof RegExp) {\n options.blockClass = blockClass;\n }\n\n if (maskTextClass instanceof RegExp) {\n options.maskTextClass = maskTextClass;\n }\n\n return options;\n}\n","import { getClient } from '@sentry/core';\nimport type { BrowserClientReplayOptions, Integration, IntegrationFn } from '@sentry/types';\nimport { consoleSandbox, dropUndefinedKeys, isBrowser } from '@sentry/utils';\n\nimport {\n DEFAULT_FLUSH_MAX_DELAY,\n DEFAULT_FLUSH_MIN_DELAY,\n MAX_REPLAY_DURATION,\n MIN_REPLAY_DURATION,\n MIN_REPLAY_DURATION_LIMIT,\n} from './constants';\nimport { ReplayContainer } from './replay';\nimport type {\n RecordingOptions,\n ReplayCanvasIntegrationOptions,\n ReplayConfiguration,\n ReplayPluginOptions,\n SendBufferedReplayOptions,\n} from './types';\nimport { getPrivacyOptions } from './util/getPrivacyOptions';\nimport { maskAttribute } from './util/maskAttribute';\n\nconst MEDIA_SELECTORS =\n 'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\n\nconst DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept'];\n\nlet _initialized = false;\n\ntype InitialReplayPluginOptions = Omit &\n Partial>;\n\nexport const replayIntegration = ((options?: ReplayConfiguration) => {\n // eslint-disable-next-line deprecation/deprecation\n return new Replay(options);\n}) satisfies IntegrationFn;\n\n/**\n * The main replay integration class, to be passed to `init({ integrations: [] })`.\n * @deprecated Use `replayIntegration()` instead.\n */\nexport class Replay implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Replay';\n\n /**\n * @inheritDoc\n */\n public name: string;\n\n /**\n * Options to pass to `rrweb.record()`\n */\n private readonly _recordingOptions: RecordingOptions;\n\n /**\n * Initial options passed to the replay integration, merged with default values.\n * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n * can only be finally set when setupOnce() is called.\n *\n * @private\n */\n private readonly _initialOptions: InitialReplayPluginOptions;\n\n private _replay?: ReplayContainer;\n\n public constructor({\n flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,\n flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,\n minReplayDuration = MIN_REPLAY_DURATION,\n maxReplayDuration = MAX_REPLAY_DURATION,\n stickySession = true,\n useCompression = true,\n workerUrl,\n _experiments = {},\n sessionSampleRate,\n errorSampleRate,\n maskAllText = true,\n maskAllInputs = true,\n blockAllMedia = true,\n\n mutationBreadcrumbLimit = 750,\n mutationLimit = 10_000,\n\n slowClickTimeout = 7_000,\n slowClickIgnoreSelectors = [],\n\n networkDetailAllowUrls = [],\n networkDetailDenyUrls = [],\n networkCaptureBodies = true,\n networkRequestHeaders = [],\n networkResponseHeaders = [],\n\n mask = [],\n maskAttributes = ['title', 'placeholder'],\n unmask = [],\n block = [],\n unblock = [],\n ignore = [],\n maskFn,\n\n beforeAddRecordingEvent,\n beforeErrorSampling,\n\n // eslint-disable-next-line deprecation/deprecation\n blockClass,\n // eslint-disable-next-line deprecation/deprecation\n blockSelector,\n // eslint-disable-next-line deprecation/deprecation\n maskInputOptions,\n // eslint-disable-next-line deprecation/deprecation\n maskTextClass,\n // eslint-disable-next-line deprecation/deprecation\n maskTextSelector,\n // eslint-disable-next-line deprecation/deprecation\n ignoreClass,\n }: ReplayConfiguration = {}) {\n // eslint-disable-next-line deprecation/deprecation\n this.name = Replay.id;\n\n const privacyOptions = getPrivacyOptions({\n mask,\n unmask,\n block,\n unblock,\n ignore,\n blockClass,\n blockSelector,\n maskTextClass,\n maskTextSelector,\n ignoreClass,\n });\n\n this._recordingOptions = {\n maskAllInputs,\n maskAllText,\n maskInputOptions: { ...(maskInputOptions || {}), password: true },\n maskTextFn: maskFn,\n maskInputFn: maskFn,\n maskAttributeFn: (key: string, value: string, el: HTMLElement): string =>\n maskAttribute({\n maskAttributes,\n maskAllText,\n privacyOptions,\n key,\n value,\n el,\n }),\n\n ...privacyOptions,\n\n // Our defaults\n slimDOMOptions: 'all',\n inlineStylesheet: true,\n // Disable inline images as it will increase segment/replay size\n inlineImages: false,\n // collect fonts, but be aware that `sentry.io` needs to be an allowed\n // origin for playback\n collectFonts: true,\n errorHandler: (err: Error & { __rrweb__?: boolean }) => {\n try {\n err.__rrweb__ = true;\n } catch (error) {\n // ignore errors here\n // this can happen if the error is frozen or does not allow mutation for other reasons\n }\n },\n };\n\n this._initialOptions = {\n flushMinDelay,\n flushMaxDelay,\n minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT),\n maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION),\n stickySession,\n sessionSampleRate,\n errorSampleRate,\n useCompression,\n workerUrl,\n blockAllMedia,\n maskAllInputs,\n maskAllText,\n mutationBreadcrumbLimit,\n mutationLimit,\n slowClickTimeout,\n slowClickIgnoreSelectors,\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),\n networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),\n beforeAddRecordingEvent,\n beforeErrorSampling,\n\n _experiments,\n };\n\n if (typeof sessionSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\n `[Replay] You are passing \\`sessionSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysSessionSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,\n );\n\n this._initialOptions.sessionSampleRate = sessionSampleRate;\n }\n\n if (typeof errorSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\n `[Replay] You are passing \\`errorSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysOnErrorSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,\n );\n\n this._initialOptions.errorSampleRate = errorSampleRate;\n }\n\n if (this._initialOptions.blockAllMedia) {\n // `blockAllMedia` is a more user friendly option to configure blocking\n // embedded media elements\n this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector\n ? MEDIA_SELECTORS\n : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;\n }\n\n if (this._isInitialized && isBrowser()) {\n throw new Error('Multiple Sentry Session Replay instances are not supported');\n }\n\n this._isInitialized = true;\n }\n\n /** If replay has already been initialized */\n protected get _isInitialized(): boolean {\n return _initialized;\n }\n\n /** Update _isInitialized */\n protected set _isInitialized(value: boolean) {\n _initialized = value;\n }\n\n /**\n * Setup and initialize replay container\n */\n public setupOnce(): void {\n if (!isBrowser()) {\n return;\n }\n\n this._setup();\n\n // Once upon a time, we tried to create a transaction in `setupOnce` and it would\n // potentially create a transaction before some native SDK integrations have run\n // and applied their own global event processor. An example is:\n // https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n //\n // So we call `this._initialize()` in next event loop as a workaround to wait for other\n // global event processors to finish. This is no longer needed, but keeping it\n // here to avoid any future issues.\n setTimeout(() => this._initialize());\n }\n\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * PerformanceObserver, Recording, Sentry SDK, etc)\n */\n public start(): void {\n if (!this._replay) {\n return;\n }\n\n this._replay.start();\n }\n\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, until an error occurs.\n */\n public startBuffering(): void {\n if (!this._replay) {\n return;\n }\n\n this._replay.startBuffering();\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n public stop(): Promise {\n if (!this._replay) {\n return Promise.resolve();\n }\n\n return this._replay.stop({ forceFlush: this._replay.recordingMode === 'session' });\n }\n\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n public flush(options?: SendBufferedReplayOptions): Promise {\n if (!this._replay || !this._replay.isEnabled()) {\n return Promise.resolve();\n }\n\n return this._replay.sendBufferedReplayOrFlush(options);\n }\n\n /**\n * Get the current session ID.\n */\n public getReplayId(): string | undefined {\n if (!this._replay || !this._replay.isEnabled()) {\n return;\n }\n\n return this._replay.getSessionId();\n }\n\n /**\n * Initializes replay.\n */\n protected _initialize(): void {\n if (!this._replay) {\n return;\n }\n\n // We have to run this in _initialize, because this runs in setTimeout\n // So when this runs all integrations have been added\n // Before this, we cannot access integrations on the client,\n // so we need to mutate the options here\n this._maybeLoadFromReplayCanvasIntegration();\n\n this._replay.initializeSampling();\n }\n\n /** Setup the integration. */\n private _setup(): void {\n // Client is not available in constructor, so we need to wait until setupOnce\n const finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n\n this._replay = new ReplayContainer({\n options: finalOptions,\n recordingOptions: this._recordingOptions,\n });\n }\n\n /** Get canvas options from ReplayCanvas integration, if it is also added. */\n private _maybeLoadFromReplayCanvasIntegration(): void {\n // To save bundle size, we skip checking for stuff here\n // and instead just try-catch everything - as generally this should all be defined\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n try {\n const client = getClient()!;\n const canvasIntegration = client.getIntegrationByName!('ReplayCanvas') as Integration & {\n getOptions(): ReplayCanvasIntegrationOptions;\n };\n if (!canvasIntegration) {\n return;\n }\n\n this._replay!['_canvas'] = canvasIntegration.getOptions();\n } catch {\n // ignore errors here\n }\n /* eslint-enable @typescript-eslint/no-non-null-assertion */\n }\n}\n\n/** Parse Replay-related options from SDK options */\nfunction loadReplayOptionsFromClient(initialOptions: InitialReplayPluginOptions): ReplayPluginOptions {\n const client = getClient();\n const opt = client && (client.getOptions() as BrowserClientReplayOptions);\n\n const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };\n\n if (!opt) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('SDK client is not available.');\n });\n return finalOptions;\n }\n\n if (\n initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n opt.replaysSessionSampleRate == null &&\n opt.replaysOnErrorSampleRate == null\n ) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n 'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',\n );\n });\n }\n\n if (typeof opt.replaysSessionSampleRate === 'number') {\n finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n }\n\n if (typeof opt.replaysOnErrorSampleRate === 'number') {\n finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n }\n\n return finalOptions;\n}\n\nfunction _getMergedNetworkHeaders(headers: string[]): string[] {\n return [...DEFAULT_NETWORK_HEADERS, ...headers.map(header => header.toLowerCase())];\n}\n","import type { getPrivacyOptions } from './getPrivacyOptions';\n\ninterface MaskAttributeParams {\n maskAttributes: string[];\n maskAllText: boolean;\n privacyOptions: ReturnType;\n key: string;\n value: string;\n el: HTMLElement;\n}\n\n/**\n * Masks an attribute if necessary, otherwise return attribute value as-is.\n */\nexport function maskAttribute({\n el,\n key,\n maskAttributes,\n maskAllText,\n privacyOptions,\n value,\n}: MaskAttributeParams): string {\n // We only mask attributes if `maskAllText` is true\n if (!maskAllText) {\n return value;\n }\n\n // unmaskTextSelector takes precendence\n if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) {\n return value;\n }\n\n if (\n maskAttributes.includes(key) ||\n // Need to mask `value` attribute for `` if it's a button-like\n // type\n (key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || ''))\n ) {\n return value.replace(/[\\S]/g, '*');\n }\n\n return value;\n}\n","import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial | undefined {\n if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n return undefined;\n }\n\n // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n // It is later used to read Sentry-DSC-values from.\n let baggageObject: Readonly> = {};\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n baggageObject = baggageHeader.reduce>((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n for (const key of Object.keys(currBaggageObject)) {\n acc[key] = currBaggageObject[key];\n }\n return acc;\n }, {});\n } else {\n // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n // this is how we choose to handle it)\n if (!baggageHeader) {\n return undefined;\n }\n\n baggageObject = baggageHeaderToObject(baggageHeader);\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce>((acc, [key, value]) => {\n if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext as Partial;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext?: Partial,\n): string | undefined {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce>(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record {\n return baggageHeader\n .split(',')\n .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n .reduce>((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record): string | undefined {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n","import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\ntype SimpleNode = {\n parentNode: SimpleNode;\n} | null;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n elem: unknown,\n options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n if (!elem) {\n return '';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset && elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement(selector: string): E | null {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) as unknown as E;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` attribute. This attribute is added at build-time\n * by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nexport function getComponentName(elem: unknown): string | null {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement && currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n","import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { consoleSandbox, logger } from './logger';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nexport function dsnFromString(str: string): DsnComponents | undefined {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() as string;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents: ReadonlyArray = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nexport function makeDsn(from: DsnLike): DsnComponents | undefined {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n // @ts-expect-error __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n return __SENTRY_SDK_SOURCE__;\n}\n","import type { ConsoleLevel } from '@sentry/types';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public logLevel: ConsoleLevel;\n\n public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n super(message);\n\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n","import { DEBUG_BUILD } from '../debug-build';\nimport { logger } from '../logger';\nimport { getFunctionName } from '../stacktrace';\n\nexport type InstrumentHandlerType = 'console' | 'dom' | 'fetch' | 'history' | 'xhr' | 'error' | 'unhandledrejection';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n// We keep the handlers globally\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Add a handler function. */\nexport function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void {\n handlers[type] = handlers[type] || [];\n (handlers[type] as InstrumentHandlerCallback[]).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nexport function resetInstrumentationHandlers(): void {\n Object.keys(handlers).forEach(key => {\n handlers[key as InstrumentHandlerType] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nexport function maybeInstrument(type: InstrumentHandlerType, instrumentFn: () => void): void {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nexport function triggerHandlers(type: InstrumentHandlerType, data: unknown): void {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataDom } from '@sentry/types';\n\nimport { uuid4 } from '../misc';\nimport { addNonEnumerableProperty, fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype SentryWrappedTarget = HTMLElement & { _sentryId?: string };\n\ntype AddEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n __sentry_instrumentation_handlers__?: {\n [key in 'click' | 'keypress']?: {\n handler?: Function;\n /** The number of custom listeners attached to this element */\n refCount: number;\n };\n };\n};\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID: number | undefined;\nlet lastCapturedEventType: string | undefined;\nlet lastCapturedEventTargetId: string | undefined;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addClickKeypressInstrumentationHandler(handler: (data: HandlerDataDom) => void): void {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nexport function instrumentDOM(): void {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target: string) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): AddEventListener {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n return function (\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event: Event): boolean {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target as SentryWrappedTarget)._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType: string, target: SentryWrappedTarget | null): boolean {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler: (data: HandlerDataDom) => void,\n globalListener: boolean = false,\n): (event: Event) => void {\n return (event: Event & { _sentryCaptured?: true }): void => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData: HandlerDataDom = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event: Event): SentryWrappedTarget | null {\n try {\n return event.target as SentryWrappedTarget | null;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataFetch } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsNativeFetch } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addFetchInstrumentationHandler(handler: (data: HandlerDataFetch) => void): void {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, instrumentFetch);\n}\n\nfunction instrumentFetch(): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch: () => void): () => void {\n return function (...args: any[]): void {\n const { method, url } = parseFetchArgs(args);\n\n const handlerData: HandlerDataFetch = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n (response: Response) => {\n const finishedHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n };\n\n triggerHandlers('fetch', finishedHandlerData);\n return response;\n },\n (error: Error) => {\n const erroredHandlerData: HandlerDataFetch = {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n };\n\n triggerHandlers('fetch', erroredHandlerData);\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nfunction hasProp(obj: unknown, prop: T): obj is Record {\n return !!obj && typeof obj === 'object' && !!(obj as Record)[prop];\n}\n\nfunction getUrlFromResource(resource: FetchResource): string {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs as [FetchResource, object];\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg as FetchResource),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n","import type { HandlerDataError } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnErrorHandler: (typeof GLOBAL_OBJ)['onerror'] | null = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalErrorInstrumentationHandler(handler: (data: HandlerDataError) => void): void {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError(): void {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg: string | object,\n url?: string,\n line?: number,\n column?: number,\n error?: Error,\n ): boolean {\n const handlerData: HandlerDataError = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { HandlerDataUnhandledRejection } from '@sentry/types';\n\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nlet _oldOnUnhandledRejectionHandler: (typeof GLOBAL_OBJ)['onunhandledrejection'] | null = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addGlobalUnhandledRejectionInstrumentationHandler(\n handler: (data: HandlerDataUnhandledRejection) => void,\n): void {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection(): void {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e: any): boolean {\n const handlerData: HandlerDataUnhandledRejection = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n","// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chromeVar = (WINDOW as any).chrome;\n const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataHistory } from '@sentry/types';\n\nimport { fill } from '../object';\nimport { supportsHistory } from '../supports';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nlet lastHref: string | undefined;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addHistoryInstrumentationHandler(handler: (data: HandlerDataHistory) => void): void {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory(): void {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n return function (this: History, ...args: any[]): void {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData: HandlerDataHistory = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n","// TODO(v8): Move everything in this file into the browser package. Nothing here is generic and we run risk of leaking browser types into non-browser packages.\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { HandlerDataXhr, SentryWrappedXMLHttpRequest, WrappedFunction } from '@sentry/types';\n\nimport { isString } from '../is';\nimport { fill } from '../object';\nimport { GLOBAL_OBJ } from '../worldwide';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addXhrInstrumentationHandler(handler: (data: HandlerDataXhr) => void): void {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nexport function instrumentXHR(): void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(WINDOW as any).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const startTimestamp = Date.now();\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(args[0]) ? args[0].toUpperCase() : undefined;\n const url = parseUrl(args[1]);\n\n if (!method || !url) {\n return originalOpen.apply(this, args);\n }\n\n this[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler: () => void = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (this.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = this.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData: HandlerDataXhr = {\n args: [method, url],\n endTimestamp: Date.now(),\n startTimestamp,\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n onreadystatechangeHandler();\n return original.apply(this, readyStateArgs);\n };\n });\n } else {\n this.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n const [header, value] = setRequestHeaderArgs;\n\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return original.apply(this, setRequestHeaderArgs);\n };\n });\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(this, args);\n }\n\n if (args[0] !== undefined) {\n sentryXhrData.body = args[0];\n }\n\n const handlerData: HandlerDataXhr = {\n args: [sentryXhrData.method, sentryXhrData.url],\n startTimestamp: Date.now(),\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nfunction parseUrl(url: string | unknown): string | undefined {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url as URL).toString();\n } catch {} // eslint-disable-line no-empty\n\n return undefined;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { ParameterizedString, PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isParameterizedString(wat: unknown): wat is ParameterizedString {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\ninterface VueViewModel {\n // Vue3\n __isVue?: boolean;\n // Vue2\n _isVue?: boolean;\n}\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isVueViewModel(wat: unknown): boolean {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat as VueViewModel).__isVue || (wat as VueViewModel)._isVue));\n}\n","import type { ConsoleLevel } from '@sentry/types';\n\nimport { DEBUG_BUILD } from './debug-build';\nimport { GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS: readonly ConsoleLevel[] = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] as const;\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record;\n\n/** This may be mutated by the console instrumentation. */\nexport const originalConsoleMethods: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key in ConsoleLevel]?: (...args: any[]) => void;\n} = {};\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n disable(): void;\n enable(): void;\n isEnabled(): boolean;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox(callback: () => T): T {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console as Console;\n const wrappedFuncs: Partial = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) as ConsoleLevel[];\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] as LoggerMethod;\n wrappedFuncs[level] = console[level] as LoggerMethod | undefined;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] as LoggerMethod;\n });\n }\n}\n\nfunction makeLogger(): Logger {\n let enabled = false;\n const logger: Partial = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args: any[]) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger as Logger;\n}\n\nexport const logger = makeLogger();\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n getRandomValues(array: Uint8Array): Uint8Array;\n randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n msCrypto?: CryptoInternal;\n crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = (): number => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '';\n }\n return eventId || '';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial): void {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception as any).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify(maybeArray: T | T[]): T[] {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\nimport { isBrowserBundle } from './env';\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n // explicitly check for browser bundles as those can be optimized statically\n // by terser/rollup.\n return (\n !isBrowserBundle() &&\n Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function dynamicRequire(mod: any, request: string): any {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nexport function loadModule(moduleName: string): T | undefined {\n let mod: T | undefined;\n\n try {\n mod = dynamicRequire(module, moduleName);\n } catch (e) {\n // no-empty\n }\n\n try {\n const { cwd } = dynamicRequire(module, 'process');\n mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;\n } catch (e) {\n // no-empty\n }\n\n return mod;\n}\n","import type { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent, isVueViewModel } from './is';\nimport type { MemoFunc } from './memo';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = 100, maxProperties: number = +Infinity): any {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nexport function normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key: string,\n value: unknown,\n depth: number = +Infinity,\n maxProperties: number = +Infinity,\n memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))\n ) {\n return value as Primitive;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value as ObjOrArray)['__sentry_skip_normalization__']) {\n return value as ObjOrArray;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value as ObjOrArray)['__sentry_override_normalization_depth__'] === 'number'\n ? ((value as ObjOrArray)['__sentry_override_normalization_depth__'] as number)\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value as ObjOrArray);\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/**\n * @deprecated This export will be removed in v8.\n */\nexport { visit as walk };\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key: unknown,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value: Exclude,\n): string {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value: unknown): string {\n const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nexport function normalizeUrlToBase(url: string, basePath: string): string {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n // memoize\n (obj: any) => boolean,\n // unmemoize\n (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner: any = hasWeakSet ? new WeakSet() : [];\n function memoize(obj: any): boolean {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj: any): void {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n","/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { DEBUG_BUILD } from './debug-build';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { logger } from './logger';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacementFactory(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: object, name: string, value: unknown): void {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nexport function convertToPlainObject(\n value: V,\n):\n | {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n }\n | {\n [ownProps: string]: unknown;\n message: string;\n name: string;\n stack?: string;\n }\n | V {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj: {\n [ownProps: string]: unknown;\n type: string;\n target: string;\n currentTarget: string;\n detail?: unknown;\n } = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps: { [key: string]: unknown } = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj as Record)[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record, maxLength: number = 40): string {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys(inputValue: T): T {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue: T, memoizationMap: Map): T {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: { [key: string]: any } = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue as T;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal as T;\n }\n\n const returnValue: unknown[] = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item: unknown) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue as unknown as T;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input: unknown): input is Record {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) as { constructor: { name: string } }).constructor.name;\n return !name || name === 'Object';\n } catch {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat as any).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n","import type { DataCategory, TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, dataCategory: DataCategory): number {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, dataCategory: DataCategory, now: number = Date.now()): boolean {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n limits: RateLimits,\n { statusCode, headers }: TransportMakeRequestResponse,\n now: number = Date.now(),\n): RateLimits {\n const updatedRateLimits: RateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n *
    ,
    ,..\n * where each
    is of the form\n * : : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories, , , namespaces] = limit.split(':', 5);\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when category === 'metric_bucket'\n if (!namespaces || namespaces.split(';').includes('custom')) {\n updatedRateLimits[category] = now + delay;\n }\n } else {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n","import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';\n\nimport type { GetModuleFn } from './node-stack-trace';\nimport { filenameIsInApp, node } from './node-stack-trace';\n\nexport { filenameIsInApp };\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack: string, skipFirst: number = 0): StackFrame[] => {\n const frames: StackFrame[] = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirst; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: ReadonlyArray): StackFrame[] {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || '?',\n }));\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n return [90, node(getModule)];\n}\n","import { isRegExp, isString, isVueViewModel } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n value: string,\n pattern: RegExp | string,\n requireExactStringMatch: boolean = false,\n): boolean {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n testString: string,\n patterns: Array = [],\n requireExactStringMatch: boolean = false,\n): boolean {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n","import { DEBUG_BUILD } from './debug-build';\nimport { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\ndeclare const EdgeRuntime: string | undefined;\n\nexport { supportsHistory } from './vendor/supportsHistory';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement as unknown) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' as ReferrerPolicy,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n /** Pending */\n PENDING = 0,\n /** Resolved / OK */\n RESOLVED = 1,\n /** Rejected / Error */\n REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike;\nexport function resolvedSyncPromise(value: T | PromiseLike): PromiseLike;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise(value?: T | PromiseLike): PromiseLike {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise(reason?: any): PromiseLike {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise implements PromiseLike {\n private _state: States;\n private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]>;\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike | null) => void, reject: (reason?: any) => void) => void,\n ) {\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public then(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike) | null,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n public catch(\n onrejected?: ((reason: any) => TResult | PromiseLike) | null,\n ): PromiseLike {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n public finally(onfinally?: (() => void) | null): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let val: TResult | any;\n let isRejected: boolean;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val as unknown as any);\n });\n });\n }\n\n /** JSDoc */\n private readonly _resolve = (value?: T | PromiseLike | null) => {\n this._setResult(States.RESOLVED, value);\n };\n\n /** JSDoc */\n private readonly _reject = (reason?: any) => {\n this._setResult(States.REJECTED, reason);\n };\n\n /** JSDoc */\n private readonly _setResult = (state: States, value?: T | PromiseLike | any) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value as PromiseLike).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };\n\n /** JSDoc */\n private readonly _executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](this._value as unknown as any);\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };\n}\n\nexport { SyncPromise };\n","import { GLOBAL_OBJ } from './worldwide';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n /**\n * The millisecond timestamp at which measurement began, measured in Unix time.\n */\n timeOrigin: number;\n /**\n * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n */\n now(): number;\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nexport function dateTimestampInSeconds(): number {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc(): () => number {\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & { performance?: Performance };\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n","import type { PropagationContext, TraceparentData } from '@sentry/types';\n\nimport { baggageHeaderToDynamicSamplingContext } from './baggage';\nimport { uuid4 } from './misc';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here\nexport const TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent?: string): TraceparentData | undefined {\n if (!traceparent) {\n return undefined;\n }\n\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (!matches) {\n return undefined;\n }\n\n let parentSampled: boolean | undefined;\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled,\n parentSpanId: matches[2],\n };\n}\n\n/**\n * Create tracing context from incoming headers.\n *\n * @deprecated Use `propagationContextFromHeaders` instead.\n */\n// TODO(v8): Remove this function\nexport function tracingContextFromHeaders(\n sentryTrace: Parameters[0],\n baggage: Parameters[0],\n): {\n traceparentData: ReturnType;\n dynamicSamplingContext: ReturnType;\n propagationContext: PropagationContext;\n} {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceparentData,\n dynamicSamplingContext: undefined,\n propagationContext: {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n },\n };\n } else {\n return {\n traceparentData,\n dynamicSamplingContext: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n propagationContext: {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n },\n };\n }\n}\n\n/**\n * Create a propagation context from incoming headers.\n */\nexport function propagationContextFromHeaders(\n sentryTrace: string | undefined,\n baggage: string | number | boolean | string[] | null | undefined,\n): PropagationContext {\n const traceparentData = extractTraceparentData(sentryTrace);\n const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n if (!traceparentData) {\n return {\n traceId: traceId || uuid4(),\n spanId: uuid4().substring(16),\n };\n } else {\n return {\n traceId: traceId || uuid4(),\n parentSpanId: parentSpanId || uuid4().substring(16),\n spanId: uuid4().substring(16),\n sampled: parentSampled,\n dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n };\n }\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nexport function generateSentryTraceHeader(\n traceId: string = uuid4(),\n spanId: string = uuid4().substring(16),\n sampled?: boolean,\n): string {\n let sampledString = '';\n if (sampled !== undefined) {\n sampledString = sampled ? '-1' : '-0';\n }\n return `${traceId}-${spanId}${sampledString}`;\n}\n","type PartialURL = {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n search?: string;\n hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Integration } from '@sentry/types';\n\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions */\nexport interface InternalGlobal {\n navigator?: { userAgent?: string };\n console: Console;\n Sentry?: {\n Integrations?: Integration[];\n };\n onerror?: {\n (event: object | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n onunhandledrejection?: {\n (event: unknown): boolean;\n __SENTRY_INSTRUMENTED__?: true;\n __SENTRY_LOADER__?: true;\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n SENTRY_SDK_SOURCE?: SdkSource;\n /**\n * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n * file.\n */\n _sentryDebugIds?: Record;\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n extensions?: {\n /** Extension methods for the hub, which are bound to the current Hub instance */\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function;\n };\n };\n /**\n * Raw module metadata that is injected by bundler plugins.\n *\n * Keys are `error.stack` strings, values are the metadata.\n */\n _sentryModuleMetadata?: Record;\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n // eslint-disable-next-line no-restricted-globals\n (typeof window == 'object' && isGlobalObj(window)) ||\n (typeof self == 'object' && isGlobalObj(self)) ||\n (typeof global == 'object' && isGlobalObj(global)) ||\n (function (this: any) {\n return this;\n })() ||\n {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject(): T & InternalGlobal {\n return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}\n","import { tuple } from './type';\nexport var PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');\n// eslint-disable-next-line import/prefer-default-export\nexport var PresetColorTypes = tuple('pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime');","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { detectFlexGapSupported } from '../styleChecker';\nexport default (function () {\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n flexible = _React$useState2[0],\n setFlexible = _React$useState2[1];\n React.useEffect(function () {\n setFlexible(detectFlexGapSupported());\n }, []);\n return flexible;\n});","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function useForceUpdate() {\n var _React$useReducer = React.useReducer(function (x) {\n return x + 1;\n }, 0),\n _React$useReducer2 = _slicedToArray(_React$useReducer, 2),\n forceUpdate = _React$useReducer2[1];\n return forceUpdate;\n}","import { tuple } from './type';\n// ================== Collapse Motion ==================\nvar getCollapsedHeight = function getCollapsedHeight() {\n return {\n height: 0,\n opacity: 0\n };\n};\nvar getRealHeight = function getRealHeight(node) {\n var scrollHeight = node.scrollHeight;\n return {\n height: scrollHeight,\n opacity: 1\n };\n};\nvar getCurrentHeight = function getCurrentHeight(node) {\n return {\n height: node ? node.offsetHeight : 0\n };\n};\nvar skipOpacityTransition = function skipOpacityTransition(_, event) {\n return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';\n};\nvar collapseMotion = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n onAppearEnd: skipOpacityTransition,\n onEnterEnd: skipOpacityTransition,\n onLeaveEnd: skipOpacityTransition,\n motionDeadline: 500\n};\nvar SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');\nvar getTransitionDirection = function getTransitionDirection(placement) {\n if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {\n return \"slide-down\";\n }\n return \"slide-up\";\n};\nvar getTransitionName = function getTransitionName(rootPrefixCls, motion, transitionName) {\n if (transitionName !== undefined) {\n return transitionName;\n }\n return \"\".concat(rootPrefixCls, \"-\").concat(motion);\n};\nexport { getTransitionName, getTransitionDirection };\nexport default collapseMotion;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { placements } from \"rc-tooltip/es/placements\";\nvar autoAdjustOverflowEnabled = {\n adjustX: 1,\n adjustY: 1\n};\nvar autoAdjustOverflowDisabled = {\n adjustX: 0,\n adjustY: 0\n};\nvar targetOffset = [0, 0];\nexport function getOverflowOptions(autoAdjustOverflow) {\n if (typeof autoAdjustOverflow === 'boolean') {\n return autoAdjustOverflow ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled;\n }\n return _extends(_extends({}, autoAdjustOverflowDisabled), autoAdjustOverflow);\n}\nexport default function getPlacements(config) {\n var _config$arrowWidth = config.arrowWidth,\n arrowWidth = _config$arrowWidth === void 0 ? 4 : _config$arrowWidth,\n _config$horizontalArr = config.horizontalArrowShift,\n horizontalArrowShift = _config$horizontalArr === void 0 ? 16 : _config$horizontalArr,\n _config$verticalArrow = config.verticalArrowShift,\n verticalArrowShift = _config$verticalArrow === void 0 ? 8 : _config$verticalArrow,\n autoAdjustOverflow = config.autoAdjustOverflow,\n arrowPointAtCenter = config.arrowPointAtCenter;\n var placementMap = {\n left: {\n points: ['cr', 'cl'],\n offset: [-4, 0]\n },\n right: {\n points: ['cl', 'cr'],\n offset: [4, 0]\n },\n top: {\n points: ['bc', 'tc'],\n offset: [0, -4]\n },\n bottom: {\n points: ['tc', 'bc'],\n offset: [0, 4]\n },\n topLeft: {\n points: ['bl', 'tc'],\n offset: [-(horizontalArrowShift + arrowWidth), -4]\n },\n leftTop: {\n points: ['tr', 'cl'],\n offset: [-4, -(verticalArrowShift + arrowWidth)]\n },\n topRight: {\n points: ['br', 'tc'],\n offset: [horizontalArrowShift + arrowWidth, -4]\n },\n rightTop: {\n points: ['tl', 'cr'],\n offset: [4, -(verticalArrowShift + arrowWidth)]\n },\n bottomRight: {\n points: ['tr', 'bc'],\n offset: [horizontalArrowShift + arrowWidth, 4]\n },\n rightBottom: {\n points: ['bl', 'cr'],\n offset: [4, verticalArrowShift + arrowWidth]\n },\n bottomLeft: {\n points: ['tl', 'bc'],\n offset: [-(horizontalArrowShift + arrowWidth), 4]\n },\n leftBottom: {\n points: ['br', 'cl'],\n offset: [-4, verticalArrowShift + arrowWidth]\n }\n };\n Object.keys(placementMap).forEach(function (key) {\n placementMap[key] = arrowPointAtCenter ? _extends(_extends({}, placementMap[key]), {\n overflow: getOverflowOptions(autoAdjustOverflow),\n targetOffset: targetOffset\n }) : _extends(_extends({}, placements[key]), {\n overflow: getOverflowOptions(autoAdjustOverflow)\n });\n placementMap[key].ignoreShake = true;\n });\n return placementMap;\n}","import * as React from 'react';\nvar isValidElement = React.isValidElement;\nexport { isValidElement };\nexport function isFragment(child) {\n return child && isValidElement(child) && child.type === React.Fragment;\n}\nexport function replaceElement(element, replacement, props) {\n if (!isValidElement(element)) {\n return replacement;\n }\n return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);\n}\nexport function cloneElement(element, props) {\n return replaceElement(element, element, props);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nexport var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\nexport var responsiveMap = {\n xs: '(max-width: 575px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n xxl: '(min-width: 1600px)'\n};\nvar subscribers = new Map();\nvar subUid = -1;\nvar screens = {};\nvar responsiveObserve = {\n matchHandlers: {},\n dispatch: function dispatch(pointMap) {\n screens = pointMap;\n subscribers.forEach(function (func) {\n return func(screens);\n });\n return subscribers.size >= 1;\n },\n subscribe: function subscribe(func) {\n if (!subscribers.size) this.register();\n subUid += 1;\n subscribers.set(subUid, func);\n func(screens);\n return subUid;\n },\n unsubscribe: function unsubscribe(token) {\n subscribers[\"delete\"](token);\n if (!subscribers.size) this.unregister();\n },\n unregister: function unregister() {\n var _this = this;\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n var handler = _this.matchHandlers[matchMediaQuery];\n handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);\n });\n subscribers.clear();\n },\n register: function register() {\n var _this2 = this;\n Object.keys(responsiveMap).forEach(function (screen) {\n var matchMediaQuery = responsiveMap[screen];\n var listener = function listener(_ref) {\n var matches = _ref.matches;\n _this2.dispatch(_extends(_extends({}, screens), _defineProperty({}, screen, matches)));\n };\n var mql = window.matchMedia(matchMediaQuery);\n mql.addListener(listener);\n _this2.matchHandlers[matchMediaQuery] = {\n mql: mql,\n listener: listener\n };\n listener(mql);\n });\n }\n};\nexport default responsiveObserve;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport { tuple } from './type';\nvar InputStatuses = tuple('warning', 'error', '');\nexport function getStatusClassNames(prefixCls, status, hasFeedback) {\n return classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-status-success\"), status === 'success'), \"\".concat(prefixCls, \"-status-warning\"), status === 'warning'), \"\".concat(prefixCls, \"-status-error\"), status === 'error'), \"\".concat(prefixCls, \"-status-validating\"), status === 'validating'), \"\".concat(prefixCls, \"-has-feedback\"), hasFeedback));\n}\nexport var getMergedStatus = function getMergedStatus(contextStatus, customStatus) {\n return customStatus || contextStatus;\n};","import canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { isStyleSupport } from \"rc-util/es/Dom/styleChecker\";\nexport var canUseDocElement = function canUseDocElement() {\n return canUseDom() && window.document.documentElement;\n};\nexport { isStyleSupport };\nvar flexGapSupported;\nexport var detectFlexGapSupported = function detectFlexGapSupported() {\n if (!canUseDocElement()) {\n return false;\n }\n if (flexGapSupported !== undefined) {\n return flexGapSupported;\n }\n // create flex container with row-gap set\n var flex = document.createElement('div');\n flex.style.display = 'flex';\n flex.style.flexDirection = 'column';\n flex.style.rowGap = '1px';\n // create two, elements inside it\n flex.appendChild(document.createElement('div'));\n flex.appendChild(document.createElement('div'));\n // append to the DOM (needed to obtain scrollHeight)\n document.body.appendChild(flex);\n flexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap\n document.body.removeChild(flex);\n return flexGapSupported;\n};","// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead\nexport var tuple = function tuple() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return args;\n};\nexport var tupleNum = function tupleNum() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return args;\n};","import raf from \"rc-util/es/raf\";\nvar id = 0;\nvar ids = {};\n// Support call raf with delay specified frame\nexport default function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n function internalCallback() {\n restFrames -= 1;\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf(internalCallback);\n }\n }\n ids[myId] = raf(internalCallback);\n return myId;\n}\nwrapperRaf.cancel = function cancel(pid) {\n if (pid === undefined) return;\n raf.cancel(ids[pid]);\n delete ids[pid];\n};\nwrapperRaf.ids = ids; // export this for test usage","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { ConfigConsumer, ConfigContext } from '../config-provider';\nimport raf from './raf';\nimport { cloneElement } from './reactNode';\nvar styleForPseudo;\n// Where el is the DOM element you'd like to test for visibility\nfunction isHidden(element) {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n return !element || element.offsetParent === null || element.hidden;\n}\nfunction getValidateContainer(nodeRoot) {\n if (nodeRoot instanceof Document) {\n return nodeRoot.body;\n }\n return Array.from(nodeRoot.childNodes).find(function (ele) {\n return (ele === null || ele === void 0 ? void 0 : ele.nodeType) === Node.ELEMENT_NODE;\n });\n}\nfunction isNotGrey(color) {\n // eslint-disable-next-line no-useless-escape\n var match = (color || '').match(/rgba?\\((\\d*), (\\d*), (\\d*)(, [\\d.]*)?\\)/);\n if (match && match[1] && match[2] && match[3]) {\n return !(match[1] === match[2] && match[2] === match[3]);\n }\n return true;\n}\nvar Wave = /*#__PURE__*/function (_React$Component) {\n _inherits(Wave, _React$Component);\n function Wave() {\n var _this;\n _classCallCheck(this, Wave);\n _this = _callSuper(this, Wave, arguments);\n _this.containerRef = /*#__PURE__*/React.createRef();\n _this.animationStart = false;\n _this.destroyed = false;\n _this.onClick = function (node, waveColor) {\n var _a, _b;\n var _this$props = _this.props,\n insertExtraNode = _this$props.insertExtraNode,\n disabled = _this$props.disabled;\n if (disabled || !node || isHidden(node) || node.className.includes('-leave')) {\n return;\n }\n _this.extraNode = document.createElement('div');\n var _assertThisInitialize = _assertThisInitialized(_this),\n extraNode = _assertThisInitialize.extraNode;\n var getPrefixCls = _this.context.getPrefixCls;\n extraNode.className = \"\".concat(getPrefixCls(''), \"-click-animating-node\");\n var attributeName = _this.getAttributeName();\n node.setAttribute(attributeName, 'true');\n // Not white or transparent or grey\n if (waveColor && waveColor !== '#fff' && waveColor !== '#ffffff' && waveColor !== 'rgb(255, 255, 255)' && waveColor !== 'rgba(255, 255, 255, 1)' && isNotGrey(waveColor) && !/rgba\\((?:\\d*, ){3}0\\)/.test(waveColor) &&\n // any transparent rgba color\n waveColor !== 'transparent') {\n extraNode.style.borderColor = waveColor;\n var nodeRoot = ((_a = node.getRootNode) === null || _a === void 0 ? void 0 : _a.call(node)) || node.ownerDocument;\n var nodeBody = (_b = getValidateContainer(nodeRoot)) !== null && _b !== void 0 ? _b : nodeRoot;\n styleForPseudo = updateCSS(\"\\n [\".concat(getPrefixCls(''), \"-click-animating-without-extra-node='true']::after, .\").concat(getPrefixCls(''), \"-click-animating-node {\\n --antd-wave-shadow-color: \").concat(waveColor, \";\\n }\"), 'antd-wave', {\n csp: _this.csp,\n attachTo: nodeBody\n });\n }\n if (insertExtraNode) {\n node.appendChild(extraNode);\n }\n ['transition', 'animation'].forEach(function (name) {\n node.addEventListener(\"\".concat(name, \"start\"), _this.onTransitionStart);\n node.addEventListener(\"\".concat(name, \"end\"), _this.onTransitionEnd);\n });\n };\n _this.onTransitionStart = function (e) {\n if (_this.destroyed) {\n return;\n }\n var node = _this.containerRef.current;\n if (!e || e.target !== node || _this.animationStart) {\n return;\n }\n _this.resetEffect(node);\n };\n _this.onTransitionEnd = function (e) {\n if (!e || e.animationName !== 'fadeEffect') {\n return;\n }\n _this.resetEffect(e.target);\n };\n _this.bindAnimationEvent = function (node) {\n if (!node || !node.getAttribute || node.getAttribute('disabled') || node.className.includes('disabled')) {\n return;\n }\n var onClick = function onClick(e) {\n // Fix radio button click twice\n if (e.target.tagName === 'INPUT' || isHidden(e.target)) {\n return;\n }\n _this.resetEffect(node);\n // Get wave color from target\n var waveColor = getComputedStyle(node).getPropertyValue('border-top-color') ||\n // Firefox Compatible\n getComputedStyle(node).getPropertyValue('border-color') || getComputedStyle(node).getPropertyValue('background-color');\n _this.clickWaveTimeoutId = window.setTimeout(function () {\n return _this.onClick(node, waveColor);\n }, 0);\n raf.cancel(_this.animationStartId);\n _this.animationStart = true;\n // Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.\n _this.animationStartId = raf(function () {\n _this.animationStart = false;\n }, 10);\n };\n node.addEventListener('click', onClick, true);\n return {\n cancel: function cancel() {\n node.removeEventListener('click', onClick, true);\n }\n };\n };\n _this.renderWave = function (_ref) {\n var csp = _ref.csp;\n var children = _this.props.children;\n _this.csp = csp;\n if (! /*#__PURE__*/React.isValidElement(children)) return children;\n var ref = _this.containerRef;\n if (supportRef(children)) {\n ref = composeRef(children.ref, _this.containerRef);\n }\n return cloneElement(children, {\n ref: ref\n });\n };\n return _this;\n }\n _createClass(Wave, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.destroyed = false;\n var node = this.containerRef.current;\n if (!node || node.nodeType !== 1) {\n return;\n }\n this.instance = this.bindAnimationEvent(node);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.instance) {\n this.instance.cancel();\n }\n if (this.clickWaveTimeoutId) {\n clearTimeout(this.clickWaveTimeoutId);\n }\n this.destroyed = true;\n }\n }, {\n key: \"getAttributeName\",\n value: function getAttributeName() {\n var getPrefixCls = this.context.getPrefixCls;\n var insertExtraNode = this.props.insertExtraNode;\n return insertExtraNode ? \"\".concat(getPrefixCls(''), \"-click-animating\") : \"\".concat(getPrefixCls(''), \"-click-animating-without-extra-node\");\n }\n }, {\n key: \"resetEffect\",\n value: function resetEffect(node) {\n var _this2 = this;\n if (!node || node === this.extraNode || !(node instanceof Element)) {\n return;\n }\n var insertExtraNode = this.props.insertExtraNode;\n var attributeName = this.getAttributeName();\n node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466\n if (styleForPseudo) {\n styleForPseudo.innerHTML = '';\n }\n if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {\n node.removeChild(this.extraNode);\n }\n ['transition', 'animation'].forEach(function (name) {\n node.removeEventListener(\"\".concat(name, \"start\"), _this2.onTransitionStart);\n node.removeEventListener(\"\".concat(name, \"end\"), _this2.onTransitionEnd);\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderWave);\n }\n }]);\n return Wave;\n}(React.Component);\nWave.contextType = ConfigContext;\nexport default Wave;","import * as React from 'react';\nvar SizeContext = /*#__PURE__*/React.createContext('default');\nexport var SizeContextProvider = function SizeContextProvider(_ref) {\n var children = _ref.children,\n size = _ref.size;\n return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (originSize) {\n return /*#__PURE__*/React.createElement(SizeContext.Provider, {\n value: size || originSize\n }, children);\n });\n};\nexport default SizeContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport { responsiveArray } from '../_util/responsiveObserve';\nimport warning from '../_util/warning';\nimport SizeContext from './SizeContext';\nvar InternalAvatar = function InternalAvatar(props, ref) {\n var groupSize = React.useContext(SizeContext);\n var _React$useState = React.useState(1),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n scale = _React$useState2[0],\n setScale = _React$useState2[1];\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n mounted = _React$useState4[0],\n setMounted = _React$useState4[1];\n var _React$useState5 = React.useState(true),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n isImgExist = _React$useState6[0],\n setIsImgExist = _React$useState6[1];\n var avatarNodeRef = React.useRef(null);\n var avatarChildrenRef = React.useRef(null);\n var avatarNodeMergeRef = composeRef(ref, avatarNodeRef);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var setScaleParam = function setScaleParam() {\n if (!avatarChildrenRef.current || !avatarNodeRef.current) {\n return;\n }\n var childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale\n var nodeWidth = avatarNodeRef.current.offsetWidth;\n // denominator is 0 is no meaning\n if (childrenWidth !== 0 && nodeWidth !== 0) {\n var _props$gap = props.gap,\n gap = _props$gap === void 0 ? 4 : _props$gap;\n if (gap * 2 < nodeWidth) {\n setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);\n }\n }\n };\n React.useEffect(function () {\n setMounted(true);\n }, []);\n React.useEffect(function () {\n setIsImgExist(true);\n setScale(1);\n }, [props.src]);\n React.useEffect(function () {\n setScaleParam();\n }, [props.gap]);\n var handleImgLoadError = function handleImgLoadError() {\n var onError = props.onError;\n var errorFlag = onError ? onError() : undefined;\n if (errorFlag !== false) {\n setIsImgExist(false);\n }\n };\n var customizePrefixCls = props.prefixCls,\n _props$shape = props.shape,\n shape = _props$shape === void 0 ? 'circle' : _props$shape,\n _props$size = props.size,\n customSize = _props$size === void 0 ? 'default' : _props$size,\n src = props.src,\n srcSet = props.srcSet,\n icon = props.icon,\n className = props.className,\n alt = props.alt,\n draggable = props.draggable,\n children = props.children,\n crossOrigin = props.crossOrigin,\n others = __rest(props, [\"prefixCls\", \"shape\", \"size\", \"src\", \"srcSet\", \"icon\", \"className\", \"alt\", \"draggable\", \"children\", \"crossOrigin\"]);\n var size = customSize === 'default' ? groupSize : customSize;\n var needResponsive = Object.keys(_typeof(size) === 'object' ? size || {} : {}).some(function (key) {\n return ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key);\n });\n var screens = useBreakpoint(needResponsive);\n var responsiveSizeStyle = React.useMemo(function () {\n if (_typeof(size) !== 'object') {\n return {};\n }\n var currentBreakpoint = responsiveArray.find(function (screen) {\n return screens[screen];\n });\n var currentSize = size[currentBreakpoint];\n return currentSize ? {\n width: currentSize,\n height: currentSize,\n lineHeight: \"\".concat(currentSize, \"px\"),\n fontSize: icon ? currentSize / 2 : 18\n } : {};\n }, [screens, size]);\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof icon === 'string' && icon.length > 2), 'Avatar', \"`icon` is using ReactNode instead of string naming in v4. Please check `\".concat(icon, \"` at https://ant.design/components/icon\")) : void 0;\n var prefixCls = getPrefixCls('avatar', customizePrefixCls);\n var sizeCls = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), size === 'large'), \"\".concat(prefixCls, \"-sm\"), size === 'small'));\n var hasImageElement = /*#__PURE__*/React.isValidElement(src);\n var classString = classNames(prefixCls, sizeCls, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(shape), !!shape), \"\".concat(prefixCls, \"-image\"), hasImageElement || src && isImgExist), \"\".concat(prefixCls, \"-icon\"), !!icon), className);\n var sizeStyle = typeof size === 'number' ? {\n width: size,\n height: size,\n lineHeight: \"\".concat(size, \"px\"),\n fontSize: icon ? size / 2 : 18\n } : {};\n var childrenToRender;\n if (typeof src === 'string' && isImgExist) {\n childrenToRender = /*#__PURE__*/React.createElement(\"img\", {\n src: src,\n draggable: draggable,\n srcSet: srcSet,\n onError: handleImgLoadError,\n alt: alt,\n crossOrigin: crossOrigin\n });\n } else if (hasImageElement) {\n childrenToRender = src;\n } else if (icon) {\n childrenToRender = icon;\n } else if (mounted || scale !== 1) {\n var transformString = \"scale(\".concat(scale, \") translateX(-50%)\");\n var childrenStyle = {\n msTransform: transformString,\n WebkitTransform: transformString,\n transform: transformString\n };\n var sizeChildrenStyle = typeof size === 'number' ? {\n lineHeight: \"\".concat(size, \"px\")\n } : {};\n childrenToRender = /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: setScaleParam\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-string\"),\n ref: avatarChildrenRef,\n style: _extends(_extends({}, sizeChildrenStyle), childrenStyle)\n }, children));\n } else {\n childrenToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-string\"),\n style: {\n opacity: 0\n },\n ref: avatarChildrenRef\n }, children);\n }\n // The event is triggered twice from bubbling up the DOM tree.\n // see https://codesandbox.io/s/kind-snow-9lidz\n delete others.onError;\n delete others.gap;\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, others, {\n style: _extends(_extends(_extends({}, sizeStyle), responsiveSizeStyle), others.style),\n className: classString,\n ref: avatarNodeMergeRef\n }), childrenToRender);\n};\nvar Avatar = /*#__PURE__*/React.forwardRef(InternalAvatar);\nif (process.env.NODE_ENV !== 'production') {\n Avatar.displayName = 'Avatar';\n}\nexport default Avatar;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport { cloneElement } from '../_util/reactNode';\nimport Avatar from './avatar';\nimport { SizeContextProvider } from './SizeContext';\nvar Group = function Group(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n maxCount = props.maxCount,\n maxStyle = props.maxStyle,\n size = props.size;\n var prefixCls = getPrefixCls('avatar-group', customizePrefixCls);\n var cls = classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n var children = props.children,\n _props$maxPopoverPlac = props.maxPopoverPlacement,\n maxPopoverPlacement = _props$maxPopoverPlac === void 0 ? 'top' : _props$maxPopoverPlac,\n _props$maxPopoverTrig = props.maxPopoverTrigger,\n maxPopoverTrigger = _props$maxPopoverTrig === void 0 ? 'hover' : _props$maxPopoverTrig;\n var childrenWithProps = toArray(children).map(function (child, index) {\n return cloneElement(child, {\n key: \"avatar-key-\".concat(index)\n });\n });\n var numOfChildren = childrenWithProps.length;\n if (maxCount && maxCount < numOfChildren) {\n var childrenShow = childrenWithProps.slice(0, maxCount);\n var childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);\n childrenShow.push( /*#__PURE__*/React.createElement(Popover, {\n key: \"avatar-popover-key\",\n content: childrenHidden,\n trigger: maxPopoverTrigger,\n placement: maxPopoverPlacement,\n overlayClassName: \"\".concat(prefixCls, \"-popover\")\n }, /*#__PURE__*/React.createElement(Avatar, {\n style: maxStyle\n }, \"+\".concat(numOfChildren - maxCount))));\n return /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: props.style\n }, childrenShow));\n }\n return /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: props.style\n }, childrenWithProps));\n};\nexport default Group;","import InternalAvatar from './avatar';\nimport Group from './group';\nexport { Group };\nvar Avatar = InternalAvatar;\nAvatar.Group = Group;\nexport default Avatar;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport warning from '../_util/warning';\nexport var GroupSizeContext = /*#__PURE__*/React.createContext(undefined);\nvar ButtonGroup = function ButtonGroup(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n size = props.size,\n className = props.className,\n others = __rest(props, [\"prefixCls\", \"size\", \"className\"]);\n var prefixCls = getPrefixCls('btn-group', customizePrefixCls);\n // large => lg\n // small => sm\n var sizeCls = '';\n switch (size) {\n case 'large':\n sizeCls = 'lg';\n break;\n case 'small':\n sizeCls = 'sm';\n break;\n case 'middle':\n case undefined:\n break;\n default:\n process.env.NODE_ENV !== \"production\" ? warning(!size, 'Button.Group', 'Invalid prop `size`.') : void 0;\n }\n var classes = classNames(prefixCls, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(sizeCls), sizeCls), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(GroupSizeContext.Provider, {\n value: size\n }, /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classes\n })));\n};\nexport default ButtonGroup;","import LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport CSSMotion from 'rc-motion';\nimport React from 'react';\nvar getCollapsedWidth = function getCollapsedWidth() {\n return {\n width: 0,\n opacity: 0,\n transform: 'scale(0)'\n };\n};\nvar getRealWidth = function getRealWidth(node) {\n return {\n width: node.scrollWidth,\n opacity: 1,\n transform: 'scale(1)'\n };\n};\nvar LoadingIcon = function LoadingIcon(_ref) {\n var prefixCls = _ref.prefixCls,\n loading = _ref.loading,\n existIcon = _ref.existIcon;\n var visible = !!loading;\n if (existIcon) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-loading-icon\")\n }, /*#__PURE__*/React.createElement(LoadingOutlined, null));\n }\n return /*#__PURE__*/React.createElement(CSSMotion, {\n visible: visible,\n // We do not really use this motionName\n motionName: \"\".concat(prefixCls, \"-loading-icon-motion\"),\n removeOnLeave: true,\n onAppearStart: getCollapsedWidth,\n onAppearActive: getRealWidth,\n onEnterStart: getCollapsedWidth,\n onEnterActive: getRealWidth,\n onLeaveStart: getRealWidth,\n onLeaveActive: getCollapsedWidth\n }, function (_ref2, ref) {\n var className = _ref2.className,\n style = _ref2.style;\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-loading-icon\"),\n style: style,\n ref: ref\n }, /*#__PURE__*/React.createElement(LoadingOutlined, {\n className: className\n }));\n });\n};\nexport default LoadingIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n/* eslint-disable react/button-has-type */\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { useCompactItemContext } from '../space/Compact';\nimport { cloneElement, isFragment } from '../_util/reactNode';\nimport { tuple } from '../_util/type';\nimport warning from '../_util/warning';\nimport Wave from '../_util/wave';\nimport Group, { GroupSizeContext } from './button-group';\nimport LoadingIcon from './LoadingIcon';\nvar rxTwoCNChar = /^[\\u4e00-\\u9fa5]{2}$/;\nvar isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);\nfunction isString(str) {\n return typeof str === 'string';\n}\nfunction isUnBorderedButtonType(type) {\n return type === 'text' || type === 'link';\n}\n// Insert one space between two chinese characters automatically.\nfunction insertSpace(child, needInserted) {\n // Check the child if is undefined or null.\n if (child === null || child === undefined) {\n return;\n }\n var SPACE = needInserted ? ' ' : '';\n // strictNullChecks oops.\n if (typeof child !== 'string' && typeof child !== 'number' && isString(child.type) && isTwoCNChar(child.props.children)) {\n return cloneElement(child, {\n children: child.props.children.split('').join(SPACE)\n });\n }\n if (typeof child === 'string') {\n return isTwoCNChar(child) ? /*#__PURE__*/React.createElement(\"span\", null, child.split('').join(SPACE)) : /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n if (isFragment(child)) {\n return /*#__PURE__*/React.createElement(\"span\", null, child);\n }\n return child;\n}\nfunction spaceChildren(children, needInserted) {\n var isPrevChildPure = false;\n var childList = [];\n React.Children.forEach(children, function (child) {\n var type = _typeof(child);\n var isCurrentChildPure = type === 'string' || type === 'number';\n if (isPrevChildPure && isCurrentChildPure) {\n var lastIndex = childList.length - 1;\n var lastChild = childList[lastIndex];\n childList[lastIndex] = \"\".concat(lastChild).concat(child);\n } else {\n childList.push(child);\n }\n isPrevChildPure = isCurrentChildPure;\n });\n // Pass to React.Children.map to auto fill key\n return React.Children.map(childList, function (child) {\n return insertSpace(child, needInserted);\n });\n}\nvar ButtonTypes = tuple('default', 'primary', 'ghost', 'dashed', 'link', 'text');\nvar ButtonShapes = tuple('default', 'circle', 'round');\nvar ButtonHTMLTypes = tuple('submit', 'button', 'reset');\nexport function convertLegacyProps(type) {\n if (type === 'danger') {\n return {\n danger: true\n };\n }\n return {\n type: type\n };\n}\nvar InternalButton = function InternalButton(props, ref) {\n var _classNames;\n var _props$loading = props.loading,\n loading = _props$loading === void 0 ? false : _props$loading,\n customizePrefixCls = props.prefixCls,\n _props$type = props.type,\n type = _props$type === void 0 ? 'default' : _props$type,\n danger = props.danger,\n _props$shape = props.shape,\n shape = _props$shape === void 0 ? 'default' : _props$shape,\n customizeSize = props.size,\n customDisabled = props.disabled,\n className = props.className,\n children = props.children,\n icon = props.icon,\n _props$ghost = props.ghost,\n ghost = _props$ghost === void 0 ? false : _props$ghost,\n _props$block = props.block,\n block = _props$block === void 0 ? false : _props$block,\n _props$htmlType = props.htmlType,\n htmlType = _props$htmlType === void 0 ? 'button' : _props$htmlType,\n rest = __rest(props, [\"loading\", \"prefixCls\", \"type\", \"danger\", \"shape\", \"size\", \"disabled\", \"className\", \"children\", \"icon\", \"ghost\", \"block\", \"htmlType\"]);\n var size = React.useContext(SizeContext);\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var groupSize = React.useContext(GroupSizeContext);\n var _React$useState = React.useState(!!loading),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerLoading = _React$useState2[0],\n setLoading = _React$useState2[1];\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n hasTwoCNChar = _React$useState4[0],\n setHasTwoCNChar = _React$useState4[1];\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n autoInsertSpaceInButton = _React$useContext.autoInsertSpaceInButton,\n direction = _React$useContext.direction;\n var buttonRef = ref || /*#__PURE__*/React.createRef();\n var isNeedInserted = function isNeedInserted() {\n return React.Children.count(children) === 1 && !icon && !isUnBorderedButtonType(type);\n };\n var fixTwoCNChar = function fixTwoCNChar() {\n // Fix for HOC usage like \n if (!buttonRef || !buttonRef.current || autoInsertSpaceInButton === false) {\n return;\n }\n var buttonText = buttonRef.current.textContent;\n if (isNeedInserted() && isTwoCNChar(buttonText)) {\n if (!hasTwoCNChar) {\n setHasTwoCNChar(true);\n }\n } else if (hasTwoCNChar) {\n setHasTwoCNChar(false);\n }\n };\n // =============== Update Loading ===============\n var loadingOrDelay = typeof loading === 'boolean' ? loading : (loading === null || loading === void 0 ? void 0 : loading.delay) || true;\n React.useEffect(function () {\n var delayTimer = null;\n if (typeof loadingOrDelay === 'number') {\n delayTimer = window.setTimeout(function () {\n delayTimer = null;\n setLoading(loadingOrDelay);\n }, loadingOrDelay);\n } else {\n setLoading(loadingOrDelay);\n }\n return function () {\n if (delayTimer) {\n // in order to not perform a React state update on an unmounted component\n // and clear timer after 'loadingOrDelay' updated.\n window.clearTimeout(delayTimer);\n delayTimer = null;\n }\n };\n }, [loadingOrDelay]);\n React.useEffect(fixTwoCNChar, [buttonRef]);\n var handleClick = function handleClick(e) {\n var onClick = props.onClick;\n // https://github.com/ant-design/ant-design/issues/30207\n if (innerLoading || mergedDisabled) {\n e.preventDefault();\n return;\n }\n onClick === null || onClick === void 0 ? void 0 : onClick(e);\n };\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof icon === 'string' && icon.length > 2), 'Button', \"`icon` is using ReactNode instead of string naming in v4. Please check `\".concat(icon, \"` at https://ant.design/components/icon\")) : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(ghost && isUnBorderedButtonType(type)), 'Button', \"`link` or `text` button can't be a `ghost` button.\") : void 0;\n var prefixCls = getPrefixCls('btn', customizePrefixCls);\n var autoInsertSpace = autoInsertSpaceInButton !== false;\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var sizeClassNameMap = {\n large: 'lg',\n small: 'sm',\n middle: undefined\n };\n var sizeFullname = compactSize || groupSize || customizeSize || size;\n var sizeCls = sizeFullname ? sizeClassNameMap[sizeFullname] || '' : '';\n var iconType = innerLoading ? 'loading' : icon;\n var linkButtonRestProps = omit(rest, ['navigate']);\n var classes = classNames(prefixCls, (_classNames = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(shape), shape !== 'default' && shape), \"\".concat(prefixCls, \"-\").concat(type), type), \"\".concat(prefixCls, \"-\").concat(sizeCls), sizeCls), \"\".concat(prefixCls, \"-icon-only\"), !children && children !== 0 && !!iconType), \"\".concat(prefixCls, \"-background-ghost\"), ghost && !isUnBorderedButtonType(type)), \"\".concat(prefixCls, \"-loading\"), innerLoading), \"\".concat(prefixCls, \"-two-chinese-chars\"), hasTwoCNChar && autoInsertSpace && !innerLoading), \"\".concat(prefixCls, \"-block\"), block), \"\".concat(prefixCls, \"-dangerous\"), !!danger), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), linkButtonRestProps.href !== undefined && mergedDisabled)), compactItemClassnames, className);\n var iconNode = icon && !innerLoading ? icon : ( /*#__PURE__*/React.createElement(LoadingIcon, {\n existIcon: !!icon,\n prefixCls: prefixCls,\n loading: !!innerLoading\n }));\n var kids = children || children === 0 ? spaceChildren(children, isNeedInserted() && autoInsertSpace) : null;\n if (linkButtonRestProps.href !== undefined) {\n return /*#__PURE__*/React.createElement(\"a\", _extends({}, linkButtonRestProps, {\n className: classes,\n onClick: handleClick,\n ref: buttonRef\n }), iconNode, kids);\n }\n var buttonNode = /*#__PURE__*/React.createElement(\"button\", _extends({}, rest, {\n type: htmlType,\n className: classes,\n onClick: handleClick,\n disabled: mergedDisabled,\n ref: buttonRef\n }), iconNode, kids);\n if (isUnBorderedButtonType(type)) {\n return buttonNode;\n }\n return /*#__PURE__*/React.createElement(Wave, {\n disabled: !!innerLoading\n }, buttonNode);\n};\nvar Button = /*#__PURE__*/React.forwardRef(InternalButton);\nif (process.env.NODE_ENV !== 'production') {\n Button.displayName = 'Button';\n}\nButton.Group = Group;\nButton.__ANT_BUTTON = true;\nexport default Button;","import Button from './button';\nexport default Button;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigConsumer } from '../config-provider';\nvar Grid = function Grid(_a) {\n var prefixCls = _a.prefixCls,\n className = _a.className,\n _a$hoverable = _a.hoverable,\n hoverable = _a$hoverable === void 0 ? true : _a$hoverable,\n props = __rest(_a, [\"prefixCls\", \"className\", \"hoverable\"]);\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var prefix = getPrefixCls('card', prefixCls);\n var classString = classNames(\"\".concat(prefix, \"-grid\"), className, _defineProperty({}, \"\".concat(prefix, \"-grid-hoverable\"), hoverable));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, props, {\n className: classString\n }));\n });\n};\nexport default Grid;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\nimport Skeleton from '../skeleton';\nimport Tabs from '../tabs';\nimport Grid from './Grid';\nfunction getAction(actions) {\n var actionList = actions.map(function (action, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n style: {\n width: \"\".concat(100 / actions.length, \"%\")\n },\n key: \"action-\".concat(index)\n }, /*#__PURE__*/React.createElement(\"span\", null, action))\n );\n });\n return actionList;\n}\nvar Card = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var size = React.useContext(SizeContext);\n var onTabChange = function onTabChange(key) {\n var _a;\n (_a = props.onTabChange) === null || _a === void 0 ? void 0 : _a.call(props, key);\n };\n var isContainGrid = function isContainGrid() {\n var containGrid;\n React.Children.forEach(props.children, function (element) {\n if (element && element.type && element.type === Grid) {\n containGrid = true;\n }\n });\n return containGrid;\n };\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n extra = props.extra,\n _props$headStyle = props.headStyle,\n headStyle = _props$headStyle === void 0 ? {} : _props$headStyle,\n _props$bodyStyle = props.bodyStyle,\n bodyStyle = _props$bodyStyle === void 0 ? {} : _props$bodyStyle,\n title = props.title,\n loading = props.loading,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n customizeSize = props.size,\n type = props.type,\n cover = props.cover,\n actions = props.actions,\n tabList = props.tabList,\n children = props.children,\n activeTabKey = props.activeTabKey,\n defaultActiveTabKey = props.defaultActiveTabKey,\n tabBarExtraContent = props.tabBarExtraContent,\n hoverable = props.hoverable,\n _props$tabProps = props.tabProps,\n tabProps = _props$tabProps === void 0 ? {} : _props$tabProps,\n others = __rest(props, [\"prefixCls\", \"className\", \"extra\", \"headStyle\", \"bodyStyle\", \"title\", \"loading\", \"bordered\", \"size\", \"type\", \"cover\", \"actions\", \"tabList\", \"children\", \"activeTabKey\", \"defaultActiveTabKey\", \"tabBarExtraContent\", \"hoverable\", \"tabProps\"]);\n var prefixCls = getPrefixCls('card', customizePrefixCls);\n var loadingBlock = /*#__PURE__*/React.createElement(Skeleton, {\n loading: true,\n active: true,\n paragraph: {\n rows: 4\n },\n title: false\n }, children);\n var hasActiveTabKey = activeTabKey !== undefined;\n var extraProps = _extends(_extends({}, tabProps), _defineProperty(_defineProperty({}, hasActiveTabKey ? 'activeKey' : 'defaultActiveKey', hasActiveTabKey ? activeTabKey : defaultActiveTabKey), \"tabBarExtraContent\", tabBarExtraContent));\n var head;\n var tabs = tabList && tabList.length ? ( /*#__PURE__*/React.createElement(Tabs, _extends({\n size: \"large\"\n }, extraProps, {\n className: \"\".concat(prefixCls, \"-head-tabs\"),\n onChange: onTabChange,\n items: tabList.map(function (item) {\n var _a;\n return {\n label: item.tab,\n key: item.key,\n disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : false\n };\n })\n }))) : null;\n if (title || extra || tabs) {\n head = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head\"),\n style: headStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-wrapper\")\n }, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-head-title\")\n }, title), extra && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), tabs);\n }\n var coverDom = cover ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-cover\")\n }, cover) : null;\n var body = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\"),\n style: bodyStyle\n }, loading ? loadingBlock : children);\n var actionDom = actions && actions.length ? ( /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-actions\")\n }, getAction(actions))) : null;\n var divProps = omit(others, ['onTabChange']);\n var mergedSize = customizeSize || size;\n var classString = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-loading\"), loading), \"\".concat(prefixCls, \"-bordered\"), bordered), \"\".concat(prefixCls, \"-hoverable\"), hoverable), \"\".concat(prefixCls, \"-contain-grid\"), isContainGrid()), \"\".concat(prefixCls, \"-contain-tabs\"), tabList && tabList.length), \"\".concat(prefixCls, \"-\").concat(mergedSize), mergedSize), \"\".concat(prefixCls, \"-type-\").concat(type), !!type), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, divProps, {\n className: classString\n }), head, coverDom, body, actionDom);\n});\nexport default Card;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigConsumer } from '../config-provider';\nvar Meta = function Meta(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n avatar = props.avatar,\n title = props.title,\n description = props.description,\n others = __rest(props, [\"prefixCls\", \"className\", \"avatar\", \"title\", \"description\"]);\n var prefixCls = getPrefixCls('card', customizePrefixCls);\n var classString = classNames(\"\".concat(prefixCls, \"-meta\"), className);\n var avatarDom = avatar ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-meta-avatar\")\n }, avatar) : null;\n var titleDom = title ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-meta-title\")\n }, title) : null;\n var descriptionDom = description ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-meta-description\")\n }, description)) : null;\n var MetaDetail = titleDom || descriptionDom ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-meta-detail\")\n }, titleDom, descriptionDom)) : null;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classString\n }), avatarDom, MetaDetail);\n });\n};\nexport default Meta;","import InternalCard from './Card';\nimport Grid from './Grid';\nimport Meta from './Meta';\nvar Card = InternalCard;\nCard.Grid = Grid;\nCard.Meta = Meta;\nexport default Card;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Checkbox from './Checkbox';\nexport var GroupContext = /*#__PURE__*/React.createContext(null);\nvar InternalCheckboxGroup = function InternalCheckboxGroup(_a, ref) {\n var defaultValue = _a.defaultValue,\n children = _a.children,\n _a$options = _a.options,\n options = _a$options === void 0 ? [] : _a$options,\n customizePrefixCls = _a.prefixCls,\n className = _a.className,\n style = _a.style,\n onChange = _a.onChange,\n restProps = __rest(_a, [\"defaultValue\", \"children\", \"options\", \"prefixCls\", \"className\", \"style\", \"onChange\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var _React$useState = React.useState(restProps.value || defaultValue || []),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n value = _React$useState2[0],\n setValue = _React$useState2[1];\n var _React$useState3 = React.useState([]),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n registeredValues = _React$useState4[0],\n setRegisteredValues = _React$useState4[1];\n React.useEffect(function () {\n if ('value' in restProps) {\n setValue(restProps.value || []);\n }\n }, [restProps.value]);\n var getOptions = function getOptions() {\n return options.map(function (option) {\n if (typeof option === 'string' || typeof option === 'number') {\n return {\n label: option,\n value: option\n };\n }\n return option;\n });\n };\n var cancelValue = function cancelValue(val) {\n setRegisteredValues(function (prevValues) {\n return prevValues.filter(function (v) {\n return v !== val;\n });\n });\n };\n var registerValue = function registerValue(val) {\n setRegisteredValues(function (prevValues) {\n return [].concat(_toConsumableArray(prevValues), [val]);\n });\n };\n var toggleOption = function toggleOption(option) {\n var optionIndex = value.indexOf(option.value);\n var newValue = _toConsumableArray(value);\n if (optionIndex === -1) {\n newValue.push(option.value);\n } else {\n newValue.splice(optionIndex, 1);\n }\n if (!('value' in restProps)) {\n setValue(newValue);\n }\n var opts = getOptions();\n onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(function (val) {\n return registeredValues.includes(val);\n }).sort(function (a, b) {\n var indexA = opts.findIndex(function (opt) {\n return opt.value === a;\n });\n var indexB = opts.findIndex(function (opt) {\n return opt.value === b;\n });\n return indexA - indexB;\n }));\n };\n var prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n var domProps = omit(restProps, ['value', 'disabled']);\n if (options && options.length > 0) {\n children = getOptions().map(function (option) {\n return /*#__PURE__*/React.createElement(Checkbox, {\n prefixCls: prefixCls,\n key: option.value.toString(),\n disabled: 'disabled' in option ? option.disabled : restProps.disabled,\n value: option.value,\n checked: value.includes(option.value),\n onChange: option.onChange,\n className: \"\".concat(groupPrefixCls, \"-item\"),\n style: option.style\n }, option.label);\n });\n }\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n var context = {\n toggleOption: toggleOption,\n value: value,\n disabled: restProps.disabled,\n name: restProps.name,\n // https://github.com/ant-design/ant-design/issues/16376\n registerValue: registerValue,\n cancelValue: cancelValue\n };\n var classString = classNames(groupPrefixCls, _defineProperty({}, \"\".concat(groupPrefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString,\n style: style\n }, domProps, {\n ref: ref\n }), /*#__PURE__*/React.createElement(GroupContext.Provider, {\n value: context\n }, children));\n};\nvar CheckboxGroup = /*#__PURE__*/React.forwardRef(InternalCheckboxGroup);\nexport default /*#__PURE__*/React.memo(CheckboxGroup);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcCheckbox from 'rc-checkbox';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { FormItemInputContext } from '../form/context';\nimport warning from '../_util/warning';\nimport { GroupContext } from './Group';\nimport DisabledContext from '../config-provider/DisabledContext';\nvar InternalCheckbox = function InternalCheckbox(_a, ref) {\n var _b;\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n children = _a.children,\n _a$indeterminate = _a.indeterminate,\n indeterminate = _a$indeterminate === void 0 ? false : _a$indeterminate,\n style = _a.style,\n onMouseEnter = _a.onMouseEnter,\n onMouseLeave = _a.onMouseLeave,\n _a$skipGroup = _a.skipGroup,\n skipGroup = _a$skipGroup === void 0 ? false : _a$skipGroup,\n disabled = _a.disabled,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"children\", \"indeterminate\", \"style\", \"onMouseEnter\", \"onMouseLeave\", \"skipGroup\", \"disabled\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var checkboxGroup = React.useContext(GroupContext);\n var _useContext = useContext(FormItemInputContext),\n isFormItemInput = _useContext.isFormItemInput;\n var contextDisabled = useContext(DisabledContext);\n var mergedDisabled = (_b = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _b !== void 0 ? _b : contextDisabled;\n var prevValue = React.useRef(restProps.value);\n React.useEffect(function () {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n process.env.NODE_ENV !== \"production\" ? warning('checked' in restProps || !!checkboxGroup || !('value' in restProps), 'Checkbox', '`value` is not a valid prop, do you mean `checked`?') : void 0;\n }, []);\n React.useEffect(function () {\n if (skipGroup) {\n return;\n }\n if (restProps.value !== prevValue.current) {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n prevValue.current = restProps.value;\n }\n return function () {\n return checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);\n };\n }, [restProps.value]);\n var prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n var checkboxProps = _extends({}, restProps);\n if (checkboxGroup && !skipGroup) {\n checkboxProps.onChange = function () {\n if (restProps.onChange) {\n restProps.onChange.apply(restProps, arguments);\n }\n if (checkboxGroup.toggleOption) {\n checkboxGroup.toggleOption({\n label: children,\n value: restProps.value\n });\n }\n };\n checkboxProps.name = checkboxGroup.name;\n checkboxProps.checked = checkboxGroup.value.includes(restProps.value);\n }\n var classString = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-wrapper\"), true), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-wrapper-checked\"), checkboxProps.checked), \"\".concat(prefixCls, \"-wrapper-disabled\"), mergedDisabled), \"\".concat(prefixCls, \"-wrapper-in-form-item\"), isFormItemInput), className);\n var checkboxClass = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-indeterminate\"), indeterminate));\n var ariaChecked = indeterminate ? 'mixed' : undefined;\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n React.createElement(\"label\", {\n className: classString,\n style: style,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, /*#__PURE__*/React.createElement(RcCheckbox, _extends({\n \"aria-checked\": ariaChecked\n }, checkboxProps, {\n prefixCls: prefixCls,\n className: checkboxClass,\n disabled: mergedDisabled,\n ref: ref\n })), children !== undefined && /*#__PURE__*/React.createElement(\"span\", null, children))\n );\n};\nvar Checkbox = /*#__PURE__*/React.forwardRef(InternalCheckbox);\nif (process.env.NODE_ENV !== 'production') {\n Checkbox.displayName = 'Checkbox';\n}\nexport default Checkbox;","import InternalCheckbox from './Checkbox';\nimport Group from './Group';\nvar Checkbox = InternalCheckbox;\nCheckbox.Group = Group;\nCheckbox.__ANT_CHECKBOX = true;\nexport default Checkbox;","import { Col } from '../grid';\nexport default Col;","import * as React from 'react';\nvar DisabledContext = /*#__PURE__*/React.createContext(false);\nexport var DisabledContextProvider = function DisabledContextProvider(_ref) {\n var children = _ref.children,\n disabled = _ref.disabled;\n var originDisabled = React.useContext(DisabledContext);\n return /*#__PURE__*/React.createElement(DisabledContext.Provider, {\n value: disabled !== null && disabled !== void 0 ? disabled : originDisabled\n }, children);\n};\nexport default DisabledContext;","import * as React from 'react';\nvar SizeContext = /*#__PURE__*/React.createContext(undefined);\nexport var SizeContextProvider = function SizeContextProvider(_ref) {\n var children = _ref.children,\n size = _ref.size;\n return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (originSize) {\n return /*#__PURE__*/React.createElement(SizeContext.Provider, {\n value: size || originSize\n }, children);\n });\n};\nexport default SizeContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nvar defaultGetPrefixCls = function defaultGetPrefixCls(suffixCls, customizePrefixCls) {\n if (customizePrefixCls) return customizePrefixCls;\n return suffixCls ? \"ant-\".concat(suffixCls) : 'ant';\n};\n// zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will case circular dependency.\nexport var ConfigContext = /*#__PURE__*/React.createContext({\n // We provide a default function for Context without provider\n getPrefixCls: defaultGetPrefixCls\n});\nexport var ConfigConsumer = ConfigContext.Consumer;\n/** @deprecated Use hooks instead. This is a legacy function */\nexport function withConfigConsumer(config) {\n return function withConfigConsumerFunc(Component) {\n // Wrap with ConfigConsumer. Since we need compatible with react 15, be care when using ref methods\n var SFC = function SFC(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {\n var basicPrefixCls = config.prefixCls;\n var getPrefixCls = configProps.getPrefixCls;\n var customizePrefixCls = props.prefixCls;\n var prefixCls = getPrefixCls(basicPrefixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(Component, _extends({}, configProps, props, {\n prefixCls: prefixCls\n }));\n });\n };\n var cons = Component.constructor;\n var name = cons && cons.displayName || Component.name || 'Component';\n if (process.env.NODE_ENV !== 'production') {\n SFC.displayName = \"withConfigConsumer(\".concat(name, \")\");\n }\n return SFC;\n };\n}","import * as React from 'react';\nimport { ConfigConsumer } from '.';\nimport Empty from '../empty';\nvar defaultRenderEmpty = function defaultRenderEmpty(componentName) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var prefix = getPrefixCls('empty');\n switch (componentName) {\n case 'Table':\n case 'List':\n return /*#__PURE__*/React.createElement(Empty, {\n image: Empty.PRESENTED_IMAGE_SIMPLE\n });\n case 'Select':\n case 'TreeSelect':\n case 'Cascader':\n case 'Transfer':\n case 'Mentions':\n return /*#__PURE__*/React.createElement(Empty, {\n image: Empty.PRESENTED_IMAGE_SIMPLE,\n className: \"\".concat(prefix, \"-small\")\n });\n /* istanbul ignore next */\n default:\n // Should never hit if we take all the component into consider.\n return /*#__PURE__*/React.createElement(Empty, null);\n }\n });\n};\nexport default defaultRenderEmpty;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport warning from '../_util/warning';\nimport { changeConfirmLocale } from '../modal/locale';\nimport LocaleContext from './context';\nexport var ANT_MARK = 'internalMark';\nvar LocaleProvider = function LocaleProvider(props) {\n var _props$locale = props.locale,\n locale = _props$locale === void 0 ? {} : _props$locale,\n children = props.children,\n _ANT_MARK__ = props._ANT_MARK__;\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? warning(_ANT_MARK__ === ANT_MARK, 'LocaleProvider', '`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale') : void 0;\n }\n React.useEffect(function () {\n changeConfirmLocale(locale && locale.Modal);\n return function () {\n changeConfirmLocale();\n };\n }, [locale]);\n var getMemoizedContextValue = React.useMemo(function () {\n return _extends(_extends({}, locale), {\n exist: true\n });\n }, [locale]);\n return /*#__PURE__*/React.createElement(LocaleContext.Provider, {\n value: getMemoizedContextValue\n }, children);\n};\nexport default LocaleProvider;","/* eslint-disable import/prefer-default-export, prefer-destructuring */\nimport { generate } from '@ant-design/colors';\nimport { TinyColor } from '@ctrl/tinycolor';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nimport { updateCSS } from \"rc-util/es/Dom/dynamicCSS\";\nimport warning from '../_util/warning';\nvar dynamicStyleMark = \"-ant-\".concat(Date.now(), \"-\").concat(Math.random());\nexport function getStyle(globalPrefixCls, theme) {\n var variables = {};\n var formatColor = function formatColor(color, updater) {\n var clone = color.clone();\n clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;\n return clone.toRgbString();\n };\n var fillColor = function fillColor(colorVal, type) {\n var baseColor = new TinyColor(colorVal);\n var colorPalettes = generate(baseColor.toRgbString());\n variables[\"\".concat(type, \"-color\")] = formatColor(baseColor);\n variables[\"\".concat(type, \"-color-disabled\")] = colorPalettes[1];\n variables[\"\".concat(type, \"-color-hover\")] = colorPalettes[4];\n variables[\"\".concat(type, \"-color-active\")] = colorPalettes[6];\n variables[\"\".concat(type, \"-color-outline\")] = baseColor.clone().setAlpha(0.2).toRgbString();\n variables[\"\".concat(type, \"-color-deprecated-bg\")] = colorPalettes[0];\n variables[\"\".concat(type, \"-color-deprecated-border\")] = colorPalettes[2];\n };\n // ================ Primary Color ================\n if (theme.primaryColor) {\n fillColor(theme.primaryColor, 'primary');\n var primaryColor = new TinyColor(theme.primaryColor);\n var primaryColors = generate(primaryColor.toRgbString());\n // Legacy - We should use semantic naming standard\n primaryColors.forEach(function (color, index) {\n variables[\"primary-\".concat(index + 1)] = color;\n });\n // Deprecated\n variables['primary-color-deprecated-l-35'] = formatColor(primaryColor, function (c) {\n return c.lighten(35);\n });\n variables['primary-color-deprecated-l-20'] = formatColor(primaryColor, function (c) {\n return c.lighten(20);\n });\n variables['primary-color-deprecated-t-20'] = formatColor(primaryColor, function (c) {\n return c.tint(20);\n });\n variables['primary-color-deprecated-t-50'] = formatColor(primaryColor, function (c) {\n return c.tint(50);\n });\n variables['primary-color-deprecated-f-12'] = formatColor(primaryColor, function (c) {\n return c.setAlpha(c.getAlpha() * 0.12);\n });\n var primaryActiveColor = new TinyColor(primaryColors[0]);\n variables['primary-color-active-deprecated-f-30'] = formatColor(primaryActiveColor, function (c) {\n return c.setAlpha(c.getAlpha() * 0.3);\n });\n variables['primary-color-active-deprecated-d-02'] = formatColor(primaryActiveColor, function (c) {\n return c.darken(2);\n });\n }\n // ================ Success Color ================\n if (theme.successColor) {\n fillColor(theme.successColor, 'success');\n }\n // ================ Warning Color ================\n if (theme.warningColor) {\n fillColor(theme.warningColor, 'warning');\n }\n // ================= Error Color =================\n if (theme.errorColor) {\n fillColor(theme.errorColor, 'error');\n }\n // ================= Info Color ==================\n if (theme.infoColor) {\n fillColor(theme.infoColor, 'info');\n }\n // Convert to css variables\n var cssList = Object.keys(variables).map(function (key) {\n return \"--\".concat(globalPrefixCls, \"-\").concat(key, \": \").concat(variables[key], \";\");\n });\n return \"\\n :root {\\n \".concat(cssList.join('\\n'), \"\\n }\\n \").trim();\n}\nexport function registerTheme(globalPrefixCls, theme) {\n var style = getStyle(globalPrefixCls, theme);\n if (canUseDom()) {\n updateCSS(style, \"\".concat(dynamicStyleMark, \"-dynamic-theme\"));\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'ConfigProvider', 'SSR do not support dynamic theme with css variables.') : void 0;\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport IconContext from \"@ant-design/icons/es/components/Context\";\nimport useMemo from \"rc-util/es/hooks/useMemo\";\nimport * as React from 'react';\nimport { merge } from \"rc-util/es/utils/set\";\nimport ValidateMessagesContext from '../form/validateMessagesContext';\nimport LocaleProvider, { ANT_MARK } from '../locale-provider';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport defaultLocale from '../locale/default';\nimport message from '../message';\nimport notification from '../notification';\nimport { ConfigConsumer, ConfigContext } from './context';\nimport { registerTheme } from './cssVariables';\nimport { DisabledContextProvider } from './DisabledContext';\nimport SizeContext, { SizeContextProvider } from './SizeContext';\nexport { ConfigContext, ConfigConsumer };\nexport var configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale', 'pageHeader'];\n// These props is used by `useContext` directly in sub component\nvar PASSED_PROPS = ['getTargetContainer', 'getPopupContainer', 'renderEmpty', 'pageHeader', 'input', 'pagination', 'form'];\nexport var defaultPrefixCls = 'ant';\nexport var defaultIconPrefixCls = 'anticon';\nvar globalPrefixCls;\nvar globalIconPrefixCls;\nfunction getGlobalPrefixCls() {\n return globalPrefixCls || defaultPrefixCls;\n}\nfunction getGlobalIconPrefixCls() {\n return globalIconPrefixCls || defaultIconPrefixCls;\n}\nvar setGlobalConfig = function setGlobalConfig(_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n theme = _ref.theme;\n if (prefixCls !== undefined) {\n globalPrefixCls = prefixCls;\n }\n if (iconPrefixCls !== undefined) {\n globalIconPrefixCls = iconPrefixCls;\n }\n if (theme) {\n registerTheme(getGlobalPrefixCls(), theme);\n }\n};\nexport var globalConfig = function globalConfig() {\n return {\n getPrefixCls: function getPrefixCls(suffixCls, customizePrefixCls) {\n if (customizePrefixCls) return customizePrefixCls;\n return suffixCls ? \"\".concat(getGlobalPrefixCls(), \"-\").concat(suffixCls) : getGlobalPrefixCls();\n },\n getIconPrefixCls: getGlobalIconPrefixCls,\n getRootPrefixCls: function getRootPrefixCls(rootPrefixCls, customizePrefixCls) {\n // Customize rootPrefixCls is first priority\n if (rootPrefixCls) {\n return rootPrefixCls;\n }\n // If Global prefixCls provided, use this\n if (globalPrefixCls) {\n return globalPrefixCls;\n }\n // [Legacy] If customize prefixCls provided, we cut it to get the prefixCls\n if (customizePrefixCls && customizePrefixCls.includes('-')) {\n return customizePrefixCls.replace(/^(.*)-[^-]*$/, '$1');\n }\n // Fallback to default prefixCls\n return getGlobalPrefixCls();\n }\n };\n};\nvar ProviderChildren = function ProviderChildren(props) {\n var children = props.children,\n csp = props.csp,\n autoInsertSpaceInButton = props.autoInsertSpaceInButton,\n form = props.form,\n locale = props.locale,\n componentSize = props.componentSize,\n direction = props.direction,\n space = props.space,\n virtual = props.virtual,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n legacyLocale = props.legacyLocale,\n parentContext = props.parentContext,\n iconPrefixCls = props.iconPrefixCls,\n componentDisabled = props.componentDisabled;\n var getPrefixCls = React.useCallback(function (suffixCls, customizePrefixCls) {\n var prefixCls = props.prefixCls;\n if (customizePrefixCls) return customizePrefixCls;\n var mergedPrefixCls = prefixCls || parentContext.getPrefixCls('');\n return suffixCls ? \"\".concat(mergedPrefixCls, \"-\").concat(suffixCls) : mergedPrefixCls;\n }, [parentContext.getPrefixCls, props.prefixCls]);\n var config = _extends(_extends({}, parentContext), {\n csp: csp,\n autoInsertSpaceInButton: autoInsertSpaceInButton,\n locale: locale || legacyLocale,\n direction: direction,\n space: space,\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n getPrefixCls: getPrefixCls\n });\n // Pass the props used by `useContext` directly with child component.\n // These props should merged into `config`.\n PASSED_PROPS.forEach(function (propName) {\n var propValue = props[propName];\n if (propValue) {\n config[propName] = propValue;\n }\n });\n // https://github.com/ant-design/ant-design/issues/27617\n var memoedConfig = useMemo(function () {\n return config;\n }, config, function (prevConfig, currentConfig) {\n var prevKeys = Object.keys(prevConfig);\n var currentKeys = Object.keys(currentConfig);\n return prevKeys.length !== currentKeys.length || prevKeys.some(function (key) {\n return prevConfig[key] !== currentConfig[key];\n });\n });\n var memoIconContextValue = React.useMemo(function () {\n return {\n prefixCls: iconPrefixCls,\n csp: csp\n };\n }, [iconPrefixCls, csp]);\n var childNode = children;\n var validateMessages = React.useMemo(function () {\n var _a, _b, _c, _d;\n return merge(((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || {}, ((_c = (_b = memoedConfig.locale) === null || _b === void 0 ? void 0 : _b.Form) === null || _c === void 0 ? void 0 : _c.defaultValidateMessages) || {}, ((_d = memoedConfig.form) === null || _d === void 0 ? void 0 : _d.validateMessages) || {}, (form === null || form === void 0 ? void 0 : form.validateMessages) || {});\n }, [memoedConfig, form === null || form === void 0 ? void 0 : form.validateMessages]);\n if (Object.keys(validateMessages).length > 0) {\n childNode = /*#__PURE__*/React.createElement(ValidateMessagesContext.Provider, {\n value: validateMessages\n }, children);\n }\n if (locale) {\n childNode = /*#__PURE__*/React.createElement(LocaleProvider, {\n locale: locale,\n _ANT_MARK__: ANT_MARK\n }, childNode);\n }\n if (iconPrefixCls || csp) {\n childNode = /*#__PURE__*/React.createElement(IconContext.Provider, {\n value: memoIconContextValue\n }, childNode);\n }\n if (componentSize) {\n childNode = /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: componentSize\n }, childNode);\n }\n if (componentDisabled !== undefined) {\n childNode = /*#__PURE__*/React.createElement(DisabledContextProvider, {\n disabled: componentDisabled\n }, childNode);\n }\n return /*#__PURE__*/React.createElement(ConfigContext.Provider, {\n value: memoedConfig\n }, childNode);\n};\nvar ConfigProvider = function ConfigProvider(props) {\n React.useEffect(function () {\n if (props.direction) {\n message.config({\n rtl: props.direction === 'rtl'\n });\n notification.config({\n rtl: props.direction === 'rtl'\n });\n }\n }, [props.direction]);\n return /*#__PURE__*/React.createElement(LocaleReceiver, null, function (_, __, legacyLocale) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (context) {\n return /*#__PURE__*/React.createElement(ProviderChildren, _extends({\n parentContext: context,\n legacyLocale: legacyLocale\n }, props));\n });\n });\n};\n/** @private internal Usage. do not use in your production */\nConfigProvider.ConfigContext = ConfigContext;\nConfigProvider.SizeContext = SizeContext;\nConfigProvider.config = setGlobalConfig;\nexport default ConfigProvider;","var locale = {\n locale: 'en_US',\n today: 'Today',\n now: 'Now',\n backToToday: 'Back to today',\n ok: 'OK',\n clear: 'Clear',\n month: 'Month',\n year: 'Year',\n timeSelect: 'select time',\n dateSelect: 'select date',\n weekSelect: 'Choose a week',\n monthSelect: 'Choose a month',\n yearSelect: 'Choose a year',\n decadeSelect: 'Choose a decade',\n yearFormat: 'YYYY',\n dateFormat: 'M/D/YYYY',\n dayFormat: 'D',\n dateTimeFormat: 'M/D/YYYY HH:mm:ss',\n monthBeforeYear: true,\n previousMonth: 'Previous month (PageUp)',\n nextMonth: 'Next month (PageDown)',\n previousYear: 'Last year (Control + left)',\n nextYear: 'Next year (Control + right)',\n previousDecade: 'Last decade',\n nextDecade: 'Next decade',\n previousCentury: 'Last century',\n nextCentury: 'Next century'\n};\nexport default locale;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport CalendarLocale from \"rc-picker/es/locale/en_US\";\nimport TimePickerLocale from '../../time-picker/locale/en_US';\n// Merge into a locale object\nvar locale = {\n lang: _extends({\n placeholder: 'Select date',\n yearPlaceholder: 'Select year',\n quarterPlaceholder: 'Select quarter',\n monthPlaceholder: 'Select month',\n weekPlaceholder: 'Select week',\n rangePlaceholder: ['Start date', 'End date'],\n rangeYearPlaceholder: ['Start year', 'End year'],\n rangeQuarterPlaceholder: ['Start quarter', 'End quarter'],\n rangeMonthPlaceholder: ['Start month', 'End month'],\n rangeWeekPlaceholder: ['Start week', 'End week']\n }, CalendarLocale),\n timePickerLocale: _extends({}, TimePickerLocale)\n};\n// All settings at:\n// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json\nexport default locale;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport warning from '../_util/warning';\nvar Divider = function Divider(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$type = props.type,\n type = _props$type === void 0 ? 'horizontal' : _props$type,\n _props$orientation = props.orientation,\n orientation = _props$orientation === void 0 ? 'center' : _props$orientation,\n orientationMargin = props.orientationMargin,\n className = props.className,\n children = props.children,\n dashed = props.dashed,\n plain = props.plain,\n restProps = __rest(props, [\"prefixCls\", \"type\", \"orientation\", \"orientationMargin\", \"className\", \"children\", \"dashed\", \"plain\"]);\n var prefixCls = getPrefixCls('divider', customizePrefixCls);\n var orientationPrefix = orientation.length > 0 ? \"-\".concat(orientation) : orientation;\n var hasChildren = !!children;\n var hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;\n var hasCustomMarginRight = orientation === 'right' && orientationMargin != null;\n var classString = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(type), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-with-text\"), hasChildren), \"\".concat(prefixCls, \"-with-text\").concat(orientationPrefix), hasChildren), \"\".concat(prefixCls, \"-dashed\"), !!dashed), \"\".concat(prefixCls, \"-plain\"), !!plain), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-no-default-orientation-margin-left\"), hasCustomMarginLeft), \"\".concat(prefixCls, \"-no-default-orientation-margin-right\"), hasCustomMarginRight), className);\n var innerStyle = _extends(_extends({}, hasCustomMarginLeft && {\n marginLeft: orientationMargin\n }), hasCustomMarginRight && {\n marginRight: orientationMargin\n });\n // Warning children not work in vertical mode\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? warning(!children || type !== 'vertical', 'Divider', '`children` not working in `vertical` mode.') : void 0;\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString\n }, restProps, {\n role: \"separator\"\n }), children && type !== 'vertical' && ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-inner-text\"),\n style: innerStyle\n }, children)));\n};\nexport default Divider;","import * as React from 'react';\nvar DrawerContext = /*#__PURE__*/React.createContext(null);\nexport default DrawerContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nvar DrawerPanel = function DrawerPanel(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n children = props.children,\n containerRef = props.containerRef,\n id = props.id,\n onMouseEnter = props.onMouseEnter,\n onMouseOver = props.onMouseOver,\n onMouseLeave = props.onMouseLeave,\n onClick = props.onClick,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp;\n var eventHandlers = {\n onMouseEnter: onMouseEnter,\n onMouseOver: onMouseOver,\n onMouseLeave: onMouseLeave,\n onClick: onClick,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp\n };\n // =============================== Render ===============================\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", _extends({\n id: id,\n className: classNames(\"\".concat(prefixCls, \"-content\"), className),\n style: _objectSpread({}, style),\n \"aria-modal\": \"true\",\n role: \"dialog\",\n ref: containerRef\n }, eventHandlers), children));\n};\nif (process.env.NODE_ENV !== 'production') {\n DrawerPanel.displayName = 'DrawerPanel';\n}\nexport default DrawerPanel;","import warning from \"rc-util/es/warning\";\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nexport function parseWidthHeight(value) {\n if (typeof value === 'string' && String(Number(value)) === value) {\n warning(false, 'Invalid value type of `width` or `height` which should be number type instead.');\n return Number(value);\n }\n return value;\n}\nexport function warnCheck(props) {\n warning(!('wrapperClassName' in props), \"'wrapperClassName' is removed. Please use 'rootClassName' instead.\");\n warning(canUseDom() || !props.open, \"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.\");\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport * as React from 'react';\nimport DrawerContext from './context';\nimport DrawerPanel from './DrawerPanel';\nimport { parseWidthHeight } from './util';\nvar sentinelStyle = {\n width: 0,\n height: 0,\n overflow: 'hidden',\n outline: 'none',\n position: 'absolute'\n};\nfunction DrawerPopup(props, ref) {\n var _ref, _pushConfig$distance, _pushConfig, _classNames;\n var prefixCls = props.prefixCls,\n open = props.open,\n placement = props.placement,\n inline = props.inline,\n push = props.push,\n forceRender = props.forceRender,\n autoFocus = props.autoFocus,\n keyboard = props.keyboard,\n rootClassName = props.rootClassName,\n rootStyle = props.rootStyle,\n zIndex = props.zIndex,\n className = props.className,\n id = props.id,\n style = props.style,\n motion = props.motion,\n width = props.width,\n height = props.height,\n children = props.children,\n contentWrapperStyle = props.contentWrapperStyle,\n mask = props.mask,\n maskClosable = props.maskClosable,\n maskMotion = props.maskMotion,\n maskClassName = props.maskClassName,\n maskStyle = props.maskStyle,\n afterOpenChange = props.afterOpenChange,\n onClose = props.onClose,\n onMouseEnter = props.onMouseEnter,\n onMouseOver = props.onMouseOver,\n onMouseLeave = props.onMouseLeave,\n onClick = props.onClick,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp;\n // ================================ Refs ================================\n var panelRef = React.useRef();\n var sentinelStartRef = React.useRef();\n var sentinelEndRef = React.useRef();\n React.useImperativeHandle(ref, function () {\n return panelRef.current;\n });\n var onPanelKeyDown = function onPanelKeyDown(event) {\n var keyCode = event.keyCode,\n shiftKey = event.shiftKey;\n switch (keyCode) {\n // Tab active\n case KeyCode.TAB:\n {\n if (keyCode === KeyCode.TAB) {\n if (!shiftKey && document.activeElement === sentinelEndRef.current) {\n var _sentinelStartRef$cur;\n (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 ? void 0 : _sentinelStartRef$cur.focus({\n preventScroll: true\n });\n } else if (shiftKey && document.activeElement === sentinelStartRef.current) {\n var _sentinelEndRef$curre;\n (_sentinelEndRef$curre = sentinelEndRef.current) === null || _sentinelEndRef$curre === void 0 ? void 0 : _sentinelEndRef$curre.focus({\n preventScroll: true\n });\n }\n }\n break;\n }\n // Close\n case KeyCode.ESC:\n {\n if (onClose && keyboard) {\n event.stopPropagation();\n onClose(event);\n }\n break;\n }\n }\n };\n // ========================== Control ===========================\n // Auto Focus\n React.useEffect(function () {\n if (open && autoFocus) {\n var _panelRef$current;\n (_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 ? void 0 : _panelRef$current.focus({\n preventScroll: true\n });\n }\n }, [open]);\n // ============================ Push ============================\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n pushed = _React$useState2[0],\n setPushed = _React$useState2[1];\n var parentContext = React.useContext(DrawerContext);\n // Merge push distance\n var pushConfig;\n if (push === false) {\n pushConfig = {\n distance: 0\n };\n } else if (push === true) {\n pushConfig = {};\n } else {\n pushConfig = push || {};\n }\n var pushDistance = (_ref = (_pushConfig$distance = (_pushConfig = pushConfig) === null || _pushConfig === void 0 ? void 0 : _pushConfig.distance) !== null && _pushConfig$distance !== void 0 ? _pushConfig$distance : parentContext === null || parentContext === void 0 ? void 0 : parentContext.pushDistance) !== null && _ref !== void 0 ? _ref : 180;\n var mergedContext = React.useMemo(function () {\n return {\n pushDistance: pushDistance,\n push: function push() {\n setPushed(true);\n },\n pull: function pull() {\n setPushed(false);\n }\n };\n }, [pushDistance]);\n // ========================= ScrollLock =========================\n // Tell parent to push\n React.useEffect(function () {\n if (open) {\n var _parentContext$push;\n parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$push = parentContext.push) === null || _parentContext$push === void 0 ? void 0 : _parentContext$push.call(parentContext);\n } else {\n var _parentContext$pull;\n parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$pull = parentContext.pull) === null || _parentContext$pull === void 0 ? void 0 : _parentContext$pull.call(parentContext);\n }\n }, [open]);\n // Clean up\n React.useEffect(function () {\n return function () {\n var _parentContext$pull2;\n parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$pull2 = parentContext.pull) === null || _parentContext$pull2 === void 0 ? void 0 : _parentContext$pull2.call(parentContext);\n };\n }, []);\n // ============================ Mask ============================\n var maskNode = mask && /*#__PURE__*/React.createElement(CSSMotion, _extends({\n key: \"mask\"\n }, maskMotion, {\n visible: open\n }), function (_ref2, maskRef) {\n var motionMaskClassName = _ref2.className,\n motionMaskStyle = _ref2.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-mask\"), motionMaskClassName, maskClassName),\n style: _objectSpread(_objectSpread({}, motionMaskStyle), maskStyle),\n onClick: maskClosable && open ? onClose : undefined,\n ref: maskRef\n });\n });\n // =========================== Panel ============================\n var motionProps = typeof motion === 'function' ? motion(placement) : motion;\n var wrapperStyle = {};\n if (pushed && pushDistance) {\n switch (placement) {\n case 'top':\n wrapperStyle.transform = \"translateY(\".concat(pushDistance, \"px)\");\n break;\n case 'bottom':\n wrapperStyle.transform = \"translateY(\".concat(-pushDistance, \"px)\");\n break;\n case 'left':\n wrapperStyle.transform = \"translateX(\".concat(pushDistance, \"px)\");\n break;\n default:\n wrapperStyle.transform = \"translateX(\".concat(-pushDistance, \"px)\");\n break;\n }\n }\n if (placement === 'left' || placement === 'right') {\n wrapperStyle.width = parseWidthHeight(width);\n } else {\n wrapperStyle.height = parseWidthHeight(height);\n }\n var eventHandlers = {\n onMouseEnter: onMouseEnter,\n onMouseOver: onMouseOver,\n onMouseLeave: onMouseLeave,\n onClick: onClick,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp\n };\n var panelNode = /*#__PURE__*/React.createElement(CSSMotion, _extends({\n key: \"panel\"\n }, motionProps, {\n visible: open,\n forceRender: forceRender,\n onVisibleChanged: function onVisibleChanged(nextVisible) {\n afterOpenChange === null || afterOpenChange === void 0 ? void 0 : afterOpenChange(nextVisible);\n },\n removeOnLeave: false,\n leavedClassName: \"\".concat(prefixCls, \"-content-wrapper-hidden\")\n }), function (_ref3, motionRef) {\n var motionClassName = _ref3.className,\n motionStyle = _ref3.style;\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classNames(\"\".concat(prefixCls, \"-content-wrapper\"), motionClassName),\n style: _objectSpread(_objectSpread(_objectSpread({}, wrapperStyle), motionStyle), contentWrapperStyle)\n }, pickAttrs(props, {\n data: true\n })), /*#__PURE__*/React.createElement(DrawerPanel, _extends({\n id: id,\n containerRef: motionRef,\n prefixCls: prefixCls,\n className: className,\n style: style\n }, eventHandlers), children));\n });\n // =========================== Render ===========================\n var containerStyle = _objectSpread({}, rootStyle);\n if (zIndex) {\n containerStyle.zIndex = zIndex;\n }\n return /*#__PURE__*/React.createElement(DrawerContext.Provider, {\n value: mergedContext\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(placement), rootClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-open\"), open), _defineProperty(_classNames, \"\".concat(prefixCls, \"-inline\"), inline), _classNames)),\n style: containerStyle,\n tabIndex: -1,\n ref: panelRef,\n onKeyDown: onPanelKeyDown\n }, maskNode, /*#__PURE__*/React.createElement(\"div\", {\n tabIndex: 0,\n ref: sentinelStartRef,\n style: sentinelStyle,\n \"aria-hidden\": \"true\",\n \"data-sentinel\": \"start\"\n }), panelNode, /*#__PURE__*/React.createElement(\"div\", {\n tabIndex: 0,\n ref: sentinelEndRef,\n style: sentinelStyle,\n \"aria-hidden\": \"true\",\n \"data-sentinel\": \"end\"\n })));\n}\nvar RefDrawerPopup = /*#__PURE__*/React.forwardRef(DrawerPopup);\nif (process.env.NODE_ENV !== 'production') {\n RefDrawerPopup.displayName = 'DrawerPopup';\n}\nexport default RefDrawerPopup;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport Portal from '@rc-component/portal';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport DrawerPopup from './DrawerPopup';\nimport { warnCheck } from './util';\nvar Drawer = function Drawer(props) {\n var _props$open = props.open,\n open = _props$open === void 0 ? false : _props$open,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-drawer' : _props$prefixCls,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'right' : _props$placement,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n _props$keyboard = props.keyboard,\n keyboard = _props$keyboard === void 0 ? true : _props$keyboard,\n _props$width = props.width,\n width = _props$width === void 0 ? 378 : _props$width,\n _props$mask = props.mask,\n mask = _props$mask === void 0 ? true : _props$mask,\n _props$maskClosable = props.maskClosable,\n maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,\n getContainer = props.getContainer,\n forceRender = props.forceRender,\n afterOpenChange = props.afterOpenChange,\n destroyOnClose = props.destroyOnClose,\n onMouseEnter = props.onMouseEnter,\n onMouseOver = props.onMouseOver,\n onMouseLeave = props.onMouseLeave,\n onClick = props.onClick,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp;\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n animatedVisible = _React$useState2[0],\n setAnimatedVisible = _React$useState2[1];\n // ============================= Warn =============================\n if (process.env.NODE_ENV !== 'production') {\n warnCheck(props);\n }\n // ============================= Open =============================\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n mounted = _React$useState4[0],\n setMounted = _React$useState4[1];\n useLayoutEffect(function () {\n setMounted(true);\n }, []);\n var mergedOpen = mounted ? open : false;\n // ============================ Focus =============================\n var panelRef = React.useRef();\n var lastActiveRef = React.useRef();\n useLayoutEffect(function () {\n if (mergedOpen) {\n lastActiveRef.current = document.activeElement;\n }\n }, [mergedOpen]);\n // ============================= Open =============================\n var internalAfterOpenChange = function internalAfterOpenChange(nextVisible) {\n var _panelRef$current;\n setAnimatedVisible(nextVisible);\n afterOpenChange === null || afterOpenChange === void 0 ? void 0 : afterOpenChange(nextVisible);\n if (!nextVisible && lastActiveRef.current && !((_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 ? void 0 : _panelRef$current.contains(lastActiveRef.current))) {\n var _lastActiveRef$curren;\n (_lastActiveRef$curren = lastActiveRef.current) === null || _lastActiveRef$curren === void 0 ? void 0 : _lastActiveRef$curren.focus({\n preventScroll: true\n });\n }\n };\n // ============================ Render ============================\n if (!forceRender && !animatedVisible && !mergedOpen && destroyOnClose) {\n return null;\n }\n var eventHandlers = {\n onMouseEnter: onMouseEnter,\n onMouseOver: onMouseOver,\n onMouseLeave: onMouseLeave,\n onClick: onClick,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp\n };\n var drawerPopupProps = _objectSpread(_objectSpread({}, props), {}, {\n open: mergedOpen,\n prefixCls: prefixCls,\n placement: placement,\n autoFocus: autoFocus,\n keyboard: keyboard,\n width: width,\n mask: mask,\n maskClosable: maskClosable,\n inline: getContainer === false,\n afterOpenChange: internalAfterOpenChange,\n ref: panelRef\n }, eventHandlers);\n return /*#__PURE__*/React.createElement(Portal, {\n open: mergedOpen || forceRender || animatedVisible,\n autoDestroy: false,\n getContainer: getContainer,\n autoLock: mask && (mergedOpen || animatedVisible)\n }, /*#__PURE__*/React.createElement(DrawerPopup, drawerPopupProps));\n};\nif (process.env.NODE_ENV !== 'production') {\n Drawer.displayName = 'Drawer';\n}\nexport default Drawer;","// export this package's api\nimport Drawer from './Drawer';\nexport default Drawer;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport RcDrawer from 'rc-drawer';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { NoFormStyle } from '../form/context';\nimport { getTransitionName } from '../_util/motion';\nimport { tuple } from '../_util/type';\nimport warning from '../_util/warning';\nimport { NoCompactStyle } from '../space/Compact';\nvar SizeTypes = tuple('default', 'large');\nvar defaultPushState = {\n distance: 180\n};\nfunction Drawer(props) {\n var width = props.width,\n height = props.height,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size,\n _props$closable = props.closable,\n closable = _props$closable === void 0 ? true : _props$closable,\n _props$mask = props.mask,\n mask = _props$mask === void 0 ? true : _props$mask,\n _props$push = props.push,\n push = _props$push === void 0 ? defaultPushState : _props$push,\n _props$closeIcon = props.closeIcon,\n closeIcon = _props$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined, null) : _props$closeIcon,\n bodyStyle = props.bodyStyle,\n drawerStyle = props.drawerStyle,\n className = props.className,\n visible = props.visible,\n open = props.open,\n children = props.children,\n style = props.style,\n title = props.title,\n headerStyle = props.headerStyle,\n onClose = props.onClose,\n footer = props.footer,\n footerStyle = props.footerStyle,\n customizePrefixCls = props.prefixCls,\n customizeGetContainer = props.getContainer,\n extra = props.extra,\n afterVisibleChange = props.afterVisibleChange,\n _afterOpenChange = props.afterOpenChange,\n rest = __rest(props, [\"width\", \"height\", \"size\", \"closable\", \"mask\", \"push\", \"closeIcon\", \"bodyStyle\", \"drawerStyle\", \"className\", \"visible\", \"open\", \"children\", \"style\", \"title\", \"headerStyle\", \"onClose\", \"footer\", \"footerStyle\", \"prefixCls\", \"getContainer\", \"extra\", \"afterVisibleChange\", \"afterOpenChange\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('drawer', customizePrefixCls);\n var getContainer =\n // 有可能为 false,所以不能直接判断\n customizeGetContainer === undefined && getPopupContainer ? function () {\n return getPopupContainer(document.body);\n } : customizeGetContainer;\n var closeIconNode = closable && ( /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onClose,\n \"aria-label\": \"Close\",\n className: \"\".concat(prefixCls, \"-close\")\n }, closeIcon));\n [['visible', 'open'], ['afterVisibleChange', 'afterOpenChange']].forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n deprecatedName = _ref2[0],\n newName = _ref2[1];\n process.env.NODE_ENV !== \"production\" ? warning(!(deprecatedName in props), 'Drawer', \"`\".concat(deprecatedName, \"` is deprecated which will be removed in next major version, please use `\").concat(newName, \"` instead.\")) : void 0;\n });\n function renderHeader() {\n if (!title && !closable) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-header\"), _defineProperty({}, \"\".concat(prefixCls, \"-header-close-only\"), closable && !title && !extra)),\n style: headerStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-header-title\")\n }, closeIconNode, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-title\")\n }, title)), extra && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra));\n }\n function renderFooter() {\n if (!footer) {\n return null;\n }\n var footerClassName = \"\".concat(prefixCls, \"-footer\");\n return /*#__PURE__*/React.createElement(\"div\", {\n className: footerClassName,\n style: footerStyle\n }, footer);\n }\n var drawerClassName = classNames(_defineProperty({\n 'no-mask': !mask\n }, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n // ============================ Size ============================\n var mergedWidth = React.useMemo(function () {\n return width !== null && width !== void 0 ? width : size === 'large' ? 736 : 378;\n }, [width, size]);\n var mergedHeight = React.useMemo(function () {\n return height !== null && height !== void 0 ? height : size === 'large' ? 736 : 378;\n }, [height, size]);\n // =========================== Motion ===========================\n var maskMotion = {\n motionName: getTransitionName(prefixCls, 'mask-motion'),\n motionAppear: true,\n motionEnter: true,\n motionLeave: true,\n motionDeadline: 500\n };\n var panelMotion = function panelMotion(motionPlacement) {\n return {\n motionName: getTransitionName(prefixCls, \"panel-motion-\".concat(motionPlacement)),\n motionAppear: true,\n motionEnter: true,\n motionLeave: true,\n motionDeadline: 500\n };\n };\n // =========================== Render ===========================\n return /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n status: true,\n override: true\n }, /*#__PURE__*/React.createElement(RcDrawer, _extends({\n prefixCls: prefixCls,\n onClose: onClose\n }, rest, {\n open: open !== null && open !== void 0 ? open : visible,\n mask: mask,\n push: push,\n width: mergedWidth,\n height: mergedHeight,\n rootClassName: drawerClassName,\n getContainer: getContainer,\n afterOpenChange: function afterOpenChange(isOpen) {\n _afterOpenChange === null || _afterOpenChange === void 0 ? void 0 : _afterOpenChange(isOpen);\n afterVisibleChange === null || afterVisibleChange === void 0 ? void 0 : afterVisibleChange(isOpen);\n },\n maskMotion: maskMotion,\n motion: panelMotion,\n rootStyle: style\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-wrapper-body\"),\n style: _extends({}, drawerStyle)\n }, renderHeader(), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\"),\n style: bodyStyle\n }, children), renderFooter()))));\n}\nif (process.env.NODE_ENV !== 'production') {\n Drawer.displayName = 'Drawer';\n}\nexport default Drawer;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport EllipsisOutlined from \"@ant-design/icons/es/icons/EllipsisOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Button from '../button';\nimport { ConfigContext } from '../config-provider';\nimport { useCompactItemContext } from '../space/Compact';\nimport Dropdown from './dropdown';\nimport Space from '../space';\nvar DropdownButton = function DropdownButton(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$type = props.type,\n type = _props$type === void 0 ? 'default' : _props$type,\n danger = props.danger,\n disabled = props.disabled,\n loading = props.loading,\n onClick = props.onClick,\n htmlType = props.htmlType,\n children = props.children,\n className = props.className,\n menu = props.menu,\n arrow = props.arrow,\n autoFocus = props.autoFocus,\n overlay = props.overlay,\n trigger = props.trigger,\n align = props.align,\n visible = props.visible,\n open = props.open,\n onVisibleChange = props.onVisibleChange,\n onOpenChange = props.onOpenChange,\n placement = props.placement,\n getPopupContainer = props.getPopupContainer,\n href = props.href,\n _props$icon = props.icon,\n icon = _props$icon === void 0 ? /*#__PURE__*/React.createElement(EllipsisOutlined, null) : _props$icon,\n title = props.title,\n _props$buttonsRender = props.buttonsRender,\n buttonsRender = _props$buttonsRender === void 0 ? function (buttons) {\n return buttons;\n } : _props$buttonsRender,\n mouseEnterDelay = props.mouseEnterDelay,\n mouseLeaveDelay = props.mouseLeaveDelay,\n overlayClassName = props.overlayClassName,\n overlayStyle = props.overlayStyle,\n destroyPopupOnHide = props.destroyPopupOnHide,\n restProps = __rest(props, [\"prefixCls\", \"type\", \"danger\", \"disabled\", \"loading\", \"onClick\", \"htmlType\", \"children\", \"className\", \"menu\", \"arrow\", \"autoFocus\", \"overlay\", \"trigger\", \"align\", \"visible\", \"open\", \"onVisibleChange\", \"onOpenChange\", \"placement\", \"getPopupContainer\", \"href\", \"icon\", \"title\", \"buttonsRender\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"overlayClassName\", \"overlayStyle\", \"destroyPopupOnHide\"]);\n var prefixCls = getPrefixCls('dropdown-button', customizePrefixCls);\n var dropdownProps = {\n menu: menu,\n arrow: arrow,\n autoFocus: autoFocus,\n align: align,\n disabled: disabled,\n trigger: disabled ? [] : trigger,\n onOpenChange: onOpenChange || onVisibleChange,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n mouseEnterDelay: mouseEnterDelay,\n mouseLeaveDelay: mouseLeaveDelay,\n overlayClassName: overlayClassName,\n overlayStyle: overlayStyle,\n destroyPopupOnHide: destroyPopupOnHide\n };\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var classes = classNames(prefixCls, compactItemClassnames, className);\n if ('overlay' in props) {\n dropdownProps.overlay = overlay;\n }\n if ('open' in props) {\n dropdownProps.open = open;\n } else if ('visible' in props) {\n dropdownProps.open = visible;\n }\n if ('placement' in props) {\n dropdownProps.placement = placement;\n } else {\n dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';\n }\n var leftButton = /*#__PURE__*/React.createElement(Button, {\n type: type,\n danger: danger,\n disabled: disabled,\n loading: loading,\n onClick: onClick,\n htmlType: htmlType,\n href: href,\n title: title\n }, children);\n var rightButton = /*#__PURE__*/React.createElement(Button, {\n type: type,\n danger: danger,\n icon: icon\n });\n var _buttonsRender = buttonsRender([leftButton, rightButton]),\n _buttonsRender2 = _slicedToArray(_buttonsRender, 2),\n leftButtonToRender = _buttonsRender2[0],\n rightButtonToRender = _buttonsRender2[1];\n return /*#__PURE__*/React.createElement(Space.Compact, _extends({\n className: classes,\n size: compactSize,\n block: true\n }, restProps), leftButtonToRender, /*#__PURE__*/React.createElement(Dropdown, _extends({}, dropdownProps), rightButtonToRender));\n};\nDropdownButton.__ANT_BUTTON = true;\nexport default DropdownButton;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport RcDropdown from 'rc-dropdown';\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport Menu from '../menu';\nimport { ConfigContext } from '../config-provider';\nimport { OverrideProvider } from '../menu/OverrideContext';\nimport getPlacements from '../_util/placements';\nimport { cloneElement } from '../_util/reactNode';\nimport { tuple } from '../_util/type';\nimport warning from '../_util/warning';\nimport DropdownButton from './dropdown-button';\nimport { NoCompactStyle } from '../space/Compact';\nvar Placements = tuple('topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight', 'top', 'bottom');\nvar Dropdown = function Dropdown(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n // Warning for deprecated usage\n if (process.env.NODE_ENV !== 'production') {\n [['visible', 'open'], ['onVisibleChange', 'onOpenChange']].forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n deprecatedName = _ref2[0],\n newName = _ref2[1];\n process.env.NODE_ENV !== \"production\" ? warning(!(deprecatedName in props), 'Dropdown', \"`\".concat(deprecatedName, \"` is deprecated which will be removed in next major version, please use `\").concat(newName, \"` instead.\")) : void 0;\n });\n process.env.NODE_ENV !== \"production\" ? warning(!('overlay' in props), 'Dropdown', '`overlay` is deprecated. Please use `menu` instead.') : void 0;\n }\n var getTransitionName = function getTransitionName() {\n var rootPrefixCls = getPrefixCls();\n var _props$placement = props.placement,\n placement = _props$placement === void 0 ? '' : _props$placement,\n transitionName = props.transitionName;\n if (transitionName !== undefined) {\n return transitionName;\n }\n if (placement.includes('top')) {\n return \"\".concat(rootPrefixCls, \"-slide-down\");\n }\n return \"\".concat(rootPrefixCls, \"-slide-up\");\n };\n var getPlacement = function getPlacement() {\n var placement = props.placement;\n if (!placement) {\n return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n }\n if (placement.includes('Center')) {\n var newPlacement = placement.slice(0, placement.indexOf('Center'));\n process.env.NODE_ENV !== \"production\" ? warning(!placement.includes('Center'), 'Dropdown', \"You are using '\".concat(placement, \"' placement in Dropdown, which is deprecated. Try to use '\").concat(newPlacement, \"' instead.\")) : void 0;\n return newPlacement;\n }\n return placement;\n };\n var menu = props.menu,\n arrow = props.arrow,\n customizePrefixCls = props.prefixCls,\n children = props.children,\n trigger = props.trigger,\n disabled = props.disabled,\n dropdownRender = props.dropdownRender,\n getPopupContainer = props.getPopupContainer,\n overlayClassName = props.overlayClassName,\n visible = props.visible,\n open = props.open,\n onVisibleChange = props.onVisibleChange,\n onOpenChange = props.onOpenChange,\n _props$mouseEnterDela = props.mouseEnterDelay,\n mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.15 : _props$mouseEnterDela,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n _props$autoAdjustOver = props.autoAdjustOverflow,\n autoAdjustOverflow = _props$autoAdjustOver === void 0 ? true : _props$autoAdjustOver;\n var prefixCls = getPrefixCls('dropdown', customizePrefixCls);\n var child = React.Children.only(children);\n var dropdownTrigger = cloneElement(child, {\n className: classNames(\"\".concat(prefixCls, \"-trigger\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), child.props.className),\n disabled: disabled\n });\n var triggerActions = disabled ? [] : trigger;\n var alignPoint;\n if (triggerActions && triggerActions.includes('contextMenu')) {\n alignPoint = true;\n }\n // =========================== Visible ============================\n var _useMergedState = useMergedState(false, {\n value: open !== undefined ? open : visible\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedOpen = _useMergedState2[0],\n setOpen = _useMergedState2[1];\n var onInnerOpenChange = useEvent(function (nextOpen) {\n onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(nextOpen);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);\n setOpen(nextOpen);\n });\n // =========================== Overlay ============================\n var overlayClassNameCustomized = classNames(overlayClassName, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'));\n var builtinPlacements = getPlacements({\n arrowPointAtCenter: _typeof(arrow) === 'object' && arrow.pointAtCenter,\n autoAdjustOverflow: autoAdjustOverflow\n });\n var onMenuClick = React.useCallback(function () {\n setOpen(false);\n }, []);\n var renderOverlay = function renderOverlay() {\n // rc-dropdown already can process the function of overlay, but we have check logic here.\n // So we need render the element to check and pass back to rc-dropdown.\n var overlay = props.overlay;\n var overlayNode;\n if (menu === null || menu === void 0 ? void 0 : menu.items) {\n overlayNode = /*#__PURE__*/React.createElement(Menu, _extends({}, menu));\n } else if (typeof overlay === 'function') {\n overlayNode = overlay();\n } else {\n overlayNode = overlay;\n }\n if (dropdownRender) {\n overlayNode = dropdownRender(overlayNode);\n }\n overlayNode = React.Children.only(typeof overlayNode === 'string' ? /*#__PURE__*/React.createElement(\"span\", null, overlayNode) : overlayNode);\n return /*#__PURE__*/React.createElement(OverrideProvider, {\n prefixCls: \"\".concat(prefixCls, \"-menu\"),\n expandIcon: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-menu-submenu-arrow\")\n }, /*#__PURE__*/React.createElement(RightOutlined, {\n className: \"\".concat(prefixCls, \"-menu-submenu-arrow-icon\")\n })),\n mode: \"vertical\",\n selectable: false,\n onClick: onMenuClick,\n validator: function validator(_ref3) {\n var mode = _ref3.mode;\n // Warning if use other mode\n process.env.NODE_ENV !== \"production\" ? warning(!mode || mode === 'vertical', 'Dropdown', \"mode=\\\"\".concat(mode, \"\\\" is not supported for Dropdown's Menu.\")) : void 0;\n }\n }, /*#__PURE__*/React.createElement(NoCompactStyle, null, overlayNode));\n };\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(RcDropdown, _extends({\n alignPoint: alignPoint\n }, props, {\n mouseEnterDelay: mouseEnterDelay,\n mouseLeaveDelay: mouseLeaveDelay,\n visible: mergedOpen,\n builtinPlacements: builtinPlacements,\n arrow: !!arrow,\n overlayClassName: overlayClassNameCustomized,\n prefixCls: prefixCls,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n transitionName: getTransitionName(),\n trigger: triggerActions,\n overlay: renderOverlay,\n placement: getPlacement(),\n onVisibleChange: onInnerOpenChange\n }), dropdownTrigger);\n};\nDropdown.Button = DropdownButton;\nexport default Dropdown;","import Dropdown from './dropdown';\nexport default Dropdown;","import * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar Empty = function Empty() {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('empty-img-default');\n return /*#__PURE__*/React.createElement(\"svg\", {\n className: prefixCls,\n width: \"184\",\n height: \"152\",\n viewBox: \"0 0 184 152\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(24 31.67)\"\n }, /*#__PURE__*/React.createElement(\"ellipse\", {\n className: \"\".concat(prefixCls, \"-ellipse\"),\n cx: \"67.797\",\n cy: \"106.89\",\n rx: \"67.797\",\n ry: \"12.668\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-path-1\"),\n d: \"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-path-2\"),\n d: \"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z\",\n transform: \"translate(13.56)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-path-3\"),\n d: \"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-path-4\"),\n d: \"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z\"\n })), /*#__PURE__*/React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-path-5\"),\n d: \"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n className: \"\".concat(prefixCls, \"-g\"),\n transform: \"translate(149.65 15.383)\"\n }, /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: \"20.654\",\n cy: \"3.167\",\n rx: \"2.849\",\n ry: \"2.815\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z\"\n }))));\n};\nexport default Empty;","import * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar Simple = function Simple() {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('empty-img-simple');\n return /*#__PURE__*/React.createElement(\"svg\", {\n className: prefixCls,\n width: \"64\",\n height: \"41\",\n viewBox: \"0 0 64 41\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(0 1)\",\n fill: \"none\",\n fillRule: \"evenodd\"\n }, /*#__PURE__*/React.createElement(\"ellipse\", {\n className: \"\".concat(prefixCls, \"-ellipse\"),\n cx: \"32\",\n cy: \"33\",\n rx: \"32\",\n ry: \"7\"\n }), /*#__PURE__*/React.createElement(\"g\", {\n className: \"\".concat(prefixCls, \"-g\"),\n fillRule: \"nonzero\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z\",\n className: \"\".concat(prefixCls, \"-path\")\n }))));\n};\nexport default Simple;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport DefaultEmptyImg from './empty';\nimport SimpleEmptyImg from './simple';\nvar defaultEmptyImg = /*#__PURE__*/React.createElement(DefaultEmptyImg, null);\nvar simpleEmptyImg = /*#__PURE__*/React.createElement(SimpleEmptyImg, null);\nvar Empty = function Empty(_a) {\n var className = _a.className,\n customizePrefixCls = _a.prefixCls,\n _a$image = _a.image,\n image = _a$image === void 0 ? defaultEmptyImg : _a$image,\n description = _a.description,\n children = _a.children,\n imageStyle = _a.imageStyle,\n restProps = __rest(_a, [\"className\", \"prefixCls\", \"image\", \"description\", \"children\", \"imageStyle\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Empty\"\n }, function (contextLocale) {\n var prefixCls = getPrefixCls('empty', customizePrefixCls);\n var des = typeof description !== 'undefined' ? description : contextLocale.description;\n var alt = typeof des === 'string' ? des : 'empty';\n var imageNode = null;\n if (typeof image === 'string') {\n imageNode = /*#__PURE__*/React.createElement(\"img\", {\n alt: alt,\n src: image\n });\n } else {\n imageNode = image;\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classNames(prefixCls, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-normal\"), image === simpleEmptyImg), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className)\n }, restProps), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-image\"),\n style: imageStyle\n }, imageNode), des && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, des), children && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, children));\n });\n};\nEmpty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;\nEmpty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;\nexport default Empty;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { FormProvider as RcFormProvider } from 'rc-field-form';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { useContext, useMemo } from 'react';\nexport var FormContext = /*#__PURE__*/React.createContext({\n labelAlign: 'right',\n vertical: false,\n itemRef: function itemRef() {}\n});\nexport var NoStyleItemContext = /*#__PURE__*/React.createContext(null);\nexport var FormProvider = function FormProvider(props) {\n var providerProps = omit(props, ['prefixCls']);\n return /*#__PURE__*/React.createElement(RcFormProvider, _extends({}, providerProps));\n};\nexport var FormItemPrefixContext = /*#__PURE__*/React.createContext({\n prefixCls: ''\n});\nexport var FormItemInputContext = /*#__PURE__*/React.createContext({});\nexport var NoFormStyle = function NoFormStyle(_ref) {\n var children = _ref.children,\n status = _ref.status,\n override = _ref.override;\n var formItemInputContext = useContext(FormItemInputContext);\n var newFormItemInputContext = useMemo(function () {\n var newContext = _extends({}, formItemInputContext);\n if (override) {\n delete newContext.isFormItemInput;\n }\n if (status) {\n delete newContext.status;\n delete newContext.hasFeedback;\n delete newContext.feedbackIcon;\n }\n return newContext;\n }, [status, override, formItemInputContext]);\n return /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {\n value: newFormItemInputContext\n }, children);\n};","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function useDebounce(value) {\n var _React$useState = React.useState(value),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n cacheValue = _React$useState2[0],\n setCacheValue = _React$useState2[1];\n React.useEffect(function () {\n var timeout = setTimeout(function () {\n setCacheValue(value);\n }, value.length ? 0 : 10);\n return function () {\n clearTimeout(timeout);\n };\n }, [value]);\n return cacheValue;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport classNames from 'classnames';\nimport CSSMotion, { CSSMotionList } from 'rc-motion';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport collapseMotion from '../_util/motion';\nimport { FormItemPrefixContext } from './context';\nimport useDebounce from './hooks/useDebounce';\nvar EMPTY_LIST = [];\nfunction toErrorEntity(error, errorStatus, prefix) {\n var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n return {\n key: typeof error === 'string' ? error : \"\".concat(prefix, \"-\").concat(index),\n error: error,\n errorStatus: errorStatus\n };\n}\nexport default function ErrorList(_ref) {\n var help = _ref.help,\n helpStatus = _ref.helpStatus,\n _ref$errors = _ref.errors,\n errors = _ref$errors === void 0 ? EMPTY_LIST : _ref$errors,\n _ref$warnings = _ref.warnings,\n warnings = _ref$warnings === void 0 ? EMPTY_LIST : _ref$warnings,\n rootClassName = _ref.className,\n fieldId = _ref.fieldId,\n onVisibleChanged = _ref.onVisibleChanged;\n var _React$useContext = React.useContext(FormItemPrefixContext),\n prefixCls = _React$useContext.prefixCls;\n var _React$useContext2 = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext2.getPrefixCls;\n var baseClassName = \"\".concat(prefixCls, \"-item-explain\");\n var rootPrefixCls = getPrefixCls();\n // We have to debounce here again since somewhere use ErrorList directly still need no shaking\n // ref: https://github.com/ant-design/ant-design/issues/36336\n var debounceErrors = useDebounce(errors);\n var debounceWarnings = useDebounce(warnings);\n var fullKeyList = React.useMemo(function () {\n if (help !== undefined && help !== null) {\n return [toErrorEntity(help, helpStatus, 'help')];\n }\n return [].concat(_toConsumableArray(debounceErrors.map(function (error, index) {\n return toErrorEntity(error, 'error', 'error', index);\n })), _toConsumableArray(debounceWarnings.map(function (warning, index) {\n return toErrorEntity(warning, 'warning', 'warning', index);\n })));\n }, [help, helpStatus, debounceErrors, debounceWarnings]);\n var helpProps = {};\n if (fieldId) {\n helpProps.id = \"\".concat(fieldId, \"_help\");\n }\n return /*#__PURE__*/React.createElement(CSSMotion, {\n motionDeadline: collapseMotion.motionDeadline,\n motionName: \"\".concat(rootPrefixCls, \"-show-help\"),\n visible: !!fullKeyList.length,\n onVisibleChanged: onVisibleChanged\n }, function (holderProps) {\n var holderClassName = holderProps.className,\n holderStyle = holderProps.style;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, helpProps, {\n className: classNames(baseClassName, holderClassName, rootClassName),\n style: holderStyle,\n role: \"alert\"\n }), /*#__PURE__*/React.createElement(CSSMotionList, _extends({\n keys: fullKeyList\n }, collapseMotion, {\n motionName: \"\".concat(rootPrefixCls, \"-show-help-item\"),\n component: false\n }), function (itemProps) {\n var key = itemProps.key,\n error = itemProps.error,\n errorStatus = itemProps.errorStatus,\n itemClassName = itemProps.className,\n itemStyle = itemProps.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n key: key,\n className: classNames(itemClassName, _defineProperty({}, \"\".concat(baseClassName, \"-\").concat(errorStatus), errorStatus)),\n style: itemStyle\n }, error);\n }));\n });\n}","// Compute what scrolling needs to be done on required scrolling boxes for target to be in view\n\n// The type names here are named after the spec to make it easier to find more information around what they mean:\n// To reduce churn and reduce things that need be maintained things from the official TS DOM library is used here\n// https://drafts.csswg.org/cssom-view/\n\n// For a definition on what is \"block flow direction\" exactly, check this: https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction\n\n// add support for visualViewport object currently implemented in chrome\ninterface visualViewport {\n height: number\n width: number\n}\n\ntype ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest'\n// This new option is tracked in this PR, which is the most likely candidate at the time: https://github.com/w3c/csswg-drafts/pull/1805\ntype ScrollMode = 'always' | 'if-needed'\n// New option that skips auto-scrolling all nodes with overflow: hidden set\n// See FF implementation: https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18\ntype SkipOverflowHiddenElements = boolean\n\ninterface Options {\n block?: ScrollLogicalPosition\n inline?: ScrollLogicalPosition\n scrollMode?: ScrollMode\n boundary?: CustomScrollBoundary\n skipOverflowHiddenElements?: SkipOverflowHiddenElements\n}\n\n// Custom behavior, not in any spec\ntype CustomScrollBoundaryCallback = (parent: Element) => boolean\ntype CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null\ninterface CustomScrollAction {\n el: Element\n top: number\n left: number\n}\n\n// @TODO better shadowdom test, 11 = document fragment\nfunction isElement(el: any): el is Element {\n return typeof el === 'object' && el != null && el.nodeType === 1\n}\n\nfunction canOverflow(\n overflow: string | null,\n skipOverflowHiddenElements?: boolean\n) {\n if (skipOverflowHiddenElements && overflow === 'hidden') {\n return false\n }\n\n return overflow !== 'visible' && overflow !== 'clip'\n}\n\nfunction getFrameElement(el: Element) {\n if (!el.ownerDocument || !el.ownerDocument.defaultView) {\n return null\n }\n\n try {\n return el.ownerDocument.defaultView.frameElement\n } catch (e) {\n return null\n }\n}\n\nfunction isHiddenByFrame(el: Element): boolean {\n const frame = getFrameElement(el)\n if (!frame) {\n return false\n }\n\n return (\n frame.clientHeight < el.scrollHeight || frame.clientWidth < el.scrollWidth\n )\n}\n\nfunction isScrollable(el: Element, skipOverflowHiddenElements?: boolean) {\n if (el.clientHeight < el.scrollHeight || el.clientWidth < el.scrollWidth) {\n const style = getComputedStyle(el, null)\n return (\n canOverflow(style.overflowY, skipOverflowHiddenElements) ||\n canOverflow(style.overflowX, skipOverflowHiddenElements) ||\n isHiddenByFrame(el)\n )\n }\n\n return false\n}\n/**\n * Find out which edge to align against when logical scroll position is \"nearest\"\n * Interesting fact: \"nearest\" works similarily to \"if-needed\", if the element is fully visible it will not scroll it\n *\n * Legends:\n * ┌────────┐ ┏ ━ ━ ━ ┓\n * │ target │ frame\n * └────────┘ ┗ ━ ━ ━ ┛\n */\nfunction alignNearest(\n scrollingEdgeStart: number,\n scrollingEdgeEnd: number,\n scrollingSize: number,\n scrollingBorderStart: number,\n scrollingBorderEnd: number,\n elementEdgeStart: number,\n elementEdgeEnd: number,\n elementSize: number\n) {\n /**\n * If element edge A and element edge B are both outside scrolling box edge A and scrolling box edge B\n *\n * ┌──┐\n * ┏━│━━│━┓\n * │ │\n * ┃ │ │ ┃ do nothing\n * │ │\n * ┗━│━━│━┛\n * └──┘\n *\n * If element edge C and element edge D are both outside scrolling box edge C and scrolling box edge D\n *\n * ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐\n * │┃ ┃│ do nothing\n * └───────────┘\n * ┗ ━ ━ ━ ━ ┛\n */\n if (\n (elementEdgeStart < scrollingEdgeStart &&\n elementEdgeEnd > scrollingEdgeEnd) ||\n (elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd)\n ) {\n return 0\n }\n\n /**\n * If element edge A is outside scrolling box edge A and element height is less than scrolling box height\n *\n * ┌──┐\n * ┏━│━━│━┓ ┏━┌━━┐━┓\n * └──┘ │ │\n * from ┃ ┃ to ┃ └──┘ ┃\n *\n * ┗━ ━━ ━┛ ┗━ ━━ ━┛\n *\n * If element edge B is outside scrolling box edge B and element height is greater than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━┌━━┐━┓\n * │ │\n * from ┃ ┌──┐ ┃ to ┃ │ │ ┃\n * │ │ │ │\n * ┗━│━━│━┛ ┗━│━━│━┛\n * │ │ └──┘\n * │ │\n * └──┘\n *\n * If element edge C is outside scrolling box edge C and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * │ ┃ │ ┃ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * ┃ │ ┃ │ ┃ ┃ │\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n */\n if (\n (elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize) ||\n (elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize)\n ) {\n return elementEdgeStart - scrollingEdgeStart - scrollingBorderStart\n }\n\n /**\n * If element edge B is outside scrolling box edge B and element height is less than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━ ━━ ━┓\n *\n * from ┃ ┃ to ┃ ┌──┐ ┃\n * ┌──┐ │ │\n * ┗━│━━│━┛ ┗━└━━┘━┛\n * └──┘\n *\n * If element edge A is outside scrolling box edge A and element height is greater than scrolling box height\n *\n * ┌──┐\n * │ │\n * │ │ ┌──┐\n * ┏━│━━│━┓ ┏━│━━│━┓\n * │ │ │ │\n * from ┃ └──┘ ┃ to ┃ │ │ ┃\n * │ │\n * ┗━ ━━ ━┛ ┗━└━━┘━┛\n *\n * If element edge C is outside scrolling box edge C and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * │ ┃ │ ┃ │ ┃ ┃\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * ┃ │ ┃ │ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n */\n if (\n (elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize) ||\n (elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize)\n ) {\n return elementEdgeEnd - scrollingEdgeEnd + scrollingBorderEnd\n }\n\n return 0\n}\n\nfunction getParentElement(element: Node): Element | null {\n const parent = element.parentElement\n if (parent == null) {\n return (element.getRootNode() as ShadowRoot).host || null\n }\n return parent\n}\n\nexport default (target: Element, options: Options): CustomScrollAction[] => {\n //TODO: remove this hack when microbundle will support typescript >= 4.0\n const windowWithViewport = window as unknown as Window & {\n visualViewport: visualViewport\n }\n\n const { scrollMode, block, inline, boundary, skipOverflowHiddenElements } =\n options\n // Allow using a callback to check the boundary\n // The default behavior is to check if the current target matches the boundary element or not\n // If undefined it'll check that target is never undefined (can happen as we recurse up the tree)\n const checkBoundary =\n typeof boundary === 'function' ? boundary : (node: any) => node !== boundary\n\n if (!isElement(target)) {\n throw new TypeError('Invalid target')\n }\n\n // Used to handle the top most element that can be scrolled\n const scrollingElement = document.scrollingElement || document.documentElement\n\n // Collect all the scrolling boxes, as defined in the spec: https://drafts.csswg.org/cssom-view/#scrolling-box\n const frames: Element[] = []\n let cursor: Element | null = target\n while (isElement(cursor) && checkBoundary(cursor)) {\n // Move cursor to parent\n cursor = getParentElement(cursor)\n\n // Stop when we reach the viewport\n if (cursor === scrollingElement) {\n frames.push(cursor)\n break\n }\n\n // Skip document.body if it's not the scrollingElement and documentElement isn't independently scrollable\n if (\n cursor != null &&\n cursor === document.body &&\n isScrollable(cursor) &&\n !isScrollable(document.documentElement)\n ) {\n continue\n }\n\n // Now we check if the element is scrollable, this code only runs if the loop haven't already hit the viewport or a custom boundary\n if (cursor != null && isScrollable(cursor, skipOverflowHiddenElements)) {\n frames.push(cursor)\n }\n }\n\n // Support pinch-zooming properly, making sure elements scroll into the visual viewport\n // Browsers that don't support visualViewport will report the layout viewport dimensions on document.documentElement.clientWidth/Height\n // and viewport dimensions on window.innerWidth/Height\n // https://www.quirksmode.org/mobile/viewports2.html\n // https://bokand.github.io/viewport/index.html\n const viewportWidth = windowWithViewport.visualViewport\n ? windowWithViewport.visualViewport.width\n : innerWidth\n const viewportHeight = windowWithViewport.visualViewport\n ? windowWithViewport.visualViewport.height\n : innerHeight\n\n // Newer browsers supports scroll[X|Y], page[X|Y]Offset is\n const viewportX = window.scrollX || pageXOffset\n const viewportY = window.scrollY || pageYOffset\n\n const {\n height: targetHeight,\n width: targetWidth,\n top: targetTop,\n right: targetRight,\n bottom: targetBottom,\n left: targetLeft,\n } = target.getBoundingClientRect()\n\n // These values mutate as we loop through and generate scroll coordinates\n let targetBlock: number =\n block === 'start' || block === 'nearest'\n ? targetTop\n : block === 'end'\n ? targetBottom\n : targetTop + targetHeight / 2 // block === 'center\n let targetInline: number =\n inline === 'center'\n ? targetLeft + targetWidth / 2\n : inline === 'end'\n ? targetRight\n : targetLeft // inline === 'start || inline === 'nearest\n\n // Collect new scroll positions\n const computations: CustomScrollAction[] = []\n // In chrome there's no longer a difference between caching the `frames.length` to a var or not, so we don't in this case (size > speed anyways)\n for (let index = 0; index < frames.length; index++) {\n const frame = frames[index]\n\n // @TODO add a shouldScroll hook here that allows userland code to take control\n\n const { height, width, top, right, bottom, left } =\n frame.getBoundingClientRect()\n\n // If the element is already visible we can end it here\n // @TODO targetBlock and targetInline should be taken into account to be compliant with https://github.com/w3c/csswg-drafts/pull/1805/files#diff-3c17f0e43c20f8ecf89419d49e7ef5e0R1333\n if (\n scrollMode === 'if-needed' &&\n targetTop >= 0 &&\n targetLeft >= 0 &&\n targetBottom <= viewportHeight &&\n targetRight <= viewportWidth &&\n targetTop >= top &&\n targetBottom <= bottom &&\n targetLeft >= left &&\n targetRight <= right\n ) {\n // Break the loop and return the computations for things that are not fully visible\n return computations\n }\n\n const frameStyle = getComputedStyle(frame)\n const borderLeft = parseInt(frameStyle.borderLeftWidth as string, 10)\n const borderTop = parseInt(frameStyle.borderTopWidth as string, 10)\n const borderRight = parseInt(frameStyle.borderRightWidth as string, 10)\n const borderBottom = parseInt(frameStyle.borderBottomWidth as string, 10)\n\n let blockScroll: number = 0\n let inlineScroll: number = 0\n\n // The property existance checks for offfset[Width|Height] is because only HTMLElement objects have them, but any Element might pass by here\n // @TODO find out if the \"as HTMLElement\" overrides can be dropped\n const scrollbarWidth =\n 'offsetWidth' in frame\n ? (frame as HTMLElement).offsetWidth -\n (frame as HTMLElement).clientWidth -\n borderLeft -\n borderRight\n : 0\n const scrollbarHeight =\n 'offsetHeight' in frame\n ? (frame as HTMLElement).offsetHeight -\n (frame as HTMLElement).clientHeight -\n borderTop -\n borderBottom\n : 0\n\n const scaleX =\n 'offsetWidth' in frame\n ? (frame as HTMLElement).offsetWidth === 0\n ? 0\n : width / (frame as HTMLElement).offsetWidth\n : 0\n const scaleY =\n 'offsetHeight' in frame\n ? (frame as HTMLElement).offsetHeight === 0\n ? 0\n : height / (frame as HTMLElement).offsetHeight\n : 0\n\n if (scrollingElement === frame) {\n // Handle viewport logic (document.documentElement or document.body)\n\n if (block === 'start') {\n blockScroll = targetBlock\n } else if (block === 'end') {\n blockScroll = targetBlock - viewportHeight\n } else if (block === 'nearest') {\n blockScroll = alignNearest(\n viewportY,\n viewportY + viewportHeight,\n viewportHeight,\n borderTop,\n borderBottom,\n viewportY + targetBlock,\n viewportY + targetBlock + targetHeight,\n targetHeight\n )\n } else {\n // block === 'center' is the default\n blockScroll = targetBlock - viewportHeight / 2\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline\n } else if (inline === 'center') {\n inlineScroll = targetInline - viewportWidth / 2\n } else if (inline === 'end') {\n inlineScroll = targetInline - viewportWidth\n } else {\n // inline === 'nearest' is the default\n inlineScroll = alignNearest(\n viewportX,\n viewportX + viewportWidth,\n viewportWidth,\n borderLeft,\n borderRight,\n viewportX + targetInline,\n viewportX + targetInline + targetWidth,\n targetWidth\n )\n }\n\n // Apply scroll position offsets and ensure they are within bounds\n // @TODO add more test cases to cover this 100%\n blockScroll = Math.max(0, blockScroll + viewportY)\n inlineScroll = Math.max(0, inlineScroll + viewportX)\n } else {\n // Handle each scrolling frame that might exist between the target and the viewport\n\n if (block === 'start') {\n blockScroll = targetBlock - top - borderTop\n } else if (block === 'end') {\n blockScroll = targetBlock - bottom + borderBottom + scrollbarHeight\n } else if (block === 'nearest') {\n blockScroll = alignNearest(\n top,\n bottom,\n height,\n borderTop,\n borderBottom + scrollbarHeight,\n targetBlock,\n targetBlock + targetHeight,\n targetHeight\n )\n } else {\n // block === 'center' is the default\n blockScroll = targetBlock - (top + height / 2) + scrollbarHeight / 2\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline - left - borderLeft\n } else if (inline === 'center') {\n inlineScroll = targetInline - (left + width / 2) + scrollbarWidth / 2\n } else if (inline === 'end') {\n inlineScroll = targetInline - right + borderRight + scrollbarWidth\n } else {\n // inline === 'nearest' is the default\n inlineScroll = alignNearest(\n left,\n right,\n width,\n borderLeft,\n borderRight + scrollbarWidth,\n targetInline,\n targetInline + targetWidth,\n targetWidth\n )\n }\n\n const { scrollLeft, scrollTop } = frame\n // Ensure scroll coordinates are not out of bounds while applying scroll offsets\n blockScroll = Math.max(\n 0,\n Math.min(\n scrollTop + blockScroll / scaleY,\n frame.scrollHeight - height / scaleY + scrollbarHeight\n )\n )\n inlineScroll = Math.max(\n 0,\n Math.min(\n scrollLeft + inlineScroll / scaleX,\n frame.scrollWidth - width / scaleX + scrollbarWidth\n )\n )\n\n // Cache the offset so that parent frames can scroll this into view correctly\n targetBlock += scrollTop - blockScroll\n targetInline += scrollLeft - inlineScroll\n }\n\n computations.push({ el: frame, top: blockScroll, left: inlineScroll })\n }\n\n return computations\n}\n","import compute from 'compute-scroll-into-view';\nfunction isOptionsObject(options) {\n return options === Object(options) && Object.keys(options).length !== 0;\n}\nfunction defaultBehavior(actions, behavior) {\n if (behavior === void 0) {\n behavior = 'auto';\n }\n var canSmoothScroll = ('scrollBehavior' in document.body.style);\n actions.forEach(function (_ref) {\n var el = _ref.el,\n top = _ref.top,\n left = _ref.left;\n if (el.scroll && canSmoothScroll) {\n el.scroll({\n top: top,\n left: left,\n behavior: behavior\n });\n } else {\n el.scrollTop = top;\n el.scrollLeft = left;\n }\n });\n}\nfunction getOptions(options) {\n if (options === false) {\n return {\n block: 'end',\n inline: 'nearest'\n };\n }\n if (isOptionsObject(options)) {\n return options;\n }\n return {\n block: 'start',\n inline: 'nearest'\n };\n}\nfunction scrollIntoView(target, options) {\n var isTargetAttached = target.isConnected || target.ownerDocument.documentElement.contains(target);\n if (isOptionsObject(options) && typeof options.behavior === 'function') {\n return options.behavior(isTargetAttached ? compute(target, options) : []);\n }\n if (!isTargetAttached) {\n return;\n }\n var computeOptions = getOptions(options);\n return defaultBehavior(compute(target, computeOptions), computeOptions.behavior);\n}\nexport default scrollIntoView;","// form item name black list. in form ,you can use form.id get the form item element.\n// use object hasOwnProperty will get better performance if black list is longer.\nvar formItemNameBlackList = ['parentNode'];\n// default form item id prefix.\nvar defaultItemNamePrefixCls = 'form_item';\nexport function toArray(candidate) {\n if (candidate === undefined || candidate === false) return [];\n return Array.isArray(candidate) ? candidate : [candidate];\n}\nexport function getFieldId(namePath, formName) {\n if (!namePath.length) return undefined;\n var mergedId = namePath.join('_');\n if (formName) {\n return \"\".concat(formName, \"_\").concat(mergedId);\n }\n var isIllegalName = formItemNameBlackList.includes(mergedId);\n return isIllegalName ? \"\".concat(defaultItemNamePrefixCls, \"_\").concat(mergedId) : mergedId;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useForm as useRcForm } from 'rc-field-form';\nimport * as React from 'react';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { getFieldId, toArray } from '../util';\nfunction toNamePathStr(name) {\n var namePath = toArray(name);\n return namePath.join('_');\n}\nexport default function useForm(form) {\n var _useRcForm = useRcForm(),\n _useRcForm2 = _slicedToArray(_useRcForm, 1),\n rcForm = _useRcForm2[0];\n var itemsRef = React.useRef({});\n var wrapForm = React.useMemo(function () {\n return form !== null && form !== void 0 ? form : _extends(_extends({}, rcForm), {\n __INTERNAL__: {\n itemRef: function itemRef(name) {\n return function (node) {\n var namePathStr = toNamePathStr(name);\n if (node) {\n itemsRef.current[namePathStr] = node;\n } else {\n delete itemsRef.current[namePathStr];\n }\n };\n }\n },\n scrollToField: function scrollToField(name) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var namePath = toArray(name);\n var fieldId = getFieldId(namePath, wrapForm.__INTERNAL__.name);\n var node = fieldId ? document.getElementById(fieldId) : null;\n if (node) {\n scrollIntoView(node, _extends({\n scrollMode: 'if-needed',\n block: 'nearest'\n }, options));\n }\n },\n getFieldInstance: function getFieldInstance(name) {\n var namePathStr = toNamePathStr(name);\n return itemsRef.current[namePathStr];\n }\n });\n }, [form, rcForm]);\n return [wrapForm];\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport FieldForm, { List, useWatch } from 'rc-field-form';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';\nimport { FormContext, FormProvider } from './context';\nimport ValidateMessagesContext from './validateMessagesContext';\nimport useForm from './hooks/useForm';\nvar InternalForm = function InternalForm(props, ref) {\n var contextSize = React.useContext(SizeContext);\n var contextDisabled = React.useContext(DisabledContext);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction,\n contextForm = _React$useContext.form;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n _props$size = props.size,\n size = _props$size === void 0 ? contextSize : _props$size,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? contextDisabled : _props$disabled,\n form = props.form,\n colon = props.colon,\n labelAlign = props.labelAlign,\n labelWrap = props.labelWrap,\n labelCol = props.labelCol,\n wrapperCol = props.wrapperCol,\n hideRequiredMark = props.hideRequiredMark,\n _props$layout = props.layout,\n layout = _props$layout === void 0 ? 'horizontal' : _props$layout,\n scrollToFirstError = props.scrollToFirstError,\n requiredMark = props.requiredMark,\n onFinishFailed = props.onFinishFailed,\n name = props.name,\n restFormProps = __rest(props, [\"prefixCls\", \"className\", \"size\", \"disabled\", \"form\", \"colon\", \"labelAlign\", \"labelWrap\", \"labelCol\", \"wrapperCol\", \"hideRequiredMark\", \"layout\", \"scrollToFirstError\", \"requiredMark\", \"onFinishFailed\", \"name\"]);\n var contextValidateMessages = React.useContext(ValidateMessagesContext);\n var mergedRequiredMark = useMemo(function () {\n if (requiredMark !== undefined) {\n return requiredMark;\n }\n if (contextForm && contextForm.requiredMark !== undefined) {\n return contextForm.requiredMark;\n }\n if (hideRequiredMark) {\n return false;\n }\n return true;\n }, [hideRequiredMark, requiredMark, contextForm]);\n var mergedColon = colon !== null && colon !== void 0 ? colon : contextForm === null || contextForm === void 0 ? void 0 : contextForm.colon;\n var prefixCls = getPrefixCls('form', customizePrefixCls);\n var formClassName = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(layout), true), \"\".concat(prefixCls, \"-hide-required-mark\"), mergedRequiredMark === false), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-\").concat(size), size), className);\n var _useForm = useForm(form),\n _useForm2 = _slicedToArray(_useForm, 1),\n wrapForm = _useForm2[0];\n var __INTERNAL__ = wrapForm.__INTERNAL__;\n __INTERNAL__.name = name;\n var formContextValue = useMemo(function () {\n return {\n name: name,\n labelAlign: labelAlign,\n labelCol: labelCol,\n labelWrap: labelWrap,\n wrapperCol: wrapperCol,\n vertical: layout === 'vertical',\n colon: mergedColon,\n requiredMark: mergedRequiredMark,\n itemRef: __INTERNAL__.itemRef,\n form: wrapForm\n };\n }, [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm]);\n React.useImperativeHandle(ref, function () {\n return wrapForm;\n });\n var onInternalFinishFailed = function onInternalFinishFailed(errorInfo) {\n onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);\n var defaultScrollToFirstError = {\n block: 'nearest'\n };\n if (scrollToFirstError && errorInfo.errorFields.length) {\n if (_typeof(scrollToFirstError) === 'object') {\n defaultScrollToFirstError = scrollToFirstError;\n }\n wrapForm.scrollToField(errorInfo.errorFields[0].name, defaultScrollToFirstError);\n }\n };\n return /*#__PURE__*/React.createElement(DisabledContextProvider, {\n disabled: disabled\n }, /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: size\n }, /*#__PURE__*/React.createElement(FormProvider, _extends({}, {\n // This is not list in API, we pass with spread\n validateMessages: contextValidateMessages\n }), /*#__PURE__*/React.createElement(FormContext.Provider, {\n value: formContextValue\n }, /*#__PURE__*/React.createElement(FieldForm, _extends({\n id: name\n }, restFormProps, {\n name: name,\n onFinishFailed: onInternalFinishFailed,\n form: wrapForm,\n className: formClassName\n }))))));\n};\nvar Form = /*#__PURE__*/React.forwardRef(InternalForm);\nexport { useForm, List, useWatch };\nexport default Form;","import { useContext } from 'react';\nimport { FormItemInputContext } from '../context';\nimport warning from '../../_util/warning';\nvar useFormItemStatus = function useFormItemStatus() {\n var _useContext = useContext(FormItemInputContext),\n status = _useContext.status;\n process.env.NODE_ENV !== \"production\" ? warning(status !== undefined, 'Form.Item', \"Form.Item.useStatus should be used under Form.Item component. For more information: \".concat(window.location.protocol, \"//\").concat(window.location.host, \"/components/form-cn/#Form.Item.useStatus\")) : void 0;\n return {\n status: status\n };\n};\nexport default useFormItemStatus;","// This icon file is generated automatically.\nvar QuestionCircleOutlined = { \"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\": \"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z\" } }] }, \"name\": \"question-circle\", \"theme\": \"outlined\" };\nexport default QuestionCircleOutlined;\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 QuestionCircleOutlinedSvg from \"@ant-design/icons-svg/es/asn/QuestionCircleOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar QuestionCircleOutlined = function QuestionCircleOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: QuestionCircleOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(QuestionCircleOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'QuestionCircleOutlined';\n}\nexport default RefIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport QuestionCircleOutlined from \"@ant-design/icons/es/icons/QuestionCircleOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Col from '../grid/col';\nimport { useLocaleReceiver } from '../locale-provider/LocaleReceiver';\nimport defaultLocale from '../locale/default';\nimport Tooltip from '../tooltip';\nimport { FormContext } from './context';\nfunction toTooltipProps(tooltip) {\n if (!tooltip) {\n return null;\n }\n if (_typeof(tooltip) === 'object' && ! /*#__PURE__*/React.isValidElement(tooltip)) {\n return tooltip;\n }\n return {\n title: tooltip\n };\n}\nvar FormItemLabel = function FormItemLabel(_ref) {\n var prefixCls = _ref.prefixCls,\n label = _ref.label,\n htmlFor = _ref.htmlFor,\n labelCol = _ref.labelCol,\n labelAlign = _ref.labelAlign,\n colon = _ref.colon,\n required = _ref.required,\n requiredMark = _ref.requiredMark,\n tooltip = _ref.tooltip;\n var _useLocaleReceiver = useLocaleReceiver('Form'),\n _useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),\n formLocale = _useLocaleReceiver2[0];\n if (!label) return null;\n return /*#__PURE__*/React.createElement(FormContext.Consumer, {\n key: \"label\"\n }, function (_ref2) {\n var vertical = _ref2.vertical,\n contextLabelAlign = _ref2.labelAlign,\n contextLabelCol = _ref2.labelCol,\n labelWrap = _ref2.labelWrap,\n contextColon = _ref2.colon;\n var _a;\n var mergedLabelCol = labelCol || contextLabelCol || {};\n var mergedLabelAlign = labelAlign || contextLabelAlign;\n var labelClsBasic = \"\".concat(prefixCls, \"-item-label\");\n var labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && \"\".concat(labelClsBasic, \"-left\"), mergedLabelCol.className, _defineProperty({}, \"\".concat(labelClsBasic, \"-wrap\"), !!labelWrap));\n var labelChildren = label;\n // Keep label is original where there should have no colon\n var computedColon = colon === true || contextColon !== false && colon !== false;\n var haveColon = computedColon && !vertical;\n // Remove duplicated user input colon\n if (haveColon && typeof label === 'string' && label.trim() !== '') {\n labelChildren = label.replace(/[:|:]\\s*$/, '');\n }\n // Tooltip\n var tooltipProps = toTooltipProps(tooltip);\n if (tooltipProps) {\n var _tooltipProps$icon = tooltipProps.icon,\n icon = _tooltipProps$icon === void 0 ? /*#__PURE__*/React.createElement(QuestionCircleOutlined, null) : _tooltipProps$icon,\n restTooltipProps = __rest(tooltipProps, [\"icon\"]);\n var tooltipNode = /*#__PURE__*/React.createElement(Tooltip, _extends({}, restTooltipProps), /*#__PURE__*/React.cloneElement(icon, {\n className: \"\".concat(prefixCls, \"-item-tooltip\"),\n title: '',\n onClick: function onClick(e) {\n // Prevent label behavior in tooltip icon\n // https://github.com/ant-design/ant-design/issues/46154\n e.preventDefault();\n },\n tabIndex: null\n }));\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, tooltipNode);\n }\n // Add required mark if optional\n if (requiredMark === 'optional' && !required) {\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-item-optional\"),\n title: \"\"\n }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.optional)));\n }\n var labelClassName = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item-required\"), required), \"\".concat(prefixCls, \"-item-required-mark-optional\"), requiredMark === 'optional'), \"\".concat(prefixCls, \"-item-no-colon\"), !computedColon));\n return /*#__PURE__*/React.createElement(Col, _extends({}, mergedLabelCol, {\n className: labelColClassName\n }), /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: htmlFor,\n className: labelClassName,\n title: typeof label === 'string' ? label : ''\n }, labelChildren));\n });\n};\nexport default FormItemLabel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Col from '../grid/col';\nimport { FormContext, FormItemPrefixContext } from './context';\nimport ErrorList from './ErrorList';\nvar FormItemInput = function FormItemInput(props) {\n var prefixCls = props.prefixCls,\n status = props.status,\n wrapperCol = props.wrapperCol,\n children = props.children,\n errors = props.errors,\n warnings = props.warnings,\n formItemRender = props._internalItemRender,\n extra = props.extra,\n help = props.help,\n fieldId = props.fieldId,\n marginBottom = props.marginBottom,\n onErrorVisibleChanged = props.onErrorVisibleChanged;\n var baseClassName = \"\".concat(prefixCls, \"-item\");\n var formContext = React.useContext(FormContext);\n var mergedWrapperCol = wrapperCol || formContext.wrapperCol || {};\n var className = classNames(\"\".concat(baseClassName, \"-control\"), mergedWrapperCol.className);\n // Pass to sub FormItem should not with col info\n var subFormContext = React.useMemo(function () {\n return _extends({}, formContext);\n }, [formContext]);\n delete subFormContext.labelCol;\n delete subFormContext.wrapperCol;\n var inputDom = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(baseClassName, \"-control-input\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(baseClassName, \"-control-input-content\")\n }, children));\n var formItemContext = React.useMemo(function () {\n return {\n prefixCls: prefixCls,\n status: status\n };\n }, [prefixCls, status]);\n var errorListDom = marginBottom !== null || errors.length || warnings.length ? ( /*#__PURE__*/React.createElement(\"div\", {\n style: {\n display: 'flex',\n flexWrap: 'nowrap'\n }\n }, /*#__PURE__*/React.createElement(FormItemPrefixContext.Provider, {\n value: formItemContext\n }, /*#__PURE__*/React.createElement(ErrorList, {\n fieldId: fieldId,\n errors: errors,\n warnings: warnings,\n help: help,\n helpStatus: status,\n className: \"\".concat(baseClassName, \"-explain-connected\"),\n onVisibleChanged: onErrorVisibleChanged\n })), !!marginBottom && /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: 0,\n height: marginBottom\n }\n }))) : null;\n var extraProps = {};\n if (fieldId) {\n extraProps.id = \"\".concat(fieldId, \"_extra\");\n }\n // If extra = 0, && will goes wrong\n // 0&&error -> 0\n var extraDom = extra ? ( /*#__PURE__*/React.createElement(\"div\", _extends({}, extraProps, {\n className: \"\".concat(baseClassName, \"-extra\")\n }), extra)) : null;\n var dom = formItemRender && formItemRender.mark === 'pro_table_render' && formItemRender.render ? formItemRender.render(props, {\n input: inputDom,\n errorList: errorListDom,\n extra: extraDom\n }) : ( /*#__PURE__*/React.createElement(React.Fragment, null, inputDom, errorListDom, extraDom));\n return /*#__PURE__*/React.createElement(FormContext.Provider, {\n value: subFormContext\n }, /*#__PURE__*/React.createElement(Col, _extends({}, mergedWrapperCol, {\n className: className\n }), dom));\n};\nexport default FormItemInput;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport omit from \"rc-util/es/omit\";\nimport { Row } from '../../grid';\nimport FormItemLabel from '../FormItemLabel';\nimport FormItemInput from '../FormItemInput';\nimport { FormContext, FormItemInputContext, NoStyleItemContext } from '../context';\nimport useDebounce from '../hooks/useDebounce';\nvar iconMap = {\n success: CheckCircleFilled,\n warning: ExclamationCircleFilled,\n error: CloseCircleFilled,\n validating: LoadingOutlined\n};\nexport default function ItemHolder(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n help = props.help,\n errors = props.errors,\n warnings = props.warnings,\n validateStatus = props.validateStatus,\n meta = props.meta,\n hasFeedback = props.hasFeedback,\n hidden = props.hidden,\n children = props.children,\n fieldId = props.fieldId,\n isRequired = props.isRequired,\n onSubItemMetaChange = props.onSubItemMetaChange,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"style\", \"help\", \"errors\", \"warnings\", \"validateStatus\", \"meta\", \"hasFeedback\", \"hidden\", \"children\", \"fieldId\", \"isRequired\", \"onSubItemMetaChange\"]);\n var itemPrefixCls = \"\".concat(prefixCls, \"-item\");\n var _React$useContext = React.useContext(FormContext),\n requiredMark = _React$useContext.requiredMark;\n // ======================== Margin ========================\n var itemRef = React.useRef(null);\n var debounceErrors = useDebounce(errors);\n var debounceWarnings = useDebounce(warnings);\n var hasHelp = help !== undefined && help !== null;\n var hasError = !!(hasHelp || errors.length || warnings.length);\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n marginBottom = _React$useState2[0],\n setMarginBottom = _React$useState2[1];\n useLayoutEffect(function () {\n if (hasError && itemRef.current) {\n var itemStyle = getComputedStyle(itemRef.current);\n setMarginBottom(parseInt(itemStyle.marginBottom, 10));\n }\n }, [hasError]);\n var onErrorVisibleChanged = function onErrorVisibleChanged(nextVisible) {\n if (!nextVisible) {\n setMarginBottom(null);\n }\n };\n // ======================== Status ========================\n var mergedValidateStatus = '';\n if (validateStatus !== undefined) {\n mergedValidateStatus = validateStatus;\n } else if (meta.validating) {\n mergedValidateStatus = 'validating';\n } else if (debounceErrors.length) {\n mergedValidateStatus = 'error';\n } else if (debounceWarnings.length) {\n mergedValidateStatus = 'warning';\n } else if (meta.touched) {\n mergedValidateStatus = 'success';\n }\n var formItemStatusContext = React.useMemo(function () {\n var feedbackIcon;\n if (hasFeedback) {\n var IconNode = mergedValidateStatus && iconMap[mergedValidateStatus];\n feedbackIcon = IconNode ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(\"\".concat(itemPrefixCls, \"-feedback-icon\"), \"\".concat(itemPrefixCls, \"-feedback-icon-\").concat(mergedValidateStatus))\n }, /*#__PURE__*/React.createElement(IconNode, null))) : null;\n }\n return {\n status: mergedValidateStatus,\n hasFeedback: hasFeedback,\n feedbackIcon: feedbackIcon,\n isFormItemInput: true\n };\n }, [mergedValidateStatus, hasFeedback]);\n // ======================== Render ========================\n var itemClassName = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, itemPrefixCls, true), \"\".concat(itemPrefixCls, \"-with-help\"), hasHelp || debounceErrors.length || debounceWarnings.length), \"\".concat(className), !!className), \"\".concat(itemPrefixCls, \"-has-feedback\"), mergedValidateStatus && hasFeedback), \"\".concat(itemPrefixCls, \"-has-success\"), mergedValidateStatus === 'success'), \"\".concat(itemPrefixCls, \"-has-warning\"), mergedValidateStatus === 'warning'), \"\".concat(itemPrefixCls, \"-has-error\"), mergedValidateStatus === 'error'), \"\".concat(itemPrefixCls, \"-is-validating\"), mergedValidateStatus === 'validating'), \"\".concat(itemPrefixCls, \"-hidden\"), hidden);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(itemClassName),\n style: style,\n ref: itemRef\n }, /*#__PURE__*/React.createElement(Row, _extends({\n className: \"\".concat(itemPrefixCls, \"-row\")\n }, omit(restProps, ['_internalItemRender', 'colon', 'dependencies', 'extra', 'fieldKey', 'getValueFromEvent', 'getValueProps', 'htmlFor', 'id', 'initialValue', 'isListField', 'label', 'labelAlign', 'labelCol', 'labelWrap', 'messageVariables', 'name', 'normalize', 'noStyle', 'preserve', 'required', 'requiredMark', 'rules', 'shouldUpdate', 'trigger', 'tooltip', 'validateFirst', 'validateTrigger', 'valuePropName', 'wrapperCol'])), /*#__PURE__*/React.createElement(FormItemLabel, _extends({\n htmlFor: fieldId,\n required: isRequired,\n requiredMark: requiredMark\n }, props, {\n prefixCls: prefixCls\n })), /*#__PURE__*/React.createElement(FormItemInput, _extends({}, props, meta, {\n errors: debounceErrors,\n warnings: debounceWarnings,\n prefixCls: prefixCls,\n status: mergedValidateStatus,\n help: help,\n marginBottom: marginBottom,\n onErrorVisibleChanged: onErrorVisibleChanged\n }), /*#__PURE__*/React.createElement(NoStyleItemContext.Provider, {\n value: onSubItemMetaChange\n }, /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {\n value: formItemStatusContext\n }, children)))), !!marginBottom && ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(itemPrefixCls, \"-margin-offset\"),\n style: {\n marginBottom: -marginBottom\n }\n })));\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { Field, FieldContext, ListContext } from 'rc-field-form';\nimport useState from \"rc-util/es/hooks/useState\";\nimport { supportRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport useFormItemStatus from '../hooks/useFormItemStatus';\nimport { ConfigContext } from '../../config-provider';\nimport { cloneElement, isValidElement } from '../../_util/reactNode';\nimport { tuple } from '../../_util/type';\nimport warning from '../../_util/warning';\nimport { FormContext, NoStyleItemContext } from '../context';\nimport useFrameState from '../hooks/useFrameState';\nimport useItemRef from '../hooks/useItemRef';\nimport { getFieldId, toArray } from '../util';\nimport ItemHolder from './ItemHolder';\nvar NAME_SPLIT = '__SPLIT__';\nvar ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '');\nvar MemoInput = /*#__PURE__*/React.memo(function (_ref) {\n var children = _ref.children;\n return children;\n}, function (prev, next) {\n return prev.value === next.value && prev.update === next.update && prev.childProps.length === next.childProps.length && prev.childProps.every(function (value, index) {\n return value === next.childProps[index];\n });\n});\nfunction hasValidName(name) {\n if (name === null) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Form.Item', '`null` is passed as `name` property') : void 0;\n }\n return !(name === undefined || name === null);\n}\nfunction genEmptyMeta() {\n return {\n errors: [],\n warnings: [],\n touched: false,\n validating: false,\n validated: false,\n name: []\n };\n}\nfunction InternalFormItem(props) {\n var name = props.name,\n noStyle = props.noStyle,\n dependencies = props.dependencies,\n customizePrefixCls = props.prefixCls,\n shouldUpdate = props.shouldUpdate,\n rules = props.rules,\n children = props.children,\n required = props.required,\n label = props.label,\n messageVariables = props.messageVariables,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? 'onChange' : _props$trigger,\n validateTrigger = props.validateTrigger,\n hidden = props.hidden;\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls;\n var _useContext2 = useContext(FormContext),\n formName = _useContext2.name;\n var isRenderProps = typeof children === 'function';\n var notifyParentMetaChange = useContext(NoStyleItemContext);\n var _useContext3 = useContext(FieldContext),\n contextValidateTrigger = _useContext3.validateTrigger;\n var mergedValidateTrigger = validateTrigger !== undefined ? validateTrigger : contextValidateTrigger;\n var hasName = hasValidName(name);\n var prefixCls = getPrefixCls('form', customizePrefixCls);\n // ========================= MISC =========================\n // Get `noStyle` required info\n var listContext = React.useContext(ListContext);\n var fieldKeyPathRef = React.useRef();\n // ======================== Errors ========================\n // >>>>> Collect sub field errors\n var _useFrameState = useFrameState({}),\n _useFrameState2 = _slicedToArray(_useFrameState, 2),\n subFieldErrors = _useFrameState2[0],\n setSubFieldErrors = _useFrameState2[1];\n // >>>>> Current field errors\n var _useState = useState(function () {\n return genEmptyMeta();\n }),\n _useState2 = _slicedToArray(_useState, 2),\n meta = _useState2[0],\n setMeta = _useState2[1];\n var onMetaChange = function onMetaChange(nextMeta) {\n // This keyInfo is not correct when field is removed\n // Since origin keyManager no longer keep the origin key anymore\n // Which means we need cache origin one and reuse when removed\n var keyInfo = listContext === null || listContext === void 0 ? void 0 : listContext.getKey(nextMeta.name);\n // Destroy will reset all the meta\n setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);\n // Bump to parent since noStyle\n if (noStyle && notifyParentMetaChange) {\n var namePath = nextMeta.name;\n if (!nextMeta.destroy) {\n if (keyInfo !== undefined) {\n var _keyInfo = _slicedToArray(keyInfo, 2),\n fieldKey = _keyInfo[0],\n restPath = _keyInfo[1];\n namePath = [fieldKey].concat(_toConsumableArray(restPath));\n fieldKeyPathRef.current = namePath;\n }\n } else {\n // Use origin cache data\n namePath = fieldKeyPathRef.current || namePath;\n }\n notifyParentMetaChange(nextMeta, namePath);\n }\n };\n // >>>>> Collect noStyle Field error to the top FormItem\n var onSubItemMetaChange = function onSubItemMetaChange(subMeta, uniqueKeys) {\n // Only `noStyle` sub item will trigger\n setSubFieldErrors(function (prevSubFieldErrors) {\n var clone = _extends({}, prevSubFieldErrors);\n // name: ['user', 1] + key: [4] = ['user', 4]\n var mergedNamePath = [].concat(_toConsumableArray(subMeta.name.slice(0, -1)), _toConsumableArray(uniqueKeys));\n var mergedNameKey = mergedNamePath.join(NAME_SPLIT);\n if (subMeta.destroy) {\n // Remove\n delete clone[mergedNameKey];\n } else {\n // Update\n clone[mergedNameKey] = subMeta;\n }\n return clone;\n });\n };\n // >>>>> Get merged errors\n var _React$useMemo = React.useMemo(function () {\n var errorList = _toConsumableArray(meta.errors);\n var warningList = _toConsumableArray(meta.warnings);\n Object.values(subFieldErrors).forEach(function (subFieldError) {\n errorList.push.apply(errorList, _toConsumableArray(subFieldError.errors || []));\n warningList.push.apply(warningList, _toConsumableArray(subFieldError.warnings || []));\n });\n return [errorList, warningList];\n }, [subFieldErrors, meta.errors, meta.warnings]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n mergedErrors = _React$useMemo2[0],\n mergedWarnings = _React$useMemo2[1];\n // ===================== Children Ref =====================\n var getItemRef = useItemRef();\n // ======================== Render ========================\n function renderLayout(baseChildren, fieldId, isRequired) {\n if (noStyle && !hidden) {\n return baseChildren;\n }\n return /*#__PURE__*/React.createElement(ItemHolder, _extends({\n key: \"row\"\n }, props, {\n prefixCls: prefixCls,\n fieldId: fieldId,\n isRequired: isRequired,\n errors: mergedErrors,\n warnings: mergedWarnings,\n meta: meta,\n onSubItemMetaChange: onSubItemMetaChange\n }), baseChildren);\n }\n if (!hasName && !isRenderProps && !dependencies) {\n return renderLayout(children);\n }\n var variables = {};\n if (typeof label === 'string') {\n variables.label = label;\n } else if (name) {\n variables.label = String(name);\n }\n if (messageVariables) {\n variables = _extends(_extends({}, variables), messageVariables);\n }\n // >>>>> With Field\n return /*#__PURE__*/React.createElement(Field, _extends({}, props, {\n messageVariables: variables,\n trigger: trigger,\n validateTrigger: mergedValidateTrigger,\n onMetaChange: onMetaChange\n }), function (control, renderMeta, context) {\n var mergedName = toArray(name).length && renderMeta ? renderMeta.name : [];\n var fieldId = getFieldId(mergedName, formName);\n var isRequired = required !== undefined ? required : !!(rules && rules.some(function (rule) {\n if (rule && _typeof(rule) === 'object' && rule.required && !rule.warningOnly) {\n return true;\n }\n if (typeof rule === 'function') {\n var ruleEntity = rule(context);\n return ruleEntity && ruleEntity.required && !ruleEntity.warningOnly;\n }\n return false;\n }));\n // ======================= Children =======================\n var mergedControl = _extends({}, control);\n var childNode = null;\n process.env.NODE_ENV !== \"production\" ? warning(!(shouldUpdate && dependencies), 'Form.Item', \"`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.\") : void 0;\n if (Array.isArray(children) && hasName) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Form.Item', 'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.') : void 0;\n childNode = children;\n } else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {\n process.env.NODE_ENV !== \"production\" ? warning(!!(shouldUpdate || dependencies), 'Form.Item', 'A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!hasName, 'Form.Item', 'A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.') : void 0;\n } else if (dependencies && !isRenderProps && !hasName) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Form.Item', 'Must set `name` or use a render function when `dependencies` is set.') : void 0;\n } else if (isValidElement(children)) {\n process.env.NODE_ENV !== \"production\" ? warning(children.props.defaultValue === undefined, 'Form.Item', '`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.') : void 0;\n var childProps = _extends(_extends({}, children.props), mergedControl);\n if (!childProps.id) {\n childProps.id = fieldId;\n }\n if (props.help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {\n var describedbyArr = [];\n if (props.help || mergedErrors.length > 0) {\n describedbyArr.push(\"\".concat(fieldId, \"_help\"));\n }\n if (props.extra) {\n describedbyArr.push(\"\".concat(fieldId, \"_extra\"));\n }\n childProps['aria-describedby'] = describedbyArr.join(' ');\n }\n if (mergedErrors.length > 0) {\n childProps['aria-invalid'] = 'true';\n }\n if (isRequired) {\n childProps['aria-required'] = 'true';\n }\n if (supportRef(children)) {\n childProps.ref = getItemRef(mergedName, children);\n }\n // We should keep user origin event handler\n var triggers = new Set([].concat(_toConsumableArray(toArray(trigger)), _toConsumableArray(toArray(mergedValidateTrigger))));\n triggers.forEach(function (eventName) {\n childProps[eventName] = function () {\n var _a2, _c2;\n var _a, _b, _c;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_a = mergedControl[eventName]) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [mergedControl].concat(args));\n (_c = (_b = children.props)[eventName]) === null || _c === void 0 ? void 0 : (_c2 = _c).call.apply(_c2, [_b].concat(args));\n };\n });\n // List of props that need to be watched for changes -> if changes are detected in MemoInput -> rerender\n var watchingChildProps = [childProps['aria-required'], childProps['aria-invalid'], childProps['aria-describedby']];\n childNode = /*#__PURE__*/React.createElement(MemoInput, {\n value: mergedControl[props.valuePropName || 'value'],\n update: children,\n childProps: watchingChildProps\n }, cloneElement(children, childProps));\n } else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {\n childNode = children(context);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(!mergedName.length, 'Form.Item', '`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.') : void 0;\n childNode = children;\n }\n return renderLayout(childNode, fieldId, isRequired);\n });\n}\nvar FormItem = InternalFormItem;\nFormItem.useStatus = useFormItemStatus;\nexport default FormItem;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport raf from \"rc-util/es/raf\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nexport default function useFrameState(defaultValue) {\n var _React$useState = React.useState(defaultValue),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n value = _React$useState2[0],\n setValue = _React$useState2[1];\n var frameRef = useRef(null);\n var batchRef = useRef([]);\n var destroyRef = useRef(false);\n React.useEffect(function () {\n destroyRef.current = false;\n return function () {\n destroyRef.current = true;\n raf.cancel(frameRef.current);\n frameRef.current = null;\n };\n }, []);\n function setFrameValue(updater) {\n if (destroyRef.current) {\n return;\n }\n if (frameRef.current === null) {\n batchRef.current = [];\n frameRef.current = raf(function () {\n frameRef.current = null;\n setValue(function (prevValue) {\n var current = prevValue;\n batchRef.current.forEach(function (func) {\n current = func(current);\n });\n return current;\n });\n });\n }\n batchRef.current.push(updater);\n }\n return [value, setFrameValue];\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { FormContext } from '../context';\nexport default function useItemRef() {\n var _React$useContext = React.useContext(FormContext),\n itemRef = _React$useContext.itemRef;\n var cacheRef = React.useRef({});\n function getRef(name, children) {\n var childrenRef = children && _typeof(children) === 'object' && children.ref;\n var nameStr = name.join('_');\n if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n cacheRef.current.name = nameStr;\n cacheRef.current.originRef = childrenRef;\n cacheRef.current.ref = composeRef(itemRef(name), childrenRef);\n }\n return cacheRef.current.ref;\n }\n return getRef;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { List } from 'rc-field-form';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport warning from '../_util/warning';\nimport { FormItemPrefixContext } from './context';\nvar FormList = function FormList(_a) {\n var customizePrefixCls = _a.prefixCls,\n children = _a.children,\n props = __rest(_a, [\"prefixCls\", \"children\"]);\n process.env.NODE_ENV !== \"production\" ? warning(!!props.name, 'Form.List', 'Miss `name` prop.') : void 0;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('form', customizePrefixCls);\n var contextValue = React.useMemo(function () {\n return {\n prefixCls: prefixCls,\n status: 'error'\n };\n }, [prefixCls]);\n return /*#__PURE__*/React.createElement(List, _extends({}, props), function (fields, operation, meta) {\n return /*#__PURE__*/React.createElement(FormItemPrefixContext.Provider, {\n value: contextValue\n }, children(fields.map(function (field) {\n return _extends(_extends({}, field), {\n fieldKey: field.key\n });\n }), operation, {\n errors: meta.errors,\n warnings: meta.warnings\n }));\n });\n};\nexport default FormList;","import warning from '../_util/warning';\nimport { FormProvider } from './context';\nimport ErrorList from './ErrorList';\nimport InternalForm, { useForm, useWatch } from './Form';\nimport Item from './FormItem';\nimport List from './FormList';\nimport useFormInstance from './hooks/useFormInstance';\nvar Form = InternalForm;\nForm.Item = Item;\nForm.List = List;\nForm.ErrorList = ErrorList;\nForm.useForm = useForm;\nForm.useFormInstance = useFormInstance;\nForm.useWatch = useWatch;\nForm.Provider = FormProvider;\nForm.create = function () {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Form', 'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.') : void 0;\n};\nexport default Form;","import { useContext } from 'react';\nimport { FormContext } from '../context';\nexport default function useFormInstance() {\n var _useContext = useContext(FormContext),\n form = _useContext.form;\n return form;\n}","import { createContext } from 'react';\n// ZombieJ: We export single file here since\n// ConfigProvider use this which will make loop deps\n// to import whole `rc-field-form`\nexport default /*#__PURE__*/createContext(undefined);","import { createContext } from 'react';\nvar RowContext = /*#__PURE__*/createContext({});\nexport default RowContext;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport RowContext from './RowContext';\nfunction parseFlex(flex) {\n if (typeof flex === 'number') {\n return \"\".concat(flex, \" \").concat(flex, \" auto\");\n }\n if (/^\\d+(\\.\\d+)?(px|em|rem|%)$/.test(flex)) {\n return \"0 0 \".concat(flex);\n }\n return flex;\n}\nvar sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];\nvar Col = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var _React$useContext2 = React.useContext(RowContext),\n gutter = _React$useContext2.gutter,\n wrap = _React$useContext2.wrap,\n supportFlexGap = _React$useContext2.supportFlexGap;\n var customizePrefixCls = props.prefixCls,\n span = props.span,\n order = props.order,\n offset = props.offset,\n push = props.push,\n pull = props.pull,\n className = props.className,\n children = props.children,\n flex = props.flex,\n style = props.style,\n others = __rest(props, [\"prefixCls\", \"span\", \"order\", \"offset\", \"push\", \"pull\", \"className\", \"children\", \"flex\", \"style\"]);\n var prefixCls = getPrefixCls('col', customizePrefixCls);\n var sizeClassObj = {};\n sizes.forEach(function (size) {\n var sizeProps = {};\n var propSize = props[size];\n if (typeof propSize === 'number') {\n sizeProps.span = propSize;\n } else if (_typeof(propSize) === 'object') {\n sizeProps = propSize || {};\n }\n delete others[size];\n sizeClassObj = _extends(_extends({}, sizeClassObj), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size, \"-\").concat(sizeProps.span), sizeProps.span !== undefined), \"\".concat(prefixCls, \"-\").concat(size, \"-order-\").concat(sizeProps.order), sizeProps.order || sizeProps.order === 0), \"\".concat(prefixCls, \"-\").concat(size, \"-offset-\").concat(sizeProps.offset), sizeProps.offset || sizeProps.offset === 0), \"\".concat(prefixCls, \"-\").concat(size, \"-push-\").concat(sizeProps.push), sizeProps.push || sizeProps.push === 0), \"\".concat(prefixCls, \"-\").concat(size, \"-pull-\").concat(sizeProps.pull), sizeProps.pull || sizeProps.pull === 0), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'));\n });\n var classes = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(span), span !== undefined), \"\".concat(prefixCls, \"-order-\").concat(order), order), \"\".concat(prefixCls, \"-offset-\").concat(offset), offset), \"\".concat(prefixCls, \"-push-\").concat(push), push), \"\".concat(prefixCls, \"-pull-\").concat(pull), pull), className, sizeClassObj);\n var mergedStyle = {};\n // Horizontal gutter use padding\n if (gutter && gutter[0] > 0) {\n var horizontalGutter = gutter[0] / 2;\n mergedStyle.paddingLeft = horizontalGutter;\n mergedStyle.paddingRight = horizontalGutter;\n }\n // Vertical gutter use padding when gap not support\n if (gutter && gutter[1] > 0 && !supportFlexGap) {\n var verticalGutter = gutter[1] / 2;\n mergedStyle.paddingTop = verticalGutter;\n mergedStyle.paddingBottom = verticalGutter;\n }\n if (flex) {\n mergedStyle.flex = parseFlex(flex);\n // Hack for Firefox to avoid size issue\n // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553\n if (wrap === false && !mergedStyle.minWidth) {\n mergedStyle.minWidth = 0;\n }\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n style: _extends(_extends({}, mergedStyle), style),\n className: classes,\n ref: ref\n }), children);\n});\nif (process.env.NODE_ENV !== 'production') {\n Col.displayName = 'Col';\n}\nexport default Col;","import { useEffect, useRef } from 'react';\nimport useForceUpdate from '../../_util/hooks/useForceUpdate';\nimport ResponsiveObserve from '../../_util/responsiveObserve';\nfunction useBreakpoint() {\n var refreshOnChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var screensRef = useRef({});\n var forceUpdate = useForceUpdate();\n useEffect(function () {\n var token = ResponsiveObserve.subscribe(function (supportScreens) {\n screensRef.current = supportScreens;\n if (refreshOnChange) {\n forceUpdate();\n }\n });\n return function () {\n return ResponsiveObserve.unsubscribe(token);\n };\n }, []);\n return screensRef.current;\n}\nexport default useBreakpoint;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useFlexGapSupport from '../_util/hooks/useFlexGapSupport';\nimport ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve';\nimport { tuple } from '../_util/type';\nimport RowContext from './RowContext';\nvar RowAligns = tuple('top', 'middle', 'bottom', 'stretch');\nvar RowJustify = tuple('start', 'end', 'center', 'space-around', 'space-between', 'space-evenly');\nfunction useMergePropByScreen(oriProp, screen) {\n var _React$useState = React.useState(typeof oriProp === 'string' ? oriProp : ''),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n prop = _React$useState2[0],\n setProp = _React$useState2[1];\n var clacMergeAlignOrJustify = function clacMergeAlignOrJustify() {\n if (typeof oriProp === 'string') {\n setProp(oriProp);\n }\n if (_typeof(oriProp) !== 'object') {\n return;\n }\n for (var i = 0; i < responsiveArray.length; i++) {\n var breakpoint = responsiveArray[i];\n // if do not match, do nothing\n if (!screen[breakpoint]) continue;\n var curVal = oriProp[breakpoint];\n if (curVal !== undefined) {\n setProp(curVal);\n return;\n }\n }\n };\n React.useEffect(function () {\n clacMergeAlignOrJustify();\n }, [JSON.stringify(oriProp), screen]);\n return prop;\n}\nvar Row = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n justify = props.justify,\n align = props.align,\n className = props.className,\n style = props.style,\n children = props.children,\n _props$gutter = props.gutter,\n gutter = _props$gutter === void 0 ? 0 : _props$gutter,\n wrap = props.wrap,\n others = __rest(props, [\"prefixCls\", \"justify\", \"align\", \"className\", \"style\", \"children\", \"gutter\", \"wrap\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var _React$useState3 = React.useState({\n xs: true,\n sm: true,\n md: true,\n lg: true,\n xl: true,\n xxl: true\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n screens = _React$useState4[0],\n setScreens = _React$useState4[1];\n // to save screens info when responsiveObserve callback had been call\n var _React$useState5 = React.useState({\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n curScreens = _React$useState6[0],\n setCurScreens = _React$useState6[1];\n // ================================== calc reponsive data ==================================\n var mergeAlign = useMergePropByScreen(align, curScreens);\n var mergeJustify = useMergePropByScreen(justify, curScreens);\n var supportFlexGap = useFlexGapSupport();\n var gutterRef = React.useRef(gutter);\n // ================================== Effect ==================================\n React.useEffect(function () {\n var token = ResponsiveObserve.subscribe(function (screen) {\n setCurScreens(screen);\n var currentGutter = gutterRef.current || 0;\n if (!Array.isArray(currentGutter) && _typeof(currentGutter) === 'object' || Array.isArray(currentGutter) && (_typeof(currentGutter[0]) === 'object' || _typeof(currentGutter[1]) === 'object')) {\n setScreens(screen);\n }\n });\n return function () {\n return ResponsiveObserve.unsubscribe(token);\n };\n }, []);\n // ================================== Render ==================================\n var getGutter = function getGutter() {\n var results = [undefined, undefined];\n var normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, undefined];\n normalizedGutter.forEach(function (g, index) {\n if (_typeof(g) === 'object') {\n for (var i = 0; i < responsiveArray.length; i++) {\n var breakpoint = responsiveArray[i];\n if (screens[breakpoint] && g[breakpoint] !== undefined) {\n results[index] = g[breakpoint];\n break;\n }\n }\n } else {\n results[index] = g;\n }\n });\n return results;\n };\n var prefixCls = getPrefixCls('row', customizePrefixCls);\n var gutters = getGutter();\n var classes = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-no-wrap\"), wrap === false), \"\".concat(prefixCls, \"-\").concat(mergeJustify), mergeJustify), \"\".concat(prefixCls, \"-\").concat(mergeAlign), mergeAlign), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n // Add gutter related style\n var rowStyle = {};\n var horizontalGutter = gutters[0] != null && gutters[0] > 0 ? gutters[0] / -2 : undefined;\n var verticalGutter = gutters[1] != null && gutters[1] > 0 ? gutters[1] / -2 : undefined;\n if (horizontalGutter) {\n rowStyle.marginLeft = horizontalGutter;\n rowStyle.marginRight = horizontalGutter;\n }\n if (supportFlexGap) {\n // Set gap direct if flex gap support\n var _gutters = _slicedToArray(gutters, 2);\n rowStyle.rowGap = _gutters[1];\n } else if (verticalGutter) {\n rowStyle.marginTop = verticalGutter;\n rowStyle.marginBottom = verticalGutter;\n }\n // \"gutters\" is a new array in each rendering phase, it'll make 'React.useMemo' effectless.\n // So we deconstruct \"gutters\" variable here.\n var _gutters2 = _slicedToArray(gutters, 2),\n gutterH = _gutters2[0],\n gutterV = _gutters2[1];\n var rowContext = React.useMemo(function () {\n return {\n gutter: [gutterH, gutterV],\n wrap: wrap,\n supportFlexGap: supportFlexGap\n };\n }, [gutterH, gutterV, wrap, supportFlexGap]);\n return /*#__PURE__*/React.createElement(RowContext.Provider, {\n value: rowContext\n }, /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classes,\n style: _extends(_extends({}, rowStyle), style),\n ref: ref\n }), children));\n});\nif (process.env.NODE_ENV !== 'production') {\n Row.displayName = 'Row';\n}\nexport default Row;","export function hasAddon(props) {\n return !!(props.addonBefore || props.addonAfter);\n}\nexport function hasPrefixSuffix(props) {\n return !!(props.prefix || props.suffix || props.allowClear);\n}\nexport function resolveOnChange(target, e, onChange, targetValue) {\n if (!onChange) {\n return;\n }\n\n var event = e;\n\n if (e.type === 'click') {\n // Clone a new target for event.\n // Avoid the following usage, the setQuery method gets the original value.\n //\n // const [query, setQuery] = React.useState('');\n // {\n // setQuery((prevStatus) => e.target.value);\n // }}\n // />\n var currentTarget = target.cloneNode(true); // click clear icon\n\n event = Object.create(e, {\n target: {\n value: currentTarget\n },\n currentTarget: {\n value: currentTarget\n }\n });\n currentTarget.value = '';\n onChange(event);\n return;\n } // Trigger by composition event, this means we need force change the input value\n\n\n if (targetValue !== undefined) {\n event = Object.create(e, {\n target: {\n value: target\n },\n currentTarget: {\n value: target\n }\n });\n target.value = targetValue;\n onChange(event);\n return;\n }\n\n onChange(event);\n}\nexport function triggerFocus(element, option) {\n if (!element) return;\n element.focus(option); // Selection content\n\n var _ref = option || {},\n cursor = _ref.cursor;\n\n if (cursor) {\n var len = element.value.length;\n\n switch (cursor) {\n case 'start':\n element.setSelectionRange(0, 0);\n break;\n\n case 'end':\n element.setSelectionRange(len, len);\n break;\n\n default:\n element.setSelectionRange(0, len);\n }\n }\n}\nexport function fixControlledValue(value) {\n if (typeof value === 'undefined' || value === null) {\n return '';\n }\n\n return String(value);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React, { cloneElement, useRef } from 'react';\nimport classNames from 'classnames';\nimport { hasAddon, hasPrefixSuffix } from \"./utils/commonUtils\";\n\nvar BaseInput = function BaseInput(props) {\n var inputElement = props.inputElement,\n prefixCls = props.prefixCls,\n prefix = props.prefix,\n suffix = props.suffix,\n addonBefore = props.addonBefore,\n addonAfter = props.addonAfter,\n className = props.className,\n style = props.style,\n affixWrapperClassName = props.affixWrapperClassName,\n groupClassName = props.groupClassName,\n wrapperClassName = props.wrapperClassName,\n disabled = props.disabled,\n readOnly = props.readOnly,\n focused = props.focused,\n triggerFocus = props.triggerFocus,\n allowClear = props.allowClear,\n value = props.value,\n handleReset = props.handleReset,\n hidden = props.hidden;\n var containerRef = useRef(null);\n\n var onInputClick = function onInputClick(e) {\n var _containerRef$current;\n\n if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e.target)) {\n triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();\n }\n }; // ================== Clear Icon ================== //\n\n\n var getClearIcon = function getClearIcon() {\n var _classNames;\n\n if (!allowClear) {\n return null;\n }\n\n var needClear = !disabled && !readOnly && value;\n var clearIconCls = \"\".concat(prefixCls, \"-clear-icon\");\n var iconNode = _typeof(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : '✖';\n return /*#__PURE__*/React.createElement(\"span\", {\n onClick: handleReset // Do not trigger onBlur when clear input\n // https://github.com/ant-design/ant-design/issues/31200\n ,\n onMouseDown: function onMouseDown(e) {\n return e.preventDefault();\n },\n className: classNames(clearIconCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(clearIconCls, \"-hidden\"), !needClear), _defineProperty(_classNames, \"\".concat(clearIconCls, \"-has-suffix\"), !!suffix), _classNames)),\n role: \"button\",\n tabIndex: -1\n }, iconNode);\n };\n\n var element = /*#__PURE__*/cloneElement(inputElement, {\n value: value,\n hidden: hidden\n }); // ================== Prefix & Suffix ================== //\n\n if (hasPrefixSuffix(props)) {\n var _classNames2;\n\n var affixWrapperPrefixCls = \"\".concat(prefixCls, \"-affix-wrapper\");\n var affixWrapperCls = classNames(affixWrapperPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-focused\"), focused), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames2, \"\".concat(affixWrapperPrefixCls, \"-input-with-clear-btn\"), suffix && allowClear && value), _classNames2), !hasAddon(props) && className, affixWrapperClassName);\n var suffixNode = (suffix || allowClear) && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, getClearIcon(), suffix);\n element = /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: style,\n hidden: !hasAddon(props) && hidden,\n onClick: onInputClick,\n ref: containerRef\n }, prefix && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prefix\")\n }, prefix), /*#__PURE__*/cloneElement(inputElement, {\n style: null,\n value: value,\n hidden: null\n }), suffixNode);\n } // ================== Addon ================== //\n\n\n if (hasAddon(props)) {\n var wrapperCls = \"\".concat(prefixCls, \"-group\");\n var addonCls = \"\".concat(wrapperCls, \"-addon\");\n var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperCls, wrapperClassName);\n var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), className, groupClassName); // Need another wrapper for changing display:table to display:inline-block\n // and put style prop in wrapper\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: mergedGroupClassName,\n style: style,\n hidden: hidden\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: mergedWrapperClassName\n }, addonBefore && /*#__PURE__*/React.createElement(\"span\", {\n className: addonCls\n }, addonBefore), /*#__PURE__*/cloneElement(element, {\n style: null,\n hidden: null\n }), addonAfter && /*#__PURE__*/React.createElement(\"span\", {\n className: addonCls\n }, addonAfter)));\n }\n\n return element;\n};\n\nexport default BaseInput;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"autoComplete\", \"onChange\", \"onFocus\", \"onBlur\", \"onPressEnter\", \"onKeyDown\", \"prefixCls\", \"disabled\", \"htmlSize\", \"className\", \"maxLength\", \"suffix\", \"showCount\", \"type\", \"inputClassName\"];\nimport React, { useRef, useState, forwardRef, useImperativeHandle, useEffect } from 'react';\nimport BaseInput from \"./BaseInput\";\nimport omit from \"rc-util/es/omit\";\nimport { fixControlledValue, hasAddon, hasPrefixSuffix, resolveOnChange, triggerFocus } from \"./utils/commonUtils\";\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nvar Input = /*#__PURE__*/forwardRef(function (props, ref) {\n var autoComplete = props.autoComplete,\n onChange = props.onChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onPressEnter = props.onPressEnter,\n onKeyDown = props.onKeyDown,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-input' : _props$prefixCls,\n disabled = props.disabled,\n htmlSize = props.htmlSize,\n className = props.className,\n maxLength = props.maxLength,\n suffix = props.suffix,\n showCount = props.showCount,\n _props$type = props.type,\n type = _props$type === void 0 ? 'text' : _props$type,\n inputClassName = props.inputClassName,\n rest = _objectWithoutProperties(props, _excluded);\n\n var _useMergedState = useMergedState(props.defaultValue, {\n value: props.value\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n value = _useMergedState2[0],\n setValue = _useMergedState2[1];\n\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n focused = _useState2[0],\n setFocused = _useState2[1];\n\n var inputRef = useRef(null);\n\n var focus = function focus(option) {\n if (inputRef.current) {\n triggerFocus(inputRef.current, option);\n }\n };\n\n useImperativeHandle(ref, function () {\n return {\n focus: focus,\n blur: function blur() {\n var _inputRef$current;\n\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();\n },\n setSelectionRange: function setSelectionRange(start, end, direction) {\n var _inputRef$current2;\n\n (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setSelectionRange(start, end, direction);\n },\n select: function select() {\n var _inputRef$current3;\n\n (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.select();\n },\n input: inputRef.current\n };\n });\n useEffect(function () {\n setFocused(function (prev) {\n return prev && disabled ? false : prev;\n });\n }, [disabled]);\n\n var handleChange = function handleChange(e) {\n if (props.value === undefined) {\n setValue(e.target.value);\n }\n\n if (inputRef.current) {\n resolveOnChange(inputRef.current, e, onChange);\n }\n };\n\n var handleKeyDown = function handleKeyDown(e) {\n if (onPressEnter && e.key === 'Enter') {\n onPressEnter(e);\n }\n\n onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);\n };\n\n var handleFocus = function handleFocus(e) {\n setFocused(true);\n onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);\n };\n\n var handleBlur = function handleBlur(e) {\n setFocused(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);\n };\n\n var handleReset = function handleReset(e) {\n setValue('');\n focus();\n\n if (inputRef.current) {\n resolveOnChange(inputRef.current, e, onChange);\n }\n };\n\n var getInputElement = function getInputElement() {\n // Fix https://fb.me/react-unknown-prop\n var otherProps = omit(props, ['prefixCls', 'onPressEnter', 'addonBefore', 'addonAfter', 'prefix', 'suffix', 'allowClear', // Input elements must be either controlled or uncontrolled,\n // specify either the value prop, or the defaultValue prop, but not both.\n 'defaultValue', 'showCount', 'affixWrapperClassName', 'groupClassName', 'inputClassName', 'wrapperClassName', 'htmlSize']);\n return /*#__PURE__*/React.createElement(\"input\", _extends({\n autoComplete: autoComplete\n }, otherProps, {\n onChange: handleChange,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n className: classNames(prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled), inputClassName, !hasAddon(props) && !hasPrefixSuffix(props) && className),\n ref: inputRef,\n size: htmlSize,\n type: type\n }));\n };\n\n var getSuffix = function getSuffix() {\n // Max length value\n var hasMaxLength = Number(maxLength) > 0;\n\n if (suffix || showCount) {\n var val = fixControlledValue(value);\n\n var valueLength = _toConsumableArray(val).length;\n\n var dataCount = _typeof(showCount) === 'object' ? showCount.formatter({\n value: val,\n count: valueLength,\n maxLength: maxLength\n }) : \"\".concat(valueLength).concat(hasMaxLength ? \" / \".concat(maxLength) : '');\n return /*#__PURE__*/React.createElement(React.Fragment, null, !!showCount && /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(\"\".concat(prefixCls, \"-show-count-suffix\"), _defineProperty({}, \"\".concat(prefixCls, \"-show-count-has-suffix\"), !!suffix))\n }, dataCount), suffix);\n }\n\n return null;\n };\n\n return /*#__PURE__*/React.createElement(BaseInput, _extends({}, rest, {\n prefixCls: prefixCls,\n className: className,\n inputElement: getInputElement(),\n handleReset: handleReset,\n value: fixControlledValue(value),\n focused: focused,\n triggerFocus: focus,\n suffix: getSuffix(),\n disabled: disabled\n }));\n});\nexport default Input;","import BaseInput from \"./BaseInput\";\nimport Input from \"./Input\";\nexport { BaseInput };\nexport default Input;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport classNames from 'classnames';\nimport RcInput from 'rc-input';\nimport { composeRef } from \"rc-util/es/ref\";\nimport React, { forwardRef, useContext, useEffect, useRef } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { FormItemInputContext, NoFormStyle } from '../form/context';\nimport { NoCompactStyle, useCompactItemContext } from '../space/Compact';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport warning from '../_util/warning';\nimport useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';\nimport { hasPrefixSuffix } from './utils';\nexport function fixControlledValue(value) {\n if (typeof value === 'undefined' || value === null) {\n return '';\n }\n return String(value);\n}\nexport function resolveOnChange(target, e, onChange, targetValue) {\n if (!onChange) {\n return;\n }\n var event = e;\n if (e.type === 'click') {\n // Clone a new target for event.\n // Avoid the following usage, the setQuery method gets the original value.\n //\n // const [query, setQuery] = React.useState('');\n // {\n // setQuery((prevStatus) => e.target.value);\n // }}\n // />\n var currentTarget = target.cloneNode(true);\n // click clear icon\n event = Object.create(e, {\n target: {\n value: currentTarget\n },\n currentTarget: {\n value: currentTarget\n }\n });\n currentTarget.value = '';\n onChange(event);\n return;\n }\n // Trigger by composition event, this means we need force change the input value\n if (targetValue !== undefined) {\n event = Object.create(e, {\n target: {\n value: target\n },\n currentTarget: {\n value: target\n }\n });\n target.value = targetValue;\n onChange(event);\n return;\n }\n onChange(event);\n}\nexport function triggerFocus(element, option) {\n if (!element) {\n return;\n }\n element.focus(option);\n // Selection content\n var _ref = option || {},\n cursor = _ref.cursor;\n if (cursor) {\n var len = element.value.length;\n switch (cursor) {\n case 'start':\n element.setSelectionRange(0, 0);\n break;\n case 'end':\n element.setSelectionRange(len, len);\n break;\n default:\n element.setSelectionRange(0, len);\n break;\n }\n }\n}\nvar Input = /*#__PURE__*/forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n _props$bordered = props.bordered,\n bordered = _props$bordered === void 0 ? true : _props$bordered,\n customStatus = props.status,\n customSize = props.size,\n customDisabled = props.disabled,\n onBlur = props.onBlur,\n onFocus = props.onFocus,\n suffix = props.suffix,\n allowClear = props.allowClear,\n addonAfter = props.addonAfter,\n addonBefore = props.addonBefore,\n className = props.className,\n onChange = props.onChange,\n rest = __rest(props, [\"prefixCls\", \"bordered\", \"status\", \"size\", \"disabled\", \"onBlur\", \"onFocus\", \"suffix\", \"allowClear\", \"addonAfter\", \"addonBefore\", \"className\", \"onChange\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction,\n input = _React$useContext.input;\n var prefixCls = getPrefixCls('input', customizePrefixCls);\n var inputRef = useRef(null);\n // ===================== Compact Item =====================\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n // ===================== Size =====================\n var size = React.useContext(SizeContext);\n var mergedSize = compactSize || customSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n // ===================== Status =====================\n var _useContext = useContext(FormItemInputContext),\n contextStatus = _useContext.status,\n hasFeedback = _useContext.hasFeedback,\n feedbackIcon = _useContext.feedbackIcon;\n var mergedStatus = getMergedStatus(contextStatus, customStatus);\n // ===================== Focus warning =====================\n var inputHasPrefixSuffix = hasPrefixSuffix(props) || !!hasFeedback;\n var prevHasPrefixSuffix = useRef(inputHasPrefixSuffix);\n useEffect(function () {\n var _a;\n if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current) {\n process.env.NODE_ENV !== \"production\" ? warning(document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input), 'Input', \"When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ\") : void 0;\n }\n prevHasPrefixSuffix.current = inputHasPrefixSuffix;\n }, [inputHasPrefixSuffix]);\n // ===================== Remove Password value =====================\n var removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);\n var handleBlur = function handleBlur(e) {\n removePasswordTimeout();\n onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);\n };\n var handleFocus = function handleFocus(e) {\n removePasswordTimeout();\n onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);\n };\n var handleChange = function handleChange(e) {\n removePasswordTimeout();\n onChange === null || onChange === void 0 ? void 0 : onChange(e);\n };\n var suffixNode = (hasFeedback || suffix) && ( /*#__PURE__*/React.createElement(React.Fragment, null, suffix, hasFeedback && feedbackIcon));\n // Allow clear\n var mergedAllowClear;\n if (_typeof(allowClear) === 'object' && (allowClear === null || allowClear === void 0 ? void 0 : allowClear.clearIcon)) {\n mergedAllowClear = allowClear;\n } else if (allowClear) {\n mergedAllowClear = {\n clearIcon: /*#__PURE__*/React.createElement(CloseCircleFilled, null)\n };\n }\n return /*#__PURE__*/React.createElement(RcInput, _extends({\n ref: composeRef(ref, inputRef),\n prefixCls: prefixCls,\n autoComplete: input === null || input === void 0 ? void 0 : input.autoComplete\n }, rest, {\n disabled: mergedDisabled || undefined,\n onBlur: handleBlur,\n onFocus: handleFocus,\n suffix: suffixNode,\n allowClear: mergedAllowClear,\n className: classNames(className, compactItemClassnames),\n onChange: handleChange,\n addonAfter: addonAfter && ( /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n override: true,\n status: true\n }, addonAfter))),\n addonBefore: addonBefore && ( /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n override: true,\n status: true\n }, addonBefore))),\n inputClassName: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-sm\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-lg\"), mergedSize === 'large'), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-borderless\"), !bordered), !inputHasPrefixSuffix && getStatusClassNames(prefixCls, mergedStatus)),\n affixWrapperClassName: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-affix-wrapper-sm\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-affix-wrapper-lg\"), mergedSize === 'large'), \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), getStatusClassNames(\"\".concat(prefixCls, \"-affix-wrapper\"), mergedStatus, hasFeedback)),\n wrapperClassName: classNames(_defineProperty({}, \"\".concat(prefixCls, \"-group-rtl\"), direction === 'rtl')),\n groupClassName: classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-group-wrapper-sm\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-group-wrapper-lg\"), mergedSize === 'large'), \"\".concat(prefixCls, \"-group-wrapper-rtl\"), direction === 'rtl'), getStatusClassNames(\"\".concat(prefixCls, \"-group-wrapper\"), mergedStatus, hasFeedback))\n }));\n});\nexport default Input;","// eslint-disable-next-line import/prefer-default-export\nexport function hasPrefixSuffix(props) {\n return !!(props.prefix || props.suffix || props.allowClear);\n}","// Thanks to https://github.com/andreypopp/react-textarea-autosize/\n/**\n * calculateNodeHeight(uiTextNode, useCache = false)\n */\nvar HIDDEN_TEXTAREA_STYLE = \"\\n min-height:0 !important;\\n max-height:none !important;\\n height:0 !important;\\n visibility:hidden !important;\\n overflow:hidden !important;\\n position:absolute !important;\\n z-index:-1000 !important;\\n top:0 !important;\\n right:0 !important;\\n pointer-events: none !important;\\n\";\nvar SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break'];\nvar computedStyleCache = {};\nvar hiddenTextarea;\nexport function calculateNodeStyling(node) {\n var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');\n if (useCache && computedStyleCache[nodeRef]) {\n return computedStyleCache[nodeRef];\n }\n var style = window.getComputedStyle(node);\n var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');\n var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));\n var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));\n var sizingStyle = SIZING_STYLE.map(function (name) {\n return \"\".concat(name, \":\").concat(style.getPropertyValue(name));\n }).join(';');\n var nodeInfo = {\n sizingStyle: sizingStyle,\n paddingSize: paddingSize,\n borderSize: borderSize,\n boxSizing: boxSizing\n };\n if (useCache && nodeRef) {\n computedStyleCache[nodeRef] = nodeInfo;\n }\n return nodeInfo;\n}\nexport default function calculateAutoSizeStyle(uiTextNode) {\n var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement('textarea');\n hiddenTextarea.setAttribute('tab-index', '-1');\n hiddenTextarea.setAttribute('aria-hidden', 'true');\n document.body.appendChild(hiddenTextarea);\n }\n // Fix wrap=\"off\" issue\n // https://github.com/ant-design/ant-design/issues/6577\n if (uiTextNode.getAttribute('wrap')) {\n hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));\n } else {\n hiddenTextarea.removeAttribute('wrap');\n }\n // Copy all CSS properties that have an impact on the height of the content in\n // the textbox\n var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),\n paddingSize = _calculateNodeStyling.paddingSize,\n borderSize = _calculateNodeStyling.borderSize,\n boxSizing = _calculateNodeStyling.boxSizing,\n sizingStyle = _calculateNodeStyling.sizingStyle;\n // Need to have the overflow attribute to hide the scrollbar otherwise\n // text-lines will not calculated properly as the shadow will technically be\n // narrower for content\n hiddenTextarea.setAttribute('style', \"\".concat(sizingStyle, \";\").concat(HIDDEN_TEXTAREA_STYLE));\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';\n var minHeight = undefined;\n var maxHeight = undefined;\n var overflowY;\n var height = hiddenTextarea.scrollHeight;\n if (boxSizing === 'border-box') {\n // border-box: add border, since height = content + padding + border\n height += borderSize;\n } else if (boxSizing === 'content-box') {\n // remove padding, since height = content\n height -= paddingSize;\n }\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = ' ';\n var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows;\n if (boxSizing === 'border-box') {\n minHeight = minHeight + paddingSize + borderSize;\n }\n height = Math.max(minHeight, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows;\n if (boxSizing === 'border-box') {\n maxHeight = maxHeight + paddingSize + borderSize;\n }\n overflowY = height > maxHeight ? '' : 'hidden';\n height = Math.min(maxHeight, height);\n }\n }\n var style = {\n height: height,\n overflowY: overflowY,\n resize: 'none'\n };\n if (minHeight) {\n style.minHeight = minHeight;\n }\n if (maxHeight) {\n style.maxHeight = maxHeight;\n }\n return style;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"onPressEnter\", \"defaultValue\", \"value\", \"autoSize\", \"onResize\", \"className\", \"style\", \"disabled\", \"onChange\", \"onInternalAutoSize\"];\nimport * as React from 'react';\nimport ResizeObserver from 'rc-resize-observer';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport raf from \"rc-util/es/raf\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport classNames from 'classnames';\nimport calculateAutoSizeStyle from './calculateNodeHeight';\nvar RESIZE_START = 0;\nvar RESIZE_MEASURING = 1;\nvar RESIZE_STABLE = 2;\nvar ResizableTextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-textarea' : _props$prefixCls,\n onPressEnter = props.onPressEnter,\n defaultValue = props.defaultValue,\n value = props.value,\n autoSize = props.autoSize,\n onResize = props.onResize,\n className = props.className,\n style = props.style,\n disabled = props.disabled,\n onChange = props.onChange,\n onInternalAutoSize = props.onInternalAutoSize,\n restProps = _objectWithoutProperties(props, _excluded);\n // =============================== Value ================================\n var _useMergedState = useMergedState(defaultValue, {\n value: value,\n postState: function postState(val) {\n return val !== null && val !== void 0 ? val : '';\n }\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setMergedValue = _useMergedState2[1];\n var onInternalChange = function onInternalChange(event) {\n setMergedValue(event.target.value);\n onChange === null || onChange === void 0 ? void 0 : onChange(event);\n };\n // ================================ Ref =================================\n var textareaRef = React.useRef();\n React.useImperativeHandle(ref, function () {\n return {\n textArea: textareaRef.current\n };\n });\n // ============================== AutoSize ==============================\n var _React$useMemo = React.useMemo(function () {\n if (autoSize && _typeof(autoSize) === 'object') {\n return [autoSize.minRows, autoSize.maxRows];\n }\n return [];\n }, [autoSize]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n minRows = _React$useMemo2[0],\n maxRows = _React$useMemo2[1];\n var needAutoSize = !!autoSize;\n // =============================== Scroll ===============================\n // https://github.com/ant-design/ant-design/issues/21870\n var fixFirefoxAutoScroll = function fixFirefoxAutoScroll() {\n try {\n // FF has bug with jump of scroll to top. We force back here.\n if (document.activeElement === textareaRef.current) {\n var _textareaRef$current = textareaRef.current,\n selectionStart = _textareaRef$current.selectionStart,\n selectionEnd = _textareaRef$current.selectionEnd,\n scrollTop = _textareaRef$current.scrollTop;\n // Fix Safari bug which not rollback when break line\n // This makes Chinese IME can't input. Do not fix this\n // const { value: tmpValue } = textareaRef.current;\n // textareaRef.current.value = '';\n // textareaRef.current.value = tmpValue;\n textareaRef.current.setSelectionRange(selectionStart, selectionEnd);\n textareaRef.current.scrollTop = scrollTop;\n }\n } catch (e) {\n // Fix error in Chrome:\n // Failed to read the 'selectionStart' property from 'HTMLInputElement'\n // http://stackoverflow.com/q/21177489/3040605\n }\n };\n // =============================== Resize ===============================\n var _React$useState = React.useState(RESIZE_STABLE),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n resizeState = _React$useState2[0],\n setResizeState = _React$useState2[1];\n var _React$useState3 = React.useState(),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n autoSizeStyle = _React$useState4[0],\n setAutoSizeStyle = _React$useState4[1];\n var startResize = function startResize() {\n setResizeState(RESIZE_START);\n if (process.env.NODE_ENV === 'test') {\n onInternalAutoSize === null || onInternalAutoSize === void 0 ? void 0 : onInternalAutoSize();\n }\n };\n // Change to trigger resize measure\n useLayoutEffect(function () {\n if (needAutoSize) {\n startResize();\n }\n }, [value, minRows, maxRows, needAutoSize]);\n useLayoutEffect(function () {\n if (resizeState === RESIZE_START) {\n setResizeState(RESIZE_MEASURING);\n } else if (resizeState === RESIZE_MEASURING) {\n var textareaStyles = calculateAutoSizeStyle(textareaRef.current, false, minRows, maxRows);\n // Safari has bug that text will keep break line on text cut when it's prev is break line.\n // ZombieJ: This not often happen. So we just skip it.\n // const { selectionStart, selectionEnd, scrollTop } = textareaRef.current;\n // const { value: tmpValue } = textareaRef.current;\n // textareaRef.current.value = '';\n // textareaRef.current.value = tmpValue;\n // if (document.activeElement === textareaRef.current) {\n // textareaRef.current.scrollTop = scrollTop;\n // textareaRef.current.setSelectionRange(selectionStart, selectionEnd);\n // }\n setResizeState(RESIZE_STABLE);\n setAutoSizeStyle(textareaStyles);\n } else {\n fixFirefoxAutoScroll();\n }\n }, [resizeState]);\n // We lock resize trigger by raf to avoid Safari warning\n var resizeRafRef = React.useRef();\n var cleanRaf = function cleanRaf() {\n raf.cancel(resizeRafRef.current);\n };\n var onInternalResize = function onInternalResize(size) {\n if (resizeState === RESIZE_STABLE) {\n onResize === null || onResize === void 0 ? void 0 : onResize(size);\n if (autoSize) {\n cleanRaf();\n resizeRafRef.current = raf(function () {\n startResize();\n });\n }\n }\n };\n React.useEffect(function () {\n return cleanRaf;\n }, []);\n // =============================== Render ===============================\n var mergedAutoSizeStyle = needAutoSize ? autoSizeStyle : null;\n var mergedStyle = _objectSpread(_objectSpread({}, style), mergedAutoSizeStyle);\n if (resizeState === RESIZE_START || resizeState === RESIZE_MEASURING) {\n mergedStyle.overflowY = 'hidden';\n mergedStyle.overflowX = 'hidden';\n }\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onInternalResize,\n disabled: !(autoSize || onResize)\n }, /*#__PURE__*/React.createElement(\"textarea\", _extends({}, restProps, {\n ref: textareaRef,\n style: mergedStyle,\n className: classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled)),\n disabled: disabled,\n value: mergedValue,\n onChange: onInternalChange\n })));\n});\nexport default ResizableTextArea;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport ResizableTextArea from './ResizableTextArea';\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n _inherits(TextArea, _React$Component);\n var _super = _createSuper(TextArea);\n function TextArea(props) {\n var _this;\n _classCallCheck(this, TextArea);\n _this = _super.call(this, props);\n _this.resizableTextArea = void 0;\n _this.focus = function () {\n _this.resizableTextArea.textArea.focus();\n };\n _this.saveTextArea = function (resizableTextArea) {\n _this.resizableTextArea = resizableTextArea;\n };\n _this.handleChange = function (e) {\n var onChange = _this.props.onChange;\n _this.setValue(e.target.value);\n if (onChange) {\n onChange(e);\n }\n };\n _this.handleKeyDown = function (e) {\n var _this$props = _this.props,\n onPressEnter = _this$props.onPressEnter,\n onKeyDown = _this$props.onKeyDown;\n if (e.keyCode === 13 && onPressEnter) {\n onPressEnter(e);\n }\n if (onKeyDown) {\n onKeyDown(e);\n }\n };\n var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;\n _this.state = {\n value: value\n };\n return _this;\n }\n _createClass(TextArea, [{\n key: \"setValue\",\n value: function setValue(value, callback) {\n if (!('value' in this.props)) {\n this.setState({\n value: value\n }, callback);\n }\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.resizableTextArea.textArea.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, this.props, {\n value: this.state.value,\n onKeyDown: this.handleKeyDown,\n onChange: this.handleChange,\n ref: this.saveTextArea\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps) {\n return {\n value: nextProps.value\n };\n }\n return null;\n }\n }]);\n return TextArea;\n}(React.Component);\nexport { ResizableTextArea };\nexport default TextArea;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { FormItemInputContext } from '../form/context';\nimport { cloneElement } from '../_util/reactNode';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport { tuple } from '../_util/type';\nvar ClearableInputType = tuple('text', 'input');\nfunction hasAddon(props) {\n return !!(props.addonBefore || props.addonAfter);\n}\nvar ClearableLabeledInput = /*#__PURE__*/function (_React$Component) {\n _inherits(ClearableLabeledInput, _React$Component);\n function ClearableLabeledInput() {\n _classCallCheck(this, ClearableLabeledInput);\n return _callSuper(this, ClearableLabeledInput, arguments);\n }\n _createClass(ClearableLabeledInput, [{\n key: \"renderClearIcon\",\n value: function renderClearIcon(prefixCls) {\n var _this$props = this.props,\n value = _this$props.value,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n handleReset = _this$props.handleReset,\n suffix = _this$props.suffix;\n var needClear = !disabled && !readOnly && value;\n var className = \"\".concat(prefixCls, \"-clear-icon\");\n return /*#__PURE__*/React.createElement(CloseCircleFilled, {\n onClick: handleReset,\n // Do not trigger onBlur when clear input\n // https://github.com/ant-design/ant-design/issues/31200\n onMouseDown: function onMouseDown(e) {\n return e.preventDefault();\n },\n className: classNames(_defineProperty(_defineProperty({}, \"\".concat(className, \"-hidden\"), !needClear), \"\".concat(className, \"-has-suffix\"), !!suffix), className),\n role: \"button\"\n });\n }\n }, {\n key: \"renderTextAreaWithClearIcon\",\n value: function renderTextAreaWithClearIcon(prefixCls, element, statusContext) {\n var _this$props2 = this.props,\n value = _this$props2.value,\n allowClear = _this$props2.allowClear,\n className = _this$props2.className,\n focused = _this$props2.focused,\n style = _this$props2.style,\n direction = _this$props2.direction,\n bordered = _this$props2.bordered,\n hidden = _this$props2.hidden,\n customStatus = _this$props2.status;\n var contextStatus = statusContext.status,\n hasFeedback = statusContext.hasFeedback;\n if (!allowClear) {\n return cloneElement(element, {\n value: value\n });\n }\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), \"\".concat(prefixCls, \"-affix-wrapper-textarea-with-clear-btn\"), getStatusClassNames(\"\".concat(prefixCls, \"-affix-wrapper\"), getMergedStatus(contextStatus, customStatus), hasFeedback), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-affix-wrapper-focused\"), focused), \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), \"\".concat(className), !hasAddon(this.props) && className));\n return /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: style,\n hidden: hidden\n }, cloneElement(element, {\n style: null,\n value: value\n }), this.renderClearIcon(prefixCls));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this = this;\n return /*#__PURE__*/React.createElement(FormItemInputContext.Consumer, null, function (statusContext) {\n var _this$props3 = _this.props,\n prefixCls = _this$props3.prefixCls,\n inputType = _this$props3.inputType,\n element = _this$props3.element;\n if (inputType === ClearableInputType[0]) {\n return _this.renderTextAreaWithClearIcon(prefixCls, element, statusContext);\n }\n });\n }\n }]);\n return ClearableLabeledInput;\n}(React.Component);\nexport default ClearableLabeledInput;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcTextArea from 'rc-textarea';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { FormItemInputContext } from '../form/context';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport ClearableLabeledInput from './ClearableLabeledInput';\nimport { fixControlledValue, resolveOnChange, triggerFocus } from './Input';\nfunction fixEmojiLength(value, maxLength) {\n return _toConsumableArray(value || '').slice(0, maxLength).join('');\n}\nfunction setTriggerValue(isCursorInEnd, preValue, triggerValue, maxLength) {\n var newTriggerValue = triggerValue;\n if (isCursorInEnd) {\n // 光标在尾部,直接截断\n newTriggerValue = fixEmojiLength(triggerValue, maxLength);\n } else if (_toConsumableArray(preValue || '').length < triggerValue.length && _toConsumableArray(triggerValue || '').length > maxLength) {\n // 光标在中间,如果最后的值超过最大值,则采用原先的值\n newTriggerValue = preValue;\n }\n return newTriggerValue;\n}\nvar TextArea = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n _a$bordered = _a.bordered,\n bordered = _a$bordered === void 0 ? true : _a$bordered,\n _a$showCount = _a.showCount,\n showCount = _a$showCount === void 0 ? false : _a$showCount,\n maxLength = _a.maxLength,\n className = _a.className,\n style = _a.style,\n customizeSize = _a.size,\n customDisabled = _a.disabled,\n onCompositionStart = _a.onCompositionStart,\n onCompositionEnd = _a.onCompositionEnd,\n onChange = _a.onChange,\n onFocus = _a.onFocus,\n onBlur = _a.onBlur,\n customStatus = _a.status,\n props = __rest(_a, [\"prefixCls\", \"bordered\", \"showCount\", \"maxLength\", \"className\", \"style\", \"size\", \"disabled\", \"onCompositionStart\", \"onCompositionEnd\", \"onChange\", \"onFocus\", \"onBlur\", \"status\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var size = React.useContext(SizeContext);\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var _React$useContext2 = React.useContext(FormItemInputContext),\n contextStatus = _React$useContext2.status,\n hasFeedback = _React$useContext2.hasFeedback,\n isFormItemInput = _React$useContext2.isFormItemInput,\n feedbackIcon = _React$useContext2.feedbackIcon;\n var mergedStatus = getMergedStatus(contextStatus, customStatus);\n var innerRef = React.useRef(null);\n var clearableInputRef = React.useRef(null);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n compositing = _React$useState2[0],\n setCompositing = _React$useState2[1];\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n focused = _React$useState4[0],\n setFocused = _React$useState4[1];\n var oldCompositionValueRef = React.useRef();\n var oldSelectionStartRef = React.useRef(0);\n var _useMergedState = useMergedState(props.defaultValue, {\n value: props.value\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n value = _useMergedState2[0],\n setValue = _useMergedState2[1];\n var hidden = props.hidden;\n var handleSetValue = function handleSetValue(val, callback) {\n if (props.value === undefined) {\n setValue(val);\n callback === null || callback === void 0 ? void 0 : callback();\n }\n };\n // =========================== Value Update ===========================\n // Max length value\n var hasMaxLength = Number(maxLength) > 0;\n var onInternalCompositionStart = function onInternalCompositionStart(e) {\n setCompositing(true);\n // 拼音输入前保存一份旧值\n oldCompositionValueRef.current = value;\n // 保存旧的光标位置\n oldSelectionStartRef.current = e.currentTarget.selectionStart;\n onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);\n };\n var onInternalCompositionEnd = function onInternalCompositionEnd(e) {\n var _a;\n setCompositing(false);\n var triggerValue = e.currentTarget.value;\n if (hasMaxLength) {\n var isCursorInEnd = oldSelectionStartRef.current >= maxLength + 1 || oldSelectionStartRef.current === ((_a = oldCompositionValueRef.current) === null || _a === void 0 ? void 0 : _a.length);\n triggerValue = setTriggerValue(isCursorInEnd, oldCompositionValueRef.current, triggerValue, maxLength);\n }\n // Patch composition onChange when value changed\n if (triggerValue !== value) {\n handleSetValue(triggerValue);\n resolveOnChange(e.currentTarget, e, onChange, triggerValue);\n }\n onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);\n };\n var handleChange = function handleChange(e) {\n var triggerValue = e.target.value;\n if (!compositing && hasMaxLength) {\n // 1. 复制粘贴超过maxlength的情况 2.未超过maxlength的情况\n var isCursorInEnd = e.target.selectionStart >= maxLength + 1 || e.target.selectionStart === triggerValue.length || !e.target.selectionStart;\n triggerValue = setTriggerValue(isCursorInEnd, value, triggerValue, maxLength);\n }\n handleSetValue(triggerValue);\n resolveOnChange(e.currentTarget, e, onChange, triggerValue);\n };\n var handleBlur = function handleBlur(e) {\n setFocused(false);\n onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);\n };\n var handleFocus = function handleFocus(e) {\n setFocused(true);\n onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);\n };\n React.useEffect(function () {\n setFocused(function (prev) {\n return !mergedDisabled && prev;\n });\n }, [mergedDisabled]);\n // ============================== Reset ===============================\n var handleReset = function handleReset(e) {\n var _a, _b, _c;\n handleSetValue('');\n (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n resolveOnChange((_c = (_b = innerRef.current) === null || _b === void 0 ? void 0 : _b.resizableTextArea) === null || _c === void 0 ? void 0 : _c.textArea, e, onChange);\n };\n var prefixCls = getPrefixCls('input', customizePrefixCls);\n React.useImperativeHandle(ref, function () {\n var _a;\n return {\n resizableTextArea: (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea,\n focus: function focus(option) {\n var _a, _b;\n triggerFocus((_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea, option);\n },\n blur: function blur() {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();\n }\n };\n });\n var textArea = /*#__PURE__*/React.createElement(RcTextArea, _extends({}, omit(props, ['allowClear']), {\n disabled: mergedDisabled,\n className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-borderless\"), !bordered), className, className && !showCount), \"\".concat(prefixCls, \"-sm\"), size === 'small' || customizeSize === 'small'), \"\".concat(prefixCls, \"-lg\"), size === 'large' || customizeSize === 'large'), getStatusClassNames(prefixCls, mergedStatus)),\n style: showCount ? {\n resize: style === null || style === void 0 ? void 0 : style.resize\n } : style,\n prefixCls: prefixCls,\n onCompositionStart: onInternalCompositionStart,\n onChange: handleChange,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onCompositionEnd: onInternalCompositionEnd,\n ref: innerRef\n }));\n var val = fixControlledValue(value);\n if (!compositing && hasMaxLength && (props.value === null || props.value === undefined)) {\n // fix #27612 将value转为数组进行截取,解决 '😂'.length === 2 等emoji表情导致的截取乱码的问题\n val = fixEmojiLength(val, maxLength);\n }\n // TextArea\n var textareaNode = /*#__PURE__*/React.createElement(ClearableLabeledInput, _extends({\n disabled: mergedDisabled,\n focused: focused\n }, props, {\n prefixCls: prefixCls,\n direction: direction,\n inputType: \"text\",\n value: val,\n element: textArea,\n handleReset: handleReset,\n ref: clearableInputRef,\n bordered: bordered,\n status: customStatus,\n style: showCount ? undefined : style\n }));\n // Only show text area wrapper when needed\n if (showCount || hasFeedback) {\n var valueLength = _toConsumableArray(val).length;\n var dataCount = '';\n if (_typeof(showCount) === 'object') {\n dataCount = showCount.formatter({\n value: val,\n count: valueLength,\n maxLength: maxLength\n });\n } else {\n dataCount = \"\".concat(valueLength).concat(hasMaxLength ? \" / \".concat(maxLength) : '');\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n hidden: hidden,\n className: classNames(\"\".concat(prefixCls, \"-textarea\"), _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-textarea-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-textarea-show-count\"), showCount), \"\".concat(prefixCls, \"-textarea-in-form-item\"), isFormItemInput), getStatusClassNames(\"\".concat(prefixCls, \"-textarea\"), mergedStatus, hasFeedback), className),\n style: style,\n \"data-count\": dataCount\n }, textareaNode, hasFeedback && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-textarea-suffix\")\n }, feedbackIcon));\n }\n return textareaNode;\n});\nexport default TextArea;","import { useEffect, useRef } from 'react';\nexport default function useRemovePasswordTimeout(inputRef, triggerOnMount) {\n var removePasswordTimeoutRef = useRef([]);\n var removePasswordTimeout = function removePasswordTimeout() {\n removePasswordTimeoutRef.current.push(setTimeout(function () {\n var _a, _b, _c, _d;\n if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {\n (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');\n }\n }));\n };\n useEffect(function () {\n if (triggerOnMount) {\n removePasswordTimeout();\n }\n return function () {\n return removePasswordTimeoutRef.current.forEach(function (timer) {\n if (timer) {\n clearTimeout(timer);\n }\n });\n };\n }, []);\n return removePasswordTimeout;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useContext, useMemo } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { FormItemInputContext } from '../form/context';\nvar Group = function Group(props) {\n var _useContext = useContext(ConfigContext),\n getPrefixCls = _useContext.getPrefixCls,\n direction = _useContext.direction;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className;\n var prefixCls = getPrefixCls('input-group', customizePrefixCls);\n var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), props.size === 'large'), \"\".concat(prefixCls, \"-sm\"), props.size === 'small'), \"\".concat(prefixCls, \"-compact\"), props.compact), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n var formItemContext = useContext(FormItemInputContext);\n var groupFormItemContext = useMemo(function () {\n return _extends(_extends({}, formItemContext), {\n isFormItemInput: false\n });\n }, [formItemContext]);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: cls,\n style: props.style,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave,\n onFocus: props.onFocus,\n onBlur: props.onBlur\n }, /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {\n value: groupFormItemContext\n }, props.children));\n};\nexport default Group;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport EyeInvisibleOutlined from \"@ant-design/icons/es/icons/EyeInvisibleOutlined\";\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useRef, useState } from 'react';\nimport { ConfigConsumer } from '../config-provider';\nimport useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';\nimport Input from './Input';\nvar defaultIconRender = function defaultIconRender(visible) {\n return visible ? /*#__PURE__*/React.createElement(EyeOutlined, null) : /*#__PURE__*/React.createElement(EyeInvisibleOutlined, null);\n};\nvar ActionMap = {\n click: 'onClick',\n hover: 'onMouseOver'\n};\nvar Password = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$visibilityTogg = props.visibilityToggle,\n visibilityToggle = _props$visibilityTogg === void 0 ? true : _props$visibilityTogg;\n var visibilityControlled = _typeof(visibilityToggle) === 'object' && visibilityToggle.visible !== undefined;\n var _useState = useState(function () {\n return visibilityControlled ? visibilityToggle.visible : false;\n }),\n _useState2 = _slicedToArray(_useState, 2),\n visible = _useState2[0],\n setVisible = _useState2[1];\n var inputRef = useRef(null);\n React.useEffect(function () {\n if (visibilityControlled) {\n setVisible(visibilityToggle.visible);\n }\n }, [visibilityControlled, visibilityToggle]);\n // Remove Password value\n var removePasswordTimeout = useRemovePasswordTimeout(inputRef);\n var onVisibleChange = function onVisibleChange() {\n var disabled = props.disabled;\n if (disabled) {\n return;\n }\n if (visible) {\n removePasswordTimeout();\n }\n setVisible(function (prevState) {\n var _a;\n var newState = !prevState;\n if (_typeof(visibilityToggle) === 'object') {\n (_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);\n }\n return newState;\n });\n };\n var getIcon = function getIcon(prefixCls) {\n var _props$action = props.action,\n action = _props$action === void 0 ? 'click' : _props$action,\n _props$iconRender = props.iconRender,\n iconRender = _props$iconRender === void 0 ? defaultIconRender : _props$iconRender;\n var iconTrigger = ActionMap[action] || '';\n var icon = iconRender(visible);\n var iconProps = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, iconTrigger, onVisibleChange), \"className\", \"\".concat(prefixCls, \"-icon\")), \"key\", 'passwordIcon'), \"onMouseDown\", function onMouseDown(e) {\n // Prevent focused state lost\n // https://github.com/ant-design/ant-design/issues/15173\n e.preventDefault();\n }), \"onMouseUp\", function onMouseUp(e) {\n // Prevent caret position change\n // https://github.com/ant-design/ant-design/issues/23524\n e.preventDefault();\n });\n return /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement(\"span\", null, icon), iconProps);\n };\n var renderPassword = function renderPassword(_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var className = props.className,\n customizePrefixCls = props.prefixCls,\n customizeInputPrefixCls = props.inputPrefixCls,\n size = props.size,\n restProps = __rest(props, [\"className\", \"prefixCls\", \"inputPrefixCls\", \"size\"]);\n var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n var prefixCls = getPrefixCls('input-password', customizePrefixCls);\n var suffixIcon = visibilityToggle && getIcon(prefixCls);\n var inputClassName = classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size), !!size));\n var omittedProps = _extends(_extends({}, omit(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {\n type: visible ? 'text' : 'password',\n className: inputClassName,\n prefixCls: inputPrefixCls,\n suffix: suffixIcon\n });\n if (size) {\n omittedProps.size = size;\n }\n return /*#__PURE__*/React.createElement(Input, _extends({\n ref: composeRef(ref, inputRef)\n }, omittedProps));\n };\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, renderPassword);\n});\nif (process.env.NODE_ENV !== 'production') {\n Password.displayName = 'Password';\n}\nexport default Password;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport SearchOutlined from \"@ant-design/icons/es/icons/SearchOutlined\";\nimport classNames from 'classnames';\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport Button from '../button';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\nimport { useCompactItemContext } from '../space/Compact';\nimport { cloneElement } from '../_util/reactNode';\nimport Input from './Input';\nvar Search = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n customizeInputPrefixCls = props.inputPrefixCls,\n className = props.className,\n customizeSize = props.size,\n suffix = props.suffix,\n _props$enterButton = props.enterButton,\n enterButton = _props$enterButton === void 0 ? false : _props$enterButton,\n addonAfter = props.addonAfter,\n loading = props.loading,\n disabled = props.disabled,\n customOnSearch = props.onSearch,\n customOnChange = props.onChange,\n onCompositionStart = props.onCompositionStart,\n onCompositionEnd = props.onCompositionEnd,\n restProps = __rest(props, [\"prefixCls\", \"inputPrefixCls\", \"className\", \"size\", \"suffix\", \"enterButton\", \"addonAfter\", \"loading\", \"disabled\", \"onSearch\", \"onChange\", \"onCompositionStart\", \"onCompositionEnd\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var contextSize = React.useContext(SizeContext);\n var composedRef = React.useRef(false);\n var prefixCls = getPrefixCls('input-search', customizePrefixCls);\n var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize;\n var size = compactSize || customizeSize || contextSize;\n var inputRef = React.useRef(null);\n var onChange = function onChange(e) {\n if (e && e.target && e.type === 'click' && customOnSearch) {\n customOnSearch(e.target.value, e);\n }\n if (customOnChange) {\n customOnChange(e);\n }\n };\n var onMouseDown = function onMouseDown(e) {\n var _a;\n if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {\n e.preventDefault();\n }\n };\n var onSearch = function onSearch(e) {\n var _a, _b;\n if (customOnSearch) {\n customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e);\n }\n };\n var onPressEnter = function onPressEnter(e) {\n if (composedRef.current || loading) {\n return;\n }\n onSearch(e);\n };\n var searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/React.createElement(SearchOutlined, null) : null;\n var btnClassName = \"\".concat(prefixCls, \"-button\");\n var button;\n var enterButtonAsElement = enterButton || {};\n var isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;\n if (isAntdButton || enterButtonAsElement.type === 'button') {\n button = cloneElement(enterButtonAsElement, _extends({\n onMouseDown: onMouseDown,\n onClick: function onClick(e) {\n var _a, _b;\n (_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n onSearch(e);\n },\n key: 'enterButton'\n }, isAntdButton ? {\n className: btnClassName,\n size: size\n } : {}));\n } else {\n button = /*#__PURE__*/React.createElement(Button, {\n className: btnClassName,\n type: enterButton ? 'primary' : undefined,\n size: size,\n disabled: disabled,\n key: \"enterButton\",\n onMouseDown: onMouseDown,\n onClick: onSearch,\n loading: loading,\n icon: searchIcon\n }, enterButton);\n }\n if (addonAfter) {\n button = [button, cloneElement(addonAfter, {\n key: 'addonAfter'\n })];\n }\n var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-\").concat(size), !!size), \"\".concat(prefixCls, \"-with-button\"), !!enterButton), className);\n var handleOnCompositionStart = function handleOnCompositionStart(e) {\n composedRef.current = true;\n onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);\n };\n var handleOnCompositionEnd = function handleOnCompositionEnd(e) {\n composedRef.current = false;\n onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);\n };\n return /*#__PURE__*/React.createElement(Input, _extends({\n ref: composeRef(inputRef, ref),\n onPressEnter: onPressEnter\n }, restProps, {\n size: size,\n onCompositionStart: handleOnCompositionStart,\n onCompositionEnd: handleOnCompositionEnd,\n prefixCls: inputPrefixCls,\n addonAfter: button,\n suffix: suffix,\n onChange: onChange,\n className: cls,\n disabled: disabled\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n Search.displayName = 'Search';\n}\nexport default Search;","import Group from './Group';\nimport InternalInput from './Input';\nimport Password from './Password';\nimport Search from './Search';\nimport TextArea from './TextArea';\nvar Input = InternalInput;\nInput.Group = Group;\nInput.Search = Search;\nInput.TextArea = TextArea;\nInput.Password = Password;\nexport default Input;","// This icon file is generated automatically.\nvar BarsOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z\" } }] }, \"name\": \"bars\", \"theme\": \"outlined\" };\nexport default BarsOutlined;\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 BarsOutlinedSvg from \"@ant-design/icons-svg/es/asn/BarsOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar BarsOutlined = function BarsOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: BarsOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(BarsOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'BarsOutlined';\n}\nexport default RefIcon;","var isNumeric = function isNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n};\nexport default isNumeric;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport BarsOutlined from \"@ant-design/icons/es/icons/BarsOutlined\";\nimport LeftOutlined from \"@ant-design/icons/es/icons/LeftOutlined\";\nimport RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { useContext, useEffect, useRef, useState } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport isNumeric from '../_util/isNumeric';\nimport { LayoutContext } from './layout';\nvar dimensionMaxMap = {\n xs: '479.98px',\n sm: '575.98px',\n md: '767.98px',\n lg: '991.98px',\n xl: '1199.98px',\n xxl: '1599.98px'\n};\nexport var SiderContext = /*#__PURE__*/React.createContext({});\nvar generateId = function () {\n var i = 0;\n return function () {\n var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n i += 1;\n return \"\".concat(prefix).concat(i);\n };\n}();\nvar Sider = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n trigger = _a.trigger,\n children = _a.children,\n _a$defaultCollapsed = _a.defaultCollapsed,\n defaultCollapsed = _a$defaultCollapsed === void 0 ? false : _a$defaultCollapsed,\n _a$theme = _a.theme,\n theme = _a$theme === void 0 ? 'dark' : _a$theme,\n _a$style = _a.style,\n style = _a$style === void 0 ? {} : _a$style,\n _a$collapsible = _a.collapsible,\n collapsible = _a$collapsible === void 0 ? false : _a$collapsible,\n _a$reverseArrow = _a.reverseArrow,\n reverseArrow = _a$reverseArrow === void 0 ? false : _a$reverseArrow,\n _a$width = _a.width,\n width = _a$width === void 0 ? 200 : _a$width,\n _a$collapsedWidth = _a.collapsedWidth,\n collapsedWidth = _a$collapsedWidth === void 0 ? 80 : _a$collapsedWidth,\n zeroWidthTriggerStyle = _a.zeroWidthTriggerStyle,\n breakpoint = _a.breakpoint,\n onCollapse = _a.onCollapse,\n onBreakpoint = _a.onBreakpoint,\n props = __rest(_a, [\"prefixCls\", \"className\", \"trigger\", \"children\", \"defaultCollapsed\", \"theme\", \"style\", \"collapsible\", \"reverseArrow\", \"width\", \"collapsedWidth\", \"zeroWidthTriggerStyle\", \"breakpoint\", \"onCollapse\", \"onBreakpoint\"]);\n var _useContext = useContext(LayoutContext),\n siderHook = _useContext.siderHook;\n var _useState = useState('collapsed' in props ? props.collapsed : defaultCollapsed),\n _useState2 = _slicedToArray(_useState, 2),\n collapsed = _useState2[0],\n setCollapsed = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n below = _useState4[0],\n setBelow = _useState4[1];\n useEffect(function () {\n if ('collapsed' in props) {\n setCollapsed(props.collapsed);\n }\n }, [props.collapsed]);\n var handleSetCollapsed = function handleSetCollapsed(value, type) {\n if (!('collapsed' in props)) {\n setCollapsed(value);\n }\n onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(value, type);\n };\n // ========================= Responsive =========================\n var responsiveHandlerRef = useRef();\n responsiveHandlerRef.current = function (mql) {\n setBelow(mql.matches);\n onBreakpoint === null || onBreakpoint === void 0 ? void 0 : onBreakpoint(mql.matches);\n if (collapsed !== mql.matches) {\n handleSetCollapsed(mql.matches, 'responsive');\n }\n };\n useEffect(function () {\n function responsiveHandler(mql) {\n return responsiveHandlerRef.current(mql);\n }\n var mql;\n if (typeof window !== 'undefined') {\n var _window = window,\n matchMedia = _window.matchMedia;\n if (matchMedia && breakpoint && breakpoint in dimensionMaxMap) {\n mql = matchMedia(\"(max-width: \".concat(dimensionMaxMap[breakpoint], \")\"));\n try {\n mql.addEventListener('change', responsiveHandler);\n } catch (error) {\n mql.addListener(responsiveHandler);\n }\n responsiveHandler(mql);\n }\n }\n return function () {\n try {\n mql === null || mql === void 0 ? void 0 : mql.removeEventListener('change', responsiveHandler);\n } catch (error) {\n mql === null || mql === void 0 ? void 0 : mql.removeListener(responsiveHandler);\n }\n };\n }, [breakpoint]); // in order to accept dynamic 'breakpoint' property, we need to add 'breakpoint' into dependency array.\n useEffect(function () {\n var uniqueId = generateId('ant-sider-');\n siderHook.addSider(uniqueId);\n return function () {\n return siderHook.removeSider(uniqueId);\n };\n }, []);\n var toggle = function toggle() {\n handleSetCollapsed(!collapsed, 'clickTrigger');\n };\n var _useContext2 = useContext(ConfigContext),\n getPrefixCls = _useContext2.getPrefixCls;\n var renderSider = function renderSider() {\n var prefixCls = getPrefixCls('layout-sider', customizePrefixCls);\n var divProps = omit(props, ['collapsed']);\n var rawWidth = collapsed ? collapsedWidth : width;\n // use \"px\" as fallback unit for width\n var siderWidth = isNumeric(rawWidth) ? \"\".concat(rawWidth, \"px\") : String(rawWidth);\n // special trigger when collapsedWidth == 0\n var zeroWidthTrigger = parseFloat(String(collapsedWidth || 0)) === 0 ? ( /*#__PURE__*/React.createElement(\"span\", {\n onClick: toggle,\n className: classNames(\"\".concat(prefixCls, \"-zero-width-trigger\"), \"\".concat(prefixCls, \"-zero-width-trigger-\").concat(reverseArrow ? 'right' : 'left')),\n style: zeroWidthTriggerStyle\n }, trigger || /*#__PURE__*/React.createElement(BarsOutlined, null))) : null;\n var iconObj = {\n expanded: reverseArrow ? /*#__PURE__*/React.createElement(RightOutlined, null) : /*#__PURE__*/React.createElement(LeftOutlined, null),\n collapsed: reverseArrow ? /*#__PURE__*/React.createElement(LeftOutlined, null) : /*#__PURE__*/React.createElement(RightOutlined, null)\n };\n var status = collapsed ? 'collapsed' : 'expanded';\n var defaultTrigger = iconObj[status];\n var triggerDom = trigger !== null ? zeroWidthTrigger || ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-trigger\"),\n onClick: toggle,\n style: {\n width: siderWidth\n }\n }, trigger || defaultTrigger)) : null;\n var divStyle = _extends(_extends({}, style), {\n flex: \"0 0 \".concat(siderWidth),\n maxWidth: siderWidth,\n minWidth: siderWidth,\n width: siderWidth\n });\n var siderCls = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(theme), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-collapsed\"), !!collapsed), \"\".concat(prefixCls, \"-has-trigger\"), collapsible && trigger !== null && !zeroWidthTrigger), \"\".concat(prefixCls, \"-below\"), !!below), \"\".concat(prefixCls, \"-zero-width\"), parseFloat(siderWidth) === 0), className);\n return /*#__PURE__*/React.createElement(\"aside\", _extends({\n className: siderCls\n }, divProps, {\n style: divStyle,\n ref: ref\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-children\")\n }, children), collapsible || below && zeroWidthTrigger ? triggerDom : null);\n };\n var contextValue = React.useMemo(function () {\n return {\n siderCollapsed: collapsed\n };\n }, [collapsed]);\n return /*#__PURE__*/React.createElement(SiderContext.Provider, {\n value: contextValue\n }, renderSider());\n});\nif (process.env.NODE_ENV !== 'production') {\n Sider.displayName = 'Sider';\n}\nexport default Sider;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nexport var LayoutContext = /*#__PURE__*/React.createContext({\n siderHook: {\n addSider: function addSider() {\n return null;\n },\n removeSider: function removeSider() {\n return null;\n }\n }\n});\nfunction generator(_ref) {\n var suffixCls = _ref.suffixCls,\n tagName = _ref.tagName,\n displayName = _ref.displayName;\n return function (BasicComponent) {\n var Adapter = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var customizePrefixCls = props.prefixCls;\n var prefixCls = getPrefixCls(suffixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(BasicComponent, _extends({\n ref: ref,\n prefixCls: prefixCls,\n tagName: tagName\n }, props));\n });\n if (process.env.NODE_ENV !== 'production') {\n Adapter.displayName = displayName;\n }\n return Adapter;\n };\n}\nvar Basic = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n tagName = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"tagName\"]);\n var classString = classNames(prefixCls, className);\n return /*#__PURE__*/React.createElement(tagName, _extends(_extends({\n className: classString\n }, others), {\n ref: ref\n }), children);\n});\nvar BasicLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext2 = React.useContext(ConfigContext),\n direction = _React$useContext2.direction;\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n siders = _React$useState2[0],\n setSiders = _React$useState2[1];\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n hasSider = props.hasSider,\n Tag = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"hasSider\", \"tagName\"]);\n var classString = classNames(prefixCls, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-has-sider\"), typeof hasSider === 'boolean' ? hasSider : siders.length > 0), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n var contextValue = React.useMemo(function () {\n return {\n siderHook: {\n addSider: function addSider(id) {\n setSiders(function (prev) {\n return [].concat(_toConsumableArray(prev), [id]);\n });\n },\n removeSider: function removeSider(id) {\n setSiders(function (prev) {\n return prev.filter(function (currentId) {\n return currentId !== id;\n });\n });\n }\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(LayoutContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Tag, _extends({\n ref: ref,\n className: classString\n }, others), children));\n});\nvar Layout = generator({\n suffixCls: 'layout',\n tagName: 'section',\n displayName: 'Layout'\n})(BasicLayout);\nvar Header = generator({\n suffixCls: 'layout-header',\n tagName: 'header',\n displayName: 'Header'\n})(Basic);\nvar Footer = generator({\n suffixCls: 'layout-footer',\n tagName: 'footer',\n displayName: 'Footer'\n})(Basic);\nvar Content = generator({\n suffixCls: 'layout-content',\n tagName: 'main',\n displayName: 'Content'\n})(Basic);\nexport { Header, Footer, Content };\nexport default Layout;","import locale from '../locale/default';\nexport default locale;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport LocaleContext from './context';\nimport defaultLocaleData from './default';\nvar LocaleReceiver = function LocaleReceiver(props) {\n var _props$componentName = props.componentName,\n componentName = _props$componentName === void 0 ? 'global' : _props$componentName,\n defaultLocale = props.defaultLocale,\n children = props.children;\n var antLocale = React.useContext(LocaleContext);\n var getLocale = React.useMemo(function () {\n var _a;\n var locale = defaultLocale || defaultLocaleData[componentName];\n var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n return _extends(_extends({}, locale instanceof Function ? locale() : locale), localeFromContext || {});\n }, [componentName, defaultLocale, antLocale]);\n var getLocaleCode = React.useMemo(function () {\n var localeCode = antLocale && antLocale.locale;\n // Had use LocaleProvide but didn't set locale\n if (antLocale && antLocale.exist && !localeCode) {\n return defaultLocaleData.locale;\n }\n return localeCode;\n }, [antLocale]);\n return children(getLocale, getLocaleCode, antLocale);\n};\nexport default LocaleReceiver;\nexport var useLocaleReceiver = function useLocaleReceiver(componentName, defaultLocale) {\n var antLocale = React.useContext(LocaleContext);\n var getLocale = React.useMemo(function () {\n var _a;\n var locale = defaultLocale || defaultLocaleData[componentName];\n var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n return _extends(_extends({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});\n }, [componentName, defaultLocale, antLocale]);\n return [getLocale];\n};","import { createContext } from 'react';\nvar LocaleContext = /*#__PURE__*/createContext(undefined);\nexport default LocaleContext;","import enUS from '../../date-picker/locale/en_US';\nexport default enUS;","/* eslint-disable no-template-curly-in-string */\nimport Pagination from \"rc-pagination/es/locale/en_US\";\nimport Calendar from '../calendar/locale/en_US';\nimport DatePicker from '../date-picker/locale/en_US';\nimport TimePicker from '../time-picker/locale/en_US';\nvar typeTemplate = '${label} is not a valid ${type}';\nvar localeValues = {\n locale: 'en',\n Pagination: Pagination,\n DatePicker: DatePicker,\n TimePicker: TimePicker,\n Calendar: Calendar,\n global: {\n placeholder: 'Please select'\n },\n Table: {\n filterTitle: 'Filter menu',\n filterConfirm: 'OK',\n filterReset: 'Reset',\n filterEmptyText: 'No filters',\n filterCheckall: 'Select all items',\n filterSearchPlaceholder: 'Search in filters',\n emptyText: 'No data',\n selectAll: 'Select current page',\n selectInvert: 'Invert current page',\n selectNone: 'Clear all data',\n selectionAll: 'Select all data',\n sortTitle: 'Sort',\n expand: 'Expand row',\n collapse: 'Collapse row',\n triggerDesc: 'Click to sort descending',\n triggerAsc: 'Click to sort ascending',\n cancelSort: 'Click to cancel sorting'\n },\n Modal: {\n okText: 'OK',\n cancelText: 'Cancel',\n justOkText: 'OK'\n },\n Popconfirm: {\n okText: 'OK',\n cancelText: 'Cancel'\n },\n Transfer: {\n titles: ['', ''],\n searchPlaceholder: 'Search here',\n itemUnit: 'item',\n itemsUnit: 'items',\n remove: 'Remove',\n selectCurrent: 'Select current page',\n removeCurrent: 'Remove current page',\n selectAll: 'Select all data',\n removeAll: 'Remove all data',\n selectInvert: 'Invert current page'\n },\n Upload: {\n uploading: 'Uploading...',\n removeFile: 'Remove file',\n uploadError: 'Upload error',\n previewFile: 'Preview file',\n downloadFile: 'Download file'\n },\n Empty: {\n description: 'No data'\n },\n Icon: {\n icon: 'icon'\n },\n Text: {\n edit: 'Edit',\n copy: 'Copy',\n copied: 'Copied',\n expand: 'Expand'\n },\n PageHeader: {\n back: 'Back'\n },\n Form: {\n optional: '(optional)',\n defaultValidateMessages: {\n \"default\": 'Field validation error for ${label}',\n required: 'Please enter ${label}',\n \"enum\": '${label} must be one of [${enum}]',\n whitespace: '${label} cannot be a blank character',\n date: {\n format: '${label} date format is invalid',\n parse: '${label} cannot be converted to a date',\n invalid: '${label} is an invalid date'\n },\n types: {\n string: typeTemplate,\n method: typeTemplate,\n array: typeTemplate,\n object: typeTemplate,\n number: typeTemplate,\n date: typeTemplate,\n \"boolean\": typeTemplate,\n integer: typeTemplate,\n \"float\": typeTemplate,\n regexp: typeTemplate,\n email: typeTemplate,\n url: typeTemplate,\n hex: typeTemplate\n },\n string: {\n len: '${label} must be ${len} characters',\n min: '${label} must be at least ${min} characters',\n max: '${label} must be up to ${max} characters',\n range: '${label} must be between ${min}-${max} characters'\n },\n number: {\n len: '${label} must be equal to ${len}',\n min: '${label} must be minimum ${min}',\n max: '${label} must be maximum ${max}',\n range: '${label} must be between ${min}-${max}'\n },\n array: {\n len: 'Must be ${len} ${label}',\n min: 'At least ${min} ${label}',\n max: 'At most ${max} ${label}',\n range: 'The amount of ${label} must be between ${min}-${max}'\n },\n pattern: {\n mismatch: '${label} does not match the pattern ${pattern}'\n }\n }\n },\n Image: {\n preview: 'Preview'\n }\n};\nexport default localeValues;","import defaultLocale from './default';\nexport default defaultLocale;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\n/** @internal Only used for Dropdown component. Do not use this in your production. */\nvar OverrideContext = /*#__PURE__*/React.createContext(null);\n/** @internal Only used for Dropdown component. Do not use this in your production. */\nexport var OverrideProvider = function OverrideProvider(_a) {\n var children = _a.children,\n restProps = __rest(_a, [\"children\"]);\n var override = React.useContext(OverrideContext);\n var context = React.useMemo(function () {\n return _extends(_extends({}, override), restProps);\n }, [override, restProps.prefixCls,\n // restProps.expandIcon, Not mark as deps since this is a ReactNode\n restProps.mode, restProps.selectable\n // restProps.validator, Not mark as deps since this is a function\n ]);\n return /*#__PURE__*/React.createElement(OverrideContext.Provider, {\n value: context\n }, children);\n};\nexport default OverrideContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport { Divider } from 'rc-menu';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar MenuDivider = function MenuDivider(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n dashed = _a.dashed,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"dashed\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('menu', customizePrefixCls);\n var classString = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-item-divider-dashed\"), !!dashed), className);\n return /*#__PURE__*/React.createElement(Divider, _extends({\n className: classString\n }, restProps));\n};\nexport default MenuDivider;","import { createContext } from 'react';\nvar MenuContext = /*#__PURE__*/createContext({\n prefixCls: '',\n firstLevel: true,\n inlineCollapsed: false\n});\nexport default MenuContext;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport { Item } from 'rc-menu';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { SiderContext } from '../layout/Sider';\nimport Tooltip from '../tooltip';\nimport { cloneElement, isValidElement } from '../_util/reactNode';\nimport MenuContext from './MenuContext';\nvar MenuItem = /*#__PURE__*/function (_React$Component) {\n _inherits(MenuItem, _React$Component);\n function MenuItem() {\n var _this;\n _classCallCheck(this, MenuItem);\n _this = _callSuper(this, MenuItem, arguments);\n _this.renderItem = function (_ref) {\n var siderCollapsed = _ref.siderCollapsed;\n var _a;\n var _this$context = _this.context,\n prefixCls = _this$context.prefixCls,\n firstLevel = _this$context.firstLevel,\n inlineCollapsed = _this$context.inlineCollapsed,\n direction = _this$context.direction,\n disableMenuItemTitleTooltip = _this$context.disableMenuItemTitleTooltip;\n var _this$props = _this.props,\n className = _this$props.className,\n children = _this$props.children;\n var _b = _this.props,\n title = _b.title,\n icon = _b.icon,\n danger = _b.danger,\n rest = __rest(_b, [\"title\", \"icon\", \"danger\"]);\n var tooltipTitle = title;\n if (typeof title === 'undefined') {\n tooltipTitle = firstLevel ? children : '';\n } else if (title === false) {\n tooltipTitle = '';\n }\n var tooltipProps = {\n title: tooltipTitle\n };\n if (!siderCollapsed && !inlineCollapsed) {\n tooltipProps.title = null;\n // Reset `open` to fix control mode tooltip display not correct\n // ref: https://github.com/ant-design/ant-design/issues/16742\n tooltipProps.open = false;\n }\n var childrenLength = toArray(children).length;\n var returnNode = /*#__PURE__*/React.createElement(Item, _extends({}, rest, {\n className: classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item-danger\"), danger), \"\".concat(prefixCls, \"-item-only-child\"), (icon ? childrenLength + 1 : childrenLength) === 1), className),\n title: typeof title === 'string' ? title : undefined\n }), cloneElement(icon, {\n className: classNames(isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : '', \"\".concat(prefixCls, \"-item-icon\"))\n }), _this.renderItemChildren(inlineCollapsed));\n if (!disableMenuItemTitleTooltip) {\n returnNode = /*#__PURE__*/React.createElement(Tooltip, _extends({}, tooltipProps, {\n placement: direction === 'rtl' ? 'left' : 'right',\n overlayClassName: \"\".concat(prefixCls, \"-inline-collapsed-tooltip\")\n }), returnNode);\n }\n return returnNode;\n };\n return _this;\n }\n _createClass(MenuItem, [{\n key: \"renderItemChildren\",\n value: function renderItemChildren(inlineCollapsed) {\n var _this$context2 = this.context,\n prefixCls = _this$context2.prefixCls,\n firstLevel = _this$context2.firstLevel;\n var _this$props2 = this.props,\n icon = _this$props2.icon,\n children = _this$props2.children;\n var wrapNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-title-content\")\n }, children);\n // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span\n // ref: https://github.com/ant-design/ant-design/pull/23456\n if (!icon || isValidElement(children) && children.type === 'span') {\n if (children && inlineCollapsed && firstLevel && typeof children === 'string') {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inline-collapsed-noicon\")\n }, children.charAt(0));\n }\n }\n return wrapNode;\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(SiderContext.Consumer, null, this.renderItem);\n }\n }]);\n return MenuItem;\n}(React.Component);\nexport { MenuItem as default };\nMenuItem.contextType = MenuContext;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport classNames from 'classnames';\nimport { SubMenu as RcSubMenu, useFullPath } from 'rc-menu';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { cloneElement, isValidElement } from '../_util/reactNode';\nimport MenuContext from './MenuContext';\nfunction SubMenu(props) {\n var _a;\n var popupClassName = props.popupClassName,\n icon = props.icon,\n title = props.title,\n theme = props.theme;\n var context = React.useContext(MenuContext);\n var prefixCls = context.prefixCls,\n inlineCollapsed = context.inlineCollapsed,\n antdMenuTheme = context.antdMenuTheme;\n var parentPath = useFullPath();\n var titleNode;\n if (!icon) {\n titleNode = inlineCollapsed && !parentPath.length && title && typeof title === 'string' ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inline-collapsed-noicon\")\n }, title.charAt(0))) : ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-title-content\")\n }, title));\n } else {\n // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span\n // ref: https://github.com/ant-design/ant-design/pull/23456\n var titleIsSpan = isValidElement(title) && title.type === 'span';\n titleNode = /*#__PURE__*/React.createElement(React.Fragment, null, cloneElement(icon, {\n className: classNames(isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : '', \"\".concat(prefixCls, \"-item-icon\"))\n }), titleIsSpan ? title : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-title-content\")\n }, title));\n }\n var contextValue = React.useMemo(function () {\n return _extends(_extends({}, context), {\n firstLevel: false\n });\n }, [context]);\n return /*#__PURE__*/React.createElement(MenuContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(RcSubMenu, _extends({}, omit(props, ['icon']), {\n title: titleNode,\n popupClassName: classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(theme || antdMenuTheme), popupClassName)\n })));\n}\nexport default SubMenu;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { ItemGroup } from 'rc-menu';\nimport * as React from 'react';\nimport MenuDivider from '../MenuDivider';\nimport MenuItem from '../MenuItem';\nimport SubMenu from '../SubMenu';\nfunction convertItemsToNodes(list) {\n return (list || []).map(function (opt, index) {\n if (opt && _typeof(opt) === 'object') {\n var _a = opt,\n label = _a.label,\n children = _a.children,\n key = _a.key,\n type = _a.type,\n restProps = __rest(_a, [\"label\", \"children\", \"key\", \"type\"]);\n var mergedKey = key !== null && key !== void 0 ? key : \"tmp-\".concat(index);\n // MenuItemGroup & SubMenuItem\n if (children || type === 'group') {\n if (type === 'group') {\n // Group\n return /*#__PURE__*/React.createElement(ItemGroup, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children));\n }\n // Sub Menu\n return /*#__PURE__*/React.createElement(SubMenu, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children));\n }\n // MenuItem & Divider\n if (type === 'divider') {\n return /*#__PURE__*/React.createElement(MenuDivider, _extends({\n key: mergedKey\n }, restProps));\n }\n return /*#__PURE__*/React.createElement(MenuItem, _extends({\n key: mergedKey\n }, restProps), label);\n }\n return null;\n }).filter(function (opt) {\n return opt;\n });\n}\n// FIXME: Move logic here in v5\n/**\n * We simply convert `items` to ReactNode for reuse origin component logic. But we need move all the\n * logic from component into this hooks when in v5\n */\nexport default function useItems(items) {\n return React.useMemo(function () {\n if (!items) {\n return items;\n }\n return convertItemsToNodes(items);\n }, [items]);\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport EllipsisOutlined from \"@ant-design/icons/es/icons/EllipsisOutlined\";\nimport classNames from 'classnames';\nimport RcMenu, { ItemGroup } from 'rc-menu';\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { SiderContext } from '../layout/Sider';\nimport collapseMotion from '../_util/motion';\nimport { cloneElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nimport useItems from './hooks/useItems';\nimport MenuContext from './MenuContext';\nimport MenuDivider from './MenuDivider';\nimport Item from './MenuItem';\nimport OverrideContext from './OverrideContext';\nimport SubMenu from './SubMenu';\nvar InternalMenu = /*#__PURE__*/forwardRef(function (props, ref) {\n var _a;\n var override = React.useContext(OverrideContext) || {};\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n getPopupContainer = _React$useContext.getPopupContainer,\n direction = _React$useContext.direction;\n var rootPrefixCls = getPrefixCls();\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n _props$theme = props.theme,\n theme = _props$theme === void 0 ? 'light' : _props$theme,\n expandIcon = props.expandIcon,\n _internalDisableMenuItemTitleTooltip = props._internalDisableMenuItemTitleTooltip,\n inlineCollapsed = props.inlineCollapsed,\n siderCollapsed = props.siderCollapsed,\n items = props.items,\n children = props.children,\n mode = props.mode,\n selectable = props.selectable,\n onClick = props.onClick,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"theme\", \"expandIcon\", \"_internalDisableMenuItemTitleTooltip\", \"inlineCollapsed\", \"siderCollapsed\", \"items\", \"children\", \"mode\", \"selectable\", \"onClick\"]);\n var passedProps = omit(restProps, ['collapsedWidth']);\n // ========================= Items ===========================\n var mergedChildren = useItems(items) || children;\n // ======================== Warning ==========================\n process.env.NODE_ENV !== \"production\" ? warning(!('inlineCollapsed' in props && mode !== 'inline'), 'Menu', '`inlineCollapsed` should only be used when `mode` is inline.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(props.siderCollapsed !== undefined && 'inlineCollapsed' in props), 'Menu', '`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning('items' in props && !children, 'Menu', '`children` will be removed in next major version. Please use `items` instead.') : void 0;\n (_a = override.validator) === null || _a === void 0 ? void 0 : _a.call(override, {\n mode: mode\n });\n // ========================== Click ==========================\n // Tell dropdown that item clicked\n var onItemClick = useEvent(function () {\n var _a;\n onClick === null || onClick === void 0 ? void 0 : onClick.apply(void 0, arguments);\n (_a = override === null || override === void 0 ? void 0 : override.onClick) === null || _a === void 0 ? void 0 : _a.call(override);\n });\n // ========================== Mode ===========================\n var mergedMode = override.mode || mode;\n // ======================= Selectable ========================\n var mergedSelectable = selectable !== null && selectable !== void 0 ? selectable : override.selectable;\n // ======================== Collapsed ========================\n // Inline Collapsed\n var mergedInlineCollapsed = React.useMemo(function () {\n if (siderCollapsed !== undefined) {\n return siderCollapsed;\n }\n return inlineCollapsed;\n }, [inlineCollapsed, siderCollapsed]);\n var defaultMotions = {\n horizontal: {\n motionName: \"\".concat(rootPrefixCls, \"-slide-up\")\n },\n inline: collapseMotion,\n other: {\n motionName: \"\".concat(rootPrefixCls, \"-zoom-big\")\n }\n };\n var prefixCls = getPrefixCls('menu', customizePrefixCls || override.prefixCls);\n var menuClassName = classNames(\"\".concat(prefixCls, \"-\").concat(theme), className);\n // ====================== Expand Icon ========================\n var mergedExpandIcon;\n if (typeof expandIcon === 'function') {\n mergedExpandIcon = expandIcon;\n } else {\n mergedExpandIcon = cloneElement(expandIcon || override.expandIcon, {\n className: \"\".concat(prefixCls, \"-submenu-expand-icon\")\n });\n }\n // ======================== Context ==========================\n var contextValue = React.useMemo(function () {\n return {\n prefixCls: prefixCls,\n inlineCollapsed: mergedInlineCollapsed || false,\n antdMenuTheme: theme,\n direction: direction,\n firstLevel: true,\n disableMenuItemTitleTooltip: _internalDisableMenuItemTitleTooltip\n };\n }, [prefixCls, mergedInlineCollapsed, theme, direction, _internalDisableMenuItemTitleTooltip]);\n // ========================= Render ==========================\n return /*#__PURE__*/React.createElement(OverrideContext.Provider, {\n value: null\n }, /*#__PURE__*/React.createElement(MenuContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(RcMenu, _extends({\n getPopupContainer: getPopupContainer,\n overflowedIndicator: /*#__PURE__*/React.createElement(EllipsisOutlined, null),\n overflowedIndicatorPopupClassName: \"\".concat(prefixCls, \"-\").concat(theme),\n mode: mergedMode,\n selectable: mergedSelectable,\n onClick: onItemClick\n }, passedProps, {\n inlineCollapsed: mergedInlineCollapsed,\n className: menuClassName,\n prefixCls: prefixCls,\n direction: direction,\n defaultMotions: defaultMotions,\n expandIcon: mergedExpandIcon,\n ref: ref\n }), mergedChildren)));\n});\n// We should keep this as ref-able\nvar Menu = /*#__PURE__*/function (_React$Component) {\n _inherits(Menu, _React$Component);\n function Menu() {\n var _this;\n _classCallCheck(this, Menu);\n _this = _callSuper(this, Menu, arguments);\n _this.focus = function (options) {\n var _a;\n (_a = _this.menu) === null || _a === void 0 ? void 0 : _a.focus(options);\n };\n return _this;\n }\n _createClass(Menu, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n return /*#__PURE__*/React.createElement(SiderContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(InternalMenu, _extends({\n ref: function ref(node) {\n _this2.menu = node;\n }\n }, _this2.props, context));\n });\n }\n }]);\n return Menu;\n}(React.Component);\nMenu.Divider = MenuDivider;\nMenu.Item = Item;\nMenu.SubMenu = SubMenu;\nMenu.ItemGroup = ItemGroup;\nexport default Menu;","// This icon file is generated automatically.\nvar InfoCircleFilled = { \"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 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z\" } }] }, \"name\": \"info-circle\", \"theme\": \"filled\" };\nexport default InfoCircleFilled;\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 InfoCircleFilledSvg from \"@ant-design/icons-svg/es/asn/InfoCircleFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar InfoCircleFilled = function InfoCircleFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: InfoCircleFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(InfoCircleFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'InfoCircleFilled';\n}\nexport default RefIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport InfoCircleFilled from \"@ant-design/icons/es/icons/InfoCircleFilled\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport RCNotification from 'rc-notification';\nimport * as React from 'react';\nimport ConfigProvider, { globalConfig } from '../config-provider';\nimport createUseMessage from './hooks/useMessage';\nvar messageInstance;\nvar defaultDuration = 3;\nvar defaultTop;\nvar key = 1;\nvar localPrefixCls = '';\nvar transitionName = 'move-up';\nvar hasTransitionName = false;\nvar getContainer;\nvar maxCount;\nvar rtl = false;\nexport function getKeyThenIncreaseKey() {\n return key++;\n}\nfunction setMessageConfig(options) {\n if (options.top !== undefined) {\n defaultTop = options.top;\n messageInstance = null; // delete messageInstance for new defaultTop\n }\n if (options.duration !== undefined) {\n defaultDuration = options.duration;\n }\n if (options.prefixCls !== undefined) {\n localPrefixCls = options.prefixCls;\n }\n if (options.getContainer !== undefined) {\n getContainer = options.getContainer;\n messageInstance = null; // delete messageInstance for new getContainer\n }\n if (options.transitionName !== undefined) {\n transitionName = options.transitionName;\n messageInstance = null; // delete messageInstance for new transitionName\n hasTransitionName = true;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n messageInstance = null;\n }\n if (options.rtl !== undefined) {\n rtl = options.rtl;\n }\n}\nfunction getRCNotificationInstance(args, callback) {\n var customizePrefixCls = args.prefixCls,\n getContextPopupContainer = args.getPopupContainer;\n var _globalConfig = globalConfig(),\n getPrefixCls = _globalConfig.getPrefixCls,\n getRootPrefixCls = _globalConfig.getRootPrefixCls,\n getIconPrefixCls = _globalConfig.getIconPrefixCls;\n var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);\n var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);\n var iconPrefixCls = getIconPrefixCls();\n if (messageInstance) {\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: messageInstance\n });\n return;\n }\n var instanceConfig = {\n prefixCls: prefixCls,\n transitionName: hasTransitionName ? transitionName : \"\".concat(rootPrefixCls, \"-\").concat(transitionName),\n style: {\n top: defaultTop\n },\n getContainer: getContainer || getContextPopupContainer,\n maxCount: maxCount\n };\n RCNotification.newInstance(instanceConfig, function (instance) {\n if (messageInstance) {\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: messageInstance\n });\n return;\n }\n messageInstance = instance;\n if (process.env.NODE_ENV === 'test') {\n messageInstance.config = instanceConfig;\n }\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: instance\n });\n });\n}\nvar typeToIcon = {\n info: InfoCircleFilled,\n success: CheckCircleFilled,\n error: CloseCircleFilled,\n warning: ExclamationCircleFilled,\n loading: LoadingOutlined\n};\nexport var typeList = Object.keys(typeToIcon);\nfunction getRCNoticeProps(args, prefixCls, iconPrefixCls) {\n var duration = args.duration !== undefined ? args.duration : defaultDuration;\n var IconComponent = typeToIcon[args.type];\n var messageClass = classNames(\"\".concat(prefixCls, \"-custom-content\"), _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(args.type), args.type), \"\".concat(prefixCls, \"-rtl\"), rtl === true));\n return {\n key: args.key,\n duration: duration,\n style: args.style || {},\n className: args.className,\n content: ( /*#__PURE__*/React.createElement(ConfigProvider, {\n iconPrefixCls: iconPrefixCls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: messageClass\n }, args.icon || IconComponent && /*#__PURE__*/React.createElement(IconComponent, null), /*#__PURE__*/React.createElement(\"span\", null, args.content)))),\n onClose: args.onClose,\n onClick: args.onClick\n };\n}\nfunction notice(args) {\n var target = args.key || getKeyThenIncreaseKey();\n var closePromise = new Promise(function (resolve) {\n var callback = function callback() {\n if (typeof args.onClose === 'function') {\n args.onClose();\n }\n return resolve(true);\n };\n getRCNotificationInstance(args, function (_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n instance = _ref.instance;\n instance.notice(getRCNoticeProps(_extends(_extends({}, args), {\n key: target,\n onClose: callback\n }), prefixCls, iconPrefixCls));\n });\n });\n var result = function result() {\n var _a;\n if (messageInstance) {\n messageInstance.removeNotice(target);\n (_a = args.onClose) === null || _a === void 0 ? void 0 : _a.call(args);\n }\n };\n result.then = function (filled, rejected) {\n return closePromise.then(filled, rejected);\n };\n result.promise = closePromise;\n return result;\n}\nfunction isArgsProps(content) {\n return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;\n}\nvar api = {\n open: notice,\n config: setMessageConfig,\n destroy: function destroy(messageKey) {\n if (messageInstance) {\n if (messageKey) {\n var _messageInstance = messageInstance,\n removeNotice = _messageInstance.removeNotice;\n removeNotice(messageKey);\n } else {\n var _messageInstance2 = messageInstance,\n destroy = _messageInstance2.destroy;\n destroy();\n messageInstance = null;\n }\n }\n }\n};\nexport function attachTypeApi(originalApi, type) {\n originalApi[type] = function (content, duration, onClose) {\n if (isArgsProps(content)) {\n return originalApi.open(_extends(_extends({}, content), {\n type: type\n }));\n }\n if (typeof duration === 'function') {\n onClose = duration;\n duration = undefined;\n }\n return originalApi.open({\n content: content,\n duration: duration,\n type: type,\n onClose: onClose\n });\n };\n}\ntypeList.forEach(function (type) {\n return attachTypeApi(api, type);\n});\napi.warn = api.warning;\napi.useMessage = createUseMessage(getRCNotificationInstance, getRCNoticeProps);\n/** @internal test Only function. Not work on production */\nexport var getInstance = function getInstance() {\n return process.env.NODE_ENV === 'test' ? messageInstance : null;\n};\nexport default api;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport useRCNotification from \"rc-notification/es/useNotification\";\nimport * as React from 'react';\nimport { attachTypeApi, getKeyThenIncreaseKey, typeList } from '..';\nimport { ConfigConsumer } from '../../config-provider';\nexport default function createUseMessage(getRcNotificationInstance, getRCNoticeProps) {\n var useMessage = function useMessage() {\n // We can only get content by render\n var getPrefixCls;\n var getPopupContainer;\n // We create a proxy to handle delay created instance\n var innerInstance = null;\n var proxy = {\n add: function add(noticeProps, holderCallback) {\n innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback);\n }\n };\n var _useRCNotification = useRCNotification(proxy),\n _useRCNotification2 = _slicedToArray(_useRCNotification, 2),\n hookNotify = _useRCNotification2[0],\n holder = _useRCNotification2[1];\n function notify(args) {\n var customizePrefixCls = args.prefixCls;\n var mergedPrefixCls = getPrefixCls('message', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var target = args.key || getKeyThenIncreaseKey();\n var closePromise = new Promise(function (resolve) {\n var callback = function callback() {\n if (typeof args.onClose === 'function') {\n args.onClose();\n }\n return resolve(true);\n };\n getRcNotificationInstance(_extends(_extends({}, args), {\n prefixCls: mergedPrefixCls,\n rootPrefixCls: rootPrefixCls,\n getPopupContainer: getPopupContainer\n }), function (_ref) {\n var prefixCls = _ref.prefixCls,\n instance = _ref.instance;\n innerInstance = instance;\n hookNotify(getRCNoticeProps(_extends(_extends({}, args), {\n key: target,\n onClose: callback\n }), prefixCls));\n });\n });\n var result = function result() {\n if (innerInstance) {\n innerInstance.removeNotice(target);\n }\n };\n result.then = function (filled, rejected) {\n return closePromise.then(filled, rejected);\n };\n result.promise = closePromise;\n return result;\n }\n // Fill functions\n var hookApiRef = React.useRef({});\n hookApiRef.current.open = notify;\n typeList.forEach(function (type) {\n return attachTypeApi(hookApiRef.current, type);\n });\n return [hookApiRef.current, /*#__PURE__*/React.createElement(ConfigConsumer, {\n key: \"holder\"\n }, function (context) {\n getPrefixCls = context.getPrefixCls;\n getPopupContainer = context.getPopupContainer;\n return holder;\n })];\n };\n return useMessage;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport useState from \"rc-util/es/hooks/useState\";\nimport * as React from 'react';\nimport Button from '../button';\nimport { convertLegacyProps } from '../button/button';\nfunction isThenable(thing) {\n return !!(thing && !!thing.then);\n}\nvar ActionButton = function ActionButton(props) {\n var clickedRef = React.useRef(false);\n var ref = React.useRef(null);\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n loading = _useState2[0],\n setLoading = _useState2[1];\n var close = props.close;\n var onInternalClose = function onInternalClose() {\n close === null || close === void 0 ? void 0 : close.apply(void 0, arguments);\n };\n React.useEffect(function () {\n var timeoutId = null;\n if (props.autoFocus) {\n timeoutId = setTimeout(function () {\n var _a;\n (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();\n });\n }\n return function () {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, []);\n var handlePromiseOnOk = function handlePromiseOnOk(returnValueOfOnOk) {\n if (!isThenable(returnValueOfOnOk)) {\n return;\n }\n setLoading(true);\n returnValueOfOnOk.then(function () {\n setLoading(false, true);\n onInternalClose.apply(void 0, arguments);\n clickedRef.current = false;\n }, function (e) {\n // See: https://github.com/ant-design/ant-design/issues/6183\n setLoading(false, true);\n clickedRef.current = false;\n return Promise.reject(e);\n });\n };\n var onClick = function onClick(e) {\n var actionFn = props.actionFn;\n if (clickedRef.current) {\n return;\n }\n clickedRef.current = true;\n if (!actionFn) {\n onInternalClose();\n return;\n }\n var returnValueOfOnOk;\n if (props.emitEvent) {\n returnValueOfOnOk = actionFn(e);\n if (props.quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) {\n clickedRef.current = false;\n onInternalClose(e);\n return;\n }\n } else if (actionFn.length) {\n returnValueOfOnOk = actionFn(close);\n // https://github.com/ant-design/ant-design/issues/23358\n clickedRef.current = false;\n } else {\n returnValueOfOnOk = actionFn();\n if (!returnValueOfOnOk) {\n onInternalClose();\n return;\n }\n }\n handlePromiseOnOk(returnValueOfOnOk);\n };\n var type = props.type,\n children = props.children,\n prefixCls = props.prefixCls,\n buttonProps = props.buttonProps;\n return /*#__PURE__*/React.createElement(Button, _extends({}, convertLegacyProps(type), {\n onClick: onClick,\n loading: loading,\n prefixCls: prefixCls\n }, buttonProps, {\n ref: ref\n }), children);\n};\nexport default ActionButton;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport Dialog from 'rc-dialog';\nimport * as React from 'react';\nimport Button from '../button';\nimport { convertLegacyProps } from '../button/button';\nimport { ConfigContext } from '../config-provider';\nimport { NoFormStyle } from '../form/context';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { NoCompactStyle } from '../space/Compact';\nimport { getTransitionName } from '../_util/motion';\nimport { canUseDocElement } from '../_util/styleChecker';\nimport warning from '../_util/warning';\nimport { getConfirmLocale } from './locale';\nvar mousePosition;\n// ref: https://github.com/ant-design/ant-design/issues/15795\nvar getClickPosition = function getClickPosition(e) {\n mousePosition = {\n x: e.pageX,\n y: e.pageY\n };\n // 100ms 内发生过点击事件,则从点击位置动画展示\n // 否则直接 zoom 展示\n // 这样可以兼容非点击方式展开\n setTimeout(function () {\n mousePosition = null;\n }, 100);\n};\n// 只有点击事件支持从鼠标位置动画展开\nif (canUseDocElement()) {\n document.documentElement.addEventListener('click', getClickPosition, true);\n}\nvar Modal = function Modal(props) {\n var _a;\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var handleCancel = function handleCancel(e) {\n var onCancel = props.onCancel;\n onCancel === null || onCancel === void 0 ? void 0 : onCancel(e);\n };\n var handleOk = function handleOk(e) {\n var onOk = props.onOk;\n onOk === null || onOk === void 0 ? void 0 : onOk(e);\n };\n process.env.NODE_ENV !== \"production\" ? warning(!('visible' in props), 'Modal', \"`visible` will be removed in next major version, please use `open` instead.\") : void 0;\n var customizePrefixCls = props.prefixCls,\n footer = props.footer,\n visible = props.visible,\n _props$open = props.open,\n open = _props$open === void 0 ? false : _props$open,\n wrapClassName = props.wrapClassName,\n centered = props.centered,\n getContainer = props.getContainer,\n closeIcon = props.closeIcon,\n _props$focusTriggerAf = props.focusTriggerAfterClose,\n focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,\n _props$width = props.width,\n width = _props$width === void 0 ? 520 : _props$width,\n restProps = __rest(props, [\"prefixCls\", \"footer\", \"visible\", \"open\", \"wrapClassName\", \"centered\", \"getContainer\", \"closeIcon\", \"focusTriggerAfterClose\", \"width\"]);\n var prefixCls = getPrefixCls('modal', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var defaultFooter = /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Modal\",\n defaultLocale: getConfirmLocale()\n }, function (contextLocale) {\n var okText = props.okText,\n _props$okType = props.okType,\n okType = _props$okType === void 0 ? 'primary' : _props$okType,\n cancelText = props.cancelText,\n _props$confirmLoading = props.confirmLoading,\n confirmLoading = _props$confirmLoading === void 0 ? false : _props$confirmLoading;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({\n onClick: handleCancel\n }, props.cancelButtonProps), cancelText || contextLocale.cancelText), /*#__PURE__*/React.createElement(Button, _extends({}, convertLegacyProps(okType), {\n loading: confirmLoading,\n onClick: handleOk\n }, props.okButtonProps), okText !== null && okText !== void 0 ? okText : contextLocale.okText));\n });\n var closeIconToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, closeIcon || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\")\n }));\n var wrapClassNameExtended = classNames(wrapClassName, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-centered\"), !!centered), \"\".concat(prefixCls, \"-wrap-rtl\"), direction === 'rtl'));\n return /*#__PURE__*/React.createElement(NoCompactStyle, null, /*#__PURE__*/React.createElement(NoFormStyle, {\n status: true,\n override: true\n }, /*#__PURE__*/React.createElement(Dialog, _extends({\n width: width\n }, restProps, {\n getContainer: getContainer === undefined ? getContextPopupContainer : getContainer,\n prefixCls: prefixCls,\n wrapClassName: wrapClassNameExtended,\n footer: footer === undefined ? defaultFooter : footer,\n visible: open || visible,\n mousePosition: (_a = restProps.mousePosition) !== null && _a !== void 0 ? _a : mousePosition,\n onClose: handleCancel,\n closeIcon: closeIconToRender,\n focusTriggerAfterClose: focusTriggerAfterClose,\n transitionName: getTransitionName(rootPrefixCls, 'zoom', props.transitionName),\n maskTransitionName: getTransitionName(rootPrefixCls, 'fade', props.maskTransitionName)\n }))));\n};\nexport default Modal;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport ConfigProvider from '../config-provider';\nimport ActionButton from '../_util/ActionButton';\nimport { getTransitionName } from '../_util/motion';\nimport warning from '../_util/warning';\nimport Dialog from './Modal';\nvar ConfirmDialog = function ConfirmDialog(props) {\n var icon = props.icon,\n onCancel = props.onCancel,\n onOk = props.onOk,\n close = props.close,\n zIndex = props.zIndex,\n afterClose = props.afterClose,\n visible = props.visible,\n open = props.open,\n keyboard = props.keyboard,\n centered = props.centered,\n getContainer = props.getContainer,\n maskStyle = props.maskStyle,\n okText = props.okText,\n okButtonProps = props.okButtonProps,\n cancelText = props.cancelText,\n cancelButtonProps = props.cancelButtonProps,\n direction = props.direction,\n prefixCls = props.prefixCls,\n wrapClassName = props.wrapClassName,\n rootPrefixCls = props.rootPrefixCls,\n iconPrefixCls = props.iconPrefixCls,\n bodyStyle = props.bodyStyle,\n _props$closable = props.closable,\n closable = _props$closable === void 0 ? false : _props$closable,\n closeIcon = props.closeIcon,\n modalRender = props.modalRender,\n focusTriggerAfterClose = props.focusTriggerAfterClose;\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof icon === 'string' && icon.length > 2), 'Modal', \"`icon` is using ReactNode instead of string naming in v4. Please check `\".concat(icon, \"` at https://ant.design/components/icon\")) : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(visible === undefined, 'Modal', \"`visible` is deprecated, please use `open` instead.\") : void 0;\n }\n // 支持传入{ icon: null }来隐藏`Modal.confirm`默认的Icon\n var okType = props.okType || 'primary';\n var contentPrefixCls = \"\".concat(prefixCls, \"-confirm\");\n // 默认为 true,保持向下兼容\n var okCancel = 'okCancel' in props ? props.okCancel : true;\n var width = props.width || 416;\n var style = props.style || {};\n var mask = props.mask === undefined ? true : props.mask;\n // 默认为 false,保持旧版默认行为\n var maskClosable = props.maskClosable === undefined ? false : props.maskClosable;\n var autoFocusButton = props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';\n var classString = classNames(contentPrefixCls, \"\".concat(contentPrefixCls, \"-\").concat(props.type), _defineProperty({}, \"\".concat(contentPrefixCls, \"-rtl\"), direction === 'rtl'), props.className);\n var cancelButton = okCancel && ( /*#__PURE__*/React.createElement(ActionButton, {\n actionFn: onCancel,\n close: close,\n autoFocus: autoFocusButton === 'cancel',\n buttonProps: cancelButtonProps,\n prefixCls: \"\".concat(rootPrefixCls, \"-btn\")\n }, cancelText));\n return /*#__PURE__*/React.createElement(ConfigProvider, {\n prefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n direction: direction\n }, /*#__PURE__*/React.createElement(Dialog, {\n prefixCls: prefixCls,\n className: classString,\n wrapClassName: classNames(_defineProperty({}, \"\".concat(contentPrefixCls, \"-centered\"), !!props.centered), wrapClassName),\n onCancel: function onCancel() {\n return close === null || close === void 0 ? void 0 : close({\n triggerCancel: true\n });\n },\n open: open || visible,\n title: \"\",\n footer: \"\",\n transitionName: getTransitionName(rootPrefixCls, 'zoom', props.transitionName),\n maskTransitionName: getTransitionName(rootPrefixCls, 'fade', props.maskTransitionName),\n mask: mask,\n maskClosable: maskClosable,\n maskStyle: maskStyle,\n style: style,\n bodyStyle: bodyStyle,\n width: width,\n zIndex: zIndex,\n afterClose: afterClose,\n keyboard: keyboard,\n centered: centered,\n getContainer: getContainer,\n closable: closable,\n closeIcon: closeIcon,\n modalRender: modalRender,\n focusTriggerAfterClose: focusTriggerAfterClose\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-body-wrapper\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-body\")\n }, icon, props.title === undefined ? null : ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(contentPrefixCls, \"-title\")\n }, props.title)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-content\")\n }, props.content)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-btns\")\n }, cancelButton, /*#__PURE__*/React.createElement(ActionButton, {\n type: okType,\n actionFn: onOk,\n close: close,\n autoFocus: autoFocusButton === 'ok',\n buttonProps: okButtonProps,\n prefixCls: \"\".concat(rootPrefixCls, \"-btn\")\n }, okText)))));\n};\nexport default ConfirmDialog;","var destroyFns = [];\nexport default destroyFns;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckCircleOutlined from \"@ant-design/icons/es/icons/CheckCircleOutlined\";\nimport CloseCircleOutlined from \"@ant-design/icons/es/icons/CloseCircleOutlined\";\nimport ExclamationCircleOutlined from \"@ant-design/icons/es/icons/ExclamationCircleOutlined\";\nimport InfoCircleOutlined from \"@ant-design/icons/es/icons/InfoCircleOutlined\";\nimport { render as reactRender, unmount as reactUnmount } from \"rc-util/es/React/render\";\nimport * as React from 'react';\nimport { globalConfig } from '../config-provider';\nimport warning from '../_util/warning';\nimport ConfirmDialog from './ConfirmDialog';\nimport destroyFns from './destroyFns';\nimport { getConfirmLocale } from './locale';\nvar defaultRootPrefixCls = '';\nfunction getRootPrefixCls() {\n return defaultRootPrefixCls;\n}\nexport default function confirm(config) {\n var container = document.createDocumentFragment();\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n var currentConfig = _extends(_extends({}, config), {\n close: close,\n open: true\n });\n var timeoutId;\n function destroy() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var triggerCancel = args.some(function (param) {\n return param && param.triggerCancel;\n });\n if (config.onCancel && triggerCancel) {\n config.onCancel.apply(config, [function () {}].concat(_toConsumableArray(args.slice(1))));\n }\n for (var i = 0; i < destroyFns.length; i++) {\n var fn = destroyFns[i];\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n if (fn === close) {\n destroyFns.splice(i, 1);\n break;\n }\n }\n reactUnmount(container);\n }\n function render(_a) {\n var okText = _a.okText,\n cancelText = _a.cancelText,\n customizePrefixCls = _a.prefixCls,\n props = __rest(_a, [\"okText\", \"cancelText\", \"prefixCls\"]);\n clearTimeout(timeoutId);\n /**\n * https://github.com/ant-design/ant-design/issues/23623\n *\n * Sync render blocks React event. Let's make this async.\n */\n timeoutId = setTimeout(function () {\n var runtimeLocale = getConfirmLocale();\n var _globalConfig = globalConfig(),\n getPrefixCls = _globalConfig.getPrefixCls,\n getIconPrefixCls = _globalConfig.getIconPrefixCls;\n // because Modal.config \b set rootPrefixCls, which is different from other components\n var rootPrefixCls = getPrefixCls(undefined, getRootPrefixCls());\n var prefixCls = customizePrefixCls || \"\".concat(rootPrefixCls, \"-modal\");\n var iconPrefixCls = getIconPrefixCls();\n reactRender( /*#__PURE__*/React.createElement(ConfirmDialog, _extends({}, props, {\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n okText: okText || (props.okCancel ? runtimeLocale.okText : runtimeLocale.justOkText),\n cancelText: cancelText || runtimeLocale.cancelText\n })), container);\n });\n }\n function close() {\n var _this = this;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n currentConfig = _extends(_extends({}, currentConfig), {\n open: false,\n afterClose: function afterClose() {\n if (typeof config.afterClose === 'function') {\n config.afterClose();\n }\n destroy.apply(_this, args);\n }\n });\n // Legacy support\n if (currentConfig.visible) {\n delete currentConfig.visible;\n }\n render(currentConfig);\n }\n function update(configUpdate) {\n if (typeof configUpdate === 'function') {\n currentConfig = configUpdate(currentConfig);\n } else {\n currentConfig = _extends(_extends({}, currentConfig), configUpdate);\n }\n render(currentConfig);\n }\n render(currentConfig);\n destroyFns.push(close);\n return {\n destroy: close,\n update: update\n };\n}\nexport function withWarn(props) {\n return _extends(_extends({\n icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),\n okCancel: false\n }, props), {\n type: 'warning'\n });\n}\nexport function withInfo(props) {\n return _extends(_extends({\n icon: /*#__PURE__*/React.createElement(InfoCircleOutlined, null),\n okCancel: false\n }, props), {\n type: 'info'\n });\n}\nexport function withSuccess(props) {\n return _extends(_extends({\n icon: /*#__PURE__*/React.createElement(CheckCircleOutlined, null),\n okCancel: false\n }, props), {\n type: 'success'\n });\n}\nexport function withError(props) {\n return _extends(_extends({\n icon: /*#__PURE__*/React.createElement(CloseCircleOutlined, null),\n okCancel: false\n }, props), {\n type: 'error'\n });\n}\nexport function withConfirm(props) {\n return _extends(_extends({\n icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),\n okCancel: true\n }, props), {\n type: 'confirm'\n });\n}\nexport function modalGlobalConfig(_ref) {\n var rootPrefixCls = _ref.rootPrefixCls;\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Modal', 'Modal.config is deprecated. Please use ConfigProvider.config instead.') : void 0;\n defaultRootPrefixCls = rootPrefixCls;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport LocaleReceiver from '../../locale-provider/LocaleReceiver';\nimport defaultLocale from '../../locale/default';\nimport ConfirmDialog from '../ConfirmDialog';\nvar HookModal = function HookModal(_ref, ref) {\n var afterClose = _ref.afterClose,\n config = _ref.config;\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n open = _React$useState2[0],\n setOpen = _React$useState2[1];\n var _React$useState3 = React.useState(config),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n innerConfig = _React$useState4[0],\n setInnerConfig = _React$useState4[1];\n var _React$useContext = React.useContext(ConfigContext),\n direction = _React$useContext.direction,\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('modal');\n var rootPrefixCls = getPrefixCls();\n var close = function close() {\n setOpen(false);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var triggerCancel = args.some(function (param) {\n return param && param.triggerCancel;\n });\n if (innerConfig.onCancel && triggerCancel) {\n innerConfig.onCancel.apply(innerConfig, [function () {}].concat(_toConsumableArray(args.slice(1))));\n }\n };\n React.useImperativeHandle(ref, function () {\n return {\n destroy: close,\n update: function update(newConfig) {\n setInnerConfig(function (originConfig) {\n return _extends(_extends({}, originConfig), newConfig);\n });\n }\n };\n });\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Modal\",\n defaultLocale: defaultLocale.Modal\n }, function (contextLocale) {\n return /*#__PURE__*/React.createElement(ConfirmDialog, _extends({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls\n }, innerConfig, {\n close: close,\n open: open,\n afterClose: afterClose,\n okText: innerConfig.okText || (innerConfig.okCancel ? contextLocale.okText : contextLocale.justOkText),\n direction: direction,\n cancelText: innerConfig.cancelText || contextLocale.cancelText\n }));\n });\n};\nexport default /*#__PURE__*/React.forwardRef(HookModal);","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport usePatchElement from '../../_util/hooks/usePatchElement';\nimport { withConfirm, withError, withInfo, withSuccess, withWarn } from '../confirm';\nimport HookModal from './HookModal';\nvar uuid = 0;\nvar ElementsHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_props, ref) {\n var _usePatchElement = usePatchElement(),\n _usePatchElement2 = _slicedToArray(_usePatchElement, 2),\n elements = _usePatchElement2[0],\n patchElement = _usePatchElement2[1];\n React.useImperativeHandle(ref, function () {\n return {\n patchElement: patchElement\n };\n }, []);\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return /*#__PURE__*/React.createElement(React.Fragment, null, elements);\n}));\nexport default function useModal() {\n var holderRef = React.useRef(null);\n // ========================== Effect ==========================\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n actionQueue = _React$useState2[0],\n setActionQueue = _React$useState2[1];\n React.useEffect(function () {\n if (actionQueue.length) {\n var cloneQueue = _toConsumableArray(actionQueue);\n cloneQueue.forEach(function (action) {\n action();\n });\n setActionQueue([]);\n }\n }, [actionQueue]);\n // =========================== Hook ===========================\n var getConfirmFunc = React.useCallback(function (withFunc) {\n return function hookConfirm(config) {\n var _a;\n uuid += 1;\n var modalRef = /*#__PURE__*/React.createRef();\n var closeFunc;\n var modal = /*#__PURE__*/React.createElement(HookModal, {\n key: \"modal-\".concat(uuid),\n config: withFunc(config),\n ref: modalRef,\n afterClose: function afterClose() {\n closeFunc === null || closeFunc === void 0 ? void 0 : closeFunc();\n }\n });\n closeFunc = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.patchElement(modal);\n return {\n destroy: function destroy() {\n function destroyAction() {\n var _a;\n (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.destroy();\n }\n if (modalRef.current) {\n destroyAction();\n } else {\n setActionQueue(function (prev) {\n return [].concat(_toConsumableArray(prev), [destroyAction]);\n });\n }\n },\n update: function update(newConfig) {\n function updateAction() {\n var _a;\n (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.update(newConfig);\n }\n if (modalRef.current) {\n updateAction();\n } else {\n setActionQueue(function (prev) {\n return [].concat(_toConsumableArray(prev), [updateAction]);\n });\n }\n }\n };\n };\n }, []);\n var fns = React.useMemo(function () {\n return {\n info: getConfirmFunc(withInfo),\n success: getConfirmFunc(withSuccess),\n error: getConfirmFunc(withError),\n warning: getConfirmFunc(withWarn),\n confirm: getConfirmFunc(withConfirm)\n };\n }, []);\n // eslint-disable-next-line react/jsx-key\n return [fns, /*#__PURE__*/React.createElement(ElementsHolder, {\n ref: holderRef\n })];\n}","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function usePatchElement() {\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n elements = _React$useState2[0],\n setElements = _React$useState2[1];\n var patchElement = React.useCallback(function (element) {\n // append a new element to elements (and create a new ref)\n setElements(function (originElements) {\n return [].concat(_toConsumableArray(originElements), [element]);\n });\n // return a function that removes the new element out of elements (and create a new ref)\n // it works a little like useEffect\n return function () {\n setElements(function (originElements) {\n return originElements.filter(function (ele) {\n return ele !== element;\n });\n });\n };\n }, []);\n return [elements, patchElement];\n}","import confirm, { modalGlobalConfig, withConfirm, withError, withInfo, withSuccess, withWarn } from './confirm';\nimport destroyFns from './destroyFns';\nimport OriginModal from './Modal';\nimport useModal from './useModal';\nfunction modalWarn(props) {\n return confirm(withWarn(props));\n}\nvar Modal = OriginModal;\nModal.useModal = useModal;\nModal.info = function infoFn(props) {\n return confirm(withInfo(props));\n};\nModal.success = function successFn(props) {\n return confirm(withSuccess(props));\n};\nModal.error = function errorFn(props) {\n return confirm(withError(props));\n};\nModal.warning = modalWarn;\nModal.warn = modalWarn;\nModal.confirm = function confirmFn(props) {\n return confirm(withConfirm(props));\n};\nModal.destroyAll = function destroyAllFn() {\n while (destroyFns.length) {\n var close = destroyFns.pop();\n if (close) {\n close();\n }\n }\n};\nModal.config = modalGlobalConfig;\nexport default Modal;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport defaultLocale from '../locale/default';\nvar runtimeLocale = _extends({}, defaultLocale.Modal);\nexport function changeConfirmLocale(newLocale) {\n if (newLocale) {\n runtimeLocale = _extends(_extends({}, runtimeLocale), newLocale);\n } else {\n runtimeLocale = _extends({}, defaultLocale.Modal);\n }\n}\nexport function getConfirmLocale() {\n return runtimeLocale;\n}","import _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport CheckCircleOutlined from \"@ant-design/icons/es/icons/CheckCircleOutlined\";\nimport CloseCircleOutlined from \"@ant-design/icons/es/icons/CloseCircleOutlined\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport ExclamationCircleOutlined from \"@ant-design/icons/es/icons/ExclamationCircleOutlined\";\nimport InfoCircleOutlined from \"@ant-design/icons/es/icons/InfoCircleOutlined\";\nimport classNames from 'classnames';\nimport Notification from 'rc-notification';\nimport * as React from 'react';\nimport ConfigProvider, { globalConfig } from '../config-provider';\nimport createUseNotification from './hooks/useNotification';\nvar notificationInstance = {};\nvar defaultDuration = 4.5;\nvar defaultTop = 24;\nvar defaultBottom = 24;\nvar defaultPrefixCls = '';\nvar defaultPlacement = 'topRight';\nvar defaultGetContainer;\nvar defaultCloseIcon;\nvar rtl = false;\nvar maxCount;\nfunction setNotificationConfig(options) {\n var duration = options.duration,\n placement = options.placement,\n bottom = options.bottom,\n top = options.top,\n getContainer = options.getContainer,\n closeIcon = options.closeIcon,\n prefixCls = options.prefixCls;\n if (prefixCls !== undefined) {\n defaultPrefixCls = prefixCls;\n }\n if (duration !== undefined) {\n defaultDuration = duration;\n }\n if (placement !== undefined) {\n defaultPlacement = placement;\n } else if (options.rtl) {\n defaultPlacement = 'topLeft';\n }\n if (bottom !== undefined) {\n defaultBottom = bottom;\n }\n if (top !== undefined) {\n defaultTop = top;\n }\n if (getContainer !== undefined) {\n defaultGetContainer = getContainer;\n }\n if (closeIcon !== undefined) {\n defaultCloseIcon = closeIcon;\n }\n if (options.rtl !== undefined) {\n rtl = options.rtl;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n }\n}\nfunction getPlacementStyle(placement) {\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTop;\n var bottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultBottom;\n var style;\n switch (placement) {\n case 'top':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top: top,\n bottom: 'auto'\n };\n break;\n case 'topLeft':\n style = {\n left: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n case 'topRight':\n style = {\n right: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n case 'bottom':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top: 'auto',\n bottom: bottom\n };\n break;\n case 'bottomLeft':\n style = {\n left: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n default:\n style = {\n right: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n }\n return style;\n}\nfunction getNotificationInstance(args, callback) {\n var _args$placement = args.placement,\n placement = _args$placement === void 0 ? defaultPlacement : _args$placement,\n top = args.top,\n bottom = args.bottom,\n _args$getContainer = args.getContainer,\n getContainer = _args$getContainer === void 0 ? defaultGetContainer : _args$getContainer,\n customizePrefixCls = args.prefixCls;\n var _globalConfig = globalConfig(),\n getPrefixCls = _globalConfig.getPrefixCls,\n getIconPrefixCls = _globalConfig.getIconPrefixCls;\n var prefixCls = getPrefixCls('notification', customizePrefixCls || defaultPrefixCls);\n var iconPrefixCls = getIconPrefixCls();\n var cacheKey = \"\".concat(prefixCls, \"-\").concat(placement);\n var cacheInstance = notificationInstance[cacheKey];\n if (cacheInstance) {\n Promise.resolve(cacheInstance).then(function (instance) {\n callback({\n prefixCls: \"\".concat(prefixCls, \"-notice\"),\n iconPrefixCls: iconPrefixCls,\n instance: instance\n });\n });\n return;\n }\n var notificationClass = classNames(\"\".concat(prefixCls, \"-\").concat(placement), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtl === true));\n notificationInstance[cacheKey] = new Promise(function (resolve) {\n Notification.newInstance({\n prefixCls: prefixCls,\n className: notificationClass,\n style: getPlacementStyle(placement, top, bottom),\n getContainer: getContainer,\n maxCount: maxCount\n }, function (notification) {\n resolve(notification);\n callback({\n prefixCls: \"\".concat(prefixCls, \"-notice\"),\n iconPrefixCls: iconPrefixCls,\n instance: notification\n });\n });\n });\n}\nvar typeToIcon = {\n success: CheckCircleOutlined,\n info: InfoCircleOutlined,\n error: CloseCircleOutlined,\n warning: ExclamationCircleOutlined\n};\nfunction getRCNoticeProps(args, prefixCls, iconPrefixCls) {\n var durationArg = args.duration,\n icon = args.icon,\n type = args.type,\n description = args.description,\n message = args.message,\n btn = args.btn,\n onClose = args.onClose,\n onClick = args.onClick,\n key = args.key,\n style = args.style,\n className = args.className,\n _args$closeIcon = args.closeIcon,\n closeIcon = _args$closeIcon === void 0 ? defaultCloseIcon : _args$closeIcon,\n props = args.props;\n var duration = durationArg === undefined ? defaultDuration : durationArg;\n var iconNode = null;\n if (icon) {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, args.icon);\n } else if (type) {\n iconNode = /*#__PURE__*/React.createElement(typeToIcon[type] || null, {\n className: \"\".concat(prefixCls, \"-icon \").concat(prefixCls, \"-icon-\").concat(type)\n });\n }\n var closeIconToRender = typeof closeIcon === 'undefined' ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\")\n }))) : closeIcon;\n var autoMarginTag = !description && iconNode ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-message-single-line-auto-margin\")\n })) : null;\n return {\n content: ( /*#__PURE__*/React.createElement(ConfigProvider, {\n iconPrefixCls: iconPrefixCls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: iconNode ? \"\".concat(prefixCls, \"-with-icon\") : '',\n role: \"alert\"\n }, iconNode, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-message\")\n }, autoMarginTag, message), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, description), btn ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-btn\")\n }, btn) : null))),\n duration: duration,\n closable: true,\n closeIcon: closeIconToRender,\n onClose: onClose,\n onClick: onClick,\n key: key,\n style: style || {},\n className: classNames(className, _defineProperty({}, \"\".concat(prefixCls, \"-\").concat(type), !!type)),\n props: props\n };\n}\nfunction notice(args) {\n getNotificationInstance(args, function (_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n instance = _ref.instance;\n instance.notice(getRCNoticeProps(args, prefixCls, iconPrefixCls));\n });\n}\nvar api = {\n open: notice,\n close: function close(key) {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n return Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {\n instance.removeNotice(key);\n });\n });\n },\n config: setNotificationConfig,\n destroy: function destroy() {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {\n instance.destroy();\n });\n delete notificationInstance[cacheKey]; // lgtm[js/missing-await]\n });\n }\n};\n['success', 'info', 'warning', 'error'].forEach(function (type) {\n api[type] = function (args) {\n return api.open(_extends(_extends({}, args), {\n type: type\n }));\n };\n});\napi.warn = api.warning;\napi.useNotification = createUseNotification(getNotificationInstance, getRCNoticeProps);\n/** @internal test Only function. Not work on production */\nexport var getInstance = function getInstance(cacheKey) {\n return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", process.env.NODE_ENV === 'test' ? notificationInstance[cacheKey] : null);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n};\nexport default api;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport useRCNotification from \"rc-notification/es/useNotification\";\nimport * as React from 'react';\nimport { ConfigConsumer } from '../../config-provider';\nexport default function createUseNotification(getNotificationInstance, getRCNoticeProps) {\n var useNotification = function useNotification() {\n // We can only get content by render\n var getPrefixCls;\n // We create a proxy to handle delay created instance\n var innerInstance = null;\n var proxy = {\n add: function add(noticeProps, holderCallback) {\n innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback);\n }\n };\n var _useRCNotification = useRCNotification(proxy),\n _useRCNotification2 = _slicedToArray(_useRCNotification, 2),\n hookNotify = _useRCNotification2[0],\n holder = _useRCNotification2[1];\n function notify(args) {\n var customizePrefixCls = args.prefixCls;\n var mergedPrefixCls = getPrefixCls('notification', customizePrefixCls);\n getNotificationInstance(_extends(_extends({}, args), {\n prefixCls: mergedPrefixCls\n }), function (_ref) {\n var prefixCls = _ref.prefixCls,\n instance = _ref.instance;\n innerInstance = instance;\n hookNotify(getRCNoticeProps(args, prefixCls));\n });\n }\n // Fill functions\n var hookApiRef = React.useRef({});\n hookApiRef.current.open = notify;\n ['success', 'info', 'warning', 'error'].forEach(function (type) {\n hookApiRef.current[type] = function (args) {\n return hookApiRef.current.open(_extends(_extends({}, args), {\n type: type\n }));\n };\n });\n return [hookApiRef.current, /*#__PURE__*/React.createElement(ConfigConsumer, {\n key: \"holder\"\n }, function (context) {\n getPrefixCls = context.getPrefixCls;\n return holder;\n })];\n };\n return useNotification;\n}","// This icon file is generated automatically.\nvar DoubleLeftOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z\" } }] }, \"name\": \"double-left\", \"theme\": \"outlined\" };\nexport default DoubleLeftOutlined;\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 DoubleLeftOutlinedSvg from \"@ant-design/icons-svg/es/asn/DoubleLeftOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DoubleLeftOutlined = function DoubleLeftOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DoubleLeftOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DoubleLeftOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DoubleLeftOutlined';\n}\nexport default RefIcon;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/* eslint react/prop-types: 0 */\nimport React from 'react';\nimport classNames from 'classnames';\nvar Pager = function Pager(props) {\n var _classNames;\n var prefixCls = \"\".concat(props.rootPrefixCls, \"-item\");\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(props.page), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-active\"), props.active), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), !props.page), _defineProperty(_classNames, props.className, !!props.className), _classNames));\n var handleClick = function handleClick() {\n props.onClick(props.page);\n };\n var handleKeyPress = function handleKeyPress(e) {\n props.onKeyPress(e, props.onClick, props.page);\n };\n return /*#__PURE__*/React.createElement(\"li\", {\n title: props.showTitle ? props.page : null,\n className: cls,\n onClick: handleClick,\n onKeyPress: handleKeyPress,\n tabIndex: \"0\"\n }, props.itemRender(props.page, 'page', /*#__PURE__*/React.createElement(\"a\", {\n rel: \"nofollow\"\n }, props.page)));\n};\nexport default Pager;","export default {\n ZERO: 48,\n NINE: 57,\n NUMPAD_ZERO: 96,\n NUMPAD_NINE: 105,\n BACKSPACE: 8,\n DELETE: 46,\n ENTER: 13,\n ARROW_UP: 38,\n ARROW_DOWN: 40\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\";\n/* eslint react/prop-types: 0 */\nimport React from 'react';\nimport KEYCODE from './KeyCode';\nvar Options = /*#__PURE__*/function (_React$Component) {\n _inherits(Options, _React$Component);\n var _super = _createSuper(Options);\n function Options() {\n var _this;\n _classCallCheck(this, Options);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.state = {\n goInputText: ''\n };\n _this.buildOptionText = function (value) {\n return \"\".concat(value, \" \").concat(_this.props.locale.items_per_page);\n };\n _this.changeSize = function (value) {\n _this.props.changeSize(Number(value));\n };\n _this.handleChange = function (e) {\n _this.setState({\n goInputText: e.target.value\n });\n };\n _this.handleBlur = function (e) {\n var _this$props = _this.props,\n goButton = _this$props.goButton,\n quickGo = _this$props.quickGo,\n rootPrefixCls = _this$props.rootPrefixCls;\n var goInputText = _this.state.goInputText;\n if (goButton || goInputText === '') {\n return;\n }\n _this.setState({\n goInputText: ''\n });\n if (e.relatedTarget && (e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-item-link\")) >= 0 || e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-item\")) >= 0)) {\n return;\n }\n quickGo(_this.getValidValue());\n };\n _this.go = function (e) {\n var goInputText = _this.state.goInputText;\n if (goInputText === '') {\n return;\n }\n if (e.keyCode === KEYCODE.ENTER || e.type === 'click') {\n _this.setState({\n goInputText: ''\n });\n _this.props.quickGo(_this.getValidValue());\n }\n };\n return _this;\n }\n _createClass(Options, [{\n key: \"getValidValue\",\n value: function getValidValue() {\n var goInputText = this.state.goInputText;\n // eslint-disable-next-line no-restricted-globals\n return !goInputText || isNaN(goInputText) ? undefined : Number(goInputText);\n }\n }, {\n key: \"getPageSizeOptions\",\n value: function getPageSizeOptions() {\n var _this$props2 = this.props,\n pageSize = _this$props2.pageSize,\n pageSizeOptions = _this$props2.pageSizeOptions;\n if (pageSizeOptions.some(function (option) {\n return option.toString() === pageSize.toString();\n })) {\n return pageSizeOptions;\n }\n return pageSizeOptions.concat([pageSize.toString()]).sort(function (a, b) {\n // eslint-disable-next-line no-restricted-globals\n var numberA = isNaN(Number(a)) ? 0 : Number(a);\n // eslint-disable-next-line no-restricted-globals\n var numberB = isNaN(Number(b)) ? 0 : Number(b);\n return numberA - numberB;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$props3 = this.props,\n pageSize = _this$props3.pageSize,\n locale = _this$props3.locale,\n rootPrefixCls = _this$props3.rootPrefixCls,\n changeSize = _this$props3.changeSize,\n quickGo = _this$props3.quickGo,\n goButton = _this$props3.goButton,\n selectComponentClass = _this$props3.selectComponentClass,\n buildOptionText = _this$props3.buildOptionText,\n selectPrefixCls = _this$props3.selectPrefixCls,\n disabled = _this$props3.disabled;\n var goInputText = this.state.goInputText;\n var prefixCls = \"\".concat(rootPrefixCls, \"-options\");\n var Select = selectComponentClass;\n var changeSelect = null;\n var goInput = null;\n var gotoButton = null;\n if (!changeSize && !quickGo) {\n return null;\n }\n var pageSizeOptions = this.getPageSizeOptions();\n if (changeSize && Select) {\n var options = pageSizeOptions.map(function (opt, i) {\n return /*#__PURE__*/React.createElement(Select.Option, {\n key: i,\n value: opt.toString()\n }, (buildOptionText || _this2.buildOptionText)(opt));\n });\n changeSelect = /*#__PURE__*/React.createElement(Select, {\n disabled: disabled,\n prefixCls: selectPrefixCls,\n showSearch: false,\n className: \"\".concat(prefixCls, \"-size-changer\"),\n optionLabelProp: \"children\",\n dropdownMatchSelectWidth: false,\n value: (pageSize || pageSizeOptions[0]).toString(),\n onChange: this.changeSize,\n getPopupContainer: function getPopupContainer(triggerNode) {\n return triggerNode.parentNode;\n },\n \"aria-label\": locale.page_size,\n defaultOpen: false\n }, options);\n }\n if (quickGo) {\n if (goButton) {\n gotoButton = typeof goButton === 'boolean' ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.go,\n onKeyUp: this.go,\n disabled: disabled,\n className: \"\".concat(prefixCls, \"-quick-jumper-button\")\n }, locale.jump_to_confirm) : /*#__PURE__*/React.createElement(\"span\", {\n onClick: this.go,\n onKeyUp: this.go\n }, goButton);\n }\n goInput = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-quick-jumper\")\n }, locale.jump_to, /*#__PURE__*/React.createElement(\"input\", {\n disabled: disabled,\n type: \"text\",\n value: goInputText,\n onChange: this.handleChange,\n onKeyUp: this.go,\n onBlur: this.handleBlur,\n \"aria-label\": locale.page\n }), locale.page, gotoButton);\n }\n return /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls)\n }, changeSelect, goInput);\n }\n }]);\n return Options;\n}(React.Component);\nOptions.defaultProps = {\n pageSizeOptions: ['10', '20', '50', '100']\n};\nexport default Options;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\n/* eslint react/prop-types: 0 */\nimport React, { cloneElement, isValidElement } from 'react';\nimport classNames from 'classnames';\nimport Pager from './Pager';\nimport Options from './Options';\nimport KEYCODE from './KeyCode';\nimport LOCALE from './locale/zh_CN';\nfunction noop() {}\nfunction isInteger(v) {\n var value = Number(v);\n return (\n // eslint-disable-next-line no-restricted-globals\n typeof value === 'number' && !isNaN(value) && isFinite(value) && Math.floor(value) === value\n );\n}\nfunction defaultItemRender(page, type, element) {\n return element;\n}\nfunction calculatePage(p, state, props) {\n var pageSize = typeof p === 'undefined' ? state.pageSize : p;\n return Math.floor((props.total - 1) / pageSize) + 1;\n}\nvar Pagination = /*#__PURE__*/function (_React$Component) {\n _inherits(Pagination, _React$Component);\n var _super = _createSuper(Pagination);\n function Pagination(props) {\n var _this;\n _classCallCheck(this, Pagination);\n _this = _super.call(this, props);\n _this.getJumpPrevPage = function () {\n return Math.max(1, _this.state.current - (_this.props.showLessItems ? 3 : 5));\n };\n _this.getJumpNextPage = function () {\n return Math.min(calculatePage(undefined, _this.state, _this.props), _this.state.current + (_this.props.showLessItems ? 3 : 5));\n };\n _this.getItemIcon = function (icon, label) {\n var prefixCls = _this.props.prefixCls;\n var iconNode = icon || /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": label,\n className: \"\".concat(prefixCls, \"-item-link\")\n });\n if (typeof icon === 'function') {\n iconNode = /*#__PURE__*/React.createElement(icon, _objectSpread({}, _this.props));\n }\n return iconNode;\n };\n _this.savePaginationNode = function (node) {\n _this.paginationNode = node;\n };\n _this.isValid = function (page) {\n var total = _this.props.total;\n return isInteger(page) && page !== _this.state.current && isInteger(total) && total > 0;\n };\n _this.shouldDisplayQuickJumper = function () {\n var _this$props = _this.props,\n showQuickJumper = _this$props.showQuickJumper,\n total = _this$props.total;\n var pageSize = _this.state.pageSize;\n if (total <= pageSize) {\n return false;\n }\n return showQuickJumper;\n };\n _this.handleKeyDown = function (e) {\n if (e.keyCode === KEYCODE.ARROW_UP || e.keyCode === KEYCODE.ARROW_DOWN) {\n e.preventDefault();\n }\n };\n _this.handleKeyUp = function (e) {\n var value = _this.getValidValue(e);\n var currentInputValue = _this.state.currentInputValue;\n if (value !== currentInputValue) {\n _this.setState({\n currentInputValue: value\n });\n }\n if (e.keyCode === KEYCODE.ENTER) {\n _this.handleChange(value);\n } else if (e.keyCode === KEYCODE.ARROW_UP) {\n _this.handleChange(value - 1);\n } else if (e.keyCode === KEYCODE.ARROW_DOWN) {\n _this.handleChange(value + 1);\n }\n };\n _this.handleBlur = function (e) {\n var value = _this.getValidValue(e);\n _this.handleChange(value);\n };\n _this.changePageSize = function (size) {\n var current = _this.state.current;\n var newCurrent = calculatePage(size, _this.state, _this.props);\n current = current > newCurrent ? newCurrent : current;\n // fix the issue:\n // Once 'total' is 0, 'current' in 'onShowSizeChange' is 0, which is not correct.\n if (newCurrent === 0) {\n // eslint-disable-next-line prefer-destructuring\n current = _this.state.current;\n }\n if (typeof size === 'number') {\n if (!('pageSize' in _this.props)) {\n _this.setState({\n pageSize: size\n });\n }\n if (!('current' in _this.props)) {\n _this.setState({\n current: current,\n currentInputValue: current\n });\n }\n }\n _this.props.onShowSizeChange(current, size);\n if ('onChange' in _this.props && _this.props.onChange) {\n _this.props.onChange(current, size);\n }\n };\n _this.handleChange = function (page) {\n var _this$props2 = _this.props,\n disabled = _this$props2.disabled,\n onChange = _this$props2.onChange;\n var _this$state = _this.state,\n pageSize = _this$state.pageSize,\n current = _this$state.current,\n currentInputValue = _this$state.currentInputValue;\n if (_this.isValid(page) && !disabled) {\n var currentPage = calculatePage(undefined, _this.state, _this.props);\n var newPage = page;\n if (page > currentPage) {\n newPage = currentPage;\n } else if (page < 1) {\n newPage = 1;\n }\n if (!('current' in _this.props)) {\n _this.setState({\n current: newPage\n });\n }\n if (newPage !== currentInputValue) {\n _this.setState({\n currentInputValue: newPage\n });\n }\n onChange(newPage, pageSize);\n return newPage;\n }\n return current;\n };\n _this.prev = function () {\n if (_this.hasPrev()) {\n _this.handleChange(_this.state.current - 1);\n }\n };\n _this.next = function () {\n if (_this.hasNext()) {\n _this.handleChange(_this.state.current + 1);\n }\n };\n _this.jumpPrev = function () {\n _this.handleChange(_this.getJumpPrevPage());\n };\n _this.jumpNext = function () {\n _this.handleChange(_this.getJumpNextPage());\n };\n _this.hasPrev = function () {\n return _this.state.current > 1;\n };\n _this.hasNext = function () {\n return _this.state.current < calculatePage(undefined, _this.state, _this.props);\n };\n _this.runIfEnter = function (event, callback) {\n if (event.key === 'Enter' || event.charCode === 13) {\n for (var _len = arguments.length, restParams = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParams[_key - 2] = arguments[_key];\n }\n callback.apply(void 0, restParams);\n }\n };\n _this.runIfEnterPrev = function (e) {\n _this.runIfEnter(e, _this.prev);\n };\n _this.runIfEnterNext = function (e) {\n _this.runIfEnter(e, _this.next);\n };\n _this.runIfEnterJumpPrev = function (e) {\n _this.runIfEnter(e, _this.jumpPrev);\n };\n _this.runIfEnterJumpNext = function (e) {\n _this.runIfEnter(e, _this.jumpNext);\n };\n _this.handleGoTO = function (e) {\n if (e.keyCode === KEYCODE.ENTER || e.type === 'click') {\n _this.handleChange(_this.state.currentInputValue);\n }\n };\n var hasOnChange = props.onChange !== noop;\n var hasCurrent = ('current' in props);\n if (hasCurrent && !hasOnChange) {\n // eslint-disable-next-line no-console\n console.warn('Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.');\n }\n var _current = props.defaultCurrent;\n if ('current' in props) {\n // eslint-disable-next-line prefer-destructuring\n _current = props.current;\n }\n var _pageSize = props.defaultPageSize;\n if ('pageSize' in props) {\n // eslint-disable-next-line prefer-destructuring\n _pageSize = props.pageSize;\n }\n _current = Math.min(_current, calculatePage(_pageSize, undefined, props));\n _this.state = {\n current: _current,\n currentInputValue: _current,\n pageSize: _pageSize\n };\n return _this;\n }\n _createClass(Pagination, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n // When current page change, fix focused style of prev item\n // A hacky solution of https://github.com/ant-design/ant-design/issues/8948\n var prefixCls = this.props.prefixCls;\n if (prevState.current !== this.state.current && this.paginationNode) {\n var lastCurrentNode = this.paginationNode.querySelector(\".\".concat(prefixCls, \"-item-\").concat(prevState.current));\n if (lastCurrentNode && document.activeElement === lastCurrentNode) {\n lastCurrentNode.blur();\n }\n }\n }\n }, {\n key: \"getValidValue\",\n value: function getValidValue(e) {\n var inputValue = e.target.value;\n var allPages = calculatePage(undefined, this.state, this.props);\n var currentInputValue = this.state.currentInputValue;\n var value;\n if (inputValue === '') {\n value = inputValue;\n // eslint-disable-next-line no-restricted-globals\n } else if (isNaN(Number(inputValue))) {\n value = currentInputValue;\n } else if (inputValue >= allPages) {\n value = allPages;\n } else {\n value = Number(inputValue);\n }\n return value;\n }\n }, {\n key: \"getShowSizeChanger\",\n value: function getShowSizeChanger() {\n var _this$props3 = this.props,\n showSizeChanger = _this$props3.showSizeChanger,\n total = _this$props3.total,\n totalBoundaryShowSizeChanger = _this$props3.totalBoundaryShowSizeChanger;\n if (typeof showSizeChanger !== 'undefined') {\n return showSizeChanger;\n }\n return total > totalBoundaryShowSizeChanger;\n }\n }, {\n key: \"renderPrev\",\n value: function renderPrev(prevPage) {\n var _this$props4 = this.props,\n prevIcon = _this$props4.prevIcon,\n itemRender = _this$props4.itemRender;\n var prevButton = itemRender(prevPage, 'prev', this.getItemIcon(prevIcon, 'prev page'));\n var disabled = !this.hasPrev();\n return /*#__PURE__*/isValidElement(prevButton) ? /*#__PURE__*/cloneElement(prevButton, {\n disabled: disabled\n }) : prevButton;\n }\n }, {\n key: \"renderNext\",\n value: function renderNext(nextPage) {\n var _this$props5 = this.props,\n nextIcon = _this$props5.nextIcon,\n itemRender = _this$props5.itemRender;\n var nextButton = itemRender(nextPage, 'next', this.getItemIcon(nextIcon, 'next page'));\n var disabled = !this.hasNext();\n return /*#__PURE__*/isValidElement(nextButton) ? /*#__PURE__*/cloneElement(nextButton, {\n disabled: disabled\n }) : nextButton;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$props6 = this.props,\n prefixCls = _this$props6.prefixCls,\n className = _this$props6.className,\n style = _this$props6.style,\n disabled = _this$props6.disabled,\n hideOnSinglePage = _this$props6.hideOnSinglePage,\n total = _this$props6.total,\n locale = _this$props6.locale,\n showQuickJumper = _this$props6.showQuickJumper,\n showLessItems = _this$props6.showLessItems,\n showTitle = _this$props6.showTitle,\n showTotal = _this$props6.showTotal,\n simple = _this$props6.simple,\n itemRender = _this$props6.itemRender,\n showPrevNextJumpers = _this$props6.showPrevNextJumpers,\n jumpPrevIcon = _this$props6.jumpPrevIcon,\n jumpNextIcon = _this$props6.jumpNextIcon,\n selectComponentClass = _this$props6.selectComponentClass,\n selectPrefixCls = _this$props6.selectPrefixCls,\n pageSizeOptions = _this$props6.pageSizeOptions;\n var _this$state2 = this.state,\n current = _this$state2.current,\n pageSize = _this$state2.pageSize,\n currentInputValue = _this$state2.currentInputValue;\n\n // When hideOnSinglePage is true and there is only 1 page, hide the pager\n if (hideOnSinglePage === true && total <= pageSize) {\n return null;\n }\n var allPages = calculatePage(undefined, this.state, this.props);\n var pagerList = [];\n var jumpPrev = null;\n var jumpNext = null;\n var firstPager = null;\n var lastPager = null;\n var gotoButton = null;\n var goButton = showQuickJumper && showQuickJumper.goButton;\n var pageBufferSize = showLessItems ? 1 : 2;\n var prevPage = current - 1 > 0 ? current - 1 : 0;\n var nextPage = current + 1 < allPages ? current + 1 : allPages;\n var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function (prev, key) {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {\n // eslint-disable-next-line no-param-reassign\n prev[key] = _this2.props[key];\n }\n return prev;\n }, {});\n var totalText = showTotal && /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls, \"-total-text\")\n }, showTotal(total, [total === 0 ? 0 : (current - 1) * pageSize + 1, current * pageSize > total ? total : current * pageSize]));\n if (simple) {\n if (goButton) {\n if (typeof goButton === 'boolean') {\n gotoButton = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.handleGoTO,\n onKeyUp: this.handleGoTO\n }, locale.jump_to_confirm);\n } else {\n gotoButton = /*#__PURE__*/React.createElement(\"span\", {\n onClick: this.handleGoTO,\n onKeyUp: this.handleGoTO\n }, goButton);\n }\n gotoButton = /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? \"\".concat(locale.jump_to).concat(current, \"/\").concat(allPages) : null,\n className: \"\".concat(prefixCls, \"-simple-pager\")\n }, gotoButton);\n }\n return /*#__PURE__*/React.createElement(\"ul\", _extends({\n className: classNames(prefixCls, \"\".concat(prefixCls, \"-simple\"), _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled), className),\n style: style,\n ref: this.savePaginationNode\n }, dataOrAriaAttributeProps), totalText, /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? locale.prev_page : null,\n onClick: this.prev,\n tabIndex: this.hasPrev() ? 0 : null,\n onKeyPress: this.runIfEnterPrev,\n className: classNames(\"\".concat(prefixCls, \"-prev\"), _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), !this.hasPrev())),\n \"aria-disabled\": !this.hasPrev()\n }, this.renderPrev(prevPage)), /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? \"\".concat(current, \"/\").concat(allPages) : null,\n className: \"\".concat(prefixCls, \"-simple-pager\")\n }, /*#__PURE__*/React.createElement(\"input\", {\n type: \"text\",\n value: currentInputValue,\n disabled: disabled,\n onKeyDown: this.handleKeyDown,\n onKeyUp: this.handleKeyUp,\n onChange: this.handleKeyUp,\n onBlur: this.handleBlur,\n size: \"3\"\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-slash\")\n }, \"/\"), allPages), /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? locale.next_page : null,\n onClick: this.next,\n tabIndex: this.hasPrev() ? 0 : null,\n onKeyPress: this.runIfEnterNext,\n className: classNames(\"\".concat(prefixCls, \"-next\"), _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), !this.hasNext())),\n \"aria-disabled\": !this.hasNext()\n }, this.renderNext(nextPage)), gotoButton);\n }\n if (allPages <= 3 + pageBufferSize * 2) {\n var pagerProps = {\n locale: locale,\n rootPrefixCls: prefixCls,\n onClick: this.handleChange,\n onKeyPress: this.runIfEnter,\n showTitle: showTitle,\n itemRender: itemRender\n };\n if (!allPages) {\n pagerList.push( /*#__PURE__*/React.createElement(Pager, _extends({}, pagerProps, {\n key: \"noPager\",\n page: 1,\n className: \"\".concat(prefixCls, \"-item-disabled\")\n })));\n }\n for (var i = 1; i <= allPages; i += 1) {\n var active = current === i;\n pagerList.push( /*#__PURE__*/React.createElement(Pager, _extends({}, pagerProps, {\n key: i,\n page: i,\n active: active\n })));\n }\n } else {\n var prevItemTitle = showLessItems ? locale.prev_3 : locale.prev_5;\n var nextItemTitle = showLessItems ? locale.next_3 : locale.next_5;\n if (showPrevNextJumpers) {\n jumpPrev = /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? prevItemTitle : null,\n key: \"prev\",\n onClick: this.jumpPrev,\n tabIndex: \"0\",\n onKeyPress: this.runIfEnterJumpPrev,\n className: classNames(\"\".concat(prefixCls, \"-jump-prev\"), _defineProperty({}, \"\".concat(prefixCls, \"-jump-prev-custom-icon\"), !!jumpPrevIcon))\n }, itemRender(this.getJumpPrevPage(), 'jump-prev', this.getItemIcon(jumpPrevIcon, 'prev page')));\n jumpNext = /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? nextItemTitle : null,\n key: \"next\",\n tabIndex: \"0\",\n onClick: this.jumpNext,\n onKeyPress: this.runIfEnterJumpNext,\n className: classNames(\"\".concat(prefixCls, \"-jump-next\"), _defineProperty({}, \"\".concat(prefixCls, \"-jump-next-custom-icon\"), !!jumpNextIcon))\n }, itemRender(this.getJumpNextPage(), 'jump-next', this.getItemIcon(jumpNextIcon, 'next page')));\n }\n lastPager = /*#__PURE__*/React.createElement(Pager, {\n locale: locale,\n last: true,\n rootPrefixCls: prefixCls,\n onClick: this.handleChange,\n onKeyPress: this.runIfEnter,\n key: allPages,\n page: allPages,\n active: false,\n showTitle: showTitle,\n itemRender: itemRender\n });\n firstPager = /*#__PURE__*/React.createElement(Pager, {\n locale: locale,\n rootPrefixCls: prefixCls,\n onClick: this.handleChange,\n onKeyPress: this.runIfEnter,\n key: 1,\n page: 1,\n active: false,\n showTitle: showTitle,\n itemRender: itemRender\n });\n var left = Math.max(1, current - pageBufferSize);\n var right = Math.min(current + pageBufferSize, allPages);\n if (current - 1 <= pageBufferSize) {\n right = 1 + pageBufferSize * 2;\n }\n if (allPages - current <= pageBufferSize) {\n left = allPages - pageBufferSize * 2;\n }\n for (var _i = left; _i <= right; _i += 1) {\n var _active = current === _i;\n pagerList.push( /*#__PURE__*/React.createElement(Pager, {\n locale: locale,\n rootPrefixCls: prefixCls,\n onClick: this.handleChange,\n onKeyPress: this.runIfEnter,\n key: _i,\n page: _i,\n active: _active,\n showTitle: showTitle,\n itemRender: itemRender\n }));\n }\n if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {\n pagerList[0] = /*#__PURE__*/cloneElement(pagerList[0], {\n className: \"\".concat(prefixCls, \"-item-after-jump-prev\")\n });\n pagerList.unshift(jumpPrev);\n }\n if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) {\n pagerList[pagerList.length - 1] = /*#__PURE__*/cloneElement(pagerList[pagerList.length - 1], {\n className: \"\".concat(prefixCls, \"-item-before-jump-next\")\n });\n pagerList.push(jumpNext);\n }\n if (left !== 1) {\n pagerList.unshift(firstPager);\n }\n if (right !== allPages) {\n pagerList.push(lastPager);\n }\n }\n var prevDisabled = !this.hasPrev() || !allPages;\n var nextDisabled = !this.hasNext() || !allPages;\n return /*#__PURE__*/React.createElement(\"ul\", _extends({\n className: classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled)),\n style: style,\n ref: this.savePaginationNode\n }, dataOrAriaAttributeProps), totalText, /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? locale.prev_page : null,\n onClick: this.prev,\n tabIndex: prevDisabled ? null : 0,\n onKeyPress: this.runIfEnterPrev,\n className: classNames(\"\".concat(prefixCls, \"-prev\"), _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), prevDisabled)),\n \"aria-disabled\": prevDisabled\n }, this.renderPrev(prevPage)), pagerList, /*#__PURE__*/React.createElement(\"li\", {\n title: showTitle ? locale.next_page : null,\n onClick: this.next,\n tabIndex: nextDisabled ? null : 0,\n onKeyPress: this.runIfEnterNext,\n className: classNames(\"\".concat(prefixCls, \"-next\"), _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), nextDisabled)),\n \"aria-disabled\": nextDisabled\n }, this.renderNext(nextPage)), /*#__PURE__*/React.createElement(Options, {\n disabled: disabled,\n locale: locale,\n rootPrefixCls: prefixCls,\n selectComponentClass: selectComponentClass,\n selectPrefixCls: selectPrefixCls,\n changeSize: this.getShowSizeChanger() ? this.changePageSize : null,\n current: current,\n pageSize: pageSize,\n pageSizeOptions: pageSizeOptions,\n quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null,\n goButton: goButton\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, prevState) {\n var newState = {};\n if ('current' in props) {\n newState.current = props.current;\n if (props.current !== prevState.current) {\n newState.currentInputValue = newState.current;\n }\n }\n if ('pageSize' in props && props.pageSize !== prevState.pageSize) {\n var current = prevState.current;\n var newCurrent = calculatePage(props.pageSize, prevState, props);\n current = current > newCurrent ? newCurrent : current;\n if (!('current' in props)) {\n newState.current = current;\n newState.currentInputValue = current;\n }\n newState.pageSize = props.pageSize;\n }\n return newState;\n }\n }]);\n return Pagination;\n}(React.Component);\nPagination.defaultProps = {\n defaultCurrent: 1,\n total: 0,\n defaultPageSize: 10,\n onChange: noop,\n className: '',\n selectPrefixCls: 'rc-select',\n prefixCls: 'rc-pagination',\n selectComponentClass: null,\n hideOnSinglePage: false,\n showPrevNextJumpers: true,\n showQuickJumper: false,\n showLessItems: false,\n showTitle: true,\n onShowSizeChange: noop,\n locale: LOCALE,\n style: {},\n itemRender: defaultItemRender,\n totalBoundaryShowSizeChanger: 50\n};\nexport default Pagination;","export default {\n // Options.jsx\n items_per_page: '条/页',\n jump_to: '跳至',\n jump_to_confirm: '确定',\n page: '页',\n // Pagination.jsx\n prev_page: '上一页',\n next_page: '下一页',\n prev_5: '向前 5 页',\n next_5: '向后 5 页',\n prev_3: '向前 3 页',\n next_3: '向后 3 页',\n page_size: '页码'\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport Select from '../select';\nvar MiniSelect = function MiniSelect(props) {\n return /*#__PURE__*/React.createElement(Select, _extends({}, props, {\n size: \"small\"\n }));\n};\nvar MiddleSelect = function MiddleSelect(props) {\n return /*#__PURE__*/React.createElement(Select, _extends({}, props, {\n size: \"middle\"\n }));\n};\nMiniSelect.Option = Select.Option;\nMiddleSelect.Option = Select.Option;\nexport { MiniSelect, MiddleSelect };","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport DoubleLeftOutlined from \"@ant-design/icons/es/icons/DoubleLeftOutlined\";\nimport DoubleRightOutlined from \"@ant-design/icons/es/icons/DoubleRightOutlined\";\nimport LeftOutlined from \"@ant-design/icons/es/icons/LeftOutlined\";\nimport RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport RcPagination from 'rc-pagination';\nimport enUS from \"rc-pagination/es/locale/en_US\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { MiddleSelect, MiniSelect } from './Select';\nvar Pagination = function Pagination(_a) {\n var customizePrefixCls = _a.prefixCls,\n customizeSelectPrefixCls = _a.selectPrefixCls,\n className = _a.className,\n size = _a.size,\n customLocale = _a.locale,\n selectComponentClass = _a.selectComponentClass,\n responsive = _a.responsive,\n showSizeChanger = _a.showSizeChanger,\n restProps = __rest(_a, [\"prefixCls\", \"selectPrefixCls\", \"className\", \"size\", \"locale\", \"selectComponentClass\", \"responsive\", \"showSizeChanger\"]);\n var _useBreakpoint = useBreakpoint(responsive),\n xs = _useBreakpoint.xs;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction,\n _React$useContext$pag = _React$useContext.pagination,\n pagination = _React$useContext$pag === void 0 ? {} : _React$useContext$pag;\n var prefixCls = getPrefixCls('pagination', customizePrefixCls);\n var mergedShowSizeChanger = showSizeChanger !== null && showSizeChanger !== void 0 ? showSizeChanger : pagination.showSizeChanger;\n var getIconsProps = function getIconsProps() {\n var ellipsis = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-item-ellipsis\")\n }, \"\\u2022\\u2022\\u2022\");\n var prevIcon = /*#__PURE__*/React.createElement(\"button\", {\n className: \"\".concat(prefixCls, \"-item-link\"),\n type: \"button\",\n tabIndex: -1\n }, /*#__PURE__*/React.createElement(LeftOutlined, null));\n var nextIcon = /*#__PURE__*/React.createElement(\"button\", {\n className: \"\".concat(prefixCls, \"-item-link\"),\n type: \"button\",\n tabIndex: -1\n }, /*#__PURE__*/React.createElement(RightOutlined, null));\n var jumpPrevIcon = /*#__PURE__*/React.createElement(\"a\", {\n className: \"\".concat(prefixCls, \"-item-link\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-container\")\n }, /*#__PURE__*/React.createElement(DoubleLeftOutlined, {\n className: \"\".concat(prefixCls, \"-item-link-icon\")\n }), ellipsis));\n var jumpNextIcon = /*#__PURE__*/React.createElement(\"a\", {\n className: \"\".concat(prefixCls, \"-item-link\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-container\")\n }, /*#__PURE__*/React.createElement(DoubleRightOutlined, {\n className: \"\".concat(prefixCls, \"-item-link-icon\")\n }), ellipsis));\n // change arrows direction in right-to-left direction\n if (direction === 'rtl') {\n var _ref = [nextIcon, prevIcon];\n prevIcon = _ref[0];\n nextIcon = _ref[1];\n var _ref2 = [jumpNextIcon, jumpPrevIcon];\n jumpPrevIcon = _ref2[0];\n jumpNextIcon = _ref2[1];\n }\n return {\n prevIcon: prevIcon,\n nextIcon: nextIcon,\n jumpPrevIcon: jumpPrevIcon,\n jumpNextIcon: jumpNextIcon\n };\n };\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Pagination\",\n defaultLocale: enUS\n }, function (contextLocale) {\n var locale = _extends(_extends({}, contextLocale), customLocale);\n var isSmall = size === 'small' || !!(xs && !size && responsive);\n var selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls);\n var extendedClassName = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-mini\"), isSmall), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(RcPagination, _extends({}, getIconsProps(), restProps, {\n prefixCls: prefixCls,\n selectPrefixCls: selectPrefixCls,\n className: extendedClassName,\n selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : MiddleSelect),\n locale: locale,\n showSizeChanger: mergedShowSizeChanger\n }));\n });\n};\nexport default Pagination;","import Pagination from './Pagination';\nexport default Pagination;","export var getRenderPropValue = function getRenderPropValue(propValue) {\n if (!propValue) {\n return null;\n }\n if (typeof propValue === 'function') {\n return propValue();\n }\n return propValue;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { getRenderPropValue } from '../_util/getRenderPropValue';\nimport { getTransitionName } from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport Tooltip from '../tooltip';\nvar Overlay = function Overlay(_ref) {\n var title = _ref.title,\n content = _ref.content,\n prefixCls = _ref.prefixCls;\n return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-title\")\n }, getRenderPropValue(title)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner-content\")\n }, getRenderPropValue(content)));\n};\nvar Popover = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var customizePrefixCls = props.prefixCls,\n title = props.title,\n content = props.content,\n _overlay = props._overlay,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'top' : _props$placement,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,\n _props$mouseEnterDela = props.mouseEnterDelay,\n mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n _props$overlayStyle = props.overlayStyle,\n overlayStyle = _props$overlayStyle === void 0 ? {} : _props$overlayStyle,\n otherProps = __rest(props, [\"prefixCls\", \"title\", \"content\", \"_overlay\", \"placement\", \"trigger\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"overlayStyle\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('popover', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var mergedOverlay = React.useMemo(function () {\n if (_overlay) {\n return _overlay;\n }\n if (!title && !content) {\n return null;\n }\n return /*#__PURE__*/React.createElement(Overlay, {\n prefixCls: prefixCls,\n title: title,\n content: content\n });\n }, [_overlay, title, content, prefixCls]);\n return /*#__PURE__*/React.createElement(Tooltip, _extends({\n placement: placement,\n trigger: trigger,\n mouseEnterDelay: mouseEnterDelay,\n mouseLeaveDelay: mouseLeaveDelay,\n overlayStyle: overlayStyle\n }, otherProps, {\n prefixCls: prefixCls,\n ref: ref,\n overlay: mergedOverlay,\n transitionName: getTransitionName(rootPrefixCls, 'zoom-big', otherProps.transitionName)\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n Popover.displayName = 'Popover';\n}\nexport default Popover;","import { useRef, useEffect } from 'react';\nexport var defaultProps = {\n percent: 0,\n prefixCls: 'rc-progress',\n strokeColor: '#2db7f5',\n strokeLinecap: 'round',\n strokeWidth: 1,\n trailColor: '#D9D9D9',\n trailWidth: 1,\n gapPosition: 'bottom'\n};\nexport var useTransitionDuration = function useTransitionDuration() {\n var pathsRef = useRef([]);\n var prevTimeStamp = useRef(null);\n useEffect(function () {\n var now = Date.now();\n var updated = false;\n pathsRef.current.forEach(function (path) {\n if (!path) {\n return;\n }\n updated = true;\n var pathStyle = path.style;\n pathStyle.transitionDuration = '.3s, .3s, .3s, .06s';\n if (prevTimeStamp.current && now - prevTimeStamp.current < 100) {\n pathStyle.transitionDuration = '0s, 0s';\n }\n });\n if (updated) {\n prevTimeStamp.current = Date.now();\n }\n });\n return pathsRef.current;\n};","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\";\nvar uuid = 0;\n/** Is client side and not jsdom */\nexport var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();\n/** Get unique id for accessibility usage */\nfunction getUUID() {\n var retId;\n // Test never reach\n /* istanbul ignore if */\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n return retId;\n}\nexport default (function (id) {\n // Inner id for accessibility usage. Only work in client side\n var _React$useState = React.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerId = _React$useState2[0],\n setInnerId = _React$useState2[1];\n React.useEffect(function () {\n setInnerId(\"rc_progress_\".concat(getUUID()));\n }, []);\n return id || innerId;\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"id\", \"prefixCls\", \"steps\", \"strokeWidth\", \"trailWidth\", \"gapDegree\", \"gapPosition\", \"trailColor\", \"strokeLinecap\", \"style\", \"className\", \"strokeColor\", \"percent\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { defaultProps, useTransitionDuration } from './common';\nimport useId from './hooks/useId';\nfunction stripPercentToNumber(percent) {\n return +percent.replace('%', '');\n}\nfunction toArray(value) {\n var mergedValue = value !== null && value !== void 0 ? value : [];\n return Array.isArray(mergedValue) ? mergedValue : [mergedValue];\n}\nvar VIEW_BOX_SIZE = 100;\nvar getCircleStyle = function getCircleStyle(perimeter, perimeterWithoutGap, offset, percent, rotateDeg, gapDegree, gapPosition, strokeColor, strokeLinecap, strokeWidth) {\n var stepSpace = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 0;\n var offsetDeg = offset / 100 * 360 * ((360 - gapDegree) / 360);\n var positionDeg = gapDegree === 0 ? 0 : {\n bottom: 0,\n top: 180,\n left: 90,\n right: -90\n }[gapPosition];\n var strokeDashoffset = (100 - percent) / 100 * perimeterWithoutGap;\n // Fix percent accuracy when strokeLinecap is round\n // https://github.com/ant-design/ant-design/issues/35009\n if (strokeLinecap === 'round' && percent !== 100) {\n strokeDashoffset += strokeWidth / 2;\n // when percent is small enough (<= 1%), keep smallest value to avoid it's disappearance\n if (strokeDashoffset >= perimeterWithoutGap) {\n strokeDashoffset = perimeterWithoutGap - 0.01;\n }\n }\n return {\n stroke: typeof strokeColor === 'string' ? strokeColor : undefined,\n strokeDasharray: \"\".concat(perimeterWithoutGap, \"px \").concat(perimeter),\n strokeDashoffset: strokeDashoffset + stepSpace,\n transform: \"rotate(\".concat(rotateDeg + offsetDeg + positionDeg, \"deg)\"),\n transformOrigin: '0 0',\n transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s',\n fillOpacity: 0\n };\n};\nvar Circle = function Circle(props) {\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n id = _defaultProps$props.id,\n prefixCls = _defaultProps$props.prefixCls,\n steps = _defaultProps$props.steps,\n strokeWidth = _defaultProps$props.strokeWidth,\n trailWidth = _defaultProps$props.trailWidth,\n _defaultProps$props$g = _defaultProps$props.gapDegree,\n gapDegree = _defaultProps$props$g === void 0 ? 0 : _defaultProps$props$g,\n gapPosition = _defaultProps$props.gapPosition,\n trailColor = _defaultProps$props.trailColor,\n strokeLinecap = _defaultProps$props.strokeLinecap,\n style = _defaultProps$props.style,\n className = _defaultProps$props.className,\n strokeColor = _defaultProps$props.strokeColor,\n percent = _defaultProps$props.percent,\n restProps = _objectWithoutProperties(_defaultProps$props, _excluded);\n var mergedId = useId(id);\n var gradientId = \"\".concat(mergedId, \"-gradient\");\n var radius = VIEW_BOX_SIZE / 2 - strokeWidth / 2;\n var perimeter = Math.PI * 2 * radius;\n var rotateDeg = gapDegree > 0 ? 90 + gapDegree / 2 : -90;\n var perimeterWithoutGap = perimeter * ((360 - gapDegree) / 360);\n var _ref = _typeof(steps) === 'object' ? steps : {\n count: steps,\n space: 2\n },\n stepCount = _ref.count,\n stepSpace = _ref.space;\n var circleStyle = getCircleStyle(perimeter, perimeterWithoutGap, 0, 100, rotateDeg, gapDegree, gapPosition, trailColor, strokeLinecap, strokeWidth);\n var percentList = toArray(percent);\n var strokeColorList = toArray(strokeColor);\n var gradient = strokeColorList.find(function (color) {\n return color && _typeof(color) === 'object';\n });\n var paths = useTransitionDuration();\n var getStokeList = function getStokeList() {\n var stackPtg = 0;\n return percentList.map(function (ptg, index) {\n var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];\n var stroke = color && _typeof(color) === 'object' ? \"url(#\".concat(gradientId, \")\") : undefined;\n var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, ptg, rotateDeg, gapDegree, gapPosition, color, strokeLinecap, strokeWidth);\n stackPtg += ptg;\n return /*#__PURE__*/React.createElement(\"circle\", {\n key: index,\n className: \"\".concat(prefixCls, \"-circle-path\"),\n r: radius,\n cx: 0,\n cy: 0,\n stroke: stroke,\n strokeLinecap: strokeLinecap,\n strokeWidth: strokeWidth,\n opacity: ptg === 0 ? 0 : 1,\n style: circleStyleForStack,\n ref: function ref(elem) {\n // https://reactjs.org/docs/refs-and-the-dom.html#callback-refs\n // React will call the ref callback with the DOM element when the component mounts,\n // and call it with `null` when it unmounts.\n // Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.\n paths[index] = elem;\n }\n });\n }).reverse();\n };\n var getStepStokeList = function getStepStokeList() {\n // only show the first percent when pass steps\n var current = Math.round(stepCount * (percentList[0] / 100));\n var stepPtg = 100 / stepCount;\n var stackPtg = 0;\n return new Array(stepCount).fill(null).map(function (_, index) {\n var color = index <= current - 1 ? strokeColorList[0] : trailColor;\n var stroke = color && _typeof(color) === 'object' ? \"url(#\".concat(gradientId, \")\") : undefined;\n var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, stepPtg, rotateDeg, gapDegree, gapPosition, color, 'butt', strokeWidth, stepSpace);\n stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepSpace) * 100 / perimeterWithoutGap;\n return /*#__PURE__*/React.createElement(\"circle\", {\n key: index,\n className: \"\".concat(prefixCls, \"-circle-path\"),\n r: radius,\n cx: 0,\n cy: 0,\n stroke: stroke\n // strokeLinecap={strokeLinecap}\n ,\n strokeWidth: strokeWidth,\n opacity: 1,\n style: circleStyleForStack,\n ref: function ref(elem) {\n paths[index] = elem;\n }\n });\n });\n };\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n className: classNames(\"\".concat(prefixCls, \"-circle\"), className),\n viewBox: \"\".concat(-VIEW_BOX_SIZE / 2, \" \").concat(-VIEW_BOX_SIZE / 2, \" \").concat(VIEW_BOX_SIZE, \" \").concat(VIEW_BOX_SIZE),\n style: style,\n id: id,\n role: \"presentation\"\n }, restProps), gradient && /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: gradientId,\n x1: \"100%\",\n y1: \"0%\",\n x2: \"0%\",\n y2: \"0%\"\n }, Object.keys(gradient).sort(function (a, b) {\n return stripPercentToNumber(a) - stripPercentToNumber(b);\n }).map(function (key, index) {\n return /*#__PURE__*/React.createElement(\"stop\", {\n key: index,\n offset: key,\n stopColor: gradient[key]\n });\n }))), !stepCount && /*#__PURE__*/React.createElement(\"circle\", {\n className: \"\".concat(prefixCls, \"-circle-trail\"),\n r: radius,\n cx: 0,\n cy: 0,\n stroke: trailColor,\n strokeLinecap: strokeLinecap,\n strokeWidth: trailWidth || strokeWidth,\n style: circleStyle\n }), stepCount ? getStepStokeList() : getStokeList());\n};\nif (process.env.NODE_ENV !== 'production') {\n Circle.displayName = 'Circle';\n}\nexport default Circle;","import warning from '../_util/warning';\nexport function validProgress(progress) {\n if (!progress || progress < 0) {\n return 0;\n }\n if (progress > 100) {\n return 100;\n }\n return progress;\n}\nexport function getSuccessPercent(_ref) {\n var success = _ref.success,\n successPercent = _ref.successPercent;\n var percent = successPercent;\n /** @deprecated Use `percent` instead */\n if (success && 'progress' in success) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Progress', '`success.progress` is deprecated. Please use `success.percent` instead.') : void 0;\n percent = success.progress;\n }\n if (success && 'percent' in success) {\n percent = success.percent;\n }\n return percent;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport * as React from 'react';\nimport { getSuccessPercent, validProgress } from './utils';\nfunction getPercentage(_ref) {\n var percent = _ref.percent,\n success = _ref.success,\n successPercent = _ref.successPercent;\n var realSuccessPercent = validProgress(getSuccessPercent({\n success: success,\n successPercent: successPercent\n }));\n return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];\n}\nfunction getStrokeColor(_ref2) {\n var _ref2$success = _ref2.success,\n success = _ref2$success === void 0 ? {} : _ref2$success,\n strokeColor = _ref2.strokeColor;\n var successColor = success.strokeColor;\n return [successColor || presetPrimaryColors.green, strokeColor || null];\n}\nvar Circle = function Circle(props) {\n var prefixCls = props.prefixCls,\n width = props.width,\n strokeWidth = props.strokeWidth,\n _props$trailColor = props.trailColor,\n trailColor = _props$trailColor === void 0 ? null : _props$trailColor,\n _props$strokeLinecap = props.strokeLinecap,\n strokeLinecap = _props$strokeLinecap === void 0 ? 'round' : _props$strokeLinecap,\n gapPosition = props.gapPosition,\n gapDegree = props.gapDegree,\n type = props.type,\n children = props.children,\n success = props.success;\n var circleSize = width || 120;\n var circleStyle = {\n width: circleSize,\n height: circleSize,\n fontSize: circleSize * 0.15 + 6\n };\n var circleWidth = strokeWidth || 6;\n var gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n var getGapDegree = function getGapDegree() {\n // Support gapDeg = 0 when type = 'dashboard'\n if (gapDegree || gapDegree === 0) {\n return gapDegree;\n }\n if (type === 'dashboard') {\n return 75;\n }\n return undefined;\n };\n // using className to style stroke color\n var isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n var strokeColor = getStrokeColor({\n success: success,\n strokeColor: props.strokeColor\n });\n var wrapperClassName = classNames(\"\".concat(prefixCls, \"-inner\"), _defineProperty({}, \"\".concat(prefixCls, \"-circle-gradient\"), isGradient));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperClassName,\n style: circleStyle\n }, /*#__PURE__*/React.createElement(RCCircle, {\n percent: getPercentage(props),\n strokeWidth: circleWidth,\n trailWidth: circleWidth,\n strokeColor: strokeColor,\n strokeLinecap: strokeLinecap,\n trailColor: trailColor,\n prefixCls: prefixCls,\n gapDegree: getGapDegree(),\n gapPosition: gapPos\n }), children);\n};\nexport default Circle;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport * as React from 'react';\nimport { getSuccessPercent, validProgress } from './utils';\n/**\n * @example\n * {\n * \"0%\": \"#afc163\",\n * \"75%\": \"#009900\",\n * \"50%\": \"green\", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'\n * \"25%\": \"#66FF00\",\n * \"100%\": \"#ffffff\"\n * }\n */\nexport var sortGradient = function sortGradient(gradients) {\n var tempArr = [];\n Object.keys(gradients).forEach(function (key) {\n var formattedKey = parseFloat(key.replace(/%/g, ''));\n if (!isNaN(formattedKey)) {\n tempArr.push({\n key: formattedKey,\n value: gradients[key]\n });\n }\n });\n tempArr = tempArr.sort(function (a, b) {\n return a.key - b.key;\n });\n return tempArr.map(function (_ref) {\n var key = _ref.key,\n value = _ref.value;\n return \"\".concat(value, \" \").concat(key, \"%\");\n }).join(', ');\n};\n/**\n * Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and\n * butter, there is the bug. And... Besides women, there is the code.\n *\n * @example\n * {\n * \"0%\": \"#afc163\",\n * \"25%\": \"#66FF00\",\n * \"50%\": \"#00CC00\", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,\n * \"75%\": \"#009900\", // #00CC00 50%, #009900 75%, #ffffff 100%)\n * \"100%\": \"#ffffff\"\n * }\n */\nexport var handleGradient = function handleGradient(strokeColor, directionConfig) {\n var _strokeColor$from = strokeColor.from,\n from = _strokeColor$from === void 0 ? presetPrimaryColors.blue : _strokeColor$from,\n _strokeColor$to = strokeColor.to,\n to = _strokeColor$to === void 0 ? presetPrimaryColors.blue : _strokeColor$to,\n _strokeColor$directio = strokeColor.direction,\n direction = _strokeColor$directio === void 0 ? directionConfig === 'rtl' ? 'to left' : 'to right' : _strokeColor$directio,\n rest = __rest(strokeColor, [\"from\", \"to\", \"direction\"]);\n if (Object.keys(rest).length !== 0) {\n var sortedGradients = sortGradient(rest);\n return {\n backgroundImage: \"linear-gradient(\".concat(direction, \", \").concat(sortedGradients, \")\")\n };\n }\n return {\n backgroundImage: \"linear-gradient(\".concat(direction, \", \").concat(from, \", \").concat(to, \")\")\n };\n};\nvar Line = function Line(props) {\n var prefixCls = props.prefixCls,\n directionConfig = props.direction,\n percent = props.percent,\n strokeWidth = props.strokeWidth,\n size = props.size,\n strokeColor = props.strokeColor,\n _props$strokeLinecap = props.strokeLinecap,\n strokeLinecap = _props$strokeLinecap === void 0 ? 'round' : _props$strokeLinecap,\n children = props.children,\n _props$trailColor = props.trailColor,\n trailColor = _props$trailColor === void 0 ? null : _props$trailColor,\n success = props.success;\n var backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {\n background: strokeColor\n };\n var borderRadius = strokeLinecap === 'square' || strokeLinecap === 'butt' ? 0 : undefined;\n var trailStyle = {\n backgroundColor: trailColor || undefined,\n borderRadius: borderRadius\n };\n var percentStyle = _extends({\n width: \"\".concat(validProgress(percent), \"%\"),\n height: strokeWidth || (size === 'small' ? 6 : 8),\n borderRadius: borderRadius\n }, backgroundProps);\n var successPercent = getSuccessPercent(props);\n var successPercentStyle = {\n width: \"\".concat(validProgress(successPercent), \"%\"),\n height: strokeWidth || (size === 'small' ? 6 : 8),\n borderRadius: borderRadius,\n backgroundColor: success === null || success === void 0 ? void 0 : success.strokeColor\n };\n var successSegment = successPercent !== undefined ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-success-bg\"),\n style: successPercentStyle\n })) : null;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-outer\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\"),\n style: trailStyle\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-bg\"),\n style: percentStyle\n }), successSegment)), children);\n};\nexport default Line;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nvar Steps = function Steps(props) {\n var size = props.size,\n steps = props.steps,\n _props$percent = props.percent,\n percent = _props$percent === void 0 ? 0 : _props$percent,\n _props$strokeWidth = props.strokeWidth,\n strokeWidth = _props$strokeWidth === void 0 ? 8 : _props$strokeWidth,\n strokeColor = props.strokeColor,\n _props$trailColor = props.trailColor,\n trailColor = _props$trailColor === void 0 ? null : _props$trailColor,\n prefixCls = props.prefixCls,\n children = props.children;\n var current = Math.round(steps * (percent / 100));\n var stepWidth = size === 'small' ? 2 : 14;\n var styledSteps = new Array(steps);\n for (var i = 0; i < steps; i++) {\n var color = Array.isArray(strokeColor) ? strokeColor[i] : strokeColor;\n styledSteps[i] = /*#__PURE__*/React.createElement(\"div\", {\n key: i,\n className: classNames(\"\".concat(prefixCls, \"-steps-item\"), _defineProperty({}, \"\".concat(prefixCls, \"-steps-item-active\"), i <= current - 1)),\n style: {\n backgroundColor: i <= current - 1 ? color : trailColor,\n width: stepWidth,\n height: strokeWidth\n }\n });\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-steps-outer\")\n }, styledSteps, children);\n};\nexport default Steps;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { tuple } from '../_util/type';\nimport warning from '../_util/warning';\nimport Circle from './Circle';\nimport Line from './Line';\nimport Steps from './Steps';\nimport { getSuccessPercent, validProgress } from './utils';\nvar ProgressTypes = tuple('line', 'circle', 'dashboard');\nvar ProgressStatuses = tuple('normal', 'exception', 'active', 'success');\nvar Progress = function Progress(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n steps = props.steps,\n strokeColor = props.strokeColor,\n _props$percent = props.percent,\n percent = _props$percent === void 0 ? 0 : _props$percent,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size,\n _props$showInfo = props.showInfo,\n showInfo = _props$showInfo === void 0 ? true : _props$showInfo,\n _props$type = props.type,\n type = _props$type === void 0 ? 'line' : _props$type,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"steps\", \"strokeColor\", \"percent\", \"size\", \"showInfo\", \"type\"]);\n function getPercentNumber() {\n var successPercent = getSuccessPercent(props);\n return parseInt(successPercent !== undefined ? successPercent.toString() : percent.toString(), 10);\n }\n function getProgressStatus() {\n var status = props.status;\n if (!ProgressStatuses.includes(status) && getPercentNumber() >= 100) {\n return 'success';\n }\n return status || 'normal';\n }\n function renderProcessInfo(prefixCls, progressStatus) {\n var format = props.format;\n var successPercent = getSuccessPercent(props);\n if (!showInfo) {\n return null;\n }\n var text;\n var textFormatter = format || function (percentNumber) {\n return \"\".concat(percentNumber, \"%\");\n };\n var isLineType = type === 'line';\n if (format || progressStatus !== 'exception' && progressStatus !== 'success') {\n text = textFormatter(validProgress(percent), validProgress(successPercent));\n } else if (progressStatus === 'exception') {\n text = isLineType ? /*#__PURE__*/React.createElement(CloseCircleFilled, null) : /*#__PURE__*/React.createElement(CloseOutlined, null);\n } else if (progressStatus === 'success') {\n text = isLineType ? /*#__PURE__*/React.createElement(CheckCircleFilled, null) : /*#__PURE__*/React.createElement(CheckOutlined, null);\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-text\"),\n title: typeof text === 'string' ? text : undefined\n }, text);\n }\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('progress', customizePrefixCls);\n var progressStatus = getProgressStatus();\n var progressInfo = renderProcessInfo(prefixCls, progressStatus);\n process.env.NODE_ENV !== \"production\" ? warning(!('successPercent' in props), 'Progress', '`successPercent` is deprecated. Please use `success.percent` instead.') : void 0;\n var strokeColorNotArray = Array.isArray(strokeColor) ? strokeColor[0] : strokeColor;\n var strokeColorNotGradient = typeof strokeColor === 'string' || Array.isArray(strokeColor) ? strokeColor : undefined;\n var progress;\n // Render progress shape\n if (type === 'line') {\n progress = steps ? ( /*#__PURE__*/React.createElement(Steps, _extends({}, props, {\n strokeColor: strokeColorNotGradient,\n prefixCls: prefixCls,\n steps: steps\n }), progressInfo)) : ( /*#__PURE__*/React.createElement(Line, _extends({}, props, {\n strokeColor: strokeColorNotArray,\n prefixCls: prefixCls,\n direction: direction\n }), progressInfo));\n } else if (type === 'circle' || type === 'dashboard') {\n progress = /*#__PURE__*/React.createElement(Circle, _extends({}, props, {\n strokeColor: strokeColorNotArray,\n prefixCls: prefixCls,\n progressStatus: progressStatus\n }), progressInfo);\n }\n var classString = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(type === 'dashboard' && 'circle' || steps && 'steps' || type), true), \"\".concat(prefixCls, \"-status-\").concat(progressStatus), true), \"\".concat(prefixCls, \"-show-info\"), showInfo), \"\".concat(prefixCls, \"-\").concat(size), size), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, omit(restProps, ['status', 'format', 'trailColor', 'strokeWidth', 'width', 'gapDegree', 'gapPosition', 'strokeLinecap', 'success', 'successPercent']), {\n className: classString,\n role: \"progressbar\"\n }), progress);\n};\nexport default Progress;","import Progress from './progress';\nexport default Progress;","import * as React from 'react';\nvar RadioGroupContext = /*#__PURE__*/React.createContext(null);\nexport var RadioGroupContextProvider = RadioGroupContext.Provider;\nexport default RadioGroupContext;\nexport var RadioOptionTypeContext = /*#__PURE__*/React.createContext(null);\nexport var RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcCheckbox from 'rc-checkbox';\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport { FormItemInputContext } from '../form/context';\nimport warning from '../_util/warning';\nimport RadioGroupContext, { RadioOptionTypeContext } from './context';\nvar InternalRadio = function InternalRadio(props, ref) {\n var _a, _b;\n var groupContext = React.useContext(RadioGroupContext);\n var radioOptionTypeContext = React.useContext(RadioOptionTypeContext);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var innerRef = React.useRef();\n var mergedRef = composeRef(ref, innerRef);\n var _useContext = useContext(FormItemInputContext),\n isFormItemInput = _useContext.isFormItemInput;\n process.env.NODE_ENV !== \"production\" ? warning(!('optionType' in props), 'Radio', '`optionType` is only support in Radio.Group.') : void 0;\n var onChange = function onChange(e) {\n var _a, _b;\n (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);\n (_b = groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) === null || _b === void 0 ? void 0 : _b.call(groupContext, e);\n };\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n style = props.style,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"children\", \"style\"]);\n var radioPrefixCls = getPrefixCls('radio', customizePrefixCls);\n var prefixCls = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === 'button' ? \"\".concat(radioPrefixCls, \"-button\") : radioPrefixCls;\n var radioProps = _extends({}, restProps);\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n if (groupContext) {\n radioProps.name = groupContext.name;\n radioProps.onChange = onChange;\n radioProps.checked = props.value === groupContext.value;\n radioProps.disabled = (_a = radioProps.disabled) !== null && _a !== void 0 ? _a : groupContext.disabled;\n }\n radioProps.disabled = (_b = radioProps.disabled) !== null && _b !== void 0 ? _b : disabled;\n var wrapperClassString = classNames(\"\".concat(prefixCls, \"-wrapper\"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-wrapper-checked\"), radioProps.checked), \"\".concat(prefixCls, \"-wrapper-disabled\"), radioProps.disabled), \"\".concat(prefixCls, \"-wrapper-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-wrapper-in-form-item\"), isFormItemInput), className);\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n React.createElement(\"label\", {\n className: wrapperClassString,\n style: style,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave\n }, /*#__PURE__*/React.createElement(RcCheckbox, _extends({}, radioProps, {\n type: \"radio\",\n prefixCls: prefixCls,\n ref: mergedRef\n })), children !== undefined ? /*#__PURE__*/React.createElement(\"span\", null, children) : null)\n );\n};\nvar Radio = /*#__PURE__*/React.forwardRef(InternalRadio);\nif (process.env.NODE_ENV !== 'production') {\n Radio.displayName = 'Radio';\n}\nexport default Radio;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\nimport getDataOrAriaProps from '../_util/getDataOrAriaProps';\nimport { RadioGroupContextProvider } from './context';\nimport Radio from './radio';\nvar RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var size = React.useContext(SizeContext);\n var _useMergedState = useMergedState(props.defaultValue, {\n value: props.value\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n value = _useMergedState2[0],\n setValue = _useMergedState2[1];\n var onRadioChange = function onRadioChange(ev) {\n var lastValue = value;\n var val = ev.target.value;\n if (!('value' in props)) {\n setValue(val);\n }\n var onChange = props.onChange;\n if (onChange && val !== lastValue) {\n onChange(ev);\n }\n };\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n options = props.options,\n _props$buttonStyle = props.buttonStyle,\n buttonStyle = _props$buttonStyle === void 0 ? 'outline' : _props$buttonStyle,\n disabled = props.disabled,\n children = props.children,\n customizeSize = props.size,\n style = props.style,\n id = props.id,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onFocus = props.onFocus,\n onBlur = props.onBlur;\n var prefixCls = getPrefixCls('radio', customizePrefixCls);\n var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n var childrenToRender = children;\n // 如果存在 options, 优先使用\n if (options && options.length > 0) {\n childrenToRender = options.map(function (option) {\n if (typeof option === 'string' || typeof option === 'number') {\n // 此处类型自动推导为 string\n return /*#__PURE__*/React.createElement(Radio, {\n key: option.toString(),\n prefixCls: prefixCls,\n disabled: disabled,\n value: option,\n checked: value === option\n }, option);\n }\n // 此处类型自动推导为 { label: string value: string }\n return /*#__PURE__*/React.createElement(Radio, {\n key: \"radio-group-value-options-\".concat(option.value),\n prefixCls: prefixCls,\n disabled: option.disabled || disabled,\n value: option.value,\n checked: value === option.value,\n style: option.style\n }, option.label);\n });\n }\n var mergedSize = customizeSize || size;\n var classString = classNames(groupPrefixCls, \"\".concat(groupPrefixCls, \"-\").concat(buttonStyle), _defineProperty(_defineProperty({}, \"\".concat(groupPrefixCls, \"-\").concat(mergedSize), mergedSize), \"\".concat(groupPrefixCls, \"-rtl\"), direction === 'rtl'), className);\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, getDataOrAriaProps(props), {\n className: classString,\n style: style,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onFocus: onFocus,\n onBlur: onBlur,\n id: id,\n ref: ref\n }), /*#__PURE__*/React.createElement(RadioGroupContextProvider, {\n value: {\n onChange: onRadioChange,\n value: value,\n disabled: props.disabled,\n name: props.name,\n optionType: props.optionType\n }\n }, childrenToRender));\n});\nexport default /*#__PURE__*/React.memo(RadioGroup);","export default function getDataOrAriaProps(props) {\n return Object.keys(props).reduce(function (prev, key) {\n if ((key.startsWith('data-') || key.startsWith('aria-') || key === 'role') && !key.startsWith('data-__')) {\n prev[key] = props[key];\n }\n return prev;\n }, {});\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { RadioOptionTypeContextProvider } from './context';\nimport Radio from './radio';\nvar RadioButton = function RadioButton(props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var customizePrefixCls = props.prefixCls,\n radioProps = __rest(props, [\"prefixCls\"]);\n var prefixCls = getPrefixCls('radio', customizePrefixCls);\n return /*#__PURE__*/React.createElement(RadioOptionTypeContextProvider, {\n value: \"button\"\n }, /*#__PURE__*/React.createElement(Radio, _extends({\n prefixCls: prefixCls\n }, radioProps, {\n type: \"radio\",\n ref: ref\n })));\n};\nexport default /*#__PURE__*/React.forwardRef(RadioButton);","import Group from './group';\nimport InternalRadio from './radio';\nimport Button from './radioButton';\nexport { Button, Group };\nvar Radio = InternalRadio;\nRadio.Button = Button;\nRadio.Group = Group;\nRadio.__ANT_RADIO = true;\nexport default Radio;","// This icon file is generated automatically.\nvar StarFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z\" } }] }, \"name\": \"star\", \"theme\": \"filled\" };\nexport default StarFilled;\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 StarFilledSvg from \"@ant-design/icons-svg/es/asn/StarFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar StarFilled = function StarFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: StarFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(StarFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'StarFilled';\n}\nexport default RefIcon;","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 React from 'react';\nvar Star = /*#__PURE__*/function (_React$Component) {\n _inherits(Star, _React$Component);\n var _super = _createSuper(Star);\n function Star() {\n var _this;\n _classCallCheck(this, Star);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.onHover = function (e) {\n var _this$props = _this.props,\n onHover = _this$props.onHover,\n index = _this$props.index;\n onHover(e, index);\n };\n _this.onClick = function (e) {\n var _this$props2 = _this.props,\n onClick = _this$props2.onClick,\n index = _this$props2.index;\n onClick(e, index);\n };\n _this.onKeyDown = function (e) {\n var _this$props3 = _this.props,\n onClick = _this$props3.onClick,\n index = _this$props3.index;\n if (e.keyCode === 13) {\n onClick(e, index);\n }\n };\n return _this;\n }\n _createClass(Star, [{\n key: \"getClassName\",\n value: function getClassName() {\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n index = _this$props4.index,\n value = _this$props4.value,\n allowHalf = _this$props4.allowHalf,\n focused = _this$props4.focused;\n var starValue = index + 1;\n var className = prefixCls;\n if (value === 0 && index === 0 && focused) {\n className += \" \".concat(prefixCls, \"-focused\");\n } else if (allowHalf && value + 0.5 >= starValue && value < starValue) {\n className += \" \".concat(prefixCls, \"-half \").concat(prefixCls, \"-active\");\n if (focused) {\n className += \" \".concat(prefixCls, \"-focused\");\n }\n } else {\n className += starValue <= value ? \" \".concat(prefixCls, \"-full\") : \" \".concat(prefixCls, \"-zero\");\n if (starValue === value && focused) {\n className += \" \".concat(prefixCls, \"-focused\");\n }\n }\n return className;\n }\n }, {\n key: \"render\",\n value: function render() {\n var onHover = this.onHover,\n onClick = this.onClick,\n onKeyDown = this.onKeyDown;\n var _this$props5 = this.props,\n disabled = _this$props5.disabled,\n prefixCls = _this$props5.prefixCls,\n character = _this$props5.character,\n characterRender = _this$props5.characterRender,\n index = _this$props5.index,\n count = _this$props5.count,\n value = _this$props5.value;\n var characterNode = typeof character === 'function' ? character(this.props) : character;\n var start = /*#__PURE__*/React.createElement(\"li\", {\n className: this.getClassName()\n }, /*#__PURE__*/React.createElement(\"div\", {\n onClick: disabled ? null : onClick,\n onKeyDown: disabled ? null : onKeyDown,\n onMouseMove: disabled ? null : onHover,\n role: \"radio\",\n \"aria-checked\": value > index ? 'true' : 'false',\n \"aria-posinset\": index + 1,\n \"aria-setsize\": count,\n tabIndex: disabled ? -1 : 0\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-first\")\n }, characterNode), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-second\")\n }, characterNode)));\n if (characterRender) {\n start = characterRender(start, this.props);\n }\n return start;\n }\n }]);\n return Star;\n}(React.Component);\nexport { Star as default };","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { getOffsetLeft } from './util';\nimport Star from './Star';\nfunction noop() {}\nvar Rate = /*#__PURE__*/function (_React$Component) {\n _inherits(Rate, _React$Component);\n var _super = _createSuper(Rate);\n function Rate(props) {\n var _this;\n _classCallCheck(this, Rate);\n _this = _super.call(this, props);\n _this.stars = void 0;\n _this.rate = void 0;\n _this.onHover = function (event, index) {\n var onHoverChange = _this.props.onHoverChange;\n var hoverValue = _this.getStarValue(index, event.pageX);\n var cleanedValue = _this.state.cleanedValue;\n if (hoverValue !== cleanedValue) {\n _this.setState({\n hoverValue: hoverValue,\n cleanedValue: null\n });\n }\n onHoverChange(hoverValue);\n };\n _this.onMouseLeave = function () {\n var onHoverChange = _this.props.onHoverChange;\n _this.setState({\n hoverValue: undefined,\n cleanedValue: null\n });\n onHoverChange(undefined);\n };\n _this.onClick = function (event, index) {\n var allowClear = _this.props.allowClear;\n var value = _this.state.value;\n var newValue = _this.getStarValue(index, event.pageX);\n var isReset = false;\n if (allowClear) {\n isReset = newValue === value;\n }\n _this.onMouseLeave();\n _this.changeValue(isReset ? 0 : newValue);\n _this.setState({\n cleanedValue: isReset ? newValue : null\n });\n };\n _this.onFocus = function () {\n var onFocus = _this.props.onFocus;\n _this.setState({\n focused: true\n });\n if (onFocus) {\n onFocus();\n }\n };\n _this.onBlur = function () {\n var onBlur = _this.props.onBlur;\n _this.setState({\n focused: false\n });\n if (onBlur) {\n onBlur();\n }\n };\n _this.onKeyDown = function (event) {\n var keyCode = event.keyCode;\n var _this$props = _this.props,\n count = _this$props.count,\n allowHalf = _this$props.allowHalf,\n onKeyDown = _this$props.onKeyDown,\n direction = _this$props.direction;\n var reverse = direction === 'rtl';\n var value = _this.state.value;\n if (keyCode === KeyCode.RIGHT && value < count && !reverse) {\n if (allowHalf) {\n value += 0.5;\n } else {\n value += 1;\n }\n _this.changeValue(value);\n event.preventDefault();\n } else if (keyCode === KeyCode.LEFT && value > 0 && !reverse) {\n if (allowHalf) {\n value -= 0.5;\n } else {\n value -= 1;\n }\n _this.changeValue(value);\n event.preventDefault();\n } else if (keyCode === KeyCode.RIGHT && value > 0 && reverse) {\n if (allowHalf) {\n value -= 0.5;\n } else {\n value -= 1;\n }\n _this.changeValue(value);\n event.preventDefault();\n } else if (keyCode === KeyCode.LEFT && value < count && reverse) {\n if (allowHalf) {\n value += 0.5;\n } else {\n value += 1;\n }\n _this.changeValue(value);\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n _this.saveRef = function (index) {\n return function (node) {\n _this.stars[index] = node;\n };\n };\n _this.saveRate = function (node) {\n _this.rate = node;\n };\n var _value = props.value;\n if (_value === undefined) {\n _value = props.defaultValue;\n }\n _this.stars = {};\n _this.state = {\n value: _value,\n focused: false,\n cleanedValue: null\n };\n return _this;\n }\n _createClass(Rate, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props2 = this.props,\n autoFocus = _this$props2.autoFocus,\n disabled = _this$props2.disabled;\n if (autoFocus && !disabled) {\n this.focus();\n }\n }\n }, {\n key: \"getStarDOM\",\n value: function getStarDOM(index) {\n return findDOMNode(this.stars[index]);\n }\n }, {\n key: \"getStarValue\",\n value: function getStarValue(index, x) {\n var _this$props3 = this.props,\n allowHalf = _this$props3.allowHalf,\n direction = _this$props3.direction;\n var reverse = direction === 'rtl';\n var value = index + 1;\n if (allowHalf) {\n var starEle = this.getStarDOM(index);\n var leftDis = getOffsetLeft(starEle);\n var width = starEle.clientWidth;\n if (reverse && x - leftDis > width / 2) {\n value -= 0.5;\n } else if (!reverse && x - leftDis < width / 2) {\n value -= 0.5;\n }\n }\n return value;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n var disabled = this.props.disabled;\n if (!disabled) {\n this.rate.focus();\n }\n }\n }, {\n key: \"blur\",\n value: function blur() {\n var disabled = this.props.disabled;\n if (!disabled) {\n this.rate.blur();\n }\n }\n }, {\n key: \"changeValue\",\n value: function changeValue(value) {\n var onChange = this.props.onChange;\n if (!('value' in this.props)) {\n this.setState({\n value: value\n });\n }\n onChange(value);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n count = _this$props4.count,\n allowHalf = _this$props4.allowHalf,\n style = _this$props4.style,\n id = _this$props4.id,\n prefixCls = _this$props4.prefixCls,\n disabled = _this$props4.disabled,\n className = _this$props4.className,\n character = _this$props4.character,\n characterRender = _this$props4.characterRender,\n tabIndex = _this$props4.tabIndex,\n direction = _this$props4.direction;\n var _this$state = this.state,\n value = _this$state.value,\n hoverValue = _this$state.hoverValue,\n focused = _this$state.focused;\n var stars = [];\n var disabledClass = disabled ? \"\".concat(prefixCls, \"-disabled\") : '';\n for (var index = 0; index < count; index += 1) {\n stars.push( /*#__PURE__*/React.createElement(Star, {\n ref: this.saveRef(index),\n index: index,\n count: count,\n disabled: disabled,\n prefixCls: \"\".concat(prefixCls, \"-star\"),\n allowHalf: allowHalf,\n value: hoverValue === undefined ? value : hoverValue,\n onClick: this.onClick,\n onHover: this.onHover,\n key: index,\n character: character,\n characterRender: characterRender,\n focused: focused\n }));\n }\n var rateClassName = classNames(prefixCls, disabledClass, className, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'));\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: rateClassName,\n style: style,\n id: id,\n onMouseLeave: disabled ? null : this.onMouseLeave,\n tabIndex: disabled ? -1 : tabIndex,\n onFocus: disabled ? null : this.onFocus,\n onBlur: disabled ? null : this.onBlur,\n onKeyDown: disabled ? null : this.onKeyDown,\n ref: this.saveRate,\n role: \"radiogroup\"\n }, stars);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, state) {\n if ('value' in nextProps && nextProps.value !== undefined) {\n return _objectSpread(_objectSpread({}, state), {}, {\n value: nextProps.value\n });\n }\n return state;\n }\n }]);\n return Rate;\n}(React.Component);\nRate.defaultProps = {\n defaultValue: 0,\n count: 5,\n allowHalf: false,\n allowClear: true,\n style: {},\n prefixCls: 'rc-rate',\n onChange: noop,\n character: '★',\n onHoverChange: noop,\n tabIndex: 0,\n direction: 'ltr'\n};\nexport default Rate;","function getScroll(w) {\n var ret = w.pageXOffset;\n var method = 'scrollLeft';\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\nfunction getClientPosition(elem) {\n var x;\n var y;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n var box = elem.getBoundingClientRect();\n x = box.left;\n y = box.top;\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n return {\n left: x,\n top: y\n };\n}\nexport function getOffsetLeft(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n // Only IE use `parentWindow`\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScroll(w);\n return pos.left;\n}","import Rate from './Rate';\nexport default Rate;","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport StarFilled from \"@ant-design/icons/es/icons/StarFilled\";\nimport RcRate from 'rc-rate';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Tooltip from '../tooltip';\nvar Rate = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n tooltips = props.tooltips,\n _props$character = props.character,\n character = _props$character === void 0 ? /*#__PURE__*/React.createElement(StarFilled, null) : _props$character,\n rest = __rest(props, [\"prefixCls\", \"tooltips\", \"character\"]);\n var characterRender = function characterRender(node, _ref) {\n var index = _ref.index;\n if (!tooltips) {\n return node;\n }\n return /*#__PURE__*/React.createElement(Tooltip, {\n title: tooltips[index]\n }, node);\n };\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var ratePrefixCls = getPrefixCls('rate', prefixCls);\n return /*#__PURE__*/React.createElement(RcRate, _extends({\n ref: ref,\n character: character,\n characterRender: characterRender\n }, rest, {\n prefixCls: ratePrefixCls,\n direction: direction\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n Rate.displayName = 'Rate';\n}\nexport default Rate;","import { Row } from '../grid';\nexport default Row;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// TODO: 4.0 - codemod should help to change `filterOption` to support node props.\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcSelect, { OptGroup, Option } from 'rc-select';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport defaultRenderEmpty from '../config-provider/defaultRenderEmpty';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport SizeContext from '../config-provider/SizeContext';\nimport { FormItemInputContext } from '../form/context';\nimport { getTransitionDirection, getTransitionName } from '../_util/motion';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport getIcons from './utils/iconUtil';\nimport warning from '../_util/warning';\nimport { useCompactItemContext } from '../space/Compact';\nvar SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';\nvar InternalSelect = function InternalSelect(_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n _a$bordered = _a.bordered,\n bordered = _a$bordered === void 0 ? true : _a$bordered,\n className = _a.className,\n getPopupContainer = _a.getPopupContainer,\n dropdownClassName = _a.dropdownClassName,\n popupClassName = _a.popupClassName,\n _a$listHeight = _a.listHeight,\n listHeight = _a$listHeight === void 0 ? 256 : _a$listHeight,\n placement = _a.placement,\n _a$listItemHeight = _a.listItemHeight,\n listItemHeight = _a$listItemHeight === void 0 ? 32 : _a$listItemHeight,\n customizeSize = _a.size,\n customDisabled = _a.disabled,\n notFoundContent = _a.notFoundContent,\n customStatus = _a.status,\n showArrow = _a.showArrow,\n props = __rest(_a, [\"prefixCls\", \"bordered\", \"className\", \"getPopupContainer\", \"dropdownClassName\", \"popupClassName\", \"listHeight\", \"placement\", \"listItemHeight\", \"size\", \"disabled\", \"notFoundContent\", \"status\", \"showArrow\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction,\n virtual = _React$useContext.virtual,\n dropdownMatchSelectWidth = _React$useContext.dropdownMatchSelectWidth;\n var size = React.useContext(SizeContext);\n var prefixCls = getPrefixCls('select', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var _useCompactItemContex = useCompactItemContext(prefixCls, direction),\n compactSize = _useCompactItemContex.compactSize,\n compactItemClassnames = _useCompactItemContex.compactItemClassnames;\n var mode = React.useMemo(function () {\n var m = props.mode;\n if (m === 'combobox') {\n return undefined;\n }\n if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {\n return 'combobox';\n }\n return m;\n }, [props.mode]);\n var isMultiple = mode === 'multiple' || mode === 'tags';\n var mergedShowArrow = showArrow !== undefined ? showArrow : props.loading || !(isMultiple || mode === 'combobox');\n // =================== Warning =====================\n process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, 'Select', '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.') : void 0;\n // ===================== Form Status =====================\n var _useContext = useContext(FormItemInputContext),\n contextStatus = _useContext.status,\n hasFeedback = _useContext.hasFeedback,\n isFormItemInput = _useContext.isFormItemInput,\n feedbackIcon = _useContext.feedbackIcon;\n var mergedStatus = getMergedStatus(contextStatus, customStatus);\n // ===================== Empty =====================\n var mergedNotFound;\n if (notFoundContent !== undefined) {\n mergedNotFound = notFoundContent;\n } else if (mode === 'combobox') {\n mergedNotFound = null;\n } else {\n mergedNotFound = (renderEmpty || defaultRenderEmpty)('Select');\n }\n // ===================== Icons =====================\n var _getIcons = getIcons(_extends(_extends({}, props), {\n multiple: isMultiple,\n hasFeedback: hasFeedback,\n feedbackIcon: feedbackIcon,\n showArrow: mergedShowArrow,\n prefixCls: prefixCls\n })),\n suffixIcon = _getIcons.suffixIcon,\n itemIcon = _getIcons.itemIcon,\n removeIcon = _getIcons.removeIcon,\n clearIcon = _getIcons.clearIcon;\n var selectProps = omit(props, ['suffixIcon', 'itemIcon']);\n var rcSelectRtlDropdownClassName = classNames(popupClassName || dropdownClassName, _defineProperty({}, \"\".concat(prefixCls, \"-dropdown-\").concat(direction), direction === 'rtl'));\n var mergedSize = compactSize || customizeSize || size;\n // ===================== Disabled =====================\n var disabled = React.useContext(DisabledContext);\n var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n var mergedClassName = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), mergedSize === 'large'), \"\".concat(prefixCls, \"-sm\"), mergedSize === 'small'), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-borderless\"), !bordered), \"\".concat(prefixCls, \"-in-form-item\"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, className);\n // ===================== Placement =====================\n var getPlacement = function getPlacement() {\n if (placement !== undefined) {\n return placement;\n }\n return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n };\n return /*#__PURE__*/React.createElement(RcSelect, _extends({\n ref: ref,\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth\n }, selectProps, {\n transitionName: getTransitionName(rootPrefixCls, getTransitionDirection(placement), props.transitionName),\n listHeight: listHeight,\n listItemHeight: listItemHeight,\n mode: mode,\n prefixCls: prefixCls,\n placement: getPlacement(),\n direction: direction,\n inputIcon: suffixIcon,\n menuItemSelectedIcon: itemIcon,\n removeIcon: removeIcon,\n clearIcon: clearIcon,\n notFoundContent: mergedNotFound,\n className: mergedClassName,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n dropdownClassName: rcSelectRtlDropdownClassName,\n showArrow: hasFeedback || showArrow,\n disabled: mergedDisabled\n }));\n};\nvar Select = /*#__PURE__*/React.forwardRef(InternalSelect);\nSelect.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;\nSelect.Option = Option;\nSelect.OptGroup = OptGroup;\nexport default Select;","import CheckOutlined from \"@ant-design/icons/es/icons/CheckOutlined\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport DownOutlined from \"@ant-design/icons/es/icons/DownOutlined\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport SearchOutlined from \"@ant-design/icons/es/icons/SearchOutlined\";\nimport * as React from 'react';\nexport default function getIcons(_ref) {\n var suffixIcon = _ref.suffixIcon,\n clearIcon = _ref.clearIcon,\n menuItemSelectedIcon = _ref.menuItemSelectedIcon,\n removeIcon = _ref.removeIcon,\n loading = _ref.loading,\n multiple = _ref.multiple,\n hasFeedback = _ref.hasFeedback,\n prefixCls = _ref.prefixCls,\n showArrow = _ref.showArrow,\n feedbackIcon = _ref.feedbackIcon;\n // Clear Icon\n var mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /*#__PURE__*/React.createElement(CloseCircleFilled, null);\n // Validation Feedback Icon\n var getSuffixIconNode = function getSuffixIconNode(arrowIcon) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, showArrow !== false && arrowIcon, hasFeedback && feedbackIcon);\n };\n // Arrow item icon\n var mergedSuffixIcon = null;\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon);\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode( /*#__PURE__*/React.createElement(LoadingOutlined, {\n spin: true\n }));\n } else {\n var iconCls = \"\".concat(prefixCls, \"-suffix\");\n mergedSuffixIcon = function mergedSuffixIcon(_ref2) {\n var open = _ref2.open,\n showSearch = _ref2.showSearch;\n if (open && showSearch) {\n return getSuffixIconNode( /*#__PURE__*/React.createElement(SearchOutlined, {\n className: iconCls\n }));\n }\n return getSuffixIconNode( /*#__PURE__*/React.createElement(DownOutlined, {\n className: iconCls\n }));\n };\n }\n // Checked item icon\n var mergedItemIcon = null;\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon;\n } else if (multiple) {\n mergedItemIcon = /*#__PURE__*/React.createElement(CheckOutlined, null);\n } else {\n mergedItemIcon = null;\n }\n var mergedRemoveIcon = null;\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon;\n } else {\n mergedRemoveIcon = /*#__PURE__*/React.createElement(CloseOutlined, null);\n }\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nvar Element = function Element(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n size = props.size,\n shape = props.shape;\n var sizeCls = classNames(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-lg\"), size === 'large'), \"\".concat(prefixCls, \"-sm\"), size === 'small'));\n var shapeCls = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-circle\"), shape === 'circle'), \"\".concat(prefixCls, \"-square\"), shape === 'square'), \"\".concat(prefixCls, \"-round\"), shape === 'round'));\n var sizeStyle = React.useMemo(function () {\n return typeof size === 'number' ? {\n width: size,\n height: size,\n lineHeight: \"\".concat(size, \"px\")\n } : {};\n }, [size]);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(prefixCls, sizeCls, shapeCls, className),\n style: _extends(_extends({}, sizeStyle), style)\n });\n};\nexport default Element;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Element from './Element';\nvar SkeletonAvatar = function SkeletonAvatar(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n active = props.active,\n _props$shape = props.shape,\n shape = _props$shape === void 0 ? 'circle' : _props$shape,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n var otherProps = omit(props, ['prefixCls', 'className']);\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-element\"), _defineProperty({}, \"\".concat(prefixCls, \"-active\"), active), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls\n }, /*#__PURE__*/React.createElement(Element, _extends({\n prefixCls: \"\".concat(prefixCls, \"-avatar\"),\n shape: shape,\n size: size\n }, otherProps)));\n};\nexport default SkeletonAvatar;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Element from './Element';\nvar SkeletonButton = function SkeletonButton(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n active = props.active,\n _props$block = props.block,\n block = _props$block === void 0 ? false : _props$block,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n var otherProps = omit(props, ['prefixCls']);\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-element\"), _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-active\"), active), \"\".concat(prefixCls, \"-block\"), block), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls\n }, /*#__PURE__*/React.createElement(Element, _extends({\n prefixCls: \"\".concat(prefixCls, \"-button\"),\n size: size\n }, otherProps)));\n};\nexport default SkeletonButton;","// This icon file is generated automatically.\nvar DotChartOutlined = { \"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-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z\" } }] }, \"name\": \"dot-chart\", \"theme\": \"outlined\" };\nexport default DotChartOutlined;\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 DotChartOutlinedSvg from \"@ant-design/icons-svg/es/asn/DotChartOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar DotChartOutlined = function DotChartOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: DotChartOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(DotChartOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'DotChartOutlined';\n}\nexport default RefIcon;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport DotChartOutlined from \"@ant-design/icons/es/icons/DotChartOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar SkeletonNode = function SkeletonNode(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n active = props.active,\n children = props.children;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-element\"), _defineProperty({}, \"\".concat(prefixCls, \"-active\"), active), className);\n var content = children !== null && children !== void 0 ? children : /*#__PURE__*/React.createElement(DotChartOutlined, null);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-image\"), className),\n style: style\n }, content));\n};\nexport default SkeletonNode;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar path = 'M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z';\nvar SkeletonImage = function SkeletonImage(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n active = props.active;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-element\"), _defineProperty({}, \"\".concat(prefixCls, \"-active\"), active), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-image\"), className),\n style: style\n }, /*#__PURE__*/React.createElement(\"svg\", {\n viewBox: \"0 0 1098 1024\",\n xmlns: \"http://www.w3.org/2000/svg\",\n className: \"\".concat(prefixCls, \"-image-svg\")\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: path,\n className: \"\".concat(prefixCls, \"-image-path\")\n }))));\n};\nexport default SkeletonImage;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Element from './Element';\nvar SkeletonInput = function SkeletonInput(props) {\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n active = props.active,\n block = props.block,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n var otherProps = omit(props, ['prefixCls']);\n var cls = classNames(prefixCls, \"\".concat(prefixCls, \"-element\"), _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-active\"), active), \"\".concat(prefixCls, \"-block\"), block), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls\n }, /*#__PURE__*/React.createElement(Element, _extends({\n prefixCls: \"\".concat(prefixCls, \"-input\"),\n size: size\n }, otherProps)));\n};\nexport default SkeletonInput;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nvar Paragraph = function Paragraph(props) {\n var getWidth = function getWidth(index) {\n var width = props.width,\n _props$rows = props.rows,\n rows = _props$rows === void 0 ? 2 : _props$rows;\n if (Array.isArray(width)) {\n return width[index];\n }\n // last paragraph\n if (rows - 1 === index) {\n return width;\n }\n return undefined;\n };\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n rows = props.rows;\n var rowList = _toConsumableArray(Array(rows)).map(function (_, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n key: index,\n style: {\n width: getWidth(index)\n }\n })\n );\n });\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: classNames(prefixCls, className),\n style: style\n }, rowList);\n};\nexport default Paragraph;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/* eslint-disable jsx-a11y/heading-has-content */\nimport classNames from 'classnames';\nimport * as React from 'react';\nvar Title = function Title(_ref) {\n var prefixCls = _ref.prefixCls,\n className = _ref.className,\n width = _ref.width,\n style = _ref.style;\n return /*#__PURE__*/React.createElement(\"h3\", {\n className: classNames(prefixCls, className),\n style: _extends({\n width: width\n }, style)\n });\n};\nexport default Title;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SkeletonAvatar from './Avatar';\nimport SkeletonButton from './Button';\nimport SkeletonNode from './Node';\nimport Element from './Element';\nimport SkeletonImage from './Image';\nimport SkeletonInput from './Input';\nimport Paragraph from './Paragraph';\nimport Title from './Title';\nfunction getComponentProps(prop) {\n if (prop && _typeof(prop) === 'object') {\n return prop;\n }\n return {};\n}\nfunction getAvatarBasicProps(hasTitle, hasParagraph) {\n if (hasTitle && !hasParagraph) {\n // Square avatar\n return {\n size: 'large',\n shape: 'square'\n };\n }\n return {\n size: 'large',\n shape: 'circle'\n };\n}\nfunction getTitleBasicProps(hasAvatar, hasParagraph) {\n if (!hasAvatar && hasParagraph) {\n return {\n width: '38%'\n };\n }\n if (hasAvatar && hasParagraph) {\n return {\n width: '50%'\n };\n }\n return {};\n}\nfunction getParagraphBasicProps(hasAvatar, hasTitle) {\n var basicProps = {};\n // Width\n if (!hasAvatar || !hasTitle) {\n basicProps.width = '61%';\n }\n // Rows\n if (!hasAvatar && hasTitle) {\n basicProps.rows = 3;\n } else {\n basicProps.rows = 2;\n }\n return basicProps;\n}\nvar Skeleton = function Skeleton(props) {\n var customizePrefixCls = props.prefixCls,\n loading = props.loading,\n className = props.className,\n style = props.style,\n children = props.children,\n _props$avatar = props.avatar,\n avatar = _props$avatar === void 0 ? false : _props$avatar,\n _props$title = props.title,\n title = _props$title === void 0 ? true : _props$title,\n _props$paragraph = props.paragraph,\n paragraph = _props$paragraph === void 0 ? true : _props$paragraph,\n active = props.active,\n round = props.round;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n if (loading || !('loading' in props)) {\n var hasAvatar = !!avatar;\n var hasTitle = !!title;\n var hasParagraph = !!paragraph;\n // Avatar\n var avatarNode;\n if (hasAvatar) {\n var avatarProps = _extends(_extends({\n prefixCls: \"\".concat(prefixCls, \"-avatar\")\n }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));\n // We direct use SkeletonElement as avatar in skeleton internal.\n avatarNode = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-header\")\n }, /*#__PURE__*/React.createElement(Element, _extends({}, avatarProps)));\n }\n var contentNode;\n if (hasTitle || hasParagraph) {\n // Title\n var $title;\n if (hasTitle) {\n var titleProps = _extends(_extends({\n prefixCls: \"\".concat(prefixCls, \"-title\")\n }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));\n $title = /*#__PURE__*/React.createElement(Title, _extends({}, titleProps));\n }\n // Paragraph\n var paragraphNode;\n if (hasParagraph) {\n var paragraphProps = _extends(_extends({\n prefixCls: \"\".concat(prefixCls, \"-paragraph\")\n }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));\n paragraphNode = /*#__PURE__*/React.createElement(Paragraph, _extends({}, paragraphProps));\n }\n contentNode = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, $title, paragraphNode);\n }\n var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-with-avatar\"), hasAvatar), \"\".concat(prefixCls, \"-active\"), active), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-round\"), round), className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style\n }, avatarNode, contentNode);\n }\n return typeof children !== 'undefined' ? children : null;\n};\nSkeleton.Button = SkeletonButton;\nSkeleton.Avatar = SkeletonAvatar;\nSkeleton.Input = SkeletonInput;\nSkeleton.Image = SkeletonImage;\nSkeleton.Node = SkeletonNode;\nexport default Skeleton;","import Skeleton from './Skeleton';\nexport default Skeleton;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nexport var SpaceCompactItemContext = /*#__PURE__*/React.createContext(null);\nexport var useCompactItemContext = function useCompactItemContext(prefixCls, direction) {\n var compactItemContext = React.useContext(SpaceCompactItemContext);\n var compactItemClassnames = React.useMemo(function () {\n if (!compactItemContext) return '';\n var compactDirection = compactItemContext.compactDirection,\n isFirstItem = compactItemContext.isFirstItem,\n isLastItem = compactItemContext.isLastItem;\n var separator = compactDirection === 'vertical' ? '-vertical-' : '-';\n return classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-compact\").concat(separator, \"item\"), true), \"\".concat(prefixCls, \"-compact\").concat(separator, \"first-item\"), isFirstItem), \"\".concat(prefixCls, \"-compact\").concat(separator, \"last-item\"), isLastItem), \"\".concat(prefixCls, \"-compact\").concat(separator, \"item-rtl\"), direction === 'rtl'));\n }, [prefixCls, direction, compactItemContext]);\n return {\n compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,\n compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,\n compactItemClassnames: compactItemClassnames\n };\n};\nexport var NoCompactStyle = function NoCompactStyle(_ref) {\n var children = _ref.children;\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: null\n }, children);\n};\nvar CompactItem = function CompactItem(_a) {\n var children = _a.children,\n otherProps = __rest(_a, [\"children\"]);\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: otherProps\n }, children);\n};\nvar Compact = function Compact(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n directionConfig = _React$useContext.direction;\n var _props$size = props.size,\n size = _props$size === void 0 ? 'middle' : _props$size,\n direction = props.direction,\n block = props.block,\n customizePrefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n restProps = __rest(props, [\"size\", \"direction\", \"block\", \"prefixCls\", \"className\", \"children\"]);\n var prefixCls = getPrefixCls('space-compact', customizePrefixCls);\n var clx = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), directionConfig === 'rtl'), \"\".concat(prefixCls, \"-block\"), block), \"\".concat(prefixCls, \"-vertical\"), direction === 'vertical'), className);\n var compactItemContext = React.useContext(SpaceCompactItemContext);\n var childNodes = toArray(children);\n var nodes = React.useMemo(function () {\n return childNodes.map(function (child, i) {\n var key = child && child.key || \"\".concat(prefixCls, \"-item-\").concat(i);\n return /*#__PURE__*/React.createElement(CompactItem, {\n key: key,\n compactSize: size,\n compactDirection: direction,\n isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),\n isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))\n }, child);\n });\n }, [size, childNodes, compactItemContext]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: clx\n }, restProps), nodes);\n};\nexport default Compact;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { SpaceContext } from '.';\nexport default function Item(_ref) {\n var className = _ref.className,\n direction = _ref.direction,\n index = _ref.index,\n marginDirection = _ref.marginDirection,\n children = _ref.children,\n split = _ref.split,\n wrap = _ref.wrap;\n var _React$useContext = React.useContext(SpaceContext),\n horizontalSize = _React$useContext.horizontalSize,\n verticalSize = _React$useContext.verticalSize,\n latestIndex = _React$useContext.latestIndex,\n supportFlexGap = _React$useContext.supportFlexGap;\n var style = {};\n if (!supportFlexGap) {\n if (direction === 'vertical') {\n if (index < latestIndex) {\n style = {\n marginBottom: horizontalSize / (split ? 2 : 1)\n };\n }\n } else {\n style = _extends(_extends({}, index < latestIndex && _defineProperty({}, marginDirection, horizontalSize / (split ? 2 : 1))), wrap && {\n paddingBottom: verticalSize\n });\n }\n }\n if (children === null || children === undefined) {\n return null;\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: style\n }, children), index < latestIndex && split && ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(className, \"-split\"),\n style: style\n }, split)));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useFlexGapSupport from '../_util/hooks/useFlexGapSupport';\nimport Item from './Item';\nimport Compact from './Compact';\nexport var SpaceContext = /*#__PURE__*/React.createContext({\n latestIndex: 0,\n horizontalSize: 0,\n verticalSize: 0,\n supportFlexGap: false\n});\nvar spaceSize = {\n small: 8,\n middle: 16,\n large: 24\n};\nfunction getNumberSize(size) {\n return typeof size === 'string' ? spaceSize[size] : size || 0;\n}\nvar Space = function Space(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n space = _React$useContext.space,\n directionConfig = _React$useContext.direction;\n var _props$size = props.size,\n size = _props$size === void 0 ? (space === null || space === void 0 ? void 0 : space.size) || 'small' : _props$size,\n align = props.align,\n className = props.className,\n children = props.children,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? 'horizontal' : _props$direction,\n customizePrefixCls = props.prefixCls,\n split = props.split,\n style = props.style,\n _props$wrap = props.wrap,\n wrap = _props$wrap === void 0 ? false : _props$wrap,\n otherProps = __rest(props, [\"size\", \"align\", \"className\", \"children\", \"direction\", \"prefixCls\", \"split\", \"style\", \"wrap\"]);\n var supportFlexGap = useFlexGapSupport();\n var _React$useMemo = React.useMemo(function () {\n return (Array.isArray(size) ? size : [size, size]).map(function (item) {\n return getNumberSize(item);\n });\n }, [size]),\n _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n horizontalSize = _React$useMemo2[0],\n verticalSize = _React$useMemo2[1];\n var childNodes = toArray(children, {\n keepEmpty: true\n });\n var mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;\n var prefixCls = getPrefixCls('space', customizePrefixCls);\n var cn = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(direction), _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), directionConfig === 'rtl'), \"\".concat(prefixCls, \"-align-\").concat(mergedAlign), mergedAlign), className);\n var itemClassName = \"\".concat(prefixCls, \"-item\");\n var marginDirection = directionConfig === 'rtl' ? 'marginLeft' : 'marginRight';\n // Calculate latest one\n var latestIndex = 0;\n var nodes = childNodes.map(function (child, i) {\n if (child !== null && child !== undefined) {\n latestIndex = i;\n }\n var key = child && child.key || \"\".concat(itemClassName, \"-\").concat(i);\n return /*#__PURE__*/React.createElement(Item, {\n className: itemClassName,\n key: key,\n direction: direction,\n index: i,\n marginDirection: marginDirection,\n split: split,\n wrap: wrap\n }, child);\n });\n var spaceContext = React.useMemo(function () {\n return {\n horizontalSize: horizontalSize,\n verticalSize: verticalSize,\n latestIndex: latestIndex,\n supportFlexGap: supportFlexGap\n };\n }, [horizontalSize, verticalSize, latestIndex, supportFlexGap]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n var gapStyle = {};\n if (wrap) {\n gapStyle.flexWrap = 'wrap';\n // Patch for gap not support\n if (!supportFlexGap) {\n gapStyle.marginBottom = -verticalSize;\n }\n }\n if (supportFlexGap) {\n gapStyle.columnGap = horizontalSize;\n gapStyle.rowGap = verticalSize;\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: cn,\n style: _extends(_extends({}, gapStyle), style)\n }, otherProps), /*#__PURE__*/React.createElement(SpaceContext.Provider, {\n value: spaceContext\n }, nodes));\n};\nvar CompoundedSpace = Space;\nCompoundedSpace.Compact = Compact;\nexport default CompoundedSpace;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport debounce from 'lodash/debounce';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigConsumer, ConfigContext } from '../config-provider';\nimport { cloneElement, isValidElement } from '../_util/reactNode';\nimport { tuple } from '../_util/type';\nvar SpinSizes = tuple('small', 'default', 'large');\n// Render indicator\nvar defaultIndicator = null;\nfunction renderIndicator(prefixCls, props) {\n var indicator = props.indicator;\n var dotClassName = \"\".concat(prefixCls, \"-dot\");\n // should not be render default indicator when indicator value is null\n if (indicator === null) {\n return null;\n }\n if (isValidElement(indicator)) {\n return cloneElement(indicator, {\n className: classNames(indicator.props.className, dotClassName)\n });\n }\n if (isValidElement(defaultIndicator)) {\n return cloneElement(defaultIndicator, {\n className: classNames(defaultIndicator.props.className, dotClassName)\n });\n }\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(dotClassName, \"\".concat(prefixCls, \"-dot-spin\"))\n }, /*#__PURE__*/React.createElement(\"i\", {\n className: \"\".concat(prefixCls, \"-dot-item\")\n }), /*#__PURE__*/React.createElement(\"i\", {\n className: \"\".concat(prefixCls, \"-dot-item\")\n }), /*#__PURE__*/React.createElement(\"i\", {\n className: \"\".concat(prefixCls, \"-dot-item\")\n }), /*#__PURE__*/React.createElement(\"i\", {\n className: \"\".concat(prefixCls, \"-dot-item\")\n }));\n}\nfunction shouldDelay(spinning, delay) {\n return !!spinning && !!delay && !isNaN(Number(delay));\n}\nvar Spin = function Spin(props) {\n var prefixCls = props.spinPrefixCls,\n _props$spinning = props.spinning,\n customSpinning = _props$spinning === void 0 ? true : _props$spinning,\n delay = props.delay,\n className = props.className,\n _props$size = props.size,\n size = _props$size === void 0 ? 'default' : _props$size,\n tip = props.tip,\n wrapperClassName = props.wrapperClassName,\n style = props.style,\n children = props.children,\n restProps = __rest(props, [\"spinPrefixCls\", \"spinning\", \"delay\", \"className\", \"size\", \"tip\", \"wrapperClassName\", \"style\", \"children\"]);\n var _React$useState = React.useState(function () {\n return customSpinning && !shouldDelay(customSpinning, delay);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n spinning = _React$useState2[0],\n setSpinning = _React$useState2[1];\n React.useEffect(function () {\n var updateSpinning = debounce(function () {\n setSpinning(customSpinning);\n }, delay);\n updateSpinning();\n return function () {\n var _a;\n (_a = updateSpinning === null || updateSpinning === void 0 ? void 0 : updateSpinning.cancel) === null || _a === void 0 ? void 0 : _a.call(updateSpinning);\n };\n }, [delay, customSpinning]);\n var isNestedPattern = function isNestedPattern() {\n return typeof children !== 'undefined';\n };\n var renderSpin = function renderSpin(_ref) {\n var direction = _ref.direction;\n var spinClassName = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-sm\"), size === 'small'), \"\".concat(prefixCls, \"-lg\"), size === 'large'), \"\".concat(prefixCls, \"-spinning\"), spinning), \"\".concat(prefixCls, \"-show-text\"), !!tip), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n // fix https://fb.me/react-unknown-prop\n var divProps = omit(restProps, ['indicator', 'prefixCls']);\n var spinElement = /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n style: style,\n className: spinClassName,\n \"aria-live\": \"polite\",\n \"aria-busy\": spinning\n }), renderIndicator(prefixCls, props), tip ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-text\")\n }, tip) : null);\n if (isNestedPattern()) {\n var containerClassName = classNames(\"\".concat(prefixCls, \"-container\"), _defineProperty({}, \"\".concat(prefixCls, \"-blur\"), spinning));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n className: classNames(\"\".concat(prefixCls, \"-nested-loading\"), wrapperClassName)\n }), spinning && /*#__PURE__*/React.createElement(\"div\", {\n key: \"loading\"\n }, spinElement), /*#__PURE__*/React.createElement(\"div\", {\n className: containerClassName,\n key: \"container\"\n }, children));\n }\n return spinElement;\n };\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, renderSpin);\n};\nvar SpinFC = function SpinFC(props) {\n var customizePrefixCls = props.prefixCls;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var spinPrefixCls = getPrefixCls('spin', customizePrefixCls);\n var spinClassProps = _extends(_extends({}, props), {\n spinPrefixCls: spinPrefixCls\n });\n return /*#__PURE__*/React.createElement(Spin, _extends({}, spinClassProps));\n};\nSpinFC.setDefaultIndicator = function (indicator) {\n defaultIndicator = indicator;\n};\nif (process.env.NODE_ENV !== 'production') {\n SpinFC.displayName = 'Spin';\n}\nexport default SpinFC;","import { createContext } from 'react';\nexport default /*#__PURE__*/createContext(null);","import * as React from 'react';\nimport classNames from 'classnames';\nvar TabPane = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var prefixCls = _ref.prefixCls,\n className = _ref.className,\n style = _ref.style,\n id = _ref.id,\n active = _ref.active,\n tabKey = _ref.tabKey,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id && \"\".concat(id, \"-panel-\").concat(tabKey),\n role: \"tabpanel\",\n tabIndex: active ? 0 : -1,\n \"aria-labelledby\": id && \"\".concat(id, \"-tab-\").concat(tabKey),\n \"aria-hidden\": !active,\n style: style,\n className: classNames(prefixCls, active && \"\".concat(prefixCls, \"-active\"), className),\n ref: ref\n }, children);\n});\nif (process.env.NODE_ENV !== 'production') {\n TabPane.displayName = 'TabPane';\n}\nexport default TabPane;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar _excluded = [\"key\", \"forceRender\", \"style\", \"className\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport TabContext from \"../TabContext\";\nimport TabPane from \"./TabPane\";\nexport default function TabPanelList(_ref) {\n var id = _ref.id,\n activeKey = _ref.activeKey,\n animated = _ref.animated,\n tabPosition = _ref.tabPosition,\n destroyInactiveTabPane = _ref.destroyInactiveTabPane;\n var _React$useContext = React.useContext(TabContext),\n prefixCls = _React$useContext.prefixCls,\n tabs = _React$useContext.tabs;\n var tabPaneAnimated = animated.tabPane;\n var tabPanePrefixCls = \"\".concat(prefixCls, \"-tabpane\");\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-content-holder\"))\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-content\"), \"\".concat(prefixCls, \"-content-\").concat(tabPosition), _defineProperty({}, \"\".concat(prefixCls, \"-content-animated\"), tabPaneAnimated))\n }, tabs.map(function (_ref2) {\n var key = _ref2.key,\n forceRender = _ref2.forceRender,\n paneStyle = _ref2.style,\n paneClassName = _ref2.className,\n restTabProps = _objectWithoutProperties(_ref2, _excluded);\n var active = key === activeKey;\n return /*#__PURE__*/React.createElement(CSSMotion, _extends({\n key: key,\n visible: active,\n forceRender: forceRender,\n removeOnLeave: !!destroyInactiveTabPane,\n leavedClassName: \"\".concat(tabPanePrefixCls, \"-hidden\")\n }, animated.tabPaneMotion), function (_ref3, ref) {\n var motionStyle = _ref3.style,\n motionClassName = _ref3.className;\n return /*#__PURE__*/React.createElement(TabPane, _extends({}, restTabProps, {\n prefixCls: tabPanePrefixCls,\n id: id,\n tabKey: key,\n animated: tabPaneAnimated,\n active: active,\n style: _objectSpread(_objectSpread({}, paneStyle), motionStyle),\n className: classNames(paneClassName, motionClassName),\n ref: ref\n }));\n });\n })));\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { useMemo } from 'react';\nvar DEFAULT_SIZE = {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n};\nexport default function useOffsets(tabs, tabSizes, holderScrollWidth) {\n return useMemo(function () {\n var _tabs$;\n var map = new Map();\n var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE;\n var rightOffset = lastOffset.left + lastOffset.width;\n for (var i = 0; i < tabs.length; i += 1) {\n var key = tabs[i].key;\n var data = tabSizes.get(key);\n\n // Reuse last one when not exist yet\n if (!data) {\n var _tabs;\n data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE;\n }\n var entity = map.get(key) || _objectSpread({}, data);\n\n // Right\n entity.right = rightOffset - entity.left - entity.width;\n\n // Update entity\n map.set(key, entity);\n }\n return map;\n }, [tabs.map(function (tab) {\n return tab.key;\n }).join('_'), tabSizes, holderScrollWidth]);\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nexport default function useSyncState(defaultState, onChange) {\n var stateRef = React.useRef(defaultState);\n var _React$useState = React.useState({}),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n forceUpdate = _React$useState2[1];\n function setState(updater) {\n var newValue = typeof updater === 'function' ? updater(stateRef.current) : updater;\n if (newValue !== stateRef.current) {\n onChange(newValue, stateRef.current);\n }\n stateRef.current = newValue;\n forceUpdate({});\n }\n return [stateRef.current, setState];\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useState, useRef } from 'react';\nvar MIN_SWIPE_DISTANCE = 0.1;\nvar STOP_SWIPE_DISTANCE = 0.01;\nvar REFRESH_INTERVAL = 20;\nvar SPEED_OFF_MULTIPLE = Math.pow(0.995, REFRESH_INTERVAL);\n\n// ================================= Hook =================================\nexport default function useTouchMove(ref, onOffset) {\n var _useState = useState(),\n _useState2 = _slicedToArray(_useState, 2),\n touchPosition = _useState2[0],\n setTouchPosition = _useState2[1];\n var _useState3 = useState(0),\n _useState4 = _slicedToArray(_useState3, 2),\n lastTimestamp = _useState4[0],\n setLastTimestamp = _useState4[1];\n var _useState5 = useState(0),\n _useState6 = _slicedToArray(_useState5, 2),\n lastTimeDiff = _useState6[0],\n setLastTimeDiff = _useState6[1];\n var _useState7 = useState(),\n _useState8 = _slicedToArray(_useState7, 2),\n lastOffset = _useState8[0],\n setLastOffset = _useState8[1];\n var motionRef = useRef();\n\n // ========================= Events =========================\n // >>> Touch events\n function onTouchStart(e) {\n var _e$touches$ = e.touches[0],\n screenX = _e$touches$.screenX,\n screenY = _e$touches$.screenY;\n setTouchPosition({\n x: screenX,\n y: screenY\n });\n window.clearInterval(motionRef.current);\n }\n function onTouchMove(e) {\n if (!touchPosition) return;\n e.preventDefault();\n var _e$touches$2 = e.touches[0],\n screenX = _e$touches$2.screenX,\n screenY = _e$touches$2.screenY;\n setTouchPosition({\n x: screenX,\n y: screenY\n });\n var offsetX = screenX - touchPosition.x;\n var offsetY = screenY - touchPosition.y;\n onOffset(offsetX, offsetY);\n var now = Date.now();\n setLastTimestamp(now);\n setLastTimeDiff(now - lastTimestamp);\n setLastOffset({\n x: offsetX,\n y: offsetY\n });\n }\n function onTouchEnd() {\n if (!touchPosition) return;\n setTouchPosition(null);\n setLastOffset(null);\n\n // Swipe if needed\n if (lastOffset) {\n var distanceX = lastOffset.x / lastTimeDiff;\n var distanceY = lastOffset.y / lastTimeDiff;\n var absX = Math.abs(distanceX);\n var absY = Math.abs(distanceY);\n\n // Skip swipe if low distance\n if (Math.max(absX, absY) < MIN_SWIPE_DISTANCE) return;\n var currentX = distanceX;\n var currentY = distanceY;\n motionRef.current = window.setInterval(function () {\n if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) {\n window.clearInterval(motionRef.current);\n return;\n }\n currentX *= SPEED_OFF_MULTIPLE;\n currentY *= SPEED_OFF_MULTIPLE;\n onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL);\n }, REFRESH_INTERVAL);\n }\n }\n\n // >>> Wheel event\n var lastWheelDirectionRef = useRef();\n function onWheel(e) {\n var deltaX = e.deltaX,\n deltaY = e.deltaY;\n\n // Convert both to x & y since wheel only happened on PC\n var mixed = 0;\n var absX = Math.abs(deltaX);\n var absY = Math.abs(deltaY);\n if (absX === absY) {\n mixed = lastWheelDirectionRef.current === 'x' ? deltaX : deltaY;\n } else if (absX > absY) {\n mixed = deltaX;\n lastWheelDirectionRef.current = 'x';\n } else {\n mixed = deltaY;\n lastWheelDirectionRef.current = 'y';\n }\n if (onOffset(-mixed, -mixed)) {\n e.preventDefault();\n }\n }\n\n // ========================= Effect =========================\n var touchEventsRef = useRef(null);\n touchEventsRef.current = {\n onTouchStart: onTouchStart,\n onTouchMove: onTouchMove,\n onTouchEnd: onTouchEnd,\n onWheel: onWheel\n };\n React.useEffect(function () {\n function onProxyTouchStart(e) {\n touchEventsRef.current.onTouchStart(e);\n }\n function onProxyTouchMove(e) {\n touchEventsRef.current.onTouchMove(e);\n }\n function onProxyTouchEnd(e) {\n touchEventsRef.current.onTouchEnd(e);\n }\n function onProxyWheel(e) {\n touchEventsRef.current.onWheel(e);\n }\n document.addEventListener('touchmove', onProxyTouchMove, {\n passive: false\n });\n document.addEventListener('touchend', onProxyTouchEnd, {\n passive: false\n });\n\n // No need to clean up since element removed\n ref.current.addEventListener('touchstart', onProxyTouchStart, {\n passive: false\n });\n ref.current.addEventListener('wheel', onProxyWheel);\n return function () {\n document.removeEventListener('touchmove', onProxyTouchMove);\n document.removeEventListener('touchend', onProxyTouchEnd);\n };\n }, []);\n}","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport { useRef, useState } from 'react';\n\n/**\n * Help to merge callback with `useLayoutEffect`.\n * One time will only trigger once.\n */\nexport default function useUpdate(callback) {\n var _useState = useState(0),\n _useState2 = _slicedToArray(_useState, 2),\n count = _useState2[0],\n setCount = _useState2[1];\n var effectRef = useRef(0);\n var callbackRef = useRef();\n callbackRef.current = callback;\n\n // Trigger on `useLayoutEffect`\n useLayoutUpdateEffect(function () {\n var _callbackRef$current;\n (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef);\n }, [count]);\n\n // Trigger to update count\n return function () {\n if (effectRef.current !== count) {\n return;\n }\n effectRef.current += 1;\n setCount(effectRef.current);\n };\n}\nexport function useUpdateState(defaultState) {\n var batchRef = useRef([]);\n var _useState3 = useState({}),\n _useState4 = _slicedToArray(_useState3, 2),\n forceUpdate = _useState4[1];\n var state = useRef(typeof defaultState === 'function' ? defaultState() : defaultState);\n var flushUpdate = useUpdate(function () {\n var current = state.current;\n batchRef.current.forEach(function (callback) {\n current = callback(current);\n });\n batchRef.current = [];\n state.current = current;\n forceUpdate({});\n });\n function updater(callback) {\n batchRef.current.push(callback);\n flushUpdate();\n }\n return [state.current, updater];\n}","import { useMemo } from 'react';\nvar DEFAULT_SIZE = {\n width: 0,\n height: 0,\n left: 0,\n top: 0,\n right: 0\n};\nexport default function useVisibleRange(tabOffsets, visibleTabContentValue, transform, tabContentSizeValue, addNodeSizeValue, operationNodeSizeValue, _ref) {\n var tabs = _ref.tabs,\n tabPosition = _ref.tabPosition,\n rtl = _ref.rtl;\n var charUnit;\n var position;\n var transformSize;\n if (['top', 'bottom'].includes(tabPosition)) {\n charUnit = 'width';\n position = rtl ? 'right' : 'left';\n transformSize = Math.abs(transform);\n } else {\n charUnit = 'height';\n position = 'top';\n transformSize = -transform;\n }\n return useMemo(function () {\n if (!tabs.length) {\n return [0, 0];\n }\n var len = tabs.length;\n var endIndex = len;\n for (var i = 0; i < len; i += 1) {\n var offset = tabOffsets.get(tabs[i].key) || DEFAULT_SIZE;\n if (offset[position] + offset[charUnit] > transformSize + visibleTabContentValue) {\n endIndex = i - 1;\n break;\n }\n }\n var startIndex = 0;\n for (var _i = len - 1; _i >= 0; _i -= 1) {\n var _offset = tabOffsets.get(tabs[_i].key) || DEFAULT_SIZE;\n if (_offset[position] < transformSize) {\n startIndex = _i + 1;\n break;\n }\n }\n return [startIndex, endIndex];\n }, [tabOffsets, visibleTabContentValue, tabContentSizeValue, addNodeSizeValue, operationNodeSizeValue, transformSize, tabPosition, tabs.map(function (tab) {\n return tab.key;\n }).join('_'), rtl]);\n}","/**\n * We trade Map as deps which may change with same value but different ref object.\n * We should make it as hash for deps\n * */\nexport function stringify(obj) {\n var tgt;\n if (obj instanceof Map) {\n tgt = {};\n obj.forEach(function (v, k) {\n tgt[k] = v;\n });\n } else {\n tgt = obj;\n }\n return JSON.stringify(tgt);\n}\nvar RC_TABS_DOUBLE_QUOTE = 'TABS_DQ';\nexport function genDataNodeKey(key) {\n return String(key).replace(/\"/g, RC_TABS_DOUBLE_QUOTE);\n}","import * as React from 'react';\nfunction AddButton(_ref, ref) {\n var prefixCls = _ref.prefixCls,\n editable = _ref.editable,\n locale = _ref.locale,\n style = _ref.style;\n if (!editable || editable.showAdd === false) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"button\", {\n ref: ref,\n type: \"button\",\n className: \"\".concat(prefixCls, \"-nav-add\"),\n style: style,\n \"aria-label\": (locale === null || locale === void 0 ? void 0 : locale.addAriaLabel) || 'Add tab',\n onClick: function onClick(event) {\n editable.onEdit('add', {\n event: event\n });\n }\n }, editable.addIcon || '+');\n}\nexport default /*#__PURE__*/React.forwardRef(AddButton);","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nvar ExtraContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var position = _ref.position,\n prefixCls = _ref.prefixCls,\n extra = _ref.extra;\n if (!extra) return null;\n var content;\n\n // Parse extra\n var assertExtra = {};\n if (_typeof(extra) === 'object' && ! /*#__PURE__*/React.isValidElement(extra)) {\n assertExtra = extra;\n } else {\n assertExtra.right = extra;\n }\n if (position === 'right') {\n content = assertExtra.right;\n }\n if (position === 'left') {\n content = assertExtra.left;\n }\n return content ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra-content\"),\n ref: ref\n }, content) : null;\n});\nif (process.env.NODE_ENV !== 'production') {\n ExtraContent.displayName = 'ExtraContent';\n}\nexport default ExtraContent;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport Dropdown from 'rc-dropdown';\nimport Menu, { MenuItem } from 'rc-menu';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport AddButton from \"./AddButton\";\nfunction OperationNode(_ref, ref) {\n var prefixCls = _ref.prefixCls,\n id = _ref.id,\n tabs = _ref.tabs,\n locale = _ref.locale,\n mobile = _ref.mobile,\n _ref$moreIcon = _ref.moreIcon,\n moreIcon = _ref$moreIcon === void 0 ? 'More' : _ref$moreIcon,\n moreTransitionName = _ref.moreTransitionName,\n style = _ref.style,\n className = _ref.className,\n editable = _ref.editable,\n tabBarGutter = _ref.tabBarGutter,\n rtl = _ref.rtl,\n removeAriaLabel = _ref.removeAriaLabel,\n onTabClick = _ref.onTabClick,\n getPopupContainer = _ref.getPopupContainer,\n popupClassName = _ref.popupClassName;\n // ======================== Dropdown ========================\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n open = _useState2[0],\n setOpen = _useState2[1];\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n selectedKey = _useState4[0],\n setSelectedKey = _useState4[1];\n var popupId = \"\".concat(id, \"-more-popup\");\n var dropdownPrefix = \"\".concat(prefixCls, \"-dropdown\");\n var selectedItemId = selectedKey !== null ? \"\".concat(popupId, \"-\").concat(selectedKey) : null;\n var dropdownAriaLabel = locale === null || locale === void 0 ? void 0 : locale.dropdownAriaLabel;\n function onRemoveTab(event, key) {\n event.preventDefault();\n event.stopPropagation();\n editable.onEdit('remove', {\n key: key,\n event: event\n });\n }\n var menu = /*#__PURE__*/React.createElement(Menu, {\n onClick: function onClick(_ref2) {\n var key = _ref2.key,\n domEvent = _ref2.domEvent;\n onTabClick(key, domEvent);\n setOpen(false);\n },\n prefixCls: \"\".concat(dropdownPrefix, \"-menu\"),\n id: popupId,\n tabIndex: -1,\n role: \"listbox\",\n \"aria-activedescendant\": selectedItemId,\n selectedKeys: [selectedKey],\n \"aria-label\": dropdownAriaLabel !== undefined ? dropdownAriaLabel : 'expanded dropdown'\n }, tabs.map(function (tab) {\n var removable = editable && tab.closable !== false && !tab.disabled;\n return /*#__PURE__*/React.createElement(MenuItem, {\n key: tab.key,\n id: \"\".concat(popupId, \"-\").concat(tab.key),\n role: \"option\",\n \"aria-controls\": id && \"\".concat(id, \"-panel-\").concat(tab.key),\n disabled: tab.disabled\n }, /*#__PURE__*/React.createElement(\"span\", null, tab.label), removable && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": removeAriaLabel || 'remove',\n tabIndex: 0,\n className: \"\".concat(dropdownPrefix, \"-menu-item-remove\"),\n onClick: function onClick(e) {\n e.stopPropagation();\n onRemoveTab(e, tab.key);\n }\n }, tab.closeIcon || editable.removeIcon || '×'));\n }));\n function selectOffset(offset) {\n var enabledTabs = tabs.filter(function (tab) {\n return !tab.disabled;\n });\n var selectedIndex = enabledTabs.findIndex(function (tab) {\n return tab.key === selectedKey;\n }) || 0;\n var len = enabledTabs.length;\n for (var i = 0; i < len; i += 1) {\n selectedIndex = (selectedIndex + offset + len) % len;\n var tab = enabledTabs[selectedIndex];\n if (!tab.disabled) {\n setSelectedKey(tab.key);\n return;\n }\n }\n }\n function onKeyDown(e) {\n var which = e.which;\n if (!open) {\n if ([KeyCode.DOWN, KeyCode.SPACE, KeyCode.ENTER].includes(which)) {\n setOpen(true);\n e.preventDefault();\n }\n return;\n }\n switch (which) {\n case KeyCode.UP:\n selectOffset(-1);\n e.preventDefault();\n break;\n case KeyCode.DOWN:\n selectOffset(1);\n e.preventDefault();\n break;\n case KeyCode.ESC:\n setOpen(false);\n break;\n case KeyCode.SPACE:\n case KeyCode.ENTER:\n if (selectedKey !== null) onTabClick(selectedKey, e);\n break;\n }\n }\n\n // ========================= Effect =========================\n useEffect(function () {\n // We use query element here to avoid React strict warning\n var ele = document.getElementById(selectedItemId);\n if (ele && ele.scrollIntoView) {\n ele.scrollIntoView(false);\n }\n }, [selectedKey]);\n useEffect(function () {\n if (!open) {\n setSelectedKey(null);\n }\n }, [open]);\n\n // ========================= Render =========================\n var moreStyle = _defineProperty({}, rtl ? 'marginRight' : 'marginLeft', tabBarGutter);\n if (!tabs.length) {\n moreStyle.visibility = 'hidden';\n moreStyle.order = 1;\n }\n var overlayClassName = classNames(_defineProperty({}, \"\".concat(dropdownPrefix, \"-rtl\"), rtl));\n var moreNode = mobile ? null : /*#__PURE__*/React.createElement(Dropdown, {\n prefixCls: dropdownPrefix,\n overlay: menu,\n trigger: ['hover'],\n visible: tabs.length ? open : false,\n transitionName: moreTransitionName,\n onVisibleChange: setOpen,\n overlayClassName: classNames(overlayClassName, popupClassName),\n mouseEnterDelay: 0.1,\n mouseLeaveDelay: 0.1,\n getPopupContainer: getPopupContainer\n }, /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n className: \"\".concat(prefixCls, \"-nav-more\"),\n style: moreStyle,\n tabIndex: -1,\n \"aria-hidden\": \"true\",\n \"aria-haspopup\": \"listbox\",\n \"aria-controls\": popupId,\n id: \"\".concat(id, \"-more\"),\n \"aria-expanded\": open,\n onKeyDown: onKeyDown\n }, moreIcon));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-nav-operations\"), className),\n style: style,\n ref: ref\n }, moreNode, /*#__PURE__*/React.createElement(AddButton, {\n prefixCls: prefixCls,\n locale: locale,\n editable: editable\n }));\n}\nexport default /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(OperationNode), function (_, next) {\n return (\n // https://github.com/ant-design/ant-design/issues/32544\n // We'd better remove syntactic sugar in `rc-menu` since this has perf issue\n next.tabMoving\n );\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport { genDataNodeKey } from \"../util\";\nfunction TabNode(_ref) {\n var _classNames;\n var prefixCls = _ref.prefixCls,\n id = _ref.id,\n active = _ref.active,\n _ref$tab = _ref.tab,\n key = _ref$tab.key,\n label = _ref$tab.label,\n disabled = _ref$tab.disabled,\n closeIcon = _ref$tab.closeIcon,\n closable = _ref.closable,\n renderWrapper = _ref.renderWrapper,\n removeAriaLabel = _ref.removeAriaLabel,\n editable = _ref.editable,\n onClick = _ref.onClick,\n onFocus = _ref.onFocus,\n style = _ref.style;\n var tabPrefix = \"\".concat(prefixCls, \"-tab\");\n var removable = editable && closable !== false && !disabled;\n function onInternalClick(e) {\n if (disabled) {\n return;\n }\n onClick(e);\n }\n function onRemoveTab(event) {\n event.preventDefault();\n event.stopPropagation();\n editable.onEdit('remove', {\n key: key,\n event: event\n });\n }\n var node = /*#__PURE__*/React.createElement(\"div\", {\n key: key\n // ref={ref}\n ,\n \"data-node-key\": genDataNodeKey(key),\n className: classNames(tabPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(tabPrefix, \"-with-remove\"), removable), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-active\"), active), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-disabled\"), disabled), _classNames)),\n style: style,\n onClick: onInternalClick\n }, /*#__PURE__*/React.createElement(\"div\", {\n role: \"tab\",\n \"aria-selected\": active,\n id: id && \"\".concat(id, \"-tab-\").concat(key),\n className: \"\".concat(tabPrefix, \"-btn\"),\n \"aria-controls\": id && \"\".concat(id, \"-panel-\").concat(key),\n \"aria-disabled\": disabled,\n tabIndex: disabled ? null : 0,\n onClick: function onClick(e) {\n e.stopPropagation();\n onInternalClick(e);\n },\n onKeyDown: function onKeyDown(e) {\n if ([KeyCode.SPACE, KeyCode.ENTER].includes(e.which)) {\n e.preventDefault();\n onInternalClick(e);\n }\n },\n onFocus: onFocus\n }, label), removable && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": removeAriaLabel || 'remove',\n tabIndex: 0,\n className: \"\".concat(tabPrefix, \"-remove\"),\n onClick: function onClick(e) {\n e.stopPropagation();\n onRemoveTab(e);\n }\n }, closeIcon || editable.removeIcon || '×'));\n return renderWrapper ? renderWrapper(node) : node;\n}\nexport default TabNode;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport raf from \"rc-util/es/raf\";\nimport { useComposeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport useOffsets from \"../hooks/useOffsets\";\nimport useSyncState from \"../hooks/useSyncState\";\nimport useTouchMove from \"../hooks/useTouchMove\";\nimport useUpdate, { useUpdateState } from \"../hooks/useUpdate\";\nimport useVisibleRange from \"../hooks/useVisibleRange\";\nimport TabContext from \"../TabContext\";\nimport { genDataNodeKey, stringify } from \"../util\";\nimport AddButton from \"./AddButton\";\nimport ExtraContent from \"./ExtraContent\";\nimport OperationNode from \"./OperationNode\";\nimport TabNode from \"./TabNode\";\nvar getSize = function getSize(refObj) {\n var _ref = refObj.current || {},\n _ref$offsetWidth = _ref.offsetWidth,\n offsetWidth = _ref$offsetWidth === void 0 ? 0 : _ref$offsetWidth,\n _ref$offsetHeight = _ref.offsetHeight,\n offsetHeight = _ref$offsetHeight === void 0 ? 0 : _ref$offsetHeight;\n return [offsetWidth, offsetHeight];\n};\n\n/**\n * Convert `SizeInfo` to unit value. Such as [123, 456] with `top` position get `123`\n */\nvar getUnitValue = function getUnitValue(size, tabPositionTopOrBottom) {\n return size[tabPositionTopOrBottom ? 0 : 1];\n};\nfunction TabNavList(props, ref) {\n var _classNames;\n var _React$useContext = React.useContext(TabContext),\n prefixCls = _React$useContext.prefixCls,\n tabs = _React$useContext.tabs;\n var className = props.className,\n style = props.style,\n id = props.id,\n animated = props.animated,\n activeKey = props.activeKey,\n rtl = props.rtl,\n extra = props.extra,\n editable = props.editable,\n locale = props.locale,\n tabPosition = props.tabPosition,\n tabBarGutter = props.tabBarGutter,\n children = props.children,\n onTabClick = props.onTabClick,\n onTabScroll = props.onTabScroll;\n var containerRef = useRef();\n var extraLeftRef = useRef();\n var extraRightRef = useRef();\n var tabsWrapperRef = useRef();\n var tabListRef = useRef();\n var operationsRef = useRef();\n var innerAddButtonRef = useRef();\n // const [getBtnRef, removeBtnRef] = useRefs();\n\n var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';\n var _useSyncState = useSyncState(0, function (next, prev) {\n if (tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'left' : 'right'\n });\n }\n }),\n _useSyncState2 = _slicedToArray(_useSyncState, 2),\n transformLeft = _useSyncState2[0],\n setTransformLeft = _useSyncState2[1];\n var _useSyncState3 = useSyncState(0, function (next, prev) {\n if (!tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'top' : 'bottom'\n });\n }\n }),\n _useSyncState4 = _slicedToArray(_useSyncState3, 2),\n transformTop = _useSyncState4[0],\n setTransformTop = _useSyncState4[1];\n var _useState = useState([0, 0]),\n _useState2 = _slicedToArray(_useState, 2),\n containerExcludeExtraSize = _useState2[0],\n setContainerExcludeExtraSize = _useState2[1];\n var _useState3 = useState([0, 0]),\n _useState4 = _slicedToArray(_useState3, 2),\n tabContentSize = _useState4[0],\n setTabContentSize = _useState4[1];\n var _useState5 = useState([0, 0]),\n _useState6 = _slicedToArray(_useState5, 2),\n addSize = _useState6[0],\n setAddSize = _useState6[1];\n var _useState7 = useState([0, 0]),\n _useState8 = _slicedToArray(_useState7, 2),\n operationSize = _useState8[0],\n setOperationSize = _useState8[1];\n var _useUpdateState = useUpdateState(new Map()),\n _useUpdateState2 = _slicedToArray(_useUpdateState, 2),\n tabSizes = _useUpdateState2[0],\n setTabSizes = _useUpdateState2[1];\n var tabOffsets = useOffsets(tabs, tabSizes, tabContentSize[0]);\n\n // ========================== Unit =========================\n var containerExcludeExtraSizeValue = getUnitValue(containerExcludeExtraSize, tabPositionTopOrBottom);\n var tabContentSizeValue = getUnitValue(tabContentSize, tabPositionTopOrBottom);\n var addSizeValue = getUnitValue(addSize, tabPositionTopOrBottom);\n var operationSizeValue = getUnitValue(operationSize, tabPositionTopOrBottom);\n var needScroll = containerExcludeExtraSizeValue < tabContentSizeValue + addSizeValue;\n var visibleTabContentValue = needScroll ? containerExcludeExtraSizeValue - operationSizeValue : containerExcludeExtraSizeValue - addSizeValue;\n\n // ========================== Util =========================\n var operationsHiddenClassName = \"\".concat(prefixCls, \"-nav-operations-hidden\");\n var transformMin = 0;\n var transformMax = 0;\n if (!tabPositionTopOrBottom) {\n transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);\n transformMax = 0;\n } else if (rtl) {\n transformMin = 0;\n transformMax = Math.max(0, tabContentSizeValue - visibleTabContentValue);\n } else {\n transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);\n transformMax = 0;\n }\n function alignInRange(value) {\n if (value < transformMin) {\n return transformMin;\n }\n if (value > transformMax) {\n return transformMax;\n }\n return value;\n }\n\n // ========================= Mobile ========================\n var touchMovingRef = useRef();\n var _useState9 = useState(),\n _useState10 = _slicedToArray(_useState9, 2),\n lockAnimation = _useState10[0],\n setLockAnimation = _useState10[1];\n function doLockAnimation() {\n setLockAnimation(Date.now());\n }\n function clearTouchMoving() {\n window.clearTimeout(touchMovingRef.current);\n }\n useTouchMove(tabsWrapperRef, function (offsetX, offsetY) {\n function doMove(setState, offset) {\n setState(function (value) {\n var newValue = alignInRange(value + offset);\n return newValue;\n });\n }\n\n // Skip scroll if place is enough\n if (!needScroll) {\n return false;\n }\n if (tabPositionTopOrBottom) {\n doMove(setTransformLeft, offsetX);\n } else {\n doMove(setTransformTop, offsetY);\n }\n clearTouchMoving();\n doLockAnimation();\n return true;\n });\n useEffect(function () {\n clearTouchMoving();\n if (lockAnimation) {\n touchMovingRef.current = window.setTimeout(function () {\n setLockAnimation(0);\n }, 100);\n }\n return clearTouchMoving;\n }, [lockAnimation]);\n\n // ===================== Visible Range =====================\n // Render tab node & collect tab offset\n var _useVisibleRange = useVisibleRange(tabOffsets,\n // Container\n visibleTabContentValue,\n // Transform\n tabPositionTopOrBottom ? transformLeft : transformTop,\n // Tabs\n tabContentSizeValue,\n // Add\n addSizeValue,\n // Operation\n operationSizeValue, _objectSpread(_objectSpread({}, props), {}, {\n tabs: tabs\n })),\n _useVisibleRange2 = _slicedToArray(_useVisibleRange, 2),\n visibleStart = _useVisibleRange2[0],\n visibleEnd = _useVisibleRange2[1];\n\n // ========================= Scroll ========================\n var scrollToTab = useEvent(function () {\n var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;\n var tabOffset = tabOffsets.get(key) || {\n width: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0\n };\n if (tabPositionTopOrBottom) {\n // ============ Align with top & bottom ============\n var newTransform = transformLeft;\n\n // RTL\n if (rtl) {\n if (tabOffset.right < transformLeft) {\n newTransform = tabOffset.right;\n } else if (tabOffset.right + tabOffset.width > transformLeft + visibleTabContentValue) {\n newTransform = tabOffset.right + tabOffset.width - visibleTabContentValue;\n }\n }\n // LTR\n else if (tabOffset.left < -transformLeft) {\n newTransform = -tabOffset.left;\n } else if (tabOffset.left + tabOffset.width > -transformLeft + visibleTabContentValue) {\n newTransform = -(tabOffset.left + tabOffset.width - visibleTabContentValue);\n }\n setTransformTop(0);\n setTransformLeft(alignInRange(newTransform));\n } else {\n // ============ Align with left & right ============\n var _newTransform = transformTop;\n if (tabOffset.top < -transformTop) {\n _newTransform = -tabOffset.top;\n } else if (tabOffset.top + tabOffset.height > -transformTop + visibleTabContentValue) {\n _newTransform = -(tabOffset.top + tabOffset.height - visibleTabContentValue);\n }\n setTransformLeft(0);\n setTransformTop(alignInRange(_newTransform));\n }\n });\n\n // ========================== Tab ==========================\n var tabNodeStyle = {};\n if (tabPosition === 'top' || tabPosition === 'bottom') {\n tabNodeStyle[rtl ? 'marginRight' : 'marginLeft'] = tabBarGutter;\n } else {\n tabNodeStyle.marginTop = tabBarGutter;\n }\n var tabNodes = tabs.map(function (tab, i) {\n var key = tab.key;\n return /*#__PURE__*/React.createElement(TabNode, {\n id: id,\n prefixCls: prefixCls,\n key: key,\n tab: tab\n /* first node should not have margin left */,\n style: i === 0 ? undefined : tabNodeStyle,\n closable: tab.closable,\n editable: editable,\n active: key === activeKey,\n renderWrapper: children,\n removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,\n onClick: function onClick(e) {\n onTabClick(key, e);\n },\n onFocus: function onFocus() {\n scrollToTab(key);\n doLockAnimation();\n if (!tabsWrapperRef.current) {\n return;\n }\n // Focus element will make scrollLeft change which we should reset back\n if (!rtl) {\n tabsWrapperRef.current.scrollLeft = 0;\n }\n tabsWrapperRef.current.scrollTop = 0;\n }\n });\n });\n\n // Update buttons records\n var updateTabSizes = function updateTabSizes() {\n return setTabSizes(function () {\n var newSizes = new Map();\n tabs.forEach(function (_ref2) {\n var _tabListRef$current;\n var key = _ref2.key;\n var btnNode = (_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.querySelector(\"[data-node-key=\\\"\".concat(genDataNodeKey(key), \"\\\"]\"));\n if (btnNode) {\n newSizes.set(key, {\n width: btnNode.offsetWidth,\n height: btnNode.offsetHeight,\n left: btnNode.offsetLeft,\n top: btnNode.offsetTop\n });\n }\n });\n return newSizes;\n });\n };\n useEffect(function () {\n updateTabSizes();\n }, [tabs.map(function (tab) {\n return tab.key;\n }).join('_')]);\n var onListHolderResize = useUpdate(function () {\n // Update wrapper records\n var containerSize = getSize(containerRef);\n var extraLeftSize = getSize(extraLeftRef);\n var extraRightSize = getSize(extraRightRef);\n setContainerExcludeExtraSize([containerSize[0] - extraLeftSize[0] - extraRightSize[0], containerSize[1] - extraLeftSize[1] - extraRightSize[1]]);\n var newAddSize = getSize(innerAddButtonRef);\n setAddSize(newAddSize);\n var newOperationSize = getSize(operationsRef);\n setOperationSize(newOperationSize);\n\n // Which includes add button size\n var tabContentFullSize = getSize(tabListRef);\n setTabContentSize([tabContentFullSize[0] - newAddSize[0], tabContentFullSize[1] - newAddSize[1]]);\n\n // Update buttons records\n updateTabSizes();\n });\n\n // ======================== Dropdown =======================\n var startHiddenTabs = tabs.slice(0, visibleStart);\n var endHiddenTabs = tabs.slice(visibleEnd + 1);\n var hiddenTabs = [].concat(_toConsumableArray(startHiddenTabs), _toConsumableArray(endHiddenTabs));\n\n // =================== Link & Operations ===================\n var _useState11 = useState(),\n _useState12 = _slicedToArray(_useState11, 2),\n inkStyle = _useState12[0],\n setInkStyle = _useState12[1];\n var activeTabOffset = tabOffsets.get(activeKey);\n\n // Delay set ink style to avoid remove tab blink\n var inkBarRafRef = useRef();\n function cleanInkBarRaf() {\n raf.cancel(inkBarRafRef.current);\n }\n useEffect(function () {\n var newInkStyle = {};\n if (activeTabOffset) {\n if (tabPositionTopOrBottom) {\n if (rtl) {\n newInkStyle.right = activeTabOffset.right;\n } else {\n newInkStyle.left = activeTabOffset.left;\n }\n newInkStyle.width = activeTabOffset.width;\n } else {\n newInkStyle.top = activeTabOffset.top;\n newInkStyle.height = activeTabOffset.height;\n }\n }\n cleanInkBarRaf();\n inkBarRafRef.current = raf(function () {\n setInkStyle(newInkStyle);\n });\n return cleanInkBarRaf;\n }, [activeTabOffset, tabPositionTopOrBottom, rtl]);\n\n // ========================= Effect ========================\n useEffect(function () {\n scrollToTab();\n // eslint-disable-next-line\n }, [activeKey, transformMin, transformMax, stringify(activeTabOffset), stringify(tabOffsets), tabPositionTopOrBottom]);\n\n // Should recalculate when rtl changed\n useEffect(function () {\n onListHolderResize();\n // eslint-disable-next-line\n }, [rtl]);\n\n // ========================= Render ========================\n var hasDropdown = !!hiddenTabs.length;\n var wrapPrefix = \"\".concat(prefixCls, \"-nav-wrap\");\n var pingLeft;\n var pingRight;\n var pingTop;\n var pingBottom;\n if (tabPositionTopOrBottom) {\n if (rtl) {\n pingRight = transformLeft > 0;\n pingLeft = transformLeft !== transformMax;\n } else {\n pingLeft = transformLeft < 0;\n pingRight = transformLeft !== transformMin;\n }\n } else {\n pingTop = transformTop < 0;\n pingBottom = transformTop !== transformMin;\n }\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: useComposeRef(ref, containerRef),\n role: \"tablist\",\n className: classNames(\"\".concat(prefixCls, \"-nav\"), className),\n style: style,\n onKeyDown: function onKeyDown() {\n // No need animation when use keyboard\n doLockAnimation();\n }\n }, /*#__PURE__*/React.createElement(ExtraContent, {\n ref: extraLeftRef,\n position: \"left\",\n extra: extra,\n prefixCls: prefixCls\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(wrapPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-left\"), pingLeft), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-right\"), pingRight), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-top\"), pingTop), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-bottom\"), pingBottom), _classNames)),\n ref: tabsWrapperRef\n }, /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: tabListRef,\n className: \"\".concat(prefixCls, \"-nav-list\"),\n style: {\n transform: \"translate(\".concat(transformLeft, \"px, \").concat(transformTop, \"px)\"),\n transition: lockAnimation ? 'none' : undefined\n }\n }, tabNodes, /*#__PURE__*/React.createElement(AddButton, {\n ref: innerAddButtonRef,\n prefixCls: prefixCls,\n locale: locale,\n editable: editable,\n style: _objectSpread(_objectSpread({}, tabNodes.length === 0 ? undefined : tabNodeStyle), {}, {\n visibility: hasDropdown ? 'hidden' : null\n })\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-ink-bar\"), _defineProperty({}, \"\".concat(prefixCls, \"-ink-bar-animated\"), animated.inkBar)),\n style: inkStyle\n })))), /*#__PURE__*/React.createElement(OperationNode, _extends({}, props, {\n removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,\n ref: operationsRef,\n prefixCls: prefixCls,\n tabs: hiddenTabs,\n className: !hasDropdown && operationsHiddenClassName,\n tabMoving: !!lockAnimation\n })), /*#__PURE__*/React.createElement(ExtraContent, {\n ref: extraRightRef,\n position: \"right\",\n extra: extra,\n prefixCls: prefixCls\n })));\n /* eslint-enable */\n}\n\nexport default /*#__PURE__*/React.forwardRef(TabNavList);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"renderTabBar\"],\n _excluded2 = [\"label\", \"key\"];\n// zombieJ: To compatible with `renderTabBar` usage.\n\nimport * as React from 'react';\nimport TabNavList from '.';\nimport TabContext from \"../TabContext\";\nimport TabPane from \"../TabPanelList/TabPane\";\n// We have to create a TabNavList components.\nexport default function TabNavListWrapper(_ref) {\n var renderTabBar = _ref.renderTabBar,\n restProps = _objectWithoutProperties(_ref, _excluded);\n var _React$useContext = React.useContext(TabContext),\n tabs = _React$useContext.tabs;\n if (renderTabBar) {\n var tabNavBarProps = _objectSpread(_objectSpread({}, restProps), {}, {\n // Legacy support. We do not use this actually\n panes: tabs.map(function (_ref2) {\n var label = _ref2.label,\n key = _ref2.key,\n restTabProps = _objectWithoutProperties(_ref2, _excluded2);\n return /*#__PURE__*/React.createElement(TabPane, _extends({\n tab: label,\n key: key,\n tabKey: key\n }, restTabProps));\n })\n });\n return renderTabBar(tabNavBarProps, TabNavList);\n }\n return /*#__PURE__*/React.createElement(TabNavList, restProps);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"id\", \"prefixCls\", \"className\", \"items\", \"direction\", \"activeKey\", \"defaultActiveKey\", \"editable\", \"animated\", \"tabPosition\", \"tabBarGutter\", \"tabBarStyle\", \"tabBarExtraContent\", \"locale\", \"moreIcon\", \"moreTransitionName\", \"destroyInactiveTabPane\", \"renderTabBar\", \"onChange\", \"onTabClick\", \"onTabScroll\", \"getPopupContainer\", \"popupClassName\"];\n// Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport isMobile from \"rc-util/es/isMobile\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport TabPanelList from \"./TabPanelList\";\nimport TabContext from \"./TabContext\";\nimport TabNavListWrapper from \"./TabNavList/Wrapper\";\nimport useAnimateConfig from \"./hooks/useAnimateConfig\";\n\n/**\n * Should added antd:\n * - type\n *\n * Removed:\n * - onNextClick\n * - onPrevClick\n * - keyboard\n */\n\n// Used for accessibility\nvar uuid = 0;\nfunction Tabs(_ref, ref) {\n var _classNames;\n var id = _ref.id,\n _ref$prefixCls = _ref.prefixCls,\n prefixCls = _ref$prefixCls === void 0 ? 'rc-tabs' : _ref$prefixCls,\n className = _ref.className,\n items = _ref.items,\n direction = _ref.direction,\n activeKey = _ref.activeKey,\n defaultActiveKey = _ref.defaultActiveKey,\n editable = _ref.editable,\n animated = _ref.animated,\n _ref$tabPosition = _ref.tabPosition,\n tabPosition = _ref$tabPosition === void 0 ? 'top' : _ref$tabPosition,\n tabBarGutter = _ref.tabBarGutter,\n tabBarStyle = _ref.tabBarStyle,\n tabBarExtraContent = _ref.tabBarExtraContent,\n locale = _ref.locale,\n moreIcon = _ref.moreIcon,\n moreTransitionName = _ref.moreTransitionName,\n destroyInactiveTabPane = _ref.destroyInactiveTabPane,\n renderTabBar = _ref.renderTabBar,\n onChange = _ref.onChange,\n onTabClick = _ref.onTabClick,\n onTabScroll = _ref.onTabScroll,\n getPopupContainer = _ref.getPopupContainer,\n popupClassName = _ref.popupClassName,\n restProps = _objectWithoutProperties(_ref, _excluded);\n var tabs = React.useMemo(function () {\n return (items || []).filter(function (item) {\n return item && _typeof(item) === 'object' && 'key' in item;\n });\n }, [items]);\n var rtl = direction === 'rtl';\n var mergedAnimated = useAnimateConfig(animated);\n\n // ======================== Mobile ========================\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n mobile = _useState2[0],\n setMobile = _useState2[1];\n useEffect(function () {\n // Only update on the client side\n setMobile(isMobile());\n }, []);\n\n // ====================== Active Key ======================\n var _useMergedState = useMergedState(function () {\n var _tabs$;\n return (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key;\n }, {\n value: activeKey,\n defaultValue: defaultActiveKey\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedActiveKey = _useMergedState2[0],\n setMergedActiveKey = _useMergedState2[1];\n var _useState3 = useState(function () {\n return tabs.findIndex(function (tab) {\n return tab.key === mergedActiveKey;\n });\n }),\n _useState4 = _slicedToArray(_useState3, 2),\n activeIndex = _useState4[0],\n setActiveIndex = _useState4[1];\n\n // Reset active key if not exist anymore\n useEffect(function () {\n var newActiveIndex = tabs.findIndex(function (tab) {\n return tab.key === mergedActiveKey;\n });\n if (newActiveIndex === -1) {\n var _tabs$newActiveIndex;\n newActiveIndex = Math.max(0, Math.min(activeIndex, tabs.length - 1));\n setMergedActiveKey((_tabs$newActiveIndex = tabs[newActiveIndex]) === null || _tabs$newActiveIndex === void 0 ? void 0 : _tabs$newActiveIndex.key);\n }\n setActiveIndex(newActiveIndex);\n }, [tabs.map(function (tab) {\n return tab.key;\n }).join('_'), mergedActiveKey, activeIndex]);\n\n // ===================== Accessibility ====================\n var _useMergedState3 = useMergedState(null, {\n value: id\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n mergedId = _useMergedState4[0],\n setMergedId = _useMergedState4[1];\n\n // Async generate id to avoid ssr mapping failed\n useEffect(function () {\n if (!id) {\n setMergedId(\"rc-tabs-\".concat(process.env.NODE_ENV === 'test' ? 'test' : uuid));\n uuid += 1;\n }\n }, []);\n\n // ======================== Events ========================\n function onInternalTabClick(key, e) {\n onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(key, e);\n var isActiveChanged = key !== mergedActiveKey;\n setMergedActiveKey(key);\n if (isActiveChanged) {\n onChange === null || onChange === void 0 ? void 0 : onChange(key);\n }\n }\n\n // ======================== Render ========================\n var sharedProps = {\n id: mergedId,\n activeKey: mergedActiveKey,\n animated: mergedAnimated,\n tabPosition: tabPosition,\n rtl: rtl,\n mobile: mobile\n };\n var tabNavBar;\n var tabNavBarProps = _objectSpread(_objectSpread({}, sharedProps), {}, {\n editable: editable,\n locale: locale,\n moreIcon: moreIcon,\n moreTransitionName: moreTransitionName,\n tabBarGutter: tabBarGutter,\n onTabClick: onInternalTabClick,\n onTabScroll: onTabScroll,\n extra: tabBarExtraContent,\n style: tabBarStyle,\n panes: null,\n getPopupContainer: getPopupContainer,\n popupClassName: popupClassName\n });\n return /*#__PURE__*/React.createElement(TabContext.Provider, {\n value: {\n tabs: tabs,\n prefixCls: prefixCls\n }\n }, /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref,\n id: id,\n className: classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(tabPosition), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-mobile\"), mobile), _defineProperty(_classNames, \"\".concat(prefixCls, \"-editable\"), editable), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), rtl), _classNames), className)\n }, restProps), tabNavBar, /*#__PURE__*/React.createElement(TabNavListWrapper, _extends({}, tabNavBarProps, {\n renderTabBar: renderTabBar\n })), /*#__PURE__*/React.createElement(TabPanelList, _extends({\n destroyInactiveTabPane: destroyInactiveTabPane\n }, sharedProps, {\n animated: mergedAnimated\n }))));\n}\nvar ForwardTabs = /*#__PURE__*/React.forwardRef(Tabs);\nif (process.env.NODE_ENV !== 'production') {\n ForwardTabs.displayName = 'Tabs';\n}\nexport default ForwardTabs;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport warning from \"rc-util/es/warning\";\nexport default function useAnimateConfig() {\n var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n inkBar: true,\n tabPane: false\n };\n var mergedAnimated;\n if (animated === false) {\n mergedAnimated = {\n inkBar: false,\n tabPane: false\n };\n } else if (animated === true) {\n mergedAnimated = {\n inkBar: true,\n tabPane: false\n };\n } else {\n mergedAnimated = _objectSpread({\n inkBar: true\n }, _typeof(animated) === 'object' ? animated : {});\n }\n\n // Enable tabPane animation if provide motion\n if (mergedAnimated.tabPaneMotion && mergedAnimated.tabPane === undefined) {\n mergedAnimated.tabPane = true;\n }\n if (!mergedAnimated.tabPaneMotion && mergedAnimated.tabPane) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, '`animated.tabPane` is true but `animated.tabPaneMotion` is not provided. Motion will not work.');\n }\n mergedAnimated.tabPane = false;\n }\n return mergedAnimated;\n}","import Tabs from \"./Tabs\";\nexport default Tabs;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getTransitionName } from '../../_util/motion';\nvar motion = {\n motionAppear: false,\n motionEnter: true,\n motionLeave: true\n};\nexport default function useAnimateConfig(prefixCls) {\n var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n inkBar: true,\n tabPane: false\n };\n var mergedAnimated;\n if (animated === false) {\n mergedAnimated = {\n inkBar: false,\n tabPane: false\n };\n } else if (animated === true) {\n mergedAnimated = {\n inkBar: true,\n tabPane: true\n };\n } else {\n mergedAnimated = _extends({\n inkBar: true\n }, _typeof(animated) === 'object' ? animated : {});\n }\n if (mergedAnimated.tabPane) {\n mergedAnimated.tabPaneMotion = _extends(_extends({}, motion), {\n motionName: getTransitionName(prefixCls, 'switch')\n });\n }\n return mergedAnimated;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport warning from '../../_util/warning';\nfunction filter(items) {\n return items.filter(function (item) {\n return item;\n });\n}\nexport default function useLegacyItems(items, children) {\n if (items) {\n return items;\n }\n process.env.NODE_ENV !== \"production\" ? warning(!children, 'Tabs', 'Tabs.TabPane is deprecated. Please use `items` directly.') : void 0;\n var childrenItems = toArray(children).map(function (node) {\n if ( /*#__PURE__*/React.isValidElement(node)) {\n var key = node.key,\n props = node.props;\n var _a = props || {},\n tab = _a.tab,\n restProps = __rest(_a, [\"tab\"]);\n var item = _extends(_extends({\n key: String(key)\n }, restProps), {\n label: tab\n });\n return item;\n }\n return null;\n });\n return filter(childrenItems);\n}","var TabPane = function TabPane() {\n return null;\n};\nif (process.env.NODE_ENV !== 'production') {\n TabPane.displayName = 'DeprecatedTabPane';\n}\nexport default TabPane;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport EllipsisOutlined from \"@ant-design/icons/es/icons/EllipsisOutlined\";\nimport PlusOutlined from \"@ant-design/icons/es/icons/PlusOutlined\";\nimport classNames from 'classnames';\nimport RcTabs from 'rc-tabs';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport SizeContext from '../config-provider/SizeContext';\nimport warning from '../_util/warning';\nimport useAnimateConfig from './hooks/useAnimateConfig';\nimport useLegacyItems from './hooks/useLegacyItems';\nimport TabPane from './TabPane';\nfunction Tabs(_a) {\n var type = _a.type,\n className = _a.className,\n propSize = _a.size,\n _onEdit = _a.onEdit,\n hideAdd = _a.hideAdd,\n centered = _a.centered,\n addIcon = _a.addIcon,\n children = _a.children,\n items = _a.items,\n animated = _a.animated,\n props = __rest(_a, [\"type\", \"className\", \"size\", \"onEdit\", \"hideAdd\", \"centered\", \"addIcon\", \"children\", \"items\", \"animated\"]);\n var customizePrefixCls = props.prefixCls,\n _props$moreIcon = props.moreIcon,\n moreIcon = _props$moreIcon === void 0 ? /*#__PURE__*/React.createElement(EllipsisOutlined, null) : _props$moreIcon;\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction,\n getPopupContainer = _React$useContext.getPopupContainer;\n var prefixCls = getPrefixCls('tabs', customizePrefixCls);\n var editable;\n if (type === 'editable-card') {\n editable = {\n onEdit: function onEdit(editType, _ref) {\n var key = _ref.key,\n event = _ref.event;\n _onEdit === null || _onEdit === void 0 ? void 0 : _onEdit(editType === 'add' ? event : key, editType);\n },\n removeIcon: /*#__PURE__*/React.createElement(CloseOutlined, null),\n addIcon: addIcon || /*#__PURE__*/React.createElement(PlusOutlined, null),\n showAdd: hideAdd !== true\n };\n }\n var rootPrefixCls = getPrefixCls();\n process.env.NODE_ENV !== \"production\" ? warning(!('onPrevClick' in props) && !('onNextClick' in props), 'Tabs', '`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.') : void 0;\n var mergedItems = useLegacyItems(items, children);\n var mergedAnimated = useAnimateConfig(prefixCls, animated);\n return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (contextSize) {\n var size = propSize !== undefined ? propSize : contextSize;\n return /*#__PURE__*/React.createElement(RcTabs, _extends({\n direction: direction,\n getPopupContainer: getPopupContainer,\n moreTransitionName: \"\".concat(rootPrefixCls, \"-slide-up\")\n }, props, {\n items: mergedItems,\n className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size), size), \"\".concat(prefixCls, \"-card\"), ['card', 'editable-card'].includes(type)), \"\".concat(prefixCls, \"-editable-card\"), type === 'editable-card'), \"\".concat(prefixCls, \"-centered\"), centered), className),\n editable: editable,\n moreIcon: moreIcon,\n prefixCls: prefixCls,\n animated: mergedAnimated\n }));\n });\n}\nTabs.TabPane = TabPane;\nexport default Tabs;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nvar CheckableTag = function CheckableTag(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n checked = _a.checked,\n onChange = _a.onChange,\n onClick = _a.onClick,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"checked\", \"onChange\", \"onClick\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var handleClick = function handleClick(e) {\n onChange === null || onChange === void 0 ? void 0 : onChange(!checked);\n onClick === null || onClick === void 0 ? void 0 : onClick(e);\n };\n var prefixCls = getPrefixCls('tag', customizePrefixCls);\n var cls = classNames(prefixCls, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-checkable\"), true), \"\".concat(prefixCls, \"-checkable-checked\"), checked), className);\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, restProps, {\n className: cls,\n onClick: handleClick\n }));\n};\nexport default CheckableTag;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes, PresetStatusColorTypes } from '../_util/colors';\nimport Wave from '../_util/wave';\nimport warning from '../_util/warning';\nimport CheckableTag from './CheckableTag';\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\"));\nvar PresetStatusColorRegex = new RegExp(\"^(\".concat(PresetStatusColorTypes.join('|'), \")$\"));\nvar InternalTag = function InternalTag(_a, ref) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n style = _a.style,\n children = _a.children,\n icon = _a.icon,\n color = _a.color,\n onClose = _a.onClose,\n closeIcon = _a.closeIcon,\n _a$closable = _a.closable,\n closable = _a$closable === void 0 ? false : _a$closable,\n props = __rest(_a, [\"prefixCls\", \"className\", \"style\", \"children\", \"icon\", \"color\", \"onClose\", \"closeIcon\", \"closable\"]);\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n // Warning for deprecated usage\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? warning(!('visible' in props), 'Tag', '`visible` will be removed in next major version, please use `visible && ` instead.') : void 0;\n }\n React.useEffect(function () {\n if ('visible' in props) {\n setVisible(props.visible);\n }\n }, [props.visible]);\n var isPresetColor = function isPresetColor() {\n if (!color) {\n return false;\n }\n return PresetColorRegex.test(color) || PresetStatusColorRegex.test(color);\n };\n var tagStyle = _extends({\n backgroundColor: color && !isPresetColor() ? color : undefined\n }, style);\n var presetColor = isPresetColor();\n var prefixCls = getPrefixCls('tag', customizePrefixCls);\n var tagClassName = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-\").concat(color), presetColor), \"\".concat(prefixCls, \"-has-color\"), color && !presetColor), \"\".concat(prefixCls, \"-hidden\"), !visible), \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n var handleCloseClick = function handleCloseClick(e) {\n e.stopPropagation();\n onClose === null || onClose === void 0 ? void 0 : onClose(e);\n if (e.defaultPrevented) {\n return;\n }\n if (!('visible' in props)) {\n setVisible(false);\n }\n };\n var renderCloseIcon = function renderCloseIcon() {\n if (closable) {\n return closeIcon ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n }, closeIcon)) : ( /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n onClick: handleCloseClick\n }));\n }\n return null;\n };\n var isNeedWave = 'onClick' in props || children && children.type === 'a';\n var tagProps = omit(props, ['visible']);\n var iconNode = icon || null;\n var kids = iconNode ? ( /*#__PURE__*/React.createElement(React.Fragment, null, iconNode, /*#__PURE__*/React.createElement(\"span\", null, children))) : children;\n var tagNode = /*#__PURE__*/React.createElement(\"span\", _extends({}, tagProps, {\n ref: ref,\n className: tagClassName,\n style: tagStyle\n }), kids, renderCloseIcon());\n return isNeedWave ? /*#__PURE__*/React.createElement(Wave, null, tagNode) : tagNode;\n};\nvar Tag = /*#__PURE__*/React.forwardRef(InternalTag);\nif (process.env.NODE_ENV !== 'production') {\n Tag.displayName = 'Tag';\n}\nTag.CheckableTag = CheckableTag;\nexport default Tag;","var locale = {\n placeholder: 'Select time',\n rangePlaceholder: ['Start time', 'End time']\n};\nexport default locale;","import * as React from 'react';\nimport classNames from 'classnames';\nexport default function Popup(props) {\n var showArrow = props.showArrow,\n arrowContent = props.arrowContent,\n children = props.children,\n prefixCls = props.prefixCls,\n id = props.id,\n overlayInnerStyle = props.overlayInnerStyle,\n className = props.className,\n style = props.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-content\"), className),\n style: style\n }, showArrow !== false && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-arrow\"),\n key: \"arrow\"\n }, arrowContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner\"),\n id: id,\n role: \"tooltip\",\n style: overlayInnerStyle\n }, typeof children === 'function' ? children() : children));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { useRef, useImperativeHandle, forwardRef } from 'react';\nimport Trigger from 'rc-trigger';\nimport { placements } from './placements';\nimport Popup from './Popup';\n\nvar Tooltip = function Tooltip(props, ref) {\n var overlayClassName = props.overlayClassName,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,\n _props$mouseEnterDela = props.mouseEnterDelay,\n mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n overlayStyle = props.overlayStyle,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,\n children = props.children,\n onVisibleChange = props.onVisibleChange,\n afterVisibleChange = props.afterVisibleChange,\n transitionName = props.transitionName,\n animation = props.animation,\n motion = props.motion,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'right' : _props$placement,\n _props$align = props.align,\n align = _props$align === void 0 ? {} : _props$align,\n _props$destroyTooltip = props.destroyTooltipOnHide,\n destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,\n defaultVisible = props.defaultVisible,\n getTooltipContainer = props.getTooltipContainer,\n overlayInnerStyle = props.overlayInnerStyle,\n arrowContent = props.arrowContent,\n overlay = props.overlay,\n id = props.id,\n showArrow = props.showArrow,\n restProps = _objectWithoutProperties(props, [\"overlayClassName\", \"trigger\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"overlayStyle\", \"prefixCls\", \"children\", \"onVisibleChange\", \"afterVisibleChange\", \"transitionName\", \"animation\", \"motion\", \"placement\", \"align\", \"destroyTooltipOnHide\", \"defaultVisible\", \"getTooltipContainer\", \"overlayInnerStyle\", \"arrowContent\", \"overlay\", \"id\", \"showArrow\"]);\n\n var domRef = useRef(null);\n useImperativeHandle(ref, function () {\n return domRef.current;\n });\n\n var extraProps = _objectSpread({}, restProps);\n\n if ('visible' in props) {\n extraProps.popupVisible = props.visible;\n }\n\n var getPopupElement = function getPopupElement() {\n return /*#__PURE__*/React.createElement(Popup, {\n showArrow: showArrow,\n arrowContent: arrowContent,\n key: \"content\",\n prefixCls: prefixCls,\n id: id,\n overlayInnerStyle: overlayInnerStyle\n }, overlay);\n };\n\n var destroyTooltip = false;\n var autoDestroy = false;\n\n if (typeof destroyTooltipOnHide === 'boolean') {\n destroyTooltip = destroyTooltipOnHide;\n } else if (destroyTooltipOnHide && _typeof(destroyTooltipOnHide) === 'object') {\n var keepParent = destroyTooltipOnHide.keepParent;\n destroyTooltip = keepParent === true;\n autoDestroy = keepParent === false;\n }\n\n return /*#__PURE__*/React.createElement(Trigger, _extends({\n popupClassName: overlayClassName,\n prefixCls: prefixCls,\n popup: getPopupElement,\n action: trigger,\n builtinPlacements: placements,\n popupPlacement: placement,\n ref: domRef,\n popupAlign: align,\n getPopupContainer: getTooltipContainer,\n onPopupVisibleChange: onVisibleChange,\n afterPopupVisibleChange: afterVisibleChange,\n popupTransitionName: transitionName,\n popupAnimation: animation,\n popupMotion: motion,\n defaultPopupVisible: defaultVisible,\n destroyPopupOnHide: destroyTooltip,\n autoDestroy: autoDestroy,\n mouseLeaveDelay: mouseLeaveDelay,\n popupStyle: overlayStyle,\n mouseEnterDelay: mouseEnterDelay\n }, extraProps), children);\n};\n\nexport default /*#__PURE__*/forwardRef(Tooltip);","import Tooltip from './Tooltip';\nimport Popup from './Popup';\nexport { Popup };\nexport default Tooltip;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport classNames from 'classnames';\nimport RcTooltip from 'rc-tooltip';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes } from '../_util/colors';\nimport { getTransitionName } from '../_util/motion';\nimport getPlacements from '../_util/placements';\nimport { cloneElement, isValidElement, isFragment } from '../_util/reactNode';\nimport warning from '../_util/warning';\nvar splitObject = function splitObject(obj, keys) {\n var picked = {};\n var omitted = _extends({}, obj);\n keys.forEach(function (key) {\n if (obj && key in obj) {\n picked[key] = obj[key];\n delete omitted[key];\n }\n });\n return {\n picked: picked,\n omitted: omitted\n };\n};\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\"));\n// Fix Tooltip won't hide at disabled button\n// mouse events don't trigger at disabled button in Chrome\n// https://github.com/react-component/tooltip/issues/18\nfunction getDisabledCompatibleChildren(element, prefixCls) {\n var elementType = element.type;\n if ((elementType.__ANT_BUTTON === true || element.type === 'button') && element.props.disabled || elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading) || elementType.__ANT_RADIO === true && element.props.disabled) {\n // Pick some layout related style properties up to span\n // Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254\n var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),\n picked = _splitObject.picked,\n omitted = _splitObject.omitted;\n var spanStyle = _extends(_extends({\n display: 'inline-block'\n }, picked), {\n cursor: 'not-allowed',\n width: element.props.block ? '100%' : undefined\n });\n var buttonStyle = _extends(_extends({}, omitted), {\n pointerEvents: 'none'\n });\n var child = cloneElement(element, {\n style: buttonStyle,\n className: null\n });\n return /*#__PURE__*/React.createElement(\"span\", {\n style: spanStyle,\n className: classNames(element.props.className, \"\".concat(prefixCls, \"-disabled-compatible-wrapper\"))\n }, child);\n }\n return element;\n}\nvar Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n // Warning for deprecated usage\n if (process.env.NODE_ENV !== 'production') {\n [['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange']].forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n deprecatedName = _ref2[0],\n newName = _ref2[1];\n process.env.NODE_ENV !== \"production\" ? warning(!(deprecatedName in props), 'Tooltip', \"`\".concat(deprecatedName, \"` is deprecated which will be removed in next major version, please use `\").concat(newName, \"` instead.\")) : void 0;\n });\n }\n var _useMergedState = useMergedState(false, {\n value: props.open !== undefined ? props.open : props.visible,\n defaultValue: props.defaultOpen !== undefined ? props.defaultOpen : props.defaultVisible\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n open = _useMergedState2[0],\n setOpen = _useMergedState2[1];\n var isNoTitle = function isNoTitle() {\n var title = props.title,\n overlay = props.overlay;\n return !title && !overlay && title !== 0; // overlay for old version compatibility\n };\n var onOpenChange = function onOpenChange(vis) {\n var _a, _b;\n setOpen(isNoTitle() ? false : vis);\n if (!isNoTitle()) {\n (_a = props.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(props, vis);\n (_b = props.onVisibleChange) === null || _b === void 0 ? void 0 : _b.call(props, vis);\n }\n };\n var getTooltipPlacements = function getTooltipPlacements() {\n var builtinPlacements = props.builtinPlacements,\n _props$arrowPointAtCe = props.arrowPointAtCenter,\n arrowPointAtCenter = _props$arrowPointAtCe === void 0 ? false : _props$arrowPointAtCe,\n _props$autoAdjustOver = props.autoAdjustOverflow,\n autoAdjustOverflow = _props$autoAdjustOver === void 0 ? true : _props$autoAdjustOver;\n return builtinPlacements || getPlacements({\n arrowPointAtCenter: arrowPointAtCenter,\n autoAdjustOverflow: autoAdjustOverflow\n });\n };\n // 动态设置动画点\n var onPopupAlign = function onPopupAlign(domNode, align) {\n var placements = getTooltipPlacements();\n // 当前返回的位置\n var placement = Object.keys(placements).find(function (key) {\n var _a, _b;\n return placements[key].points[0] === ((_a = align.points) === null || _a === void 0 ? void 0 : _a[0]) && placements[key].points[1] === ((_b = align.points) === null || _b === void 0 ? void 0 : _b[1]);\n });\n if (!placement) {\n return;\n }\n // 根据当前坐标设置动画点\n var rect = domNode.getBoundingClientRect();\n var transformOrigin = {\n top: '50%',\n left: '50%'\n };\n if (/top|Bottom/.test(placement)) {\n transformOrigin.top = \"\".concat(rect.height - align.offset[1], \"px\");\n } else if (/Top|bottom/.test(placement)) {\n transformOrigin.top = \"\".concat(-align.offset[1], \"px\");\n }\n if (/left|Right/.test(placement)) {\n transformOrigin.left = \"\".concat(rect.width - align.offset[0], \"px\");\n } else if (/right|Left/.test(placement)) {\n transformOrigin.left = \"\".concat(-align.offset[0], \"px\");\n }\n domNode.style.transformOrigin = \"\".concat(transformOrigin.left, \" \").concat(transformOrigin.top);\n };\n var getOverlay = function getOverlay() {\n var title = props.title,\n overlay = props.overlay;\n if (title === 0) {\n return title;\n }\n return overlay || title || '';\n };\n var getPopupContainer = props.getPopupContainer,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'top' : _props$placement,\n _props$mouseEnterDela = props.mouseEnterDelay,\n mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n otherProps = __rest(props, [\"getPopupContainer\", \"placement\", \"mouseEnterDelay\", \"mouseLeaveDelay\"]);\n var customizePrefixCls = props.prefixCls,\n openClassName = props.openClassName,\n getTooltipContainer = props.getTooltipContainer,\n overlayClassName = props.overlayClassName,\n color = props.color,\n overlayInnerStyle = props.overlayInnerStyle,\n children = props.children;\n var prefixCls = getPrefixCls('tooltip', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var tempOpen = open;\n // Hide tooltip when there is no title\n if (!('open' in props) && !('visible' in props) && isNoTitle()) {\n tempOpen = false;\n }\n var child = getDisabledCompatibleChildren(isValidElement(children) && !isFragment(children) ? children : /*#__PURE__*/React.createElement(\"span\", null, children), prefixCls);\n var childProps = child.props;\n var childCls = !childProps.className || typeof childProps.className === 'string' ? classNames(childProps.className, _defineProperty({}, openClassName || \"\".concat(prefixCls, \"-open\"), true)) : childProps.className;\n var customOverlayClassName = classNames(overlayClassName, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(prefixCls, \"-\").concat(color), color && PresetColorRegex.test(color)));\n var formattedOverlayInnerStyle = overlayInnerStyle;\n var arrowContentStyle = {};\n if (color && !PresetColorRegex.test(color)) {\n formattedOverlayInnerStyle = _extends(_extends({}, overlayInnerStyle), {\n background: color\n });\n // @ts-ignore\n arrowContentStyle = {\n '--antd-arrow-background-color': color\n };\n }\n return /*#__PURE__*/React.createElement(RcTooltip, _extends({}, otherProps, {\n placement: placement,\n mouseEnterDelay: mouseEnterDelay,\n mouseLeaveDelay: mouseLeaveDelay,\n prefixCls: prefixCls,\n overlayClassName: customOverlayClassName,\n getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,\n ref: ref,\n builtinPlacements: getTooltipPlacements(),\n overlay: getOverlay(),\n visible: tempOpen,\n onVisibleChange: onOpenChange,\n onPopupAlign: onPopupAlign,\n overlayInnerStyle: formattedOverlayInnerStyle,\n arrowContent: /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-arrow-content\"),\n style: arrowContentStyle\n }),\n motion: {\n motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),\n motionDeadline: 1000\n }\n }), tempOpen ? cloneElement(child, {\n className: childCls\n }) : child);\n});\nif (process.env.NODE_ENV !== 'production') {\n Tooltip.displayName = 'Tooltip';\n}\nexport default Tooltip;","// This icon file is generated automatically.\nvar CaretDownFilled = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z\" } }] }, \"name\": \"caret-down\", \"theme\": \"filled\" };\nexport default CaretDownFilled;\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 CaretDownFilledSvg from \"@ant-design/icons-svg/es/asn/CaretDownFilled\";\nimport AntdIcon from '../components/AntdIcon';\nvar CaretDownFilled = function CaretDownFilled(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: CaretDownFilledSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(CaretDownFilled);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'CaretDownFilled';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar MinusSquareOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" } }] }, \"name\": \"minus-square\", \"theme\": \"outlined\" };\nexport default MinusSquareOutlined;\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 MinusSquareOutlinedSvg from \"@ant-design/icons-svg/es/asn/MinusSquareOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar MinusSquareOutlined = function MinusSquareOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: MinusSquareOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(MinusSquareOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'MinusSquareOutlined';\n}\nexport default RefIcon;","// This icon file is generated automatically.\nvar PlusSquareOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" } }] }, \"name\": \"plus-square\", \"theme\": \"outlined\" };\nexport default PlusSquareOutlined;\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 PlusSquareOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlusSquareOutlined\";\nimport AntdIcon from '../components/AntdIcon';\nvar PlusSquareOutlined = function PlusSquareOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread(_objectSpread({}, props), {}, {\n ref: ref,\n icon: PlusSquareOutlinedSvg\n }));\n};\nvar RefIcon = /*#__PURE__*/React.forwardRef(PlusSquareOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'PlusSquareOutlined';\n}\nexport default RefIcon;","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport CaretDownFilled from \"@ant-design/icons/es/icons/CaretDownFilled\";\nimport FileOutlined from \"@ant-design/icons/es/icons/FileOutlined\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport MinusSquareOutlined from \"@ant-design/icons/es/icons/MinusSquareOutlined\";\nimport PlusSquareOutlined from \"@ant-design/icons/es/icons/PlusSquareOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { cloneElement, isValidElement } from '../../_util/reactNode';\nexport default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, treeNodeProps) {\n var isLeaf = treeNodeProps.isLeaf,\n expanded = treeNodeProps.expanded,\n loading = treeNodeProps.loading;\n if (loading) {\n return /*#__PURE__*/React.createElement(LoadingOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-loading-icon\")\n });\n }\n var showLeafIcon;\n if (showLine && _typeof(showLine) === 'object') {\n showLeafIcon = showLine.showLeafIcon;\n }\n if (isLeaf) {\n if (!showLine) {\n return null;\n }\n if (typeof showLeafIcon !== 'boolean' && !!showLeafIcon) {\n var leafIcon = typeof showLeafIcon === 'function' ? showLeafIcon(treeNodeProps) : showLeafIcon;\n var leafCls = \"\".concat(prefixCls, \"-switcher-line-custom-icon\");\n if (isValidElement(leafIcon)) {\n return cloneElement(leafIcon, {\n className: classNames(leafIcon.props.className || '', leafCls)\n });\n }\n return leafIcon;\n }\n return showLeafIcon ? ( /*#__PURE__*/React.createElement(FileOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n })) : ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-switcher-leaf-line\")\n }));\n }\n var switcherCls = \"\".concat(prefixCls, \"-switcher-icon\");\n var switcher = typeof switcherIcon === 'function' ? switcherIcon(treeNodeProps) : switcherIcon;\n if (isValidElement(switcher)) {\n return cloneElement(switcher, {\n className: classNames(switcher.props.className || '', switcherCls)\n });\n }\n if (switcher) {\n return switcher;\n }\n if (showLine) {\n return expanded ? ( /*#__PURE__*/React.createElement(MinusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n })) : ( /*#__PURE__*/React.createElement(PlusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n }));\n }\n return /*#__PURE__*/React.createElement(CaretDownFilled, {\n className: switcherCls\n });\n}","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nexports.noop = noop;\nObject.defineProperty(exports, \"resetWarned\", {\n enumerable: true,\n get: function get() {\n return _warning.resetWarned;\n }\n});\nvar _warning = _interopRequireWildcard(require(\"rc-util/lib/warning\"));\nfunction noop() {}\n// eslint-disable-next-line import/no-mutable-exports\nvar warning = noop;\nif (process.env.NODE_ENV !== 'production') {\n warning = function warning(valid, component, message) {\n (0, _warning[\"default\"])(valid, \"[antd: \".concat(component, \"] \").concat(message));\n // StrictMode will inject console which will not throw warning in React 17.\n if (process.env.NODE_ENV === 'test') {\n (0, _warning.resetWarned)();\n }\n };\n}\nvar _default = exports[\"default\"] = warning;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _en_US = _interopRequireDefault(require(\"../../date-picker/locale/en_US\"));\nvar _default = exports[\"default\"] = _en_US[\"default\"];","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.DisabledContextProvider = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar DisabledContext = /*#__PURE__*/React.createContext(false);\nvar DisabledContextProvider = exports.DisabledContextProvider = function DisabledContextProvider(_ref) {\n var children = _ref.children,\n disabled = _ref.disabled;\n var originDisabled = React.useContext(DisabledContext);\n return /*#__PURE__*/React.createElement(DisabledContext.Provider, {\n value: disabled !== null && disabled !== void 0 ? disabled : originDisabled\n }, children);\n};\nvar _default = exports[\"default\"] = DisabledContext;","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.SizeContextProvider = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar SizeContext = /*#__PURE__*/React.createContext(undefined);\nvar SizeContextProvider = exports.SizeContextProvider = function SizeContextProvider(_ref) {\n var children = _ref.children,\n size = _ref.size;\n return /*#__PURE__*/React.createElement(SizeContext.Consumer, null, function (originSize) {\n return /*#__PURE__*/React.createElement(SizeContext.Provider, {\n value: size || originSize\n }, children);\n });\n};\nvar _default = exports[\"default\"] = SizeContext;","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConfigContext = exports.ConfigConsumer = void 0;\nexports.withConfigConsumer = withConfigConsumer;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar defaultGetPrefixCls = function defaultGetPrefixCls(suffixCls, customizePrefixCls) {\n if (customizePrefixCls) return customizePrefixCls;\n return suffixCls ? \"ant-\".concat(suffixCls) : 'ant';\n};\n// zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will case circular dependency.\nvar ConfigContext = exports.ConfigContext = /*#__PURE__*/React.createContext({\n // We provide a default function for Context without provider\n getPrefixCls: defaultGetPrefixCls\n});\nvar ConfigConsumer = exports.ConfigConsumer = ConfigContext.Consumer;\n/** @deprecated Use hooks instead. This is a legacy function */\nfunction withConfigConsumer(config) {\n return function withConfigConsumerFunc(Component) {\n // Wrap with ConfigConsumer. Since we need compatible with react 15, be care when using ref methods\n var SFC = function SFC(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {\n var basicPrefixCls = config.prefixCls;\n var getPrefixCls = configProps.getPrefixCls;\n var customizePrefixCls = props.prefixCls;\n var prefixCls = getPrefixCls(basicPrefixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(Component, (0, _extends2[\"default\"])({}, configProps, props, {\n prefixCls: prefixCls\n }));\n });\n };\n var cons = Component.constructor;\n var name = cons && cons.displayName || Component.name || 'Component';\n if (process.env.NODE_ENV !== 'production') {\n SFC.displayName = \"withConfigConsumer(\".concat(name, \")\");\n }\n return SFC;\n };\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getStyle = getStyle;\nexports.registerTheme = registerTheme;\nvar _colors = require(\"@ant-design/colors\");\nvar _tinycolor = require(\"@ctrl/tinycolor\");\nvar _canUseDom = _interopRequireDefault(require(\"rc-util/lib/Dom/canUseDom\"));\nvar _dynamicCSS = require(\"rc-util/lib/Dom/dynamicCSS\");\nvar _warning = _interopRequireDefault(require(\"../_util/warning\"));\n/* eslint-disable import/prefer-default-export, prefer-destructuring */\n\nvar dynamicStyleMark = \"-ant-\".concat(Date.now(), \"-\").concat(Math.random());\nfunction getStyle(globalPrefixCls, theme) {\n var variables = {};\n var formatColor = function formatColor(color, updater) {\n var clone = color.clone();\n clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;\n return clone.toRgbString();\n };\n var fillColor = function fillColor(colorVal, type) {\n var baseColor = new _tinycolor.TinyColor(colorVal);\n var colorPalettes = (0, _colors.generate)(baseColor.toRgbString());\n variables[\"\".concat(type, \"-color\")] = formatColor(baseColor);\n variables[\"\".concat(type, \"-color-disabled\")] = colorPalettes[1];\n variables[\"\".concat(type, \"-color-hover\")] = colorPalettes[4];\n variables[\"\".concat(type, \"-color-active\")] = colorPalettes[6];\n variables[\"\".concat(type, \"-color-outline\")] = baseColor.clone().setAlpha(0.2).toRgbString();\n variables[\"\".concat(type, \"-color-deprecated-bg\")] = colorPalettes[0];\n variables[\"\".concat(type, \"-color-deprecated-border\")] = colorPalettes[2];\n };\n // ================ Primary Color ================\n if (theme.primaryColor) {\n fillColor(theme.primaryColor, 'primary');\n var primaryColor = new _tinycolor.TinyColor(theme.primaryColor);\n var primaryColors = (0, _colors.generate)(primaryColor.toRgbString());\n // Legacy - We should use semantic naming standard\n primaryColors.forEach(function (color, index) {\n variables[\"primary-\".concat(index + 1)] = color;\n });\n // Deprecated\n variables['primary-color-deprecated-l-35'] = formatColor(primaryColor, function (c) {\n return c.lighten(35);\n });\n variables['primary-color-deprecated-l-20'] = formatColor(primaryColor, function (c) {\n return c.lighten(20);\n });\n variables['primary-color-deprecated-t-20'] = formatColor(primaryColor, function (c) {\n return c.tint(20);\n });\n variables['primary-color-deprecated-t-50'] = formatColor(primaryColor, function (c) {\n return c.tint(50);\n });\n variables['primary-color-deprecated-f-12'] = formatColor(primaryColor, function (c) {\n return c.setAlpha(c.getAlpha() * 0.12);\n });\n var primaryActiveColor = new _tinycolor.TinyColor(primaryColors[0]);\n variables['primary-color-active-deprecated-f-30'] = formatColor(primaryActiveColor, function (c) {\n return c.setAlpha(c.getAlpha() * 0.3);\n });\n variables['primary-color-active-deprecated-d-02'] = formatColor(primaryActiveColor, function (c) {\n return c.darken(2);\n });\n }\n // ================ Success Color ================\n if (theme.successColor) {\n fillColor(theme.successColor, 'success');\n }\n // ================ Warning Color ================\n if (theme.warningColor) {\n fillColor(theme.warningColor, 'warning');\n }\n // ================= Error Color =================\n if (theme.errorColor) {\n fillColor(theme.errorColor, 'error');\n }\n // ================= Info Color ==================\n if (theme.infoColor) {\n fillColor(theme.infoColor, 'info');\n }\n // Convert to css variables\n var cssList = Object.keys(variables).map(function (key) {\n return \"--\".concat(globalPrefixCls, \"-\").concat(key, \": \").concat(variables[key], \";\");\n });\n return \"\\n :root {\\n \".concat(cssList.join('\\n'), \"\\n }\\n \").trim();\n}\nfunction registerTheme(globalPrefixCls, theme) {\n var style = getStyle(globalPrefixCls, theme);\n if ((0, _canUseDom[\"default\"])()) {\n (0, _dynamicCSS.updateCSS)(style, \"\".concat(dynamicStyleMark, \"-dynamic-theme\"));\n } else {\n process.env.NODE_ENV !== \"production\" ? (0, _warning[\"default\"])(false, 'ConfigProvider', 'SSR do not support dynamic theme with css variables.') : void 0;\n }\n}","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"ConfigConsumer\", {\n enumerable: true,\n get: function get() {\n return _context.ConfigConsumer;\n }\n});\nObject.defineProperty(exports, \"ConfigContext\", {\n enumerable: true,\n get: function get() {\n return _context.ConfigContext;\n }\n});\nexports.globalConfig = exports.defaultPrefixCls = exports.defaultIconPrefixCls = exports[\"default\"] = exports.configConsumerProps = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _Context = _interopRequireDefault(require(\"@ant-design/icons/lib/components/Context\"));\nvar _useMemo = _interopRequireDefault(require(\"rc-util/lib/hooks/useMemo\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _set = require(\"rc-util/lib/utils/set\");\nvar _validateMessagesContext = _interopRequireDefault(require(\"../form/validateMessagesContext\"));\nvar _localeProvider = _interopRequireWildcard(require(\"../locale-provider\"));\nvar _LocaleReceiver = _interopRequireDefault(require(\"../locale-provider/LocaleReceiver\"));\nvar _default2 = _interopRequireDefault(require(\"../locale/default\"));\nvar _message = _interopRequireDefault(require(\"../message\"));\nvar _notification = _interopRequireDefault(require(\"../notification\"));\nvar _context = require(\"./context\");\nvar _cssVariables = require(\"./cssVariables\");\nvar _DisabledContext = require(\"./DisabledContext\");\nvar _SizeContext = _interopRequireWildcard(require(\"./SizeContext\"));\nvar configConsumerProps = exports.configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale', 'pageHeader'];\n// These props is used by `useContext` directly in sub component\nvar PASSED_PROPS = ['getTargetContainer', 'getPopupContainer', 'renderEmpty', 'pageHeader', 'input', 'pagination', 'form'];\nvar defaultPrefixCls = exports.defaultPrefixCls = 'ant';\nvar defaultIconPrefixCls = exports.defaultIconPrefixCls = 'anticon';\nvar globalPrefixCls;\nvar globalIconPrefixCls;\nfunction getGlobalPrefixCls() {\n return globalPrefixCls || defaultPrefixCls;\n}\nfunction getGlobalIconPrefixCls() {\n return globalIconPrefixCls || defaultIconPrefixCls;\n}\nvar setGlobalConfig = function setGlobalConfig(_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n theme = _ref.theme;\n if (prefixCls !== undefined) {\n globalPrefixCls = prefixCls;\n }\n if (iconPrefixCls !== undefined) {\n globalIconPrefixCls = iconPrefixCls;\n }\n if (theme) {\n (0, _cssVariables.registerTheme)(getGlobalPrefixCls(), theme);\n }\n};\nvar globalConfig = exports.globalConfig = function globalConfig() {\n return {\n getPrefixCls: function getPrefixCls(suffixCls, customizePrefixCls) {\n if (customizePrefixCls) return customizePrefixCls;\n return suffixCls ? \"\".concat(getGlobalPrefixCls(), \"-\").concat(suffixCls) : getGlobalPrefixCls();\n },\n getIconPrefixCls: getGlobalIconPrefixCls,\n getRootPrefixCls: function getRootPrefixCls(rootPrefixCls, customizePrefixCls) {\n // Customize rootPrefixCls is first priority\n if (rootPrefixCls) {\n return rootPrefixCls;\n }\n // If Global prefixCls provided, use this\n if (globalPrefixCls) {\n return globalPrefixCls;\n }\n // [Legacy] If customize prefixCls provided, we cut it to get the prefixCls\n if (customizePrefixCls && customizePrefixCls.includes('-')) {\n return customizePrefixCls.replace(/^(.*)-[^-]*$/, '$1');\n }\n // Fallback to default prefixCls\n return getGlobalPrefixCls();\n }\n };\n};\nvar ProviderChildren = function ProviderChildren(props) {\n var children = props.children,\n csp = props.csp,\n autoInsertSpaceInButton = props.autoInsertSpaceInButton,\n form = props.form,\n locale = props.locale,\n componentSize = props.componentSize,\n direction = props.direction,\n space = props.space,\n virtual = props.virtual,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,\n legacyLocale = props.legacyLocale,\n parentContext = props.parentContext,\n iconPrefixCls = props.iconPrefixCls,\n componentDisabled = props.componentDisabled;\n var getPrefixCls = React.useCallback(function (suffixCls, customizePrefixCls) {\n var prefixCls = props.prefixCls;\n if (customizePrefixCls) return customizePrefixCls;\n var mergedPrefixCls = prefixCls || parentContext.getPrefixCls('');\n return suffixCls ? \"\".concat(mergedPrefixCls, \"-\").concat(suffixCls) : mergedPrefixCls;\n }, [parentContext.getPrefixCls, props.prefixCls]);\n var config = (0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, parentContext), {\n csp: csp,\n autoInsertSpaceInButton: autoInsertSpaceInButton,\n locale: locale || legacyLocale,\n direction: direction,\n space: space,\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth,\n getPrefixCls: getPrefixCls\n });\n // Pass the props used by `useContext` directly with child component.\n // These props should merged into `config`.\n PASSED_PROPS.forEach(function (propName) {\n var propValue = props[propName];\n if (propValue) {\n config[propName] = propValue;\n }\n });\n // https://github.com/ant-design/ant-design/issues/27617\n var memoedConfig = (0, _useMemo[\"default\"])(function () {\n return config;\n }, config, function (prevConfig, currentConfig) {\n var prevKeys = Object.keys(prevConfig);\n var currentKeys = Object.keys(currentConfig);\n return prevKeys.length !== currentKeys.length || prevKeys.some(function (key) {\n return prevConfig[key] !== currentConfig[key];\n });\n });\n var memoIconContextValue = React.useMemo(function () {\n return {\n prefixCls: iconPrefixCls,\n csp: csp\n };\n }, [iconPrefixCls, csp]);\n var childNode = children;\n var validateMessages = React.useMemo(function () {\n var _a, _b, _c, _d;\n return (0, _set.merge)(((_a = _default2[\"default\"].Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || {}, ((_c = (_b = memoedConfig.locale) === null || _b === void 0 ? void 0 : _b.Form) === null || _c === void 0 ? void 0 : _c.defaultValidateMessages) || {}, ((_d = memoedConfig.form) === null || _d === void 0 ? void 0 : _d.validateMessages) || {}, (form === null || form === void 0 ? void 0 : form.validateMessages) || {});\n }, [memoedConfig, form === null || form === void 0 ? void 0 : form.validateMessages]);\n if (Object.keys(validateMessages).length > 0) {\n childNode = /*#__PURE__*/React.createElement(_validateMessagesContext[\"default\"].Provider, {\n value: validateMessages\n }, children);\n }\n if (locale) {\n childNode = /*#__PURE__*/React.createElement(_localeProvider[\"default\"], {\n locale: locale,\n _ANT_MARK__: _localeProvider.ANT_MARK\n }, childNode);\n }\n if (iconPrefixCls || csp) {\n childNode = /*#__PURE__*/React.createElement(_Context[\"default\"].Provider, {\n value: memoIconContextValue\n }, childNode);\n }\n if (componentSize) {\n childNode = /*#__PURE__*/React.createElement(_SizeContext.SizeContextProvider, {\n size: componentSize\n }, childNode);\n }\n if (componentDisabled !== undefined) {\n childNode = /*#__PURE__*/React.createElement(_DisabledContext.DisabledContextProvider, {\n disabled: componentDisabled\n }, childNode);\n }\n return /*#__PURE__*/React.createElement(_context.ConfigContext.Provider, {\n value: memoedConfig\n }, childNode);\n};\nvar ConfigProvider = function ConfigProvider(props) {\n React.useEffect(function () {\n if (props.direction) {\n _message[\"default\"].config({\n rtl: props.direction === 'rtl'\n });\n _notification[\"default\"].config({\n rtl: props.direction === 'rtl'\n });\n }\n }, [props.direction]);\n return /*#__PURE__*/React.createElement(_LocaleReceiver[\"default\"], null, function (_, __, legacyLocale) {\n return /*#__PURE__*/React.createElement(_context.ConfigConsumer, null, function (context) {\n return /*#__PURE__*/React.createElement(ProviderChildren, (0, _extends2[\"default\"])({\n parentContext: context,\n legacyLocale: legacyLocale\n }, props));\n });\n });\n};\n/** @private internal Usage. do not use in your production */\nConfigProvider.ConfigContext = _context.ConfigContext;\nConfigProvider.SizeContext = _SizeContext[\"default\"];\nConfigProvider.config = setGlobalConfig;\nvar _default = exports[\"default\"] = ConfigProvider;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _en_US = _interopRequireDefault(require(\"rc-picker/lib/locale/en_US\"));\nvar _en_US2 = _interopRequireDefault(require(\"../../time-picker/locale/en_US\"));\n// Merge into a locale object\nvar locale = {\n lang: (0, _extends2[\"default\"])({\n placeholder: 'Select date',\n yearPlaceholder: 'Select year',\n quarterPlaceholder: 'Select quarter',\n monthPlaceholder: 'Select month',\n weekPlaceholder: 'Select week',\n rangePlaceholder: ['Start date', 'End date'],\n rangeYearPlaceholder: ['Start year', 'End year'],\n rangeQuarterPlaceholder: ['Start quarter', 'End quarter'],\n rangeMonthPlaceholder: ['Start month', 'End month'],\n rangeWeekPlaceholder: ['Start week', 'End week']\n }, _en_US[\"default\"]),\n timePickerLocale: (0, _extends2[\"default\"])({}, _en_US2[\"default\"])\n};\n// All settings at:\n// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json\nvar _default = exports[\"default\"] = locale;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _react = require(\"react\");\n// ZombieJ: We export single file here since\n// ConfigProvider use this which will make loop deps\n// to import whole `rc-field-form`\nvar _default = exports[\"default\"] = /*#__PURE__*/(0, _react.createContext)(undefined);","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.useLocaleReceiver = exports[\"default\"] = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _context = _interopRequireDefault(require(\"./context\"));\nvar _default2 = _interopRequireDefault(require(\"./default\"));\nvar LocaleReceiver = function LocaleReceiver(props) {\n var _props$componentName = props.componentName,\n componentName = _props$componentName === void 0 ? 'global' : _props$componentName,\n defaultLocale = props.defaultLocale,\n children = props.children;\n var antLocale = React.useContext(_context[\"default\"]);\n var getLocale = React.useMemo(function () {\n var _a;\n var locale = defaultLocale || _default2[\"default\"][componentName];\n var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n return (0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, locale instanceof Function ? locale() : locale), localeFromContext || {});\n }, [componentName, defaultLocale, antLocale]);\n var getLocaleCode = React.useMemo(function () {\n var localeCode = antLocale && antLocale.locale;\n // Had use LocaleProvide but didn't set locale\n if (antLocale && antLocale.exist && !localeCode) {\n return _default2[\"default\"].locale;\n }\n return localeCode;\n }, [antLocale]);\n return children(getLocale, getLocaleCode, antLocale);\n};\nvar _default = exports[\"default\"] = LocaleReceiver;\nvar useLocaleReceiver = exports.useLocaleReceiver = function useLocaleReceiver(componentName, defaultLocale) {\n var antLocale = React.useContext(_context[\"default\"]);\n var getLocale = React.useMemo(function () {\n var _a;\n var locale = defaultLocale || _default2[\"default\"][componentName];\n var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n return (0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});\n }, [componentName, defaultLocale, antLocale]);\n return [getLocale];\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _react = require(\"react\");\nvar LocaleContext = /*#__PURE__*/(0, _react.createContext)(undefined);\nvar _default = exports[\"default\"] = LocaleContext;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _default2 = _interopRequireDefault(require(\"../locale/default\"));\nvar _default = exports[\"default\"] = _default2[\"default\"];","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.ANT_MARK = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _warning = _interopRequireDefault(require(\"../_util/warning\"));\nvar _locale = require(\"../modal/locale\");\nvar _context = _interopRequireDefault(require(\"./context\"));\nvar ANT_MARK = exports.ANT_MARK = 'internalMark';\nvar LocaleProvider = function LocaleProvider(props) {\n var _props$locale = props.locale,\n locale = _props$locale === void 0 ? {} : _props$locale,\n children = props.children,\n _ANT_MARK__ = props._ANT_MARK__;\n if (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? (0, _warning[\"default\"])(_ANT_MARK__ === ANT_MARK, 'LocaleProvider', '`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale') : void 0;\n }\n React.useEffect(function () {\n (0, _locale.changeConfirmLocale)(locale && locale.Modal);\n return function () {\n (0, _locale.changeConfirmLocale)();\n };\n }, [locale]);\n var getMemoizedContextValue = React.useMemo(function () {\n return (0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, locale), {\n exist: true\n });\n }, [locale]);\n return /*#__PURE__*/React.createElement(_context[\"default\"].Provider, {\n value: getMemoizedContextValue\n }, children);\n};\nvar _default = exports[\"default\"] = LocaleProvider;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _en_US = _interopRequireDefault(require(\"rc-pagination/lib/locale/en_US\"));\nvar _en_US2 = _interopRequireDefault(require(\"../calendar/locale/en_US\"));\nvar _en_US3 = _interopRequireDefault(require(\"../date-picker/locale/en_US\"));\nvar _en_US4 = _interopRequireDefault(require(\"../time-picker/locale/en_US\"));\n/* eslint-disable no-template-curly-in-string */\n\nvar typeTemplate = '${label} is not a valid ${type}';\nvar localeValues = {\n locale: 'en',\n Pagination: _en_US[\"default\"],\n DatePicker: _en_US3[\"default\"],\n TimePicker: _en_US4[\"default\"],\n Calendar: _en_US2[\"default\"],\n global: {\n placeholder: 'Please select'\n },\n Table: {\n filterTitle: 'Filter menu',\n filterConfirm: 'OK',\n filterReset: 'Reset',\n filterEmptyText: 'No filters',\n filterCheckall: 'Select all items',\n filterSearchPlaceholder: 'Search in filters',\n emptyText: 'No data',\n selectAll: 'Select current page',\n selectInvert: 'Invert current page',\n selectNone: 'Clear all data',\n selectionAll: 'Select all data',\n sortTitle: 'Sort',\n expand: 'Expand row',\n collapse: 'Collapse row',\n triggerDesc: 'Click to sort descending',\n triggerAsc: 'Click to sort ascending',\n cancelSort: 'Click to cancel sorting'\n },\n Modal: {\n okText: 'OK',\n cancelText: 'Cancel',\n justOkText: 'OK'\n },\n Popconfirm: {\n okText: 'OK',\n cancelText: 'Cancel'\n },\n Transfer: {\n titles: ['', ''],\n searchPlaceholder: 'Search here',\n itemUnit: 'item',\n itemsUnit: 'items',\n remove: 'Remove',\n selectCurrent: 'Select current page',\n removeCurrent: 'Remove current page',\n selectAll: 'Select all data',\n removeAll: 'Remove all data',\n selectInvert: 'Invert current page'\n },\n Upload: {\n uploading: 'Uploading...',\n removeFile: 'Remove file',\n uploadError: 'Upload error',\n previewFile: 'Preview file',\n downloadFile: 'Download file'\n },\n Empty: {\n description: 'No data'\n },\n Icon: {\n icon: 'icon'\n },\n Text: {\n edit: 'Edit',\n copy: 'Copy',\n copied: 'Copied',\n expand: 'Expand'\n },\n PageHeader: {\n back: 'Back'\n },\n Form: {\n optional: '(optional)',\n defaultValidateMessages: {\n \"default\": 'Field validation error for ${label}',\n required: 'Please enter ${label}',\n \"enum\": '${label} must be one of [${enum}]',\n whitespace: '${label} cannot be a blank character',\n date: {\n format: '${label} date format is invalid',\n parse: '${label} cannot be converted to a date',\n invalid: '${label} is an invalid date'\n },\n types: {\n string: typeTemplate,\n method: typeTemplate,\n array: typeTemplate,\n object: typeTemplate,\n number: typeTemplate,\n date: typeTemplate,\n \"boolean\": typeTemplate,\n integer: typeTemplate,\n \"float\": typeTemplate,\n regexp: typeTemplate,\n email: typeTemplate,\n url: typeTemplate,\n hex: typeTemplate\n },\n string: {\n len: '${label} must be ${len} characters',\n min: '${label} must be at least ${min} characters',\n max: '${label} must be up to ${max} characters',\n range: '${label} must be between ${min}-${max} characters'\n },\n number: {\n len: '${label} must be equal to ${len}',\n min: '${label} must be minimum ${min}',\n max: '${label} must be maximum ${max}',\n range: '${label} must be between ${min}-${max}'\n },\n array: {\n len: 'Must be ${len} ${label}',\n min: 'At least ${min} ${label}',\n max: 'At most ${max} ${label}',\n range: 'The amount of ${label} must be between ${min}-${max}'\n },\n pattern: {\n mismatch: '${label} does not match the pattern ${pattern}'\n }\n }\n },\n Image: {\n preview: 'Preview'\n }\n};\nvar _default = exports[\"default\"] = localeValues;","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = createUseMessage;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _useNotification = _interopRequireDefault(require(\"rc-notification/lib/useNotification\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ = require(\"..\");\nvar _configProvider = require(\"../../config-provider\");\nfunction createUseMessage(getRcNotificationInstance, getRCNoticeProps) {\n var useMessage = function useMessage() {\n // We can only get content by render\n var getPrefixCls;\n var getPopupContainer;\n // We create a proxy to handle delay created instance\n var innerInstance = null;\n var proxy = {\n add: function add(noticeProps, holderCallback) {\n innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback);\n }\n };\n var _useRCNotification = (0, _useNotification[\"default\"])(proxy),\n _useRCNotification2 = (0, _slicedToArray2[\"default\"])(_useRCNotification, 2),\n hookNotify = _useRCNotification2[0],\n holder = _useRCNotification2[1];\n function notify(args) {\n var customizePrefixCls = args.prefixCls;\n var mergedPrefixCls = getPrefixCls('message', customizePrefixCls);\n var rootPrefixCls = getPrefixCls();\n var target = args.key || (0, _.getKeyThenIncreaseKey)();\n var closePromise = new Promise(function (resolve) {\n var callback = function callback() {\n if (typeof args.onClose === 'function') {\n args.onClose();\n }\n return resolve(true);\n };\n getRcNotificationInstance((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n prefixCls: mergedPrefixCls,\n rootPrefixCls: rootPrefixCls,\n getPopupContainer: getPopupContainer\n }), function (_ref) {\n var prefixCls = _ref.prefixCls,\n instance = _ref.instance;\n innerInstance = instance;\n hookNotify(getRCNoticeProps((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n key: target,\n onClose: callback\n }), prefixCls));\n });\n });\n var result = function result() {\n if (innerInstance) {\n innerInstance.removeNotice(target);\n }\n };\n result.then = function (filled, rejected) {\n return closePromise.then(filled, rejected);\n };\n result.promise = closePromise;\n return result;\n }\n // Fill functions\n var hookApiRef = React.useRef({});\n hookApiRef.current.open = notify;\n _.typeList.forEach(function (type) {\n return (0, _.attachTypeApi)(hookApiRef.current, type);\n });\n return [hookApiRef.current, /*#__PURE__*/React.createElement(_configProvider.ConfigConsumer, {\n key: \"holder\"\n }, function (context) {\n getPrefixCls = context.getPrefixCls;\n getPopupContainer = context.getPopupContainer;\n return holder;\n })];\n };\n return useMessage;\n}","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.attachTypeApi = attachTypeApi;\nexports.getInstance = exports[\"default\"] = void 0;\nexports.getKeyThenIncreaseKey = getKeyThenIncreaseKey;\nexports.typeList = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _CheckCircleFilled = _interopRequireDefault(require(\"@ant-design/icons/CheckCircleFilled\"));\nvar _CloseCircleFilled = _interopRequireDefault(require(\"@ant-design/icons/CloseCircleFilled\"));\nvar _ExclamationCircleFilled = _interopRequireDefault(require(\"@ant-design/icons/ExclamationCircleFilled\"));\nvar _InfoCircleFilled = _interopRequireDefault(require(\"@ant-design/icons/InfoCircleFilled\"));\nvar _LoadingOutlined = _interopRequireDefault(require(\"@ant-design/icons/LoadingOutlined\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar _rcNotification = _interopRequireDefault(require(\"rc-notification\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _configProvider = _interopRequireWildcard(require(\"../config-provider\"));\nvar _useMessage = _interopRequireDefault(require(\"./hooks/useMessage\"));\nvar messageInstance;\nvar defaultDuration = 3;\nvar defaultTop;\nvar key = 1;\nvar localPrefixCls = '';\nvar transitionName = 'move-up';\nvar hasTransitionName = false;\nvar getContainer;\nvar maxCount;\nvar rtl = false;\nfunction getKeyThenIncreaseKey() {\n return key++;\n}\nfunction setMessageConfig(options) {\n if (options.top !== undefined) {\n defaultTop = options.top;\n messageInstance = null; // delete messageInstance for new defaultTop\n }\n if (options.duration !== undefined) {\n defaultDuration = options.duration;\n }\n if (options.prefixCls !== undefined) {\n localPrefixCls = options.prefixCls;\n }\n if (options.getContainer !== undefined) {\n getContainer = options.getContainer;\n messageInstance = null; // delete messageInstance for new getContainer\n }\n if (options.transitionName !== undefined) {\n transitionName = options.transitionName;\n messageInstance = null; // delete messageInstance for new transitionName\n hasTransitionName = true;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n messageInstance = null;\n }\n if (options.rtl !== undefined) {\n rtl = options.rtl;\n }\n}\nfunction getRCNotificationInstance(args, callback) {\n var customizePrefixCls = args.prefixCls,\n getContextPopupContainer = args.getPopupContainer;\n var _globalConfig = (0, _configProvider.globalConfig)(),\n getPrefixCls = _globalConfig.getPrefixCls,\n getRootPrefixCls = _globalConfig.getRootPrefixCls,\n getIconPrefixCls = _globalConfig.getIconPrefixCls;\n var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);\n var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);\n var iconPrefixCls = getIconPrefixCls();\n if (messageInstance) {\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: messageInstance\n });\n return;\n }\n var instanceConfig = {\n prefixCls: prefixCls,\n transitionName: hasTransitionName ? transitionName : \"\".concat(rootPrefixCls, \"-\").concat(transitionName),\n style: {\n top: defaultTop\n },\n getContainer: getContainer || getContextPopupContainer,\n maxCount: maxCount\n };\n _rcNotification[\"default\"].newInstance(instanceConfig, function (instance) {\n if (messageInstance) {\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: messageInstance\n });\n return;\n }\n messageInstance = instance;\n if (process.env.NODE_ENV === 'test') {\n messageInstance.config = instanceConfig;\n }\n callback({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls,\n iconPrefixCls: iconPrefixCls,\n instance: instance\n });\n });\n}\nvar typeToIcon = {\n info: _InfoCircleFilled[\"default\"],\n success: _CheckCircleFilled[\"default\"],\n error: _CloseCircleFilled[\"default\"],\n warning: _ExclamationCircleFilled[\"default\"],\n loading: _LoadingOutlined[\"default\"]\n};\nvar typeList = exports.typeList = Object.keys(typeToIcon);\nfunction getRCNoticeProps(args, prefixCls, iconPrefixCls) {\n var duration = args.duration !== undefined ? args.duration : defaultDuration;\n var IconComponent = typeToIcon[args.type];\n var messageClass = (0, _classnames[\"default\"])(\"\".concat(prefixCls, \"-custom-content\"), (0, _defineProperty2[\"default\"])((0, _defineProperty2[\"default\"])({}, \"\".concat(prefixCls, \"-\").concat(args.type), args.type), \"\".concat(prefixCls, \"-rtl\"), rtl === true));\n return {\n key: args.key,\n duration: duration,\n style: args.style || {},\n className: args.className,\n content: ( /*#__PURE__*/React.createElement(_configProvider[\"default\"], {\n iconPrefixCls: iconPrefixCls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: messageClass\n }, args.icon || IconComponent && /*#__PURE__*/React.createElement(IconComponent, null), /*#__PURE__*/React.createElement(\"span\", null, args.content)))),\n onClose: args.onClose,\n onClick: args.onClick\n };\n}\nfunction notice(args) {\n var target = args.key || getKeyThenIncreaseKey();\n var closePromise = new Promise(function (resolve) {\n var callback = function callback() {\n if (typeof args.onClose === 'function') {\n args.onClose();\n }\n return resolve(true);\n };\n getRCNotificationInstance(args, function (_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n instance = _ref.instance;\n instance.notice(getRCNoticeProps((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n key: target,\n onClose: callback\n }), prefixCls, iconPrefixCls));\n });\n });\n var result = function result() {\n var _a;\n if (messageInstance) {\n messageInstance.removeNotice(target);\n (_a = args.onClose) === null || _a === void 0 ? void 0 : _a.call(args);\n }\n };\n result.then = function (filled, rejected) {\n return closePromise.then(filled, rejected);\n };\n result.promise = closePromise;\n return result;\n}\nfunction isArgsProps(content) {\n return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;\n}\nvar api = {\n open: notice,\n config: setMessageConfig,\n destroy: function destroy(messageKey) {\n if (messageInstance) {\n if (messageKey) {\n var _messageInstance = messageInstance,\n removeNotice = _messageInstance.removeNotice;\n removeNotice(messageKey);\n } else {\n var _messageInstance2 = messageInstance,\n destroy = _messageInstance2.destroy;\n destroy();\n messageInstance = null;\n }\n }\n }\n};\nfunction attachTypeApi(originalApi, type) {\n originalApi[type] = function (content, duration, onClose) {\n if (isArgsProps(content)) {\n return originalApi.open((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, content), {\n type: type\n }));\n }\n if (typeof duration === 'function') {\n onClose = duration;\n duration = undefined;\n }\n return originalApi.open({\n content: content,\n duration: duration,\n type: type,\n onClose: onClose\n });\n };\n}\ntypeList.forEach(function (type) {\n return attachTypeApi(api, type);\n});\napi.warn = api.warning;\napi.useMessage = (0, _useMessage[\"default\"])(getRCNotificationInstance, getRCNoticeProps);\n/** @internal test Only function. Not work on production */\nvar getInstance = exports.getInstance = function getInstance() {\n return process.env.NODE_ENV === 'test' ? messageInstance : null;\n};\nvar _default = exports[\"default\"] = api;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.changeConfirmLocale = changeConfirmLocale;\nexports.getConfirmLocale = getConfirmLocale;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _default = _interopRequireDefault(require(\"../locale/default\"));\nvar runtimeLocale = (0, _extends2[\"default\"])({}, _default[\"default\"].Modal);\nfunction changeConfirmLocale(newLocale) {\n if (newLocale) {\n runtimeLocale = (0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, runtimeLocale), newLocale);\n } else {\n runtimeLocale = (0, _extends2[\"default\"])({}, _default[\"default\"].Modal);\n }\n}\nfunction getConfirmLocale() {\n return runtimeLocale;\n}","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = createUseNotification;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));\nvar _useNotification = _interopRequireDefault(require(\"rc-notification/lib/useNotification\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _configProvider = require(\"../../config-provider\");\nfunction createUseNotification(getNotificationInstance, getRCNoticeProps) {\n var useNotification = function useNotification() {\n // We can only get content by render\n var getPrefixCls;\n // We create a proxy to handle delay created instance\n var innerInstance = null;\n var proxy = {\n add: function add(noticeProps, holderCallback) {\n innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback);\n }\n };\n var _useRCNotification = (0, _useNotification[\"default\"])(proxy),\n _useRCNotification2 = (0, _slicedToArray2[\"default\"])(_useRCNotification, 2),\n hookNotify = _useRCNotification2[0],\n holder = _useRCNotification2[1];\n function notify(args) {\n var customizePrefixCls = args.prefixCls;\n var mergedPrefixCls = getPrefixCls('notification', customizePrefixCls);\n getNotificationInstance((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n prefixCls: mergedPrefixCls\n }), function (_ref) {\n var prefixCls = _ref.prefixCls,\n instance = _ref.instance;\n innerInstance = instance;\n hookNotify(getRCNoticeProps(args, prefixCls));\n });\n }\n // Fill functions\n var hookApiRef = React.useRef({});\n hookApiRef.current.open = notify;\n ['success', 'info', 'warning', 'error'].forEach(function (type) {\n hookApiRef.current[type] = function (args) {\n return hookApiRef.current.open((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n type: type\n }));\n };\n });\n return [hookApiRef.current, /*#__PURE__*/React.createElement(_configProvider.ConfigConsumer, {\n key: \"holder\"\n }, function (context) {\n getPrefixCls = context.getPrefixCls;\n return holder;\n })];\n };\n return useNotification;\n}","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getInstance = exports[\"default\"] = void 0;\nvar _regeneratorRuntime2 = _interopRequireDefault(require(\"@babel/runtime/helpers/regeneratorRuntime\"));\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _CheckCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons/CheckCircleOutlined\"));\nvar _CloseCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons/CloseCircleOutlined\"));\nvar _CloseOutlined = _interopRequireDefault(require(\"@ant-design/icons/CloseOutlined\"));\nvar _ExclamationCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons/ExclamationCircleOutlined\"));\nvar _InfoCircleOutlined = _interopRequireDefault(require(\"@ant-design/icons/InfoCircleOutlined\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar _rcNotification = _interopRequireDefault(require(\"rc-notification\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _configProvider = _interopRequireWildcard(require(\"../config-provider\"));\nvar _useNotification = _interopRequireDefault(require(\"./hooks/useNotification\"));\nvar __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar notificationInstance = {};\nvar defaultDuration = 4.5;\nvar defaultTop = 24;\nvar defaultBottom = 24;\nvar defaultPrefixCls = '';\nvar defaultPlacement = 'topRight';\nvar defaultGetContainer;\nvar defaultCloseIcon;\nvar rtl = false;\nvar maxCount;\nfunction setNotificationConfig(options) {\n var duration = options.duration,\n placement = options.placement,\n bottom = options.bottom,\n top = options.top,\n getContainer = options.getContainer,\n closeIcon = options.closeIcon,\n prefixCls = options.prefixCls;\n if (prefixCls !== undefined) {\n defaultPrefixCls = prefixCls;\n }\n if (duration !== undefined) {\n defaultDuration = duration;\n }\n if (placement !== undefined) {\n defaultPlacement = placement;\n } else if (options.rtl) {\n defaultPlacement = 'topLeft';\n }\n if (bottom !== undefined) {\n defaultBottom = bottom;\n }\n if (top !== undefined) {\n defaultTop = top;\n }\n if (getContainer !== undefined) {\n defaultGetContainer = getContainer;\n }\n if (closeIcon !== undefined) {\n defaultCloseIcon = closeIcon;\n }\n if (options.rtl !== undefined) {\n rtl = options.rtl;\n }\n if (options.maxCount !== undefined) {\n maxCount = options.maxCount;\n }\n}\nfunction getPlacementStyle(placement) {\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTop;\n var bottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultBottom;\n var style;\n switch (placement) {\n case 'top':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top: top,\n bottom: 'auto'\n };\n break;\n case 'topLeft':\n style = {\n left: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n case 'topRight':\n style = {\n right: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n case 'bottom':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top: 'auto',\n bottom: bottom\n };\n break;\n case 'bottomLeft':\n style = {\n left: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n default:\n style = {\n right: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n }\n return style;\n}\nfunction getNotificationInstance(args, callback) {\n var _args$placement = args.placement,\n placement = _args$placement === void 0 ? defaultPlacement : _args$placement,\n top = args.top,\n bottom = args.bottom,\n _args$getContainer = args.getContainer,\n getContainer = _args$getContainer === void 0 ? defaultGetContainer : _args$getContainer,\n customizePrefixCls = args.prefixCls;\n var _globalConfig = (0, _configProvider.globalConfig)(),\n getPrefixCls = _globalConfig.getPrefixCls,\n getIconPrefixCls = _globalConfig.getIconPrefixCls;\n var prefixCls = getPrefixCls('notification', customizePrefixCls || defaultPrefixCls);\n var iconPrefixCls = getIconPrefixCls();\n var cacheKey = \"\".concat(prefixCls, \"-\").concat(placement);\n var cacheInstance = notificationInstance[cacheKey];\n if (cacheInstance) {\n Promise.resolve(cacheInstance).then(function (instance) {\n callback({\n prefixCls: \"\".concat(prefixCls, \"-notice\"),\n iconPrefixCls: iconPrefixCls,\n instance: instance\n });\n });\n return;\n }\n var notificationClass = (0, _classnames[\"default\"])(\"\".concat(prefixCls, \"-\").concat(placement), (0, _defineProperty2[\"default\"])({}, \"\".concat(prefixCls, \"-rtl\"), rtl === true));\n notificationInstance[cacheKey] = new Promise(function (resolve) {\n _rcNotification[\"default\"].newInstance({\n prefixCls: prefixCls,\n className: notificationClass,\n style: getPlacementStyle(placement, top, bottom),\n getContainer: getContainer,\n maxCount: maxCount\n }, function (notification) {\n resolve(notification);\n callback({\n prefixCls: \"\".concat(prefixCls, \"-notice\"),\n iconPrefixCls: iconPrefixCls,\n instance: notification\n });\n });\n });\n}\nvar typeToIcon = {\n success: _CheckCircleOutlined[\"default\"],\n info: _InfoCircleOutlined[\"default\"],\n error: _CloseCircleOutlined[\"default\"],\n warning: _ExclamationCircleOutlined[\"default\"]\n};\nfunction getRCNoticeProps(args, prefixCls, iconPrefixCls) {\n var durationArg = args.duration,\n icon = args.icon,\n type = args.type,\n description = args.description,\n message = args.message,\n btn = args.btn,\n onClose = args.onClose,\n onClick = args.onClick,\n key = args.key,\n style = args.style,\n className = args.className,\n _args$closeIcon = args.closeIcon,\n closeIcon = _args$closeIcon === void 0 ? defaultCloseIcon : _args$closeIcon,\n props = args.props;\n var duration = durationArg === undefined ? defaultDuration : durationArg;\n var iconNode = null;\n if (icon) {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, args.icon);\n } else if (type) {\n iconNode = /*#__PURE__*/React.createElement(typeToIcon[type] || null, {\n className: \"\".concat(prefixCls, \"-icon \").concat(prefixCls, \"-icon-\").concat(type)\n });\n }\n var closeIconToRender = typeof closeIcon === 'undefined' ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, /*#__PURE__*/React.createElement(_CloseOutlined[\"default\"], {\n className: \"\".concat(prefixCls, \"-close-icon\")\n }))) : closeIcon;\n var autoMarginTag = !description && iconNode ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-message-single-line-auto-margin\")\n })) : null;\n return {\n content: ( /*#__PURE__*/React.createElement(_configProvider[\"default\"], {\n iconPrefixCls: iconPrefixCls\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: iconNode ? \"\".concat(prefixCls, \"-with-icon\") : '',\n role: \"alert\"\n }, iconNode, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-message\")\n }, autoMarginTag, message), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, description), btn ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-btn\")\n }, btn) : null))),\n duration: duration,\n closable: true,\n closeIcon: closeIconToRender,\n onClose: onClose,\n onClick: onClick,\n key: key,\n style: style || {},\n className: (0, _classnames[\"default\"])(className, (0, _defineProperty2[\"default\"])({}, \"\".concat(prefixCls, \"-\").concat(type), !!type)),\n props: props\n };\n}\nfunction notice(args) {\n getNotificationInstance(args, function (_ref) {\n var prefixCls = _ref.prefixCls,\n iconPrefixCls = _ref.iconPrefixCls,\n instance = _ref.instance;\n instance.notice(getRCNoticeProps(args, prefixCls, iconPrefixCls));\n });\n}\nvar api = {\n open: notice,\n close: function close(key) {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n return Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {\n instance.removeNotice(key);\n });\n });\n },\n config: setNotificationConfig,\n destroy: function destroy() {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {\n instance.destroy();\n });\n delete notificationInstance[cacheKey]; // lgtm[js/missing-await]\n });\n }\n};\n['success', 'info', 'warning', 'error'].forEach(function (type) {\n api[type] = function (args) {\n return api.open((0, _extends2[\"default\"])((0, _extends2[\"default\"])({}, args), {\n type: type\n }));\n };\n});\napi.warn = api.warning;\napi.useNotification = (0, _useNotification[\"default\"])(getNotificationInstance, getRCNoticeProps);\n/** @internal test Only function. Not work on production */\nvar getInstance = exports.getInstance = function getInstance(cacheKey) {\n return __awaiter(void 0, void 0, void 0, /*#__PURE__*/(0, _regeneratorRuntime2[\"default\"])().mark(function _callee() {\n return (0, _regeneratorRuntime2[\"default\"])().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", process.env.NODE_ENV === 'test' ? notificationInstance[cacheKey] : null);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n};\nvar _default = exports[\"default\"] = api;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar locale = {\n placeholder: 'Select time',\n rangePlaceholder: ['Start time', 'End time']\n};\nvar _default = exports[\"default\"] = locale;","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\")[\"default\"];\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\")[\"default\"];\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _configProvider = require(\"../config-provider\");\nvar __rest = void 0 && (void 0).__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar TimelineItem = function TimelineItem(_a) {\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n _a$color = _a.color,\n color = _a$color === void 0 ? 'blue' : _a$color,\n dot = _a.dot,\n _a$pending = _a.pending,\n pending = _a$pending === void 0 ? false : _a$pending,\n position = _a.position,\n label = _a.label,\n children = _a.children,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"color\", \"dot\", \"pending\", \"position\", \"label\", \"children\"]);\n var _React$useContext = React.useContext(_configProvider.ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n var prefixCls = getPrefixCls('timeline', customizePrefixCls);\n var itemClassName = (0, _classnames[\"default\"])((0, _defineProperty2[\"default\"])((0, _defineProperty2[\"default\"])({}, \"\".concat(prefixCls, \"-item\"), true), \"\".concat(prefixCls, \"-item-pending\"), pending), className);\n var dotClassName = (0, _classnames[\"default\"])((0, _defineProperty2[\"default\"])((0, _defineProperty2[\"default\"])((0, _defineProperty2[\"default\"])({}, \"\".concat(prefixCls, \"-item-head\"), true), \"\".concat(prefixCls, \"-item-head-custom\"), !!dot), \"\".concat(prefixCls, \"-item-head-\").concat(color), true));\n var customColor = /blue|red|green|gray/.test(color || '') ? undefined : color;\n return /*#__PURE__*/React.createElement(\"li\", (0, _extends2[\"default\"])({}, restProps, {\n className: itemClassName\n }), label && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-label\")\n }, label), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-tail\")\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: dotClassName,\n style: {\n borderColor: customColor,\n color: customColor\n }\n }, dot), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-content\")\n }, children));\n};\nvar _default = exports[\"default\"] = TimelineItem;","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/get-prototype-of\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function 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 (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n","require('../../modules/es6.object.get-prototype-of');\nmodule.exports = require('../../modules/_core').Object.getPrototypeOf;\n","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","module.exports = function () { /* empty */ };\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var core = module.exports = { version: '2.6.12' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = true;\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","module.exports = require('./_hide');\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toObject = require('./_to-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $GOPS = require('./_object-gops');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","require('./es6.array.iterator');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar TO_STRING_TAG = require('./_wks')('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClassicEditor\"] = factory();\n\telse\n\t\troot[\"ClassicEditor\"] = factory();\n})(self, () => {\nreturn ","/* MIT license */\n/* eslint-disable no-mixed-operators */\nconst cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\nmodule.exports = convert;\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Infinity;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tlet r = rgb[0] / 255;\n\tlet g = rgb[1] / 255;\n\tlet b = rgb[2] / 255;\n\n\t// Assume sRGB\n\tr = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);\n\n\tconst x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tconst y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tconst z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t2;\n\tlet t3;\n\tlet val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// Assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (~~(args > 50) + 1) * 0.5;\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(char => {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tconst integer = parseInt(colorString, 16);\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet grayscale;\n\tlet hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));\n\n\tlet f = 0;\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1.0 - c);\n\tlet f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1.0 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tconst val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (val << 16) + (val << 8) + val;\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n","const conversions = require('./conversions');\nconst route = require('./route');\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(fromModel => {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\trouteModels.forEach(toModel => {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n","const conversions = require('./conversions');\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css\"],\"names\":[],\"mappings\":\"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content blockquote {\\n\\t/* See #12 */\\n\\toverflow: hidden;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\\n\\tpadding-right: 1.5em;\\n\\tpadding-left: 1.5em;\\n\\n\\tmargin-left: 0;\\n\\tmargin-right: 0;\\n\\tfont-style: italic;\\n\\tborder-left: solid 5px hsl(0, 0%, 80%);\\n}\\n\\n.ck-content[dir=\\\"rtl\\\"] blockquote {\\n\\tborder-left: 0;\\n\\tborder-right: solid 5px hsl(0, 0%, 80%);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:\\\"\\\";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css\"],\"names\":[],\"mappings\":\"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CAIF,kCAEC,mBAAoB,CADpB,iBAED,CChCA,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CAOF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD,CAGD,kCAGC,gDAAiD,CADjD,sDAAuD,CADvD,QAAS,CAGT,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\tdisplay: inline;\\n\\t\\tposition: relative;\\n\\t\\tpointer-events: none;\\n\\n\\t\\t& span {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\n\\t\\t& > .ck-widget__type-around {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\tposition: absolute;\\n\\tpointer-events: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-clipboard-drop-target-dot-width: 12px;\\n\\t--ck-clipboard-drop-target-dot-height: 8px;\\n\\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border)\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\t& span {\\n\\t\\t\\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tmargin-left: -1px;\\n\\n\\t\\t\\t/* The triangle above the marker */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\theight: 0;\\n\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttop: calc(var(--ck-clipboard-drop-target-dot-height) * -.5);\\n\\n\\t\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t\\t\\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\\n\\t\\t\\t\\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget that it a drop target.\\n\\t */\\n\\t& .ck-widget.ck-clipboard-drop-target-range {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\tzoom: 0.6;\\n\\t\\toutline: none !important;\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\theight: 0;\\n\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\tmargin-top: -1px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor {\\n\\t/* All the elements within `.ck-editor` are positioned relatively to it.\\n\\t If any element needs to be positioned with respect to the , etc.,\\n\\t it must land outside of the `.ck-editor` in DOM. */\\n\\tposition: relative;\\n\\n\\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\\n\\t\\tz-index: var(--ck-z-modal);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n.ck.ck-editor__top {\\n\\t& .ck-sticky-panel {\\n\\t\\t& .ck-toolbar {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\tborder-bottom-width: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck-sticky-panel__content_sticky .ck-toolbar {\\n\\t\\t\\tborder-bottom-width: 1px;\\n\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Note: Use ck-editor__main to make sure these styles don't apply to other editor types */\\n.ck.ck-editor__main > .ck-editor__editable {\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\\n\\tbackground: var(--ck-color-base-background);\\n\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&:not(.ck-focused) {\\n\\t\\tborder-color: var(--ck-color-base-border);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css\"],\"names\":[],\"mappings\":\"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC5BC,qDAEC,6CAA8C,CAD9C,WAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder,\\n.ck .ck-placeholder {\\n\\tposition: relative;\\n\\n\\t&::before {\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tcontent: attr(data-placeholder);\\n\\n\\t\\t/* See ckeditor/ckeditor5#469. */\\n\\t\\tpointer-events: none;\\n\\t}\\n}\\n\\n/* See ckeditor/ckeditor5#1987. */\\n.ck.ck-read-only .ck-placeholder {\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n/*\\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\\n */\\n.ck.ck-reset_all .ck-placeholder {\\n\\tposition: relative;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder, .ck .ck-placeholder {\\n\\t&::before {\\n\\t\\tcursor: text;\\n\\t\\tcolor: var(--ck-color-engine-placeholder-text);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css\"],\"names\":[],\"mappings\":\"AAMA,qDACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\\n\\tdisplay: none;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-button.ck-color-table__color-picker,.ck .ck-button.ck-color-table__remove-color{align-items:center;display:flex;width:100%}[dir=rtl] .ck .ck-button.ck-color-table__color-picker,[dir=rtl] .ck .ck-button.ck-color-table__remove-color{justify-content:flex-start}.ck .ck-button.ck-color-table__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-picker{padding:8px}.ck.ck-color-picker .hex-color-picker{height:100px;margin:0 0 var(--ck-spacing-large) 0}.ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-table_action-bar{display:flex;flex-direction:row;justify-content:space-around;padding:0 8px 8px}.ck.ck-color-table_action-bar .ck-button-cancel,.ck.ck-color-table_action-bar .ck-button-save{flex:1}.ck .ck-button.ck-color-table__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css\"],\"names\":[],\"mappings\":\"AAOA,wFAGC,kBAAmB,CADnB,YAAa,CAEb,UAKD,CATA,4GAOE,0BAEF,CAEA,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,gDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF,CAGD,8BACC,iBACD,CAEA,oBACC,WAmBD,CAjBC,sCACC,YAAa,CACb,oCAcD,CAZC,wDACC,iEACD,CACA,iDACC,iEACD,CAEA,yHAGC,WAAY,CADZ,UAED,CAIF,8BACC,YAAa,CACb,kBAAmB,CACnB,4BAA6B,CAC7B,iBAMD,CAJC,8FAEC,MACD,CClED,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck .ck-button.ck-color-table__remove-color,\\n.ck .ck-button.ck-color-table__color-picker {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\twidth: 100%;\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\tjustify-content: flex-start;\\n\\t}\\n}\\n\\n.ck .ck-button.ck-color-table__color-picker {\\n\\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\\n\\tborder-bottom-left-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\n\\t&:not(:focus) {\\n\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n}\\n\\nlabel.ck.ck-color-grid__label {\\n\\tfont-weight: unset;\\n}\\n\\n.ck.ck-color-picker {\\n\\tpadding: 8px;\\n\\n\\t& .hex-color-picker {\\n\\t\\theight: 100px;\\n\\t\\tmargin: 0 0 var(--ck-spacing-large) 0;\\n\\n\\t\\t&::part(saturation) {\\n\\t\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\t\\t}\\n\\t\\t&::part(hue) {\\n\\t\\t\\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\\n\\t\\t}\\n\\n\\t\\t&::part(saturation-pointer),\\n\\t\\t&::part(hue-pointer) {\\n\\t\\t\\twidth: 15px;\\n\\t\\t\\theight: 15px;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-color-table_action-bar {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tjustify-content: space-around;\\n\\tpadding: 0 8px 8px;\\n\\n\\t& .ck-button-save,\\n\\t& .ck-button-cancel {\\n\\t\\tflex: 1\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck .ck-button.ck-color-table__remove-color {\\n\\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\\n\\tborder-bottom-left-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\n\\t&:not(:focus) {\\n\\t\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css\"],\"names\":[],\"mappings\":\"AAUC,uBACC,cACD,CAEA,wBACC,eACD,CAEA,sBACC,eACD,CAEA,uBACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* The values should be synchronized with the \\\"FONT_SIZE_PRESET_UNITS\\\" object in the \\\"/src/fontsize/utils.js\\\" file. */\\n\\n/* Styles should be prefixed with the `.ck-content` class.\\nSee https://github.com/ckeditor/ckeditor5/issues/6636 */\\n.ck-content {\\n\\t& .text-tiny {\\n\\t\\tfont-size: .7em;\\n\\t}\\n\\n\\t& .text-small {\\n\\t\\tfont-size: .85em;\\n\\t}\\n\\n\\t& .text-big {\\n\\t\\tfont-size: 1.4em;\\n\\t}\\n\\n\\t& .text-huge {\\n\\t\\tfont-size: 1.8em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css\"],\"names\":[],\"mappings\":\"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-heading_heading1 {\\n\\tfont-size: 20px;\\n}\\n\\n.ck.ck-heading_heading2 {\\n\\tfont-size: 17px;\\n}\\n\\n.ck.ck-heading_heading3 {\\n\\tfont-size: 14px;\\n}\\n\\n.ck[class*=\\\"ck-heading_heading\\\"] {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Resize dropdown's button label. */\\n.ck.ck-dropdown.ck-heading-dropdown {\\n\\t& .ck-dropdown__button .ck-button__label {\\n\\t\\twidth: 8em;\\n\\t}\\n\\n\\t& .ck-dropdown__panel .ck-list__item {\\n\\t\\tmin-width: 18em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css\"],\"names\":[],\"mappings\":\"AAMC,mBAEC,UAAW,CADX,aAAc,CAOd,gBAAkB,CAGlB,cAAe,CARf,iBAuBD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAYC,sBAAuB,CANvB,mBAAoB,CAGpB,cAoBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content {\\n\\t& .image {\\n\\t\\tdisplay: table;\\n\\t\\tclear: both;\\n\\t\\ttext-align: center;\\n\\n\\t\\t/* Make sure there is some space between the content and the image. Center image by default. */\\n\\t\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\t \\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\t\\tmargin: 0.9em auto;\\n\\n\\t\\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\\n\\t\\tmin-width: 50px;\\n\\n\\t\\t& img {\\n\\t\\t\\t/* Prevent unnecessary margins caused by line-height (see #44). */\\n\\t\\t\\tdisplay: block;\\n\\n\\t\\t\\t/* Center the image if its width is smaller than the content's width. */\\n\\t\\t\\tmargin: 0 auto;\\n\\n\\t\\t\\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\\n\\t\\t\\tmin-width: 100%\\n\\t\\t}\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t/*\\n\\t\\t * Normally, the .image-inline would have \\\"display: inline-block\\\" and \\\"img { width: 100% }\\\" (to follow the wrapper while resizing).\\n\\t\\t * Unfortunately, together with \\\"srcset\\\", it gets automatically stretched up to the width of the editing root.\\n\\t\\t * This strange behavior does not happen with inline-flex.\\n\\t\\t */\\n\\t\\tdisplay: inline-flex;\\n\\n\\t\\t/* While being resized, don't allow the image to exceed the width of the editing root. */\\n\\t\\tmax-width: 100%;\\n\\n\\t\\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\\n\\t\\talign-items: flex-start;\\n\\n\\t\\t/* When the picture is present it must act as a flex container to let the img resize properly */\\n\\t\\t& picture {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t}\\n\\n\\t\\t/* When the picture is present, it must act like a resizable img. */\\n\\t\\t& picture,\\n\\t\\t& img {\\n\\t\\t\\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\tflex-shrink: 1;\\n\\n\\t\\t\\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\\n\\t\\t\\tmax-width: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Inhertit the content styles padding of the
    in case the integration overrides `text-align: center`\\n\\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\\n\\t * caret does, and not at the edge of
    .\\n\\t */\\n\\t& .image > figcaption.ck-placeholder::before {\\n\\t\\tpadding-left: inherit;\\n\\t\\tpadding-right: inherit;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the image caption placeholder doesn't overflow the placeholder area.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\\n\\t\\t */\\n\\t\\twhite-space: nowrap;\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n\\n\\n\\t/*\\n\\t * Make sure the selected inline image always stays on top of its siblings.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\\n\\t */\\n\\t& .image.ck-widget_selected {\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t& .image-inline.ck-widget_selected {\\n\\t\\tz-index: 1;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the native browser selection style is not displayed.\\n\\t\\t * Inline image widgets have their own styles for the selected state and\\n\\t\\t * leaving this up to the browser is asking for a visual collision.\\n\\t\\t */\\n\\t\\t& ::selection {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t/* The inline image nested in the table should have its original size if not resized.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\\n\\t& td,\\n\\t& th {\\n\\t\\t& .image-inline img {\\n\\t\\t\\tmax-width: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,mDACD,CAGA,8BAKC,yDAA0D,CAH1D,mBAAoB,CAEpB,wCAAyC,CAHzC,qBAAsB,CAMtB,eAAgB,CAChB,mBAAoB,CAFpB,YAAa,CAHb,qBAMD,CAGA,qEACC,iDACD,CAEA,sCACC,GACC,oEACD,CAEA,GACC,yDACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-image-caption-background: hsl(0, 0%, 97%);\\n\\t--ck-color-image-caption-text: hsl(0, 0%, 20%);\\n\\t--ck-color-image-caption-highligted-background: hsl(52deg 100% 50%);\\n}\\n\\n/* Content styles */\\n.ck-content .image > figcaption {\\n\\tdisplay: table-caption;\\n\\tcaption-side: bottom;\\n\\tword-break: break-word;\\n\\tcolor: var(--ck-color-image-caption-text);\\n\\tbackground-color: var(--ck-color-image-caption-background);\\n\\tpadding: .6em;\\n\\tfont-size: .75em;\\n\\toutline-offset: -1px;\\n}\\n\\n/* Editing styles */\\n.ck.ck-editor__editable .image > figcaption.image__caption_highlighted {\\n\\tanimation: ck-image-caption-highlight .6s ease-out;\\n}\\n\\n@keyframes ck-image-caption-highlight {\\n\\t0% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-highligted-background);\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-background);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,8BAA+B,CAC/B,qEACD,CAMC,qFAEC,oDACD,CAIA,yEAEC,UACD,CAEA,8BACC,WAAY,CACZ,yCAA0C,CAC1C,aACD,CAEA,oCACC,UAAW,CACX,0CACD,CAEA,sCACC,gBAAiB,CACjB,iBACD,CAEA,qCACC,WAAY,CACZ,yCACD,CAEA,2CAEC,gBAAiB,CADjB,cAED,CAEA,0CACC,aAAc,CACd,iBACD,CAGA,6GAGC,YACD,CAGC,mGAGC,kDAAmD,CADnD,+CAED,CAEA,iDACC,iDACD,CAEA,kDACC,gDACD,CAUC,0lBAGC,qDAKD,CAHC,8nBACC,YACD,CAKD,oVAGC,2DACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-image-style-spacing: 1.5em;\\n\\t--ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);\\n}\\n\\n.ck-content {\\n\\t/* Provides a minimal side margin for the left and right aligned images, so that the user has a visual feedback\\n\\tconfirming successful application of the style if image width exceeds the editor's size.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9342 */\\n\\t& .image-style-block-align-left,\\n\\t& .image-style-block-align-right {\\n\\t\\tmax-width: calc(100% - var(--ck-image-style-spacing));\\n\\t}\\n\\n\\t/* Allows displaying multiple floating images in the same line.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9183#issuecomment-804988132 */\\n\\t& .image-style-align-left,\\n\\t& .image-style-align-right {\\n\\t\\tclear: none;\\n\\t}\\n\\n\\t& .image-style-side {\\n\\t\\tfloat: right;\\n\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t\\tmax-width: 50%;\\n\\t}\\n\\n\\t& .image-style-align-left {\\n\\t\\tfloat: left;\\n\\t\\tmargin-right: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t& .image-style-align-center {\\n\\t\\tmargin-left: auto;\\n\\t\\tmargin-right: auto;\\n\\t}\\n\\n\\t& .image-style-align-right {\\n\\t\\tfloat: right;\\n\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t& .image-style-block-align-right {\\n\\t\\tmargin-right: 0;\\n\\t\\tmargin-left: auto;\\n\\t}\\n\\n\\t& .image-style-block-align-left {\\n\\t\\tmargin-left: 0;\\n\\t\\tmargin-right: auto;\\n\\t}\\n\\n\\t/* Simulates margin collapsing with the preceding paragraph, which does not work for the floating elements. */\\n\\t& p + .image-style-align-left,\\n\\t& p + .image-style-align-right,\\n\\t& p + .image-style-side {\\n\\t\\tmargin-top: 0;\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t&.image-style-align-left,\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-top: var(--ck-inline-image-style-spacing);\\n\\t\\t\\tmargin-bottom: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-left {\\n\\t\\t\\tmargin-right: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-left: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/* The button should display as a regular drop-down if the action button\\n\\tis forced to fire the same action as the arrow button. */\\n\\t&.ck-splitbutton_flatten {\\n\\t\\t&:hover,\\n\\t\\t&.ck-splitbutton_open {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-background);\\n\\n\\t\\t\\t\\t&::after {\\n\\t\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-splitbutton_open:hover {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-hover-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:\\\"\\\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css\"],\"names\":[],\"mappings\":\"AAKA,+BAUC,iBAAkB,CATlB,aAAc,CACd,iBAAkB,CAOlB,sCAAwC,CADxC,oCAAsC,CAGtC,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BAWC,sBAA4B,CAN5B,0BAAgC,CADhC,qCAAuC,CADvC,wEAA0E,CAD1E,uDAAwD,CAMxD,oDAAuD,CAWvD,oFAAuF,CAlBvF,SAAU,CAgBV,eAAgB,CAChB,mFA0BD,CAtBC,qCAgBC,mBAAsB,CADtB,sBAAyB,CAEzB,4BAA6B,CAH7B,4CAA6C,CAF7C,sFAAuF,CADvF,oFAAqF,CASrF,qBAAsB,CAdtB,QAAS,CAJT,QAAS,CAGT,SAAU,CADV,OAAQ,CAKR,mCAAoC,CACpC,yBAA0B,CAH1B,OAcD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GAGC,QAAS,CAFT,SAAU,CACV,OAED,CACA,IAEC,QAAS,CADT,UAED,CACA,GAGC,YAAc,CAFd,SAAU,CACV,UAED,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-image-upload-complete-icon {\\n\\tdisplay: block;\\n\\tposition: absolute;\\n\\n\\t/*\\n\\t * Smaller images should have the icon closer to the border.\\n\\t * Match the icon position with the linked image indicator brought by the link image feature.\\n\\t */\\n\\ttop: min(var(--ck-spacing-medium), 6%);\\n\\tright: min(var(--ck-spacing-medium), 6%);\\n\\tborder-radius: 50%;\\n\\tz-index: 1;\\n\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\\n\\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\\n\\n\\t/* Match the icon size with the linked image indicator brought by the link image feature. */\\n\\t--ck-image-upload-icon-size: 20;\\n\\t--ck-image-upload-icon-width: 2px;\\n\\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\\n}\\n\\n.ck-image-upload-complete-icon {\\n\\topacity: 0;\\n\\tbackground: var(--ck-color-image-upload-icon-background);\\n\\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\\n\\tanimation-fill-mode: forwards, forwards;\\n\\tanimation-duration: 500ms, 500ms;\\n\\n\\t/* To make animation scalable. */\\n\\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\\n\\n\\t/* Hide completed upload icon after 3 seconds. */\\n\\tanimation-delay: 0ms, 3000ms;\\n\\n\\t/*\\n\\t * Use CSS math to simulate container queries.\\n\\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\\n\\t */\\n\\toverflow: hidden;\\n\\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\n\\t/* This is check icon element made from border-width mixed with animations. */\\n\\t&::after {\\n\\t\\t/* Because of border transformation we need to \\\"hard code\\\" left position. */\\n\\t\\tleft: 25%;\\n\\n\\t\\ttop: 50%;\\n\\t\\topacity: 0;\\n\\t\\theight: 0;\\n\\t\\twidth: 0;\\n\\n\\t\\ttransform: scaleX(-1) rotate(135deg);\\n\\t\\ttransform-origin: left top;\\n\\t\\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\t\\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\n\\t\\tanimation-name: ck-upload-complete-icon-check;\\n\\t\\tanimation-duration: 500ms;\\n\\t\\tanimation-delay: 500ms;\\n\\t\\tanimation-fill-mode: forwards;\\n\\n\\t\\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-show {\\n\\tfrom {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-hide {\\n\\tfrom {\\n\\t\\topacity: 1;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 0;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-check {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0;\\n\\t\\theight: 0;\\n\\t}\\n\\t33% {\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0.45em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:\\\"\\\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css\"],\"names\":[],\"mappings\":\"AAKA,kCAGC,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,MAAO,CALP,iBAAkB,CAIlB,KAOD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAGC,QAAS,CADT,UAgBD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCAEC,WAAY,CADZ,UAWD,CARC,yCAMC,yDAA0D,CAH1D,iBAAkB,CAElB,kCAAmC,CADnC,8DAA+D,CAF/D,+CAAgD,CADhD,8CAMD,CAGD,wCACC,GACC,uBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-upload-placeholder-loader {\\n\\tposition: absolute;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\ttop: 0;\\n\\tleft: 0;\\n\\n\\t&::before {\\n\\t\\tcontent: '';\\n\\t\\tposition: relative;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\\n\\t--ck-upload-placeholder-loader-size: 32px;\\n\\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\\n}\\n\\n.ck .ck-image-upload-placeholder {\\n\\t/* We need to control the full width of the SVG gray background. */\\n\\twidth: 100%;\\n\\tmargin: 0;\\n\\n\\t&.image-inline {\\n\\t\\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\\n\\t}\\n\\n\\t& img {\\n\\t\\t/*\\n\\t\\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\\n\\t\\t * There's nothing special about this number except that it should make the image placeholder look like\\n\\t\\t * a real image during this short period after the upload started and before the image was read from the\\n\\t\\t * file system (and a rich preview was loaded).\\n\\t\\t */\\n\\t\\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\\n\\t}\\n}\\n\\n.ck .ck-upload-placeholder-loader {\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\n\\t&::before {\\n\\t\\twidth: var(--ck-upload-placeholder-loader-size);\\n\\t\\theight: var(--ck-upload-placeholder-loader-size);\\n\\t\\tborder-radius: 50%;\\n\\t\\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\\n\\t\\tborder-right: 2px solid transparent;\\n\\t\\tanimation: ck-upload-placeholder-loader 1s linear infinite;\\n\\t}\\n}\\n\\n@keyframes ck-upload-placeholder-loader {\\n\\tto {\\n\\t\\ttransform: rotate( 360deg );\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css\"],\"names\":[],\"mappings\":\"AAMC,qEAEC,iBACD,CAGA,uGAIC,MAAO,CAFP,iBAAkB,CAClB,KAED,CCRC,yFACC,oBACD,CAID,uGAIC,gDAAiD,CAFjD,UAAW,CAGX,oBAAuB,CAFvB,OAGD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\t/* Showing animation. */\\n\\t\\t&.ck-appear {\\n\\t\\t\\tanimation: fadeIn 700ms;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\theight: 2px;\\n\\t\\twidth: 0;\\n\\t\\tbackground: var(--ck-color-upload-bar-background);\\n\\t\\ttransition: width 100ms;\\n\\t}\\n}\\n\\n@keyframes fadeIn {\\n\\tfrom { opacity: 0; }\\n\\tto { opacity: 1; }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-text-alternative-form {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css\"],\"names\":[],\"mappings\":\"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCAEC,gDAAiD,CADjD,WAAY,CAEZ,iBAAkB,CAClB,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Class added to span element surrounding currently selected link. */\\n.ck .ck-link_selected {\\n\\tbackground: var(--ck-color-link-selected-background);\\n\\n\\t/* Give linked inline images some outline to let the user know they are also part of the link. */\\n\\t& span.image-inline {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\\n\\t}\\n}\\n\\n/*\\n * Classes used by the \\\"fake visual selection\\\" displayed in the content when an input\\n * in the link UI has focus (the browser does not render the native selection in this state).\\n */\\n.ck .ck-fake-link-selection {\\n\\tbackground: var(--ck-color-link-fake-selection);\\n}\\n\\n/* A collapsed fake visual selection. */\\n.ck .ck-fake-link-selection_collapsed {\\n\\theight: 100%;\\n\\tborder-right: 1px solid var(--ck-color-base-text);\\n\\tmargin-right: -1px;\\n\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css\"],\"names\":[],\"mappings\":\"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCIA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EAEC,kCAAmC,CAEnC,cAAe,CAIf,+BAAgC,CAChC,aAAc,CARd,kCAAmC,CASnC,iBAAkB,CAPlB,sBAYD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDtDD,oCC0DC,wDACC,8DAMD,CAJC,0EAEC,cAAe,CADf,WAED,CAGD,gJAME,aAEF,CDzED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-link-actions__preview {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-link-actions__preview {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\t& .ck-button.ck-link-actions__preview {\\n\\t\\tpadding-left: 0;\\n\\t\\tpadding-right: 0;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tpadding: 0 var(--ck-spacing-medium);\\n\\t\\t\\tcolor: var(--ck-color-link-default);\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\tcursor: pointer;\\n\\n\\t\\t\\t/* Match the box model of the link editor form's input so the balloon\\n\\t\\t\\tdoes not change width when moving between actions and the form. */\\n\\t\\t\\tmax-width: var(--ck-input-width);\\n\\t\\t\\tmin-width: 3em;\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&,\\n\\t\\t&:hover,\\n\\t\\t&:focus,\\n\\t\\t&:active {\\n\\t\\t\\tbackground: none;\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&:focus {\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-button:not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-button:not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button.ck-link-actions__preview {\\n\\t\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\tmax-width: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical>.ck-button{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css\"],\"names\":[],\"mappings\":\"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCAEC,+BAAgC,CADhC,SAgDD,CA7CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CAIC,eAAgB,CAFhB,QAAS,CADT,kCAAmC,CAEnC,SAkBD,CAfC,wDACC,gDACD,CARD,4GAeE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAUD,CARC,wEACC,SAAU,CACV,UAKD,CAHC,8EACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-form {\\n\\tdisplay: flex;\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tdisplay: block;\\n\\n\\t/*\\n\\t * Whether the form is in the responsive mode or not, if there are decorator buttons\\n\\t * keep the top margin of action buttons medium.\\n\\t */\\n\\t& .ck-button {\\n\\t\\t&.ck-button-save,\\n\\t\\t&.ck-button-cancel {\\n\\t\\t\\tmargin-top: var(--ck-spacing-medium);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tpadding: 0;\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\\n\\n\\t\\t& .ck-input-text {\\n\\t\\t\\tmin-width: 0;\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-button {\\n\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\tmargin: 0;\\n\\t\\twidth: 50%;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\\n\\t& .ck.ck-list {\\n\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button.ck-switchbutton {\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/list.css\"],\"names\":[],\"mappings\":\"AAKA,eACC,uBAiBD,CAfC,kBACC,2BAaD,CAXC,qBACC,2BASD,CAPC,wBACC,2BAKD,CAHC,2BACC,2BACD,CAMJ,eACC,oBAaD,CAXC,kBACC,sBASD,CAJE,6CACC,sBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content ol {\\n\\tlist-style-type: decimal;\\n\\n\\t& ol {\\n\\t\\tlist-style-type: lower-latin;\\n\\n\\t\\t& ol {\\n\\t\\t\\tlist-style-type: lower-roman;\\n\\n\\t\\t\\t& ol {\\n\\t\\t\\t\\tlist-style-type: upper-latin;\\n\\n\\t\\t\\t\\t& ol {\\n\\t\\t\\t\\t\\tlist-style-type: upper-roman;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck-content ul {\\n\\tlist-style-type: disc;\\n\\n\\t& ul {\\n\\t\\tlist-style-type: circle;\\n\\n\\t\\t& ul {\\n\\t\\t\\tlist-style-type: square;\\n\\n\\t\\t\\t& ul {\\n\\t\\t\\t\\tlist-style-type: square;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css\"],\"names\":[],\"mappings\":\"AAKA,mBAGC,UAAW,CASX,aAAc,CAJd,aAAe,CAQf,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .media {\\n\\t/* Don't allow floated content overlap the media.\\n\\thttps://github.com/ckeditor/ckeditor5-media-embed/issues/53 */\\n\\tclear: both;\\n\\n\\t/* Make sure there is some space between the content and the media. */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em 0;\\n\\n\\t/* Make sure media is not overriden with Bootstrap default `flex` value.\\n\\tSee: https://github.com/ckeditor/ckeditor5/issues/1373. */\\n\\tdisplay: block;\\n\\n\\t/* Give the media some minimal width in the content to prevent them\\n\\tfrom being \\\"squashed\\\" in tight spaces, e.g. in table cells (#44) */\\n\\tmin-width: 15em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*=\\\"open.spotify.com\\\"]{max-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Im0yMDYuNDc3IDI2MC45LTI4Ljk4NyAyOC45ODdhNS4yMTggNS4yMTggMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiIGZpbGw9IiM1Yzg4YzUiLz48cGF0aCBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwNy4zMzMuNTAyLjY1IDEuMDA1Ljk1IDEuNTA4LjM0My40NzcuNjczLjk1Ny45ODggMS40NCAxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5LjMxNS0uNDgyLjY0NS0uOTYyLjk4OC0xLjQzOS4zLS41MDMuNjE3LTEuMDA2Ljk1LTEuNTA4LjM1OS0uNy43Ni0xLjQwNCAxLjE5LTIuMTA3IDEuNDI2LTIuNDAyIDItNS4xMTQgMi4wMDQtNy44NzUgMC04Ljg0NC03LjUxMS0xNi4wMTQtMTYuNzc2LTE2LjAxNHoiIGZpbGw9IiNkZDRiM2UiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PGVsbGlwc2Ugcnk9IjUuNTY0IiByeD0iNS44MjgiIGN5PSIyMzkuMDAyIiBjeD0iMjI2Ljc0MiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMTkwLjMwMSAyMzcuMjgzYy00LjY3IDAtOC40NTcgMy44NTMtOC40NTcgOC42MDZzMy43ODYgOC42MDcgOC40NTcgOC42MDdjMy4wNDMgMCA0LjgwNi0uOTU4IDYuMzM3LTIuNTE2IDEuNTMtMS41NTcgMi4wODctMy45MTMgMi4wODctNi4yOSAwLS4zNjItLjAyMy0uNzIyLS4wNjQtMS4wNzloLTguMjU3djMuMDQzaDQuODVjLS4xOTcuNzU5LS41MzEgMS40NS0xLjA1OCAxLjk4Ni0uOTQyLjk1OC0yLjAyOCAxLjU0OC0zLjkwMSAxLjU0OC0yLjg3NiAwLTUuMjA4LTIuMzcyLTUuMjA4LTUuMjk5IDAtMi45MjYgMi4zMzItNS4yOTkgNS4yMDgtNS4yOTkgMS4zOTkgMCAyLjYxOC40MDcgMy41ODQgMS4yOTNsMi4zODEtMi4zOGMwLS4wMDItLjAwMy0uMDA0LS4wMDQtLjAwNS0xLjU4OC0xLjUyNC0zLjYyLTIuMjE1LTUuOTU1LTIuMjE1em00LjQzIDUuNjYuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0ibTIxNS4xODQgMjUxLjkyOS03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVhNS4yMzMgNS4yMzMgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjlsLS4wMDItLjAwM3oiIGZpbGw9IiNjM2MzYzMiLz48cGF0aCBkPSJtMjEyLjk4MyAyNDguNDk1LTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOCA1LjIzOGgxLjAxNWwzNS42NjYtMzUuNjY2YTEzNi4yNzUgMTM2LjI3NSAwIDAgMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAgMC0uOTg5LTEuNDQgMzUuMTI3IDM1LjEyNyAwIDAgMC0uOTUtMS41MDhjLS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OVptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OVoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzNabTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1Wk00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDAgNDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-media-embed/mediaembedediting.css\"],\"names\":[],\"mappings\":\"AAMC,0CAGC,kBAAmB,CAFnB,YAAa,CACb,qBAcD,CAXC,sEAEC,cAAe,CAEf,iBAMD,CAJC,wGAEC,aAAc,CADd,eAED,CAWD,6kBACC,YACD,CAYF,2LACC,mBACD,CC1CA,MACC,0CAA2C,CAE3C,mDAA4D,CAC5D,2EACD,CAEA,mBACC,aA+FD,CA7FC,0CAEC,0CAA2C,CAD3C,0CA6BD,CA1BC,uEAIC,uBAA2B,CAC3B,qBAAsB,CAHtB,kDAAmD,CACnD,qCAAsC,CAFtC,qDAUD,CAJC,gFAEC,WAAY,CADZ,UAED,CAGD,4EACC,sDAAuD,CAGvD,iBAAkB,CADlB,iBAAkB,CAElB,sBAAuB,CAHvB,kBAUD,CALC,kFACC,4DAA6D,CAC7D,cAAe,CACf,yBACD,CAIF,wDAEC,gBAAiB,CADjB,eAED,CAEA,4UAIC,wvGACD,CAEA,2EACC,kBAaD,CAXC,wGACC,orBACD,CAEA,6GACC,UAKD,CAHC,mHACC,UACD,CAIF,4EACC,2DAcD,CAZC,yGACC,4jHACD,CAGA,8GACC,aAKD,CAHC,oHACC,UACD,CAIF,6EAEC,iDAaD,CAXC,0GACC,wiCACD,CAEA,+GACC,aAKD,CAHC,qHACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-media__wrapper {\\n\\t& .ck-media__placeholder {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\talign-items: center;\\n\\n\\t\\t& .ck-media__placeholder__url {\\n\\t\\t\\t/* Otherwise the URL will overflow when the content is very narrow. */\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\tposition: relative;\\n\\n\\t\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\t\\toverflow: hidden;\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"twitter.com\\\"],\\n\\t&[data-oembed-url*=\\\"google.com/maps\\\"],\\n\\t&[data-oembed-url*=\\\"goo.gl/maps\\\"],\\n\\t&[data-oembed-url*=\\\"maps.google.com\\\"],\\n\\t&[data-oembed-url*=\\\"maps.app.goo.gl\\\"],\\n\\t&[data-oembed-url*=\\\"facebook.com\\\"],\\n\\t&[data-oembed-url*=\\\"instagram.com\\\"] {\\n\\t\\t& .ck-media__placeholder__icon * {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Disable all mouse interaction as long as the editor is not read–only.\\n https://github.com/ckeditor/ckeditor5-media-embed/issues/58 */\\n.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper > *:not(.ck-media__placeholder) {\\n\\tpointer-events: none;\\n}\\n\\n/* Disable all mouse interaction when the widget is not selected (e.g. to avoid opening links by accident).\\n https://github.com/ckeditor/ckeditor5-media-embed/issues/18 */\\n.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder {\\n\\tpointer-events: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-media-embed-placeholder-icon-size: 3em;\\n\\n\\t--ck-color-media-embed-placeholder-url-text: hsl(0, 0%, 46%);\\n\\t--ck-color-media-embed-placeholder-url-text-hover: var(--ck-color-base-text);\\n}\\n\\n.ck-media__wrapper {\\n\\tmargin: 0 auto;\\n\\n\\t& .ck-media__placeholder {\\n\\t\\tpadding: calc( 3 * var(--ck-spacing-standard) );\\n\\t\\tbackground: var(--ck-color-base-foreground);\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tmin-width: var(--ck-media-embed-placeholder-icon-size);\\n\\t\\t\\theight: var(--ck-media-embed-placeholder-icon-size);\\n\\t\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t\\t\\tbackground-position: center;\\n\\t\\t\\tbackground-size: cover;\\n\\n\\t\\t\\t& .ck-icon {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\theight: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: var(--ck-color-media-embed-placeholder-url-text);\\n\\t\\t\\twhite-space: nowrap;\\n\\t\\t\\ttext-align: center;\\n\\t\\t\\tfont-style: italic;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: var(--ck-color-media-embed-placeholder-url-text-hover);\\n\\t\\t\\t\\tcursor: pointer;\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"open.spotify.com\\\"] {\\n\\t\\tmax-width: 300px;\\n\\t\\tmax-height: 380px;\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon {\\n\\t\\tbackground-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMTJjLjE4Mi40MTIuNTE2LjY2Ni44NzkuNjY3LjQwMy0uMDAxLjc2OC0uMzE0LjkzLS43OTkuNjAzLTUuNzU2IDIuMjM4LTkuNzI5IDQuNTg1LTEzLjc5NC43ODItMS4zNSAxLjY3My0yLjcxNSAyLjQ2NS0zLjk5IDEuMTM3LTEuNjY2IDIuMzI4LTMuNCAzLjYzOC01LjE2OS4zMTUtLjQ4Mi42NDUtLjk2Mi45ODgtMS40MzkuMy0uNTAzLjYxNy0xLjAwNi45NS0xLjUwOC4zNTktLjcuNzYtMS40MDQgMS4xOS0yLjEwNyAxLjQyNi0yLjQwMiAyLTUuMTE0IDIuMDA0LTcuODc1IDAtOC44NDQtNy41MTEtMTYuMDE0LTE2Ljc3Ni0xNi4wMTR6IiBmaWxsPSIjZGQ0YjNlIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIHJ5PSI1LjU2NCIgcng9IjUuODI4IiBjeT0iMjM5LjAwMiIgY3g9IjIyNi43NDIiIGZpbGw9IiM4MDJkMjciIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjkgMC0uMzYyLS4wMjMtLjcyMi0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhjMC0uMDAyLS4wMDMtLjAwNC0uMDA0LS4wMDUtMS41ODgtMS41MjQtMy42Mi0yLjIxNS01Ljk1NS0yLjIxNXptNC40MyA1LjY2bC4wMDMuMDA2di0uMDAzeiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjE1LjE4NCAyNTEuOTI5bC03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVjLjI4Ny0uNjQ5LjQ0OS0xLjM2Ni40NDktMi4xMjN2LTMxLjE2NWMtLjQ2OS42NzUtLjkzNCAxLjM0OS0xLjM4MiAyLjAwNS0uNzkyIDEuMjc1LTEuNjgyIDIuNjQtMi40NjUgMy45OS0yLjM0NyA0LjA2NS0zLjk4MiA4LjAzOC00LjU4NSAxMy43OTQtLjE2Mi40ODUtLjUyNy43OTgtLjkzLjc5OS0uMzYzLS4wMDEtLjY5Ny0uMjU1LS44NzktLjY2N3YtLjAxMmMtLjU5My01LjgyMi0yLjIzNy05LjgyLTQuNi0xMy45MTQtLjc4My0xLjM1LTEuNjczLTIuNzE1LTIuNDY2LTMuOTktMS4xMzctMS42NjYtMi4zMjctMy40LTMuNjM3LTUuMTY5bC0uMDAyLS4wMDN6IiBmaWxsPSIjYzNjM2MzIi8+PHBhdGggZD0iTTIxMi45ODMgMjQ4LjQ5NWwtMzYuOTUyIDM2Ljk1M3YuODEyYTUuMjI3IDUuMjI3IDAgMCAwIDUuMjM4IDUuMjM4aDEuMDE1bDM1LjY2Ni0zNS42NjZhMTM2LjI3NSAxMzYuMjc1IDAgMCAwLTIuNzY0LTMuOSAzNy41NzUgMzcuNTc1IDAgMCAwLS45ODktMS40NGMtLjI5OS0uNTAzLS42MTYtMS4wMDYtLjk1LTEuNTA4LS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjExLjk5OCAyNjEuMDgzbC02LjE1MiA2LjE1MSAyNC4yNjQgMjQuMjY0aC43ODFhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzktNS4yMzh2LTEuMDQ1eiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48L2c+PC9zdmc+);\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder {\\n\\t\\tbackground: hsl(220, 46%, 48%);\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMDI0cHgiIGhlaWdodD0iMTAyNHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPkZpbGwgMTwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImZMb2dvX1doaXRlIiBmaWxsPSIjRkZGRkZFIj4gICAgICAgICAgICA8cGF0aCBkPSJNOTY3LjQ4NCwwIEw1Ni41MTcsMCBDMjUuMzA0LDAgMCwyNS4zMDQgMCw1Ni41MTcgTDAsOTY3LjQ4MyBDMCw5OTguNjk0IDI1LjI5NywxMDI0IDU2LjUyMiwxMDI0IEw1NDcsMTAyNCBMNTQ3LDYyOCBMNDE0LDYyOCBMNDE0LDQ3MyBMNTQ3LDQ3MyBMNTQ3LDM1OS4wMjkgQzU0NywyMjYuNzY3IDYyNy43NzMsMTU0Ljc0NyA3NDUuNzU2LDE1NC43NDcgQzgwMi4yNjksMTU0Ljc0NyA4NTAuODQyLDE1OC45NTUgODY1LDE2MC44MzYgTDg2NSwyOTkgTDc4My4zODQsMjk5LjAzNyBDNzE5LjM5MSwyOTkuMDM3IDcwNywzMjkuNTI5IDcwNywzNzQuMjczIEw3MDcsNDczIEw4NjAuNDg3LDQ3MyBMODQwLjUwMSw2MjggTDcwNyw2MjggTDcwNywxMDI0IEw5NjcuNDg0LDEwMjQgQzk5OC42OTcsMTAyNCAxMDI0LDk5OC42OTcgMTAyNCw5NjcuNDg0IEwxMDI0LDU2LjUxNSBDMTAyNCwyNS4zMDMgOTk4LjY5NywwIDk2Ny40ODQsMCIgaWQ9IkZpbGwtMSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+);\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(220, 100%, 90%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder {\\n\\t\\tbackground: linear-gradient(-135deg,hsl(246, 100%, 39%),hsl(302, 100%, 36%),hsl(0, 100%, 48%));\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI1MDRweCIgaGVpZ2h0PSI1MDRweCIgdmlld0JveD0iMCAwIDUwNCA1MDQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+ICAgICAgICA8dGl0bGU+Z2x5cGgtbG9nb19NYXkyMDE2PC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPiAgICAgICAgPHBvbHlnb24gaWQ9InBhdGgtMSIgcG9pbnRzPSIwIDAuMTU5IDUwMy44NDEgMC4xNTkgNTAzLjg0MSA1MDMuOTQgMCA1MDMuOTQiPjwvcG9seWdvbj4gICAgPC9kZWZzPiAgICA8ZyBpZD0iZ2x5cGgtbG9nb19NYXkyMDE2IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJHcm91cC0zIj4gICAgICAgICAgICA8bWFzayBpZD0ibWFzay0yIiBmaWxsPSJ3aGl0ZSI+ICAgICAgICAgICAgICAgIDx1c2UgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+ICAgICAgICAgICAgPC9tYXNrPiAgICAgICAgICAgIDxnIGlkPSJDbGlwLTIiPjwvZz4gICAgICAgICAgICA8cGF0aCBkPSJNMjUxLjkyMSwwLjE1OSBDMTgzLjUwMywwLjE1OSAxNzQuOTI0LDAuNDQ5IDE0OC4wNTQsMS42NzUgQzEyMS4yNCwyLjg5OCAxMDIuOTI3LDcuMTU3IDg2LjkwMywxMy4zODUgQzcwLjMzNywxOS44MjIgNTYuMjg4LDI4LjQzNiA0Mi4yODIsNDIuNDQxIEMyOC4yNzcsNTYuNDQ3IDE5LjY2Myw3MC40OTYgMTMuMjI2LDg3LjA2MiBDNi45OTgsMTAzLjA4NiAyLjczOSwxMjEuMzk5IDEuNTE2LDE0OC4yMTMgQzAuMjksMTc1LjA4MyAwLDE4My42NjIgMCwyNTIuMDggQzAsMzIwLjQ5NyAwLjI5LDMyOS4wNzYgMS41MTYsMzU1Ljk0NiBDMi43MzksMzgyLjc2IDYuOTk4LDQwMS4wNzMgMTMuMjI2LDQxNy4wOTcgQzE5LjY2Myw0MzMuNjYzIDI4LjI3Nyw0NDcuNzEyIDQyLjI4Miw0NjEuNzE4IEM1Ni4yODgsNDc1LjcyMyA3MC4zMzcsNDg0LjMzNyA4Ni45MDMsNDkwLjc3NSBDMTAyLjkyNyw0OTcuMDAyIDEyMS4yNCw1MDEuMjYxIDE0OC4wNTQsNTAyLjQ4NCBDMTc0LjkyNCw1MDMuNzEgMTgzLjUwMyw1MDQgMjUxLjkyMSw1MDQgQzMyMC4zMzgsNTA0IDMyOC45MTcsNTAzLjcxIDM1NS43ODcsNTAyLjQ4NCBDMzgyLjYwMSw1MDEuMjYxIDQwMC45MTQsNDk3LjAwMiA0MTYuOTM4LDQ5MC43NzUgQzQzMy41MDQsNDg0LjMzNyA0NDcuNTUzLDQ3NS43MjMgNDYxLjU1OSw0NjEuNzE4IEM0NzUuNTY0LDQ0Ny43MTIgNDg0LjE3OCw0MzMuNjYzIDQ5MC42MTYsNDE3LjA5NyBDNDk2Ljg0Myw0MDEuMDczIDUwMS4xMDIsMzgyLjc2IDUwMi4zMjUsMzU1Ljk0NiBDNTAzLjU1MSwzMjkuMDc2IDUwMy44NDEsMzIwLjQ5NyA1MDMuODQxLDI1Mi4wOCBDNTAzLjg0MSwxODMuNjYyIDUwMy41NTEsMTc1LjA4MyA1MDIuMzI1LDE0OC4yMTMgQzUwMS4xMDIsMTIxLjM5OSA0OTYuODQzLDEwMy4wODYgNDkwLjYxNiw4Ny4wNjIgQzQ4NC4xNzgsNzAuNDk2IDQ3NS41NjQsNTYuNDQ3IDQ2MS41NTksNDIuNDQxIEM0NDcuNTUzLDI4LjQzNiA0MzMuNTA0LDE5LjgyMiA0MTYuOTM4LDEzLjM4NSBDNDAwLjkxNCw3LjE1NyAzODIuNjAxLDIuODk4IDM1NS43ODcsMS42NzUgQzMyOC45MTcsMC40NDkgMzIwLjMzOCwwLjE1OSAyNTEuOTIxLDAuMTU5IFogTTI1MS45MjEsNDUuNTUgQzMxOS4xODYsNDUuNTUgMzI3LjE1NCw0NS44MDcgMzUzLjcxOCw0Ny4wMTkgQzM3OC4yOCw0OC4xMzkgMzkxLjYxOSw1Mi4yNDMgNDAwLjQ5Niw1NS42OTMgQzQxMi4yNTUsNjAuMjYzIDQyMC42NDcsNjUuNzIyIDQyOS40NjIsNzQuNTM4IEM0MzguMjc4LDgzLjM1MyA0NDMuNzM3LDkxLjc0NSA0NDguMzA3LDEwMy41MDQgQzQ1MS43NTcsMTEyLjM4MSA0NTUuODYxLDEyNS43MiA0NTYuOTgxLDE1MC4yODIgQzQ1OC4xOTMsMTc2Ljg0NiA0NTguNDUsMTg0LjgxNCA0NTguNDUsMjUyLjA4IEM0NTguNDUsMzE5LjM0NSA0NTguMTkzLDMyNy4zMTMgNDU2Ljk4MSwzNTMuODc3IEM0NTUuODYxLDM3OC40MzkgNDUxLjc1NywzOTEuNzc4IDQ0OC4zMDcsNDAwLjY1NSBDNDQzLjczNyw0MTIuNDE0IDQzOC4yNzgsNDIwLjgwNiA0MjkuNDYyLDQyOS42MjEgQzQyMC42NDcsNDM4LjQzNyA0MTIuMjU1LDQ0My44OTYgNDAwLjQ5Niw0NDguNDY2IEMzOTEuNjE5LDQ1MS45MTYgMzc4LjI4LDQ1Ni4wMiAzNTMuNzE4LDQ1Ny4xNCBDMzI3LjE1OCw0NTguMzUyIDMxOS4xOTEsNDU4LjYwOSAyNTEuOTIxLDQ1OC42MDkgQzE4NC42NSw0NTguNjA5IDE3Ni42ODQsNDU4LjM1MiAxNTAuMTIzLDQ1Ny4xNCBDMTI1LjU2MSw0NTYuMDIgMTEyLjIyMiw0NTEuOTE2IDEwMy4zNDUsNDQ4LjQ2NiBDOTEuNTg2LDQ0My44OTYgODMuMTk0LDQzOC40MzcgNzQuMzc5LDQyOS42MjEgQzY1LjU2NCw0MjAuODA2IDYwLjEwNCw0MTIuNDE0IDU1LjUzNCw0MDAuNjU1IEM1Mi4wODQsMzkxLjc3OCA0Ny45OCwzNzguNDM5IDQ2Ljg2LDM1My44NzcgQzQ1LjY0OCwzMjcuMzEzIDQ1LjM5MSwzMTkuMzQ1IDQ1LjM5MSwyNTIuMDggQzQ1LjM5MSwxODQuODE0IDQ1LjY0OCwxNzYuODQ2IDQ2Ljg2LDE1MC4yODIgQzQ3Ljk4LDEyNS43MiA1Mi4wODQsMTEyLjM4MSA1NS41MzQsMTAzLjUwNCBDNjAuMTA0LDkxLjc0NSA2NS41NjMsODMuMzUzIDc0LjM3OSw3NC41MzggQzgzLjE5NCw2NS43MjIgOTEuNTg2LDYwLjI2MyAxMDMuMzQ1LDU1LjY5MyBDMTEyLjIyMiw1Mi4yNDMgMTI1LjU2MSw0OC4xMzkgMTUwLjEyMyw0Ny4wMTkgQzE3Ni42ODcsNDUuODA3IDE4NC42NTUsNDUuNTUgMjUxLjkyMSw0NS41NSBaIiBpZD0iRmlsbC0xIiBmaWxsPSIjRkZGRkZGIiBtYXNrPSJ1cmwoI21hc2stMikiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgICAgIDxwYXRoIGQ9Ik0yNTEuOTIxLDMzNi4wNTMgQzIwNS41NDMsMzM2LjA1MyAxNjcuOTQ3LDI5OC40NTcgMTY3Ljk0NywyNTIuMDggQzE2Ny45NDcsMjA1LjcwMiAyMDUuNTQzLDE2OC4xMDYgMjUxLjkyMSwxNjguMTA2IEMyOTguMjk4LDE2OC4xMDYgMzM1Ljg5NCwyMDUuNzAyIDMzNS44OTQsMjUyLjA4IEMzMzUuODk0LDI5OC40NTcgMjk4LjI5OCwzMzYuMDUzIDI1MS45MjEsMzM2LjA1MyBaIE0yNTEuOTIxLDEyMi43MTUgQzE4MC40NzQsMTIyLjcxNSAxMjIuNTU2LDE4MC42MzMgMTIyLjU1NiwyNTIuMDggQzEyMi41NTYsMzIzLjUyNiAxODAuNDc0LDM4MS40NDQgMjUxLjkyMSwzODEuNDQ0IEMzMjMuMzY3LDM4MS40NDQgMzgxLjI4NSwzMjMuNTI2IDM4MS4yODUsMjUyLjA4IEMzODEuMjg1LDE4MC42MzMgMzIzLjM2NywxMjIuNzE1IDI1MS45MjEsMTIyLjcxNSBaIiBpZD0iRmlsbC00IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgICAgICA8cGF0aCBkPSJNNDE2LjYyNywxMTcuNjA0IEM0MTYuNjI3LDEzNC4zIDQwMy4wOTIsMTQ3LjgzNCAzODYuMzk2LDE0Ny44MzQgQzM2OS43MDEsMTQ3LjgzNCAzNTYuMTY2LDEzNC4zIDM1Ni4xNjYsMTE3LjYwNCBDMzU2LjE2NiwxMDAuOTA4IDM2OS43MDEsODcuMzczIDM4Ni4zOTYsODcuMzczIEM0MDMuMDkyLDg3LjM3MyA0MTYuNjI3LDEwMC45MDggNDE2LjYyNywxMTcuNjA0IiBpZD0iRmlsbC01IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgIDwvZz48L3N2Zz4=);\\n\\t\\t}\\n\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(302, 100%, 94%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder {\\n\\t\\t/* Use gradient to contrast with focused widget (ckeditor/ckeditor5-media-embed#22). */\\n\\t\\tbackground: linear-gradient( to right, hsl(201, 85%, 70%), hsl(201, 85%, 35%) );\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQwMCA0MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojRkZGRkZGO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MDAsMjAwYzAsMTEwLjUtODkuNSwyMDAtMjAwLDIwMFMwLDMxMC41LDAsMjAwUzg5LjUsMCwyMDAsMFM0MDAsODkuNSw0MDAsMjAweiBNMTYzLjQsMzA1LjVjODguNywwLDEzNy4yLTczLjUsMTM3LjItMTM3LjJjMC0yLjEsMC00LjItMC4xLTYuMmM5LjQtNi44LDE3LjYtMTUuMywyNC4xLTI1Yy04LjYsMy44LTE3LjksNi40LTI3LjcsNy42YzEwLTYsMTcuNi0xNS40LDIxLjItMjYuN2MtOS4zLDUuNS0xOS42LDkuNS0zMC42LDExLjdjLTguOC05LjQtMjEuMy0xNS4yLTM1LjItMTUuMmMtMjYuNiwwLTQ4LjIsMjEuNi00OC4yLDQ4LjJjMCwzLjgsMC40LDcuNSwxLjMsMTFjLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40Yy00LjEsNy4xLTYuNSwxNS40LTYuNSwyNC4yYzAsMTYuNyw4LjUsMzEuNSwyMS41LDQwLjFjLTcuOS0wLjItMTUuMy0yLjQtMjEuOC02YzAsMC4yLDAsMC40LDAsMC42YzAsMjMuNCwxNi42LDQyLjgsMzguNyw0Ny4zYy00LDEuMS04LjMsMS43LTEyLjcsMS43Yy0zLjEsMC02LjEtMC4zLTkuMS0wLjljNi4xLDE5LjIsMjMuOSwzMy4xLDQ1LDMzLjVjLTE2LjUsMTIuOS0zNy4zLDIwLjYtNTkuOSwyMC42Yy0zLjksMC03LjctMC4yLTExLjUtMC43QzExMC44LDI5Ny41LDEzNi4yLDMwNS41LDE2My40LDMwNS41Ii8+PC9zdmc+);\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(201, 100%, 86%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,kBAEC,sBAAuB,CADvB,YAAa,CAEb,kBAAmB,CACnB,gBAqBD,CAnBC,yCACC,oBACD,CAEA,4BACC,YACD,CCbA,oCDCD,kBAeE,cAUF,CARE,yCACC,eACD,CAEA,6BACC,cACD,CCtBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-media-form {\\n\\tdisplay: flex;\\n\\talign-items: flex-start;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-mention-background:rgba(153,0,48,.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-mention/mention.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,+CAAwD,CACxD,+BACD,CAEA,qBACC,6CAA8C,CAC9C,kCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-mention-background: hsla(341, 100%, 30%, 0.1);\\n\\t--ck-color-mention-text: hsl(341, 100%, 30%);\\n}\\n\\n.ck-content .mention {\\n\\tbackground: var(--ck-color-mention-background);\\n\\tcolor: var(--ck-color-mention-text);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{flex-shrink:0;overflow:hidden}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,kCACD,CAEA,gBACC,4CAA6C,CAM7C,iBAAkB,CAJlB,eAAgB,CAMhB,2BAQD,CAJC,+BAEC,aAAc,CADd,eAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-mention-list-max-height: 300px;\\n}\\n\\n.ck.ck-mentions {\\n\\tmax-height: var(--ck-mention-list-max-height);\\n\\n\\toverflow-y: auto;\\n\\n\\t/* Prevent unnecessary horizontal scrollbar in Safari\\n\\thttps://github.com/ckeditor/ckeditor5-mention/issues/41 */\\n\\toverflow-x: hidden;\\n\\n\\toverscroll-behavior: contain;\\n\\n\\t/* Prevent unnecessary vertical scrollbar in Safari\\n\\thttps://github.com/ckeditor/ckeditor5-mention/issues/41 */\\n\\t& > .ck-list__item {\\n\\t\\toverflow: hidden;\\n\\t\\tflex-shrink: 0;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);height:20px;width:20px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,YAAa,CACb,0BAA2B,CAF3B,UAgCD,CA5BC,0CAEC,WAAY,CADZ,cAED,CAEA,sCACC,cAMD,CAHC,kFACC,YACD,CAGD,8CAEC,YAWD,CATC,kFAEC,eAAgB,CADhB,iBAOD,CAJC,0IAEC,aAAc,CADd,iBAED,CC1BF,+CAGE,4BAA6B,CAD7B,yBAcF,CAhBA,+CAQE,2BAA4B,CAD5B,wBASF,CAHC,2CACC,SACD,CAIA,wEACC,SA0CD,CA3CA,kFAKE,2BAA4B,CAD5B,wBAuCF,CApCE,8FACC,iCACD,CATF,kFAcE,4BAA6B,CAD7B,yBA8BF,CA3BE,8FACC,kCACD,CAGD,oFACC,oDACD,CAEA,4GC1CF,eD2DE,CAjBA,+PCtCD,qCDuDC,CAjBA,4GAKC,6CAA8C,CAD9C,WAAY,CADZ,UAcD,CAVC,oKAKC,cAA6B,CAC7B,iBAAkB,CAHlB,WAAY,CADZ,QAAS,CADT,QAAS,CAMT,uBAAwB,CACxB,oBAAqB,CAJrB,QAKD,CAKH,oDAIC,2BAA4B,CAC5B,4BAA6B,CAH7B,qEAAwE,CADxE,UA0BD,CApBC,gEACC,oDACD,CATD,8DAYE,yBAeF,CA3BA,8DAgBE,wBAWF,CARC,gEACC,uCAMD,CAPA,0EAKE,sCAAuC,CADvC,cAGF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-input-color {\\n\\twidth: 100%;\\n\\tdisplay: flex;\\n\\tflex-direction: row-reverse;\\n\\n\\t& > input.ck.ck-input-text {\\n\\t\\tmin-width: auto;\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t& > div.ck.ck-dropdown {\\n\\t\\tmin-width: auto;\\n\\n\\t\\t/* This dropdown has no arrow but a color preview instead. */\\n\\t\\t& > .ck-input-color__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__button {\\n\\t\\t/* Resolving issue with misaligned buttons on Safari (see #10589) */\\n\\t\\tdisplay: flex;\\n\\n\\t\\t& .ck.ck-input-color__button__preview {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n.ck.ck-input-color {\\n\\t& > .ck.ck-input-text {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* Make sure the focused input is always on top of the dropdown button so its\\n\\t\\t outline and border are never cropped (also when the input is read-only). */\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-dropdown {\\n\\t\\t& > .ck.ck-button.ck-input-color__button {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-left: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-right: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t&.ck-disabled {\\n\\t\\t\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview {\\n\\t\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\t\\twidth: 20px;\\n\\t\\t\\t\\theight: 20px;\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-input-border);\\n\\n\\t\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\t\\ttop: -30%;\\n\\t\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\t\\theight: 150%;\\n\\t\\t\\t\\t\\twidth: 8%;\\n\\t\\t\\t\\t\\tbackground: hsl(0, 100%, 50%);\\n\\t\\t\\t\\t\\tborder-radius: 2px;\\n\\t\\t\\t\\t\\ttransform: rotate(45deg);\\n\\t\\t\\t\\t\\ttransform-origin: 50%;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__remove-color {\\n\\t\\twidth: 100%;\\n\\t\\tpadding: calc(var(--ck-spacing-standard) / 2) var(--ck-spacing-standard);\\n\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-bottom: 1px solid var(--ck-color-input-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: 0;\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/form.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,mCAyBD,CAvBC,kBAEC,YACD,CAEA,8BACC,cAAe,CACf,OACD,CAEA,4BACC,cAWD,CARE,6DACC,4CACD,CAEA,mEACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form {\\n\\tpadding: 0 0 var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t& .ck.ck-input-text {\\n\\t\\tmin-width: 100%;\\n\\t\\twidth: 0;\\n\\t}\\n\\n\\t& .ck.ck-dropdown {\\n\\t\\tmin-width: 100%;\\n\\n\\t\\t& .ck-dropdown__button {\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/formrow.css\"],\"names\":[],\"mappings\":\"AAKA,iBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAaD,CAVC,iCACC,WACD,CAGC,wHAEC,sBACD,CCbF,iBACC,4DA2BD,CAvBE,6CAEE,mCAMF,CARA,6CAME,oCAEF,CAGD,2BAEC,cAAe,CADf,UAED,CAEA,2CACC,kCAKD,CAHC,wEACC,0BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\t& .ck-button-save,\\n\\t\\t& .ck-button-cancel {\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-form__row {\\n\\tpadding: var(--ck-spacing-standard) var(--ck-spacing-large) 0;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\t& + * {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-label {\\n\\t\\twidth: 100%;\\n\\t\\tmin-width: 100%;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button .ck-button__label {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css\"],\"names\":[],\"mappings\":\"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAGC,yFAA0F,CAD1F,oJAED,CAEA,mFAEC,iBACD,CAEA,uCAIC,4CAA6C,CAC7C,iBAAkB,CAFlB,iDAAkD,CADlD,qDAAsD,CADtD,mDAAoD,CAKpD,YAAa,CACb,eAUD,CARC,6CACC,eACD,CAEA,6CAEC,6CAA8C,CAD9C,yCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: wrap;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-insert-table-dropdown-padding: 10px;\\n\\t--ck-insert-table-dropdown-box-height: 11px;\\n\\t--ck-insert-table-dropdown-box-width: 12px;\\n\\t--ck-insert-table-dropdown-box-margin: 1px;\\n}\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\t/* The width of a container should match 10 items in a row so there will be a 10x10 grid. */\\n\\twidth: calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);\\n\\tpadding: var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;\\n}\\n\\n.ck .ck-insert-table-dropdown__label,\\n.ck[dir=rtl] .ck-insert-table-dropdown__label {\\n\\ttext-align: center;\\n}\\n\\n.ck .ck-insert-table-dropdown-grid-box {\\n\\tmin-width: var(--ck-insert-table-dropdown-box-width);\\n\\tmin-height: var(--ck-insert-table-dropdown-box-height);\\n\\tmargin: var(--ck-insert-table-dropdown-box-margin);\\n\\tborder: 1px solid var(--ck-color-base-border);\\n\\tborder-radius: 1px;\\n\\toutline: none;\\n\\ttransition: none;\\n\\n\\t&:focus {\\n\\t\\tbox-shadow: none;\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\tborder-color: var(--ck-color-focus-border);\\n\\t\\tbackground: var(--ck-color-focus-outer-shadow);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/table.css\"],\"names\":[],\"mappings\":\"AAKA,mBAKC,aAAc,CADd,gBAiCD,CA9BC,yBAYC,yBAAkC,CAVlC,wBAAyB,CACzB,gBAAiB,CAKjB,WAAY,CADZ,UAsBD,CAfC,wDAQC,wBAAiC,CANjC,aAAc,CACd,YAMD,CAEA,4BAEC,0BAA+B,CAD/B,eAED,CAMF,+BACC,gBACD,CAEA,+BACC,eACD,CAEA,+CAKC,oBAAqB,CAMrB,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .table {\\n\\t/* Give the table widget some air and center it horizontally */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em auto;\\n\\tdisplay: table;\\n\\n\\t& table {\\n\\t\\t/* The table cells should have slight borders */\\n\\t\\tborder-collapse: collapse;\\n\\t\\tborder-spacing: 0;\\n\\n\\t\\t/* Table width and height are set on the parent
    . Make sure the table inside stretches\\n\\t\\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\n\\t\\t/* The outer border of the table should be slightly darker than the inner lines.\\n\\t\\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\\n\\t\\tborder: 1px double hsl(0, 0%, 70%);\\n\\n\\t\\t& td,\\n\\t\\t& th {\\n\\t\\t\\tmin-width: 2em;\\n\\t\\t\\tpadding: .4em;\\n\\n\\t\\t\\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.\\n\\t\\t\\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\\n\\t\\t\\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\\n\\t\\t\\tborder: 1px solid hsl(0, 0%, 75%);\\n\\t\\t}\\n\\n\\t\\t& th {\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tbackground: hsla(0, 0%, 0%, 5%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\\nwhen content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\\n.ck-content[dir=\\\"rtl\\\"] .table th {\\n\\ttext-align: right;\\n}\\n\\n.ck-content[dir=\\\"ltr\\\"] .table th {\\n\\ttext-align: left;\\n}\\n\\n.ck-editor__editable .ck-table-bogus-paragraph {\\n\\t/*\\n\\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\\n\\t */\\n\\tdisplay: inline-block;\\n\\n\\t/*\\n\\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\\n\\t */\\n\\twidth: 100%;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tablecellproperties.css\"],\"names\":[],\"mappings\":\"AAOE,6FACC,cAiBD,CAdE,0HAEC,cACD,CAEA,yHAEC,cACD,CAEA,uHACC,WACD,CClBJ,kCACC,WAkBD,CAfE,2FACC,mBAAoB,CACpB,SAAU,CACV,SACD,CAGC,4GACC,eAAgB,CAGhB,qCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\t&:first-of-type {\\n\\t\\t\\t\\t\\t/* 4 buttons out of 7 (h-alignment + v-alignment) = 0.57 */\\n\\t\\t\\t\\t\\tflex-grow: 0.57;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\t/* 3 buttons out of 7 (h-alignment + v-alignment) = 0.43 */\\n\\t\\t\\t\\t\\tflex-grow: 0.43;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& .ck-button {\\n\\t\\t\\t\\t\\tflex-grow: 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__padding-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 25%;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-table-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableediting.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,6DACD,CAKE,8QAGC,wDAAyD,CAKzD,iBAAkB,CAClB,8CAA+C,CAC/C,mBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-table-focused-cell-background: hsla(212, 90%, 80%, .3);\\n}\\n\\n.ck-widget.table {\\n\\t& td,\\n\\t& th {\\n\\t\\t&.ck-editor__nested-editable.ck-editor__nested-editable_focused,\\n\\t\\t&.ck-editor__nested-editable:focus {\\n\\t\\t\\t/* A very slight background to highlight the focused cell */\\n\\t\\t\\tbackground: var(--ck-color-table-focused-cell-background);\\n\\n\\t\\t\\t/* Fixes the problem where surrounding cells cover the focused cell's border.\\n\\t\\t\\tIt does not fix the problem in all places but the UX is improved.\\n\\t\\t\\tSee https://github.com/ckeditor/ckeditor5-table/issues/29. */\\n\\t\\t\\tborder-style: none;\\n\\t\\t\\toutline: 1px solid var(--ck-color-focus-border);\\n\\t\\t\\toutline-offset: -1px; /* progressive enhancement - no IE support */\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:\\\"\\\";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAWE,wHACC,cACD,CAEA,8DAEC,kBAAmB,CADnB,cAgBD,CAbC,qFAGC,kBAAmB,CAFnB,YAAa,CACb,6BAMD,CAEA,sMACC,WACD,CAIF,4CAEC,iBAoBD,CAlBC,8EAGC,2DAAgE,CADhE,QAAS,CADT,iBAAkB,CAGlB,8BAA+B,CAG/B,SAUD,CAPC,oFACC,UAAW,CAGX,QAAS,CAFT,iBAAkB,CAClB,wDAA6D,CAE7D,0BACD,CChDH,MACC,0CAA2C,CAC3C,2CACD,CAMI,2FACC,kCAAmC,CACnC,iBACD,CAGD,8KAIC,cAAe,CADf,cAAe,CADf,UAGD,CAGD,8DACC,SAcD,CAZC,yMAEC,QACD,CAEA,iGACC,mBAAoB,CACpB,oBAAqB,CACrB,wCAAyC,CACzC,6CAA8C,CAC9C,gCACD,CAIF,4CACC,sCAyBD,CAvBC,8ECxCD,eDyDC,CAjBA,mMCpCA,qCDqDA,CAjBA,8EAGC,qCAAsC,CACtC,qCAAsC,CAEtC,oDAAqD,CADrD,wDAAyD,CAEzD,iBAUD,CAPC,oFACC,2EAA4E,CAE5E,kBAAmB,CADnB,kJAED,CAdD,8EAgBC,iEACD,CAGA,6GACC,YACD,CAIF,oDACC,GACC,SACD,CAEA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__background-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\tdisplay: flex;\\n\\t\\t\\t\\tflex-direction: column-reverse;\\n\\t\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t\\t& .ck.ck-dropdown {\\n\\t\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\t/* Allow absolute positioning of the status (error) balloons. */\\n\\t\\tposition: relative;\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tbottom: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\ttransform: translate(-50%,100%);\\n\\n\\t\\t\\t/* Make sure the balloon status stays on top of other form elements. */\\n\\t\\t\\tz-index: 1;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\ttop: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttransform: translateX( -50% );\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-table-properties-error-arrow-size: 6px;\\n\\t--ck-table-properties-min-error-width: 150px;\\n}\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\t& > .ck-label {\\n\\t\\t\\t\\t\\tfont-size: var(--ck-font-size-tiny);\\n\\t\\t\\t\\t\\ttext-align: center;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__border-style,\\n\\t\\t\\t& .ck-table-form__border-width {\\n\\t\\t\\t\\twidth: 80px;\\n\\t\\t\\t\\tmin-width: 80px;\\n\\t\\t\\t\\tmax-width: 80px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck-table-form__dimensions-row__width,\\n\\t\\t\\t& .ck-table-form__dimensions-row__height {\\n\\t\\t\\t\\tmargin: 0\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\talign-self: flex-end;\\n\\t\\t\\t\\tdisplay: inline-block;\\n\\t\\t\\t\\theight: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tline-height: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tmargin: 0 var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\tpadding-top: var(--ck-spacing-standard);\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\tbackground: var(--ck-color-base-error);\\n\\t\\t\\tcolor: var(--ck-color-base-background);\\n\\t\\t\\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\\n\\t\\t\\tmin-width: var(--ck-table-properties-min-error-width);\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-color: transparent transparent var(--ck-color-base-error) transparent;\\n\\t\\t\\t\\tborder-width: 0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size);\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\n\\t\\t\\tanimation: ck-table-form-labeled-view-status-appear .15s ease both;\\n\\t\\t}\\n\\n\\t\\t/* Hide the error balloon when the field is blurred. Makes the experience much more clear. */\\n\\t\\t& .ck-input.ck-error:not(:focus) + .ck.ck-labeled-field-view__status {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-table-form-labeled-view-status-appear {\\n\\t0% {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableproperties.css\"],\"names\":[],\"mappings\":\"AAOE,mFAGC,sBAAuB,CADvB,YAAa,CADb,cAOD,CAHC,qHACC,gBACD,CCTH,6BACC,WAmBD,CAhBE,mFACC,mBAAoB,CACpB,SAYD,CAVC,kGACC,eAAgB,CAGhB,qCAKD,CAHC,uHACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\tflex-basis: 0;\\n\\t\\t\\talign-content: baseline;\\n\\n\\t\\t\\t& .ck.ck-toolbar .ck-toolbar__items {\\n\\t\\t\\t\\tflex-wrap: nowrap;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\n\\t\\t\\t\\t& .ck-toolbar__items > * {\\n\\t\\t\\t\\t\\twidth: 40px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:\\\"\\\";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,wDACD,CAGC,0IAKC,gBAAiB,CAFjB,uBAAwB,CACxB,aAAc,CAFd,iBAiCD,CA3BC,sJAGC,yDAA0D,CAK1D,QAAS,CAPT,UAAW,CAKX,MAAO,CAJP,mBAAoB,CAEpB,iBAAkB,CAGlB,OAAQ,CAFR,KAID,CAEA,wTAEC,4BACD,CAMA,gKACC,aAKD,CAHC,0NACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);\\n}\\n\\n.ck.ck-editor__editable .table table {\\n\\t& td.ck-editor__editable_selected,\\n\\t& th.ck-editor__editable_selected {\\n\\t\\tposition: relative;\\n\\t\\tcaret-color: transparent;\\n\\t\\toutline: unset;\\n\\t\\tbox-shadow: unset;\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/6446 */\\n\\t\\t&:after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\tbackground-color: var(--ck-table-selected-cell-background);\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft: 0;\\n\\t\\t\\tright: 0;\\n\\t\\t\\tbottom: 0;\\n\\t\\t}\\n\\n\\t\\t& ::selection,\\n\\t\\t&:focus {\\n\\t\\t\\tbackground-color: transparent;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * To reduce the amount of noise, all widgets in the table selection have no outline and no selection handle.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9491.\\n\\t\\t */\\n\\t\\t& .ck-widget {\\n\\t\\t\\toutline: unset;\\n\\n\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AAOA,6BAMC,kBAAmB,CADnB,mBAAoB,CAEpB,oBAAqB,CAHrB,iBAAkB,CCFlB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDkBD,CAdC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEjBD,6BCAC,oDD4ID,CCzIE,6EACC,0DACD,CAEA,+EACC,2DACD,CAID,qDACC,6DACD,CDfD,6BEDC,eF6ID,CA5IA,wIEGE,qCFyIF,CA5IA,6BA6BC,uBAAwB,CANxB,4BAA6B,CAjB7B,cAAe,CAcf,iBAAkB,CAHlB,aAAc,CAJd,4CAA6C,CAD7C,2CAA4C,CAJ5C,8BAA+B,CAC/B,iBAAkB,CAiBlB,4DAA8D,CAnB9D,qBAAsB,CAFtB,kBAuID,CA7GC,oFGhCA,2BAA2B,CCF3B,2CAA8B,CDC9B,YHqCA,CAIC,kJAEC,aACD,CAGD,iEAIC,aAAc,CACd,cAAe,CAHf,iBAAkB,CAClB,mBAAoB,CAMpB,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAYD,CAbA,6FAIE,mCASF,CAbA,6FAQE,oCAKF,CAbA,yEAWC,eAAiB,CACjB,UACD,CAIC,oIIrFD,oDJyFC,CAOA,gLKhGD,kCLkGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAcD,CAXC,2HAEE,4CAA+C,CAC/C,oCAOF,CAVA,2HAQE,mCAAoC,CADpC,6CAGF,CAKA,mHACC,WACD,CAID,yCC/HA,+CDmIA,CChIC,yFACC,qDACD,CAEA,2FACC,sDACD,CAID,iEACC,wDACD,CDgHA,yCAGC,qCACD,CAEA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CC/IC,mDDoJD,CCjJE,2FACC,yDACD,CAEA,6FACC,0DACD,CAID,mEACC,4DACD,CDgID,2CAIC,wCACD,CAEA,uCAEC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-unselectable;\\n\\n\\tposition: relative;\\n\\tdisplay: inline-flex;\\n\\talign-items: center;\\n\\tjustify-content: left;\\n\\n\\t& .ck-button__label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Center the icon horizontally in a button without text. */\\n\\t&:not(.ck-button_with-text) {\\n\\t\\tjustify-content: center;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-button-colors --ck-color-button-default;\\n\\t@mixin ck-rounded-corners;\\n\\n\\twhite-space: nowrap;\\n\\tcursor: default;\\n\\tvertical-align: middle;\\n\\tpadding: var(--ck-spacing-tiny);\\n\\ttext-align: center;\\n\\n\\t/* A very important piece of styling. Go to variable declaration to learn more. */\\n\\tmin-width: var(--ck-ui-component-min-height);\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Normalize the height of the line. Removing this will break consistent height\\n\\tamong text and text-less buttons (with icons). */\\n\\tline-height: 1;\\n\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t/* Avoid flickering when the foucs border shows up. */\\n\\tborder: 1px solid transparent;\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\\n\\t-webkit-appearance: none;\\n\\n\\t&:active,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t/* Allow icon coloring using the text \\\"color\\\" property. */\\n\\t& .ck-button__icon {\\n\\t\\t& use,\\n\\t\\t& use * {\\n\\t\\t\\tcolor: inherit;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\t\\tfont-size: inherit;\\n\\t\\tfont-weight: inherit;\\n\\t\\tcolor: inherit;\\n\\t\\tcursor: inherit;\\n\\n\\t\\t/* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and\\n\\t\\twithout labels (but with icons) have different sizes in Chrome */\\n\\t\\tvertical-align: middle;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttext-align: left;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__keystroke {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\tfont-weight: bold;\\n\\t\\topacity: .7;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t&.ck-disabled {\\n\\t\\t&:active,\\n\\t\\t&:focus {\\n\\t\\t\\t/* The disabled button should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t& .ck-button__keystroke {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\\n\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-keystroke {\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* A style of the button which is currently on, e.g. its feature is active. */\\n\\t&.ck-on {\\n\\t\\t@mixin ck-button-colors --ck-color-button-on;\\n\\n\\t\\tcolor: var(--ck-color-button-on-color);\\n\\t}\\n\\n\\t&.ck-button-save {\\n\\t\\tcolor: var(--ck-color-button-save);\\n\\t}\\n\\n\\t&.ck-button-cancel {\\n\\t\\tcolor: var(--ck-color-button-cancel);\\n\\t}\\n}\\n\\n/* A style of the button which handles the primary action. */\\n.ck.ck-button-action,\\na.ck.ck-button-action {\\n\\t@mixin ck-button-colors --ck-color-button-action;\\n\\n\\tcolor: var(--ck-color-button-action-text);\\n}\\n\\n.ck.ck-button-bold,\\na.ck.ck-button-bold {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements a button of given background color.\\n *\\n * @param {String} $background - Background color of the button.\\n * @param {String} $border - Border color of the button.\\n */\\n@define-mixin ck-button-colors $prefix {\\n\\tbackground: var($(prefix)-background);\\n\\n\\t&:not(.ck-disabled) {\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var($(prefix)-hover-background);\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbackground: var($(prefix)-active-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t&.ck-disabled {\\n\\t\\tbackground: var($(prefix)-disabled-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,0DAAgE,CAChE,2HAIC,CACD,0FACD,CAOC,0QAEC,sBAAuB,CADvB,aAED,CAEA,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDCpCA,eD4EA,CAxCA,yIChCC,qCDwED,CAxCA,2DAKE,gBAmCF,CAxCA,2DAUE,iBA8BF,CAxCA,iDAkBC,uDAAwD,CAFxD,4BAA6B,CAD7B,iFAAsF,CAEtF,0CAuBD,CApBC,2ECxDD,eDmEC,CAXA,6LCpDA,qCAAsC,CDsDpC,8CASF,CAXA,2EAOC,yDAA0D,CAD1D,gDAAiD,CAIjD,uBAA0B,CAL1B,+CAMD,CAEA,uDACC,6DAKD,CAHC,iFACC,qDACD,CAIF,6DEhFA,kCFkFA,CAGA,oCACC,wBAAyB,CAEzB,eAAgB,CADhB,YAQD,CALC,uDACC,iGAAmG,CAEnG,4BAA6B,CAD7B,kBAED,CAKA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,2DAMF,CAXA,2FASE,oEAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t& .ck-button__toggle {\\n\\t\\tdisplay: block;\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\\nof the component, floating–point numbers have been used which, for the default font size\\n(see: --ck-font-size-base), will generate simple integers. */\\n:root {\\n\\t/* 34px at 13px font-size */\\n\\t--ck-switch-button-toggle-width: 2.6153846154em;\\n\\t/* 14px at 13px font-size */\\n\\t--ck-switch-button-toggle-inner-size: calc(1.0769230769em + 1px);\\n\\t--ck-switch-button-translation: calc(\\n\\t\\tvar(--ck-switch-button-toggle-width) -\\n\\t\\tvar(--ck-switch-button-toggle-inner-size) -\\n\\t\\t2px /* Border */\\n\\t);\\n\\t--ck-switch-button-inner-hover-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\\n}\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t/* Unlike a regular button, the switch button text color and background should never change.\\n\\t * Changing toggle switch (background, outline) is enough to carry the information about the\\n\\t * state of the entire component (https://github.com/ckeditor/ckeditor5/issues/12519)\\n\\t */\\n\\t&, &:hover, &:focus, &:active, &.ck-on:hover, &.ck-on:focus, &.ck-on:active {\\n\\t\\tcolor: inherit;\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__toggle {\\n\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Make sure the toggle is always to the right as far as possible. */\\n\\t\\t\\tmargin-left: auto;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Make sure the toggle is always to the left as far as possible. */\\n\\t\\t\\tmargin-right: auto;\\n\\t\\t}\\n\\n\\t\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\t\\t/* Gently animate the background color of the toggle switch */\\n\\t\\ttransition: background 400ms ease, box-shadow .2s ease-in-out, outline .2s ease-in-out;\\n\\t\\tborder: 1px solid transparent;\\n\\t\\twidth: var(--ck-switch-button-toggle-width);\\n\\t\\tbackground: var(--ck-color-switch-button-off-background);\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-radius: calc(.5 * var(--ck-border-radius));\\n\\t\\t\\t}\\n\\n\\t\\t\\twidth: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\theight: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\tbackground: var(--ck-color-switch-button-inner-background);\\n\\n\\t\\t\\t/* Gently animate the inner part of the toggle switch */\\n\\t\\t\\ttransition: all 300ms ease;\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-off-hover-background);\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\tbox-shadow: var(--ck-switch-button-inner-hover-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-button__toggle {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t/* Overriding default .ck-button:focus styles + an outline around the toogle */\\n\\t&:focus {\\n\\t\\tborder-color: transparent;\\n\\t\\toutline: none;\\n\\t\\tbox-shadow: none;\\n\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-background), 0 0 0 5px var(--ck-color-focus-outer-shadow);\\n\\t\\t\\toutline-offset: 1px;\\n\\t\\t\\toutline: var(--ck-focus-ring);\\n\\t\\t}\\n\\t}\\n\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-on {\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-on-background);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-switch-button-on-hover-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\t/*\\n\\t\\t\\t\\t* Move the toggle switch to the right. It will be animated.\\n\\t\\t\\t\\t*/\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\ttransform: translateX( var( --ck-switch-button-translation ) );\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css\"],\"names\":[],\"mappings\":\"AAKA,kBACC,YACD,CCAA,MACC,8BAA+B,CAK/B,wCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBAOC,QAAS,CALT,qCAAsC,CAEtC,yCAA0C,CAD1C,wCAAyC,CAEzC,SAAU,CACV,8BAA+B,CAL/B,oCAyCD,CAjCC,oCACC,YAAa,CACb,gBACD,CAEA,4DACC,gDACD,CAEA,oCAEC,2CAA4C,CAD5C,YAED,CAEA,8BACC,8FAKD,CAHC,0CACC,aACD,CAGD,8HAIC,QACD,CAEA,gGAEC,iGACD,CAGD,yBACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-color-grid {\\n\\tdisplay: grid;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-color-grid-tile-size: 24px;\\n\\n\\t/* Not using global colors here because these may change but some colors in a pallette\\n\\t * require special treatment. For instance, this ensures no matter what the UI text color is,\\n\\t * the check icon will look good on the black color tile. */\\n\\t--ck-color-color-grid-check-icon: hsl(212, 81%, 46%);\\n}\\n\\n.ck.ck-color-grid {\\n\\tgrid-gap: 5px;\\n\\tpadding: 8px;\\n}\\n\\n.ck.ck-color-grid__tile {\\n\\twidth: var(--ck-color-grid-tile-size);\\n\\theight: var(--ck-color-grid-tile-size);\\n\\tmin-width: var(--ck-color-grid-tile-size);\\n\\tmin-height: var(--ck-color-grid-tile-size);\\n\\tpadding: 0;\\n\\ttransition: .2s ease box-shadow;\\n\\tborder: 0;\\n\\n\\t&.ck-disabled {\\n\\t\\tcursor: unset;\\n\\t\\ttransition: unset;\\n\\t}\\n\\n\\t&.ck-color-table__color-tile_bordered {\\n\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\tdisplay: none;\\n\\t\\tcolor: var(--ck-color-color-grid-check-icon);\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\\n\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-on,\\n\\t&:focus:not( .ck-disabled ),\\n\\t&:hover:not( .ck-disabled ) {\\n\\t\\t/* Disable the default .ck-button's border ring. */\\n\\t\\tborder: 0;\\n\\t}\\n\\n\\t&:focus:not( .ck-disabled ),\\n\\t&:hover:not( .ck-disabled ) {\\n\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\\n\\t}\\n}\\n\\n.ck.ck-color-grid__label {\\n\\tpadding: 0 var(--ck-spacing-standard);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-input{min-width:unset}.color-picker-hex-input{width:max-content}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css\"],\"names\":[],\"mappings\":\"AAKA,aACC,eACD,CAEA,wBACC,iBACD,CAEA,yBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAMD,CAJC,qDAEC,sCAAuC,CADvC,kCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-input {\\n\\tmin-width: unset;\\n}\\n\\n.color-picker-hex-input {\\n\\twidth: max-content;\\n}\\n\\n.ck.ck-color-picker__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t& .ck-color-picker__hash-view {\\n\\t\\tpadding-top: var(--ck-spacing-tiny);\\n\\t\\tpadding-right: var(--ck-spacing-medium);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBA2ED,CAzEC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UACD,CAEA,oCACC,YAAa,CAEb,sCAAuC,CAEvC,iBAAkB,CAHlB,yBA4DD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSAUC,WAAY,CADZ,QAED,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CCpFA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CAIC,sCAAuC,CAHvC,gCAID,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEAEC,eAAgB,CAChB,sBAAuB,CAFvB,SAGD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eH8GD,CA5BA,qFG9EE,qCH0GF,CA5BA,uBAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CE1FT,oCAA8B,CF6F9B,cAmBD,CAfC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-dropdown-max-width: 75vw;\\n}\\n\\n.ck.ck-dropdown {\\n\\tdisplay: inline-block;\\n\\tposition: relative;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\tpointer-events: none;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n\\n\\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& .ck-dropdown__panel {\\n\\t\\tdisplay: none;\\n\\t\\tz-index: var(--ck-z-modal);\\n\\t\\tmax-width: var(--ck-dropdown-max-width);\\n\\n\\t\\tposition: absolute;\\n\\n\\t\\t&.ck-dropdown__panel-visible {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_n,\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_nme {\\n\\t\\t\\tbottom: 100%;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_se,\\n\\t\\t&.ck-dropdown__panel_sw,\\n\\t\\t&.ck-dropdown__panel_smw,\\n\\t\\t&.ck-dropdown__panel_sme,\\n\\t\\t&.ck-dropdown__panel_s {\\n\\t\\t\\t/*\\n\\t\\t\\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\\n\\t\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\\n\\t\\t\\t */\\n\\t\\t\\ttop: 100%;\\n\\t\\t\\tbottom: auto;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_se {\\n\\t\\t\\tleft: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_sw {\\n\\t\\t\\tright: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_s,\\n\\t\\t&.ck-dropdown__panel_n {\\n\\t\\t\\t/* Positioning panels relative to the center of the button */\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_smw {\\n\\t\\t\\t/* Positioning panels relative to the middle-west of the button */\\n\\t\\t\\tleft: 75%;\\n\\t\\t\\ttransform: translateX(-75%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nme,\\n\\t\\t&.ck-dropdown__panel_sme {\\n\\t\\t\\t/* Positioning panels relative to the middle-east of the button */\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\ttransform: translateX(-25%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\\n * See https://github.com/ckeditor/ckeditor5/issues/7874\\n */\\n.ck.ck-toolbar .ck-dropdown__panel {\\n\\tz-index: calc( var(--ck-z-modal) + 1 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\\n}\\n\\n.ck.ck-dropdown {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tright: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tleft: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-dropdown__arrow {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* #23 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\twidth: 7em;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t\\t&.ck-disabled .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t\\t&.ck-on {\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__button_label-width_auto .ck-button__label {\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\\n\\t\\t&.ck-off:active,\\n\\t\\t&.ck-on:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t\\t\\n\\t\\t\\t&:focus {\\n\\t\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-dropdown__panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tbackground: var(--ck-color-dropdown-panel-background);\\n\\tborder: 1px solid var(--ck-color-dropdown-panel-border);\\n\\tbottom: 0;\\n\\n\\t/* Make sure the panel is at least as wide as the drop-down's button. */\\n\\tmin-width: 100%;\\n\\n\\t/* Disabled corner border radius to be consistent with the .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-dropdown__panel_se {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_sw {\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_ne {\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_nw {\\n\\t\\tborder-bottom-right-radius: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDKpC,2BAA4B,CAC5B,4BAA6B,CAF7B,wBAIF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-dropdown .ck-dropdown__panel .ck-list {\\n\\t/* Disabled radius of top-left border to be consistent with .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t/* Make sure the button belonging to the first/last child of the list goes well with the\\n\\tborder radius of the entire panel. */\\n\\t& .ck-list__item {\\n\\t\\t&:first-child .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:last-child .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:\\\"\\\";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,iBAKD,CAHC,iDACC,qCACD,CCJD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAKE,gCAAiC,CADjC,6BASF,CAbA,oIAWE,+BAAgC,CADhC,4BAGF,CAEA,0CAGC,eAiBD,CApBA,oDAQE,+BAAgC,CADhC,4BAaF,CApBA,oDAcE,gCAAiC,CADjC,6BAOF,CAHC,8CACC,mCACD,CAKD,sDAEC,qBAAwB,CADxB,kBAED,CAQC,0KACC,wDACD,CAIA,8JAKC,0DAA2D,CAJ3D,UAAW,CAGX,WAAY,CAFZ,iBAAkB,CAClB,SAGD,CAGA,sIACC,iEACD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCCzFA,eDmGA,CAVA,qHCrFC,qCD+FD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-splitbutton {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-splitbutton__action:focus {\\n\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\\n\\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/*\\n\\t * Note: ck-rounded and ck-dir mixins don't go together (because they both use @nest).\\n\\t */\\n\\t&:hover > .ck-splitbutton__action,\\n\\t&.ck-splitbutton_open > .ck-splitbutton__action {\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-splitbutton__arrow {\\n\\t\\t/* It's a text-less button and since the icon is positioned absolutely in such situation,\\n\\t\\tit must get some arbitrary min-width. */\\n\\t\\tmin-width: unset;\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Make sure the divider stretches 100% height of the button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/10936 */\\n\\t& > .ck-splitbutton__arrow:not(:focus) {\\n\\t\\tborder-top-width: 0px;\\n\\t\\tborder-bottom-width: 0px;\\n\\t}\\n\\n\\t/* When the split button is \\\"open\\\" (the arrow is on) or being hovered, it should get some styling\\n\\tas a whole. The background of both buttons should stand out and there should be a visual\\n\\tseparation between both buttons. */\\n\\t&.ck-splitbutton_open,\\n\\t&:hover {\\n\\t\\t/* When the split button hovered as a whole, not as individual buttons. */\\n\\t\\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\\n\\t\\t\\tbackground: var(--ck-color-split-button-hover-background);\\n\\t\\t}\\n\\n\\t\\t/* Splitbutton separator needs to be set with the ::after pseudoselector\\n\\t\\tto display properly the borders on focus */\\n\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 1px;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tbackground-color: var(--ck-color-split-button-hover-border);\\n\\t\\t}\\n\\n\\t\\t/* Make sure the divider between the buttons looks fine when the button is focused */\\n\\t\\t& > .ck-splitbutton__arrow:focus::after {\\n\\t\\t\\t--ck-color-split-button-hover-border: var(--ck-color-focus-border);\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tleft: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Don't round the bottom left and right corners of the buttons when \\\"open\\\"\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-splitbutton_open {\\n\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t& > .ck-splitbutton__action {\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-splitbutton__arrow {\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oCACD,CAEA,4CAGC,8CAA+C,CAD/C,iBAQD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-toolbar-dropdown-max-width: 60vw;\\n}\\n\\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\\n\\twidth: max-content;\\n\\tmax-width: var(--ck-toolbar-dropdown-max-width);\\n\\n\\t& .ck-button {\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-toolbar-dropdown .ck-toolbar {\\n\\tborder: 0;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEEPA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFWA,CAGD,+BAGC,4BAA6B,CAF7B,aAAc,CACd,oCA6BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,mDACD,CAIA,gEACC,gDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n\\n:root {\\n\\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\\n}\\n\\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t&.ck-focused {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\t}\\n}\\n\\n.ck.ck-editor__editable_inline {\\n\\toverflow: auto;\\n\\tpadding: 0 var(--ck-spacing-standard);\\n\\tborder: 1px solid transparent;\\n\\n\\t&[dir=\\\"ltr\\\"] {\\n\\t\\ttext-align: left;\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"] {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\\n\\t& > *:first-child {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\\n\\t& > *:last-child {\\n\\t\\t/*\\n\\t\\t * This value should match with the default margins of the block elements (like .media or .image)\\n\\t\\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\\n\\t\\t */\\n\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\\n\\t&.ck-blurred ::selection {\\n\\t\\tbackground: var(--ck-color-editable-blur-selection);\\n\\t}\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_n\\\"] {\\n\\t&::after {\\n\\t\\tborder-bottom-color: var(--ck-color-base-foreground);\\n\\t}\\n}\\n\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_s\\\"] {\\n\\t&::after {\\n\\t\\tborder-top-color: var(--ck-color-base-foreground);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css\"],\"names\":[],\"mappings\":\"AAKA,oBAIC,kBAAmB,CAHnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CAEjB,6BACD,CCNA,MACC,4BACD,CAEA,oBAIC,mDAAoD,CAFpD,mCAAoC,CACpC,wCAAyC,CAFzC,uDAQD,CAHC,4CACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__header {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\talign-items: center;\\n\\tjustify-content: space-between;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-form-header-height: 38px;\\n}\\n\\n.ck.ck-form__header {\\n\\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\\n\\theight: var(--ck-form-header-height);\\n\\tline-height: var(--ck-form-header-height);\\n\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\n\\t& .ck-form__header__label {\\n\\t\\tfont-weight: bold;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,qBACD,CCFA,MACC,0EACD,CAEA,YAKC,uBAAwB,CAHxB,0BAA2B,CAD3B,yBAA0B,CAU1B,qBAoBD,CAlBC,0BALA,cAQA,CAMC,sEACC,aAMD,CAJC,+CAEC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-icon {\\n\\tvertical-align: middle;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\\n}\\n\\n.ck.ck-icon {\\n\\twidth: var(--ck-icon-size);\\n\\theight: var(--ck-icon-size);\\n\\n\\t/* Multiplied by the height of the line in \\\"px\\\" should give SVG \\\"viewport\\\" dimensions */\\n\\tfont-size: .8333350694em;\\n\\n\\t/* Inherit cursor style (#5). */\\n\\tcursor: inherit;\\n\\n\\t/* This will prevent blurry icons on Firefox. See #340. */\\n\\twill-change: transform;\\n\\n\\t& * {\\n\\t\\t/* Inherit cursor style (#5). */\\n\\t\\tcursor: inherit;\\n\\t}\\n\\n\\t/* Allows dynamic coloring of an icon by inheriting its color from the parent. */\\n\\t&.ck-icon_inherit-color {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t& * {\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:not([fill]) {\\n\\t\\t\\t\\t/* Needed by FF. */\\n\\t\\t\\t\\tfill: currentColor;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/input/input.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AASA,MACC,qBAAsB,CAGtB,2CACD,CAEA,aCLC,eD2CD,CAtCA,iECDE,qCDuCF,CAtCA,aAGC,2CAA4C,CAC5C,6CAA8C,CAK9C,4CAA6C,CAH7C,+BAAgC,CADhC,6DAA8D,CAO9D,4DA0BD,CAxBC,mBEnBA,2BAA2B,CCF3B,2CAA8B,CDC9B,YFuBA,CAEA,uBAEC,oDAAqD,CADrD,sDAAuD,CAEvD,yCAMD,CAJC,6BG/BD,oDHkCC,CAGD,sBAEC,sCAAuC,CADvC,+CAMD,CAHC,4BGzCD,iDH2CC,CAIF,0BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-input-width: 18em;\\n\\n\\t/* Backward compatibility. */\\n\\t--ck-input-text-width: var(--ck-input-width);\\n}\\n\\n.ck.ck-input {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-input-background);\\n\\tborder: 1px solid var(--ck-color-input-border);\\n\\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t/* This is important to stay of the same height as surrounding buttons */\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\\n\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t&[readonly] {\\n\\t\\tborder: 1px solid var(--ck-color-input-disabled-border);\\n\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\n\\t\\t&:focus {\\n\\t\\t\\t/* The read-only input should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\tborder-color: var(--ck-color-input-error-border);\\n\\t\\tanimation: ck-input-shake .3s ease both;\\n\\n\\t\\t&:focus {\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-input-shake {\\n\\t20% {\\n\\t\\ttransform: translateX(-2px);\\n\\t}\\n\\n\\t40% {\\n\\t\\ttransform: translateX(2px);\\n\\t}\\n\\n\\t60% {\\n\\t\\ttransform: translateX(-1px);\\n\\t}\\n\\n\\t80% {\\n\\t\\ttransform: translateX(1px);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css\"],\"names\":[],\"mappings\":\"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tdisplay: block;\\n}\\n\\n.ck.ck-voice-label {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tfont-weight: bold;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,oEAAqE,CACrE,8EAAiF,CACjF,yEACD,CAEA,0BCLC,eD8GD,CAzGA,2FCDE,qCD0GF,CAtGC,mEACC,UAmCD,CAjCC,gFACC,KA+BD,CAhCA,0FAIE,MA4BF,CAhCA,0FAQE,OAwBF,CAhCA,gFAiBC,yDAA0D,CAG1D,eAAmB,CADnB,kBAAoB,CAOpB,cAAe,CAFf,eAAgB,CANhB,2CAA8C,CAP9C,mBAAoB,CAYpB,sBAAuB,CARvB,6DAA+D,CAH/D,oBAAqB,CAgBrB,+JAID,CAQA,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,oUAGE,+HAYF,CAfA,oUAOE,wIAQF,CAfA,gTAaC,sBAAuB,CAFvB,iEAAkE,CAGlE,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-labeled-field-view {\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\tdisplay: flex;\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t& .ck.ck-label {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\\n\\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-x: var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-y: calc(0.6 * var(--ck-font-size-base));\\n\\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\\n}\\n\\n.ck.ck-labeled-field-view {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\twidth: 100%;\\n\\n\\t\\t& > .ck.ck-label {\\n\\t\\t\\ttop: 0px;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tleft: 0px;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tright: 0px;\\n\\t\\t\\t}\\n\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\ttransform-origin: 0 0;\\n\\n\\t\\t\\t/* By default, display the label scaled down above the field. */\\n\\t\\t\\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\\n\\n\\t\\t\\tbackground: var(--ck-color-labeled-field-label-background);\\n\\t\\t\\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\\n\\t\\t\\tline-height: initial;\\n\\t\\t\\tfont-weight: normal;\\n\\n\\t\\t\\t/* Prevent overflow when the label is longer than the input */\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\ttransition:\\n\\t\\t\\t\\ttransform var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tpadding var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tbackground var(--ck-labeled-field-view-transition);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\n\\t\\t& .ck-input:not([readonly]) + .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-labeled-field-view__status {\\n\\t\\tfont-size: var(--ck-font-size-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\n\\t\\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\\n\\t\\tThe status could be very long. */\\n\\t\\twhite-space: normal;\\n\\n\\t\\t&.ck-labeled-field-view__status_error {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Disabled fields and fields that have no focus should fade out. */\\n\\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\t}\\n\\n\\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-disabled.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttransform: translate(var(--ck-labeled-field-label-default-position-x), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttransform: translate(calc(-1 * var(--ck-labeled-field-label-default-position-x)), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t/* Compensate for the default translate position. */\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\\n\\n\\t\\tbackground: transparent;\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\\n\\n\\t/* Make sure dropdown' background color in any of dropdown's state does not collide with labeled field. */\\n\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t/* When the dropdown is \\\"empty\\\", the labeled field label replaces its label. */\\n\\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-switchbutton):not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,YAGC,YAAa,CACb,qBAAsB,CCFtB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDaD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEfD,YCEC,eDGD,CALA,+DCME,qCDDF,CALA,YAIC,0CAA2C,CAD3C,oBAED,CAEA,kBACC,cAAe,CACf,cA2DD,CAzDC,6BAIC,eAAgB,CAHhB,gBAAiB,CAQjB,iIAEiE,CARjE,eAAgB,CADhB,UAwCD,CA7BC,+CAEC,yEACD,CAEA,oCACC,eACD,CAEA,mCACC,oDAAqD,CACrD,yCAaD,CAXC,0CACC,eACD,CAEA,2DACC,0DACD,CAEA,iFACC,4CACD,CAGD,qDACC,uDACD,CAMA,yCACC,0CAA2C,CAC3C,aAMD,CAJC,iEACC,uDAAwD,CACxD,aACD,CAKH,uBAGC,sCAAuC,CAFvC,UAAW,CACX,UAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\n\\t& .ck-list__item,\\n\\t& .ck-list__separator {\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/* Make sure that whatever child of the list item gets focus, it remains on the\\n\\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\\n\\tadjacent list items. */\\n\\t& .ck-list__item > *:focus {\\n\\t\\tposition: relative;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tlist-style-type: none;\\n\\tbackground: var(--ck-color-list-background);\\n}\\n\\n.ck.ck-list__item {\\n\\tcursor: default;\\n\\tmin-width: 12em;\\n\\n\\t& .ck-button {\\n\\t\\tmin-height: unset;\\n\\t\\twidth: 100%;\\n\\t\\ttext-align: left;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t/* List items should have the same height. Use absolute units to make sure it is so\\n\\t\\t because e.g. different heading styles may have different height\\n\\t\\t https://github.com/ckeditor/ckeditor5-heading/issues/63 */\\n\\t\\tpadding:\\n\\t\\t\\tcalc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base))\\n\\t\\t\\tcalc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base));\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\\n\\t\\t\\tline-height: calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base));\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-button-on-background);\\n\\t\\t\\tcolor: var(--ck-color-list-button-on-text);\\n\\n\\t\\t\\t&:active {\\n\\t\\t\\t\\tbox-shadow: none;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-on-background-focus);\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus:not(.ck-switchbutton):not(.ck-disabled) {\\n\\t\\t\\t\\tborder-color: var(--ck-color-base-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* It's unnecessary to change the background/text of a switch toggle; it has different ways\\n\\tof conveying its state (like the switcher) */\\n\\t& .ck-switchbutton {\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-background);\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t\\t\\tcolor: inherit;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-list__separator {\\n\\theight: 1px;\\n\\twidth: 100%;\\n\\tbackground: var(--ck-color-base-border);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\\\"\\\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCLC,eDmMD,CA9LA,iFCDE,qCD+LF,CA9LA,qBAMC,2CAA4C,CAC5C,wEAAyE,CEdzE,oCAA8B,CFW9B,eA0LD,CApLE,+GAIC,kBAAmB,CADnB,QAAS,CADT,OAGD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,kDACD,CAEA,2CACC,iFAAkF,CAClF,gFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,iEAAkE,CAClE,uDAAwD,CACxD,qDACD,CAEA,2CACC,iFAAkF,CAClF,mFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,oDACD,CAEA,2CACC,iFAAkF,CAClF,kFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,mDACD,CAEA,2CACC,iFAAkF,CAClF,iFACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAIC,8CAAiD,CAFjD,QAAS,CACT,uDAED,CAIA,2GAGC,8CAAiD,CADjD,+CAED,CAIA,2GAGC,8CAAiD,CADjD,gDAED,CAIA,6GAIC,8CAAiD,CADjD,uDAA0D,CAD1D,SAGD,CAIA,6GAIC,8CAAiD,CAFjD,QAAS,CACT,sDAED,CAIA,6GAGC,uDAA0D,CAD1D,SAAU,CAEV,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD,CAIA,yGAGC,sDAAyD,CADzD,6CAAgD,CAEhD,OACD,CAIA,yGAEC,4CAA+C,CAC/C,sDAAyD,CACzD,OACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* Make sure the balloon arrow does not float over its children. */\\n\\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\tz-index: var(--ck-z-modal);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_visible {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-border-width: 1px;\\n\\t--ck-balloon-arrow-offset: 2px;\\n\\t--ck-balloon-arrow-height: 10px;\\n\\t--ck-balloon-arrow-half-width: 8px;\\n\\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: var(--ck-balloon-border-width) solid var(--ck-color-panel-border);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\twidth: 0;\\n\\t\\t\\theight: 0;\\n\\t\\t\\tborder-style: solid;\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\\n\\t\\t\\tmargin-top: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\\n\\t\\t\\tmargin-top: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\\n\\t\\t\\tmargin-bottom: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\\n\\t\\t\\tmargin-bottom: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_e\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-border);\\n\\t\\t\\tmargin-right: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-background);\\n\\t\\t\\tmargin-right: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_w\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tmargin-left: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-background) transparent transparent;\\n\\t\\t\\tmargin-left: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_n {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_ne {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_s {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_se {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_smw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nmw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_e {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_w {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css\"],\"names\":[],\"mappings\":\"AAKA,oCAEC,kBAAmB,CADnB,YAAa,CAEb,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCAGC,qCAAsC,CAFtC,oCAAqC,CACrC,kCAED,CAGA,iEAIC,mCAAoC,CAHpC,uCAID,CAMA,2DACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\\n */\\n.ck .ck-balloon-rotator__content .ck-toolbar {\\n\\tjustify-content: center;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\n\\t/* Let's keep similar appearance to `ck-toolbar`. */\\n\\t& > * {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Gives counter more breath than buttons. */\\n\\t& .ck-balloon-rotator__counter {\\n\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t/* We need to use smaller margin because of previous button's right margin. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n.ck .ck-balloon-rotator__content {\\n\\n\\t/* Disable default annotation shadow inside rotator with fake panels. */\\n\\t& .ck.ck-annotation-wrapper {\\n\\t\\tbox-shadow: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBAKC,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CCXtC,oCAA8B,CDc9B,WAAY,CAPZ,eAAgB,CAMhB,UAED,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-fake-panel {\\n\\tposition: absolute;\\n\\n\\t/* Fake panels should be placed under main balloon content. */\\n\\tz-index: calc(var(--ck-z-modal) - 1);\\n}\\n\\n.ck .ck-fake-panel div {\\n\\tposition: absolute;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tz-index: 2;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tz-index: 1;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-fake-panel-offset-horizontal: 6px;\\n\\t--ck-balloon-fake-panel-offset-vertical: 6px;\\n}\\n\\n/* Let's use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\\n.ck .ck-fake-panel div {\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: 1px solid var(--ck-color-panel-border);\\n\\tborder-radius: var(--ck-border-radius);\\n\\n\\twidth: 100%;\\n\\theight: 100%;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\\n\\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\\n}\\n.ck .ck-fake-panel div:nth-child( 3 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\\n}\\n\\n/* If balloon is positioned above element, we need to move fake panel to the top. */\\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\\n\\t--ck-balloon-fake-panel-offset-vertical: -6px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAMC,qDAEC,cAAe,CACf,KAAM,CAFN,yBAGD,CAEA,kEAEC,iBAAkB,CADlB,QAED,CCPA,qDAIC,wBAAyB,CACzB,yBAA0B,CAF1B,sBAAuB,CCFxB,oCDKA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\tz-index: var(--ck-z-modal); /* #315 */\\n\\t\\tposition: fixed;\\n\\t\\ttop: 0;\\n\\t}\\n\\n\\t& .ck-sticky-panel__content_sticky_bottom-limit {\\n\\t\\ttop: auto;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\t@mixin ck-drop-shadow;\\n\\n\\t\\tborder-width: 0 1px 1px;\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-vertical-form .ck-button:after{bottom:-1px;content:\\\"\\\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:\\\"\\\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css\"],\"names\":[],\"mappings\":\"AAQC,mCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,yCACC,YACD,CCdA,oCDoBE,wCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,8CACC,YACD,CC9BF,CCAD,qDACC,kDACD,CAEA,uBACC,+BAmED,CAjEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,oCA8CF,CA5CE,8CACC,wDAWD,CATC,6DACC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAKA,0DACC,kDACD,CAGD,iGAIC,eAAgB,CADhB,kCAAmC,CADnC,kCAmBD,CAfC,yHACC,gDACD,CARD,0OAeE,aAMF,CAJE,+IACC,kDACD,CDpEH\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck-vertical-form .ck-button {\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\twidth: 0;\\n\\t\\tposition: absolute;\\n\\t\\tright: -1px;\\n\\t\\ttop: -1px;\\n\\t\\tbottom: -1px;\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t&:focus::after {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n.ck.ck-responsive-form {\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t\\ttop: -1px;\\n\\t\\t\\t\\tbottom: -1px;\\n\\t\\t\\t\\tz-index: 1;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus::after {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\\n\\tborder-right: 1px solid var(--ck-color-base-border);\\n}\\n\\n.ck.ck-responsive-form {\\n\\tpadding: var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& > :not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& > :not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tpadding: 0;\\n\\t\\twidth: calc(.8 * var(--ck-input-width));\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\\n\\n\\t\\t\\t& .ck-input-text {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\n\\t\\t\\t/* Let the long error messages wrap in the narrow form. */\\n\\t\\t\\t& .ck-labeled-field-view__error {\\n\\t\\t\\t\\twhite-space: normal;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& > .ck-button:nth-last-child(1),\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t\\t\\tborder-radius: 0;\\n\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css\"],\"names\":[],\"mappings\":\"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-block-toolbar-button {\\n\\tposition: absolute;\\n\\tz-index: var(--ck-z-default);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-block-toolbar-button: var(--ck-color-text);\\n\\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\\n}\\n\\n.ck.ck-block-toolbar-button {\\n\\tcolor: var(--ck-color-block-toolbar-button);\\n\\tfont-size: var(--ck-block-toolbar-size);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,eAKC,kBAAmB,CAFnB,YAAa,CACb,oBAAqB,CCFrB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6CD,CA3CC,kCAGC,kBAAmB,CAFnB,YAAa,CACb,kBAAmB,CAEnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eDwGD,CA3GA,qECOE,qCDoGF,CA3GA,eAGC,6CAA8C,CAE9C,+CAAgD,CADhD,iCAuGD,CApGC,yCACC,kBAAmB,CAGnB,yCAA0C,CAO1C,qCAAsC,CADtC,kCAAmC,CAPnC,aAAc,CADd,SAUD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAIC,qCAAsC,CADtC,kCAED,CAEA,mCAEC,SAaD,CAVC,0DAQC,eAAgB,CAHhB,QAAS,CAHT,UAOD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAMA,wEACC,cACD,CAEA,iFACC,aAAc,CACd,UACD,CAGD,qBACC,YACD,CAtGD,qCAyGE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JAEC,2BAA4B,CAD5B,wBAED,CAGA,2JAEC,4BAA6B,CAD7B,yBAED,CASD,8RACC,mCACD,CAWA,qHACC,cACD,CAIC,6JAEC,4BAA6B,CAD7B,yBAED,CAGA,2JAEC,2BAA4B,CAD5B,wBAED,CASD,8RACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-flow: row nowrap;\\n\\talign-items: center;\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-flow: row wrap;\\n\\t\\talign-items: center;\\n\\t\\tflex-grow: 1;\\n\\n\\t}\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t/*\\n\\t\\t * A leading or trailing separator makes no sense (separates from nothing on one side).\\n\\t\\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\\n\\t\\t * moved to another toolbar in the dropdown.\\n\\t\\t */\\n\\t\\t&:first-child,\\n\\t\\t&:last-child {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\tflex-basis: 100%;\\n\\t}\\n\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t&.ck-toolbar_vertical > .ck-toolbar__items {\\n\\t\\tflex-direction: column;\\n\\t}\\n\\n\\t&.ck-toolbar_floating > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t& > .ck-dropdown__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\tborder: 1px solid var(--ck-color-toolbar-border);\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\talign-self: stretch;\\n\\t\\twidth: 1px;\\n\\t\\tmin-width: 1px;\\n\\t\\tbackground: var(--ck-color-toolbar-border);\\n\\n\\t\\t/*\\n\\t\\t * These margins make the separators look better in balloon toolbars (when aligned with the \\\"tip\\\").\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\\n\\t\\t */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\theight: 0;\\n\\t}\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\t& > *:not(.ck-toolbar__line-break) {\\n\\t\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t/* Don't display a separator after an empty items container, for instance,\\n\\t\\twhen all items were grouped */\\n\\t\\t&:empty + .ck.ck-toolbar__separator {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/* Make sure items wrapped to the next line have v-spacing */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t&.ck-toolbar_vertical {\\n\\t\\t/* Items in a vertical toolbar span the entire width. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\\n\\t\\t& > .ck-toolbar__items > .ck {\\n\\t\\t\\t/* Items in a vertical toolbar should span the horizontal space. */\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t/* Items in a vertical toolbar should have no margin. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\\n\\t\\t\\tborder-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-toolbar_compact {\\n\\t\\t/* No spacing around items. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t& > .ck-toolbar__items > * {\\n\\t\\t\\t/* Compact toolbar items have no spacing between them. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* \\\"Middle\\\" children should have no rounded corners. */\\n\\t\\t\\t&:not(:first-child):not(:last-child) {\\n\\t\\t\\t\\tborder-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/*\\n\\t\\t * Dropdown button has asymmetric padding to fit the arrow.\\n\\t\\t * This button has no arrow so let's revert that padding back to normal.\\n\\t\\t */\\n\\t\\t& > .ck.ck-button.ck-dropdown__button {\\n\\t\\t\\tpadding-left: var(--ck-spacing-tiny);\\n\\t\\t}\\n\\t}\\n\\n\\t/* A drop-down containing the nested toolbar with configured items. */\\n\\t& .ck-toolbar__nested-toolbar-dropdown {\\n\\t\\t/* Prevent empty space in the panel when the dropdown label is visible and long but the toolbar has few items. */\\n\\t\\t& > .ck-dropdown__panel {\\n\\t\\t\\tmin-width: auto;\\n\\t\\t}\\n\\n\\t\\t& > .ck-button > .ck-button__label {\\n\\t\\t\\tmax-width: 7em;\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@nest .ck-toolbar-container & {\\n\\t\\tborder: 0;\\n\\t}\\n}\\n\\n/* stylelint-disable */\\n\\n/*\\n * Styles for RTL toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"rtl\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"rtl\\\"] {\\n\\t& > .ck-toolbar__items > .ck {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\\n\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-left: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/*\\n * Styles for LTR toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"ltr\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"ltr\\\"] {\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/* stylelint-enable */\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium);pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css\"],\"names\":[],\"mappings\":\"AAKA,gCCGC,6BAA8B,CAC9B,6BAA8B,CAC9B,iCAAkC,CAClC,6BAA8B,CAC9B,8DAA+D,CAE/D,kCAAmC,CDPnC,mBAAoB,CAEpB,qCACD,CCMC,kDAGC,kCAAmC,CAFnC,cAAe,CACf,eAED,CAbD,gCAgBC,eAMD,CAHC,uCACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t/* Keep tooltips transparent for any interactions. */\\n\\tpointer-events: none;\\n\\n\\tz-index: calc( var(--ck-z-modal) + 100 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t--ck-balloon-border-width: 0px;\\n\\t--ck-balloon-arrow-offset: 0px;\\n\\t--ck-balloon-arrow-half-width: 4px;\\n\\t--ck-balloon-arrow-height: 4px;\\n\\t--ck-color-panel-background: var(--ck-color-tooltip-background);\\n\\n\\tpadding: 0 var(--ck-spacing-medium);\\n\\n\\t& .ck-tooltip__text {\\n\\t\\tfont-size: .9em;\\n\\t\\tline-height: 1.5;\\n\\t\\tcolor: var(--ck-color-tooltip-text);\\n\\t}\\n\\n\\t/* Reset balloon panel styles */\\n\\tbox-shadow: none;\\n\\n\\t/* Hide the default shadow of the .ck-balloon-panel tip */\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-line-height:10px;--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);border:0;box-shadow:none;min-height:unset}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:7.5px;font-weight:700;letter-spacing:-.2px;line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_reset.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_poweredby.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_spacing.css\"],\"names\":[],\"mappings\":\"AAQA,WAGC,sBACD,CCPA,2EAGC,qBAAsB,CAEtB,WAAY,CACZ,eAAgB,CAFhB,UAGD,CCPA,MACC,gBAAiB,CACjB,4CACD,CCAA,oDAEC,yBACD,CCNA,MACC,gCAAiC,CACjC,oCAAqC,CACrC,sCAAuC,CACvC,kCAA2C,CAC3C,qDAAsD,CACtD,+BAA4C,CAC5C,yDACD,CAEA,2CACC,qDAAsD,CAItD,0CAA2C,CAF3C,QAAS,CACT,eAAgB,CAEhB,gBA6CD,CA3CC,6DACC,4CAoCD,CAlCC,+DAGC,kBAAmB,CAFnB,cAAe,CACf,YAAa,CAGb,qBAAsB,CACtB,4CAA6C,CAF7C,WAAY,CAGZ,qFACD,CAEA,mFASC,qCAAsC,CAFtC,cAAe,CANf,eAAgB,CAIhB,eAAiB,CAHjB,oBAAqB,CAMrB,kBAAmB,CAFnB,gBAAiB,CAHjB,gBAAiB,CACjB,wBAOD,CAEA,sEAEC,cAAe,CADf,aAED,CAGC,qEACC,mBAAqB,CACrB,SACD,CAIF,mEACC,2BAA4B,CAC5B,8CACD,CC5DD,MACC,kCAAmD,CACnD,+BAAoD,CACpD,8BAAkD,CAClD,8BAAuD,CACvD,6BAAmD,CACnD,yBAA+C,CAC/C,8BAAsD,CACtD,oCAA4D,CAC5D,6BAAkD,CAIlD,mDAA4D,CAC5D,qEAA+E,CAC/E,qCAA4D,CAC5D,qDAA8D,CAC9D,gDAAyD,CACzD,yCAAqD,CACrD,sCAAsD,CACtD,4CAA0D,CAC1D,sCAAsD,CAItD,gDAAuD,CACvD,kDAAiE,CACjE,mDAAkE,CAClE,yDAA8D,CAE9D,uCAA6D,CAC7D,6CAAoE,CACpE,8CAAoE,CACpE,gDAAiE,CACjE,kCAAyD,CAGzD,+DAAsE,CACtE,iDAAsE,CACtE,kDAAsE,CACtE,oDAAoE,CACpE,6DAAsE,CAEtE,8BAAoD,CACpD,gCAAqD,CAErD,+CAA8D,CAC9D,qDAAiE,CACjE,+EAAqF,CACrF,oDAAuE,CACvE,yEAA8E,CAC9E,oDAAgE,CAIhE,oEAA2E,CAC3E,4DAAoE,CAIpE,2DAAoE,CACpE,mDAA6D,CAC7D,wDAAgE,CAChE,+CAA0D,CAC1D,4CAA2D,CAC3D,4DAAoE,CACpE,sCAAsD,CAItD,0DAAmE,CACnE,uFAA6F,CAC7F,oEAA2E,CAC3E,0EAA+E,CAC/E,8DAAsE,CAItE,2DAAoE,CACpE,mDAA6D,CAI7D,6DAAsE,CACtE,qDAA+D,CAI/D,uDAAgE,CAChE,uDAAiE,CAIjE,0CAAyD,CAIzD,wCAA2D,CAI3D,+BAAoD,CACpD,uDAAmE,CACnE,kDAAgE,CAIhE,oCAAwD,CCvGxD,wBAAyB,CCAzB,0CAA2C,CAK3C,gGAAiG,CAKjG,4GAA6G,CAK7G,sGAAuG,CAKvG,sDAAuD,CCvBvD,wBAAyB,CACzB,6BAA8B,CAC9B,wDAA6D,CAE7D,yBAA0B,CAC1B,2BAA4B,CAC5B,yBAA0B,CAC1B,wBAAyB,CACzB,0BAA2B,CCJ3B,kCJuGD,CIjGA,2EAaC,oBAAqB,CANrB,sBAAuB,CADvB,QAAS,CAFT,QAAS,CACT,SAAU,CAGV,oBAAqB,CAErB,eAAgB,CADhB,qBAKD,CAKA,8DAGC,wBAAyB,CAEzB,0BAA2B,CAG3B,WAAY,CACZ,UAAW,CALX,iGAAkG,CAElG,eAAgB,CAChB,kBAGD,CAGC,qDACC,gBACD,CAEA,mDAEC,sBACD,CAEA,qDACC,oBACD,CAEA,mLAGC,WACD,CAEA,iNAGC,cACD,CAEA,qDAEC,yBAAoC,CADpC,YAED,CAEA,qEAGC,QAAQ,CADR,SAED,CAMD,8BAEC,gBACD,CCnFA,MACC,sBAAuB,CCAvB,gEAAiE,CAKjE,0DAA2D,CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which hides an element in DOM.\\n */\\n.ck-hidden {\\n\\t/* Override selector specificity. Otherwise, all elements with some display\\n\\tstyle defined will override this one, which is not a desired result. */\\n\\tdisplay: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-reset,\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\tbox-sizing: border-box;\\n\\twidth: auto;\\n\\theight: auto;\\n\\tposition: static;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-z-default: 1;\\n\\t--ck-z-modal: calc( var(--ck-z-default) + 999 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class that disables all transitions of the element and its children.\\n */\\n.ck-transitions-disabled,\\n.ck-transitions-disabled * {\\n\\ttransition: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-powered-by-line-height: 10px;\\n\\t--ck-powered-by-padding-vertical: 2px;\\n\\t--ck-powered-by-padding-horizontal: 4px;\\n\\t--ck-powered-by-text-color: hsl(0, 0%, 31%);\\n\\t--ck-powered-by-border-radius: var(--ck-border-radius);\\n\\t--ck-powered-by-background: hsl(0, 0%, 100%);\\n\\t--ck-powered-by-border-color: var(--ck-color-focus-border);\\n}\\n\\n.ck.ck-balloon-panel.ck-powered-by-balloon {\\n\\t--ck-border-radius: var(--ck-powered-by-border-radius);\\n\\n\\tborder: 0;\\n\\tbox-shadow: none;\\n\\tbackground: var(--ck-powered-by-background);\\n\\tmin-height: unset;\\n\\n\\t& .ck.ck-powered-by {\\n\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\n\\t\\t& a {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\talign-items: center;\\n\\t\\t\\topacity: .66;\\n\\t\\t\\tfilter: grayscale(80%);\\n\\t\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\t\\t\\tpadding: var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal);\\n\\t\\t}\\n\\n\\t\\t& .ck-powered-by__label {\\n\\t\\t\\tfont-size: 7.5px;\\n\\t\\t\\tletter-spacing: -.2px;\\n\\t\\t\\tpadding-left: 2px;\\n\\t\\t\\ttext-transform: uppercase;\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tmargin-right: 4px;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tline-height: normal;\\n\\t\\t\\tcolor: var(--ck-powered-by-text-color);\\n\\n\\t\\t}\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t& a {\\n\\t\\t\\t\\tfilter: grayscale(0%);\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"position_border\\\"] {\\n\\t\\tborder: var(--ck-focus-ring);\\n\\t\\tborder-color: var(--ck-powered-by-border-color);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-base-foreground: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 98%);\\n\\t--ck-color-base-background: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 100%);\\n\\t--ck-color-base-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(220, 6%, 81%);\\n\\t--ck-color-base-action: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(104, 50.2%, 42.5%);\\n\\t--ck-color-base-focus: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\t--ck-color-base-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 20%);\\n\\t--ck-color-base-active: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\t--ck-color-base-active-focus:\\t\\t\\t\\t\\t\\t\\t\\thsl(218.2, 100%, 52.5%);\\n\\t--ck-color-base-error:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t/* -- Generic colors ------------------------------------------------------------------------ */\\n\\n\\t--ck-color-focus-border-coordinates: \\t\\t\\t\\t\\t\\t218, 81.8%, 56.9%;\\n\\t--ck-color-focus-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(var(--ck-color-focus-border-coordinates));\\n\\t--ck-color-focus-outer-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsl(212.4, 89.3%, 89%);\\n\\t--ck-color-focus-disabled-shadow:\\t\\t\\t\\t\\t\\t\\thsla(209, 90%, 72%,.3);\\n\\t--ck-color-focus-error-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsla(9,100%,56%,.3);\\n\\t--ck-color-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-shadow-drop: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.15);\\n\\t--ck-color-shadow-drop-active:\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.2);\\n\\t--ck-color-shadow-inner: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Buttons ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-button-default-background: \\t\\t\\t\\t\\t\\ttransparent;\\n\\t--ck-color-button-default-hover-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-active-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-disabled-background: \\t\\t\\t\\ttransparent;\\n\\n\\t--ck-color-button-on-background: \\t\\t\\t\\t\\t\\t\\thsl(212, 100%, 97.1%);\\n\\t--ck-color-button-on-hover-background: \\t\\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-active-background: \\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-disabled-background: \\t\\t\\t\\t\\thsl(211, 15%, 95%);\\n\\t--ck-color-button-on-color:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\n\\n\\t--ck-color-button-action-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-action);\\n\\t--ck-color-button-action-hover-background: \\t\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-active-background: \\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-disabled-background: \\t\\t\\t\\thsl(104, 44%, 58%);\\n\\t--ck-color-button-action-text: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t--ck-color-button-save: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(120, 100%, 27%);\\n\\t--ck-color-button-cancel: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t--ck-color-switch-button-off-background:\\t\\t\\t\\t\\thsl(0, 0%, 57.6%);\\n\\t--ck-color-switch-button-off-hover-background:\\t\\t\\t\\thsl(0, 0%, 49%);\\n\\t--ck-color-switch-button-on-background:\\t\\t\\t\\t\\t\\tvar(--ck-color-button-action-background);\\n\\t--ck-color-switch-button-on-hover-background:\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-switch-button-inner-background:\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-switch-button-inner-shadow:\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Dropdown ------------------------------------------------------------------------------ */\\n\\n\\t--ck-color-dropdown-panel-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-dropdown-panel-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Input --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-input-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-input-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-error-border:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-error);\\n\\t--ck-color-input-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-input-disabled-background: \\t\\t\\t\\t\\t\\thsl(0, 0%, 95%);\\n\\t--ck-color-input-disabled-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-disabled-text: \\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 46%);\\n\\n\\t/* -- List ---------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-list-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-list-button-hover-background: \\t\\t\\t\\t\\tvar(--ck-color-button-default-hover-background);\\n\\t--ck-color-list-button-on-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-background-focus: \\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-text:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Panel --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-panel-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-panel-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Toolbar ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-toolbar-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-toolbar-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Tooltip ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-tooltip-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-tooltip-text: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Engine -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-engine-placeholder-text: \\t\\t\\t\\t\\t\\thsl(0, 0%, 44%);\\n\\n\\t/* -- Upload -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-upload-bar-background:\\t\\t \\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\n\\t/* -- Link -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-link-default:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(240, 100%, 47%);\\n\\t--ck-color-link-selected-background:\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.1);\\n\\t--ck-color-link-fake-selection:\\t\\t\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.3);\\n\\n\\t/* -- Search result highlight ---------------------------------------------------------------- */\\n\\n\\t--ck-color-highlight-background:\\t\\t\\t\\t\\t\\t\\thsl(60, 100%, 50%)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * An opacity value of disabled UI item.\\n\\t */\\n\\t--ck-disabled-opacity: .5;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * The geometry of the of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when disabled).\\n\\t */\\n\\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when has errors).\\n\\t */\\n\\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's border or outline.\\n\\t */\\n\\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-font-size-base: 13px;\\n\\t--ck-line-height-base: 1.84615;\\n\\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\\n\\n\\t--ck-font-size-tiny: 0.7em;\\n\\t--ck-font-size-small: 0.75em;\\n\\t--ck-font-size-normal: 1em;\\n\\t--ck-font-size-big: 1.4em;\\n\\t--ck-font-size-large: 1.8em;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* This is super-important. This is **manually** adjusted so a button without an icon\\n\\tis never smaller than a button with icon, additionally making sure that text-less buttons\\n\\tare perfect squares. The value is also shared by other components which should stay \\\"in-line\\\"\\n\\twith buttons. */\\n\\t--ck-ui-component-min-height: 2.3em;\\n}\\n\\n/**\\n * Resets an element, ignoring its children.\\n */\\n.ck.ck-reset,\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\t/* Do not include inheritable rules here. */\\n\\tmargin: 0;\\n\\tpadding: 0;\\n\\tborder: 0;\\n\\tbackground: transparent;\\n\\ttext-decoration: none;\\n\\tvertical-align: middle;\\n\\ttransition: none;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\\n\\tword-wrap: break-word;\\n}\\n\\n/**\\n * Resets an element AND its children.\\n */\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\t/* These are rule inherited by all children elements. */\\n\\tborder-collapse: collapse;\\n\\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\\n\\tcolor: var(--ck-color-text);\\n\\ttext-align: left;\\n\\twhite-space: nowrap;\\n\\tcursor: auto;\\n\\tfloat: none;\\n}\\n\\n.ck-reset_all {\\n\\t& .ck-rtl *:not(.ck-reset_all-excluded *) {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t& iframe:not(.ck-reset_all-excluded *) {\\n\\t\\t/* For IE */\\n\\t\\tvertical-align: inherit;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *) {\\n\\t\\twhite-space: pre-wrap;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: text;\\n\\t}\\n\\n\\t& textarea[disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"][disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"][disabled]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: default;\\n\\t}\\n\\n\\t& fieldset:not(.ck-reset_all-excluded *) {\\n\\t\\tpadding: 10px;\\n\\t\\tborder: 2px groove hsl(255, 7%, 88%);\\n\\t}\\n\\n\\t& button:not(.ck-reset_all-excluded *)::-moz-focus-inner {\\n\\t\\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\\n\\t\\tpadding: 0;\\n\\t\\tborder: 0\\n\\t}\\n}\\n\\n/**\\n * Default UI rules for RTL languages.\\n */\\n.ck[dir=\\\"rtl\\\"],\\n.ck[dir=\\\"rtl\\\"] .ck {\\n\\ttext-align: right;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Default border-radius value.\\n */\\n:root{\\n\\t--ck-border-radius: 2px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * A visual style of element's inner shadow (i.e. input).\\n\\t */\\n\\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\\n\\n\\t/**\\n\\t * A visual style of element's drop shadow (i.e. panel).\\n\\t */\\n\\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\\n\\n\\t/**\\n\\t * A visual style of element's active shadow (i.e. comment or suggestion).\\n\\t */\\n\\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-spacing-unit: \\t\\t\\t\\t\\t\\t0.6em;\\n\\t--ck-spacing-large: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 1.5);\\n\\t--ck-spacing-standard: \\t\\t\\t\\t\\tvar(--ck-spacing-unit);\\n\\t--ck-spacing-medium: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.8);\\n\\t--ck-spacing-small: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.5);\\n\\t--ck-spacing-tiny: \\t\\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.3);\\n\\t--ck-spacing-extra-tiny: \\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.16);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CAEtD,qDAAsD,CACtD,6CAA8C,CAF9C,0CAA2C,CAI3C,aAAc,CADd,kCAAmC,CAGnC,uCAAwC,CACxC,4CAA6C,CAF7C,iCAsCD,CAlCC,8NAKC,iBACD,CAEA,0CAEC,qCAAsC,CADtC,oCAED,CAEA,2CAEC,sCAAuC,CADvC,oCAED,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CAEC,QAAS,CADT,6CAAgD,CAEhD,yBACD,CCjFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eAGC,yBAA0B,CAD1B,mBAAoB,CADpB,gDAAiD,CAGjD,6GAUD,CARC,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAWD,CAPC,yGAKC,iEAAkE,CCnCnE,2BAA2B,CCF3B,qCAA8B,CDC9B,YDqCA,CAIA,4EAKC,4BAA6B,CAa7B,iEAAkE,CAhBlE,qBAAsB,CAoBtB,mDAAoD,CAhBpD,SAAU,CALV,WAAY,CAsBZ,KAAM,CAFN,2BAA4B,CAT5B,6SAgCD,CAnBC,qFAIC,oDAAqD,CADrD,yCAA0C,CAD1C,wCAWD,CANC,kHACC,SAAU,CAGV,+DACD,CAID,wHACC,SACD,CAID,kFAEC,oDAAqD,CADrD,SAED,CAKC,oMAEC,6CAA8C,CAD9C,SAOD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-resizer: var(--ck-color-focus-border);\\n\\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\\n\\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\\n\\n\\t--ck-resizer-border-radius: var(--ck-border-radius);\\n\\t--ck-resizer-tooltip-offset: 10px;\\n\\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\\n}\\n\\n.ck .ck-widget {\\n\\t/* This is neccessary for type around UI to be positioned properly. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n\\n\\t& .ck-widget__selection-handle {\\n\\t\\tposition: absolute;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the icon in not a subject to font-size or line-height to avoid\\n\\t\\t\\tunnecessary spacing around it. */\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n\\n\\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n}\\n\\n.ck .ck-size-view {\\n\\tbackground: var(--ck-color-resizer-tooltip-background);\\n\\tcolor: var(--ck-color-resizer-tooltip-text);\\n\\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\tfont-size: var(--ck-font-size-tiny);\\n\\tdisplay: block;\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\theight: var(--ck-resizer-tooltip-height);\\n\\tline-height: var(--ck-resizer-tooltip-height);\\n\\n\\t&.ck-orientation-top-left,\\n\\t&.ck-orientation-top-right,\\n\\t&.ck-orientation-bottom-right,\\n\\t&.ck-orientation-bottom-left,\\n\\t&.ck-orientation-above-center {\\n\\t\\tposition: absolute;\\n\\t}\\n\\n\\t&.ck-orientation-top-left {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-top-right {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t/* Class applied if the widget is too small to contain the size label */\\n\\t&.ck-orientation-above-center {\\n\\t\\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\\n\\t\\tleft: 50%;\\n\\t\\ttransform: translate(-50%);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-widget-outline-thickness: 3px;\\n\\t--ck-widget-handler-icon-size: 16px;\\n\\t--ck-widget-handler-animation-duration: 200ms;\\n\\t--ck-widget-handler-animation-curve: ease;\\n\\n\\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\\n\\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\\n\\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\\n\\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\\n}\\n\\n.ck .ck-widget {\\n\\toutline-width: var(--ck-widget-outline-thickness);\\n\\toutline-style: solid;\\n\\toutline-color: transparent;\\n\\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\\n\\t}\\n\\n\\t&:hover {\\n\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t}\\n}\\n\\n.ck .ck-editor__nested-editable {\\n\\tborder: 1px solid transparent;\\n\\n\\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\\n\\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\\n\\t&.ck-editor__nested-editable_focused,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\n\\t\\tbackground-color: var(--ck-color-widget-editable-focus-background);\\n\\t}\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t& .ck-widget__selection-handle {\\n\\t\\tpadding: 4px;\\n\\t\\tbox-sizing: border-box;\\n\\n\\t\\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\\n\\t\\tbackground-color: transparent;\\n\\t\\topacity: 0;\\n\\n\\t\\t/* Transition:\\n\\t\\t * background-color for the .ck-widget_selected state change,\\n\\t\\t * visibility for hiding the handler,\\n\\t\\t * opacity for the proper look of the icon when the handler disappears. */\\n\\t\\ttransition:\\n\\t\\t\\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t/* Make only top corners round. */\\n\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\n\\t\\t/* Place the drag handler outside the widget wrapper. */\\n\\t\\ttransform: translateY(-100%);\\n\\t\\tleft: calc(0px - var(--ck-widget-outline-thickness));\\n\\t\\ttop: 0;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\\n\\t\\t\\twidth: var(--ck-widget-handler-icon-size);\\n\\t\\t\\theight: var(--ck-widget-handler-icon-size);\\n\\t\\t\\tcolor: var(--ck-color-widget-drag-handler-icon-color);\\n\\n\\t\\t\\t/* The \\\"selected\\\" part of the icon is invisible by default */\\n\\t\\t\\t& .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 0;\\n\\n\\t\\t\\t\\t/* Note: The animation is longer on purpose. Simply feels better. */\\n\\t\\t\\t\\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\\n\\t\\t&:hover .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\topacity: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\topacity: 1;\\n\\t\\tbackground-color: var(--ck-color-widget-hover-border);\\n\\t}\\n\\n\\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\topacity: 1;\\n\\t\\t\\tbackground-color: var(--ck-color-focus-border);\\n\\n\\t\\t\\t/* When the widget is selected, notify the user using the proper look of the icon. */\\n\\t\\t\\t& .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/* In a RTL environment, align the selection handler to the right side of the widget */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\\n\\tleft: auto;\\n\\tright: calc(0px - var(--ck-widget-outline-thickness));\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\\n.ck.ck-editor__editable.ck-read-only .ck-widget {\\n\\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\\n\\ttransition: none;\\n\\n\\t&:not(.ck-widget_selected) {\\n\\t\\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\\n\\t\\t *\\n\\t\\t * Leave the unit because this custom property is used in calc() by other features.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\\n\\t\\t */\\n\\t\\t--ck-widget-outline-thickness: 0px;\\n\\t}\\n\\n\\t&.ck-widget_with-selection-handle {\\n\\t\\t& .ck-widget__selection-handle,\\n\\t\\t& .ck-widget__selection-handle:hover {\\n\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Style the widget when it's selected but the editable it belongs to lost focus. */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck.ck-editor__editable.ck-blurred .ck-widget {\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline-color: var(--ck-color-widget-blurred-border);\\n\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t& > .ck-widget__selection-handle,\\n\\t\\t\\t& > .ck-widget__selection-handle:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\\n\\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\\n\\tIn fact, anything with overflow: hidden.\\n\\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\\n\\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css\"],\"names\":[],\"mappings\":\"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CAMb,MAAO,CAFP,mBAAoB,CAHpB,iBAAkB,CAMlB,KACD,CAGC,2EACC,aACD,CAGD,gCAIC,kBAAmB,CAHnB,iBAcD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCAGC,uCAAwC,CACxC,gDAA6D,CAC7D,6CAA8C,CAH9C,6BAA8B,CAD9B,4BAyBD,CAnBC,oEAEC,6BAA8B,CAD9B,4BAED,CAEA,qEAEC,8BAA+B,CAD/B,4BAED,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget_with-resizer {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\\n\\tpointer-events: none;\\n\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\\n\\t& > .ck-widget__resizer {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\tposition: absolute;\\n\\n\\t/* Resizers are the only UI elements that should interfere with a pointer device. */\\n\\tpointer-events: all;\\n\\n\\t&.ck-widget__resizer__handle-top-left,\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tcursor: nwse-resize;\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right,\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tcursor: nesw-resize;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-resizer-size: 10px;\\n\\n\\t/* Set the resizer with a 50% offset. */\\n\\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\\n\\t--ck-resizer-border-width: 1px;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\toutline: 1px solid var(--ck-color-resizer);\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\twidth: var(--ck-resizer-size);\\n\\theight: var(--ck-resizer-size);\\n\\tbackground: var(--ck-color-focus-border);\\n\\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\n\\t&.ck-widget__resizer__handle-top-left {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\\\"\\\";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css\"],\"names\":[],\"mappings\":\"AASC,+CACC,aAAc,CAEd,eAAgB,CADhB,iBAAkB,CAElB,2BAwBD,CAtBC,mDAGC,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAEA,qFAGC,kBAAoB,CADpB,gDAAoD,CAGpD,0BACD,CAEA,oFAEC,mDAAuD,CACvD,mBAAqB,CAErB,yBACD,CAUA,mLACC,UAAW,CACX,aAAc,CAGd,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAMD,2EACC,YAAa,CAEb,MAAO,CADP,iBAAkB,CAElB,OACD,CAOA,iFACC,gDAAqD,CACrD,iDACD,CAKA,wHAEC,aAAc,CADd,qDAED,CAKA,uHACC,wDAA6D,CAC7D,aACD,CAoBD,mOACC,YACD,CC3GA,MACC,wCAAyC,CACzC,wEAAyE,CACzE,8EAA+E,CAC/E,2FAA4F,CAC5F,wDAAyD,CACzD,uDAAwD,CACxD,yEACD,CAgBC,+CAGC,oDAAqD,CACrD,mBAAoB,CAFpB,+CAAgD,CAVjD,SAAU,CACV,mBAAoB,CAYnB,uMAAyM,CAJzM,8CAkDD,CA1CC,mDAEC,UAAW,CAGX,cAAe,CAFf,8BAA+B,CAC/B,6BAA8B,CAH9B,UAoBD,CAdC,qDACC,mBAAoB,CACpB,mBAAoB,CAEpB,SAAU,CACV,qDAAsD,CACtD,kBAAmB,CACnB,oBAAqB,CACrB,qBACD,CAEA,wDACC,kBACD,CAGD,qDAIC,6DAcD,CARE,kEACC,oDACD,CAEA,8DACC,wDACD,CAUF,uKAvED,SAAU,CACV,mBAwEC,CAOD,gGACC,0DACD,CAOA,uKAEC,2DAQD,CANC,mLAIC,uEAAkF,CADlF,mBAAoB,CADpB,2DAA4D,CAD5D,0DAID,CAOD,8GACC,gBACD,CAKA,mDAGC,mFAAoF,CAOpF,oCAAqC,CARrC,UAAW,CAOX,oCAAwC,CARxC,mBAUD,CAOC,6JAEC,yBACD,CAUA,yKACC,iDACD,CAMA,uOAlJD,SAAU,CACV,mBAmJC,CAoBA,6yBACC,SACD,CASF,uHACC,aAAc,CACd,iBACD,CAYG,iRAlMF,SAAU,CACV,mBAmME,CAQH,kIACC,qEAKD,CAHC,wIACC,WACD,CAGD,4CACC,GACC,oBACD,CACA,OACC,mBACD,CACD,CAEA,gDACC,OACC,mBACD,CACA,OACC,mBACD,CACD,CAEA,8CACC,GACC,6HACD,CACA,IACC,6HACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t\\toverflow: hidden;\\n\\t\\tz-index: var(--ck-z-default);\\n\\n\\t\\t& svg {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 50%;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 2);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_before {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tleft: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_after {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tright: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(50%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 1px;\\n\\t\\t\\tleft: 1px;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tdisplay: none;\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t}\\n\\n\\t/*\\n\\t * When the widget is hovered the \\\"fake caret\\\" would normally be narrower than the\\n\\t * extra outline displayed around the widget. Let's extend the \\\"fake caret\\\" to match\\n\\t * the full width of the widget.\\n\\t */\\n\\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t\\tright: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed before the widget (backward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed after the widget (forward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n/*\\n * Integration with the read-only mode of the editor.\\n */\\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the restricted editing mode (feature) of the editor.\\n */\\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\\n */\\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-widget-type-around-button-size: 20px;\\n\\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\\n\\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\\n\\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\\n\\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\\n\\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\\n\\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\\n}\\n\\n@define-mixin ck-widget-type-around-button-visible {\\n\\topacity: 1;\\n\\tpointer-events: auto;\\n}\\n\\n@define-mixin ck-widget-type-around-button-hidden {\\n\\topacity: 0;\\n\\tpointer-events: none;\\n}\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\twidth: var(--ck-widget-type-around-button-size);\\n\\t\\theight: var(--ck-widget-type-around-button-size);\\n\\t\\tbackground: var(--ck-color-widget-type-around-button);\\n\\t\\tborder-radius: 100px;\\n\\t\\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: 10px;\\n\\t\\t\\theight: 8px;\\n\\t\\t\\ttransform: translate(-50%,-50%);\\n\\t\\t\\ttransition: transform .5s ease;\\n\\t\\t\\tmargin-top: 1px;\\n\\n\\t\\t\\t& * {\\n\\t\\t\\t\\tstroke-dasharray: 10;\\n\\t\\t\\t\\tstroke-dashoffset: 0;\\n\\n\\t\\t\\t\\tfill: none;\\n\\t\\t\\t\\tstroke: var(--ck-color-widget-type-around-button-icon);\\n\\t\\t\\t\\tstroke-width: 1.5px;\\n\\t\\t\\t\\tstroke-linecap: round;\\n\\t\\t\\t\\tstroke-linejoin: round;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& line {\\n\\t\\t\\t\\tstroke-dasharray: 7;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t/*\\n\\t\\t\\t * Display the \\\"sonar\\\" around the button when hovered.\\n\\t\\t\\t */\\n\\t\\t\\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Animate active button's icon.\\n\\t\\t\\t */\\n\\t\\t\\t& svg {\\n\\t\\t\\t\\t& polyline {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& line {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Show type around buttons when the widget gets selected or being hovered.\\n\\t */\\n\\t&.ck-widget_selected,\\n\\t&:hover {\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-visible;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\\n\\t * and still can be hovered).\\n\\t */\\n\\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-hover);\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-active);\\n\\n\\t\\t&::after {\\n\\t\\t\\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\tborder-radius: 100px;\\n\\t\\t\\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the \\\"before\\\" button when the widget has a selection handle. Because some space\\n\\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\\n\\t */\\n\\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\t\\tmargin-left: 20px;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& .ck-widget__type-around__fake-caret {\\n\\t\\tpointer-events: none;\\n\\t\\theight: 1px;\\n\\t\\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\\n\\n\\t\\t/*\\n\\t\\t * The semi-transparent-outline+background combo improves the contrast\\n\\t\\t * when the background underneath the fake caret is dark.\\n\\t\\t */\\n\\t\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n\\t\\tbackground: var(--ck-color-base-text);\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t * Despite the widget being physically selected in the model, its outline should disappear.\\n\\t */\\n\\t&.ck-widget_selected {\\n\\t\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t\\toutline-color: transparent;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t/*\\n\\t\\t * When the \\\"fake caret\\\" is visible we simulate that the widget is not selected\\n\\t\\t * (despite being physically selected), so the outline color should be for the\\n\\t\\t * unselected widget.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Styles of the type around buttons when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t\\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\\n\\t\\t */\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\\n\\t\\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\\n\\t\\t */\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t&.ck-widget_selected,\\n\\t\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\t\\topacity: 0\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\\n\\t\\t * hide the resize UI because it creates too much noise. It can be visible when the user\\n\\t\\t * hovers the widget, though.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\\n\\t\\t\\topacity: 0\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the \\\"before\\\" button when the widget has a selection handle in an RTL environment.\\n * The selection handler is aligned to the right side of the widget so there is no need to create\\n * additional space for it next to the \\\"before\\\" button.\\n */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\tmargin-left: 0;\\n\\tmargin-right: 20px;\\n}\\n\\n/*\\n * Hide type around buttons when the widget is selected as a child of a selected\\n * nested editable (e.g. mulit-cell table selection).\\n *\\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\\n */\\n.ck-editor__nested-editable.ck-editor__editable_selected {\\n\\t& .ck-widget {\\n\\t\\t&.ck-widget_selected,\\n\\t\\t&:hover {\\n\\t\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\\n */\\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\\n\\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\\n\\n\\t& svg * {\\n\\t\\tstroke: hsl(0,0%,60%);\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-dash {\\n\\t0% {\\n\\t\\tstroke-dashoffset: 10;\\n\\t}\\n\\t20%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-tip-dash {\\n\\t0%, 20% {\\n\\t\\tstroke-dashoffset: 7;\\n\\t}\\n\\t40%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-button-sonar {\\n\\t0% {\\n\\t\\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n\\t50% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\\n\\t}\\n\\t100% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-fake-caret-pulse {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t49% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t50% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t99% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid.ck-character-grid__tiles{display:grid}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@phudak/ckeditor5-emoji/theme/charactergrid.css\"],\"names\":[],\"mappings\":\"AAKA,sBACC,cACD,CAEA,+CACI,YACJ\",\"sourcesContent\":[\"/*\\r\\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\\r\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\r\\n */\\r\\n\\r\\n.ck.ck-character-grid {\\r\\n\\tmax-width: 100%;\\r\\n}\\r\\n\\r\\n.ck.ck-character-grid.ck-character-grid__tiles {\\r\\n display: grid;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-character-info{display:flex;justify-content:space-between}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@phudak/ckeditor5-emoji/theme/characterinfo.css\"],\"names\":[],\"mappings\":\"AAKA,sBACC,YAAa,CACb,6BACD\",\"sourcesContent\":[\"/*\\r\\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\\r\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\r\\n */\\r\\n\\r\\n.ck.ck-character-info {\\r\\n\\tdisplay: flex;\\r\\n\\tjustify-content: space-between;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-emoji-grid-font-size{font-size:1.4em!important}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@phudak/ckeditor5-emoji/theme/emoji-characters.css\"],\"names\":[],\"mappings\":\"AAAA,yBACI,yBACJ\",\"sourcesContent\":[\".ck-emoji-grid-font-size {\\r\\n font-size: 1.4em !important;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { 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\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 _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of `);\n const root = this.attachShadow({ mode: 'open' });\n root.appendChild(template.content.cloneNode(true));\n root.addEventListener('move', this);\n this[$parts] = this[$sliders].map((slider) => new slider(root));\n }\n connectedCallback() {\n // A user may set a property on an _instance_ of an element,\n // before its prototype has been connected to this class.\n // If so, we need to run it through the proper class setter.\n if (this.hasOwnProperty('color')) {\n const value = this.color;\n delete this['color'];\n this.color = value;\n }\n else if (!this.color) {\n this.color = this.colorModel.defaultColor;\n }\n }\n attributeChangedCallback(_attr, _oldVal, newVal) {\n const color = this.colorModel.fromAttr(newVal);\n if (!this[$isSame](color)) {\n this.color = color;\n }\n }\n handleEvent(event) {\n // Merge the current HSV color object with updated params.\n const oldHsva = this[$hsva];\n const newHsva = { ...oldHsva, ...event.detail };\n this[$update](newHsva);\n let newColor;\n if (!equalColorObjects(newHsva, oldHsva) &&\n !this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) {\n this[$color] = newColor;\n fire(this, 'color-changed', { value: newColor });\n }\n }\n [$isSame](color) {\n return this.color && this.colorModel.equal(color, this.color);\n }\n [$update](hsva) {\n this[$hsva] = hsva;\n this[$parts].forEach((part) => part.update(hsva));\n }\n}\n//# sourceMappingURL=color-picker.js.map","export default `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`;\n//# sourceMappingURL=hue.js.map","export default `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`;\n//# sourceMappingURL=saturation.js.map","import { ColorPicker } from '../components/color-picker.js';\nimport { hexToHsva, hsvaToHex } from '../utils/convert.js';\nimport { equalHex } from '../utils/compare.js';\nconst colorModel = {\n defaultColor: '#000',\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n fromAttr: (color) => color\n};\nexport class HexBase extends ColorPicker {\n get colorModel() {\n return colorModel;\n }\n}\n//# sourceMappingURL=hex.js.map","import { HexBase } from './lib/entrypoints/hex.js';\n/**\n * A color picker custom element that uses HEX format.\n *\n * @element hex-color-picker\n *\n * @prop {string} color - Selected color in HEX format.\n * @attr {string} color - Selected color in HEX format.\n *\n * @fires color-changed - Event fired when color property changes.\n *\n * @csspart hue - A hue selector container.\n * @csspart saturation - A saturation selector container\n * @csspart hue-pointer - A hue pointer element.\n * @csspart saturation-pointer - A saturation pointer element.\n */\nexport class HexColorPicker extends HexBase {\n}\ncustomElements.define('hex-color-picker', HexColorPicker);\n//# sourceMappingURL=hex-color-picker.js.map","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorpicker.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorpicker/colorpickerview\n */\nimport { convertColor, convertToHex } from './utils';\nimport { global, env } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nimport View from '../view';\nimport LabeledFieldView from '../labeledfield/labeledfieldview';\nimport { createLabeledInputText } from '../labeledfield/utils';\nimport 'vanilla-colorful/hex-color-picker.js';\nimport '../../theme/components/colorpicker/colorpicker.css';\nconst waitingTime = 150;\nexport default class ColorPickerView extends View {\n /**\n * Creates a view of color picker.\n *\n * @param locale\n * @param config\n */\n constructor(locale, config) {\n super(locale);\n this.set('color', '');\n this.set('_hexColor', '');\n this._format = config.format || 'hsl';\n this.hexInputRow = this._createInputRow();\n const children = this.createCollection();\n children.add(this.hexInputRow);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-color-picker'],\n tabindex: -1\n },\n children\n });\n this._debounceColorPickerEvent = debounce((color) => {\n this.set('color', color);\n }, waitingTime, {\n leading: true\n });\n // Sets color in the picker if color was updated.\n this.on('set:color', (evt, propertyName, newValue) => {\n // The color needs always to be kept in the output format.\n evt.return = convertColor(newValue, this._format);\n });\n this.on('change:color', () => {\n this._hexColor = convertColorToCommonHexFormat(this.color);\n });\n this.on('change:_hexColor', () => {\n this.picker.setAttribute('color', this._hexColor);\n // There has to be two way binding between properties.\n // Extra precaution has to be taken to trigger change back only when the color really changes.\n if (convertColorToCommonHexFormat(this.color) != convertColorToCommonHexFormat(this._hexColor)) {\n this.color = this._hexColor;\n }\n });\n }\n /**\n * Renders color picker in the view.\n */\n render() {\n super.render();\n this.picker = global.document.createElement('hex-color-picker');\n this.picker.setAttribute('class', 'hex-color-picker');\n this.picker.setAttribute('tabindex', '-1');\n this._createSlidersView();\n if (this.element) {\n this.element.insertBefore(this.picker, this.hexInputRow.element);\n // Create custom stylesheet with a look of focused pointer in color picker and append it into the color picker shadowDom\n const styleSheetForFocusedColorPicker = document.createElement('style');\n styleSheetForFocusedColorPicker.textContent = '[role=\"slider\"]:focus [part$=\"pointer\"] {' +\n 'border: 1px solid #fff;' +\n 'outline: 1px solid var(--ck-color-focus-border);' +\n 'box-shadow: 0 0 0 2px #fff;' +\n '}';\n this.picker.shadowRoot.appendChild(styleSheetForFocusedColorPicker);\n }\n this.picker.addEventListener('color-changed', event => {\n const customEvent = event;\n const color = customEvent.detail.value;\n this._debounceColorPickerEvent(color);\n });\n }\n /**\n * Focuses the first pointer in color picker.\n *\n */\n focus() {\n // In some browsers we need to move the focus to the input first.\n // Otherwise, the color picker doesn't behave as expected.\n // In FF, after selecting the color via slider, it instantly moves back to the previous color.\n // In all iOS browsers and desktop Safari, once the saturation slider is moved for the first time,\n // editor collapses the selection and doesn't apply the color change.\n // See: https://github.com/cksource/ckeditor5-internal/issues/3245, https://github.com/ckeditor/ckeditor5/issues/14119,\n // https://github.com/cksource/ckeditor5-internal/issues/3268.\n /* istanbul ignore next -- @preserve */\n if (env.isGecko || env.isiOS || env.isSafari) {\n const input = this.hexInputRow.children.get(1);\n input.focus();\n }\n const firstSlider = this.slidersView.first;\n firstSlider.focus();\n }\n /**\n * Creates collection of sliders in color picker.\n *\n * @private\n */\n _createSlidersView() {\n const colorPickersChildren = [...this.picker.shadowRoot.children];\n const sliders = colorPickersChildren.filter(item => item.getAttribute('role') === 'slider');\n const slidersView = sliders.map(slider => {\n const view = new SliderView(slider);\n return view;\n });\n this.slidersView = this.createCollection();\n slidersView.forEach(item => {\n this.slidersView.add(item);\n });\n }\n /**\n * Creates input row for defining custom colors in color picker.\n *\n * @private\n */\n _createInputRow() {\n const hashView = new HashView();\n const colorInput = this._createColorInput();\n return new ColorPickerInputRowView(this.locale, [hashView, colorInput]);\n }\n /**\n * Creates the input where user can type or paste the color in hex format.\n *\n * @private\n */\n _createColorInput() {\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n const { t } = this.locale;\n labeledInput.set({\n label: t('HEX'),\n class: 'color-picker-hex-input'\n });\n labeledInput.fieldView.bind('value').to(this, '_hexColor', pickerColor => {\n if (labeledInput.isFocused) {\n // Text field shouldn't be updated with color change if the text field is focused.\n // Imagine user typing hex code and getting the value of field changed.\n return labeledInput.fieldView.value;\n }\n else {\n return pickerColor.startsWith('#') ? pickerColor.substring(1) : pickerColor;\n }\n });\n // Only accept valid hex colors as input.\n labeledInput.fieldView.on('input', () => {\n const inputValue = labeledInput.fieldView.element.value;\n if (inputValue) {\n // Trim the whitespace.\n const trimmedValue = inputValue.trim();\n // Drop the `#` from the beginning if present.\n const hashlessInput = trimmedValue.startsWith('#') ? trimmedValue.substring(1) : trimmedValue;\n // Check if it's a hex color (3,4,6 or 8 chars long and with proper characters).\n const isValidHexColor = [3, 4, 6, 8].includes(hashlessInput.length) &&\n /(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})/.test(hashlessInput);\n if (isValidHexColor) {\n // If so, set the color.\n // Otherwise, do nothing.\n this._debounceColorPickerEvent('#' + hashlessInput);\n }\n }\n });\n return labeledInput;\n }\n}\n// Converts any color format to a unified hex format.\n//\n// @param inputColor\n// @returns An unified hex string.\nfunction convertColorToCommonHexFormat(inputColor) {\n let ret = convertToHex(inputColor);\n if (!ret) {\n ret = '#000';\n }\n if (ret.length === 4) {\n // Unfold shortcut format.\n ret = '#' + [ret[1], ret[1], ret[2], ret[2], ret[3], ret[3]].join('');\n }\n return ret.toLowerCase();\n}\n// View abstraction over pointer in color picker.\nclass SliderView extends View {\n /**\n * @param element HTML elemnt of slider in color picker.\n */\n constructor(element) {\n super();\n this.element = element;\n }\n /**\n * Focuses element.\n */\n focus() {\n this.element.focus();\n }\n}\n// View abstaction over the `#` character before color input.\nclass HashView extends View {\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__hash-view'\n ]\n },\n children: '#'\n });\n }\n}\n// The class representing a row containing hex color input field.\n// **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),\n// it will become a component in `ckeditor5-ui`.\n//\n// @private\nclass ColorPickerInputRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n */\n constructor(locale, children) {\n super(locale);\n this.children = this.createCollection(children);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__row'\n ]\n },\n children: this.children\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/componentfactory\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.\n *\n * It allows functions producing specific UI components to be registered under their unique names\n * in the factory. A registered component can be then instantiated by providing its name.\n * Note that the names are case insensitive.\n *\n * ```ts\n * // The editor provides localization tools for the factory.\n * const factory = new ComponentFactory( editor );\n *\n * factory.add( 'foo', locale => new FooView( locale ) );\n * factory.add( 'bar', locale => new BarView( locale ) );\n *\n * // An instance of FooView.\n * const fooInstance = factory.create( 'foo' );\n *\n * // Names are case insensitive so this is also allowed:\n * const barInstance = factory.create( 'Bar' );\n * ```\n *\n * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory\n * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.\n */\nexport default class ComponentFactory {\n /**\n * Creates an instance of the factory.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n /**\n * Registered component factories.\n */\n this._components = new Map();\n this.editor = editor;\n }\n /**\n * Returns an iterator of registered component names. Names are returned in lower case.\n */\n *names() {\n for (const value of this._components.values()) {\n yield value.originalName;\n }\n }\n /**\n * Registers a component factory function that will be used by the\n * {@link #create create} method and called with the\n * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,\n * allowing localization of the {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @param callback The callback that returns the component.\n */\n add(name, callback) {\n this._components.set(getNormalized(name), { callback, originalName: name });\n }\n /**\n * Creates an instance of a component registered in the factory under a specific name.\n *\n * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to\n * the previously {@link #add added} factory function, allowing localization of the\n * {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @returns The instantiated component view.\n */\n create(name) {\n if (!this.has(name)) {\n /**\n * The required component is not registered in the component factory. Please make sure\n * the provided name is correct and the component has been correctly\n * {@link module:ui/componentfactory~ComponentFactory#add added} to the factory.\n *\n * @error componentfactory-item-missing\n * @param name The name of the missing component.\n */\n throw new CKEditorError('componentfactory-item-missing', this, { name });\n }\n return this._components.get(getNormalized(name)).callback(this.editor.locale);\n }\n /**\n * Checks if a component of a given name is registered in the factory.\n *\n * @param name The name of the component.\n */\n has(name) {\n return this._components.has(getNormalized(name));\n }\n}\n/**\n * Ensures that the component name used as the key in the internal map is in lower case.\n */\nfunction getNormalized(name) {\n return String(name).toLowerCase();\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonpanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/balloonpanelview\n */\nimport View from '../../view';\nimport { getOptimalPosition, global, isRange, toUnit } from '@ckeditor/ckeditor5-utils';\nimport { isElement } from 'lodash-es';\nimport '../../../theme/components/panel/balloonpanel.css';\nconst toPx = toUnit('px');\nconst defaultLimiterElement = global.document.body;\n/**\n * The balloon panel view class.\n *\n * A floating container which can\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any\n * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position\n * e.g. when the web page is scrolled.\n *\n * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and\n * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view\n * collection.\n *\n * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}\n * that the balloon can use, automatically switching from one to another when the viewport space becomes\n * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also\n * accept any custom position set provided by the user compatible with the\n * {@link module:utils/dom/position~Options options}.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const childView = new ChildView();\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Add a child view to the panel's content collection.\n * panel.content.add( childView );\n *\n * // Start pinning the panel to an element with the \"target\" id DOM.\n * // The balloon will remain pinned until unpin() is called.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n */\nexport default class BalloonPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('position', 'arrow_nw');\n this.set('isVisible', false);\n this.set('withArrow', true);\n this.set('class', undefined);\n this._pinWhenIsVisibleCallback = null;\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-panel',\n bind.to('position', value => `ck-balloon-panel_${value}`),\n bind.if('isVisible', 'ck-balloon-panel_visible'),\n bind.if('withArrow', 'ck-balloon-panel_with-arrow'),\n bind.to('class')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx)\n }\n },\n children: this.content\n });\n }\n /**\n * Shows the panel.\n *\n * See {@link #isVisible}.\n */\n show() {\n this.isVisible = true;\n }\n /**\n * Hides the panel.\n *\n * See {@link #isVisible}.\n */\n hide() {\n this.isVisible = false;\n }\n /**\n * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a\n * smart positioning heuristics that chooses from available positions to make sure the panel\n * is visible to the user i.e. within the limits of the viewport.\n *\n * This method accepts configuration {@link module:utils/dom/position~Options options}\n * to set the `target`, optional `limiter` and `positions` the balloon should choose from.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Attach the panel to an element with the \"target\" id DOM.\n * panel.attachTo( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * **Note**: Attaching the panel will also automatically {@link #show} it.\n *\n * **Note**: An attached panel will not follow its target when the window is scrolled or resized.\n * See the {@link #pin} method for a more permanent positioning strategy.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n */\n attachTo(options) {\n this.show();\n const defaultPositions = BalloonPanelView.defaultPositions;\n const positionOptions = Object.assign({}, {\n element: this.element,\n positions: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthMiddleWest,\n defaultPositions.southArrowNorthMiddleEast,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthMiddleWest,\n defaultPositions.northArrowSouthMiddleEast,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.viewportStickyNorth\n ],\n limiter: defaultLimiterElement,\n fitInViewport: true\n }, options);\n const optimalPosition = BalloonPanelView._getOptimalPosition(positionOptions);\n // Usually browsers make some problems with super accurate values like 104.345px\n // so it is better to use int values.\n const left = parseInt(optimalPosition.left);\n const top = parseInt(optimalPosition.top);\n const position = optimalPosition.name;\n const config = optimalPosition.config || {};\n const { withArrow = true } = config;\n this.top = top;\n this.left = left;\n this.position = position;\n this.withArrow = withArrow;\n }\n /**\n * Works the same way as the {@link #attachTo} method except that the position of the panel is\n * continuously updated when:\n *\n * * any ancestor of the {@link module:utils/dom/position~Options#target}\n * or {@link module:utils/dom/position~Options#limiter} is scrolled,\n * * the browser window gets resized or scrolled.\n *\n * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}\n * and is immune to the changing environment.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Pin the panel to an element with the \"target\" id DOM.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * To leave the pinned state, use the {@link #unpin} method.\n *\n * **Note**: Pinning the panel will also automatically {@link #show} it.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n */\n pin(options) {\n this.unpin();\n this._pinWhenIsVisibleCallback = () => {\n if (this.isVisible) {\n this._startPinning(options);\n }\n else {\n this._stopPinning();\n }\n };\n this._startPinning(options);\n // Control the state of the listeners depending on whether the panel is visible\n // or not.\n // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.listenTo(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n }\n /**\n * Stops pinning the panel, as set up by {@link #pin}.\n */\n unpin() {\n if (this._pinWhenIsVisibleCallback) {\n // Deactivate listeners attached by pin().\n this._stopPinning();\n // Deactivate the panel pin() control logic.\n // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.stopListening(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n this._pinWhenIsVisibleCallback = null;\n this.hide();\n }\n }\n /**\n * Starts managing the pinned state of the panel. See {@link #pin}.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n */\n _startPinning(options) {\n this.attachTo(options);\n const targetElement = getDomElement(options.target);\n const limiterElement = options.limiter ? getDomElement(options.limiter) : defaultLimiterElement;\n // Then we need to listen on scroll event of eny element in the document.\n this.listenTo(global.document, 'scroll', (evt, domEvt) => {\n const scrollTarget = domEvt.target;\n // The position needs to be updated if the positioning target is within the scrolled element.\n const isWithinScrollTarget = targetElement && scrollTarget.contains(targetElement);\n // The position needs to be updated if the positioning limiter is within the scrolled element.\n const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains(limiterElement);\n // The positioning target and/or limiter can be a Rect, object etc..\n // There's no way to optimize the listener then.\n if (isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement) {\n this.attachTo(options);\n }\n }, { useCapture: true });\n // We need to listen on window resize event and update position.\n this.listenTo(global.window, 'resize', () => {\n this.attachTo(options);\n });\n }\n /**\n * Stops managing the pinned state of the panel. See {@link #pin}.\n */\n _stopPinning() {\n this.stopListening(global.document, 'scroll');\n this.stopListening(global.window, 'resize');\n }\n}\n/**\n * A side offset of the arrow tip from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────┐\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │\n *\t\t │ │\n *\t\t └──+ +───────────────┘\n *\t\t | \\ /\n *\t\t | \\/\n *\t\t>┼─────┼< ─────────────────────── side offset\n *\n * ```\n *\n * @default 25\n */\nBalloonPanelView.arrowSideOffset = 25;\n/**\n * A height offset of the arrow from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────┐\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │ ╱-- arrow height offset\n *\t\t │ │ V\n *\t\t └──+ +───────────────┘ --- ─┼───────\n *\t\t \\ / │\n *\t\t \\/ │\n *\t\t────────────────────────────────┼───────\n *\t\t ^\n *\n *\n *\t\t>┼────┼< arrow height offset\n *\t\t │ │\n *\t\t │ ┌────────────────────────┐\n *\t\t │ │ │\n *\t\t │ ╱ │\n *\t\t │ ╱ Balloon │\n *\t\t │ ╲ Content │\n *\t\t │ ╲ │\n *\t\t │ │ │\n *\t\t │ └────────────────────────┘\n * ```\n *\n * @default 10\n*/\nBalloonPanelView.arrowHeightOffset = 10;\n/**\n * A vertical offset of the balloon panel from the edge of the viewport if sticky.\n * It helps in accessing toolbar buttons underneath the balloon panel.\n *\n * ```\n *\t\t ┌───────────────────────────────────────────────────┐\n *\t\t │ Target │\n *\t\t │ │\n *\t\t │ /── vertical offset │\n *\t\t┌─────────────────────────────V─────────────────────────┐\n *\t\t│ Toolbar ┌─────────────┐ │\n *\t\t├────────────────────│ Balloon │────────────────────┤\n *\t\t│ │ └─────────────┘ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ └───────────────────────────────────────────────────┘ │\n *\t\t│ Viewport │\n *\t\t└───────────────────────────────────────────────────────┘\n * ```\n *\n * @default 20\n */\nBalloonPanelView.stickyVerticalOffset = 20;\n/**\n * Function used to calculate the optimal position for the balloon.\n */\nBalloonPanelView._getOptimalPosition = getOptimalPosition;\n/**\n * A default set of positioning functions used by the balloon panel view\n * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.\n *\n * The available positioning functions are as follows:\n *\n * **North west**\n *\n * * `northWestArrowSouthWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North**\n *\n * * `northArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n * * `northArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North east**\n *\n * * `northEastArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northEastArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **South**\n *\n * * `southArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South west**\n *\n * * `southWestArrowNorthWest`\n *\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southWestArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South east**\n *\n * * `southEastArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorth`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **West**\n *\n * * `westArrowEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |>[ Target ]\n *\t\t+-----------------+\n * ```\n *\n * **East**\n *\n * * `eastArrowWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t[ Target ]<| Balloon |\n *\t\t +-----------------+\n * ```\n *\n * **Sticky**\n *\n * * `viewportStickyNorth`\n *\n * ```\n *\t\t +---------------------------+\n *\t\t | [ Target ] |\n *\t\t | |\n *\t\t+-----------------------------------+\n *\t\t| | +-----------------+ | |\n *\t\t| | | Balloon | | |\n *\t\t| | +-----------------+ | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| +---------------------------+ |\n *\t\t| Viewport |\n *\t\t+-----------------------------------+\n * ```\n *\n * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.\n *\n * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.\n *\n * Default positioning functions with customized offsets can be generated using\n * {@link module:ui/panel/balloon/balloonpanelview~generatePositions}.\n *\n * The name that the position function returns will be reflected in the balloon panel's class that\n * controls the placement of the \"arrow\". See {@link #position} to learn more.\n */\nBalloonPanelView.defaultPositions = generatePositions();\n/**\n * Returns the DOM element for given object or null, if there is none,\n * e.g. when the passed object is a Rect instance or so.\n */\nfunction getDomElement(object) {\n if (isElement(object)) {\n return object;\n }\n if (isRange(object)) {\n return object.commonAncestorContainer;\n }\n if (typeof object == 'function') {\n return getDomElement(object());\n }\n return null;\n}\n/**\n * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * {@link module:utils/dom/position~PositioningFunction positioning functions} adjusted by the specific offsets.\n *\n * @internal\n * @param options Options to generate positions. If not specified, this helper will simply return\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n * @param options.sideOffset A custom side offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset the default value}\n * will be used.\n * @param options.heightOffset A custom height offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset the default value}\n * will be used.\n * @param options.stickyVerticalOffset A custom offset (in pixels) of the `viewportStickyNorth` positioning function.\n * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}\n * will be used.\n * @param options.config Additional configuration of the balloon balloon panel view.\n * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more\n * about {@link module:utils/dom/position~PositioningFunction positioning functions}.\n */\nexport function generatePositions(options = {}) {\n const { sideOffset = BalloonPanelView.arrowSideOffset, heightOffset = BalloonPanelView.arrowHeightOffset, stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset, config } = options;\n return {\n // ------- North west\n northWestArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northWestArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northWestArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North\n northArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North east\n northEastArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northEastArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northEastArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- South west\n southWestArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southWestArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southWestArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South\n southArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South east\n southEastArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southEastArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southEastArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- West\n westArrowEast: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.left - balloonRect.width - heightOffset,\n name: 'arrow_e',\n ...(config && { config })\n }),\n // ------- East\n eastArrowWest: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.right + heightOffset,\n name: 'arrow_w',\n ...(config && { config })\n }),\n // ------- Sticky\n viewportStickyNorth: (targetRect, balloonRect, viewportRect) => {\n if (!targetRect.getIntersection(viewportRect)) {\n return null;\n }\n return {\n top: viewportRect.top + stickyVerticalOffset,\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrowless',\n config: {\n withArrow: false,\n ...config\n }\n };\n }\n };\n /**\n * Returns the top coordinate for positions starting with `north*`.\n *\n * @param targetRect A rect of the target.\n * @param balloonRect A rect of the balloon.\n */\n function getNorthTop(targetRect, balloonRect) {\n return targetRect.top - balloonRect.height - heightOffset;\n }\n /**\n * Returns the top coordinate for positions starting with `south*`.\n *\n * @param targetRect A rect of the target.\n */\n function getSouthTop(targetRect) {\n return targetRect.bottom + heightOffset;\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tooltip.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/tooltipmanager\n */\nimport View from './view';\nimport BalloonPanelView, { generatePositions } from './panel/balloon/balloonpanelview';\nimport { DomEmitterMixin, ResizeObserver, first, global, isVisible } from '@ckeditor/ckeditor5-utils';\nimport { isElement, debounce } from 'lodash-es';\nimport '../theme/components/tooltip/tooltip.css';\nconst BALLOON_CLASS = 'ck-tooltip';\n/**\n * A tooltip manager class for the UI of the editor.\n *\n * **Note**: Most likely you do not have to use the `TooltipManager` API listed below in order to display tooltips. Popular\n * {@glink framework/architecture/ui-library UI components} support tooltips out-of-the-box via observable properties\n * (see {@link module:ui/button/buttonview~ButtonView#tooltip} and {@link module:ui/button/buttonview~ButtonView#tooltipPosition}).\n *\n * # Displaying tooltips\n *\n * To display a tooltip, set `data-cke-tooltip-text` attribute on any DOM element:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'My tooltip';\n * ```\n *\n * The tooltip will show up whenever the user moves the mouse over the element or the element gets focus in DOM.\n *\n * # Positioning tooltips\n *\n * To change the position of the tooltip, use the `data-cke-tooltip-position` attribute (`s`, `se`, `sw`, `n`, `e`, or `w`):\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip to the north';\n * domElement.dataset.ckeTooltipPosition = 'n';\n * ```\n *\n * # Disabling tooltips\n *\n * In order to disable the tooltip temporarily, use the `data-cke-tooltip-disabled` attribute:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Disabled. For now.';\n * domElement.dataset.ckeTooltipDisabled = 'true';\n * ```\n *\n * # Styling tooltips\n *\n * By default, the tooltip has `.ck-tooltip` class and its text inner `.ck-tooltip__text`.\n *\n * If your tooltip requires custom styling, using `data-cke-tooltip-class` attribute will add additional class to the balloon\n * displaying the tooltip:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip with a red text';\n * domElement.dataset.ckeTooltipClass = 'my-class';\n * ```\n *\n * ```css\n * .ck.ck-tooltip.my-class { color: red }\n * ```\n *\n * **Note**: This class is a singleton. All editor instances re-use the same instance loaded by\n * {@link module:ui/editorui/editorui~EditorUI} of the first editor.\n */\nexport default class TooltipManager extends DomEmitterMixin() {\n /**\n * Creates an instance of the tooltip manager.\n */\n constructor(editor) {\n super();\n /**\n * Stores the reference to the DOM element the tooltip is attached to. `null` when there's no tooltip\n * in the UI.\n */\n this._currentElementWithTooltip = null;\n /**\n * Stores the current tooltip position. `null` when there's no tooltip in the UI.\n */\n this._currentTooltipPosition = null;\n /**\n * An instance of the resize observer that keeps track on target element visibility,\n * when it hides the tooltip should also disappear.\n *\n * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.\n */\n this._resizeObserver = null;\n TooltipManager._editors.add(editor);\n // TooltipManager must be a singleton. Multiple instances would mean multiple tooltips attached\n // to the same DOM element with data-cke-tooltip-* attributes.\n if (TooltipManager._instance) {\n return TooltipManager._instance;\n }\n TooltipManager._instance = this;\n this.tooltipTextView = new View(editor.locale);\n this.tooltipTextView.set('text', '');\n this.tooltipTextView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-tooltip__text'\n ]\n },\n children: [\n {\n text: this.tooltipTextView.bindTemplate.to('text')\n }\n ]\n });\n this.balloonPanelView = new BalloonPanelView(editor.locale);\n this.balloonPanelView.class = BALLOON_CLASS;\n this.balloonPanelView.content.add(this.tooltipTextView);\n this._pinTooltipDebounced = debounce(this._pinTooltip, 600);\n this.listenTo(global.document, 'mouseenter', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'mouseleave', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'focus', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'blur', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'scroll', this._onScroll.bind(this), { useCapture: true });\n // Because this class is a singleton, its only instance is shared across all editors and connects them through the reference.\n // This causes issues with the ContextWatchdog. When an error is thrown in one editor, the watchdog traverses the references\n // and (because of shared tooltip manager) figures that the error affects all editors and restarts them all.\n // This flag, excludes tooltip manager instance from the traversal and brings ContextWatchdog back to normal.\n // More in https://github.com/ckeditor/ckeditor5/issues/12292.\n this._watchdogExcluded = true;\n }\n /**\n * Destroys the tooltip manager.\n *\n * **Note**: The manager singleton cannot be destroyed until all editors that use it are destroyed.\n *\n * @param editor The editor the manager was created for.\n */\n destroy(editor) {\n const editorBodyViewCollection = editor.ui.view && editor.ui.view.body;\n TooltipManager._editors.delete(editor);\n this.stopListening(editor.ui);\n // Prevent the balloon panel from being destroyed in the EditorUI#destroy() cascade. It should be destroyed along\n // with the last editor only (https://github.com/ckeditor/ckeditor5/issues/12602).\n if (editorBodyViewCollection && editorBodyViewCollection.has(this.balloonPanelView)) {\n editorBodyViewCollection.remove(this.balloonPanelView);\n }\n if (!TooltipManager._editors.size) {\n this._unpinTooltip();\n this.balloonPanelView.destroy();\n this.stopListening();\n TooltipManager._instance = null;\n }\n }\n /**\n * Returns {@link #balloonPanelView} {@link module:utils/dom/position~PositioningFunction positioning functions} for a given position\n * name.\n *\n * @param position Name of the position (`s`, `se`, `sw`, `n`, `e`, or `w`).\n * @returns Positioning functions to be used by the {@link #balloonPanelView}.\n */\n static getPositioningFunctions(position) {\n const defaultPositions = TooltipManager.defaultBalloonPositions;\n return {\n // South is most popular. We can use positioning heuristics to avoid clipping by the viewport with the sane fallback.\n s: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthEast,\n defaultPositions.southArrowNorthWest\n ],\n n: [defaultPositions.northArrowSouth],\n e: [defaultPositions.eastArrowWest],\n w: [defaultPositions.westArrowEast],\n sw: [defaultPositions.southArrowNorthEast],\n se: [defaultPositions.southArrowNorthWest]\n }[position];\n }\n /**\n * Handles displaying tooltips on `mouseenter` and `focus` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onEnterOrFocus(evt, { target }) {\n const elementWithTooltipAttribute = getDescendantWithTooltip(target);\n // Abort when there's no descendant needing tooltip.\n if (!elementWithTooltipAttribute) {\n return;\n }\n // Abort to avoid flashing when, for instance:\n // * a tooltip is displayed for a focused element, then the same element gets mouseentered,\n // * a tooltip is displayed for an element via mouseenter, then the focus moves to the same element.\n if (elementWithTooltipAttribute === this._currentElementWithTooltip) {\n return;\n }\n this._unpinTooltip();\n this._pinTooltipDebounced(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));\n }\n /**\n * Handles hiding tooltips on `mouseleave` and `blur` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onLeaveOrBlur(evt, { target, relatedTarget }) {\n if (evt.name === 'mouseleave') {\n // Don't act when the event does not concern a DOM element (e.g. a mouseleave out of an entire document),\n if (!isElement(target)) {\n return;\n }\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // For instance, a random mouseleave far away in the page should not unpin the tooltip that was pinned because\n // of a previous focus. Only leaving the same element should hide the tooltip.\n if (this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n const descendantWithTooltip = getDescendantWithTooltip(target);\n const relatedDescendantWithTooltip = getDescendantWithTooltip(relatedTarget);\n // Unpin when the mouse was leaving element with a tooltip to a place which does not have or has a different tooltip.\n // Note that this should happen whether the tooltip is already visible or not, for instance, it could be invisible but queued\n // (debounced): it should get canceled.\n if (descendantWithTooltip && descendantWithTooltip !== relatedDescendantWithTooltip) {\n this._unpinTooltip();\n }\n }\n else {\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // For instance, a random blur in the web page should not unpin the tooltip that was pinned because of a previous mouseenter.\n if (this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n // Note that unpinning should happen whether the tooltip is already visible or not, for instance, it could be invisible but\n // queued (debounced): it should get canceled (e.g. quick focus then quick blur using the keyboard).\n this._unpinTooltip();\n }\n }\n /**\n * Handles hiding tooltips on `scroll` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onScroll(evt, { target }) {\n // No tooltip, no reason to react on scroll.\n if (!this._currentElementWithTooltip) {\n return;\n }\n // When scrolling a container that has both the balloon and the current element (common ancestor), the balloon can remain\n // visible (e.g. scrolling ≤body>). Otherwise, to avoid glitches (clipping, lagging) better just hide the tooltip.\n // Also, don't do anything when scrolling an unrelated DOM element that has nothing to do with the current element and the balloon.\n if (target.contains(this.balloonPanelView.element) && target.contains(this._currentElementWithTooltip)) {\n return;\n }\n this._unpinTooltip();\n }\n /**\n * Pins the tooltip to a specific DOM element.\n *\n * @param options.text Text of the tooltip to display.\n * @param options.position The position of the tooltip.\n * @param options.cssClass Additional CSS class of the balloon with the tooltip.\n */\n _pinTooltip(targetDomElement, { text, position, cssClass }) {\n // Use the body collection of the first editor.\n const bodyViewCollection = first(TooltipManager._editors.values()).ui.view.body;\n if (!bodyViewCollection.has(this.balloonPanelView)) {\n bodyViewCollection.add(this.balloonPanelView);\n }\n this.tooltipTextView.text = text;\n this.balloonPanelView.pin({\n target: targetDomElement,\n positions: TooltipManager.getPositioningFunctions(position)\n });\n this._resizeObserver = new ResizeObserver(targetDomElement, () => {\n // The ResizeObserver will call its callback when the target element hides and the tooltip\n // should also disappear (https://github.com/ckeditor/ckeditor5/issues/12492).\n if (!isVisible(targetDomElement)) {\n this._unpinTooltip();\n }\n });\n this.balloonPanelView.class = [BALLOON_CLASS, cssClass]\n .filter(className => className)\n .join(' ');\n // Start responding to changes in editor UI or content layout. For instance, when collaborators change content\n // and a contextual toolbar attached to a content starts to move (and so should move the tooltip).\n // Note: Using low priority to let other listeners that position contextual toolbars etc. to react first.\n for (const editor of TooltipManager._editors) {\n this.listenTo(editor.ui, 'update', this._updateTooltipPosition.bind(this), { priority: 'low' });\n }\n this._currentElementWithTooltip = targetDomElement;\n this._currentTooltipPosition = position;\n }\n /**\n * Unpins the tooltip and cancels all queued pinning.\n */\n _unpinTooltip() {\n this._pinTooltipDebounced.cancel();\n this.balloonPanelView.unpin();\n for (const editor of TooltipManager._editors) {\n this.stopListening(editor.ui, 'update');\n }\n this._currentElementWithTooltip = null;\n this._currentTooltipPosition = null;\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Updates the position of the tooltip so it stays in sync with the element it is pinned to.\n *\n * Hides the tooltip when the element is no longer visible in DOM.\n */\n _updateTooltipPosition() {\n // This could happen if the tooltip was attached somewhere in a contextual content toolbar and the toolbar\n // disappeared (e.g. removed an image).\n if (!isVisible(this._currentElementWithTooltip)) {\n this._unpinTooltip();\n return;\n }\n this.balloonPanelView.pin({\n target: this._currentElementWithTooltip,\n positions: TooltipManager.getPositioningFunctions(this._currentTooltipPosition)\n });\n }\n}\n/**\n * A set of default {@link module:utils/dom/position~PositioningFunction positioning functions} used by the `TooltipManager`\n * to pin tooltips in different positions.\n */\nTooltipManager.defaultBalloonPositions = generatePositions({\n heightOffset: 5,\n sideOffset: 13\n});\n/**\n * A set of editors the single tooltip manager instance must listen to.\n * This is mostly to handle `EditorUI#update` listeners from individual editors.\n */\nTooltipManager._editors = new Set();\n/**\n * A reference to the `TooltipManager` instance. The class is a singleton and as such,\n * successive attempts at creating instances should return this instance.\n */\nTooltipManager._instance = null;\nfunction getDescendantWithTooltip(element) {\n if (!isElement(element)) {\n return null;\n }\n return element.closest('[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])');\n}\nfunction getTooltipData(element) {\n return {\n text: element.dataset.ckeTooltipText,\n position: (element.dataset.ckeTooltipPosition || 's'),\n cssClass: element.dataset.ckeTooltipClass || ''\n };\n}\n","import debounce from './debounce.js';\nimport isObject from './isObject.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nexport default throttle;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Rect, DomEmitterMixin, findClosestScrollableAncestor, verifyLicense } from '@ckeditor/ckeditor5-utils';\nimport BalloonPanelView from '../panel/balloon/balloonpanelview';\nimport IconView from '../icon/iconview';\nimport View from '../view';\nimport { throttle } from 'lodash-es';\nimport poweredByIcon from '../../theme/icons/project-logo.svg';\nconst ICON_WIDTH = 53;\nconst ICON_HEIGHT = 10;\nconst NARROW_ROOT_HEIGHT_THRESHOLD = 50;\nconst NARROW_ROOT_WIDTH_THRESHOLD = 350;\nconst DEFAULT_LABEL = 'Powered by';\nconst OFF_THE_SCREEN_POSITION = {\n top: -99999,\n left: -99999,\n name: 'invalid',\n config: {\n withArrow: false\n }\n};\n/**\n * A helper that enables the \"powered by\" feature in the editor and renders a link to the project's\n * webpage next to the bottom of the editable element (editor root, source editing area, etc.) when the editor is focused.\n *\n * @private\n */\nexport default class PoweredBy extends DomEmitterMixin() {\n /**\n * Creates a \"powered by\" helper for a given editor. The feature is initialized on Editor#ready\n * event.\n *\n * @param editor\n */\n constructor(editor) {\n super();\n this.editor = editor;\n this._balloonView = null;\n this._lastFocusedEditableElement = null;\n this._showBalloonThrottled = throttle(this._showBalloon.bind(this), 50, { leading: true });\n editor.on('ready', this._handleEditorReady.bind(this));\n }\n /**\n * Destroys the \"powered by\" helper along with its view.\n */\n destroy() {\n const balloon = this._balloonView;\n if (balloon) {\n // Balloon gets destroyed by the body collection.\n // The powered by view gets destroyed by the balloon.\n balloon.unpin();\n this._balloonView = null;\n }\n this._showBalloonThrottled.cancel();\n this.stopListening();\n }\n /**\n * Enables \"powered by\" label once the editor (ui) is ready.\n */\n _handleEditorReady() {\n const editor = this.editor;\n /* istanbul ignore next -- @preserve */\n if (verifyLicense(editor.config.get('licenseKey')) === 'VALID') {\n return;\n }\n // No view means no body collection to append the powered by balloon to.\n if (!editor.ui.view) {\n return;\n }\n editor.ui.focusTracker.on('change:isFocused', (evt, data, isFocused) => {\n this._updateLastFocusedEditableElement();\n if (isFocused) {\n this._showBalloon();\n }\n else {\n this._hideBalloon();\n }\n });\n editor.ui.focusTracker.on('change:focusedElement', (evt, data, focusedElement) => {\n this._updateLastFocusedEditableElement();\n if (focusedElement) {\n this._showBalloon();\n }\n });\n editor.ui.on('update', () => {\n this._showBalloonThrottled();\n });\n }\n /**\n * Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}\n * with the \"powered by\" view inside ready for positioning.\n */\n _createBalloonView() {\n const editor = this.editor;\n const balloon = this._balloonView = new BalloonPanelView();\n const poweredByConfig = getNormalizedConfig(editor);\n const view = new PoweredByView(editor.locale, poweredByConfig.label);\n balloon.content.add(view);\n balloon.set({\n class: 'ck-powered-by-balloon'\n });\n editor.ui.view.body.add(balloon);\n editor.ui.focusTracker.add(balloon.element);\n this._balloonView = balloon;\n }\n /**\n * Attempts to display the balloon with the \"powered by\" view.\n */\n _showBalloon() {\n if (!this._lastFocusedEditableElement) {\n return;\n }\n const attachOptions = getBalloonAttachOptions(this.editor, this._lastFocusedEditableElement);\n if (attachOptions) {\n if (!this._balloonView) {\n this._createBalloonView();\n }\n this._balloonView.pin(attachOptions);\n }\n }\n /**\n * Hides the \"powered by\" balloon if already visible.\n */\n _hideBalloon() {\n if (this._balloonView) {\n this._balloonView.unpin();\n }\n }\n /**\n * Updates the {@link #_lastFocusedEditableElement} based on the state of the global focus tracker.\n */\n _updateLastFocusedEditableElement() {\n const editor = this.editor;\n const isFocused = editor.ui.focusTracker.isFocused;\n const focusedElement = editor.ui.focusTracker.focusedElement;\n if (!isFocused || !focusedElement) {\n this._lastFocusedEditableElement = null;\n return;\n }\n const editableEditorElements = Array.from(editor.ui.getEditableElementsNames()).map(name => {\n return editor.ui.getEditableElement(name);\n });\n if (editableEditorElements.includes(focusedElement)) {\n this._lastFocusedEditableElement = focusedElement;\n }\n else {\n // If it's none of the editable element, then the focus is somewhere in the UI. Let's display powered by\n // over the first element then.\n this._lastFocusedEditableElement = editableEditorElements[0];\n }\n }\n}\n/**\n * A view displaying a \"powered by\" label and project logo wrapped in a link.\n */\nclass PoweredByView extends View {\n /**\n * Created an instance of the \"powered by\" view.\n *\n * @param locale The localization services instance.\n * @param label The label text.\n */\n constructor(locale, label) {\n super(locale);\n const iconView = new IconView();\n const bind = this.bindTemplate;\n iconView.set({\n content: poweredByIcon,\n isColorInherited: false\n });\n iconView.extendTemplate({\n attributes: {\n style: {\n width: ICON_WIDTH + 'px',\n height: ICON_HEIGHT + 'px'\n }\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-powered-by'],\n 'aria-hidden': true\n },\n children: [\n {\n tag: 'a',\n attributes: {\n href: 'https://ckeditor.com/?utm_source=ckeditor&' +\n 'utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo',\n target: '_blank',\n tabindex: '-1'\n },\n children: [\n ...label ? [\n {\n tag: 'span',\n attributes: {\n class: ['ck', 'ck-powered-by__label']\n },\n children: [label]\n }\n ] : [],\n iconView\n ],\n on: {\n dragstart: bind.to(evt => evt.preventDefault())\n }\n }\n ]\n });\n }\n}\nfunction getBalloonAttachOptions(editor, focusedEditableElement) {\n const poweredByConfig = getNormalizedConfig(editor);\n const positioningFunction = poweredByConfig.side === 'right' ?\n getLowerRightCornerPosition(focusedEditableElement, poweredByConfig) :\n getLowerLeftCornerPosition(focusedEditableElement, poweredByConfig);\n return {\n target: focusedEditableElement,\n positions: [positioningFunction]\n };\n}\nfunction getLowerRightCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, (rootRect, balloonRect) => {\n return rootRect.left + rootRect.width - balloonRect.width - config.horizontalOffset;\n });\n}\nfunction getLowerLeftCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, rootRect => rootRect.left + config.horizontalOffset);\n}\nfunction getLowerCornerPosition(focusedEditableElement, config, getBalloonLeft) {\n return (editableElementRect, balloonRect) => {\n const visibleEditableElementRect = editableElementRect.getVisible();\n // Root cropped by ancestors.\n if (!visibleEditableElementRect) {\n return OFF_THE_SCREEN_POSITION;\n }\n if (editableElementRect.width < NARROW_ROOT_WIDTH_THRESHOLD || editableElementRect.height < NARROW_ROOT_HEIGHT_THRESHOLD) {\n return OFF_THE_SCREEN_POSITION;\n }\n let balloonTop;\n if (config.position === 'inside') {\n balloonTop = editableElementRect.bottom - balloonRect.height;\n }\n else {\n balloonTop = editableElementRect.bottom - balloonRect.height / 2;\n }\n balloonTop -= config.verticalOffset;\n const balloonLeft = getBalloonLeft(editableElementRect, balloonRect);\n if (config.position === 'inside') {\n const newBalloonRect = balloonRect.clone().moveTo(balloonLeft, balloonTop);\n // The watermark cannot be positioned in this corner because the corner is not quite visible.\n if (newBalloonRect.getIntersectionArea(visibleEditableElementRect) < newBalloonRect.getArea()) {\n return OFF_THE_SCREEN_POSITION;\n }\n }\n else {\n const firstScrollableEditableElementAncestor = findClosestScrollableAncestor(focusedEditableElement);\n if (firstScrollableEditableElementAncestor) {\n const firstScrollableEditableElementAncestorRect = new Rect(firstScrollableEditableElementAncestor);\n // The watermark cannot be positioned in this corner because the corner is \"not visible enough\".\n if (visibleEditableElementRect.bottom + balloonRect.height / 2 > firstScrollableEditableElementAncestorRect.bottom) {\n return OFF_THE_SCREEN_POSITION;\n }\n }\n }\n return {\n top: balloonTop,\n left: balloonLeft,\n name: `position_${config.position}-side_${config.side}`,\n config: {\n withArrow: false\n }\n };\n };\n}\nfunction getNormalizedConfig(editor) {\n const userConfig = editor.config.get('ui.poweredBy');\n const position = userConfig && userConfig.position || 'border';\n return {\n position,\n label: DEFAULT_LABEL,\n verticalOffset: position === 'inside' ? 5 : 0,\n horizontalOffset: 5,\n side: editor.locale.contentLanguageDirection === 'ltr' ? 'right' : 'left',\n ...userConfig\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/verifylicense\n */\nimport { releaseDate } from './version';\n/**\n * Checks whether the given string contains information that allows you to verify the license status.\n *\n * @param token The string to check.\n * @returns String that represents the state of given `token` parameter.\n */\nexport default function verifyLicense(token) {\n // This function implements naive and partial license key check mechanism,\n // used only to decide whether to show or hide the \"Powered by CKEditor\" logo.\n //\n // You can read the reasoning behind showing the logo to unlicensed (GPL) users\n // in this thread: https://github.com/ckeditor/ckeditor5/issues/14082.\n //\n // We firmly believe in the values behind creating open-source software, even when that\n // means keeping the license verification logic open for everyone to see.\n //\n // Please keep this code intact. Thank you for your understanding.\n function oldTokenCheck(token) {\n if (token.match(/^[a-zA-Z0-9+/=$]+$/g) && (token.length >= 40 && token.length <= 255)) {\n return 'VALID';\n }\n else {\n return 'INVALID';\n }\n }\n // TODO: issue ci#3175\n let decryptedData = '';\n let decryptedSecondElement = '';\n if (!token) {\n return 'INVALID';\n }\n try {\n decryptedData = atob(token);\n }\n catch (e) {\n return 'INVALID';\n }\n const splittedDecryptedData = decryptedData.split('-');\n const firstElement = splittedDecryptedData[0];\n const secondElement = splittedDecryptedData[1];\n if (!secondElement) {\n return oldTokenCheck(token);\n }\n try {\n atob(secondElement);\n }\n catch (e) {\n try {\n atob(firstElement);\n if (!atob(firstElement).length) {\n return oldTokenCheck(token);\n }\n }\n catch (e) {\n return oldTokenCheck(token);\n }\n }\n if (firstElement.length < 40 || firstElement.length > 255) {\n return 'INVALID';\n }\n try {\n // Must be a valid format.\n atob(firstElement);\n }\n catch (e) {\n return 'INVALID';\n }\n try {\n decryptedSecondElement = atob(secondElement);\n }\n catch (e) {\n return 'INVALID';\n }\n if (decryptedSecondElement.length !== 8) {\n return 'INVALID';\n }\n const year = Number(decryptedSecondElement.substring(0, 4));\n const monthIndex = Number(decryptedSecondElement.substring(4, 6)) - 1;\n const day = Number(decryptedSecondElement.substring(6, 8));\n const date = new Date(year, monthIndex, day);\n if (date < releaseDate || isNaN(Number(date))) {\n return 'INVALID';\n }\n return 'VALID';\n}\n","export default \"\\n\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/findclosestscrollableancestor\n */\nimport global from './global';\n/**\n * Returns the closest scrollable ancestor of a DOM element.\n *\n * @param domElement DOM element.\n * @returns First ancestor of `domElement` that is scrollable or null if such ancestor doesn't exist.\n */\nexport default function findClosestScrollableAncestor(domElement) {\n let element = domElement.parentElement;\n if (!element) {\n return null;\n }\n while (element.tagName != 'BODY') {\n const overflow = element.style.overflowY || global.window.getComputedStyle(element).overflowY;\n if (overflow === 'auto' || overflow === 'scroll') {\n break;\n }\n element = element.parentElement;\n if (!element) {\n return null;\n }\n }\n return element;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editorui\n */\n/* globals console */\nimport ComponentFactory from '../componentfactory';\nimport TooltipManager from '../tooltipmanager';\nimport PoweredBy from './poweredby';\nimport { ObservableMixin, isVisible, FocusTracker } from '@ckeditor/ckeditor5-utils';\n/**\n * A class providing the minimal interface that is required to successfully bootstrap any editor UI.\n */\nexport default class EditorUI extends ObservableMixin() {\n /**\n * Creates an instance of the editor UI class.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n super();\n /**\n * Indicates the UI is ready. Set `true` after {@link #event:ready} event is fired.\n *\n * @readonly\n * @default false\n */\n this.isReady = false;\n /**\n * Stores all editable elements used by the editor instance.\n */\n this._editableElementsMap = new Map();\n /**\n * All available & focusable toolbars.\n */\n this._focusableToolbarDefinitions = [];\n this.editor = editor;\n this.componentFactory = new ComponentFactory(editor);\n this.focusTracker = new FocusTracker();\n this.tooltipManager = new TooltipManager(editor);\n this.poweredBy = new PoweredBy(editor);\n this.set('viewportOffset', this._readViewportOffsetFromConfig());\n this.once('ready', () => {\n this.isReady = true;\n });\n // Informs UI components that should be refreshed after layout change.\n this.listenTo(editor.editing.view.document, 'layoutChanged', () => this.update());\n this._initFocusTracking();\n }\n /**\n * The main (outermost) DOM element of the editor UI.\n *\n * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `
    ` which\n * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}\n * it is the editable element itself (as there is no other wrapper). However, in\n * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not\n * come with a single \"main\" HTML element (its editable element and toolbar are separate).\n *\n * This property can be understood as a shorthand for retrieving the element that a specific editor integration\n * considers to be its main DOM element.\n */\n get element() {\n return null;\n }\n /**\n * Fires the {@link module:ui/editorui/editorui~EditorUI#event:update `update`} event.\n *\n * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to\n * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).\n */\n update() {\n this.fire('update');\n }\n /**\n * Destroys the UI.\n */\n destroy() {\n this.stopListening();\n this.focusTracker.destroy();\n this.tooltipManager.destroy(this.editor);\n this.poweredBy.destroy();\n // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.\n for (const domElement of this._editableElementsMap.values()) {\n domElement.ckeditorInstance = null;\n this.editor.keystrokes.stopListening(domElement);\n }\n this._editableElementsMap = new Map();\n this._focusableToolbarDefinitions = [];\n }\n /**\n * Stores the native DOM editable element used by the editor under a unique name.\n *\n * Also, registers the element in the editor to maintain the accessibility of the UI. When the user is editing text in a focusable\n * editable area, they can use the Alt + F10 keystroke to navigate over editor toolbars. See {@link #addToolbar}.\n *\n * @param rootName The unique name of the editable element.\n * @param domElement The native DOM editable element.\n */\n setEditableElement(rootName, domElement) {\n this._editableElementsMap.set(rootName, domElement);\n // Put a reference to the CKEditor instance in the editable native DOM element.\n // It helps 3rd–party software (browser extensions, other libraries) access and recognize\n // CKEditor 5 instances (editing roots) and use their API (there is no global editor\n // instance registry).\n if (!domElement.ckeditorInstance) {\n domElement.ckeditorInstance = this.editor;\n }\n // Register the element, so it becomes available for Alt+F10 and Esc navigation.\n this.focusTracker.add(domElement);\n const setUpKeystrokeHandler = () => {\n // The editing view of the editor is already listening to keystrokes from DOM roots (see: KeyObserver).\n // Do not duplicate listeners.\n if (this.editor.editing.view.getDomRoot(rootName)) {\n return;\n }\n this.editor.keystrokes.listenTo(domElement);\n };\n // For editable elements set by features after EditorUI is ready (e.g. source editing).\n if (this.isReady) {\n setUpKeystrokeHandler();\n }\n // For editable elements set while the editor is being created (e.g. DOM roots).\n else {\n this.once('ready', setUpKeystrokeHandler);\n }\n }\n /**\n * Removes the editable from the editor UI. Removes all handlers added by {@link #setEditableElement}.\n *\n * @param rootName The name of the editable element to remove.\n */\n removeEditableElement(rootName) {\n const domElement = this._editableElementsMap.get(rootName);\n if (!domElement) {\n return;\n }\n this._editableElementsMap.delete(rootName);\n this.editor.keystrokes.stopListening(domElement);\n this.focusTracker.remove(domElement);\n domElement.ckeditorInstance = null;\n }\n /**\n * Returns the editable editor element with the given name or null if editable does not exist.\n *\n * @param rootName The editable name.\n */\n getEditableElement(rootName = 'main') {\n return this._editableElementsMap.get(rootName);\n }\n /**\n * Returns array of names of all editor editable elements.\n */\n getEditableElementsNames() {\n return this._editableElementsMap.keys();\n }\n /**\n * Adds a toolbar to the editor UI. Used primarily to maintain the accessibility of the UI.\n *\n * Focusable toolbars can be accessed (focused) by users by pressing the Alt + F10 keystroke.\n * Successive keystroke presses navigate over available toolbars.\n *\n * @param toolbarView A instance of the toolbar to be registered.\n */\n addToolbar(toolbarView, options = {}) {\n if (toolbarView.isRendered) {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n }\n else {\n toolbarView.once('render', () => {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n });\n }\n this._focusableToolbarDefinitions.push({ toolbarView, options });\n }\n /**\n * Stores all editable elements used by the editor instance.\n *\n * @deprecated\n */\n get _editableElements() {\n /**\n * The {@link module:ui/editorui/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been\n * deprecated and will be removed in the near future. Please use\n * {@link module:ui/editorui/editorui~EditorUI#setEditableElement `setEditableElement()`} and\n * {@link module:ui/editorui/editorui~EditorUI#getEditableElement `getEditableElement()`} methods instead.\n *\n * @error editor-ui-deprecated-editable-elements\n * @param editorUI Editor UI instance the deprecated property belongs to.\n */\n console.warn('editor-ui-deprecated-editable-elements: ' +\n 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.', { editorUI: this });\n return this._editableElementsMap;\n }\n /**\n * Returns viewport offsets object:\n *\n * ```js\n * {\n * \ttop: Number,\n * \tright: Number,\n * \tbottom: Number,\n * \tleft: Number\n * }\n * ```\n *\n * Only top property is currently supported.\n */\n _readViewportOffsetFromConfig() {\n const editor = this.editor;\n const viewportOffsetConfig = editor.config.get('ui.viewportOffset');\n if (viewportOffsetConfig) {\n return viewportOffsetConfig;\n }\n // Not present in EditorConfig type, because it's legacy. Hence the `as` expression.\n const legacyOffsetConfig = editor.config.get('toolbar.viewportTopOffset');\n // Fall back to deprecated toolbar config.\n if (legacyOffsetConfig) {\n /**\n * The {@link module:core/editor/editorconfig~EditorConfig#toolbar `EditorConfig#toolbar.viewportTopOffset`}\n * property has been deprecated and will be removed in the near future. Please use\n * {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset`} instead.\n *\n * @error editor-ui-deprecated-viewport-offset-config\n */\n console.warn('editor-ui-deprecated-viewport-offset-config: ' +\n 'The `toolbar.vieportTopOffset` configuration option is deprecated. ' +\n 'It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead.');\n return { top: legacyOffsetConfig };\n }\n // More keys to come in the future.\n return { top: 0 };\n }\n /**\n * Starts listening for Alt + F10 and Esc keystrokes in the context of focusable\n * {@link #setEditableElement editable elements} and {@link #addToolbar toolbars}\n * to allow users navigate across the UI.\n */\n _initFocusTracking() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n let lastFocusedForeignElement;\n let candidateDefinitions;\n // Focus the next focusable toolbar on Alt + F10.\n editor.keystrokes.set('Alt+F10', (data, cancel) => {\n const focusedElement = this.focusTracker.focusedElement;\n // Focus moved out of a DOM element that\n // * is not a toolbar,\n // * does not belong to the editing view (e.g. source editing).\n if (Array.from(this._editableElementsMap.values()).includes(focusedElement) &&\n !Array.from(editingView.domRoots.values()).includes(focusedElement)) {\n lastFocusedForeignElement = focusedElement;\n }\n const currentFocusedToolbarDefinition = this._getCurrentFocusedToolbarDefinition();\n // * When focusing a toolbar for the first time, set the array of definitions for successive presses of Alt+F10.\n // This ensures, the navigation works always the same and no pair of toolbars takes over\n // (e.g. image and table toolbars when a selected image is inside a cell).\n // * It could be that the focus went to the toolbar by clicking a toolbar item (e.g. a dropdown). In this case,\n // there were no candidates so they must be obtained (#12339).\n if (!currentFocusedToolbarDefinition || !candidateDefinitions) {\n candidateDefinitions = this._getFocusableCandidateToolbarDefinitions();\n }\n // In a single Alt+F10 press, check all candidates but if none were focused, don't go any further.\n // This prevents an infinite loop.\n for (let i = 0; i < candidateDefinitions.length; i++) {\n const candidateDefinition = candidateDefinitions.shift();\n // Put the first definition to the back of the array. This allows circular navigation over all toolbars\n // on successive presses of Alt+F10.\n candidateDefinitions.push(candidateDefinition);\n // Don't focus the same toolbar again. If you did, this would move focus from the nth focused toolbar item back to the\n // first item as per ToolbarView#focus() if the user navigated inside the toolbar.\n if (candidateDefinition !== currentFocusedToolbarDefinition &&\n this._focusFocusableCandidateToolbar(candidateDefinition)) {\n // Clean up after a current visible toolbar when switching to the next one.\n if (currentFocusedToolbarDefinition && currentFocusedToolbarDefinition.options.afterBlur) {\n currentFocusedToolbarDefinition.options.afterBlur();\n }\n break;\n }\n }\n cancel();\n });\n // Blur the focused toolbar on Esc and bring the focus back to its origin.\n editor.keystrokes.set('Esc', (data, cancel) => {\n const focusedToolbarDef = this._getCurrentFocusedToolbarDefinition();\n if (!focusedToolbarDef) {\n return;\n }\n // Bring focus back to where it came from before focusing the toolbar:\n // 1. If it came from outside the engine view (e.g. source editing), move it there.\n if (lastFocusedForeignElement) {\n lastFocusedForeignElement.focus();\n lastFocusedForeignElement = null;\n }\n // 2. There are two possibilities left:\n // 2.1. It could be that the focus went from an editable element in the view (root or nested).\n // 2.2. It could be the focus went straight to the toolbar before even focusing the editing area.\n // In either case, just focus the view editing. The focus will land where it belongs.\n else {\n editor.editing.view.focus();\n }\n // Clean up after the toolbar if there is anything to do there.\n if (focusedToolbarDef.options.afterBlur) {\n focusedToolbarDef.options.afterBlur();\n }\n cancel();\n });\n }\n /**\n * Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.\n *\n * Focusable toolbars candidates are either:\n * * already visible,\n * * have `beforeFocus()` set in their {@link module:ui/editorui/editorui~FocusableToolbarDefinition definition} that suggests that\n * they might show up when called. Keep in mind that determining whether a toolbar will show up (and become focusable) is impossible\n * at this stage because it depends on its implementation, that in turn depends on the editing context (selection).\n *\n * **Note**: Contextual toolbars take precedence over regular toolbars.\n */\n _getFocusableCandidateToolbarDefinitions() {\n const definitions = [];\n for (const toolbarDef of this._focusableToolbarDefinitions) {\n const { toolbarView, options } = toolbarDef;\n if (isVisible(toolbarView.element) || options.beforeFocus) {\n definitions.push(toolbarDef);\n }\n }\n // Contextual and already visible toolbars have higher priority. If both are true, the toolbar will always focus first.\n // For instance, a selected widget toolbar vs inline editor toolbar: both are visible but the widget toolbar is contextual.\n definitions.sort((defA, defB) => getToolbarDefinitionWeight(defA) - getToolbarDefinitionWeight(defB));\n return definitions;\n }\n /**\n * Returns a definition of the toolbar that is currently visible and focused (one of its children has focus).\n *\n * `null` is returned when no toolbar is currently focused.\n */\n _getCurrentFocusedToolbarDefinition() {\n for (const definition of this._focusableToolbarDefinitions) {\n if (definition.toolbarView.element && definition.toolbarView.element.contains(this.focusTracker.focusedElement)) {\n return definition;\n }\n }\n return null;\n }\n /**\n * Focuses a focusable toolbar candidate using its definition.\n *\n * @param candidateToolbarDefinition A definition of the toolbar to focus.\n * @returns `true` when the toolbar candidate was focused. `false` otherwise.\n */\n _focusFocusableCandidateToolbar(candidateToolbarDefinition) {\n const { toolbarView, options: { beforeFocus } } = candidateToolbarDefinition;\n if (beforeFocus) {\n beforeFocus();\n }\n // If it didn't show up after beforeFocus(), it's not focusable at all.\n if (!isVisible(toolbarView.element)) {\n return false;\n }\n toolbarView.focus();\n return true;\n }\n}\n/**\n * Returns a number (weight) for a toolbar definition. Visible toolbars have a higher priority and so do\n * contextual toolbars (displayed in the context of a content, for instance, an image toolbar).\n *\n * A standard invisible toolbar is the heaviest. A visible contextual toolbar is the lightest.\n *\n * @param toolbarDef A toolbar definition to be weighted.\n */\nfunction getToolbarDefinitionWeight(toolbarDef) {\n const { toolbarView, options } = toolbarDef;\n let weight = 10;\n // Prioritize already visible toolbars. They should get focused first.\n if (isVisible(toolbarView.element)) {\n weight--;\n }\n // Prioritize contextual toolbars. They are displayed at the selection.\n if (options.isContextual) {\n weight--;\n }\n return weight;\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./editorui.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editoruiview\n */\nimport View from '../view';\nimport BodyCollection from './bodycollection';\nimport '../../theme/components/editorui/editorui.css';\n/**\n * The editor UI view class. Base class for the editor main views.\n */\nexport default class EditorUIView extends View {\n /**\n * Creates an instance of the editor UI view class.\n *\n * @param locale The locale instance.\n */\n constructor(locale) {\n super(locale);\n this.body = new BodyCollection(locale);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.body.attachToDom();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.body.detachFromDom();\n return super.destroy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/boxed/boxededitoruiview\n */\nimport EditorUIView from '../editoruiview';\nimport LabelView from '../../label/labelview';\n/**\n * The boxed editor UI view class. This class represents an editor interface\n * consisting of a toolbar and an editable area, enclosed within a box.\n */\nexport default class BoxedEditorUIView extends EditorUIView {\n /**\n * Creates an instance of the boxed editor UI view class.\n *\n * @param locale The locale instance..\n */\n constructor(locale) {\n super(locale);\n this.top = this.createCollection();\n this.main = this.createCollection();\n this._voiceLabelView = this._createVoiceLabel();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-editor',\n 'ck-rounded-corners'\n ],\n role: 'application',\n dir: locale.uiLanguageDirection,\n lang: locale.uiLanguage,\n 'aria-labelledby': this._voiceLabelView.id\n },\n children: [\n this._voiceLabelView,\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-editor__top',\n 'ck-reset_all'\n ],\n role: 'presentation'\n },\n children: this.top\n },\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-editor__main'\n ],\n role: 'presentation'\n },\n children: this.main\n }\n ]\n });\n }\n /**\n * Creates a voice label view instance.\n */\n _createVoiceLabel() {\n const t = this.t;\n const voiceLabel = new LabelView();\n voiceLabel.text = t('Rich Text Editor');\n voiceLabel.extendTemplate({\n attributes: {\n class: 'ck-voice-label'\n }\n });\n return voiceLabel;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/editableuiview\n */\nimport View from '../view';\n/**\n * The editable UI view class.\n */\nexport default class EditableUIView extends View {\n /**\n * Creates an instance of EditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, this view\n * should create it. Otherwise, the existing element should be used.\n */\n constructor(locale, editingView, editableElement) {\n super(locale);\n /**\n * The name of the editable UI view.\n */\n this.name = null;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-content',\n 'ck-editor__editable',\n 'ck-rounded-corners'\n ],\n lang: locale.contentLanguage,\n dir: locale.contentLanguageDirection\n }\n });\n this.set('isFocused', false);\n this._editableElement = editableElement;\n this._hasExternalElement = !!this._editableElement;\n this._editingView = editingView;\n }\n /**\n * Renders the view by either applying the {@link #template} to the existing\n * {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement} or assigning {@link #element}\n * as {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement}.\n */\n render() {\n super.render();\n if (this._hasExternalElement) {\n this.template.apply(this.element = this._editableElement);\n }\n else {\n this._editableElement = this.element;\n }\n this.on('change:isFocused', () => this._updateIsFocusedClasses());\n this._updateIsFocusedClasses();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._hasExternalElement) {\n this.template.revert(this._editableElement);\n }\n super.destroy();\n }\n /**\n * Whether an external {@link #_editableElement} was passed into the constructor, which also means\n * the view will not render its {@link #template}.\n */\n get hasExternalElement() {\n return this._hasExternalElement;\n }\n /**\n * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to\n * the {@link #isFocused} property value using the {@link #_editingView editing view} API.\n */\n _updateIsFocusedClasses() {\n const editingView = this._editingView;\n if (editingView.isRenderingInProgress) {\n updateAfterRender(this);\n }\n else {\n update(this);\n }\n function update(view) {\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(view.name);\n writer.addClass(view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot);\n writer.removeClass(view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot);\n });\n }\n // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).\n // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another\n // callback and render is called inside the already pending render.\n // We need to be sure that callback is executed only when the value has changed from `true` to `false`.\n // See https://github.com/ckeditor/ckeditor5/issues/1676.\n function updateAfterRender(view) {\n editingView.once('change:isRenderingInProgress', (evt, name, value) => {\n if (!value) {\n update(view);\n }\n else {\n updateAfterRender(view);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/inline/inlineeditableuiview\n */\nimport EditableUIView from '../editableuiview';\n/**\n * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.\n */\nexport default class InlineEditableUIView extends EditableUIView {\n /**\n * Creates an instance of the InlineEditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, the\n * {@link module:ui/editableui/editableuiview~EditableUIView}\n * will create it. Otherwise, the existing element will be used.\n * @param options Additional configuration of the view.\n * @param options.label A function that gets called with the instance of this view as an argument\n * and should return a string that represents the label of the editable for assistive technologies. If not provided,\n * a default label generator is used.\n */\n constructor(locale, editingView, editableElement, options = {}) {\n super(locale, editingView, editableElement);\n const t = locale.t;\n this.extendTemplate({\n attributes: {\n role: 'textbox',\n class: 'ck-editor__editable_inline'\n }\n });\n this._generateLabel = options.label || (() => t('Editor editing area: %0', this.name));\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const editingView = this._editingView;\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(this.name);\n writer.setAttribute('aria-label', this._generateLabel(this), viewRoot);\n });\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formheader.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/formheader/formheaderview\n */\nimport View from '../view';\nimport '../../theme/components/formheader/formheader.css';\n/**\n * The class component representing a form header view. It should be used in more advanced forms to\n * describe the main purpose of the form.\n *\n * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.\n * The component can also be extended by any other elements, like: icons, dropdowns, etc.\n *\n * It is used i.a.\n * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}\n * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.\n *\n * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.\n */\nexport default class FormHeaderView extends View {\n /**\n * Creates an instance of the form header class.\n *\n * @param locale The locale instance.\n * @param options.label A label.\n * @param options.class An additional class.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('label', options.label || '');\n this.set('class', options.class || null);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header',\n bind.to('class')\n ]\n },\n children: this.children\n });\n const label = new View(locale);\n label.setTemplate({\n tag: 'h2',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header__label'\n ]\n },\n children: [\n { text: bind.to('label') }\n ]\n });\n this.children.add(label);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/notification/notification\n */\n/* globals window */\nimport { ContextPlugin } from '@ckeditor/ckeditor5-core';\n/**\n * The Notification plugin.\n *\n * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be\n * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching\n * notifications makes it possible to switch the notifications UI.\n *\n * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.\n * See {@link module:ui/notification/notification~Notification#showWarning}.\n */\nexport default class Notification extends ContextPlugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Notification';\n }\n /**\n * @inheritDoc\n */\n init() {\n // Each unhandled and not stopped `show:warning` event is displayed as a system alert.\n this.on('show:warning', (evt, data) => {\n window.alert(data.message); // eslint-disable-line no-alert\n }, { priority: 'lowest' });\n }\n /**\n * Shows a success notification.\n *\n * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:success:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \ttitle: 'Image upload success'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showSuccess(message, data = {}) {\n this._showNotification({\n message,\n type: 'success',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows an information notification.\n *\n * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \tnamespace: 'editor:status'\n * } );\n * ```\n *\n * will fire the `show:info:editor:status` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \ttitle: 'Network information'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showInfo(message, data = {}) {\n this._showNotification({\n message,\n type: 'info',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows a warning notification.\n *\n * By default, it fires the {@link #event:show:warning `show:warning` event}\n * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:warning:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \ttitle: 'Upload failed'\n * } );\n * ```\n *\n * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.\n * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Do something with the data.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * } );\n * ```\n *\n * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Show the warning in the UI, but do not stop it.\n * } );\n *\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Log the warning to some error tracker.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * }, { priority: 'low' } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showWarning(message, data = {}) {\n this._showNotification({\n message,\n type: 'warning',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Fires the `show` event with the specified type, namespace and message.\n *\n * @param data The message data.\n * @param data.message The content of the notification.\n * @param data.type The type of the message.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n _showNotification(data) {\n const event = data.namespace ?\n `show:${data.type}:${data.namespace}` :\n `show:${data.type}`;\n this.fire(event, {\n message: data.message,\n type: data.type,\n title: data.title || ''\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/model\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport { extend } from 'lodash-es';\n/**\n * The base MVC model class.\n */\nexport default class Model extends ObservableMixin() {\n /**\n * Creates a new Model instance.\n *\n * @param attributes The model state attributes to be defined during the instance creation.\n * @param properties The (out of state) properties to be appended to the instance during creation.\n */\n constructor(attributes, properties) {\n super();\n // Extend this instance with the additional (out of state) properties.\n if (properties) {\n extend(this, properties);\n }\n // Initialize the attributes.\n if (attributes) {\n this.set(attributes);\n }\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonrotator.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fakepanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/contextualballoon\n */\nimport BalloonPanelView from './balloonpanelview';\nimport View from '../../view';\nimport ButtonView from '../../button/buttonview';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { CKEditorError, FocusTracker, Rect, toUnit } from '@ckeditor/ckeditor5-utils';\nimport prevIcon from '../../../theme/icons/previous-arrow.svg';\nimport nextIcon from '../../../theme/icons/next-arrow.svg';\nimport '../../../theme/components/panel/balloonrotator.css';\nimport '../../../theme/components/panel/fakepanel.css';\nconst toPx = toUnit('px');\n/**\n * Provides the common contextual balloon for the editor.\n *\n * The role of this plugin is to unify the contextual balloons logic, simplify views management and help\n * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * instances in the editor.\n *\n * This plugin allows for creating single or multiple panel stacks.\n *\n * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,\n * the previous view becomes visible.\n *\n * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.\n * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel\n * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.\n *\n * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection\n * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.\n * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the \"Next\"\n * and \"Previous\" buttons.\n *\n * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no\n * panels in any stack, the balloon panel will be hidden.\n *\n * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option\n * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.\n *\n * From the implementation point of view, the contextual ballon plugin is reusing a single\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon\n * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},\n * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific\n * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a\n * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).\n */\nexport default class ContextualBalloon extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ContextualBalloon';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The map of views and their stacks.\n */\n this._viewToStack = new Map();\n /**\n * The map of IDs and stacks.\n */\n this._idToStack = new Map();\n /**\n * The common balloon panel view.\n */\n this._view = null;\n /**\n * Rotator view embedded in the contextual balloon.\n * Displays the currently visible view in the balloon and provides navigation for switching stacks.\n */\n this._rotatorView = null;\n /**\n * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.\n */\n this._fakePanelsView = null;\n this.positionLimiter = () => {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n const editableElement = viewDocument.selection.editableElement;\n if (editableElement) {\n return view.domConverter.mapViewToDom(editableElement.root);\n }\n return null;\n };\n this.set('visibleView', null);\n this.set('_numberOfStacks', 0);\n this.set('_singleViewMode', false);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n if (this._view) {\n this._view.destroy();\n }\n if (this._rotatorView) {\n this._rotatorView.destroy();\n }\n if (this._fakePanelsView) {\n this._fakePanelsView.destroy();\n }\n }\n /**\n * The common balloon panel view.\n */\n get view() {\n if (!this._view) {\n this._createPanelView();\n }\n return this._view;\n }\n /**\n * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.\n */\n hasView(view) {\n return Array.from(this._viewToStack.keys()).includes(view);\n }\n /**\n * Adds a new view to the stack and makes it visible if the current stack is visible\n * or it is the first view in the balloon.\n *\n * @param data The configuration of the view.\n * @param data.stackId The ID of the stack that the view is added to. Defaults to `'main'`.\n * @param data.view The content of the balloon.\n * @param data.position Positioning options.\n * @param data.balloonClassName An additional CSS class added to the {@link #view balloon} when visible.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow. Defaults to `true`.\n * @param data.singleViewMode Whether the view should be the only visible view even if other stacks were added. Defaults to `false`.\n */\n add(data) {\n if (!this._view) {\n this._createPanelView();\n }\n if (this.hasView(data.view)) {\n /**\n * Trying to add configuration of the same view more than once.\n *\n * @error contextualballoon-add-view-exist\n */\n throw new CKEditorError('contextualballoon-add-view-exist', [this, data]);\n }\n const stackId = data.stackId || 'main';\n // If new stack is added, creates it and show view from this stack.\n if (!this._idToStack.has(stackId)) {\n this._idToStack.set(stackId, new Map([[data.view, data]]));\n this._viewToStack.set(data.view, this._idToStack.get(stackId));\n this._numberOfStacks = this._idToStack.size;\n if (!this._visibleStack || data.singleViewMode) {\n this.showStack(stackId);\n }\n return;\n }\n const stack = this._idToStack.get(stackId);\n if (data.singleViewMode) {\n this.showStack(stackId);\n }\n // Add new view to the stack.\n stack.set(data.view, data);\n this._viewToStack.set(data.view, stack);\n // And display it if is added to the currently visible stack.\n if (stack === this._visibleStack) {\n this._showView(data);\n }\n }\n /**\n * Removes the given view from the stack. If the removed view was visible,\n * the view preceding it in the stack will become visible instead.\n * When there is no view in the stack, the next stack will be displayed.\n * When there are no more stacks, the balloon will hide.\n *\n * @param view A view to be removed from the balloon.\n */\n remove(view) {\n if (!this.hasView(view)) {\n /**\n * Trying to remove the configuration of the view not defined in the stack.\n *\n * @error contextualballoon-remove-view-not-exist\n */\n throw new CKEditorError('contextualballoon-remove-view-not-exist', [this, view]);\n }\n const stack = this._viewToStack.get(view);\n if (this._singleViewMode && this.visibleView === view) {\n this._singleViewMode = false;\n }\n // When visible view will be removed we need to show a preceding view or next stack\n // if a view is the only view in the stack.\n if (this.visibleView === view) {\n if (stack.size === 1) {\n if (this._idToStack.size > 1) {\n this._showNextStack();\n }\n else {\n this.view.hide();\n this.visibleView = null;\n this._rotatorView.hideView();\n }\n }\n else {\n this._showView(Array.from(stack.values())[stack.size - 2]);\n }\n }\n if (stack.size === 1) {\n this._idToStack.delete(this._getStackId(stack));\n this._numberOfStacks = this._idToStack.size;\n }\n else {\n stack.delete(view);\n }\n this._viewToStack.delete(view);\n }\n /**\n * Updates the position of the balloon using the position data of the first visible view in the stack.\n * When new position data is given, the position data of the currently visible view will be updated.\n *\n * @param position Position options.\n */\n updatePosition(position) {\n if (position) {\n this._visibleStack.get(this.visibleView).position = position;\n }\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n }\n /**\n * Shows the last view from the stack of a given ID.\n */\n showStack(id) {\n this.visibleStack = id;\n const stack = this._idToStack.get(id);\n if (!stack) {\n /**\n * Trying to show a stack that does not exist.\n *\n * @error contextualballoon-showstack-stack-not-exist\n */\n throw new CKEditorError('contextualballoon-showstack-stack-not-exist', this);\n }\n if (this._visibleStack === stack) {\n return;\n }\n this._showView(Array.from(stack.values()).pop());\n }\n /**\n * Initializes view instances.\n */\n _createPanelView() {\n this._view = new BalloonPanelView(this.editor.locale);\n this.editor.ui.view.body.add(this._view);\n this.editor.ui.focusTracker.add(this._view.element);\n this._rotatorView = this._createRotatorView();\n this._fakePanelsView = this._createFakePanelsView();\n }\n /**\n * Returns the stack of the currently visible view.\n */\n get _visibleStack() {\n return this._viewToStack.get(this.visibleView);\n }\n /**\n * Returns the ID of the given stack.\n */\n _getStackId(stack) {\n const entry = Array.from(this._idToStack.entries()).find(entry => entry[1] === stack);\n return entry[0];\n }\n /**\n * Shows the last view from the next stack.\n */\n _showNextStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) + 1;\n if (!stacks[nextIndex]) {\n nextIndex = 0;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Shows the last view from the previous stack.\n */\n _showPrevStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) - 1;\n if (!stacks[nextIndex]) {\n nextIndex = stacks.length - 1;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Creates a rotator view.\n */\n _createRotatorView() {\n const view = new RotatorView(this.editor.locale);\n const t = this.editor.locale.t;\n this.view.content.add(view);\n // Hide navigation when there is only a one stack & not in single view mode.\n view.bind('isNavigationVisible').to(this, '_numberOfStacks', this, '_singleViewMode', (value, isSingleViewMode) => {\n return !isSingleViewMode && value > 1;\n });\n // Update balloon position after toggling navigation.\n view.on('change:isNavigationVisible', () => (this.updatePosition()), { priority: 'low' });\n // Update stacks counter value.\n view.bind('counter').to(this, 'visibleView', this, '_numberOfStacks', (visibleView, numberOfStacks) => {\n if (numberOfStacks < 2) {\n return '';\n }\n const current = Array.from(this._idToStack.values()).indexOf(this._visibleStack) + 1;\n return t('%0 of %1', [current, numberOfStacks]);\n });\n view.buttonNextView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showNextStack();\n });\n view.buttonPrevView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showPrevStack();\n });\n return view;\n }\n /**\n * Creates a fake panels view.\n */\n _createFakePanelsView() {\n const view = new FakePanelsView(this.editor.locale, this.view);\n view.bind('numberOfPanels').to(this, '_numberOfStacks', this, '_singleViewMode', (number, isSingleViewMode) => {\n const showPanels = !isSingleViewMode && number >= 2;\n return showPanels ? Math.min(number - 1, 2) : 0;\n });\n view.listenTo(this.view, 'change:top', () => view.updatePosition());\n view.listenTo(this.view, 'change:left', () => view.updatePosition());\n this.editor.ui.view.body.add(view);\n return view;\n }\n /**\n * Sets the view as the content of the balloon and attaches the balloon using position\n * options of the first view.\n *\n * @param data Configuration.\n * @param data.view The view to show in the balloon.\n * @param data.balloonClassName Additional class name which will be added to the {@link #view balloon}.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow.\n */\n _showView({ view, balloonClassName = '', withArrow = true, singleViewMode = false }) {\n this.view.class = balloonClassName;\n this.view.withArrow = withArrow;\n this._rotatorView.showView(view);\n this.visibleView = view;\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n if (singleViewMode) {\n this._singleViewMode = true;\n }\n }\n /**\n * Returns position options of the last view in the stack.\n * This keeps the balloon in the same position when the view is changed.\n */\n _getBalloonPosition() {\n let position = Array.from(this._visibleStack.values()).pop().position;\n if (position) {\n // Use the default limiter if none has been specified.\n if (!position.limiter) {\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n limiter: this.positionLimiter\n });\n }\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n viewportOffsetConfig: this.editor.ui.viewportOffset\n });\n }\n return position;\n }\n}\n/**\n * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.\n * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.\n * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.\n */\nexport class RotatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const t = locale.t;\n const bind = this.bindTemplate;\n this.set('isNavigationVisible', true);\n this.focusTracker = new FocusTracker();\n this.buttonPrevView = this._createButtonView(t('Previous'), prevIcon);\n this.buttonNextView = this._createButtonView(t('Next'), nextIcon);\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-rotator'\n ],\n 'z-index': '-1'\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck-balloon-rotator__navigation',\n bind.to('isNavigationVisible', value => value ? '' : 'ck-hidden')\n ]\n },\n children: [\n this.buttonPrevView,\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck-balloon-rotator__counter'\n ]\n },\n children: [\n {\n text: bind.to('counter')\n }\n ]\n },\n this.buttonNextView\n ]\n },\n {\n tag: 'div',\n attributes: {\n class: 'ck-balloon-rotator__content'\n },\n children: this.content\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n }\n /**\n * Shows a given view.\n *\n * @param view The view to show.\n */\n showView(view) {\n this.hideView();\n this.content.add(view);\n }\n /**\n * Hides the currently displayed view.\n */\n hideView() {\n this.content.clear();\n }\n /**\n * Creates a navigation button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n */\n _createButtonView(label, icon) {\n const view = new ButtonView(this.locale);\n view.set({\n label,\n icon,\n tooltip: true\n });\n return view;\n }\n}\n/**\n * Displays additional layers under the balloon when multiple stacks are added to the balloon.\n */\nclass FakePanelsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, balloonPanelView) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('height', 0);\n this.set('width', 0);\n this.set('numberOfPanels', 0);\n this.content = this.createCollection();\n this._balloonPanelView = balloonPanelView;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-fake-panel',\n bind.to('numberOfPanels', number => number ? '' : 'ck-hidden')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx),\n width: bind.to('width', toPx),\n height: bind.to('height', toPx)\n }\n },\n children: this.content\n });\n this.on('change:numberOfPanels', (evt, name, next, prev) => {\n if (next > prev) {\n this._addPanels(next - prev);\n }\n else {\n this._removePanels(prev - next);\n }\n this.updatePosition();\n });\n }\n _addPanels(number) {\n while (number--) {\n const view = new View();\n view.setTemplate({ tag: 'div' });\n this.content.add(view);\n this.registerChild(view);\n }\n }\n _removePanels(number) {\n while (number--) {\n const view = this.content.last;\n this.content.remove(view);\n this.deregisterChild(view);\n view.destroy();\n }\n }\n /**\n * Updates coordinates of fake panels.\n */\n updatePosition() {\n if (this.numberOfPanels) {\n const { top, left } = this._balloonPanelView;\n const { width, height } = new Rect(this._balloonPanelView.element);\n Object.assign(this, { top, left, width, height });\n }\n }\n}\n","export default \"\";","export default \"\";","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stickypanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/sticky/stickypanelview\n */\nimport View from '../../view';\nimport Template from '../../template';\nimport { global, toUnit } from '@ckeditor/ckeditor5-utils';\nimport '../../../theme/components/panel/stickypanel.css';\nconst toPx = toUnit('px');\n/**\n * The sticky panel view class.\n */\nexport default class StickyPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isActive', false);\n this.set('isSticky', false);\n this.set('limiterElement', null);\n this.set('limiterBottomOffset', 50);\n this.set('viewportTopOffset', 0);\n this.set('_marginLeft', null);\n this.set('_isStickyToTheLimiter', false);\n this.set('_hasViewportTopOffset', false);\n this.content = this.createCollection();\n this._contentPanelPlaceholder = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel__placeholder'\n ],\n style: {\n display: bind.to('isSticky', isSticky => isSticky ? 'block' : 'none'),\n height: bind.to('isSticky', isSticky => {\n return isSticky ? toPx(this._panelRect.height) : null;\n })\n }\n }\n }).render();\n this._contentPanel = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel__content',\n // Toggle class of the panel when \"sticky\" state changes in the view.\n bind.if('isSticky', 'ck-sticky-panel__content_sticky'),\n bind.if('_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit')\n ],\n style: {\n width: bind.to('isSticky', isSticky => {\n return isSticky ? toPx(this._contentPanelPlaceholder.getBoundingClientRect().width) : null;\n }),\n top: bind.to('_hasViewportTopOffset', _hasViewportTopOffset => {\n return _hasViewportTopOffset ? toPx(this.viewportTopOffset) : null;\n }),\n bottom: bind.to('_isStickyToTheLimiter', _isStickyToTheLimiter => {\n return _isStickyToTheLimiter ? toPx(this.limiterBottomOffset) : null;\n }),\n marginLeft: bind.to('_marginLeft')\n }\n },\n children: this.content\n }).render();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel'\n ]\n },\n children: [\n this._contentPanelPlaceholder,\n this._contentPanel\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Check if the panel should go into the sticky state immediately.\n this._checkIfShouldBeSticky();\n // Update sticky state of the panel as the window is being scrolled.\n this.listenTo(global.window, 'scroll', () => {\n this._checkIfShouldBeSticky();\n });\n // Synchronize with `model.isActive` because sticking an inactive panel is pointless.\n this.listenTo(this, 'change:isActive', () => {\n this._checkIfShouldBeSticky();\n });\n }\n /**\n * Analyzes the environment to decide whether the panel should\n * be sticky or not.\n */\n _checkIfShouldBeSticky() {\n const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();\n let limiterRect;\n if (!this.limiterElement) {\n this.isSticky = false;\n }\n else {\n limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();\n // The panel must be active to become sticky.\n this.isSticky = this.isActive &&\n // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).\n limiterRect.top < this.viewportTopOffset &&\n // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.\n // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because\n // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel\n // would be positioned before the model#limiterElement.\n this._panelRect.height + this.limiterBottomOffset < limiterRect.height;\n }\n // Stick the panel to the top edge of the viewport simulating CSS position:sticky.\n // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky\n if (this.isSticky) {\n this._isStickyToTheLimiter =\n limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;\n this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;\n this._marginLeft = this._isStickyToTheLimiter ? null : toPx(-global.window.scrollX);\n }\n // Detach the panel from the top edge of the viewport.\n else {\n this._isStickyToTheLimiter = false;\n this._hasViewportTopOffset = false;\n this._marginLeft = null;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/balloon/balloontoolbar\n */\nimport ContextualBalloon from '../../panel/balloon/contextualballoon';\nimport ToolbarView from '../toolbarview';\nimport BalloonPanelView, { generatePositions } from '../../panel/balloon/balloonpanelview';\nimport normalizeToolbarConfig from '../normalizetoolbarconfig';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { FocusTracker, Rect, ResizeObserver, env, global, toUnit } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nconst toPx = toUnit('px');\n/**\n * The contextual toolbar.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class BalloonToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BalloonToolbar';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * An instance of the resize observer that allows to respond to changes in editable's geometry\n * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).\n *\n * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the\n * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.\n *\n * **Note:** Created in {@link #init}.\n */\n this._resizeObserver = null;\n this._balloonConfig = normalizeToolbarConfig(editor.config.get('balloonToolbar'));\n this.toolbarView = this._createToolbarView();\n this.focusTracker = new FocusTracker();\n // Wait for the EditorUI#init. EditableElement is not available before.\n editor.ui.once('ready', () => {\n this.focusTracker.add(editor.ui.getEditableElement());\n this.focusTracker.add(this.toolbarView.element);\n });\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(this.toolbarView, {\n beforeFocus: () => this.show(true),\n afterBlur: () => this.hide(),\n isContextual: true\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n this._fireSelectionChangeDebounced = debounce(() => this.fire('_selectionChangeDebounced'), 200);\n // The appearance of the BalloonToolbar method is event–driven.\n // It is possible to stop the #show event and this prevent the toolbar from showing up.\n this.decorate('show');\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n // Show/hide the toolbar on editable focus/blur.\n this.listenTo(this.focusTracker, 'change:isFocused', (evt, name, isFocused) => {\n const isToolbarVisible = this._balloon.visibleView === this.toolbarView;\n if (!isFocused && isToolbarVisible) {\n this.hide();\n }\n else if (isFocused) {\n this.show();\n }\n });\n // Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.\n this.listenTo(selection, 'change:range', (evt, data) => {\n if (data.directChange || selection.isCollapsed) {\n this.hide();\n }\n // Fire internal `_selectionChangeDebounced` event to use it for showing\n // the toolbar after the selection stops changing.\n this._fireSelectionChangeDebounced();\n });\n // Show the toolbar when the selection stops changing.\n this.listenTo(this, '_selectionChangeDebounced', () => {\n if (this.editor.editing.view.document.isFocused) {\n this.show();\n }\n });\n if (!this._balloonConfig.shouldNotGroupWhenFull) {\n this.listenTo(editor, 'ready', () => {\n const editableElement = editor.ui.view.editable.element;\n // Set #toolbarView's max-width on the initialization and update it on the editable resize.\n this._resizeObserver = new ResizeObserver(editableElement, entry => {\n // The max-width equals 90% of the editable's width for the best user experience.\n // The value keeps the balloon very close to the boundaries of the editable and limits the cases\n // when the balloon juts out from the editable element it belongs to.\n this.toolbarView.maxWidth = toPx(entry.contentRect.width * .9);\n });\n });\n }\n // Listen to the toolbar view and whenever it changes its geometry due to some items being\n // grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar\n // means the balloon could be pointing at the wrong place. Once updated, the balloon will point\n // at the right selection in the content again.\n // https://github.com/ckeditor/ckeditor5/issues/6444\n this.listenTo(this.toolbarView, 'groupedItemsUpdate', () => {\n this._updatePosition();\n });\n }\n /**\n * Creates toolbar components based on given configuration.\n * This needs to be done when all plugins are ready.\n */\n afterInit() {\n const factory = this.editor.ui.componentFactory;\n this.toolbarView.fillFromConfig(this._balloonConfig, factory);\n }\n /**\n * Creates the toolbar view instance.\n */\n _createToolbarView() {\n const t = this.editor.locale.t;\n const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;\n const toolbarView = new ToolbarView(this.editor.locale, {\n shouldGroupWhenFull,\n isFloating: true\n });\n toolbarView.ariaLabel = t('Editor contextual toolbar');\n toolbarView.render();\n return toolbarView;\n }\n /**\n * Shows the toolbar and attaches it to the selection.\n *\n * Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.\n *\n * @param showForCollapsedSelection When set `true`, the toolbar will show despite collapsed selection in the\n * editing view.\n */\n show(showForCollapsedSelection = false) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const schema = editor.model.schema;\n // Do not add the toolbar to the balloon stack twice.\n if (this._balloon.hasView(this.toolbarView)) {\n return;\n }\n // Do not show the toolbar when the selection is collapsed.\n if (selection.isCollapsed && !showForCollapsedSelection) {\n return;\n }\n // Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.\n // See https://github.com/ckeditor/ckeditor5/issues/6443.\n if (selectionContainsOnlyMultipleSelectables(selection, schema)) {\n return;\n }\n // Don not show the toolbar when all components inside are disabled\n // see https://github.com/ckeditor/ckeditor5-ui/issues/269.\n if (Array.from(this.toolbarView.items).every((item) => item.isEnabled !== undefined && !item.isEnabled)) {\n return;\n }\n // Update the toolbar position when the editor ui should be refreshed.\n this.listenTo(this.editor.ui, 'update', () => {\n this._updatePosition();\n });\n // Add the toolbar to the common editor contextual balloon.\n this._balloon.add({\n view: this.toolbarView,\n position: this._getBalloonPositionData(),\n balloonClassName: 'ck-toolbar-container'\n });\n }\n /**\n * Hides the toolbar.\n */\n hide() {\n if (this._balloon.hasView(this.toolbarView)) {\n this.stopListening(this.editor.ui, 'update');\n this._balloon.remove(this.toolbarView);\n }\n }\n /**\n * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached\n * to the selection.\n */\n _getBalloonPositionData() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const viewSelection = viewDocument.selection;\n // Get direction of the selection.\n const isBackward = viewDocument.selection.isBackward;\n return {\n // Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed\n // as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously\n // computed and hence, the target is defined as a function instead of a static value.\n // https://github.com/ckeditor/ckeditor5-ui/issues/195\n target: () => {\n const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();\n const rangeRects = Rect.getDomRangeRects(view.domConverter.viewRangeToDom(range));\n // Select the proper range rect depending on the direction of the selection.\n if (isBackward) {\n return rangeRects[0];\n }\n else {\n // Ditch the zero-width \"orphan\" rect in the next line for the forward selection if there's\n // another one preceding it. It is not rendered as a selection by the web browser anyway.\n // https://github.com/ckeditor/ckeditor5-ui/issues/308\n if (rangeRects.length > 1 && rangeRects[rangeRects.length - 1].width === 0) {\n rangeRects.pop();\n }\n return rangeRects[rangeRects.length - 1];\n }\n },\n positions: this._getBalloonPositions(isBackward)\n };\n }\n /**\n * Updates the position of the {@link #_balloon} to make up for changes:\n *\n * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),\n * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).\n */\n _updatePosition() {\n this._balloon.updatePosition(this._getBalloonPositionData());\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.stopListening();\n this._fireSelectionChangeDebounced.cancel();\n this.toolbarView.destroy();\n this.focusTracker.destroy();\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Returns toolbar positions for the given direction of the selection.\n */\n _getBalloonPositions(isBackward) {\n const isSafariIniOS = env.isSafari && env.isiOS;\n // https://github.com/ckeditor/ckeditor5/issues/7707\n const positions = isSafariIniOS ? generatePositions({\n // 20px when zoomed out. Less then 20px when zoomed in; the \"radius\" of the native selection handle gets\n // smaller as the user zooms in. No less than the default v-offset, though.\n heightOffset: Math.max(BalloonPanelView.arrowHeightOffset, Math.round(20 / global.window.visualViewport.scale))\n }) : BalloonPanelView.defaultPositions;\n return isBackward ? [\n positions.northWestArrowSouth,\n positions.northWestArrowSouthWest,\n positions.northWestArrowSouthEast,\n positions.northWestArrowSouthMiddleEast,\n positions.northWestArrowSouthMiddleWest,\n positions.southWestArrowNorth,\n positions.southWestArrowNorthWest,\n positions.southWestArrowNorthEast,\n positions.southWestArrowNorthMiddleWest,\n positions.southWestArrowNorthMiddleEast\n ] : [\n positions.southEastArrowNorth,\n positions.southEastArrowNorthEast,\n positions.southEastArrowNorthWest,\n positions.southEastArrowNorthMiddleEast,\n positions.southEastArrowNorthMiddleWest,\n positions.northEastArrowSouth,\n positions.northEastArrowSouthEast,\n positions.northEastArrowSouthWest,\n positions.northEastArrowSouthMiddleEast,\n positions.northEastArrowSouthMiddleWest\n ];\n }\n}\n/**\n * Returns \"true\" when the selection has multiple ranges and each range contains a selectable element\n * and nothing else.\n */\nfunction selectionContainsOnlyMultipleSelectables(selection, schema) {\n // It doesn't contain multiple objects if there is only one range.\n if (selection.rangeCount === 1) {\n return false;\n }\n return [...selection.getRanges()].every(range => {\n const element = range.getContainedElement();\n return element && schema.isSelectable(element);\n });\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blocktoolbar.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/block/blockbuttonview\n */\nimport ButtonView from '../../button/buttonview';\nimport { toUnit } from '@ckeditor/ckeditor5-utils';\nimport '../../../theme/components/toolbar/blocktoolbar.css';\nconst toPx = toUnit('px');\n/**\n * The block button view class.\n *\n * This view represents a button attached next to block element where the selection is anchored.\n *\n * See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.\n */\nexport default class BlockButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n // Hide button on init.\n this.isVisible = false;\n this.isToggleable = true;\n this.set('top', 0);\n this.set('left', 0);\n this.extendTemplate({\n attributes: {\n class: 'ck-block-toolbar-button',\n style: {\n top: bind.to('top', val => toPx(val)),\n left: bind.to('left', val => toPx(val))\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/block/blocktoolbar\n */\n/* global window */\nimport { Plugin, icons } from '@ckeditor/ckeditor5-core';\nimport { Rect, ResizeObserver, getOptimalPosition, toUnit } from '@ckeditor/ckeditor5-utils';\nimport BlockButtonView from './blockbuttonview';\nimport BalloonPanelView from '../../panel/balloon/balloonpanelview';\nimport ToolbarView from '../toolbarview';\nimport clickOutsideHandler from '../../bindings/clickoutsidehandler';\nimport normalizeToolbarConfig from '../normalizetoolbarconfig';\nconst toPx = toUnit('px');\nconst { pilcrow } = icons;\n/**\n * The block toolbar plugin.\n *\n * This plugin provides a button positioned next to the block of content where the selection is anchored.\n * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in\n * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.\n *\n * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}\n * as `$block` for which the toolbar provides at least one option.\n *\n * By default, the button is attached so its right boundary is touching the\n * {@link module:engine/view/editableelement~EditableElement}:\n *\n * ```\n * __ |\n * | || This is a block of content that the\n * ¯¯ | button is attached to. This is a\n * | block of content that the button is\n * | attached to.\n * ```\n *\n * The position of the button can be adjusted using the CSS `transform` property:\n *\n * ```css\n * .ck-block-toolbar-button {\n * \ttransform: translateX( -10px );\n * }\n * ```\n *\n * ```\n * __ |\n * | | | This is a block of content that the\n * ¯¯ | button is attached to. This is a\n * | block of content that the button is\n * | attached to.\n * ```\n *\n * **Note**: If you plan to run the editor in a right–to–left (RTL) language, keep in mind the button\n * will be attached to the **right** boundary of the editable area. In that case, make sure the\n * CSS position adjustment works properly by adding the following styles:\n *\n * ```css\n * .ck[dir=\"rtl\"] .ck-block-toolbar-button {\n * \ttransform: translateX( 10px );\n * }\n * ```\n */\nexport default class BlockToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockToolbar';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * An instance of the resize observer that allows to respond to changes in editable's geometry\n * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).\n *\n * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the\n * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.\n *\n * **Note:** Created in {@link #afterInit}.\n */\n this._resizeObserver = null;\n this._blockToolbarConfig = normalizeToolbarConfig(this.editor.config.get('blockToolbar'));\n this.toolbarView = this._createToolbarView();\n this.panelView = this._createPanelView();\n this.buttonView = this._createButtonView();\n // Close the #panelView upon clicking outside of the plugin UI.\n clickOutsideHandler({\n emitter: this.panelView,\n contextElements: [this.panelView.element, this.buttonView.element],\n activator: () => this.panelView.isVisible,\n callback: () => this._hidePanel()\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Hides panel on a direct selection change.\n this.listenTo(editor.model.document.selection, 'change:range', (evt, data) => {\n if (data.directChange) {\n this._hidePanel();\n }\n });\n this.listenTo(editor.ui, 'update', () => this._updateButton());\n // `low` priority is used because of https://github.com/ckeditor/ckeditor5-core/issues/133.\n this.listenTo(editor, 'change:isReadOnly', () => this._updateButton(), { priority: 'low' });\n this.listenTo(editor.ui.focusTracker, 'change:isFocused', () => this._updateButton());\n // Reposition button on resize.\n this.listenTo(this.buttonView, 'change:isVisible', (evt, name, isVisible) => {\n if (isVisible) {\n // Keep correct position of button and panel on window#resize.\n this.buttonView.listenTo(window, 'resize', () => this._updateButton());\n }\n else {\n // Stop repositioning button when is hidden.\n this.buttonView.stopListening(window, 'resize');\n // Hide the panel when the button disappears.\n this._hidePanel();\n }\n });\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(this.toolbarView, {\n beforeFocus: () => this._showPanel(),\n afterBlur: () => this._hidePanel()\n });\n }\n /**\n * Fills the toolbar with its items based on the configuration.\n *\n * **Note:** This needs to be done after all plugins are ready.\n */\n afterInit() {\n const factory = this.editor.ui.componentFactory;\n const config = this._blockToolbarConfig;\n this.toolbarView.fillFromConfig(config, factory);\n // Hide panel before executing each button in the panel.\n for (const item of this.toolbarView.items) {\n item.on('execute', () => this._hidePanel(true), { priority: 'high' });\n }\n if (!config.shouldNotGroupWhenFull) {\n this.listenTo(this.editor, 'ready', () => {\n const editableElement = this.editor.ui.view.editable.element;\n // Set #toolbarView's max-width just after the initialization and update it on the editable resize.\n this._resizeObserver = new ResizeObserver(editableElement, () => {\n this.toolbarView.maxWidth = this._getToolbarMaxWidth();\n });\n });\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n this.panelView.destroy();\n this.buttonView.destroy();\n this.toolbarView.destroy();\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Creates the {@link #toolbarView}.\n */\n _createToolbarView() {\n const t = this.editor.locale.t;\n const shouldGroupWhenFull = !this._blockToolbarConfig.shouldNotGroupWhenFull;\n const toolbarView = new ToolbarView(this.editor.locale, {\n shouldGroupWhenFull,\n isFloating: true\n });\n toolbarView.ariaLabel = t('Editor block content toolbar');\n return toolbarView;\n }\n /**\n * Creates the {@link #panelView}.\n */\n _createPanelView() {\n const editor = this.editor;\n const panelView = new BalloonPanelView(editor.locale);\n panelView.content.add(this.toolbarView);\n panelView.class = 'ck-toolbar-container';\n editor.ui.view.body.add(panelView);\n editor.ui.focusTracker.add(panelView.element);\n // Close #panelView on `Esc` press.\n this.toolbarView.keystrokes.set('Esc', (evt, cancel) => {\n this._hidePanel(true);\n cancel();\n });\n return panelView;\n }\n /**\n * Creates the {@link #buttonView}.\n */\n _createButtonView() {\n const editor = this.editor;\n const t = editor.t;\n const buttonView = new BlockButtonView(editor.locale);\n buttonView.set({\n label: t('Edit block'),\n icon: pilcrow,\n withText: false\n });\n // Bind the panelView observable properties to the buttonView.\n buttonView.bind('isOn').to(this.panelView, 'isVisible');\n buttonView.bind('tooltip').to(this.panelView, 'isVisible', isVisible => !isVisible);\n // Toggle the panelView upon buttonView#execute.\n this.listenTo(buttonView, 'execute', () => {\n if (!this.panelView.isVisible) {\n this._showPanel();\n }\n else {\n this._hidePanel(true);\n }\n });\n editor.ui.view.body.add(buttonView);\n editor.ui.focusTracker.add(buttonView.element);\n return buttonView;\n }\n /**\n * Shows or hides the button.\n * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.\n */\n _updateButton() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n // Hides the button when the editor is not focused.\n if (!editor.ui.focusTracker.isFocused) {\n this._hideButton();\n return;\n }\n // Hides the button when the selection is in non-editable place.\n if (!editor.model.canEditAt(editor.model.document.selection)) {\n this._hideButton();\n return;\n }\n // Get the first selected block, button will be attached to this element.\n const modelTarget = Array.from(model.document.selection.getSelectedBlocks())[0];\n // Hides the button when there is no enabled item in toolbar for the current block element.\n if (!modelTarget || Array.from(this.toolbarView.items).every((item) => !item.isEnabled)) {\n this._hideButton();\n return;\n }\n // Get DOM target element.\n const domTarget = view.domConverter.mapViewToDom(editor.editing.mapper.toViewElement(modelTarget));\n // Show block button.\n this.buttonView.isVisible = true;\n // Attach block button to target DOM element.\n this._attachButtonToElement(domTarget);\n // When panel is opened then refresh it position to be properly aligned with block button.\n if (this.panelView.isVisible) {\n this._showPanel();\n }\n }\n /**\n * Hides the button.\n */\n _hideButton() {\n this.buttonView.isVisible = false;\n }\n /**\n * Shows the {@link #toolbarView} attached to the {@link #buttonView}.\n * If the toolbar is already visible, then it simply repositions it.\n */\n _showPanel() {\n // Usually, the only way to show the toolbar is by pressing the block button. It makes it impossible for\n // the toolbar to show up when the button is invisible (feature does not make sense for the selection then).\n // The toolbar navigation using Alt+F10 does not access the button but shows the panel directly using this method.\n // So we need to check whether this is possible first.\n if (!this.buttonView.isVisible) {\n return;\n }\n const wasVisible = this.panelView.isVisible;\n // So here's the thing: If there was no initial panelView#show() or these two were in different order, the toolbar\n // positioning will break in RTL editors. Weird, right? What you show know is that the toolbar\n // grouping works thanks to:\n //\n // * the ResizeObserver, which kicks in as soon as the toolbar shows up in DOM (becomes visible again).\n // * the observable ToolbarView#maxWidth, which triggers re-grouping when changed.\n //\n // Here are the possible scenarios:\n //\n // 1. (WRONG ❌) If the #maxWidth is set when the toolbar is invisible, it won't affect item grouping (no DOMRects, no grouping).\n // Then, when panelView.pin() is called, the position of the toolbar will be calculated for the old\n // items grouping state, and when finally ResizeObserver kicks in (hey, the toolbar is visible now, right?)\n // it will group/ungroup some items and the length of the toolbar will change. But since in RTL the toolbar\n // is attached on the right side and the positioning uses CSS \"left\", it will result in the toolbar shifting\n // to the left and being displayed in the wrong place.\n // 2. (WRONG ❌) If the panelView.pin() is called first and #maxWidth set next, then basically the story repeats. The balloon\n // calculates the position for the old toolbar grouping state, then the toolbar re-groups items and because\n // it is positioned using CSS \"left\" it will move.\n // 3. (RIGHT ✅) We show the panel first (the toolbar does re-grouping but it does not matter), then the #maxWidth\n // is set allowing the toolbar to re-group again and finally panelView.pin() does the positioning when the\n // items grouping state is stable and final.\n //\n // https://github.com/ckeditor/ckeditor5/issues/6449, https://github.com/ckeditor/ckeditor5/issues/6575\n this.panelView.show();\n this.toolbarView.maxWidth = this._getToolbarMaxWidth();\n this.panelView.pin({\n target: this.buttonView.element,\n limiter: this.editor.ui.getEditableElement()\n });\n if (!wasVisible) {\n this.toolbarView.items.get(0).focus();\n }\n }\n /**\n * Hides the {@link #toolbarView}.\n *\n * @param focusEditable When `true`, the editable will be focused after hiding the panel.\n */\n _hidePanel(focusEditable) {\n this.panelView.isVisible = false;\n if (focusEditable) {\n this.editor.editing.view.focus();\n }\n }\n /**\n * Attaches the {@link #buttonView} to the target block of content.\n *\n * @param targetElement Target element.\n */\n _attachButtonToElement(targetElement) {\n const contentStyles = window.getComputedStyle(targetElement);\n const editableRect = new Rect(this.editor.ui.getEditableElement());\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n // When line height is not an integer then thread it as \"normal\".\n // MDN says that 'normal' == ~1.2 on desktop browsers.\n const contentLineHeight = parseInt(contentStyles.lineHeight, 10) || parseInt(contentStyles.fontSize, 10) * 1.2;\n const position = getOptimalPosition({\n element: this.buttonView.element,\n target: targetElement,\n positions: [\n (contentRect, buttonRect) => {\n let left;\n if (this.editor.locale.uiLanguageDirection === 'ltr') {\n left = editableRect.left - buttonRect.width;\n }\n else {\n left = editableRect.right;\n }\n return {\n top: contentRect.top + contentPaddingTop + (contentLineHeight - buttonRect.height) / 2,\n left\n };\n }\n ]\n });\n this.buttonView.top = position.top;\n this.buttonView.left = position.left;\n }\n /**\n * Gets the {@link #toolbarView} max-width, based on\n * editable width plus distance between farthest edge of the {@link #buttonView} and the editable.\n *\n * @returns A maximum width that toolbar can have, in pixels.\n */\n _getToolbarMaxWidth() {\n const editableElement = this.editor.ui.view.editable.element;\n const editableRect = new Rect(editableElement);\n const buttonRect = new Rect(this.buttonView.element);\n const isRTL = this.editor.locale.uiLanguageDirection === 'rtl';\n const offset = isRTL ? (buttonRect.left - editableRect.right) + buttonRect.width : editableRect.left - buttonRect.left;\n return toPx(editableRect.width + offset);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { EditorUI, normalizeToolbarConfig } from 'ckeditor5/src/ui';\nimport { enablePlaceholder } from 'ckeditor5/src/engine';\nimport { ElementReplacer } from 'ckeditor5/src/utils';\n/**\n * The classic editor UI class.\n */\nexport default class ClassicEditorUI extends EditorUI {\n /**\n * Creates an instance of the classic editor UI class.\n *\n * @param editor The editor instance.\n * @param view The view of the UI.\n */\n constructor(editor, view) {\n super(editor);\n this.view = view;\n this._toolbarConfig = normalizeToolbarConfig(editor.config.get('toolbar'));\n this._elementReplacer = new ElementReplacer();\n }\n /**\n * @inheritDoc\n */\n get element() {\n return this.view.element;\n }\n /**\n * Initializes the UI.\n *\n * @param replacementElement The DOM element that will be the source for the created editor.\n */\n init(replacementElement) {\n const editor = this.editor;\n const view = this.view;\n const editingView = editor.editing.view;\n const editable = view.editable;\n const editingRoot = editingView.document.getRoot();\n // The editable UI and editing root should share the same name. Then name is used\n // to recognize the particular editable, for instance in ARIA attributes.\n editable.name = editingRoot.rootName;\n view.render();\n // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.\n // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().\n const editableElement = editable.element;\n // Register the editable UI view in the editor. A single editor instance can aggregate multiple\n // editable areas (roots) but the classic editor has only one.\n this.setEditableElement(editable.name, editableElement);\n // Let the editable UI element respond to the changes in the global editor focus\n // tracker. It has been added to the same tracker a few lines above but, in reality, there are\n // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long\n // as they have focus, the editable should act like it is focused too (although technically\n // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.\n // Doing otherwise will result in editable focus styles disappearing, once e.g. the\n // toolbar gets focused.\n view.editable.bind('isFocused').to(this.focusTracker);\n // Bind the editable UI element to the editing view, making it an end– and entry–point\n // of the editor's engine. This is where the engine meets the UI.\n editingView.attachDomRoot(editableElement);\n // If an element containing the initial data of the editor was provided, replace it with\n // an editor instance's UI in DOM until the editor is destroyed. For instance, a